Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: SocialGouv/ozensemble-site
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.28.9
Choose a base ref
...
head repository: SocialGouv/ozensemble-site
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 9 commits
  • 23 files changed
  • 7 contributors

Commits on Jul 5, 2024

  1. fix: correct values (#191)

    igorrenquin authored Jul 5, 2024
    Copy the full SHA
    be85e5f View commit details

Commits on Jul 8, 2024

  1. fix: sitemap proxied from nextjs app (#183)

    * fix: sitemap proxied from nextjs app
    
    * fix: robots.txt to new sitemap
    
    * fix: cpu limit
    
    * fix: better init strapi (#192)
    
    ---------
    
    Co-authored-by: YoanRos <[email protected]>
    Co-authored-by: Matéo Mévollon <[email protected]>
    Co-authored-by: Matéo Mévollon <[email protected]>
    4 people authored Jul 8, 2024
    Copy the full SHA
    ec9c454 View commit details

Commits on Jul 17, 2024

  1. feat: add nutri app logo

    YoanRos committed Jul 17, 2024
    Copy the full SHA
    bcf7d4c View commit details

Commits on Jul 18, 2024

  1. feat: first draft (#193)

    * feat: first draft
    
    * fix: no data yet
    YoanRos authored Jul 18, 2024
    Copy the full SHA
    0dac869 View commit details

Commits on Jul 24, 2024

  1. feat: add fetching (#195)

    YoanRos authored Jul 24, 2024
    Copy the full SHA
    5da6ce3 View commit details

Commits on Jul 30, 2024

  1. fix: add blocks (#196)

    YoanRos authored Jul 30, 2024
    Copy the full SHA
    39b8d40 View commit details
  2. fix: taille vignettes

    YoanRos committed Jul 30, 2024
    Copy the full SHA
    a4b9b69 View commit details

Commits on Oct 14, 2024

  1. fix: raise memory request

    matmut7 committed Oct 14, 2024
    Copy the full SHA
    56424bd View commit details

Commits on Nov 28, 2024

  1. fix: Strapi on S3 (#201)

    * deploy
    
    * feat: add s3 plugin config
    
    * feat: add s3 secret reference in kontinuous
    
    * fix: strapi env
    
    * fix: add s3 plugin
    
    * Revert "fix: add s3 plugin"
    
    This reverts commit 789fd45.
    
    * fix: install s3 plugin in strapi dir
    
    * fix: s3 config
    
    * fix: cleaning
    
    * remove initContainer
    
    * fix: CSP
    
    * runtime env
    
    * default
    
    * new seed
    
    * wip
    
    * wip
    
    * wip
    
    * deactivate
    
    * fix: deactivate
    
    * fix: move deactivate
    
    * fix: kontinuous config
    
    * fix: api secrets
    
    * fix: secret refs
    
    ---------
    
    Co-authored-by: Gary van Woerkens <[email protected]>
    matmut7 and gary-van-woerkens authored Nov 28, 2024
    Copy the full SHA
    a21d8e5 View commit details
104 changes: 80 additions & 24 deletions .kontinuous/env/dev/values.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,86 @@
api:
cmd: true
args:
- sh
- -c
- "yarn strapi import --force -f seed-data.tar.gz && yarn start"
~preDeploy.cleaner:
match:
kind: Deployment
value: true
volumes:
- name: public
volumeMounts:
- mountPath: /app/public
name: public
vars:
ENV: review
envFrom:
- secretRef:
name: pg-app
- secretRef:
name: api
- secretRef:
name: ozensemble-dev-app-access-key

# Strapi wants to move the entire uploads dir to a backup when you import data
# 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
image:
"{{ .Values.global.registry }}/{{ .Values.global.projectName }}/{{
- name: import
image: "{{ .Values.global.registry }}/{{ .Values.global.projectName }}/{{
.Values.global.imageRepository }}/api:{{ .Values.global.imageTag }}"
command: ["/bin/sh", "-c"]
args:
- cp -r public/. /mnt/public;
volumeMounts:
- name: public
mountPath: /mnt/public
- |
yarn strapi import --force -f seed-data.tar.gz
envFrom:
- secretRef:
name: pg-app
- secretRef:
name: api
- secretRef:
name: ozensemble-dev-app-access-key
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
- name: ENV
value: review
- name: BRANCH_NAME
value: "{{ .Values.global.branchSlug }}"

deactivate:
jobs-deactivate:
runs:
cleanup-bucket:
image: bitnami/rclone:latest
run: |
rclone purge remote:${BUCKET_NAME}/{{ .Values.global.branchSlug }}
checkout: false
env:
- name: RCLONE_CONFIG_REMOTE_TYPE
value: s3
- name: RCLONE_CONFIG_REMOTE_PROVIDER
value: Other
- name: RCLONE_CONFIG_REMOTE_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: ozensemble-dev-app-access-key
key: bucket_access_key
- name: RCLONE_CONFIG_REMOTE_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: ozensemble-dev-app-access-key
key: bucket_secret_key
- name: RCLONE_CONFIG_REMOTE_REGION
valueFrom:
secretKeyRef:
name: ozensemble-dev-app-access-key
key: bucket_region
- name: RCLONE_CONFIG_REMOTE_ENDPOINT
valueFrom:
secretKeyRef:
name: ozensemble-dev-app-access-key
key: bucket_endpoint
- name: BUCKET_NAME
valueFrom:
secretKeyRef:
name: ozensemble-dev-app-access-key
key: bucket_name
9 changes: 9 additions & 0 deletions .kontinuous/env/preprod/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
api:
vars:
ENV: preprod
addVolumes:
- uploads
volumeMounts:
- mountPath: /app/public/uploads
name: uploads
envFrom:
- secretRef:
name: pg-app
- secretRef:
name: api
- secretRef:
name: ozensemble-dev-app-access-key
13 changes: 11 additions & 2 deletions .kontinuous/env/prod/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
api:
vars:
ENV: prod
addVolumes:
- uploads
volumeMounts:
@@ -7,10 +9,17 @@ api:
resources:
requests:
cpu: "100m"
memory: 768Mi
memory: "768Mi"
limits:
cpu: "300m"
memory: "1Gi"
envFrom:
- secretRef:
name: pg-app
- secretRef:
name: api
- secretRef:
name: ozensemble-prod-app-access-key

next-app:
host: ozensemble.fabrique.social.gouv.fr
@@ -20,7 +29,7 @@ next-app:
resources:
requests:
cpu: "200m"
memory: "256Mi
memory: "512Mi"
limits:
cpu: "300m"
memory: "512Mi"
9 changes: 2 additions & 7 deletions .kontinuous/values.yaml
Original file line number Diff line number Diff line change
@@ -15,14 +15,8 @@ api:
~needs: ["build-api", "pg"]
imagePackage: api
probesPath: /_health
startupProbe:
initialDelaySeconds: 300
containerPort: "1337"
envFrom:
- secretRef:
name: pg-app
- secretRef:
name: api

vars:
DATABASE_HOST: "$(PGHOST)"
DATABASE_PORT: "$(PGPORT)"
@@ -32,6 +26,7 @@ api:
HOST: "0.0.0.0"
PORT: "1337"
DATABASE_CLIENT: postgres
BRANCH_NAME: "{{ .Values.global.branchSlug }}"
replicas: 1 # mandatory because volume is RWO
strategyType: Recreate # idem
securityContext:
55 changes: 43 additions & 12 deletions api/config/middlewares.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,43 @@
module.exports = [
'strapi::logger',
'strapi::errors',
'strapi::security',
'strapi::cors',
'strapi::poweredBy',
'strapi::query',
'strapi::body',
'strapi::session',
'strapi::favicon',
'strapi::public',
];
module.exports = ({ env }) => [
"strapi::logger",
"strapi::errors",
{
name: "strapi::security",
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
"connect-src": ["'self'", "https:"],
"img-src": [
"'self'",
"data:",
"blob:",
"market-assets.strapi.io",
`${env("bucket_name")}.${
new URL(env("bucket_endpoint", "https://fabrique.social.gouv.fr"))
.hostname
}`,
],
"media-src": [
"'self'",
"data:",
"blob:",
"market-assets.strapi.io",
`${env("bucket_name")}.${
new URL(env("bucket_endpoint", "https://fabrique.social.gouv.fr"))
.hostname
}`,
],
upgradeInsecureRequests: null,
},
},
},
},
"strapi::cors",
"strapi::poweredBy",
"strapi::query",
"strapi::body",
"strapi::session",
"strapi::favicon",
"strapi::public",
]
50 changes: 38 additions & 12 deletions api/config/plugins.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
module.exports = () => ({
'sitemap': {
enabled: true,
config: {
cron: '0 0 0 * * *',
limit: 45000,
xsl: true,
autoGenerate: false,
caching: true,
allowedFields: ['id', 'uid'],
excludedTypes: [],
module.exports = ({ env }) => ({
sitemap: {
enabled: true,
config: {
cron: "0 0 0 * * *",
limit: 45000,
xsl: true,
autoGenerate: false,
caching: true,
allowedFields: ["id", "uid"],
excludedTypes: [],
},
},
upload: {
config: {
provider: "aws-s3",
providerOptions: {
rootPath: env("ENV") === "prod" ? "" : env("BRANCH_NAME"),
s3Options: {
region: env("bucket_region"),
endpoint: env("bucket_endpoint"),
credentials: {
accessKeyId: env("bucket_access_key"),
secretAccessKey: env("bucket_secret_key"),
},
params: {
ACL: "public-read",
signedUrlExpires: 15 * 60,
Bucket: env("bucket_name"),
},
},
},
});
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
})
1 change: 1 addition & 0 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
"@strapi/plugin-cloud": "4.24.0",
"@strapi/plugin-i18n": "4.24.0",
"@strapi/plugin-users-permissions": "4.24.0",
"@strapi/provider-upload-aws-s3": "^5.4.0",
"@strapi/strapi": "4.24.0",
"better-sqlite3": "8.6.0",
"pg": "^8.12.0",
Binary file modified api/seed-data.tar.gz
Binary file not shown.
24 changes: 24 additions & 0 deletions api/src/api/plan-page/content-types/plan-page/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"kind": "singleType",
"collectionName": "plan_pages",
"info": {
"singularName": "plan-page",
"pluralName": "plan-pages",
"displayName": "Plan-page ",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"sections": {
"type": "component",
"repeatable": true,
"component": "blocks.urls-section"
}
}
}
9 changes: 9 additions & 0 deletions api/src/api/plan-page/controllers/plan-page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict"

/**
* plan-page controller
*/

const { createCoreController } = require("@strapi/strapi").factories

module.exports = createCoreController("api::plan-page.plan-page")
9 changes: 9 additions & 0 deletions api/src/api/plan-page/routes/plan-page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict"

/**
* plan-page router
*/

const { createCoreRouter } = require("@strapi/strapi").factories

module.exports = createCoreRouter("api::plan-page.plan-page")
9 changes: 9 additions & 0 deletions api/src/api/plan-page/services/plan-page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict"

/**
* plan-page service
*/

const { createCoreService } = require("@strapi/strapi").factories

module.exports = createCoreService("api::plan-page.plan-page")
21 changes: 21 additions & 0 deletions api/src/components/blocks/urls-section.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"collectionName": "components_blocks_urls_sections",
"info": {
"displayName": "urls-section",
"description": ""
},
"options": {},
"attributes": {
"title": {
"type": "string"
},
"urls": {
"type": "component",
"repeatable": true,
"component": "micros.titled-url"
},
"parentUrl": {
"type": "string"
}
}
}
16 changes: 16 additions & 0 deletions api/src/components/micros/titled-url.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"collectionName": "components_micros_titled_urls",
"info": {
"displayName": "titled-url",
"description": ""
},
"options": {},
"attributes": {
"title": {
"type": "string"
},
"url": {
"type": "string"
}
}
}
Loading