安全更新 OctoberCMS 网站

Safely updating an OctoberCMS website

问题的前提

作为开发人员,我们需要知道客户使用的软件与我们交付给他们的软件完全一样。我们还需要开发堆栈不是一个移动的目标。为此,软件更新应完全在开发人员的控制之下。


问题

我可以在 OctoberCMS 中禁用 所有 自动更新(核心、插件、主题)吗?


更新的首选方法

为避免任何 'breaking' 更改,我想通过
的组合来更新实时(和测试)网站 * git-ftp 从开发服务器到测试/上线

* php artisan october:up


详情

https://octobercms.com/docs/plugin/updates 中有一节指出,

Update process

October executes the update process automatically when any of the following occurs:
1) When an administrator signs in to the back-end.
2) When the system is updated using the update feature in the back-end area.
3) When the console command php artisan october:up is called in the command line from the application directory.

1) 和 3) 没有机会避免可能无意中 'break' 实时网站的更改:

在 1) 中,每次管理员登录实时站点时,可能会上传和安装潜在的破坏性更改。

在 3) 中,为更新的插件更新数据库的过程也可能导致系统其他部分的更新,
a) 破坏现场
b) 使 live 站点与 developmenttesting 不同步。

同一页上还有另一个部分说,

Important updates

Sometimes a plugin needs to introduce features that will break websites already using the plugin. If an update comment in the version.yaml file begins with three exclamation marks (!!!) then it will be considered Important and will require the user to confirm before updating. An example of an important update comment:

1.1.0: !!! This is an important update that contains breaking changes.

When the system detects an important update it will provide three options to proceed:

Confirm update
Skip this plugin (once only)
Skip this plugin (always)

Confirming the comment will update the plugin as usual, or if the comment is skipped it will not be updated.

但是,这有两个问题:

1) 插件作者必须彻底测试更新,注意'breaking changes',并在版本文件中添加!!!

2) 更新可能不是标准意义上的 'break' 网站,但它可能会导致不必要的副作用,实际上可能会导致损坏。

可以在 cms.php 配置文件中禁用核心更新:

/*
|--------------------------------------------------------------------------
| Prevents application updates
|--------------------------------------------------------------------------
|
| If using composer or git to download updates to the core files, set this
| value to 'true' to prevent the update gateway from trying to download
| these files again as part of the application update process. Plugins
| and themes will still be downloaded.
|
*/

'disableCoreUpdates' => false,

但是,正如相关评论中所述,“仍将下载插件和主题”。
我假设这意味着下载 安装。

那么,我可以在 OctoberCMS 中禁用 所有 自动更新(核心、插件、主题)吗?
如果没有,是否有另一种方法可以避免这些问题,或者我应该 post 这是 OctoberCMS github 页面上非常需要的功能吗?

即使在开发服务器上,自动更新插件也是一个问题,这一点很有争议:
在开发一个网站时,它突然崩溃了。此中断是由于开发人员所做的更改,还是后台登录期间发生的插件后台更新?
这是否意味着在开发网站时我必须让自己永久登录以避免启动更新过程?

更新过程与您在问题中列出的过程略有不同。过程如下:

更新过程

1) 当管理员登录到后端时,将安装任何已下载的更新(迁移等)
2) 使用后台更新功能更新系统时,下载并安装更新。
3) 当从应用程序目录的命令行中调用控制台命令 php artisan october:up 时,将安装已下载的更新。
4) 使用控制台命令 php artisan october:update 下载并安装更新。
5) 当使用 composer composer update 下载更新时,你可以使用 php artisan october:up

安装它们