library-ts/node/users/UserManagementServerSetting...

59 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-11-10 17:41:48 +00:00
import { RegExpUtility } from "../../browser/text/RegExpUtitlity";
2025-11-10 19:24:53 +00:00
import { Files } from "../files/Files";
2025-11-10 17:41:48 +00:00
export class UserManagementServerSettings
{
// Server settings
url:string;
port:number = 8084;
corsURLs:string[] = [];
2025-11-11 09:35:13 +00:00
isDebugMode:boolean = false;
2025-11-11 10:33:59 +00:00
httpsKeyPath:string;
httpsCertPath:string;
2025-11-11 13:13:39 +00:00
emailKey:string;
2025-11-15 20:18:53 +00:00
persistSessions:boolean = true;
2025-11-10 17:41:48 +00:00
// Paths
rootPath:string;
userDBPath:string;
rolesPath:string;
2025-11-15 20:18:53 +00:00
sessionsPath:string;
2025-11-10 17:41:48 +00:00
2025-11-15 18:58:30 +00:00
// Apps
appsPath:string;
userApps:string[];
2025-11-10 17:41:48 +00:00
// Geo-Lite Lib
geoLocationPath:string;
geoAccountID:string;
geoLicenseKey:string;
// Email
emailFrom:string;
// User settings
maxLogins:number = 5;
2025-11-11 21:46:18 +00:00
signUpConfirmationURL:string;
changePasswordURL:string;
2025-11-10 17:41:48 +00:00
static makeAllPathsAbsolute( settings:UserManagementServerSettings )
{
settings.userDBPath = this._makePathAbsolute( settings.userDBPath, settings.rootPath );
settings.rolesPath = this._makePathAbsolute( settings.rolesPath, settings.rootPath );
settings.geoLocationPath = this._makePathAbsolute( settings.geoLocationPath, settings.rootPath );
}
protected static _makePathAbsolute( path:string, rootPath:string )
{
if ( path.indexOf( rootPath ) === 0 )
{
return path;
}
2025-11-10 19:24:53 +00:00
return Files.joinPaths( [ rootPath, path ] );
2025-11-10 17:41:48 +00:00
}
}