From 1c69f4fd6ad8fde45757f67a4143ec6f4028321a Mon Sep 17 00:00:00 2001 From: Saturn-V Date: Thu, 19 Oct 2023 16:18:34 -0700 Subject: [PATCH] remove keys --- docker/adapter/Dockerfile | 3 +++ docker/adapter/src/index.ts | 6 +++--- helm/service/templates/adapter.yaml | 10 +++++++++- helm/service/values.yaml | 3 +++ index.html | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/docker/adapter/Dockerfile b/docker/adapter/Dockerfile index 5db046e..d52bb20 100644 --- a/docker/adapter/Dockerfile +++ b/docker/adapter/Dockerfile @@ -6,5 +6,8 @@ COPY . . RUN npm install --include-dev VOLUME ./data +ENV TENANT_ID +ENV CLIENT_ID +ENV CLIENT_SECRET CMD ["npm","run","trace"] diff --git a/docker/adapter/src/index.ts b/docker/adapter/src/index.ts index 7a2c173..1611a8b 100644 --- a/docker/adapter/src/index.ts +++ b/docker/adapter/src/index.ts @@ -1,8 +1,8 @@ import fs from 'fs' -const tenant_id = "3209935f-cc7a-42f8-aec8-87e3589716cb" -const client_id = "a0a2f365-ff6b-4aa2-b6dd-99d06e29266b" -const client_secret = "lCO8Q~-iIn_w9kL4ntIB_PQu7.PL5klPd-AlfbDu" +const tenant_id = process.env.TENANT_ID +const client_id = process.env.CLIENT_ID +const client_secret = process.env.CLIENT_SECRET const AUTHORITY = `https://login.microsoftonline.com/${tenant_id}` const GRAPH = `https://graph.microsoft.com` const TOKEN_URL = `${AUTHORITY}/oauth2/v2.0/token` diff --git a/helm/service/templates/adapter.yaml b/helm/service/templates/adapter.yaml index 9f2d538..b22e99a 100644 --- a/helm/service/templates/adapter.yaml +++ b/helm/service/templates/adapter.yaml @@ -15,10 +15,18 @@ spec: containers: - name: adapter image: "{{ .Values.adapter.image }}:{{ .Values.adapter.tag }}" - + volumeMounts: - name: {{ .Values.pvc.mount }} mountPath: /adapter/data + + env: + - name: TENANT_ID + value: {{ .Values.adapter.tenantId }} + - name: CLIENT_ID + value: {{ .Values.adapter.clientId }} + - name: CLIENT_SECRET + value: {{ .Values.adapter.clientSecret }} volumes: - name: {{ .Values.pvc.mount }} diff --git a/helm/service/values.yaml b/helm/service/values.yaml index 66a330a..1730276 100644 --- a/helm/service/values.yaml +++ b/helm/service/values.yaml @@ -17,3 +17,6 @@ pvc: mount: pewpew-adapter-volume claim: pewpew-adapter-pvc name: pewpew-adapter-pv + tenantId: "YOUR-TENANT-ID" + clientId: "YOUR-CLIENT-ID" + clientSecret: "YOUR-CLIENT-SECRET" diff --git a/index.html b/index.html index 255491f..e39f4ef 100644 --- a/index.html +++ b/index.html @@ -426,7 +426,7 @@

About IPew

loadData: function () { var self = this if (this.data.length === 0) { - $.getJSON('data/data.json', function (data) { + $.getJSON(`${window.location.host}/data/data.json`, function (data) { self.data = data.data self.getData(); });