Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yserz committed Mar 12, 2019
2 parents 96120a1 + 68bbcb7 commit e7791fd
Show file tree
Hide file tree
Showing 10 changed files with 595 additions and 403 deletions.
19 changes: 19 additions & 0 deletions .copyconfigrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const pkg = require('./package.json');
const {execSync} = require('child_process');
const path = require('path');

const source = path.join(pkg.name, 'content');
const currentBranch = execSync(`git rev-parse --abbrev-ref HEAD`)
.toString()
.trim();
const configurationEntry = `wire-web-config-default-${currentBranch === 'master' ? 'master' : 'staging'}`;
const repositoryUrl = pkg.dependencies[configurationEntry];

module.exports = {
files: {
[`${source}/image/**`]: './dist/templates/image/',
[`${source}/translation/**`]: './dist/translation/',
[path.join(pkg.name, '.env.defaults')]: path.join(__dirname, '.env.defaults'),
},
repositoryUrl,
};
1 change: 0 additions & 1 deletion .env

This file was deleted.

32 changes: 0 additions & 32 deletions .env.defaults

This file was deleted.

11 changes: 11 additions & 0 deletions .env.localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://github.com/wireapp/wire-account/wiki/Self-hosting

NODE_ENV="development"
NODE_DEBUG="@wireapp/*"
PORT="8081"

APP_BASE="http://localhost:8081"
FEATURE_ENFORCE_HTTPS="false"

CSP_EXTRA_CONNECT_SRC="http://localhost:35729, ws://localhost:35729"
CSP_EXTRA_SCRIPT_SRC="http://localhost:35729"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package-lock.json
yarn-error.log

# Configuration imported from https://github.com/wireapp/wire-web-config-default/
.env
.env.defaults
/config
dist/templates/image
dist/translation
6 changes: 5 additions & 1 deletion app/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ function parseCommaSeparatedList(list: string = ''): string[] {

function mergedCSP(): HelmetCSP {
const csp: HelmetCSP = {
connectSrc: [...defaultCSP.connectSrc, ...parseCommaSeparatedList(process.env.CSP_EXTRA_CONNECT_SRC)],
connectSrc: [
...defaultCSP.connectSrc,
process.env.BACKEND_REST,
...parseCommaSeparatedList(process.env.CSP_EXTRA_CONNECT_SRC),
],
defaultSrc: [...defaultCSP.defaultSrc, ...parseCommaSeparatedList(process.env.CSP_EXTRA_DEFAULT_SRC)],
fontSrc: [...defaultCSP.fontSrc, ...parseCommaSeparatedList(process.env.CSP_EXTRA_FONT_SRC)],
frameSrc: [...defaultCSP.frameSrc, ...parseCommaSeparatedList(process.env.CSP_EXTRA_FRAME_SRC)],
Expand Down
77 changes: 0 additions & 77 deletions bin/configure.js

This file was deleted.

2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ gulp.task('version', function(done) {

gulp.task('zip', function() {
return gulp
.src(['package.json', 'dist/**/*', '!dist/*.zip'], {dot: true, nodir: true})
.src(['package.json', '.env.defaults', 'dist/**/*', '!dist/*.zip'], {dot: true, nodir: true})
.pipe($.zip('wire-account.zip'))
.pipe(gulp.dest('dist'));
});
Expand Down
42 changes: 22 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"dependencies": {
"@wireapp/commons": "1.0.4",
"@wireapp/commons": "1.0.11",
"axios": "0.18.0",
"dotenv": "6.2.0",
"dotenv-extended": "2.3.0",
"dotenv-extended": "2.4.0",
"express": "4.16.4",
"express-formidable": "1.2.0",
"express-useragent": "1.0.12",
"fs-extra": "7.0.1",
"helmet": "3.15.1",
"i18next": "15.0.1",
"i18next": "15.0.5",
"i18next-express-middleware": "1.7.1",
"i18next-node-fs-backend": "2.1.1",
"intl": "1.2.5",
Expand All @@ -19,30 +19,32 @@
"normalize.css": "8.0.1",
"nunjucks": "3.1.7",
"nunjucks-autoescape": "1.0.1",
"pm2": "3.2.9",
"wire-web-config-default": "https://github.com/wireapp/wire-web-config-default#v0.10.1"
"pm2": "3.3.1",
"wire-web-config-default-master": "https://github.com/wireapp/wire-web-config-wire#v0.14.0",
"wire-web-config-default-staging": "https://github.com/wireapp/wire-web-config-default#v0.14.0"
},
"devDependencies": {
"@types/dotenv": "6.1.0",
"@types/express": "4.16.1",
"@types/express-formidable": "1.0.3",
"@types/express-useragent": "0.2.21",
"@types/fs-extra": "5.0.4",
"@types/fs-extra": "5.0.5",
"@types/helmet": "0.0.42",
"@types/i18next": "12.1.0",
"@types/i18next-node-fs-backend": "0.0.30",
"@types/jasmine": "3.3.8",
"@types/node": "10.12.24",
"@types/nunjucks": "3.1.0",
"@types/jasmine": "3.3.9",
"@types/node": "11.9.5",
"@types/nunjucks": "3.1.1",
"@wireapp/copy-config": "0.3.1",
"babel-eslint": "10.0.1",
"concurrently": "4.1.0",
"cross-env": "5.2.0",
"del": "3.0.0",
"eslint": "5.13.0",
"eslint-config-prettier": "4.0.0",
"del": "4.0.0",
"eslint": "5.15.1",
"eslint-config-prettier": "4.1.0",
"eslint-plugin-es5": "1.3.1",
"eslint-plugin-jasmine": "2.10.1",
"eslint-plugin-jsdoc": "4.1.0",
"eslint-plugin-jsdoc": "4.1.1",
"eslint-plugin-no-unsanitized": "3.0.2",
"eslint-plugin-prettier": "3.0.1",
"gulp": "4.0.0",
Expand All @@ -55,22 +57,22 @@
"gulp-plumber": "1.2.1",
"gulp-sequence": "1.0.0",
"gulp-size": "3.0.0",
"gulp-sourcemaps": "2.6.4",
"gulp-uglify": "3.0.1",
"gulp-sourcemaps": "2.6.5",
"gulp-uglify": "3.0.2",
"gulp-util": "3.0.8",
"gulp-zip": "4.2.0",
"husky": "1.3.1",
"i18next-scanner": "2.9.1",
"i18next-scanner": "2.9.2",
"jasmine": "3.3.1",
"less": "3.9.0",
"lint-staged": "8.1.3",
"lint-staged": "8.1.5",
"nodemon": "1.18.10",
"prettier": "1.16.4",
"tslint": "5.12.1",
"tslint": "5.13.1",
"tslint-config-prettier": "1.18.0",
"tslint-eslint-rules": "5.4.0",
"tslint-plugin-prettier": "2.0.1",
"typescript": "3.3.3",
"typescript": "3.3.3333",
"uglify-js": "3.4.9"
},
"husky": {
Expand Down Expand Up @@ -108,7 +110,7 @@
"lint:other": "yarn prettier --list-different",
"lint:ts": "tslint --config tslint.json --project tsconfig.json \"**/*.ts\"",
"lint": "yarn lint:js && yarn lint:other",
"postinstall": "yarn configure",
"postinstall": "copy-config",
"prettier": "prettier \"**/*.{json,less,md,yml}\"",
"start:prod": "pm2 start \"./index.js\" --name \"Wire Account Management\" && pm2 logs",
"start": "yarn build:server && concurrently \"gulp watch\" \"yarn build:server --w\" \"nodemon ./dist/index.js\"",
Expand Down
Loading

0 comments on commit e7791fd

Please sign in to comment.