feat: disable dashboard domain warning for dynamic domains

This commit is contained in:
2026-06-20 20:59:04 +00:00
parent fdc6d83bdf
commit ea5711b527
3 changed files with 55 additions and 3 deletions
+2
View File
@@ -11,6 +11,7 @@ COPY edubox-tools.patch \
edubox-install.patch \ edubox-install.patch \
edubox-install-language.patch \ edubox-install-language.patch \
edubox-language.patch \ edubox-language.patch \
edubox-dashboard-warning.patch \
edubox-docker-run.patch \ edubox-docker-run.patch \
/tmp/ /tmp/
RUN patch -p1 -d /var/www/html < /tmp/edubox-tools.patch && \ 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.patch && \
patch -p1 -d /var/www/html < /tmp/edubox-install-language.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-language.patch && \
patch -p1 -d /var/www/html < /tmp/edubox-dashboard-warning.patch && \
patch -p1 -d / < /tmp/edubox-docker-run.patch && \ patch -p1 -d / < /tmp/edubox-docker-run.patch && \
rm /tmp/edubox-*.patch rm /tmp/edubox-*.patch
+4 -3
View File
@@ -30,9 +30,9 @@ docker build -t edubox-prestashop:9 .
```bash ```bash
docker tag edubox-prestashop:9 \ 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 \ 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 ## 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.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-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-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 davertissement "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é. | | `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 ## Fichiers injectés
@@ -69,7 +70,7 @@ Le template PrestaShop 9 dans `server/prisma/seed.ts` utilise cette image :
```yaml ```yaml
app: 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 ## Mise à jour vers une nouvelle version de PrestaShop
+49
View File
@@ -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') . ' <span style="color: #CC0000;">' . $_SERVER['HTTP_HOST'] . '</span><br />';
- 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}' => '<a href="' . $this->context->link->getAdminLink('AdminShopUrl', true, [], ['id_shop_url' => (int) $shop->id, 'updateshop_url' => 1]) . '">',
- '{/link}' => '</a>',
- ],
- '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}' => '<a href="' . $this->context->link->getAdminLink('AdminMeta') . '#meta_fieldset_shop_url">',
- '{/link}' => '</a>',
- ],
- '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()