From ee912e41632824884a257ca2b8e52a6dd351f363 Mon Sep 17 00:00:00 2001 From: Corentin Huet Date: Mon, 6 Oct 2025 12:42:48 +0200 Subject: [PATCH 1/4] fix: images from static pages are now saved in the storage folder --- .gitignore | 3 +++ app/Models/StaticPage.php | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e00c845..ac19178 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,9 @@ Homestead.yaml npm-debug.log yarn-error.log .npmrc +.zshrc +.npm/ +.composer/ # Ignore public favicon /public/android-chrome-192x192.png diff --git a/app/Models/StaticPage.php b/app/Models/StaticPage.php index 6773a27..024c0e0 100644 --- a/app/Models/StaticPage.php +++ b/app/Models/StaticPage.php @@ -3,6 +3,7 @@ namespace App\Models; use App\Enums\StaticPageType; +use App\Lib\Helpers\FileStorageHelper; use App\Lib\Helpers\ToolboxHelper; use App\Traits\Models\ActivityLog; use Illuminate\Database\Eloquent\Factories\HasFactory; @@ -17,6 +18,9 @@ use Illuminate\Support\Str; * @property string $title Title for the page. * @property string $slug Slug of the title for the page. * @property string $content WYSIWYG text content using ckeditor. + * @property string $picture Slide picture path. + * @property string $picture_alt Slide picture alt attribute. + * @property string $picture_title Slide picture title attribute. * @property-read \Illuminate\Support\Carbon $created_at Created date. * @property-read \Illuminate\Support\Carbon $updated_at Updated date. * @@ -37,6 +41,9 @@ class StaticPage extends Model 'seo_description', 'title', 'content', + 'picture', + 'picture_alt', + 'picture_title', ]; /** @@ -61,6 +68,9 @@ class StaticPage extends Model static::updating(function (self $model) { self::manageFields($model); }); + static::updated(function (self $model) { + FileStorageHelper::removeOldFile($model, 'picture'); + }); } // * ROUTABLE @@ -105,7 +115,9 @@ class StaticPage extends Model ToolboxHelper::assertNoInternalBoUrls('content', $model->content); $model->content = clean($model->content); } - + if ($model->picture) { + $model->picture = FileStorageHelper::storeFile($model, $model->picture, true); + } // * TRANSFORMATIONS self::setSlug($model, $model->title); } From cacee5c21db7b5a1bae28c870485451853793634 Mon Sep 17 00:00:00 2001 From: Noah Lancien Date: Wed, 8 Oct 2025 10:43:01 +0200 Subject: [PATCH 2/4] ci: added staging-resources.yaml --- staging-resources.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 staging-resources.yaml diff --git a/staging-resources.yaml b/staging-resources.yaml new file mode 100644 index 0000000..a1cd413 --- /dev/null +++ b/staging-resources.yaml @@ -0,0 +1,20 @@ +--- +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: ${CI_PROJECT_PATH_SLUG}-ingress-route +spec: + entryPoints: + - web + - websecure + routes: + - match: Host(`${APP_DOMAIN}`) + kind: Rule + services: + - name: ${CI_PROJECT_PATH_SLUG}-service + port: 80 + middlewares: + - name: admin-ldc-whitelist + namespace: common-services + tls: + secretName: ${CRT_TLS_NAME} From b834747955ac4ddd6ef30343ed2ca8dd7dd02974 Mon Sep 17 00:00:00 2001 From: Corentin Huet Date: Wed, 15 Oct 2025 10:50:24 +0200 Subject: [PATCH 3/4] feat: added volailles ramon redirections to volena.fr --- production-resources.yaml | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/production-resources.yaml b/production-resources.yaml index c297d72..ea5b7d1 100644 --- a/production-resources.yaml +++ b/production-resources.yaml @@ -11,3 +11,48 @@ spec: issuerRef: name: $APP_CERT_ISSUER kind: ClusterIssuer + +--- +# Redirect with domain replacement +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: redirect-volailles-ramon-to-volena +spec: + redirectRegex: + regex: ^https://(.*)(volailles-ramon)(.*) + replacement: https://${REDIRECT}${APP_DOMAIN} + permanent: true +--- +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: redirect-volailles-ramon-to-volena +spec: + entryPoints: + - websecure + routes: + - match: Host(`volailles-ramon.fr`) || Host(`www.volailles-ramon.fr`) || Host(`volailles-ramon.com`) || Host(`www.volailles-ramon.com`) + kind: Rule + services: + - name: api@internal + kind: TraefikService + middlewares: + - name: redirect-volailles-ramon-to-volena + tls: + secretName: redirect-volailles-ramon-to-volena +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: redirect-volailles-ramon-to-volena +spec: + dnsNames: + - volailles-ramon.fr + - www.volailles-ramon.fr + - volailles-ramon.com + - www.volailles-ramon.com + secretName: redirect-volailles-ramon-to-volena + issuerRef: + name: $APP_CERT_ISSUER + kind: ClusterIssuer From fad0d13c8fe8edbeef61ddc3f3322a0590053d3d Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Thu, 16 Oct 2025 11:55:15 +0200 Subject: [PATCH 4/4] fix: Fix redirects domaines ssl challenge --- production-resources.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production-resources.yaml b/production-resources.yaml index ea5b7d1..d9109a5 100644 --- a/production-resources.yaml +++ b/production-resources.yaml @@ -32,7 +32,7 @@ spec: entryPoints: - websecure routes: - - match: Host(`volailles-ramon.fr`) || Host(`www.volailles-ramon.fr`) || Host(`volailles-ramon.com`) || Host(`www.volailles-ramon.com`) + - match: (Host(`volailles-ramon.fr`) || Host(`www.volailles-ramon.fr`) || Host(`volailles-ramon.com`) || Host(`www.volailles-ramon.com`)) && !PathPrefix(`/.well-known/acme-challenge/`) kind: Rule services: - name: api@internal