diff --git a/services/web/config/settings.defaults.coffee b/services/web/config/settings.defaults.coffee index 641bef5d9b..e9b3f38707 100644 --- a/services/web/config/settings.defaults.coffee +++ b/services/web/config/settings.defaults.coffee @@ -15,10 +15,16 @@ httpAuthUsers[httpAuthUser] = httpAuthPass sessionSecret = process.env['SESSION_SECRET'] or "secret-please-change" -v1Api = - url: process.env['V1_API_URL'] or "http://#{process.env['V1_HOST'] or 'localhost'}:5000" - user: process.env['V1_API_USER'] or 'overleaf' - pass: process.env['V1_API_PASSWORD'] or 'password' +if process.env['V1_API_URL'] or process.env['V1_HOST'] + v1Api = + url: process.env['V1_API_URL'] or "http://#{process.env['V1_HOST']}:5000" + user: process.env['V1_API_USER'] + pass: process.env['V1_API_PASSWORD'] +else + v1Api = + url: undefined + user: undefined + pass: undefined module.exports = settings = diff --git a/services/web/test/acceptance/config/settings.test.coffee b/services/web/test/acceptance/config/settings.test.coffee index 9f659f22e1..9c6f72cbad 100644 --- a/services/web/test/acceptance/config/settings.test.coffee +++ b/services/web/test/acceptance/config/settings.test.coffee @@ -1,10 +1,16 @@ v1Api = url: "http://#{process.env['V1_HOST'] or 'localhost'}:5000" + user: process.env['V1_API_USER'] or 'overleaf' + pass: process.env['V1_API_PASSWORD'] or 'password' module.exports = enableSubscriptions: true apis: + v1: + url: v1Api.url + user: v1Api.user + pass: v1Api.pass recurly: # Set up our own mock recurly server url: 'http://localhost:6034'