add RESTRICT_GUEST_ACCESS to block unregistered users from all applications
This commit is contained in:
24
application_config.js.tmpl
Normal file
24
application_config.js.tmpl
Normal file
@ -0,0 +1,24 @@
|
||||
// CryptPad application customization — generated from environment variables
|
||||
// See https://docs.cryptpad.org/en/admin_guide/customization.html
|
||||
// For default file, see: https://github.com/cryptpad/cryptpad/blob/main/customize.dist/application_config.js
|
||||
|
||||
(() => {
|
||||
const factory = (AppConfig) => {
|
||||
{{ if eq (env "RESTRICT_GUEST_ACCESS") "true" }}
|
||||
// Block unregistered users from accessing any applications
|
||||
AppConfig.registeredOnlyTypes = AppConfig.availablePadTypes.slice();
|
||||
{{ end }}
|
||||
|
||||
return AppConfig;
|
||||
};
|
||||
|
||||
// Do not change code below
|
||||
if (typeof(module) !== 'undefined' && module.exports) {
|
||||
module.exports = factory(
|
||||
require('../www/common/application_config_internal.js')
|
||||
);
|
||||
} else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) {
|
||||
define(['/common/application_config_internal.js'], factory);
|
||||
}
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user