Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM node:18-bullseye-slim AS builder
WORKDIR /app

COPY . .
COPY ./config/config.template.ts ./config/index.ts
RUN apt-get update -y && apt-get install g++ python3 make -y && yarn cache clean && yarn install && yarn build && rm -rf node_modules/ && yarn install --production

# Production stage
Expand Down
28 changes: 28 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
urls: &urls
backend_url: &backend_url "http://wallet-backend-server:8002"
wallet_url: &wallet_url "http://localhost:3000"
wallet_host: &wallet_host "localhost"

backend:
url: *backend_url
port: 8002
appSecret: dsfkwfkwfwdfdsfSaSe2e34r4frwr42rAFdsf2lfmfsmklfwmer
ssl: SSL_FLAG
db:
host: wallet-db
port: 3307
username: root
password: root
dbname: wallet
walletClientUrl: *wallet_url
webauthn:
attestation: direct
origin: *wallet_url
rp:
id: *wallet_host
name: wwWallet demo
alg: EdDSA
notifications:
enabled: true
serviceAccount: firebaseConfig.json

27 changes: 0 additions & 27 deletions config/config.template.ts

This file was deleted.

35 changes: 35 additions & 0 deletions config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import path from 'node:path';
import fs from 'node:fs';
import { parse } from 'yaml';

const yamlConfig = fs.readFileSync(path.join(process.cwd(), 'config.yml')).toString()

console.log(parse(yamlConfig));

export const config: {
url: string;
port: string;
appSecret: string;
ssl: string;
db: {
host: string;
port: string;
username: string;
password: string;
dbname: string;
}
walletClientUrl: string;
webauthn: {
attestation: string;
origin: string;
rp: {
id: string;
name: string;
}
}
alg: string;
notifications: {
enabled: string;
serviceAccount: string;
}
}= parse(yamlConfig).backend
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"typeorm": "^0.3.9",
"uuid": "^9.0.0",
"ws": "^8.14.1",
"yaml": "^2.8.1",
"zod": "^3.21.4"
},
"devDependencies": {
Expand Down