commit 0dacdcf8c38dcc0173277b5169e2649d386ce4bc parent 2172b9426096a0e6f49a91357a183dbeb5d8a397 Author: MS <ms@taler.net> Date: Wed, 16 Nov 2022 14:35:15 +0100 drafting TypeScript demo config Diffstat:
| A | docker/demo/config/deployment.ts | | | 61 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 61 insertions(+), 0 deletions(-)
diff --git a/docker/demo/config/deployment.ts b/docker/demo/config/deployment.ts @@ -0,0 +1,61 @@ +/** + * Not belonging here: ports to expose when + * starting the services and Git tags. + */ + +interface BankAccount { + username: string; + password: string; +} + +interface NexusAccount { + username: string; + password: string; +} + +class ApiKey { + apikey: string; + constructor(apikey: string) { + if (!apikey.startsWith("secret-token:")) { + throw Error("Given API key lacks leading 'secret-token:' part.") + } + this.apikey = apikey; + } +} + +interface TalerConfigUrls { + merchantUrl: URL; + landingUrl: URL; + blogUrl: URL; + donationsUrl: URL; + surveyUrl: URL; + syncUrl: URL; + // was bank-url in INI config: + bankSandboxUrl: URL; + // was default-exchange in INI config: + exchangeUrl: URL; +} + +interface TalerConfigSecrets { + merchantApiKey: ApiKey; + dbPassword: string; +} + +interface TalerConfigBankAccounts { + exchange: BankAccount; + blog: BankAccount; + pos: BankAccount; + gnunet: BankAccount; + taler: BankAccount; + tor: BankAccount; + survey: BankAccount; + defaultMerchantInstance: BankAccount; +} + +interface TalerConfig { + currency: string; + urls: TalerConfigUrls; + secrets: TalerConfigSecrets; + bankAccounts: TalerConfigBankAccounts; + exchangeNexusAccount: NexusAccount; +}