Merge pull request #13682 from raisedadead/fix/update-config-for-debug-setups
fix: Update config to be flexible for hostpull/14483/head
commit
d51474f682
|
@ -12,6 +12,7 @@ import { blacklistedUsernames } from '../../server/utils/constants';
|
|||
const debug = debugFactory('fcc:user:remote');
|
||||
const BROWNIEPOINTS_TIMEOUT = [1, 'hour'];
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
const devHost = process.env.HOST || 'localhost';
|
||||
|
||||
function getAboutProfile({
|
||||
username,
|
||||
|
@ -443,7 +444,7 @@ module.exports = function(User) {
|
|||
from: 'Team@freecodecamp.com',
|
||||
subject: 'Welcome to freeCodeCamp!',
|
||||
protocol: isDev ? null : 'https',
|
||||
host: isDev ? 'localhost' : 'freecodecamp.com',
|
||||
host: isDev ? devHost : 'freecodecamp.com',
|
||||
port: isDev ? null : 443,
|
||||
template: path.join(
|
||||
__dirname,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// enable debug for gulp
|
||||
/* eslint-disable prefer-object-spread/prefer-object-spread */
|
||||
process.env.DEBUG = process.env.DEBUG || 'fcc:*';
|
||||
require('dotenv').load();
|
||||
|
||||
require('babel-core/register');
|
||||
const Rx = require('rx'),
|
||||
|
@ -62,8 +63,10 @@ function resolve(filepath, thisString, withThisString) {
|
|||
|
||||
// user definable
|
||||
const __DEV__ = !yargs.argv.p;
|
||||
const host = process.env.HOST || 'localhost';
|
||||
const port = yargs.argv.port || process.env.PORT || '3001';
|
||||
const syncPort = yargs.argv['sync-port'] || process.env.SYNC_PORT || '3000';
|
||||
|
||||
// make sure sync ui port does not interfere with proxy port
|
||||
const syncUIPort = yargs.argv['sync-ui-port'] ||
|
||||
process.env.SYNC_UI_PORT ||
|
||||
|
@ -227,7 +230,7 @@ gulp.task('dev-server', syncDepenedents, function() {
|
|||
port: syncUIPort
|
||||
},
|
||||
proxy: {
|
||||
target: `http://localhost:${port}`,
|
||||
target: `http://${host}:${port}`,
|
||||
reqHeaders: ({ url: { hostname } }) => ({
|
||||
host: `${hostname}:${syncPort}`
|
||||
})
|
||||
|
|
|
@ -5,6 +5,7 @@ import path from 'path';
|
|||
|
||||
const debug = debugFactory('fcc:user:remote');
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
const devHost = process.env.HOST || 'localhost';
|
||||
|
||||
function destroyAllRelated(id, Model) {
|
||||
return Observable.fromNodeCallback(
|
||||
|
@ -77,7 +78,7 @@ module.exports = function(app) {
|
|||
from: 'Team@freecodecamp.com',
|
||||
subject: 'Welcome to freeCodeCamp!',
|
||||
protocol: isDev ? null : 'https',
|
||||
host: isDev ? 'localhost' : 'freecodecamp.com',
|
||||
host: isDev ? devHost : 'freecodecamp.com',
|
||||
port: isDev ? null : 443,
|
||||
template: path.join(
|
||||
__dirname,
|
||||
|
|
|
@ -4,9 +4,12 @@ let trusted = [
|
|||
"'self'"
|
||||
];
|
||||
|
||||
const host = process.env.HOST || 'localhost';
|
||||
const port = process.env.PORT || process.env.SYNC_PORT || '3000';
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
trusted = trusted.concat([
|
||||
'ws://localhost:3000'
|
||||
`ws://${host}:${port}`
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue