feat: Support running under subpath (#1451)
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ test
|
||||
.tmp
|
||||
.venv
|
||||
|
||||
views/index.html
|
||||
views/index.ejs
|
||||
|
||||
data/*
|
||||
|
||||
|
||||
+1
-1
@@ -134,7 +134,7 @@ swagger.json
|
||||
dist
|
||||
logs
|
||||
|
||||
views/index.html
|
||||
views/index.ejs
|
||||
|
||||
data/*
|
||||
!data/.gitkeep
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/*!
|
||||
* Copyright (c) 2025 PLANKA Software GmbH
|
||||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
exits: {
|
||||
success: {
|
||||
responseType: 'view',
|
||||
viewTemplatePath: 'index',
|
||||
},
|
||||
},
|
||||
|
||||
fn() {
|
||||
return {
|
||||
basePath: sails.config.custom.baseUrlPath,
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -15,7 +15,7 @@ module.exports = {
|
||||
|
||||
fn(inputs) {
|
||||
inputs.response.clearCookie('httpOnlyToken', {
|
||||
path: sails.config.custom.baseUrlPath,
|
||||
path: sails.config.custom.baseUrlPath || '/',
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ module.exports = {
|
||||
fn(inputs) {
|
||||
inputs.response.cookie('httpOnlyToken', inputs.value, {
|
||||
expires: new Date(inputs.accessTokenPayload.exp * 1000),
|
||||
path: sails.config.custom.baseUrlPath,
|
||||
path: sails.config.custom.baseUrlPath || '/',
|
||||
secure: sails.config.custom.baseUrlSecure,
|
||||
httpOnly: true,
|
||||
sameSite: 'strict',
|
||||
|
||||
@@ -41,7 +41,7 @@ module.exports.custom = {
|
||||
version,
|
||||
|
||||
baseUrl,
|
||||
baseUrlPath: parsedBasedUrl.pathname,
|
||||
baseUrlPath: parsedBasedUrl.pathname.replace(/\/$/, ''), // Remove trailing slash
|
||||
baseUrlSecure: parsedBasedUrl.protocol === 'https:',
|
||||
|
||||
maxUploadFileSize: envToBytes(process.env.MAX_UPLOAD_FILE_SIZE),
|
||||
|
||||
@@ -44,6 +44,7 @@ module.exports.policies = {
|
||||
|
||||
'_internal/update-config': ['is-authenticated', 'is-internal'],
|
||||
|
||||
index: true,
|
||||
'swagger/show': true,
|
||||
'bootstrap/show': true,
|
||||
'terms/show': true,
|
||||
|
||||
@@ -266,7 +266,7 @@ module.exports.routes = {
|
||||
},
|
||||
|
||||
'GET /*': {
|
||||
view: 'index',
|
||||
action: 'index',
|
||||
skipAssets: true,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ module.exports.views = {
|
||||
*
|
||||
*/
|
||||
|
||||
extension: 'html',
|
||||
// extension: 'ejs',
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user