Download all log files from compiles.sharelatex.env (#833)

* add a couple of missing buildPdfDownloadUrl

* only download pdfs from compile server when streaming

* use compiles.env for resonse files

* update config to use clsi_lb
This commit is contained in:
Henry Oswald 2018-08-21 09:24:48 +01:00 committed by GitHub
parent 53a9a174a2
commit 7a253e56ef
2 changed files with 8 additions and 5 deletions

View file

@ -135,6 +135,7 @@ module.exports = settings =
url: "http://#{process.env['FILESTORE_HOST'] or 'localhost'}:3009"
clsi:
url: "http://#{process.env['CLSI_HOST'] or 'localhost'}:3013"
# url: "http://#{process.env['CLSI_LB_HOST']}:3014"
backendGroupName: undefined
templates:
url: "http://#{process.env['TEMPLATES_HOST'] or 'localhost'}:3007"
@ -340,7 +341,7 @@ module.exports = settings =
# disablePerUserCompiles: true
# Domain the client (pdfjs) should download the compiled pdf from
# pdfDownloadDomain: "http://compiles.sharelatex.test:3014"
# pdfDownloadDomain: "http://clsi-lb:3014"
# Maximum size of text documents in the real-time editing system.
max_doc_length: 2 * 1024 * 1024 # 2mb

View file

@ -225,7 +225,8 @@ define [
}, {params: params}
buildPdfDownloadUrl = (pdfDownloadDomain, path)->
if pdfDownloadDomain?
#we only download builds from compiles server for security reasons
if pdfDownloadDomain? and path.indexOf("build") != -1
return "#{pdfDownloadDomain}#{path}"
else
return path
@ -378,14 +379,15 @@ define [
compileGroup:ide.compileGroup
clsiserverid:ide.clsiServerId
if file?.url? # FIXME clean this up when we have file.urls out consistently
opts.url = buildPdfDownloadUrl options.pdfDownloadDomain, file.url
opts.url = file.url
else if file?.build?
opts.url = buildPdfDownloadUrl options.pdfDownloadDomain, "/project/#{$scope.project_id}/build/#{file.build}/output/#{name}"
opts.url = "/project/#{$scope.project_id}/build/#{file.build}/output/#{name}"
else
opts.url = buildPdfDownloadUrl options.pdfDownloadDomain, "/project/#{$scope.project_id}/output/#{name}"
opts.url = "/project/#{$scope.project_id}/output/#{name}"
# check if we need to bust cache (build id is unique so don't need it in that case)
if not file?.build?
opts.params.cache_bust = "#{Date.now()}"
opts.url = buildPdfDownloadUrl options.pdfDownloadDomain, opts.url
return $http(opts)
# accumulate the log entries