From ea5711b527d21188007c63b94f2fd4bb0972b330 Mon Sep 17 00:00:00 2001 From: yacine Date: Sat, 20 Jun 2026 20:59:04 +0000 Subject: [PATCH] feat: disable dashboard domain warning for dynamic domains --- Dockerfile | 2 ++ README.md | 7 ++--- edubox-dashboard-warning.patch | 49 ++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 edubox-dashboard-warning.patch diff --git a/Dockerfile b/Dockerfile index cfc7a41..fa085e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ COPY edubox-tools.patch \ edubox-install.patch \ edubox-install-language.patch \ edubox-language.patch \ + edubox-dashboard-warning.patch \ edubox-docker-run.patch \ /tmp/ RUN patch -p1 -d /var/www/html < /tmp/edubox-tools.patch && \ @@ -23,6 +24,7 @@ RUN patch -p1 -d /var/www/html < /tmp/edubox-tools.patch && \ patch -p1 -d /var/www/html < /tmp/edubox-install.patch && \ patch -p1 -d /var/www/html < /tmp/edubox-install-language.patch && \ patch -p1 -d /var/www/html < /tmp/edubox-language.patch && \ + patch -p1 -d /var/www/html < /tmp/edubox-dashboard-warning.patch && \ patch -p1 -d / < /tmp/edubox-docker-run.patch && \ rm /tmp/edubox-*.patch diff --git a/README.md b/README.md index 4950470..1e41332 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ docker build -t edubox-prestashop:9 . ```bash docker tag edubox-prestashop:9 \ - 151.80.60.98:3001/yacine/edubox/edubox-prestashop:9-edubox-7 + 151.80.60.98:3001/yacine/edubox/edubox-prestashop:9-edubox-8 docker push \ - 151.80.60.98:3001/yacine/edubox/edubox-prestashop:9-edubox-7 + 151.80.60.98:3001/yacine/edubox/edubox-prestashop:9-edubox-8 ``` ## Patches appliqués @@ -49,6 +49,7 @@ docker push \ | `edubox-install.patch` | `src/PrestaShopBundle/Install/Install.php` | `finalize()` respecte `PS_FOLDER_ADMIN` (évite le bug overlayfs `admin` → `admin-edubox`). | | `edubox-install-language.patch` | `src/PrestaShopBundle/Install/Install.php` | Évite le téléchargement du pack legacy `fr.gzip` quand le pack Symfony est embarqué. | | `edubox-language.patch` | `classes/Language.php` | Utilise `_PS_TRANSLATIONS_DIR_` au runtime pour le cache langue ; évite le téléchargement réseau si le pack est présent. | +| `edubox-dashboard-warning.patch` | `controllers/admin/AdminDashboardController.php` | Désactive le bandeau d’avertissement "domaine différent de SEO & URL". | | `edubox-docker-run.patch` | `/tmp/docker_run.sh` | Supprime un `install.lock` résiduel si une installation précédente a échoué. | ## Fichiers injectés @@ -69,7 +70,7 @@ Le template PrestaShop 9 dans `server/prisma/seed.ts` utilise cette image : ```yaml app: - image: 151.80.60.98:3001/yacine/edubox/edubox-prestashop:9-edubox-7 + image: 151.80.60.98:3001/yacine/edubox/edubox-prestashop:9-edubox-8 ``` ## Mise à jour vers une nouvelle version de PrestaShop diff --git a/edubox-dashboard-warning.patch b/edubox-dashboard-warning.patch new file mode 100644 index 0000000..fd5c7b4 --- /dev/null +++ b/edubox-dashboard-warning.patch @@ -0,0 +1,49 @@ +--- a/controllers/admin/AdminDashboardController.php ++++ b/controllers/admin/AdminDashboardController.php +@@ -330,43 +330,9 @@ + + protected function getWarningDomainName() + { +- $warning = false; +- if (Shop::isFeatureActive()) { +- return; +- } +- +- $shop = Context::getContext()->shop; +- if ($_SERVER['HTTP_HOST'] != $shop->domain && $_SERVER['HTTP_HOST'] != $shop->domain_ssl && Tools::getValue('ajax') == false) { +- $warning = $this->trans('You are currently connected under the following domain name:', [], 'Admin.Dashboard.Notification') . ' ' . $_SERVER['HTTP_HOST'] . '
'; +- if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE')) { +- $warning .= $this->trans( +- 'This is different from the shop domain name set in the Multistore settings: "%s".', +- [ +- '%s' => $shop->domain, +- ], +- 'Admin.Dashboard.Notification' +- ) . $this->trans( +- 'If this is your main domain, please {link}change it now{/link}.', +- [ +- '{link}' => '', +- '{/link}' => '', +- ], +- 'Admin.Dashboard.Notification' +- ); +- } else { +- $warning .= $this->trans('This is different from the domain name set in the "SEO & URLs" tab.', [], 'Admin.Dashboard.Notification') . ' +- ' . $this->trans( +- 'If this is your main domain, please {link}change it now{/link}.', +- [ +- '{link}' => '', +- '{/link}' => '', +- ], +- 'Admin.Dashboard.Notification' +- ); +- } +- } +- +- return $warning; ++ // EduBox: instances use dynamic public domains behind a reverse proxy. ++ // The domain stored during installation never matches the request host. ++ return false; + } + + public function ajaxProcessRefreshDashboard()