Merge branch 'master' of ssh://numinibsd/git/base/enigma-bbs

This commit is contained in:
Bryan Ashby 2017-02-16 21:40:23 -07:00
commit 44af46dd90
2 changed files with 18 additions and 12 deletions

View File

@ -16,6 +16,7 @@ const paths = require('path');
const async = require('async'); const async = require('async');
const fs = require('fs'); const fs = require('fs');
const mimeTypes = require('mime-types'); const mimeTypes = require('mime-types');
const _ = require('lodash');
const WEB_SERVER_PACKAGE_NAME = 'codes.l33t.enigma.web.server'; const WEB_SERVER_PACKAGE_NAME = 'codes.l33t.enigma.web.server';
@ -166,6 +167,9 @@ class FileAreaWebAccess {
// //
let schema; let schema;
let port; let port;
if(_.isString(Config.contentServers.web.overrideUrlPrefix)) {
return `${Config.contentServers.web.overrideUrlPrefix}${Config.fileBase.web.path}${hashId}`;
} else {
if(Config.contentServers.web.https.enabled) { if(Config.contentServers.web.https.enabled) {
schema = 'https://'; schema = 'https://';
port = (443 === Config.contentServers.web.https.port) ? port = (443 === Config.contentServers.web.https.port) ?
@ -180,6 +184,7 @@ class FileAreaWebAccess {
return `${schema}${Config.contentServers.web.domain}${port}${Config.fileBase.web.path}${hashId}`; return `${schema}${Config.contentServers.web.domain}${port}${Config.fileBase.web.path}${hashId}`;
} }
}
getExistingTempDownloadServeItem(client, fileEntry, cb) { getExistingTempDownloadServeItem(client, fileEntry, cb) {
const hashId = this.getHashId(client, fileEntry); const hashId = this.getHashId(client, fileEntry);

View File

@ -21,7 +21,8 @@ This will configure HTTP for port 8080 (override with `port`). To additionally e
contentServers: { contentServers: {
web: { web: {
domain: bbs.yourdomain.com domain: bbs.yourdomain.com
// set 'overrideUrlPrefix' if for example, you use a transparent proxy in front of ENiGMA and need to be explicit about URLs the system hands out
overrideUrlPrefix: https://bbs.yourdomain.com
https: { https: {
enabled: true enabled: true
port: 8443 port: 8443