novactive/ezmaintenancebundle

Novactive eZ Maintenance bundle 是一个 Ibexa 插件,帮助您轻松启用维护页面。

v2.0.1 2024-01-17 10:15 UTC

README

此存储库是我们所说的“子树分割”:主存储库中的一个目录的只读副本。它由 Composer 用于允许开发者依赖于特定插件。

如果您想报告或贡献,请转到主存储库打开问题:[https://github.com/Novactive/Nova-eZPlatform-Bundles](https://github.com/Novactive/Nova-eZPlatform-Bundles)

通过 .md 文件在存储库中提供文档,也在此打包:[https://novactive.github.io/Nova-eZPlatform-Bundles/master/MaintenanceBundle/README.md.html](https://novactive.github.io/Nova-eZPlatform-Bundles/master/MaintenanceBundle/README.md.html)

Downloads Latest version License

轻松启用维护页面。

安装

步骤 1:使用 Composer 下载

将库添加到您的 composer.json,运行 composer require novactive/ezmaintenancebundle 以更新依赖项。

步骤 2:启用插件

然后将在您的应用程序的 bundles.php 中注入插件。

     Novactive\NovaeZMaintenanceBundle\NovaeZMaintenanceBundle::class => [ 'all'=> true ],

步骤 3:添加默认路由

激活 sroutes

_novaezmaintenance_routes:
    resource: '@NovaeZMaintenanceBundle/Resources/config/routing/main.yaml'

步骤 4:清除缓存并检查

php app|ezpublish/console cache:clear --env=dev

步骤 5:检查 X-Maintenance 响应头到 VCL

维护页面将返回 503 状态码,VCL 将放弃它,因此更新您的 vcl 以强制显示带有 503 和 X-Maintenance 头的响应

if (bereq.http.accept ~ "application/vnd.fos.user-context-hash"
        && beresp.status >= 500 && !beresp.http.X-Maintenance
    ) {
        return (abandon);
    }

配置

nova_ezmaintenance:
    system:
        default:
            enable: false # to enable to capability
            template: '@ibexadesign/maintenance.html.twig' # the template you want as a maintenace page
            lock_file_id: 'plop.lock' # the name of the lock file in the cluster