From 7bb4a6356c6349aebdb8a4b89cb70fcf376bca89 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Thu, 13 Mar 2025 17:58:41 -0400 Subject: [PATCH 1/2] fix: ajouter route /nothing/ au ui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Certains boutons appelent cette page pour clearer un div, ça marche sans cette route mais ça call une erreur dans la console. --- server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.go b/server.go index a9a4117..b27a5de 100644 --- a/server.go +++ b/server.go @@ -5,6 +5,7 @@ import ( "crypto/subtle" "fmt" "log" + "net/http" "git.agecem.com/bottin/agendas/ui" "git.agecem.com/bottin/bottin/v10/pkg/bottin" @@ -63,6 +64,7 @@ func RunServer(ctx context.Context, cfg Config, bottinClient *bottin.APIClient, ) e.GET("/", UIIndex(ctx, bottinClient, dbClient)) + e.GET("/nothing/", func(c echo.Context) error { return c.NoContent(http.StatusOK) }) //e.GET("/transaction/", UIReadTransaction e.POST("/transaction/", UICreateTransaction(ctx, cfg, bottinClient, dbClient)) From e11206c492d483f65f0b02824e7a8bdaaf2e00d7 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Thu, 13 Mar 2025 18:52:39 -0400 Subject: [PATCH 2/2] =?UTF-8?q?k8s:=20ajouter=20fichiers=20de=20d=C3=A9plo?= =?UTF-8?q?iement=20de=20base?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inclut des manifests pour le Deployment, le Service et un example de Secret ConfigMap. --- .gitignore | 1 + k8s/deployment.yaml | 45 +++++++++++++++++++++++++++++++++++++++++ k8s/example-secret.yaml | 31 ++++++++++++++++++++++++++++ k8s/service.yaml | 11 ++++++++++ 4 files changed, 88 insertions(+) create mode 100644 k8s/deployment.yaml create mode 100644 k8s/example-secret.yaml create mode 100644 k8s/service.yaml diff --git a/.gitignore b/.gitignore index 19ace02..b27f105 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .env .swp +k8s/prod.secret.yaml diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..306161c --- /dev/null +++ b/k8s/deployment.yaml @@ -0,0 +1,45 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: agendas-deployment + labels: + app: agendas +spec: + replicas: 1 + selector: + matchLabels: + app: agendas + template: + metadata: + labels: + app: agendas + spec: + containers: + - name: agendas + image: git.agecem.com/bottin/agendas:latest + command: ['agendas', '--config', '/etc/agendas/config.yaml'] + imagePullPolicy: Always + ports: + - containerPort: 3333 + volumeMounts: + - name: config-secret + mountPath: '/etc/agendas/' + readOnly: true + - name: localtime + mountPath: /etc/localtime + readOnly: true + volumes: + - name: config-secret + secret: + secretName: agendas-config-secret + items: + - key: config.yaml + path: config.yaml + - key: cert.pem + path: cert.pem + - key: key.pem + path: key.pem + - name: localtime + hostPath: + path: /etc/localtime + type: File diff --git a/k8s/example-secret.yaml b/k8s/example-secret.yaml new file mode 100644 index 0000000..06edeaf --- /dev/null +++ b/k8s/example-secret.yaml @@ -0,0 +1,31 @@ +apiVersion: v1 +kind: Secret +metadata: + name: agendas-config-secret +type: Opaque +stringData: + config.yaml: | + Bottin: + Host: 'api.bottin.agecem.com' + Key: 'CHANGE_ME' + Port: 443 + TLS: + Enabled: true + SkipVerify: false + Credentials: + 'agendas': 'CHANGE_ME' + DB: + Database: 'agendas' + Host: 'db' + Password: 'CHANGE_ME' + Port: 5432 + SSLMode: 'prefer' + Username: 'agendas' + TLS: + Enabled: true + Cert: '/etc/agendas/cert.pem' + Key: '/etc/agendas/key.pem' + cert.pem: | + CHANGE_ME + key.pem: | + CHANGE_ME diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..1b8bd17 --- /dev/null +++ b/k8s/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: agendas-service +spec: + type: NodePort + selector: + app: agendas + ports: + - protocol: TCP + port: 3333