Skip to content

Commit

Permalink
Merge pull request #45 from CBIIT/release-v2.2.1
Browse files Browse the repository at this point in the history
Release v2.2.1
  • Loading branch information
fmanuelos authored Aug 11, 2020
2 parents b37af03 + b24b87f commit 54931a1
Show file tree
Hide file tree
Showing 15 changed files with 4,364 additions and 2,199 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ node_modules
npm-debug.log
client/static/dist
gdc-docs
geckodriver.exe
geckodriver.exe
.env
.vscode
7 changes: 3 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ var config = require('./server/config');
var logger = require('./server/components/logger');
var app = express();


require('./server/config/express')(app);
require('./routes')(app);

app.listen(config.port, function(){
logger.info('GDCMVS listening on port :' + config.port);
});
app.listen(config.port, () => {
logger.info('GDCMVS listening on port :' + config.port);
});
6 changes: 3 additions & 3 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<% include views/header.html %>
<%- include('views/header.html'); -%>

<% include views/body.html %>
<%- include('views/body.html'); -%>

<% include views/footer.html %>
<%- include('views/footer.html'); -%>
5,772 changes: 3,855 additions & 1,917 deletions package-lock.json

Large diffs are not rendered by default.

53 changes: 27 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gdcmvs",
"version": "v2.2.0",
"version": "v2.2.1",
"description": "GDC Metadata Validation Services",
"main": "app.js",
"scripts": {
Expand All @@ -21,42 +21,43 @@
},
"dependencies": {
"body-parser": "^1.18.3",
"commander": "^2.20.1",
"commander": "^5.1.0",
"compression": "^1.7.3",
"cookie-parser": "^1.4.3",
"ejs": "^2.7.1",
"cookie-parser": "^1.4.5",
"dotenv": "^8.2.0",
"ejs": "^3.1.3",
"elasticsearch": "^15.2.0",
"express": "^4.17.1",
"googleapis": "^27.0.0",
"helmet": "^3.21.1",
"lodash": "^4.17.15",
"method-override": "^2.3.10",
"morgan": "^1.9.1",
"googleapis": "^54.1.0",
"helmet": "^3.23.3",
"lodash": "^4.17.19",
"method-override": "^3.0.0",
"morgan": "^1.10.0",
"node-fetch": "^2.6.0",
"rotating-file-stream": "^1.4.4",
"swagger-ui-express": "^4.1.2",
"rotating-file-stream": "^2.1.3",
"swagger-ui-express": "^4.1.4",
"winston": "^2.4.4",
"winston-daily-rotate-file": "^1.7.2",
"yamljs": "^0.2.10"
"yamljs": "^0.3.0"
},
"devDependencies": {
"@babel/core": "^7.6.3",
"@babel/preset-env": "^7.6.3",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"clean-webpack-plugin": "^2.0.2",
"css-loader": "^2.1.1",
"eslint": "^5.16.0",
"eslint-loader": "^2.2.1",
"@babel/core": "^7.10.5",
"@babel/preset-env": "^7.10.4",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^3.6.0",
"eslint": "^7.4.0",
"eslint-loader": "^4.0.2",
"filemanager-webpack-plugin": "^2.0.5",
"mini-css-extract-plugin": "^0.6.0",
"mocha": "^5.2.0",
"mini-css-extract-plugin": "^0.9.0",
"mocha": "^8.0.1",
"node-excel-export": "^1.4.4",
"node-xlsx": "^0.12.1",
"node-xlsx": "^0.15.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"selenium-webdriver": "^3.5.0",
"style-loader": "^0.23.1",
"webpack": "^4.41.0",
"webpack-cli": "^3.3.9"
"style-loader": "^1.2.1",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12"
}
}
2 changes: 1 addition & 1 deletion routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ module.exports = function (app) {
app.get('*', function (req, res) {
res.status(404).sendFile(app.get('views') + '/404.html');
});
};
};
36 changes: 17 additions & 19 deletions server/components/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,29 @@
* back-end logger for application
*/

'use strict';

const winston = require('winston');
const config = require('../config');
winston.emitErrs = true;

const tsFormat = () => (new Date()).toLocaleTimeString();

var logger = new winston.Logger({
transports: [
new (require('winston-daily-rotate-file'))({
filename: config.logDir + '/-warning.log',
timestamp: tsFormat,
datePattern: 'yyyy-MM-dd',
prepend: true,
level: 'warn'
}),
new winston.transports.Console({
level: 'debug',
handleExceptions: true,
json: false,
colorize: true
})
],
exitOnError: false
transports: [
new (require('winston-daily-rotate-file'))({
filename: config.logDir + '/-warning.log',
timestamp: tsFormat,
datePattern: 'yyyy-MM-dd',
prepend: true,
level: 'warn'
}),
new winston.transports.Console({
level: 'debug',
handleExceptions: true,
json: false,
colorize: true
})
],
exitOnError: false
});

module.exports = logger;
module.exports = logger;
76 changes: 37 additions & 39 deletions server/config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,40 @@ const fs = require('fs');
const rfs = require('rotating-file-stream');

module.exports = app => {

let env = config.env;

app.set('views', config.root + '/client');
app.engine('html', require('ejs').renderFile);
app.set('view engine', 'html');
app.use(compression());
app.use(bodyParser.urlencoded({
limit: '4mb', // 100kb default is too small
extended: false
}));
app.use(bodyParser.json({
limit: '4mb' // 100kb default is too small
}));
app.use(methodOverride());
app.use(cookieParser());
app.use(express.static(path.join(config.root, 'client/static')));
app.set('viewPath', 'client');

if ('dev' === env) {
app.use(morgan('dev'));
}
else if('prod' === env || 'test' === env){
let logDirectory = config.logDir;

// ensure log directory exists
fs.existsSync(logDirectory) || fs.mkdirSync(logDirectory);

// create a rotating write stream
var accessLogStream = rfs('access.log', {
interval: '1d', // rotate daily
path: logDirectory
})

morgan.format('log-format', ':remote-addr - - [:date[clf]] ":method :url HTTP/:http-version" :status ":referrer" ":user-agent"');
// setup the logger
app.use(morgan('log-format', {stream: accessLogStream}));
}
};
let env = config.env;

app.set('views', config.root + '/client');
app.engine('html', require('ejs').renderFile);
app.set('view engine', 'html');
app.use(compression());
app.use(bodyParser.urlencoded({
limit: '4mb', // 100kb default is too small
extended: false
}));
app.use(bodyParser.json({
limit: '4mb' // 100kb default is too small
}));
app.use(methodOverride());
app.use(cookieParser());
app.use(express.static(path.join(config.root, 'client/static')));
app.set('viewPath', 'client');

if (env === 'dev') {
app.use(morgan('dev'));
} else if (env === 'prod' || env === 'test') {
let logDirectory = config.logDir;

// ensure log directory exists
fs.existsSync(logDirectory) || fs.mkdirSync(logDirectory);

// create a rotating write stream
var accessLogStream = rfs.createStream('access.log', {
interval: '1d', // rotate daily
path: logDirectory
});

morgan.format('log-format', ':remote-addr - - [:date[clf]] ":method :url HTTP/:http-version" :status ":referrer" ":user-agent"');
// setup the logger
app.use(morgan('log-format', { stream: accessLogStream }));
}
};
112 changes: 58 additions & 54 deletions server/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,64 @@
const path = require('path');
const _ = require('lodash');

if (process.env.NODE_ENV !== 'prod') {
require('dotenv').config();
};

const all = {
// Root path of server
root: path.normalize(__dirname + '/../..'),

// Server port
port: process.env.PORT || 3000,

// Server port
logDir: process.env.LOGDIR || '/local/content/mvs/logs',

// Node environment (dev, test, stage, prod), must select one.
env: process.env.NODE_ENV || 'prod',

//general gdc index name
indexName: 'gdc',

//suggestion index name for typeahead
suggestionName: 'gdc-suggestion',

//NCIT details index name;
ncitDetails: 'ncit-details',

//index name for properties
index_p: 'gdc-p',

//index name for values
index_v: 'gdc-v',

// GDC searchable nodes
searchable_nodes : ["case", "demographic", "diagnosis", "exposure", "family_history", "follow_up", "molecular_test",
"treatment", "slide", "sample", "read_group", "portion", "analyte", "aliquot", "slide_image", "analysis_metadata",
"clinical_supplement", "experiment_metadata", "pathology_detail", "pathology_report", "run_metadata", "biospecimen_supplement",
"submitted_aligned_reads", "submitted_genomic_profile", "submitted_methylation_beta_value", "submitted_tangent_copy_number",
"submitted_unaligned_reads", "data_release", "root"
],

// GDC drugs properties
drugs_properties : ["therapeutic_agents"],

//get data from caDSR
caDSR_url:[
"https://cdebrowser.nci.nih.gov/cdebrowserServer/rest/search?publicId=",
"https://cdebrowser.nci.nih.gov/cdebrowserServer/rest/CDEData?deIdseq="
],

//get synonyms from NCIt
NCIt_url: [
'https://ncit.nci.nih.gov/ncitbrowser/pages/concept_details.jsf?dictionary=NCI_Thesaurus&code=',
'https://ncit.nci.nih.gov/ncitbrowser/pages/concept_details.jsf?dictionary=NCI_Thesaurus&type=synonym&code=',
'http://nciws-d790.nci.nih.gov:15080/evsrestapi2/api/v1/ctrp/concept/',
'https://ncit.nci.nih.gov/ncitbrowser/pages/concept_details.jsf?dictionary=CTCAE&type=synonym&code=',
'https://evsrestapi.nci.nih.gov/evsrestapi/api/v1/ctrp/concept/',
'https://evsrestapi-stage.nci.nih.gov/evsrestapi/api/v1/conceptList?db=weekly&properties=Code,Preferred_Name,FULL_SYN,DEFINITION&concepts='
]
// Root path of server
root: path.resolve(__dirname, '../../'),

// Server port
port: process.env.PORT || 3000,

// Server port
logDir: process.env.LOGDIR || '/local/content/mvs/logs',

// Node environment (dev, test, stage, prod), must select one.
env: process.env.NODE_ENV || 'prod',

// general gdc index name
indexName: 'gdc',

// suggestion index name for typeahead
suggestionName: 'gdc-suggestion',

// NCIT details index name;
ncitDetails: 'ncit-details',

// index name for properties
index_p: 'gdc-p',

// index name for values
index_v: 'gdc-v',

// GDC searchable nodes
searchable_nodes: ['case', 'demographic', 'diagnosis', 'exposure', 'family_history', 'follow_up', 'molecular_test',
'treatment', 'slide', 'sample', 'read_group', 'portion', 'analyte', 'aliquot', 'slide_image', 'analysis_metadata',
'clinical_supplement', 'experiment_metadata', 'pathology_detail', 'pathology_report', 'run_metadata', 'biospecimen_supplement',
'submitted_aligned_reads', 'submitted_genomic_profile', 'submitted_methylation_beta_value', 'submitted_tangent_copy_number',
'submitted_unaligned_reads', 'data_release', 'root'
],

// GDC drugs properties
drugs_properties: ['therapeutic_agents'],

// get data from caDSR
caDSR_url: [
'https://cdebrowser.nci.nih.gov/cdebrowserServer/rest/search?publicId=',
'https://cdebrowser.nci.nih.gov/cdebrowserServer/rest/CDEData?deIdseq='
],

// get synonyms from NCIt
NCIt_url: [
'https://ncit.nci.nih.gov/ncitbrowser/pages/concept_details.jsf?dictionary=NCI_Thesaurus&code=',
'https://ncit.nci.nih.gov/ncitbrowser/pages/concept_details.jsf?dictionary=NCI_Thesaurus&type=synonym&code=',
'http://nciws-d790.nci.nih.gov:15080/evsrestapi2/api/v1/ctrp/concept/',
'https://ncit.nci.nih.gov/ncitbrowser/pages/concept_details.jsf?dictionary=CTCAE&type=synonym&code=',
'https://evsrestapi.nci.nih.gov/evsrestapi/api/v1/ctrp/concept/',
'https://evsrestapi-stage.nci.nih.gov/evsrestapi/api/v1/conceptList?db=weekly&properties=Code,Preferred_Name,FULL_SYN,DEFINITION&concepts='
]
};

module.exports = _.merge(all, require('./' + all.env + '.js'));
module.exports = _.merge(all, require('./' + all.env + '.js'));
Loading

0 comments on commit 54931a1

Please sign in to comment.