feat: Allow setting customer panel URL via environment variables
This commit is contained in:
@@ -34,6 +34,7 @@ SECRET_KEY=notsecretkey
|
||||
# INTERNAL_ACCESS_TOKEN=
|
||||
# STORAGE_LIMIT=
|
||||
# ACTIVE_USERS_LIMIT=
|
||||
# CUSTOMER_PANEL_URL=
|
||||
|
||||
# Set to true to show more detailed authentication error messages.
|
||||
# It should not be enabled without a rate limiter for security reasons.
|
||||
|
||||
@@ -52,6 +52,11 @@
|
||||
* nullable: true
|
||||
* description: Maximum number of active users allowed (conditionally added for admins if configured)
|
||||
* example: 100
|
||||
* customerPanelUrl:
|
||||
* type: string
|
||||
* format: uri
|
||||
* description: URL to the customer management panel (conditionally added for admins if configured)
|
||||
* example: https://panel.example.com
|
||||
* version:
|
||||
* type: string
|
||||
* description: Current version of the PLANKA application
|
||||
|
||||
@@ -21,7 +21,10 @@ module.exports = {
|
||||
version: sails.config.custom.version,
|
||||
};
|
||||
if (inputs.user && inputs.user.role === User.Roles.ADMIN) {
|
||||
data.activeUsersLimit = sails.config.custom.activeUsersLimit;
|
||||
Object.assign(data, {
|
||||
activeUsersLimit: sails.config.custom.activeUsersLimit,
|
||||
customerPanelUrl: sails.config.custom.customerPanelUrl,
|
||||
});
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
@@ -62,6 +62,7 @@ module.exports.custom = {
|
||||
internalAccessToken: process.env.INTERNAL_ACCESS_TOKEN,
|
||||
storageLimit: envToBytes(process.env.STORAGE_LIMIT),
|
||||
activeUsersLimit: envToNumber(process.env.ACTIVE_USERS_LIMIT),
|
||||
customerPanelUrl: process.env.CUSTOMER_PANEL_URL,
|
||||
|
||||
showDetailedAuthErrors: process.env.SHOW_DETAILED_AUTH_ERRORS === 'true',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user