mirror of
https://github.com/caprover/caprover
synced 2026-05-03 10:10:29 +00:00
Fixed issue raised in https://github.com/caprover/caprover/pull/2362\#issuecomment-3609213641
Run build / build (push) Has been cancelled
Run formatter / check-code-formatting (push) Has been cancelled
Run lint / run-lint (push) Has been cancelled
Build and push the edge image / run-pre-checks (push) Has been cancelled
Build and push the edge image / build-publish-docker-hub (push) Has been cancelled
Run build / build (push) Has been cancelled
Run formatter / check-code-formatting (push) Has been cancelled
Run lint / run-lint (push) Has been cancelled
Build and push the edge image / run-pre-checks (push) Has been cancelled
Build and push the edge image / build-publish-docker-hub (push) Has been cancelled
This commit is contained in:
@@ -474,21 +474,33 @@ router.get('/goaccess/:appName/files/:file', async function (req, res, next) {
|
||||
})
|
||||
}
|
||||
|
||||
const path = `${appName}/${file}`
|
||||
res.sendFile(
|
||||
path,
|
||||
{ root: CaptainConstants.nginxSharedLogsPathOnHost },
|
||||
function (error) {
|
||||
if (error !== undefined) {
|
||||
Logger.e(error, 'Error getting GoAccess report ' + path)
|
||||
const baseApi = new BaseApi(
|
||||
ApiStatusCodes.NOT_FOUND,
|
||||
'Report not found'
|
||||
)
|
||||
res.send(baseApi)
|
||||
}
|
||||
}
|
||||
const fileRelativePath = `${appName}/${file}`
|
||||
const absolutePath = path.join(
|
||||
CaptainConstants.nginxSharedLogsPathOnHost,
|
||||
appName,
|
||||
file
|
||||
)
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
return fs.readFile(absolutePath, 'utf8')
|
||||
})
|
||||
.then(function (fileContents) {
|
||||
const baseApi = new BaseApi(
|
||||
ApiStatusCodes.STATUS_OK,
|
||||
'GoAccess report retrieved'
|
||||
)
|
||||
baseApi.data = fileContents
|
||||
res.send(baseApi)
|
||||
})
|
||||
.catch(function (error) {
|
||||
Logger.e(error, 'Error getting GoAccess report ' + fileRelativePath)
|
||||
const baseApi = new BaseApi(
|
||||
ApiStatusCodes.NOT_FOUND,
|
||||
'Report not found'
|
||||
)
|
||||
res.send(baseApi)
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/nginxconfig/', function (req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user