From 89b45131d189760106a3e390b21f0e7c0e887161 Mon Sep 17 00:00:00 2001 From: Arnaud AMBROSELLI Date: Thu, 27 Jun 2024 12:25:39 +0200 Subject: [PATCH 1/4] fix: sitemap proxied from nextjs app --- next-app/app/sitemap.xml/route.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 next-app/app/sitemap.xml/route.ts diff --git a/next-app/app/sitemap.xml/route.ts b/next-app/app/sitemap.xml/route.ts new file mode 100644 index 0000000..280a95f --- /dev/null +++ b/next-app/app/sitemap.xml/route.ts @@ -0,0 +1,28 @@ +// sitemap/index.xml +// https://api-ozensemble-site.fabrique.social.gouv.fr/api/sitemap/index.xml +export const dynamic = "force-dynamic" // defaults to auto + +export async function GET() { + const sitemap = await fetch( + "https://api-ozensemble-site.fabrique.social.gouv.fr/api/sitemap/index.xml" + ).then((res) => res.text()) + + if (!sitemap) { + return new Response("It exists but its fucked up", { + headers: { + "Content-Type": "text/xml", + }, + }) + } + return new Response( + sitemap.replace( + ``, + `` + ), + { + headers: { + "Content-Type": "text/xml", + }, + } + ) +} From f58fe7adb1c9beb5478ee0b4fb72ebb54dde5f25 Mon Sep 17 00:00:00 2001 From: YoanRos Date: Thu, 27 Jun 2024 12:33:32 +0200 Subject: [PATCH 2/4] fix: robots.txt to new sitemap --- next-app/public/robots.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/next-app/public/robots.txt b/next-app/public/robots.txt index a6ab962..e99f1f4 100644 --- a/next-app/public/robots.txt +++ b/next-app/public/robots.txt @@ -2,4 +2,4 @@ User-agent: * Allow: /public/ # Allow crawling of pages in the /public/ directory Allow: /images/ # Allow crawling of images Disallow: /fb-redirection/ -Sitemap: https://api-ozensemble-site.fabrique.social.gouv.fr/api/sitemap/index.xml \ No newline at end of file +Sitemap: https://ozensemble-site.fabrique.social.gouv.fr/sitemap.xml \ No newline at end of file From 3c564e6c7b4b26f442dee125461b3100308a3688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 3 Jul 2024 17:25:06 +0200 Subject: [PATCH 3/4] fix: cpu limit --- .kontinuous/env/dev/values.yaml | 2 ++ .kontinuous/values.yaml | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.kontinuous/env/dev/values.yaml b/.kontinuous/env/dev/values.yaml index 6b4a08c..59972c5 100644 --- a/.kontinuous/env/dev/values.yaml +++ b/.kontinuous/env/dev/values.yaml @@ -1,4 +1,6 @@ api: + annotations: + oblik.socialgouv.io/min-limit-cpu: "2" cmd: true args: - sh diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index b2ace57..f61aef9 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -15,8 +15,6 @@ api: ~needs: ["build-api", "pg"] imagePackage: api probesPath: /_health - startupProbe: - initialDelaySeconds: 300 containerPort: "1337" envFrom: - secretRef: From 6b32ad06f557489874ebae980e9a7fa95e92c8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= <38255502+matmut7@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:31:56 +0200 Subject: [PATCH 4/4] fix: better init strapi (#192) --- .kontinuous/env/dev/values.yaml | 35 ++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/.kontinuous/env/dev/values.yaml b/.kontinuous/env/dev/values.yaml index 59972c5..c413b78 100644 --- a/.kontinuous/env/dev/values.yaml +++ b/.kontinuous/env/dev/values.yaml @@ -1,11 +1,4 @@ api: - annotations: - oblik.socialgouv.io/min-limit-cpu: "2" - cmd: true - args: - - sh - - -c - - "yarn strapi import --force -f seed-data.tar.gz && yarn start" ~preDeploy.cleaner: match: kind: Deployment @@ -20,13 +13,37 @@ api: # so public cannot be a volume, it must be its parent # see https://github.com/strapi/strapi/issues/17809 initContainers: - - name: move-public-to-volume + - name: import-and-prepare image: "{{ .Values.global.registry }}/{{ .Values.global.projectName }}/{{ .Values.global.imageRepository }}/api:{{ .Values.global.imageTag }}" command: ["/bin/sh", "-c"] args: - - cp -r public/. /mnt/public; + - | + yarn strapi import --force -f seed-data.tar.gz && \ + cp -r public/. /mnt/public volumeMounts: - name: public mountPath: /mnt/public + envFrom: + - secretRef: + name: pg-app + - secretRef: + name: api + env: + - name: DATABASE_HOST + value: "$(PGHOST)" + - name: DATABASE_PORT + value: "$(PGPORT)" + - name: DATABASE_NAME + value: "$(PGDATABASE)" + - name: DATABASE_USERNAME + value: "$(PGUSER)" + - name: DATABASE_PASSWORD + value: "$(PGPASSWORD)" + - name: HOST + value: "0.0.0.0" + - name: PORT + value: "1337" + - name: DATABASE_CLIENT + value: postgres