[INIT] Initial Project Structure
This commit is contained in:
commit
0fc5f05b6a
105 changed files with 10448 additions and 0 deletions
49
lib/config.ts
Normal file
49
lib/config.ts
Normal file
|
@ -0,0 +1,49 @@
|
|||
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",
|
||||
},
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue