50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
|
import DefaultRolePolicies from "./vix/AppPolicies";
|
||
|
|
||
|
const requiredEnvars: string[] = ["CAIRO_KEYPAIR_KEY"];
|
||
|
|
||
|
const encodedEnvar = (envar: string | undefined) => (!!envar ? Buffer.from(envar, "base64").toString("utf8") : envar);
|
||
|
|
||
|
export function assertRequired() {
|
||
|
for (const e of requiredEnvars) if (!process.env[e]) throw Error(`Envar '${e}' is required!`);
|
||
|
}
|
||
|
|
||
|
export default {
|
||
|
Server: {
|
||
|
basePath: "/cairo/",
|
||
|
projectSlug: "$cairo",
|
||
|
projectName: "$cairo",
|
||
|
rootPassword: process.env.CAIRO_ROOT_PASSWORD,
|
||
|
},
|
||
|
RolePolicy: {
|
||
|
Root: {
|
||
|
id: "ck1ro7ekp000203zu5gn3d9cr",
|
||
|
name: "Root",
|
||
|
policies: DefaultRolePolicies.Root,
|
||
|
},
|
||
|
Admin: {
|
||
|
id: "ck1ro7bm0000103z5h45sswqs",
|
||
|
name: "Admin",
|
||
|
policies: DefaultRolePolicies.Admin,
|
||
|
},
|
||
|
User: {
|
||
|
id: "ck1ro7g3e000303z52ee63nqs",
|
||
|
name: "User",
|
||
|
policies: DefaultRolePolicies.User,
|
||
|
},
|
||
|
},
|
||
|
SigningOptions: {
|
||
|
HashRounds: 12,
|
||
|
Version: "0.0.1-alpha",
|
||
|
Issuer: encodedEnvar(process.env.CAIRO_HOSTNAME) ?? "https://cairo.dunemask.net",
|
||
|
Keys: {
|
||
|
KeyPair: encodedEnvar(process.env.CAIRO_KEYPAIR_KEY) ?? "keypair-key",
|
||
|
},
|
||
|
Subjects: {
|
||
|
User: "user",
|
||
|
Cargo: "cargo",
|
||
|
Runner: "runner",
|
||
|
Pod: "pod",
|
||
|
},
|
||
|
},
|
||
|
};
|