Skip to content

Commit 90b459e

Browse files
authored
Merge pull request #71 from chrescobar/test
test -> main (v0.2.11 upstream)
2 parents 0e0623e + 7d056e1 commit 90b459e

168 files changed

Lines changed: 14687 additions & 1629 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ app.use(favicon(path.join(__dirname, '/public/favicon.ico')));
3636
app.use(logger('dev'));
3737
app.use(cookieParser(config.get('cookieSecret')));
3838

39+
const proxyConfig = config.get('proxyConfig');
40+
if (proxyConfig) {
41+
const proxy = require("express-http-proxy");
42+
var prox;
43+
44+
for (const prox of proxyConfig) {
45+
console.log(prox);
46+
app.use(prox.local, proxy(prox.site, {
47+
proxyReqPathResolver: req => req.originalUrl.replace(prox.local, ""),
48+
https: true
49+
}));
50+
}
51+
}
52+
3953
app.use(function (req, res, next) {
4054
// console.log("Config.production: ", config.production);
4155
// console.log("Session Data: ", req.session);
@@ -52,6 +66,7 @@ app.use(function (req, res, next) {
5266
probModelSeedServiceURL: config.get('probModelSeedServiceURL'), // for dashboard
5367
shockServiceURL: config.get('shockServiceURL'), // for dashboard
5468
workspaceServiceURL: config.get('workspaceServiceURL'),
69+
workspaceDownloadServiceURL: config.get('workspaceDownloadServiceURL'),
5570
appBaseURL: config.get('appBaseURL'),
5671
appServiceURL: config.get('appServiceURL'),
5772
dataServiceURL: config.get('dataServiceURL'),
@@ -66,6 +81,8 @@ app.use(function (req, res, next) {
6681
jiraLabel: config.get('jiraLabel'),
6782
appVersion: packageJSON.version,
6883
userServiceURL: config.get('userServiceURL'),
84+
copilotApiURL: config.get('copilotApiURL'),
85+
copilotDbURL: config.get('copilotDbURL'),
6986
localStorageCheckInterval: config.get('localStorageCheckInterval')
7087
};
7188
// console.log("Application Options: ", req.applicationOptions);

bin/p3-web

100644100755
Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
#!/usr/bin/env node
2+
3+
const https = require('https');
4+
const fs = require('fs');
5+
26
var debug = require('debug')('p3-web');
37
var app = require('../app');
48
var conf = require('../config');
59

610
debug('Launching p3-web...');
711

8-
app.set('port', conf.get('http_port') || 7032);
12+
app.set('port', conf.get('http_port') || 3000);
913

10-
var server = app.listen(app.get('port'), function () {
11-
debug('Express server listening on port ' + server.address().port);
12-
});
14+
const sslConfig = conf.get('sslConfig');
15+
var server;
1316

17+
if (sslConfig) {
18+
// Read SSL cert and key
19+
const sslOptions = {
20+
key: fs.readFileSync(sslConfig.ssl_key),
21+
cert: fs.readFileSync(sslConfig.ssl_cert)
22+
};
23+
server = https.createServer(sslOptions, app).listen(app.get('port'), function () {
24+
debug('Express server listening on SSL port ' + server.address().port);
25+
});
26+
}
27+
else {
28+
server = app.listen(app.get('port'), function () {
29+
debug('Express server listening on port ' + server.address().port);
30+
});
31+
}

config-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const defaults = {
1919
'shockServiceURL': 'https://p3.theseed.org/services/shock_api', // only for status dashboard
2020
dataServiceURL: 'https://p3.theseed.org/services/data_api',
2121
accountURL: 'http://user.patric.local:3002/',
22-
docsServiceURL: 'https://bv-brc.org/docs/',
22+
docsServiceURL: 'https://www.dxkb.org/docs/',
2323
userServiceURL: '',
2424
localStorageCheckInterval: 86400,
2525
enableDevTools: false,

config-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const defaults = {
1919
'shockServiceURL': 'https://p3.theseed.org/services/shock_api', // only for status dashboard
2020
dataServiceURL: 'https://p3.theseed.org/services/data_api',
2121
accountURL: 'http://user.patric.local:3002/',
22-
docsServiceURL: 'https://bv-brc.org/docs/',
22+
docsServiceURL: 'https://www.dxkb.org/docs/',
2323
userServiceURL: '',
2424
localStorageCheckInterval: 86400,
2525
enableDevTools: false,

config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ const defaults = {
1919
'shockServiceURL': 'https://p3.theseed.org/services/shock_api', // only for status dashboard
2020
dataServiceURL: 'https://p3.theseed.org/services/data_api',
2121
accountURL: 'http://user.patric.local:3002/',
22-
docsServiceURL: 'https://dxkb.org/docs/',
23-
userServiceURL: 'https://user.patricbrc.org',
22+
docsServiceURL: 'https://www.dxkb.org/docs/',
23+
userServiceURL: '',
24+
'copilotApiURL': 'https://www.bv-brc.org/services/copilot-api/copilot-api/chatbrc',
25+
'copilotDbURL': 'https://www.bv-brc.org/services/copilot-api/copilot-api/db',
2426
localStorageCheckInterval: 86400,
2527
enableDevTools: false,
2628
reportProblemEmailAddress: 'help@bv-brc.org',

0 commit comments

Comments
 (0)