This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
skynet-webportal/packages/dashboard/src/config.js

40 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-02-03 14:06:44 +00:00
export const SECURITY_MODE_STANDALONE = "cookie";
export const SECURITY_MODE_JWT = "jwt";
const baseUrl = process.env.BASE_URL || "/";
let securityMode = SECURITY_MODE_STANDALONE;
let browserUrl = process.env.KRATOS_BROWSER_URL || "https://secure.siasky.xyz/.ory/kratos/public";
let publicUrl = process.env.KRATOS_PUBLIC_URL || "https://secure.siasky.xyz/.ory/kratos/public";
switch ((process.env.SECURITY_MODE || "").toLowerCase()) {
case "jwt":
case "oathkeeper":
securityMode = SECURITY_MODE_JWT;
break;
case "cookie":
case "standalone":
default:
securityMode = SECURITY_MODE_STANDALONE;
}
export default {
kratos: {
browser: browserUrl.replace(/\/+$/, ""),
admin: (process.env.KRATOS_ADMIN_URL || "").replace(/\/+$/, ""),
public: publicUrl.replace(/\/+$/, ""),
},
baseUrl,
jwksUrl: process.env.JWKS_URL || "/",
projectName: process.env.PROJECT_NAME || "SecureApp",
securityMode,
SECURITY_MODE_JWT,
SECURITY_MODE_STANDALONE,
https: {
enabled: process.env.hasOwnProperty("TLS_KEY_PATH") && process.env.hasOwnProperty("TLS_CERT_PATH"),
certificatePath: process.env.TLS_CERT_PATH || "",
keyPath: process.env.TLS_KEY_PATH || "",
},
};