From a2d98a7d7aa435a956f14ac306655bab9c2726d2 Mon Sep 17 00:00:00 2001 From: uni-kakurenbo Date: Thu, 1 Jan 2026 10:33:47 +0900 Subject: [PATCH 1/5] feat(traQ): inject config during deployment --- preview-traq/deployment-patch.yaml | 38 ++++++++ preview-traq/kustomization.yaml | 15 ++++ traq/frontend/config.json | 135 +++++++++++++++++++++++++++++ traq/frontend/deployment.yaml | 22 +++++ traq/frontend/kustomization.yaml | 5 ++ 5 files changed, 215 insertions(+) create mode 100644 preview-traq/deployment-patch.yaml create mode 100644 traq/frontend/config.json diff --git a/preview-traq/deployment-patch.yaml b/preview-traq/deployment-patch.yaml new file mode 100644 index 000000000..7567de951 --- /dev/null +++ b/preview-traq/deployment-patch.yaml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: preview-traq-placeholder +spec: + template: + spec: + initContainers: + - name: convert-config + image: busybox:1.36.1 + command: ["sh", "-c"] + args: + - | + echo ";(() => { self.traQConfig = $(cat /config-in/config.json) })()" > /app/override/config.js + volumeMounts: + - name: config-json + mountPath: /config-in + - name: config-js + mountPath: /app/override + resources: + requests: + cpu: "10m" + memory: "50Mi" + limits: + cpu: "50m" + memory: "100Mi" + containers: + - name: preview-traq-placeholder + volumeMounts: + - name: config-js + mountPath: /app/override/config.js + subPath: config.js + volumes: + - name: config-json + configMap: + name: preview-traq-config + - name: config-js + emptyDir: {} diff --git a/preview-traq/kustomization.yaml b/preview-traq/kustomization.yaml index 32e6d7fbb..c06854b58 100644 --- a/preview-traq/kustomization.yaml +++ b/preview-traq/kustomization.yaml @@ -1,9 +1,24 @@ helmGlobals: chartHome: ../.common +configMapGenerator: + - name: preview-traq-config + namespace: preview-traq + files: + - config.json=../traq/frontend/config.json + options: + disableNameSuffixHash: true + helmCharts: - includeCRDs: true name: preview-ui namespace: preview-traq releaseName: preview-traq valuesFile: values.yaml + +patches: + - path: deployment-patch.yaml + target: + kind: Deployment + name: preview-traq-.* + namespace: preview-traq diff --git a/traq/frontend/config.json b/traq/frontend/config.json new file mode 100644 index 000000000..ca89c9b5f --- /dev/null +++ b/traq/frontend/config.json @@ -0,0 +1,135 @@ +{ + "$schema": "https://raw.githubusercontent.com/traPtitech/traQ_S-UI/refs/heads/master/config.schema.json", + "firebase": { + "apiKey": "AIzaSyDee_VkrRtByJCrCZAX3nTSDPl8AaHlWfY", + "appId": "1:993645413001:web:b253ea3776d6cf85163c58", + "projectId": "traq-r", + "messagingSenderId": "993645413001", + "vapidKey": "BPHegiDotHG7TlKhoW1qvwUYjOQj1C7RgKjvw3etUJZ_4x3LWUtFVXtRANWwckJX4G2w3CVj4zwi5QNThg7DZH4" + }, + "enableQall": true, + "enableSearch": true, + "services": [ + { + "label": "Portal", + "iconPath": "portal.svg", + "appLink": "https://portal.trap.jp/" + }, + { + "label": "Official Website", + "iconPath": "traP.svg", + "appLink": "https://trap.jp/" + }, + { + "label": "Wiki", + "iconPath": "crowi.svg", + "appLink": "https://wiki.trap.jp/" + }, + { + "label": "Blog Admin", + "iconPath": "ghost.svg", + "appLink": "https://blog-admin.trap.jp/" + }, + { + "label": "Drive", + "iconPath": "nextcloud.svg", + "appLink": "https://drive.trap.jp/" + }, + { + "label": "Gitea", + "iconPath": "gitea.svg", + "appLink": "https://git.trap.jp/" + }, + { + "label": "NeoShowcase", + "iconPath": "neoshowcase.svg", + "appLink": "https://ns.trap.jp/" + }, + { + "label": "HackMD", + "iconPath": "hackmd.svg", + "appLink": "https://md.trap.jp/" + }, + { + "label": "anke-to", + "iconPath": "anke-to.svg", + "appLink": "https://anke-to.trap.jp/" + }, + { + "label": "booQ", + "iconPath": "booq.svg", + "appLink": "https://booq.trap.jp/" + }, + { + "label": "knoQ", + "iconPath": "knoq.svg", + "appLink": "https://knoq.trap.jp/" + }, + { + "label": "BOT Console", + "iconPath": "bot-console.svg", + "appLink": "https://bot-console.trap.jp/" + }, + { + "label": "Jomon", + "iconPath": "jomon.svg", + "appLink": "https://jomon.trap.jp/" + }, + { + "label": "traPortfolio", + "iconPath": "traPortfolio.svg", + "appLink": "https://portfolio.trap.jp/" + }, + { + "label": "tpf-admin", + "iconPath": "traPortfolio-admin.svg", + "appLink": "https://portfolio-admin.trap.jp/" + }, + { + "label": "rucQ", + "iconPath": "rucq.svg", + "appLink": "https://rucq.trap.jp/" + }, + { + "label": "traP Collection", + "iconPath": "traPCollection.svg", + "appLink": "https://collection.trap.jp/" + } + ], + "ogpIgnoreHostNames": [ + "wiki.trap.jp", + "git.trap.jp", + "md.trap.jp", + "drive.trap.jp", + "anke-to.trap.jp", + "booq.trap.jp", + "knoq.trap.jp", + "wiki.trapti.tech", + "git.trapti.tech", + "md.trapti.tech", + "drive.trapti.tech", + "jomon.trap.jp", + "ns.trap.jp", + "portfolio-admin.trap.jp", + "rucq.trap.jp" + ], + "wikiPageOrigin": "https://wiki.trap.jp", + "blogPagePrefix": "https://trap.jp/author/", + "auth": { + "resetLink": "https://portal.trap.jp/reset-password", + "changeLink": "https://portal.trap.jp/me/change-password", + "changeName": "traPortal" + }, + "isRootChannelSelectableAsParentChannel": false, + "tooLargeFileMessage": "大きい%sの共有にはDriveを使用してください", + "showWidgetCopyButton": true, + "inlineReplyDisableChannels": [ + "#general", + "#general/schedule", + "#general/meeting", + "#random", + "#random/wasure", + "#services" + ], + "iosPwaInfoLink": "https://wiki.trap.jp/SysAd/docs/traQ-S/PWA" +} diff --git a/traq/frontend/deployment.yaml b/traq/frontend/deployment.yaml index 209a848c4..e61d07dda 100644 --- a/traq/frontend/deployment.yaml +++ b/traq/frontend/deployment.yaml @@ -16,6 +16,18 @@ spec: spec: nodeSelector: kubernetes.io/hostname: c1-203.tokyotech.org + initContainers: + - name: convert-config + image: busybox:1.36.1 + command: ["sh", "-c"] + args: + - | + echo ";(() => { self.traQConfig = $(cat /config-in/config.json) })()" > /app/override/config.js + volumeMounts: + - name: config-json + mountPath: /config-in + - name: config-js + mountPath: /app/override containers: - image: ghcr.io/traptitech/traq-ui:3.31.2 name: traq-frontend @@ -33,4 +45,14 @@ spec: value: "1120420953" - name: NEW_RELIC_AGENT_ID value: "1120420953" + volumeMounts: + - mountPath: /app/override/config.js + name: config-js + subPath: config.js + volumes: + - configMap: + name: traq-frontend-config + name: config-json + - emptyDir: {} + name: config-js restartPolicy: Always diff --git a/traq/frontend/kustomization.yaml b/traq/frontend/kustomization.yaml index 95daa59cb..aeaa10a72 100644 --- a/traq/frontend/kustomization.yaml +++ b/traq/frontend/kustomization.yaml @@ -2,3 +2,8 @@ resources: - ./deployment.yaml - ./service.yaml - ./ingress-route.yaml + +configMapGenerator: + - name: traq-frontend-config + files: + - config.json From 868d43e0541f208f7c86fee2f00c8194b14ec6f3 Mon Sep 17 00:00:00 2001 From: uni-kakurenbo Date: Wed, 25 Mar 2026 15:52:41 +0900 Subject: [PATCH 2/5] fixup! feat(traQ): inject config during deployment --- .../templates/dashboard-deployment.yaml | 8 ++++ preview-traq/deployment-patch.yaml | 38 ------------------- preview-traq/kustomization.yaml | 7 ---- preview-traq/values.yaml | 11 ++++++ 4 files changed, 19 insertions(+), 45 deletions(-) delete mode 100644 preview-traq/deployment-patch.yaml diff --git a/.common/preview-ui-template/templates/dashboard-deployment.yaml b/.common/preview-ui-template/templates/dashboard-deployment.yaml index b88091297..30cfe9266 100644 --- a/.common/preview-ui-template/templates/dashboard-deployment.yaml +++ b/.common/preview-ui-template/templates/dashboard-deployment.yaml @@ -27,3 +27,11 @@ spec: ports: - name: http containerPort: {{ .Values.port }} + {{- if .Values.containers.volumeMounts }} + volumeMounts: + {{- toYaml .Values.containers.volumeMounts | nindent 12 }} + {{- end }} + {{- if .Values.volumes }} + volumes: + {{- toYaml .Values.volumes | nindent 8 }} + {{- end }} diff --git a/preview-traq/deployment-patch.yaml b/preview-traq/deployment-patch.yaml deleted file mode 100644 index 7567de951..000000000 --- a/preview-traq/deployment-patch.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: preview-traq-placeholder -spec: - template: - spec: - initContainers: - - name: convert-config - image: busybox:1.36.1 - command: ["sh", "-c"] - args: - - | - echo ";(() => { self.traQConfig = $(cat /config-in/config.json) })()" > /app/override/config.js - volumeMounts: - - name: config-json - mountPath: /config-in - - name: config-js - mountPath: /app/override - resources: - requests: - cpu: "10m" - memory: "50Mi" - limits: - cpu: "50m" - memory: "100Mi" - containers: - - name: preview-traq-placeholder - volumeMounts: - - name: config-js - mountPath: /app/override/config.js - subPath: config.js - volumes: - - name: config-json - configMap: - name: preview-traq-config - - name: config-js - emptyDir: {} diff --git a/preview-traq/kustomization.yaml b/preview-traq/kustomization.yaml index c06854b58..9ffc1a1d0 100644 --- a/preview-traq/kustomization.yaml +++ b/preview-traq/kustomization.yaml @@ -15,10 +15,3 @@ helmCharts: namespace: preview-traq releaseName: preview-traq valuesFile: values.yaml - -patches: - - path: deployment-patch.yaml - target: - kind: Deployment - name: preview-traq-.* - namespace: preview-traq diff --git a/preview-traq/values.yaml b/preview-traq/values.yaml index 28fb1ed20..40ff0a67b 100644 --- a/preview-traq/values.yaml +++ b/preview-traq/values.yaml @@ -34,3 +34,14 @@ staging: otherParameters: port: 80 + +containers: + volumeMounts: + - name: config-json + mountPath: /app/override/config.json + subPath: config.json + +volumes: + - name: config-json + configMap: + name: preview-traq-config From 34463203620791a82ee8569f4a99821ec8e6e3e5 Mon Sep 17 00:00:00 2001 From: uni-kakurenbo Date: Wed, 25 Mar 2026 15:52:59 +0900 Subject: [PATCH 3/5] fixup! fixup! feat(traQ): inject config during deployment --- preview-traq/values.yaml | 2 +- traq/frontend/{config.json => config.jsonc} | 7 ++++++- traq/frontend/kustomization.yaml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) rename traq/frontend/{config.json => config.jsonc} (94%) diff --git a/preview-traq/values.yaml b/preview-traq/values.yaml index 40ff0a67b..84ba50542 100644 --- a/preview-traq/values.yaml +++ b/preview-traq/values.yaml @@ -39,7 +39,7 @@ containers: volumeMounts: - name: config-json mountPath: /app/override/config.json - subPath: config.json + subPath: config.jsonc volumes: - name: config-json diff --git a/traq/frontend/config.json b/traq/frontend/config.jsonc similarity index 94% rename from traq/frontend/config.json rename to traq/frontend/config.jsonc index ca89c9b5f..2495f58c0 100644 --- a/traq/frontend/config.json +++ b/traq/frontend/config.jsonc @@ -131,5 +131,10 @@ "#random/wasure", "#services" ], - "iosPwaInfoLink": "https://wiki.trap.jp/SysAd/docs/traQ-S/PWA" + "iosPwaInfoLink": "https://wiki.trap.jp/SysAd/docs/traQ-S/PWA", + "defaultChannelId": [ + "04ad2c18-fdcb-4c43-beef-82e8ba26ac98", // #general of q.trap.jp + "83afc6cc-737d-4868-9a2f-aeb7c199260e" // #general of q-dev.trapti.tech + ], + "fallbackChannelPath": "general" } diff --git a/traq/frontend/kustomization.yaml b/traq/frontend/kustomization.yaml index aeaa10a72..e94dae798 100644 --- a/traq/frontend/kustomization.yaml +++ b/traq/frontend/kustomization.yaml @@ -6,4 +6,4 @@ resources: configMapGenerator: - name: traq-frontend-config files: - - config.json + - config.jsonc From ae1a6b3e8e1971c23680376cc8d5c1e4fb2f1b25 Mon Sep 17 00:00:00 2001 From: uni-kakurenbo Date: Wed, 25 Mar 2026 15:57:21 +0900 Subject: [PATCH 4/5] fixup! fixup! fixup! feat(traQ): inject config during deployment --- traq-dev/frontend/deployment-patch.yaml | 8 ++++++++ traq-dev/frontend/kustomization.yaml | 5 +++++ traq/frontend/kustomization.yaml | 5 ----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/traq-dev/frontend/deployment-patch.yaml b/traq-dev/frontend/deployment-patch.yaml index b0c2b93b0..c5e5e1028 100644 --- a/traq-dev/frontend/deployment-patch.yaml +++ b/traq-dev/frontend/deployment-patch.yaml @@ -21,3 +21,11 @@ spec: value: "1120421442" - name: NEW_RELIC_AGENT_ID value: "1120421442" + volumeMounts: + - name: config-json + mountPath: /app/override/config.json + subPath: config.jsonc + volumes: + - name: config-json + configMap: + name: traq-frontend-config diff --git a/traq-dev/frontend/kustomization.yaml b/traq-dev/frontend/kustomization.yaml index e25b4c5eb..04b148f1b 100644 --- a/traq-dev/frontend/kustomization.yaml +++ b/traq-dev/frontend/kustomization.yaml @@ -1,6 +1,11 @@ resources: - ../../traq/frontend +configMapGenerator: + - name: traq-frontend-config + files: + - ../../traq/frontend/config.jsonc + patches: - path: deployment-patch.yaml target: diff --git a/traq/frontend/kustomization.yaml b/traq/frontend/kustomization.yaml index e94dae798..95daa59cb 100644 --- a/traq/frontend/kustomization.yaml +++ b/traq/frontend/kustomization.yaml @@ -2,8 +2,3 @@ resources: - ./deployment.yaml - ./service.yaml - ./ingress-route.yaml - -configMapGenerator: - - name: traq-frontend-config - files: - - config.jsonc From 57de4db488242cf900e46df2ecf6dc1dc758421f Mon Sep 17 00:00:00 2001 From: uni-kakurenbo Date: Wed, 25 Mar 2026 16:27:36 +0900 Subject: [PATCH 5/5] fixup! fixup! fixup! fixup! feat(traQ): inject config during deployment --- preview-traq/kustomization.yaml | 2 +- traq/frontend/deployment.yaml | 20 +++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/preview-traq/kustomization.yaml b/preview-traq/kustomization.yaml index 9ffc1a1d0..a8624e398 100644 --- a/preview-traq/kustomization.yaml +++ b/preview-traq/kustomization.yaml @@ -5,7 +5,7 @@ configMapGenerator: - name: preview-traq-config namespace: preview-traq files: - - config.json=../traq/frontend/config.json + - config.json=../traq/frontend/config.jsonc options: disableNameSuffixHash: true diff --git a/traq/frontend/deployment.yaml b/traq/frontend/deployment.yaml index e61d07dda..fd4701253 100644 --- a/traq/frontend/deployment.yaml +++ b/traq/frontend/deployment.yaml @@ -16,18 +16,6 @@ spec: spec: nodeSelector: kubernetes.io/hostname: c1-203.tokyotech.org - initContainers: - - name: convert-config - image: busybox:1.36.1 - command: ["sh", "-c"] - args: - - | - echo ";(() => { self.traQConfig = $(cat /config-in/config.json) })()" > /app/override/config.js - volumeMounts: - - name: config-json - mountPath: /config-in - - name: config-js - mountPath: /app/override containers: - image: ghcr.io/traptitech/traq-ui:3.31.2 name: traq-frontend @@ -46,13 +34,11 @@ spec: - name: NEW_RELIC_AGENT_ID value: "1120420953" volumeMounts: - - mountPath: /app/override/config.js - name: config-js - subPath: config.js + - mountPath: /app/override/config.json + name: config-json + subPath: config.jsonc volumes: - configMap: name: traq-frontend-config name: config-json - - emptyDir: {} - name: config-js restartPolicy: Always