Remove v1 defaults (#2391)

GitOrigin-RevId: e9812c9d7785ac64500dcd3925a6b5be4cb04d7c
This commit is contained in:
Miguel Serrano 2019-11-21 11:08:26 +01:00 committed by sharelatex
parent 475e6971a2
commit 11419845e8
3 changed files with 22 additions and 5 deletions

View file

@ -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 =

View file

@ -1,10 +1,16 @@
v1Api =
url: "http://#{process.env['V1_HOST'] or 'localhost'}:5000"
url: "http://localhost:5000"
user: 'overleaf'
pass: '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'

View file

@ -19,6 +19,10 @@ describe('AnalyticsController', function() {
getInstitutionLicences: sinon.stub().callsArgWith(4)
}
this.Features = {
hasFeature: sinon.stub().returns(true)
}
this.controller = SandboxedModule.require(modulePath, {
globals: {
console: console
@ -28,6 +32,7 @@ describe('AnalyticsController', function() {
'../Authentication/AuthenticationController': this
.AuthenticationController,
'../Institutions/InstitutionsAPI': this.InstitutionsAPI,
'../../infrastructure/Features': this.Features,
'logger-sharelatex': {
log() {}
},