如何禁用一种类型的所有服务集成

How to disable all service integrations of one kind

我已经通过管理员界面向我的 gitlab-ce 添加了一个 slack 服务模板。一切正常。我激活了 "active by default"。 因此,所有 项目现在将通知推送到主频道。那些是 lot

更改服务模板配置不会被项目继承。因此有效地使我无法通过管理员恢复设置 UI.

那么,我怎样才能禁用所有项目的 slack 服务集成,以免它让我们所有人都抓狂,因为 general-channel 刚刚被 gitlab 淹没了?

后面就是issue 40921:

Allow to apply service template to all projects

Sometimes users want to apply the same integration like JIRA across all GitLab projects, currently templates are the only way to do that through the UI, but project integration templates only works for projects that have been created after it.

唯一的解决方法:

I had this issue too. One workaround is to patch the database like this:

sudo gitlab-rails dbconsole
UPDATE services SET properties = replace(properties, 'http://someoldurl.com', 'https://somenewurl.com');

(适应您的松弛设置:这只是一个例子)

按照@VonC 的建议深入 psql 并破解我的方法,我终于 运行 按照命令禁用相关服务的活动标志(在我们的例子中是 slack 和 mattermost):

sudo gitlab-rails dbconsole
UPDATE "services" SET active = FALSE WHERE type LIKE 'SlackService' AND active = TRUE;
UPDATE "services" SET active = FALSE WHERE type LIKE 'SlackSlashCommandsService' AND active = TRUE;
UPDATE "services" SET active = FALSE WHERE type LIKE 'MattermostService' AND active = TRUE;
UPDATE "services" SET active = FALSE WHERE type LIKE 'MattermostSlashCommandsService' AND active = TRUE;