rename: homelab-gateway → telegram-gateway
All checks were successful
Docker Build / build-and-push-image (push) Successful in 44s

Aligns the project name with the public URL (tg.arcodange.fr) and the
Arcodange organization conventions. The 'homelab-gateway' name was too
generic.

Touches: chart name + helpers, image registry path, Go module path,
secret/configmap names, deployment mountPath, all docs.
This commit is contained in:
2026-05-09 12:35:03 +02:00
parent ee832de089
commit 13dc7aee13
15 changed files with 68 additions and 68 deletions

View File

@@ -1,10 +1,10 @@
# Deploy `homelab-gateway` — Phase 1 (echo bot) # Deploy `telegram-gateway` — Phase 1 (echo bot)
Procédure end-to-end pour mettre le gateway en ligne avec un bot Procédure end-to-end pour mettre le gateway en ligne avec un bot
`arcodange_factory_bot` (slug interne `factory`). `arcodange_factory_bot` (slug interne `factory`).
> Phase 1 simplifiée : **pas de Vault**. Le `Secret` k8s > Phase 1 simplifiée : **pas de Vault**. Le `Secret` k8s
> `homelab-gateway-bots` est créé manuellement avec `kubectl create secret`. > `telegram-gateway-bots` est créé manuellement avec `kubectl create secret`.
> La migration vers Vault Secrets Operator se fait plus tard (Phase 2+) via > La migration vers Vault Secrets Operator se fait plus tard (Phase 2+) via
> `vault.enabled: true` dans `chart/values.yaml`. > `vault.enabled: true` dans `chart/values.yaml`.
@@ -12,7 +12,7 @@ Procédure end-to-end pour mettre le gateway en ligne avec un bot
## 1. Pré-requis ## 1. Pré-requis
- Repo Gitea déjà créé : `arcodange/homelab-gateway` - Repo Gitea déjà créé : `arcodange/telegram-gateway`
- Bot Telegram déjà créé via @BotFather : `@arcodange_factory_bot` - Bot Telegram déjà créé via @BotFather : `@arcodange_factory_bot`
- Token : `8737289837:…` (en variable d'env, jamais committé) - Token : `8737289837:…` (en variable d'env, jamais committé)
- chat_id : récupéré via [@userinfobot](https://t.me/userinfobot) - chat_id : récupéré via [@userinfobot](https://t.me/userinfobot)
@@ -23,17 +23,17 @@ Procédure end-to-end pour mettre le gateway en ligne avec un bot
## 2. Push du repo (déclenche le build Docker) ## 2. Push du repo (déclenche le build Docker)
```bash ```bash
cd /Users/gabrielradureau/Work/Vibe/homelab_gateway cd /Users/gabrielradureau/Work/Vibe/telegram-gateway
git init git init
git add . git add .
git commit -m "Phase 1 MVP — echo bot factory" git commit -m "Phase 1 MVP — echo bot factory"
git branch -M main git branch -M main
git remote add origin ssh://git@192.168.1.202:2222/arcodange/homelab-gateway.git git remote add origin ssh://git@192.168.1.202:2222/arcodange/telegram-gateway.git
git push -u origin main git push -u origin main
``` ```
Gitea Actions build l'image et la pousse : Gitea Actions build l'image et la pousse :
`gitea.arcodange.lab/arcodange/homelab-gateway:latest`. `gitea.arcodange.lab/arcodange/telegram-gateway:latest`.
## 3. Créer le `Secret` k8s avec le token + secret_token ## 3. Créer le `Secret` k8s avec le token + secret_token
@@ -43,9 +43,9 @@ SECRET=$(openssl rand -hex 32)
# Le namespace est créé par ArgoCD si absent — on le crée explicitement avant # Le namespace est créé par ArgoCD si absent — on le crée explicitement avant
# pour pouvoir y poser le Secret tout de suite. # pour pouvoir y poser le Secret tout de suite.
kubectl create namespace homelab-gateway --dry-run=client -o yaml | kubectl apply -f - kubectl create namespace telegram-gateway --dry-run=client -o yaml | kubectl apply -f -
kubectl -n homelab-gateway create secret generic homelab-gateway-bots \ kubectl -n telegram-gateway create secret generic telegram-gateway-bots \
--from-literal=BOT_FACTORY_TOKEN='8737289837:AAEVIygazfxgqJTxaxOh3X-mEoKaV7Rw1Gw' \ --from-literal=BOT_FACTORY_TOKEN='8737289837:AAEVIygazfxgqJTxaxOh3X-mEoKaV7Rw1Gw' \
--from-literal=BOT_FACTORY_SECRET="$SECRET" --from-literal=BOT_FACTORY_SECRET="$SECRET"
@@ -60,15 +60,15 @@ echo "secret_token = $SECRET"
## 4. Activer l'Application ArgoCD ## 4. Activer l'Application ArgoCD
L'entrée `homelab-gateway` est ajoutée dans L'entrée `telegram-gateway` est ajoutée dans
`/Users/gabrielradureau/Work/Arcodange/factory/argocd/values.yaml` (PR `/Users/gabrielradureau/Work/Arcodange/factory/argocd/values.yaml` (PR
ouverte). Une fois la PR mergée : ouverte). Une fois la PR mergée :
```bash ```bash
kubectl -n argocd get app homelab-gateway -w kubectl -n argocd get app telegram-gateway -w
# attends Healthy + Synced # attends Healthy + Synced
kubectl -n homelab-gateway logs deploy/homelab-gateway -f kubectl -n telegram-gateway logs deploy/telegram-gateway -f
# attends "homelab-gateway listening on :8080 (1 bot(s) loaded)" # attends "telegram-gateway listening on :8080 (1 bot(s) loaded)"
# Smoke # Smoke
curl -I https://tg.arcodange.fr/healthz # → 200 curl -I https://tg.arcodange.fr/healthz # → 200
@@ -79,7 +79,7 @@ curl -I https://tg.arcodange.fr/healthz # → 200
```bash ```bash
export BOT_FACTORY_TOKEN='8737289837:AAEVIygazfxgqJTxaxOh3X-mEoKaV7Rw1Gw' export BOT_FACTORY_TOKEN='8737289837:AAEVIygazfxgqJTxaxOh3X-mEoKaV7Rw1Gw'
export BOT_FACTORY_SECRET="$SECRET" # même valeur qu'à l'étape 3 export BOT_FACTORY_SECRET="$SECRET" # même valeur qu'à l'étape 3
cd /Users/gabrielradureau/Work/Vibe/homelab_gateway cd /Users/gabrielradureau/Work/Vibe/telegram-gateway
make setwebhook SLUG=factory BASE_URL=https://tg.arcodange.fr make setwebhook SLUG=factory BASE_URL=https://tg.arcodange.fr
# → "webhook set: url=https://tg.arcodange.fr/bot/factory pending=0 last_err=\"\"" # → "webhook set: url=https://tg.arcodange.fr/bot/factory pending=0 last_err=\"\""
``` ```
@@ -100,8 +100,8 @@ Pour le test `/echo coucou` répond `coucou`.
| Symptôme | Action | | Symptôme | Action |
|---|---| |---|---|
| Pod `CreateContainerConfigError` | Le Secret `homelab-gateway-bots` manque. Le créer (étape 3). | | Pod `CreateContainerConfigError` | Le Secret `telegram-gateway-bots` manque. Le créer (étape 3). |
| Pod `CrashLoopBackOff` "no bots in /etc/…/bots.yaml" | ConfigMap pas généré ou mal monté. `kubectl get cm -n homelab-gateway -o yaml`. | | Pod `CrashLoopBackOff` "no bots in /etc/…/bots.yaml" | ConfigMap pas généré ou mal monté. `kubectl get cm -n telegram-gateway -o yaml`. |
| `curl https://tg.arcodange.fr/healthz` → 502/504 | Ingress pas encore propagé OU le pod n'est pas Ready. `kubectl describe ingress` + `kubectl describe pod`. | | `curl https://tg.arcodange.fr/healthz` → 502/504 | Ingress pas encore propagé OU le pod n'est pas Ready. `kubectl describe ingress` + `kubectl describe pod`. |
| `setWebhook``Wrong response from the webhook: 401` | `BOT_FACTORY_SECRET` côté Secret ≠ celui passé à setWebhook. Régénérer + recréer le Secret avec `kubectl delete && create`. | | `setWebhook``Wrong response from the webhook: 401` | `BOT_FACTORY_SECRET` côté Secret ≠ celui passé à setWebhook. Régénérer + recréer le Secret avec `kubectl delete && create`. |
| Webhook accepté mais pas de réponse Telegram | `kubectl logs` côté gateway → erreur sendMessage. Token bot invalide (révoqué via @BotFather ?) ou rate-limit Telegram. | | Webhook accepté mais pas de réponse Telegram | `kubectl logs` côté gateway → erreur sendMessage. Token bot invalide (révoqué via @BotFather ?) ou rate-limit Telegram. |
@@ -112,6 +112,6 @@ Pour le test `/echo coucou` répond `coucou`.
- Phase 3 : handlers `shell` / `script` / `ollama` async, retry quand le - Phase 3 : handlers `shell` / `script` / `ollama` async, retry quand le
Macbook Ollama est endormi. Macbook Ollama est endormi.
- Phase 4 : passage à Vault (toggle `vault.enabled: true` + provisionner - Phase 4 : passage à Vault (toggle `vault.enabled: true` + provisionner
`kvv2/homelab-gateway/config`), Wake-on-LAN, multi-provider. `kvv2/telegram-gateway/config`), Wake-on-LAN, multi-provider.
Plan complet : `~/.claude/plans/pour-les-notifications-on-inherited-seal.md`. Plan complet : `~/.claude/plans/pour-les-notifications-on-inherited-seal.md`.

View File

@@ -1,6 +1,6 @@
SHELL := /bin/bash SHELL := /bin/bash
APP := homelab-gateway APP := telegram-gateway
IMAGE := gitea.arcodange.lab/arcodange-org/$(APP) IMAGE := gitea.arcodange.lab/arcodange/$(APP)
TAG ?= dev TAG ?= dev
.PHONY: build test vet tidy run docker push setwebhook deletewebhook .PHONY: build test vet tidy run docker push setwebhook deletewebhook

View File

@@ -1,4 +1,4 @@
# homelab-gateway # telegram-gateway
Telegram **webhook gateway** for the Arcodange home lab. Replaces polling-based Telegram **webhook gateway** for the Arcodange home lab. Replaces polling-based
bots (e.g. those scheduled in Cowork) with direct webhook delivery from bots (e.g. those scheduled in Cowork) with direct webhook delivery from
@@ -13,7 +13,7 @@ See the design doc at `~/.claude/plans/pour-les-notifications-on-inherited-seal.
## Architecture (current) ## Architecture (current)
``` ```
Telegram → Cloudflare Tunnel (tg.arcodange.fr) → Service homelab-gateway:8080 Telegram → Cloudflare Tunnel (tg.arcodange.fr) → Service telegram-gateway:8080
→ /bot/<slug> → secret_token check → handler dispatch → Bot API sendMessage → /bot/<slug> → secret_token check → handler dispatch → Bot API sendMessage
``` ```
@@ -55,19 +55,19 @@ make deletewebhook SLUG=factory
## Configuration ## Configuration
- **Routing** (non-secret): YAML at `$CONFIG_PATH` (default - **Routing** (non-secret): YAML at `$CONFIG_PATH` (default
`/etc/homelab-gateway/bots.yaml`, mounted from a ConfigMap in cluster). `/etc/telegram-gateway/bots.yaml`, mounted from a ConfigMap in cluster).
- **Secrets**: per-bot env vars `BOT_<UPPER_SLUG>_TOKEN`, - **Secrets**: per-bot env vars `BOT_<UPPER_SLUG>_TOKEN`,
`BOT_<UPPER_SLUG>_SECRET`. Sourced from Vault path `BOT_<UPPER_SLUG>_SECRET`. Sourced from Vault path
`kvv2/homelab-gateway/config` via Vault Secrets Operator. `kvv2/telegram-gateway/config` via Vault Secrets Operator.
## Cluster deploy ## Cluster deploy
- Image: `gitea.arcodange.lab/arcodange/homelab-gateway:<tag>` - Image: `gitea.arcodange.lab/arcodange/telegram-gateway:<tag>`
- Helm chart: `chart/` - Helm chart: `chart/`
- ArgoCD app: `homelab-gateway` (in `factory/argocd/values.yaml`) - ArgoCD app: `telegram-gateway` (in `factory/argocd/values.yaml`)
- Public URL: `https://tg.arcodange.fr` (Cloudflare déjà configuré pour - Public URL: `https://tg.arcodange.fr` (Cloudflare déjà configuré pour
router `*.arcodange.fr` vers le home lab → Traefik route par Host) router `*.arcodange.fr` vers le home lab → Traefik route par Host)
- Secrets Phase 1 : `kubectl create secret generic homelab-gateway-bots …` - Secrets Phase 1 : `kubectl create secret generic telegram-gateway-bots …`
(sans Vault). Migration vers Vault Secrets Operator en Phase 2+ via (sans Vault). Migration vers Vault Secrets Operator en Phase 2+ via
`vault.enabled: true` dans `chart/values.yaml`. `vault.enabled: true` dans `chart/values.yaml`.

View File

@@ -1,6 +1,6 @@
apiVersion: v2 apiVersion: v2
name: homelab-gateway name: telegram-gateway
description: Telegram webhook gateway for the Arcodange home lab description: Telegram webhook gateway for the Arcodange home lab (tg.arcodange.fr)
type: application type: application
version: 0.1.0 version: 0.1.0
appVersion: "0.1.0" appVersion: "0.1.0"

View File

@@ -1,14 +1,14 @@
{{/* {{/*
Expand the name of the chart. Expand the name of the chart.
*/}} */}}
{{- define "homelab-gateway.name" -}} {{- define "telegram-gateway.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }} {{- end }}
{{/* {{/*
Create a default fully qualified app name. Create a default fully qualified app name.
*/}} */}}
{{- define "homelab-gateway.fullname" -}} {{- define "telegram-gateway.fullname" -}}
{{- if .Values.fullnameOverride }} {{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }} {{- else }}
@@ -24,16 +24,16 @@ Create a default fully qualified app name.
{{/* {{/*
Chart name + version label value. Chart name + version label value.
*/}} */}}
{{- define "homelab-gateway.chart" -}} {{- define "telegram-gateway.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }} {{- end }}
{{/* {{/*
Common labels. Common labels.
*/}} */}}
{{- define "homelab-gateway.labels" -}} {{- define "telegram-gateway.labels" -}}
helm.sh/chart: {{ include "homelab-gateway.chart" . }} helm.sh/chart: {{ include "telegram-gateway.chart" . }}
{{ include "homelab-gateway.selectorLabels" . }} {{ include "telegram-gateway.selectorLabels" . }}
{{- if .Chart.AppVersion }} {{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }} {{- end }}
@@ -43,17 +43,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/* {{/*
Selector labels. Selector labels.
*/}} */}}
{{- define "homelab-gateway.selectorLabels" -}} {{- define "telegram-gateway.selectorLabels" -}}
app.kubernetes.io/name: {{ include "homelab-gateway.name" . }} app.kubernetes.io/name: {{ include "telegram-gateway.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }} {{- end }}
{{/* {{/*
Service account name. Service account name.
*/}} */}}
{{- define "homelab-gateway.serviceAccountName" -}} {{- define "telegram-gateway.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }} {{- if .Values.serviceAccount.create }}
{{- default (include "homelab-gateway.fullname" .) .Values.serviceAccount.name }} {{- default (include "telegram-gateway.fullname" .) .Values.serviceAccount.name }}
{{- else }} {{- else }}
{{- default "default" .Values.serviceAccount.name }} {{- default "default" .Values.serviceAccount.name }}
{{- end }} {{- end }}

View File

@@ -1,10 +1,10 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "homelab-gateway.fullname" . }}-bots name: {{ include "telegram-gateway.fullname" . }}-bots
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "homelab-gateway.labels" . | nindent 4 }} {{- include "telegram-gateway.labels" . | nindent 4 }}
data: data:
bots.yaml: | bots.yaml: |
bots: bots:

View File

@@ -1,10 +1,10 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "homelab-gateway.fullname" . }} name: {{ include "telegram-gateway.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "homelab-gateway.labels" . | nindent 4 }} {{- include "telegram-gateway.labels" . | nindent 4 }}
spec: spec:
revisionHistoryLimit: 3 revisionHistoryLimit: 3
{{- if not .Values.autoscaling.enabled }} {{- if not .Values.autoscaling.enabled }}
@@ -12,7 +12,7 @@ spec:
{{- end }} {{- end }}
selector: selector:
matchLabels: matchLabels:
{{- include "homelab-gateway.selectorLabels" . | nindent 6 }} {{- include "telegram-gateway.selectorLabels" . | nindent 6 }}
template: template:
metadata: metadata:
annotations: annotations:
@@ -21,7 +21,7 @@ spec:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
labels: labels:
{{- include "homelab-gateway.labels" . | nindent 8 }} {{- include "telegram-gateway.labels" . | nindent 8 }}
{{- with .Values.podLabels }} {{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
@@ -30,7 +30,7 @@ spec:
imagePullSecrets: imagePullSecrets:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
serviceAccountName: {{ include "homelab-gateway.serviceAccountName" . }} serviceAccountName: {{ include "telegram-gateway.serviceAccountName" . }}
securityContext: securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }} {{- toYaml .Values.podSecurityContext | nindent 8 }}
containers: containers:
@@ -39,12 +39,12 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }} {{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["serve", "--config", "/etc/homelab-gateway/bots.yaml", "--addr", ":{{ .Values.service.port }}"] args: ["serve", "--config", "/etc/telegram-gateway/bots.yaml", "--addr", ":{{ .Values.service.port }}"]
env: env:
- name: LISTEN_ADDR - name: LISTEN_ADDR
value: ":{{ .Values.service.port }}" value: ":{{ .Values.service.port }}"
- name: CONFIG_PATH - name: CONFIG_PATH
value: /etc/homelab-gateway/bots.yaml value: /etc/telegram-gateway/bots.yaml
envFrom: envFrom:
- secretRef: - secretRef:
name: {{ .Values.secret.name }} name: {{ .Values.secret.name }}
@@ -60,14 +60,14 @@ spec:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
volumeMounts: volumeMounts:
- name: bots-config - name: bots-config
mountPath: /etc/homelab-gateway mountPath: /etc/telegram-gateway
readOnly: true readOnly: true
- name: tmp - name: tmp
mountPath: /tmp mountPath: /tmp
volumes: volumes:
- name: bots-config - name: bots-config
configMap: configMap:
name: {{ include "homelab-gateway.fullname" . }}-bots name: {{ include "telegram-gateway.fullname" . }}-bots
- name: tmp - name: tmp
emptyDir: {} emptyDir: {}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}

View File

@@ -2,10 +2,10 @@
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ include "homelab-gateway.fullname" . }} name: {{ include "telegram-gateway.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "homelab-gateway.labels" . | nindent 4 }} {{- include "telegram-gateway.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }} {{- with .Values.ingress.annotations }}
annotations: annotations:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
@@ -28,7 +28,7 @@ spec:
pathType: {{ .pathType }} pathType: {{ .pathType }}
backend: backend:
service: service:
name: {{ include "homelab-gateway.fullname" $ }} name: {{ include "telegram-gateway.fullname" $ }}
port: port:
number: {{ $.Values.service.port }} number: {{ $.Values.service.port }}
{{- end }} {{- end }}

View File

@@ -1,10 +1,10 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ include "homelab-gateway.fullname" . }} name: {{ include "telegram-gateway.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "homelab-gateway.labels" . | nindent 4 }} {{- include "telegram-gateway.labels" . | nindent 4 }}
spec: spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
ports: ports:
@@ -13,4 +13,4 @@ spec:
protocol: TCP protocol: TCP
name: http name: http
selector: selector:
{{- include "homelab-gateway.selectorLabels" . | nindent 4 }} {{- include "telegram-gateway.selectorLabels" . | nindent 4 }}

View File

@@ -2,10 +2,10 @@
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: {{ include "homelab-gateway.serviceAccountName" . }} name: {{ include "telegram-gateway.serviceAccountName" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "homelab-gateway.labels" . | nindent 4 }} {{- include "telegram-gateway.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }} {{- with .Values.serviceAccount.annotations }}
annotations: annotations:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}

View File

@@ -5,13 +5,13 @@ metadata:
name: auth name: auth
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "homelab-gateway.labels" . | nindent 4 }} {{- include "telegram-gateway.labels" . | nindent 4 }}
spec: spec:
method: kubernetes method: kubernetes
mount: kubernetes mount: kubernetes
kubernetes: kubernetes:
role: {{ .Values.vault.role }} role: {{ .Values.vault.role }}
serviceAccount: {{ include "homelab-gateway.serviceAccountName" . }} serviceAccount: {{ include "telegram-gateway.serviceAccountName" . }}
audiences: audiences:
- vault - vault
{{- end }} {{- end }}

View File

@@ -5,7 +5,7 @@ metadata:
name: bots-secrets name: bots-secrets
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "homelab-gateway.labels" . | nindent 4 }} {{- include "telegram-gateway.labels" . | nindent 4 }}
spec: spec:
type: kv-v2 type: kv-v2
mount: {{ .Values.vault.mount }} mount: {{ .Values.vault.mount }}

View File

@@ -1,7 +1,7 @@
replicaCount: 1 replicaCount: 1
image: image:
repository: gitea.arcodange.lab/arcodange/homelab-gateway repository: gitea.arcodange.lab/arcodange/telegram-gateway
pullPolicy: Always pullPolicy: Always
tag: "" tag: ""
@@ -85,18 +85,18 @@ bots:
handler: echo handler: echo
# k8s Secret consumed by `envFrom`. Phase 1: create it manually with kubectl. # k8s Secret consumed by `envFrom`. Phase 1: create it manually with kubectl.
# kubectl -n homelab-gateway create secret generic homelab-gateway-bots \ # kubectl -n telegram-gateway create secret generic telegram-gateway-bots \
# --from-literal=BOT_FACTORY_TOKEN=… --from-literal=BOT_FACTORY_SECRET=… # --from-literal=BOT_FACTORY_TOKEN=… --from-literal=BOT_FACTORY_SECRET=…
secret: secret:
name: homelab-gateway-bots name: telegram-gateway-bots
# Vault Secrets Operator integration (Phase 2+). When enabled, VSO writes the # Vault Secrets Operator integration (Phase 2+). When enabled, VSO writes the
# secret named `secret.name` automatically from `kvv2/homelab-gateway/config`. # secret named `secret.name` automatically from `kvv2/telegram-gateway/config`.
vault: vault:
enabled: false enabled: false
role: homelab-gateway role: telegram-gateway
mount: kvv2 mount: kvv2
path: homelab-gateway/config path: telegram-gateway/config
refreshAfter: 30s refreshAfter: 30s
nodeSelector: nodeSelector:

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/arcodange-org/homelab-gateway module github.com/arcodange/telegram-gateway
go 1.23 go 1.23

View File

@@ -13,7 +13,7 @@ import (
) )
const defaultListenAddr = ":8080" const defaultListenAddr = ":8080"
const defaultConfigPath = "/etc/homelab-gateway/bots.yaml" const defaultConfigPath = "/etc/telegram-gateway/bots.yaml"
func main() { func main() {
subcmd := "" subcmd := ""
@@ -62,7 +62,7 @@ func runServer() {
defer stop() defer stop()
go func() { go func() {
log.Printf("homelab-gateway listening on %s (%d bot(s) loaded)", *addr, registry.Count()) log.Printf("telegram-gateway listening on %s (%d bot(s) loaded)", *addr, registry.Count())
if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) { if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
log.Fatalf("server: %v", err) log.Fatalf("server: %v", err)
} }