Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Swagger documentation and review gulpfile #555

Open
wants to merge 38 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a534dc0
Build swagger.json as part of webpack.make.js when running npm run bu…
tschaffter Sep 24, 2019
ce8f372
Fix gulp default task
tschaffter Sep 25, 2019
10b4e0d
WIP Define gulp tasks to set env vars from file (remove the need to s…
tschaffter Sep 25, 2019
7697ad6
WIP Loading envvars using dotenv instead of gulp-env
tschaffter Sep 26, 2019
0a94e15
Finalize tasks env:prod and env:test
tschaffter Sep 26, 2019
7b4ce16
Moving to more flexible env vars files
tschaffter Sep 26, 2019
521b959
Review build process up to build:images
tschaffter Sep 26, 2019
b4e59f1
Untrack config files
tschaffter Sep 26, 2019
877480d
Complete review of gulp task build (webpack compile review not covered)
tschaffter Sep 26, 2019
a4ff77d
WIP on start:server:prod, crash because SSL certificates are not load…
tschaffter Sep 26, 2019
c33116b
Add env:ssl task to gulp
tschaffter Sep 26, 2019
8e55d0d
Distribution server can be started with gulp serve:dist
tschaffter Sep 26, 2019
f667685
Complete review of the gulp task serve:dist
tschaffter Sep 26, 2019
e6fc8e3
Remove font-awesome, fix gulp task lint:server and lint:server:test
tschaffter Sep 26, 2019
62a5a0d
Add gulp task lint:client:ts
tschaffter Sep 27, 2019
ff57b70
Add lint:client:html
tschaffter Sep 27, 2019
9ccd6eb
Complete gulp task lint
tschaffter Sep 27, 2019
2bfb5c5
Add gulp task test:server
tschaffter Sep 27, 2019
fc13cf6
Add gulp task test
tschaffter Sep 27, 2019
69fa3fd
Review npm cover task, remove references to coverage in gulp file
tschaffter Sep 27, 2019
2b4c9ac
Add gulp task init:ssl:server, init:ssl:mongodb, init:ssl and init
tschaffter Sep 27, 2019
20ecca9
Add gulp tasks init:config:dev, init:config:prod, init:config
tschaffter Sep 28, 2019
cc41c64
Cleanup import in gul pfile
tschaffter Sep 28, 2019
22fabe8
Update the config files
tschaffter Sep 28, 2019
5737e62
Portal can be started with gulp and gulp serve:dist, work in progress
tschaffter Sep 28, 2019
2f4d43f
The command sudo gulp serve:dev now works to star the portal in dev e…
tschaffter Sep 28, 2019
0dc7bc3
Minor update
tschaffter Sep 28, 2019
b2d5b90
Review of webpack.make.js in progress (done up to devtool)
tschaffter Sep 28, 2019
a13d594
Review of babel-loader completed
tschaffter Sep 28, 2019
a03fced
Review asset and html loader, replace awesome-typescript-loader by th…
tschaffter Sep 28, 2019
b92d4d2
Work on webpack.make.js, next is to take care of swagger compilate
tschaffter Sep 29, 2019
d553b7a
Remove old config files
tschaffter Sep 29, 2019
ea3d291
Reviewed css injection, add comment to webpack.make.js
tschaffter Sep 30, 2019
c5efe73
Remove webpack:dev from serve:dev
tschaffter Sep 30, 2019
750dd87
Comment out copy:fonts which is not used for now
tschaffter Sep 30, 2019
1e49dcc
Remove reference to localEnv
tschaffter Sep 30, 2019
aa4b5d5
Add a few more comments to webpack.make.js
tschaffter Sep 30, 2019
6097a0e
Add prototype of gulp task to run docker-compose
tschaffter Sep 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moving to more flexible env vars files
  • Loading branch information
tschaffter committed Sep 26, 2019
commit 7b4ce16620add77d1ac76d48023203ddca462f60
72 changes: 72 additions & 0 deletions config/default.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# MONGODB
MONGO_PORT=27017
MONGO_INITDB_ROOT_USERNAME=
MONGO_INITDB_ROOT_PASSWORD=
## Configuring for the portal
MONGO_INITDB_DATABASE=phccp-dev
MONGO_USERNAME=
MONGO_PASSWORD=

# PORTAL
NODE_ENV=development
CLIENT_PORT=443
PORT=
DOMAIN=https://localhost

## Session secret
SESSION_SECRET=phccp-secret

## Configuring SSL
SSL_KEY=`cat ./certs/server.key`
SSL_CERT=`cat ./certs/server.cert`

## Configuring connection with MongoDB
MONGODB_PROTOCOL=mongodb
MONGODB_IP=localhost
MONGODB_PORT=${MONGO_PORT}
MONGODB_PATH=/${MONGO_INITDB_DATABASE}
MONGODB_USER=
MONGODB_PASSWORD=
MONGODB_SSL=
MONGODB_SSL_VALIDATE= # Set to false when using self-signed certificate
MONGODB_SSL_CA= # Content of CA's certificate (not the path)
MONGODB_SSL_KEY= # Content of the key (default: read ./certs/server.key)
MONGODB_SSL_CERT= # Content of the certificate (default: read ./certs/server.cert)

## Initialization (credentials works with local and SSO auth strategies)
[email protected]
APP_INIT_ADMIN_PASSWORD=admin
APP_INIT_DB_SEED_NAME=development

## CONTACT_US_URL=https://sagebionetworks.org

## Enabling local authentication
AUTH_LOCAL=true

## Enabling Google OAuth 2.0
OAUTH_GOOGLE_ID=
OAUTH_GOOGLE_SECRET=

## Enabling Google SAML
SAML_GOOGLE_ENTRY_POINT=
SAML_GOOGLE_ISSUER=

## Enabling Microsoft Azure AD OpenID Connect (demo)
AZUREAD_OPENIDCONNECT_IDENTITY_METADATA=
AZUREAD_OPENIDCONNECT_CLIENT_ID=
AZUREAD_OPENIDCONNECT_CLIENT_SECRET=

## Enabling Roche Azure AD
ROCHE_AZURE_AD_IDENTITY_METADATA=
ROCHE_AZURE_AD_CLIENT_ID=
ROCHE_AZURE_AD_CLIENT_SECRET=

# NEO4J
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=neo4jpassword

# PROVENANCE
PROVENANCE_API_SERVER_PROTOCOL=http
PROVENANCE_API_SERVER_IP=localhost
PROVENANCE_API_SERVER_PORT=8080
PROVENANCE_API_SERVER_PATH=/rest/v1
Empty file added config/development.env
Empty file.
68 changes: 68 additions & 0 deletions config/production.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,70 @@
# MONGODB
MONGO_PORT=27017
MONGO_INITDB_ROOT_USERNAME=admin
MONGO_INITDB_ROOT_PASSWORD=password
## Configuring for the portal
MONGO_INITDB_DATABASE=phccp
MONGO_USERNAME= # app
MONGO_PASSWORD= # app123

# PORTAL
NODE_ENV=production
CLIENT_PORT=
PORT=443
DOMAIN=https://localhost

## Session secret
SESSION_SECRET=phccp-secret

## Configuring SSL
SSL_KEY=`cat ./certs/server.key`
SSL_CERT=`cat ./certs/server.cert`

## Configuring connection with MongoDB
MONGODB_PROTOCOL=mongodb
MONGODB_IP=localhost
MONGODB_PORT=${MONGO_PORT}
MONGODB_PATH=/${MONGO_INITDB_DATABASE}
MONGODB_USER=${MONGO_USERNAME}
MONGODB_PASSWORD=${MONGO_PASSWORD}
MONGODB_SSL=false # true
MONGODB_SSL_VALIDATE=false # Set to false when using self-signed certificate
MONGODB_SSL_CA= # Content of CA's certificate
MONGODB_SSL_KEY= #`cat ./certs/server.key` # Content of the key (default: read ./certs/server.key)
MONGODB_SSL_CERT= #`cat ./certs/server.cert` # Content of the certificate (default: read ./certs/server.cert)

## Initialization (credentials works with local and SSO auth strategies)
[email protected]
APP_INIT_ADMIN_PASSWORD=admin
APP_INIT_DB_SEED_NAME=default

## Enabling local authentication
AUTH_LOCAL=true

## Enabling Google OAuth 2.0
OAUTH_GOOGLE_ID=
OAUTH_GOOGLE_SECRET=

## Enabling Google SAML
SAML_GOOGLE_ENTRY_POINT=
SAML_GOOGLE_ISSUER=

## Enabling Microsoft Azure AD OpenID Connect (demo)
AZUREAD_OPENIDCONNECT_IDENTITY_METADATA=
AZUREAD_OPENIDCONNECT_CLIENT_ID=
AZUREAD_OPENIDCONNECT_CLIENT_SECRET=

## Enabling Roche Azure AD
ROCHE_AZURE_AD_IDENTITY_METADATA=
ROCHE_AZURE_AD_CLIENT_ID=
ROCHE_AZURE_AD_CLIENT_SECRET=

# NEO4J
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=neo4jpassword

# PROVENANCE
PROVENANCE_API_SERVER_PROTOCOL=http
PROVENANCE_API_SERVER_IP=localhost
PROVENANCE_API_SERVER_PORT=8080
PROVENANCE_API_SERVER_PATH=/rest/v1
2 changes: 0 additions & 2 deletions config/production.sample.env
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# MONGODB
MONGO_PORT=27017
23 changes: 9 additions & 14 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -190,29 +190,24 @@ let mocha = lazypipe().pipe(
* Env
********************/

// gulp.task('env:all', cb => {
// let localConfig;
// try {
// localConfig = require(`./${serverPath}/config/local.env`);
// } catch (e) {
// localConfig = {};
// }
// plugins.env({
// vars: localConfig,
// });
// cb();
// });
/**
* Sets the default env vars.
*/
gulp.task('env:default', done => {
readConfig('config/default.env');
done();
});

/**
* Sets NODE_ENV to 'test' in process.env.
* Sets the env vars specific to the test environment.
*/
gulp.task('env:test', done => {
process.env.NODE_ENV = 'test';
done();
});

/**
* Sets NODE_ENV to 'production' in process.env.
* Sets the env vars specific to the production environment.
*/
gulp.task('env:prod', done => {
readConfig('config/production.env');