aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorPaweł Bogusławski <pawel.boguslawski@ib.pl>2021-02-11 18:34:34 +0100
committerGitHub <noreply@github.com>2021-02-11 12:34:34 -0500
commit7d7007dca75ab3a3a48b9f3fd7cc4350cc626870 (patch)
treea9d4974fc5e990befc682c0725f7adb217491d08 /templates
parentac701637b42d2d6bb5fe9b258f3f54959b6a505e (diff)
downloadgitea-7d7007dca75ab3a3a48b9f3fd7cc4350cc626870.tar.gz
gitea-7d7007dca75ab3a3a48b9f3fd7cc4350cc626870.zip
Added option to disable webhooks (#13176)
* Added option to disable web hooks This mod introduces DISABLE_WEB_HOOKS parameter in [security] section of app.ini (by default set to false). If set to true it disables web hooks feature. Any existing undelivered web hook tasks will be cancelled. Any existing web hook definitions will be left untouched in db but its delivery tasks will be ignored. Author-Change-Id: IB#1105130 * Webhook spelling fixed Webhook spelling fixed. Fixes: 07df6614dc84cdd2e9f39c57577fa1062bd70012 Related: https://github.com/go-gitea/gitea/pull/13176#pullrequestreview-510868421 Author-Change-Id: IB#1105174 * Parameter description fixed Parameter description fixed. Fixes: 07df6614dc84cdd2e9f39c57577fa1062bd70012 Related: https://github.com/go-gitea/gitea/pull/13176#pullrequestreview-514086107 Author-Change-Id: IB#1105174
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/navbar.tmpl8
-rw-r--r--templates/org/settings/navbar.tmpl2
-rw-r--r--templates/repo/settings/nav.tmpl2
-rw-r--r--templates/repo/settings/navbar.tmpl8
4 files changed, 14 insertions, 6 deletions
diff --git a/templates/admin/navbar.tmpl b/templates/admin/navbar.tmpl
index 953076d808..c656d0619b 100644
--- a/templates/admin/navbar.tmpl
+++ b/templates/admin/navbar.tmpl
@@ -12,9 +12,11 @@
<a class="{{if .PageIsAdminRepositories}}active{{end}} item" href="{{AppSubUrl}}/admin/repos">
{{.i18n.Tr "admin.repositories"}}
</a>
- <a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/hooks">
- {{.i18n.Tr "admin.hooks"}}
- </a>
+ {{if not DisableWebhooks}}
+ <a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/hooks">
+ {{.i18n.Tr "admin.hooks"}}
+ </a>
+ {{end}}
<a class="{{if .PageIsAdminAuthentications}}active{{end}} item" href="{{AppSubUrl}}/admin/auths">
{{.i18n.Tr "admin.authentication"}}
</a>
diff --git a/templates/org/settings/navbar.tmpl b/templates/org/settings/navbar.tmpl
index 63114b056e..b4edbb077f 100644
--- a/templates/org/settings/navbar.tmpl
+++ b/templates/org/settings/navbar.tmpl
@@ -4,9 +4,11 @@
<a class="{{if .PageIsSettingsOptions}}active{{end}} item" href="{{.OrgLink}}/settings">
{{.i18n.Tr "org.settings.options"}}
</a>
+ {{if not DisableWebhooks}}
<a class="{{if .PageIsSettingsHooks}}active{{end}} item" href="{{.OrgLink}}/settings/hooks">
{{.i18n.Tr "repo.settings.hooks"}}
</a>
+ {{end}}
<a class="{{if .PageIsOrgSettingsLabels}}active{{end}} item" href="{{.OrgLink}}/settings/labels">
{{.i18n.Tr "repo.labels"}}
</a>
diff --git a/templates/repo/settings/nav.tmpl b/templates/repo/settings/nav.tmpl
index 5cc77e1dc9..4b89ece349 100644
--- a/templates/repo/settings/nav.tmpl
+++ b/templates/repo/settings/nav.tmpl
@@ -5,7 +5,9 @@
<li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{.i18n.Tr "repo.settings.options"}}</a></li>
<li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{.i18n.Tr "repo.settings.collaboration"}}</a></li>
<li {{if .PageIsSettingsBranches}}class="current"{{end}}><a href="{{.RepoLink}}/settings/branches">{{.i18n.Tr "repo.settings.branches"}}</a></li>
+ {{if not DisableWebhooks}}
<li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{.i18n.Tr "repo.settings.hooks"}}</a></li>
+ {{end}}
{{if or .SignedUser.AllowGitHook .SignedUser.IsAdmin}}
<li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.i18n.Tr "repo.settings.githooks"}}</a></li>
{{end}}
diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl
index 1aba5de731..501c3c4630 100644
--- a/templates/repo/settings/navbar.tmpl
+++ b/templates/repo/settings/navbar.tmpl
@@ -11,9 +11,11 @@
{{.i18n.Tr "repo.settings.branches"}}
</a>
{{end}}
- <a class="{{if .PageIsSettingsHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks">
- {{.i18n.Tr "repo.settings.hooks"}}
- </a>
+ {{if not DisableWebhooks}}
+ <a class="{{if .PageIsSettingsHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks">
+ {{.i18n.Tr "repo.settings.hooks"}}
+ </a>
+ {{end}}
{{if .SignedUser.CanEditGitHook}}
<a class="{{if .PageIsSettingsGitHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks/git">
{{.i18n.Tr "repo.settings.githooks"}}