Adding Dockerfile and build script

This commit is contained in:
Fabian
2019-10-01 17:45:38 +02:00
parent 65588f4b98
commit 405e589328
11 changed files with 98 additions and 45 deletions

View File

@ -13,7 +13,7 @@ export class DatabaseManager {
let databases = await Settings.getDatabases();
databases.forEach(dbconfig => {
let db = new Database(dbconfig.name, dbconfig.accesskey, dbconfig.rules, dbconfig.publickey);
let db = new Database(dbconfig.name, dbconfig.accesskey, dbconfig.rules, dbconfig.publickey, dbconfig.rootkey);
this.databases.set(dbconfig.name, db);
})
}
@ -68,7 +68,7 @@ export class Database {
}
}
constructor(public name: string, public accesskey?: string, rawRules?: string, public publickey?: string) {
constructor(public name: string, public accesskey?: string, rawRules?: string, public publickey?: string, public rootkey?: string) {
if (rawRules)
this.rules = new Rules(rawRules);
}
@ -84,11 +84,17 @@ export class Database {
this.accesskey = key;
}
async setRootKey(key: string) {
await Settings.setDatabaseAccessKey(this.name, key);
this.accesskey = key;
}
async setPublicKey(key: string) {
await Settings.setDatabasePublicKey(this.name, key);
this.publickey = key;
}
getQuery(path: string[]) {
return new Query(this, path);
}