diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 273eec0..f51362f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,7 +15,7 @@ jobs: QUAY_USER: "${{ fromJSON(secrets.VAULT_KV_1D187965_OP_QUAY_ROBOT_ACCOUNT).username }}" QUAY_TOKEN: "${{ fromJSON(secrets.VAULT_KV_1D187965_OP_QUAY_ROBOT_ACCOUNT).password }}" BOT_ACCESS_TOKEN: "${{ fromJSON(secrets.VAULT_KV_1D187965_OP_GITHUB_INFRALOVERS).PAT }}" - MONDOO_SERVICE_ACCOUNT: "${{ fromJson(secrets.VAULT_KV_1D187965_OP_MONDOO_PACKER_AGENT).password }}" + # MONDOO_SERVICE_ACCOUNT: "${{ fromJson(secrets.VAULT_KV_1D187965_OP_MONDOO_PACKER_AGENT).password }}" with: dockerfile: Dockerfile score: 0 diff --git a/Dockerfile b/Dockerfile index 253213e..a24e24b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,11 @@ FROM docker.io/node:gallium-slim +WORKDIR /app LABEL MAINTAINER=mbuchleitner@infralovers.com +COPY package* ./ +RUN npm i -COPY colors.js / -COPY index.html / +COPY colors.js ./ +COPY index.html ./ -ENTRYPOINT [ "/usr/local/bin/node", "/colors.js" ] +ENTRYPOINT [ "/usr/local/bin/node", "/app/colors.js" ] diff --git a/colors.js b/colors.js index 4f0b066..3e0ff24 100644 --- a/colors.js +++ b/colors.js @@ -144,6 +144,15 @@ function handleIdx(req, res) { }) } +const ini = require('ini'); +if (fs.existsSync('/etc/config/config.properties') ) { + console.log("reading config from /etc/config/config.properties") + const config = ini.parse(fs.readFileSync('/etc/config/config.properties', 'utf-8')); + liveRequestCount = config.live + readyRequestCount = config.ready + serverport = config.port + console.log("switching live count to %d and ready count to %d", liveRequestCount, readyRequestCount) +} var wsrv = http.createServer(handleRequest); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..e716589 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,21 @@ +{ + "name": "colors_app", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "ini": "^5.0.0" + } + }, + "node_modules/ini": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-5.0.0.tgz", + "integrity": "sha512-+N0ngpO3e7cRUWOJAS7qw0IZIVc6XPrW4MlFBdD066F2L4k1L6ker3hLqSq7iXxU5tgS4WGkIUElWn5vogAEnw==", + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..a7f1fc8 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "ini": "^5.0.0" + } +}