From a546db566b4dccbfd08d79f9f0866512f2ce5e86 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Tue, 11 Mar 2025 15:51:13 -0400 Subject: [PATCH 1/3] =?UTF-8?q?deployment:=20d=C3=A9placer=20compose.yaml?= =?UTF-8?q?=20et=20Dockerfile=20vers=20racine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plus standard si focus user experience --- deployments/docker/agendas/Dockerfile => Dockerfile | 0 deployments/compose/full/compose.yaml => compose.yaml | 4 +--- 2 files changed, 1 insertion(+), 3 deletions(-) rename deployments/docker/agendas/Dockerfile => Dockerfile (100%) rename deployments/compose/full/compose.yaml => compose.yaml (87%) diff --git a/deployments/docker/agendas/Dockerfile b/Dockerfile similarity index 100% rename from deployments/docker/agendas/Dockerfile rename to Dockerfile diff --git a/deployments/compose/full/compose.yaml b/compose.yaml similarity index 87% rename from deployments/compose/full/compose.yaml rename to compose.yaml index da4bc83..2419186 100644 --- a/deployments/compose/full/compose.yaml +++ b/compose.yaml @@ -14,9 +14,7 @@ services: depends_on: - 'db' image: 'git.agecem.com/bottin/agendas:latest' - build: - context: '../../../' - dockerfile: './deployments/docker/agendas/Dockerfile' + build: '.' restart: 'unless-stopped' ports: - '3333:3333' From 7bb4a6356c6349aebdb8a4b89cb70fcf376bca89 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Thu, 13 Mar 2025 17:58:41 -0400 Subject: [PATCH 2/3] 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 3/3] =?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