diff --git a/.env b/.env index 5f97c6d5..b51b1897 100644 --- a/.env +++ b/.env @@ -129,10 +129,6 @@ NO_URL_REWRITE_AVAILABLE=0 # Set to 1, if Part-DB should redirect all HTTP requests to HTTPS. You dont need to configure this, if your webserver already does this. REDIRECT_TO_HTTPS=0 -# Override value if you want to show to show a given text on homepage. -# When this is empty the content of config/banner.md is used as banner -BANNER="" - # Set this to zero, if you want to disable the year 2038 bug check on 32-bit systems (it will cause errors with current 32-bit PHP versions) DISABLE_YEAR2038_BUG_CHECK=0 diff --git a/config/banner.md b/config/banner.md index 997ca15e..1d38a3f3 100644 --- a/config/banner.md +++ b/config/banner.md @@ -1,14 +1,4 @@ -Welcome to Part-DB. - -If you want to change this banner, edit `config/banner.md` file or set the `BANNER` environment variable. +**Attention**: +Since Version 2.0.0 this file is no longer used. -
-

-And God said
-$\nabla \cdot \vec{D} = \rho$, -$\nabla \cdot \vec{B} = 0$, -$\nabla \times \vec{E} = -\frac{\partial \vec{B}}{\partial t}$, -$\nabla \times \vec{H} = \vec{j} + \frac{\partial \vec{D}}{\partial t}$,
-and then there was light. -

-
\ No newline at end of file +You can now set the banner text directly in the admin interface, or by setting the `BANNER` environment variable. diff --git a/config/parameters.yaml b/config/parameters.yaml index 311b567c..154fbd8a 100644 --- a/config/parameters.yaml +++ b/config/parameters.yaml @@ -90,7 +90,6 @@ parameters: env(ERROR_PAGE_SHOW_HELP): 1 env(DEMO_MODE): 0 - env(BANNER): '' env(EMAIL_SENDER_EMAIL): 'noreply@partdb.changeme' diff --git a/docs/upgrade/1_to_2.md b/docs/upgrade/1_to_2.md index 44219c73..799e9ec6 100644 --- a/docs/upgrade/1_to_2.md +++ b/docs/upgrade/1_to_2.md @@ -24,4 +24,9 @@ easily upgrade your system to the new requirements. Otherwise, you can use the o ships all required dependencies and is always up to date with the latest requirements, so that you do not have to worry about the requirements at all. - +## Changes +* The `config/banner.md` file that could been used to customize the banner text, was removed. You can now set the banner text + directly in the admin interface, or by setting the `BANNER` environment variable. If you want to keep your existing + banner text, you will have to copy it from the `config/banner.md` file to the admin interface or set the `BANNER` + environment variable. + diff --git a/src/Services/System/BannerHelper.php b/src/Services/System/BannerHelper.php index 81925f2c..bb27158f 100644 --- a/src/Services/System/BannerHelper.php +++ b/src/Services/System/BannerHelper.php @@ -30,7 +30,7 @@ use App\Settings\SystemSettings\CustomizationSettings; */ class BannerHelper { - public function __construct(private CustomizationSettings $customizationSettings) + public function __construct(private readonly CustomizationSettings $customizationSettings) { } @@ -43,4 +43,4 @@ class BannerHelper { return $this->customizationSettings->banner ?? ""; } -} \ No newline at end of file +} diff --git a/src/Settings/SystemSettings/CustomizationSettings.php b/src/Settings/SystemSettings/CustomizationSettings.php index abfeb880..d7e92a51 100644 --- a/src/Settings/SystemSettings/CustomizationSettings.php +++ b/src/Settings/SystemSettings/CustomizationSettings.php @@ -49,6 +49,7 @@ class CustomizationSettings #[SettingsParameter( label: new TM("settings.system.customization.banner"), formType: RichTextEditorType::class, formOptions: ['mode' => 'markdown-full'], + envVar: "BANNER", envVarMode: EnvVarMode::OVERWRITE, )] public ?string $banner = null; @@ -58,4 +59,4 @@ class CustomizationSettings )] #[ValidTheme] public string $theme = 'bootstrap'; -} \ No newline at end of file +}