mirror of https://github.com/gogs/gogs.git
webhook: overhaul route handlers (#6002)
* Overual route handlers and fixes #5366 * Merge routes for repo and org * Inject OrgRepoContext * DRY validateWebhook * DRY c.HasError * Add tests * Update CHANGELOGpull/6005/head
parent
82e511ddb1
commit
22717a1c06
conf/locale
internal
assets
cmd
conf
mock
route
templates/repo/settings
|
@ -40,6 +40,7 @@ All notable changes to Gogs are documented in this file.
|
|||
- [Security] Potential ability to delete files outside a repository.
|
||||
- [Security] Potential ability to set primary email on others' behalf from their verified emails.
|
||||
- [Security] Potential XSS attack via `.ipynb`. [#5170](https://github.com/gogs/gogs/issues/5170)
|
||||
- [Security] Potential SSRF attack via webhooks. [#5366](https://github.com/gogs/gogs/issues/5366)
|
||||
- [Security] Potential CSRF attack in admin panel. [#5367](https://github.com/gogs/gogs/issues/5367)
|
||||
- [Security] Potential RCE on mirror repositories. [#5767](https://github.com/gogs/gogs/issues/5767)
|
||||
- [Security] Potential XSS attack with raw markdown API. [#5907](https://github.com/gogs/gogs/pull/5907)
|
||||
|
|
|
@ -790,8 +790,10 @@ settings.collaborator_deletion_desc = This user will no longer have collaboratio
|
|||
settings.remove_collaborator_success = Collaborator has been removed.
|
||||
settings.search_user_placeholder = Search user...
|
||||
settings.org_not_allowed_to_be_collaborator = Organization is not allowed to be added as a collaborator.
|
||||
settings.add_webhook = Add Webhook
|
||||
settings.hooks_desc = Webhooks are much like basic HTTP POST event triggers. Whenever something occurs in Gogs, we will handle the notification to the target host you specify. Learn more in this <a target="_blank" href="%s">Webhooks Guide</a>.
|
||||
settings.hooks_desc = Webhooks are much like basic HTTP POST event triggers. Whenever something occurs in Gogs, we will handle the notification to the target host you specify.
|
||||
settings.webhooks.add_new = Add a new webhook:
|
||||
settings.webhooks.choose_a_type = Choose a type...
|
||||
settings.add_webhook = Add webhook
|
||||
settings.webhook_deletion = Delete Webhook
|
||||
settings.webhook_deletion_desc = Delete this webhook will remove its information and all delivery history. Do you want to continue?
|
||||
settings.webhook_deletion_success = Webhook has been deleted successfully!
|
||||
|
@ -805,6 +807,8 @@ settings.webhook.response = Response
|
|||
settings.webhook.headers = Headers
|
||||
settings.webhook.payload = Payload
|
||||
settings.webhook.body = Body
|
||||
settings.webhook.err_cannot_parse_payload_url = Cannot parse payload URL: %v
|
||||
settings.webhook.err_cannot_use_local_addresses = Non admins are not allowed to use local addresses.
|
||||
settings.githooks_desc = Git Hooks are powered by Git itself, you can edit files of supported hooks in the list below to perform custom operations.
|
||||
settings.githook_edit_desc = If the hook is inactive, sample content will be presented. Leaving content to an empty value will disable this hook.
|
||||
settings.githook_name = Hook Name
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -95,20 +95,20 @@
|
|||
// ../../../templates/repo/settings/collaboration.tmpl (2.85kB)
|
||||
// ../../../templates/repo/settings/deploy_keys.tmpl (3.661kB)
|
||||
// ../../../templates/repo/settings/githook_edit.tmpl (1.329kB)
|
||||
// ../../../templates/repo/settings/githooks.tmpl (978B)
|
||||
// ../../../templates/repo/settings/githooks.tmpl (928B)
|
||||
// ../../../templates/repo/settings/navbar.tmpl (1.124kB)
|
||||
// ../../../templates/repo/settings/options.tmpl (18.43kB)
|
||||
// ../../../templates/repo/settings/protected_branch.tmpl (3.64kB)
|
||||
// ../../../templates/repo/settings/webhook/base.tmpl (293B)
|
||||
// ../../../templates/repo/settings/webhook/delete_modal.tmpl (526B)
|
||||
// ../../../templates/repo/settings/webhook/dingtalk.tmpl (699B)
|
||||
// ../../../templates/repo/settings/webhook/discord.tmpl (1.25kB)
|
||||
// ../../../templates/repo/settings/webhook/gogs.tmpl (1.512kB)
|
||||
// ../../../templates/repo/settings/webhook/dingtalk.tmpl (665B)
|
||||
// ../../../templates/repo/settings/webhook/discord.tmpl (1.217kB)
|
||||
// ../../../templates/repo/settings/webhook/gogs.tmpl (1.478kB)
|
||||
// ../../../templates/repo/settings/webhook/history.tmpl (3.16kB)
|
||||
// ../../../templates/repo/settings/webhook/list.tmpl (2.182kB)
|
||||
// ../../../templates/repo/settings/webhook/list.tmpl (2.048kB)
|
||||
// ../../../templates/repo/settings/webhook/new.tmpl (1.06kB)
|
||||
// ../../../templates/repo/settings/webhook/settings.tmpl (5.033kB)
|
||||
// ../../../templates/repo/settings/webhook/slack.tmpl (1.515kB)
|
||||
// ../../../templates/repo/settings/webhook/settings.tmpl (5.012kB)
|
||||
// ../../../templates/repo/settings/webhook/slack.tmpl (1.48kB)
|
||||
// ../../../templates/repo/user_cards.tmpl (1.927kB)
|
||||
// ../../../templates/repo/view_file.tmpl (5.187kB)
|
||||
// ../../../templates/repo/view_list.tmpl (2.249kB)
|
||||
|
@ -352,7 +352,7 @@ func adminDashboardTmpl() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "admin/dashboard.tmpl", size: 6934, mode: os.FileMode(0644), modTime: time.Unix(1584761549, 0)}
|
||||
info := bindataFileInfo{name: "admin/dashboard.tmpl", size: 6934, mode: os.FileMode(0644), modTime: time.Unix(1584763658, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfd, 0x19, 0x82, 0xd8, 0xa2, 0xc7, 0x34, 0x8f, 0x60, 0x56, 0x87, 0x7c, 0x36, 0x18, 0xba, 0xf4, 0x64, 0x28, 0xc3, 0xbc, 0x16, 0x51, 0xb1, 0x7f, 0xba, 0x3f, 0x32, 0x3, 0x60, 0x38, 0x13, 0x51}}
|
||||
return a, nil
|
||||
}
|
||||
|
@ -2117,7 +2117,7 @@ func repoSettingsGithook_editTmpl() (*asset, error) {
|
|||
return a, nil
|
||||
}
|
||||
|
||||
var _repoSettingsGithooksTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x93\xcf\x8e\x9c\x30\x0c\xc6\xcf\xcc\x53\x58\xa8\xd7\x01\xb5\xda\x43\x0f\x2c\xe7\xad\xb4\xed\xa1\xbb\xf7\xca\x03\x06\xac\x0d\x09\x4a\x3c\x6c\x57\x69\xde\xbd\xe2\x5f\x66\x86\x91\xaa\x9e\x62\xb0\xfd\xfb\x3e\x9b\xe0\xbd\x50\x3f\x28\x14\x82\xf4\x84\x8e\xf2\x8e\xb0\x4e\x21\x0b\xe1\x50\xd4\x3c\x42\xa5\xd0\xb9\xc7\xd4\xd2\x60\x1c\x8b\xb1\x1f\xe0\x48\x84\x75\xeb\xa0\x65\xe9\x8c\x79\x73\x69\x79\x48\xae\x31\x53\xed\x8c\x21\xbb\x80\x92\x6b\xd2\x99\xa1\x32\x5a\x90\x35\xd9\xa9\x73\x9f\x6c\x2d\xd7\xf3\xfb\x7b\xe6\xa6\x9c\x6b\x1c\x4f\xb8\xc1\x6f\x09\xf2\x4e\x6a\x24\x78\xe7\x9a\xa0\x32\xea\xdc\xeb\x59\x8e\xb4\x2c\xd0\xe4\x6e\x60\x54\x64\x25\xb2\x92\xa2\x7b\xb8\x72\x23\x66\x00\x14\xc1\xaa\xa3\x1a\xd6\x99\x16\x4e\xe2\x7d\xc6\x9f\xbf\xea\xec\xd5\x2e\xf6\xb2\xcd\x5e\x16\x17\xb3\x21\xf3\xee\x61\x69\xda\xcd\x1a\xc9\x82\x27\x45\xe0\xa8\xed\x2f\x46\xf7\xc5\x13\x12\x14\xbb\x98\xbf\x29\x60\xa1\x3e\x26\xfe\xc3\xdb\xaf\x9a\x5c\x95\xc2\x1f\x78\x11\xfb\xe5\xe9\xf5\xfb\xf3\xea\x75\x72\x5b\xf3\xb8\x91\xbc\xb7\xa8\x5b\x82\xec\x69\x6a\x8a\x35\xff\x90\x4e\x0a\x37\xa0\x8e\x9f\x83\x7e\x0b\x78\xcf\x0d\x68\x23\x90\x7d\x73\x2f\xd8\x0f\x8a\x42\x68\x2d\x91\xf6\x9e\x94\x5b\x1e\x3e\xbc\x27\x5d\x87\x90\x96\x05\x6f\xcd\xa6\x12\xae\x8c\x86\xf5\x3c\x0e\x96\x7b\x16\x1e\xe9\x58\x1b\x49\xcb\x22\xe7\xb2\xc8\x27\xb5\x9d\x78\xe9\x7d\xf6\x03\x7b\x0a\xe1\x2e\x8d\x37\xc6\x4e\xea\x4c\x70\x66\xb0\xdc\x76\x92\x42\x67\xa9\x79\x4c\xbd\xff\x94\xfd\xa4\xc1\x3c\xb3\x7e\x0b\xe1\x72\xe9\xe6\xb5\xe5\x2d\x4b\x1e\xf1\xd7\x66\x1b\x84\x06\x8f\x03\xe9\x8a\xd5\xe6\x0d\xa3\xf2\x6e\xa9\xf3\xa8\x87\x7d\xe6\x12\xc6\x68\x0b\xd6\x73\x3d\xee\xee\x70\x63\x8c\x6c\x7f\xdb\xdf\x00\x00\x00\xff\xff\xa0\x64\xc6\xfc\xd2\x03\x00\x00"
|
||||
var _repoSettingsGithooksTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x93\xcf\x8e\x9c\x30\x0c\xc6\xcf\xcc\x53\x58\xa8\xd7\x01\x55\xda\x43\x0f\x2c\xe7\x56\xaa\x7a\x68\x7b\xaf\x3c\x60\xc0\xda\x90\x44\x89\x87\xed\x2a\xca\xbb\x57\xfc\xcb\xcc\x30\x87\x9e\x6c\x70\xbe\x9f\x3f\x5b\x49\x08\x42\xa3\x55\x28\x04\xf9\x05\x3d\x95\x03\x61\x9b\x43\x11\xe3\xa9\x6a\x79\x82\x46\xa1\xf7\xaf\xb9\x23\x6b\x3c\x8b\x71\x1f\xe0\x49\x84\x75\xef\xa1\x67\x19\x8c\x79\xf3\x79\x7d\xca\xee\x31\xf3\xd9\x05\x43\x6e\x05\x65\xf7\xa4\x2b\x43\x63\xb4\x20\x6b\x72\xb3\xf2\x58\xec\x1d\xb7\xcb\xff\x67\xe6\xde\xb9\xd4\x38\x5d\x70\x87\x3f\x12\xe4\x9d\xd4\x44\xf0\xce\x2d\x41\x63\xd4\x75\xd4\x4b\x3b\xd2\xb2\x42\xb3\xa7\x81\x51\x91\x93\xc4\xca\xaa\xe1\xe5\xce\x8d\x18\x0b\x28\x82\xcd\x40\x2d\x6c\x33\xad\x9c\x2c\x84\x82\x3f\x7f\xd1\xc5\x6f\xb7\xda\x2b\x76\x7b\x45\x5a\xcc\x8e\x2c\x87\x97\x55\x74\x98\x35\x91\x3d\xf5\xe3\xcd\x62\x56\xd9\xfa\xff\xf4\x3f\x2d\xf9\x26\x8f\xb1\x2a\xed\x2e\x7b\xa4\xcf\xa7\x40\xb1\x4f\xd8\x2c\x04\x87\xba\x27\x28\xbe\xce\x80\xcd\xdd\x41\xc8\x42\x63\x12\x64\x59\xe5\x2d\xea\xb4\x5c\xfa\x2b\x10\x02\x77\xa0\x8d\x40\xf1\xcd\xff\xc2\xd1\x2a\x8a\xb1\x77\x44\x3a\x04\x52\x7e\xfd\xf8\x08\x81\x74\x1b\x63\x5e\x57\xbc\x8b\x4d\x23\xdc\x18\x0d\x5b\x3c\x5b\xc7\x23\x0b\x4f\x74\x6e\x8d\xe4\x75\x55\x72\x5d\x95\x73\xb7\x43\xf3\x79\x15\x3f\x70\xa4\x79\xd2\x43\x19\x1f\x8c\x5d\xd4\x95\xe0\xca\xe0\xb8\x1f\x24\x87\xc1\x51\xf7\x9a\x87\xf0\xa9\xf8\x49\xd6\x7c\x67\xfd\x16\xe3\xed\x0a\x2d\x2b\x2c\x7b\x96\x32\xe1\xef\xcd\x76\x08\x1d\x9e\x2d\xe9\x86\xd5\xee\x0d\x53\xe7\xaa\x6c\x79\xba\x2d\x75\x19\xf5\x74\xac\xdc\xd2\x94\xed\xc9\x16\xb7\xf0\x74\x23\x3b\x63\x64\x7f\x3b\xff\x02\x00\x00\xff\xff\x7f\x7d\x8a\xff\xa0\x03\x00\x00"
|
||||
|
||||
func repoSettingsGithooksTmplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -2132,8 +2132,8 @@ func repoSettingsGithooksTmpl() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "repo/settings/githooks.tmpl", size: 978, mode: os.FileMode(0644), modTime: time.Unix(1583774436, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x70, 0xd8, 0xac, 0xb7, 0x71, 0x44, 0xa5, 0xe7, 0xc2, 0x68, 0x9f, 0xf7, 0xb0, 0xaa, 0xb6, 0x73, 0xe1, 0x7, 0xb2, 0x6e, 0xa6, 0xff, 0x4, 0xdc, 0xb8, 0xf5, 0x12, 0x2d, 0xb0, 0x29, 0xcb, 0x77}}
|
||||
info := bindataFileInfo{name: "repo/settings/githooks.tmpl", size: 928, mode: os.FileMode(0644), modTime: time.Unix(1584870152, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2b, 0x8c, 0xe3, 0x3f, 0xe3, 0x4b, 0xcc, 0x73, 0x4c, 0x9e, 0xc2, 0x69, 0x51, 0x5d, 0x74, 0x56, 0x49, 0xe3, 0x87, 0x9, 0x7e, 0x2c, 0xc4, 0x38, 0xf1, 0x68, 0x96, 0x99, 0xa7, 0x1e, 0xbf, 0x87}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
|
@ -2237,7 +2237,7 @@ func repoSettingsWebhookDelete_modalTmpl() (*asset, error) {
|
|||
return a, nil
|
||||
}
|
||||
|
||||
var _repoSettingsWebhookDingtalkTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x92\x4f\x8f\xd3\x30\x10\xc5\xcf\xc9\xa7\x18\xf9\x8e\x2d\x38\x21\x94\x14\x89\x7f\xda\x95\x0a\x5a\x6d\x8b\x38\x46\x6e\x3c\x6d\xad\x3a\x1e\xaf\xed\xb4\x54\xc6\xdf\x1d\x39\x69\x58\x96\x03\x39\xc5\xd6\xf3\x9b\x37\xbf\x99\x94\xf4\x1e\xf0\x09\xf8\x1d\xd1\x69\x7b\x75\x08\x4c\x69\x7b\x88\xd2\x9c\x58\xce\x75\xd5\xb8\x55\x4a\x5c\xbf\x7e\x6b\xf9\xd6\x03\xf3\xe8\x88\x07\x8c\x51\xdb\x43\xe0\x52\xa9\x6e\x51\x77\x47\xa2\x53\xa7\x30\xf4\x0c\xd8\x31\x46\x17\xde\x09\x41\x0e\xed\x2b\x45\x3d\x5f\x54\xbc\xa7\x41\x30\xf8\x05\x9b\xe8\xdf\xdc\x6d\xbf\xae\x73\x6e\x84\x5b\xd5\x55\xb3\x27\x3f\x40\x6f\x64\x08\x2d\x1b\x35\x94\x23\x03\xd9\x47\x4d\xb6\x65\x29\xf1\x0f\x32\xe0\x5a\xdb\x53\xce\x62\xa9\x2f\x4a\xc9\x20\x16\x6f\x31\xf5\xc2\x1f\xe4\x01\xef\xc3\xe6\xa6\x29\x6d\x85\x6f\x78\xc9\xd9\xe2\x25\x25\x34\x01\x73\x4e\x89\xff\xc0\x5d\x79\xcd\xef\x3f\x95\x23\x5a\x95\x33\x83\x01\xe3\x91\x54\xcb\x1c\x85\xc8\x56\x75\x55\xa5\xc4\x3f\x6e\x1e\xbf\x6c\xe9\x84\x76\x4e\x5b\x57\x55\xa3\xf4\x79\x49\xea\xf1\x69\xd4\x1e\x15\xec\x35\x1a\x05\x73\x82\xcf\xde\x77\x0f\xf2\x6a\x48\xaa\xef\x8f\xeb\x9c\xd1\x7b\xf2\x4b\x91\x62\x5b\x35\x46\xee\xd0\x94\x26\x5b\xe6\x66\x65\x37\x7a\xc3\xfe\xc3\xfa\x6f\x59\x81\x36\x39\xcc\x66\xda\xba\x31\x82\x56\x2f\xbd\xc0\xca\x01\xff\xb9\x8a\x57\x87\x2d\x9b\x7e\xcf\xd2\x8c\x38\x91\x5d\x50\x4c\x59\x19\x38\x23\x7b\x3c\x92\x51\xe8\xdb\xe7\x41\x4a\xa7\x5f\x0e\xd1\xd3\x8e\xa2\x08\x68\xd5\x7b\xd9\xf7\x18\x42\x17\x0b\xa5\xf6\xe7\xed\x63\x20\xc7\x48\x7b\xea\xc7\x00\x0b\xa5\x12\xb7\x11\x4a\x9f\x67\xb6\x11\x07\x67\x64\xc4\xb9\xd5\xe7\xb1\x5e\xe6\x40\x7f\x2e\x18\xf0\x69\x15\x45\x59\x8a\x55\x7d\x23\x59\xff\x0e\x00\x00\xff\xff\xbc\xdb\x60\x1c\xbb\x02\x00\x00"
|
||||
var _repoSettingsWebhookDingtalkTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x92\x41\x8f\xd3\x30\x10\x85\xcf\xc9\xaf\x18\x8d\xb8\xe2\x08\x4e\x08\x25\xe5\x80\x58\x2d\x52\x41\xab\x6d\x11\xc7\xc8\xb5\xa7\xad\x15\xc7\xe3\xb5\x9d\x2e\x55\xc8\x7f\x47\x4e\x1a\x60\x39\x90\x4b\x9c\xd1\xd3\xf3\x37\xef\x65\x1c\xcd\x11\xe8\x09\xc4\x3d\x73\xb7\xbf\x7a\x02\xd4\xc6\x9d\x92\xb4\x1d\x4e\x53\x59\xd4\x7e\x33\x8e\xc2\xbc\x79\xe7\xc4\x3e\x00\x06\xf2\x2c\x22\xa5\x64\xdc\x29\x0a\xa9\x75\xbb\xaa\xdb\x33\x73\xd7\x6a\x8a\x0a\x01\xcf\x29\xf9\xf8\xbe\xaa\xd8\x93\x7b\xad\x59\x89\x55\x25\x14\xf7\x15\xc2\x4f\xd8\xa5\xf0\xf6\x7e\xff\x65\x3b\x4d\x75\xe5\x37\x65\x51\x1f\x39\xf4\xa0\xac\x8c\xb1\xc1\xc1\x40\xfe\x44\x90\x2a\x19\x76\x0d\xce\x94\xe2\x41\x9e\xe8\x73\xdc\xdd\x6e\xcf\xc0\xf1\x2b\x3d\x4f\xd3\x38\xbe\x12\x5b\xe3\xba\x7c\x22\x1b\x29\xbf\xc5\x1d\x87\xfe\xdb\xe3\x76\x9e\x39\x3d\x4d\x08\x3d\xa5\x33\xeb\x06\x3d\xc7\x84\x9b\xb2\x28\xc6\x51\x7c\xdc\x3d\xde\xed\xb9\x23\xb7\xb0\x94\x45\x51\x6b\x73\x59\x39\x02\x3d\x0d\x26\x90\x86\xa3\x21\xab\x61\xa1\xf8\x14\x42\xfb\x20\xaf\x96\xa5\x9e\xfd\x29\x04\x0e\xeb\x25\xd9\xb6\xa8\xad\x3c\x90\xcd\x2b\x34\xe8\x17\x65\x3b\x04\x8b\xff\x49\xf2\x6f\x59\x8e\x64\x76\x58\xcc\x8c\xf3\x43\x02\xa3\x5f\x7a\x81\x93\x3d\xfd\x33\x4a\x57\x4f\x0d\xce\xc7\x8b\xb4\x03\xe5\xdc\xc4\x77\x3a\xe4\x66\xc4\xcc\x8a\xe0\xad\x54\x74\x66\xab\x29\x34\x7f\x6a\x92\xde\xbc\xac\x28\xf0\x81\x53\x15\xc9\xe9\x0f\x52\x29\x8a\xb1\x4d\x39\xa5\xe6\xc7\xed\x41\x90\x43\xe2\x23\xab\x21\xc2\x9a\x52\xc6\xad\x2b\x6d\x2e\x4b\xb6\x89\x7a\x6f\x65\xa2\x65\xd5\x6a\x5d\xb5\x7a\x5e\x80\x7e\x0f\x10\xc4\xfc\xa3\x55\xb9\xf2\x4d\x79\x4b\xb2\xfc\x15\x00\x00\xff\xff\xf2\x7d\x18\xf9\x99\x02\x00\x00"
|
||||
|
||||
func repoSettingsWebhookDingtalkTmplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -2252,12 +2252,12 @@ func repoSettingsWebhookDingtalkTmpl() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/dingtalk.tmpl", size: 699, mode: os.FileMode(0644), modTime: time.Unix(1571173927, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2d, 0x52, 0x26, 0x40, 0x4c, 0x91, 0x81, 0xb, 0xf0, 0xa6, 0xea, 0x74, 0xd7, 0x1f, 0x24, 0xd7, 0x9d, 0x70, 0x6e, 0x56, 0xe3, 0xac, 0xcc, 0xa1, 0x36, 0x5d, 0x7a, 0xaa, 0x55, 0x12, 0x5f, 0xd}}
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/dingtalk.tmpl", size: 665, mode: os.FileMode(0644), modTime: time.Unix(1584877872, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf9, 0x8d, 0xcf, 0x8d, 0x6b, 0xf9, 0x4, 0xe0, 0xcb, 0xdc, 0x54, 0x4d, 0x49, 0x8a, 0xf1, 0x61, 0xba, 0x5e, 0x76, 0x48, 0x2, 0x3, 0xa6, 0xb5, 0xc5, 0xd8, 0x20, 0x67, 0xc1, 0x98, 0x73, 0x37}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _repoSettingsWebhookDiscordTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x94\x4b\x8f\xdb\x20\x10\xc7\xcf\xf6\xa7\x40\xf4\x8e\xd5\xc7\xa1\xad\xec\x1c\xba\x7d\xec\x4a\xdb\x6a\xb5\x49\xd5\xa3\x45\x60\xe2\xa0\x60\x60\x01\x27\x8d\x28\xdf\xbd\xc2\x8f\x64\x1f\xc9\x6e\x7b\xcb\x30\xff\xfc\x67\x7e\x83\x99\x10\xc4\x0a\xc1\x1d\x22\x97\x5a\x6f\x16\x7b\x03\x08\x73\xe1\x98\xb6\x1c\xc7\x98\x67\xa5\x99\x85\x40\xc4\xeb\xf7\x8a\x2c\x2c\xc2\x16\x8c\x26\x0e\xbc\x17\xaa\x71\x84\x72\x5e\x8f\xe2\x7a\xad\xf5\xa6\xe6\xe0\x18\x46\x78\xed\xbd\x71\x1f\x8b\x62\xcc\x51\x63\x08\xd3\x6d\x81\xd1\x1f\x34\xf7\xf6\xcd\xe5\xe2\xfb\x75\x8c\x65\x61\x66\x79\x56\xae\xb4\x6d\x11\x93\xd4\xb9\x0a\x77\x02\xa5\x10\x23\xca\xbc\xd0\xaa\xc2\x21\x90\x4f\xd4\xc1\xb5\x50\x9b\x18\x8b\xa9\x6e\x91\x6a\xb9\xc9\xbd\xe8\x09\xc8\x0d\x6d\xe0\xca\xcd\x47\x49\x82\x71\x3f\x60\x17\xa3\x82\x5d\x08\x20\x1d\xc4\x18\x02\xf9\x05\xcb\xf4\x67\x72\xf5\x39\x85\xa0\x78\x8c\x18\xb5\xe0\xd7\x9a\x57\xd8\x68\xe7\xf1\x2c\xcf\xb2\x10\xc8\xc5\xfc\xf6\xeb\x42\x6f\x40\x0d\xcd\xe6\x59\x56\x72\xb1\x9d\x1a\xb5\x70\xd7\x09\x0b\x1c\xad\x04\x48\x8e\x86\x0e\xbe\x58\x5b\xdf\xd0\xbd\xd4\x94\xff\xbc\xbd\x8e\x11\xac\xd5\x76\x2a\x92\x6c\xb3\x52\xd2\x25\xc8\xc4\x58\x61\x33\x28\xeb\xce\x4a\xfc\xcc\x88\xef\xcb\xd2\xcc\x7a\x87\xc1\x4c\x28\xd3\x79\x24\xf8\x43\x2f\xa4\x68\x0b\x8f\x8e\xfc\xde\x40\x85\xfb\x9f\x5b\x2a\x3b\xe8\x07\x3b\x8d\xa2\xef\x15\x23\xda\x79\xbd\xd2\xac\x73\x68\x82\x4b\x55\xca\x82\x8b\xed\x2c\x7f\x84\xdf\x53\x3f\x45\xea\x1c\xd8\x54\xfd\x39\x1e\x27\x29\xdb\xd4\x07\xe5\x59\xa4\x83\x62\xe4\x39\xc6\x47\x82\x79\xf2\xba\xec\x19\xc6\x6c\x02\x31\x92\x32\x58\x6b\xc9\xc1\x56\x18\x48\x43\xd0\x37\xdd\x38\x7c\x8f\xe6\x9f\x60\x04\xd3\xea\xa5\xcb\x19\x60\x0e\xca\xb3\x30\x07\xc5\x08\x73\x8c\x4f\xc1\x5c\x31\xad\xc6\x4b\x79\xca\x32\x3d\x2d\xf8\x4d\x5b\x23\xa1\x7f\x57\xa2\x6d\x8a\x15\xdd\x26\x57\x62\x54\xf3\xdf\xa8\x4c\x4b\x6d\x5f\xe6\x1c\x64\x67\x21\x87\xf4\x48\x38\x06\xa7\xf0\x2e\x52\xea\x34\xdc\x2b\xce\xdf\x2d\xdf\x7e\x78\x08\x10\x82\x87\xd6\x48\xea\x61\x68\xeb\xb8\x06\x76\xc3\x17\x7c\x38\xc0\x88\xf4\x2b\xab\x48\x4b\x64\x96\x8f\x4f\x2f\xff\x1b\x00\x00\xff\xff\x26\xaa\xc4\x7a\xe2\x04\x00\x00"
|
||||
var _repoSettingsWebhookDiscordTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x94\x5f\x6f\xdb\x20\x14\xc5\x9f\xed\x4f\x81\xd8\x9e\xb1\xf6\xe7\x61\x9b\xec\xbc\x54\xeb\x5a\xa9\x9d\xaa\x26\xd5\x1e\x2d\x02\x37\x0e\x0a\xe6\x52\xc0\xe9\x22\xcf\xdf\x7d\xc2\x76\x9c\xfe\x49\xda\xed\x29\xbe\xdc\xa3\x73\xcf\x0f\x02\x6d\xab\x56\x04\xee\x09\xbb\x40\xdc\x2c\x76\x16\x08\x95\xca\x0b\x74\x92\x76\x5d\x9a\xe4\x76\xd6\xb6\x4c\x7d\xf8\x62\xd8\xc2\x11\xea\xc0\x22\xf3\x10\x82\x32\x95\x67\x5c\xca\x72\x14\x97\x6b\xc4\x4d\x29\xc1\x0b\x4a\xe8\x3a\x04\xeb\xbf\x65\xd9\xd8\xe3\xd6\x32\x81\x75\x46\xc9\x1f\x32\x0f\xee\xe3\xc5\xe2\xfa\xaa\xeb\xf2\xcc\xce\xd2\x24\x5f\xa1\xab\x89\xd0\xdc\xfb\x82\x36\x8a\xc4\x92\x12\x2e\x82\x42\x53\xd0\x3e\x1c\xbb\xe1\x15\x5c\xfa\xf9\x38\x35\xe6\xf4\x3f\xe1\xa1\xeb\xda\xf6\x3d\xbb\x52\x66\x13\xbf\x40\x7b\x88\xbf\xec\x1c\x5d\x7d\x77\x7b\xd5\xaf\x19\xd9\x75\x94\xd4\x10\xd6\x28\x0b\x6a\xd1\x07\x3a\x4b\x93\xa4\x6d\xd9\xd9\xfc\xf6\x7c\x81\x1b\x30\x43\x96\x34\x49\x72\xa9\xb6\xfb\x1c\x0e\xee\x1b\xe5\x40\x92\x95\x02\x2d\xc9\x90\xe2\xbb\x73\xe5\x0d\xdf\x69\xe4\xb2\xf7\x07\xe7\xd0\xed\x87\x44\xdb\x24\xd7\x7c\x09\x3a\x22\x14\xd4\x0e\xca\xb2\x71\x9a\xbe\xb2\x83\x8f\x65\x71\x4b\x7a\x87\xc1\x4c\x19\xdb\x04\xa2\xe4\x53\x2f\x62\x78\x0d\xcf\x96\xc2\xce\x42\x41\xfb\xcf\x2d\xd7\x0d\xc4\x7d\x63\xbf\x60\x19\x8f\x84\xf5\x59\x29\xe1\x4d\xc0\x15\x8a\xc6\x93\x3d\x5c\x9c\x92\x67\x52\x6d\x67\xe9\x33\xfc\x9e\xfa\x25\x52\xe3\xc1\xc5\xe9\xaf\xf1\x78\xcd\xc5\xa6\x9c\x94\x27\x91\x26\xc5\xc8\x73\xa8\x0f\x04\xf3\xe8\x75\x0d\x81\xb3\xbb\xb1\x1b\x41\xac\xe6\x02\xd6\xa8\x25\xb8\x82\x02\xab\x18\xf9\x81\x95\xa7\x8f\x68\xfe\x09\x46\x09\x34\x6f\x1d\xce\x00\x33\x29\x4f\xc2\x4c\x8a\x11\xe6\x50\x1f\x83\xb9\x14\x68\xc6\x43\x79\xc9\xb2\xbf\x39\xf0\x9b\xd7\x56\x43\x7f\x6d\x54\x5d\x65\x2b\xbe\x8d\xae\xcc\x9a\xea\xbf\x51\x05\x6a\x74\x6f\x73\x0e\xb2\x93\x90\x43\x7b\x24\x1c\x8b\x63\x78\x67\xb1\x75\x1c\xee\x9d\x94\x9f\x97\x9f\xbe\x3e\x05\x68\xdb\x00\xb5\xd5\x3c\xc0\x10\x2b\xdb\xc7\xca\x1e\x86\x7f\xf0\xb4\x40\x09\xeb\x5f\xa4\x2c\xbe\x11\xb3\x74\xbc\x7a\xe9\xdf\x00\x00\x00\xff\xff\x54\x5a\x48\x90\xc1\x04\x00\x00"
|
||||
|
||||
func repoSettingsWebhookDiscordTmplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -2272,12 +2272,12 @@ func repoSettingsWebhookDiscordTmpl() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/discord.tmpl", size: 1250, mode: os.FileMode(0644), modTime: time.Unix(1571173927, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xff, 0x45, 0xbc, 0x96, 0xaa, 0x26, 0x4c, 0xeb, 0x77, 0x1, 0x9d, 0x88, 0x55, 0x99, 0x6c, 0x9b, 0xc5, 0x42, 0x7f, 0xa7, 0x72, 0xec, 0x92, 0xe9, 0xdb, 0x3e, 0x42, 0xec, 0x8b, 0x97, 0xd6, 0x32}}
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/discord.tmpl", size: 1217, mode: os.FileMode(0644), modTime: time.Unix(1584877671, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x49, 0x5f, 0xec, 0x8, 0x7c, 0xb0, 0xcb, 0x7f, 0x47, 0xc9, 0xe8, 0x35, 0x65, 0xbe, 0x44, 0xd4, 0x36, 0x34, 0xd7, 0x47, 0x2, 0xcc, 0xf3, 0x7f, 0xdf, 0xa6, 0xe3, 0x30, 0x5a, 0x7a, 0xf2, 0xe6}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _repoSettingsWebhookGogsTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x54\xcf\x6f\xdb\x20\x14\x3e\x3b\x7f\x05\xe2\x1e\x5b\xed\x69\x9a\x12\x1f\xd6\x6d\x6a\xa5\x6e\xaa\x9a\x4c\x3b\x46\xd4\x3c\x27\x2c\x98\x47\x01\xd7\x8d\x28\xff\xfb\x84\x8d\xd3\x38\xdd\xda\x1b\x3c\x1e\xdf\xfb\xbe\xf7\xcb\x7b\x51\x13\x78\x24\xf9\x35\xe2\x7e\x7d\xd0\x40\xe8\x16\xb7\x96\x86\x30\xcb\x16\xba\xf4\x3e\x17\x17\x9f\x54\xbe\x36\x84\x1a\xd0\x98\x5b\x70\x4e\xa8\xad\xcd\x19\xe7\x9b\x0e\x1e\x76\x88\xfb\x0d\x07\x5b\x51\x42\x77\xce\x69\xfb\xb9\x28\x22\x40\x2e\xb0\xe0\x58\xd9\xa2\x06\xe6\x5a\x03\xb6\x48\xce\xf9\xce\x35\x92\x92\x17\xb2\x72\xe6\xf2\x7a\xfd\xe3\x36\x84\x45\xa1\xcb\x59\xb6\xa8\xd1\x34\xa4\x92\xcc\xda\x25\x6d\x05\x89\x57\x4a\x58\xe5\x04\xaa\x25\xf5\x3e\xff\xc2\x2c\xdc\x0a\xb5\x0f\xa1\x18\x59\x14\x11\xd1\xf6\x01\x8b\x5e\x49\x7e\xc7\xb6\x70\x63\x57\xe9\x3d\x8a\xb2\x3f\xa1\x0b\x41\x41\xe7\x3d\x48\x0b\x21\x78\x9f\xff\x4e\x5c\x6e\xbe\xc6\x2b\x28\x1e\x02\x25\x0d\xb8\x1d\xf2\x25\xd5\x68\x1d\x2d\x67\x59\xe6\x7d\x7e\xb5\xba\xff\xbe\xc6\x3d\xa8\x81\xe9\x2c\xcb\x16\x5c\x3c\x8d\x2c\x0d\x3c\xb6\xc2\x00\x27\xb5\x00\xc9\xc9\xc0\xe0\x9b\x31\x9b\x3b\x76\x90\xc8\xf8\xaf\xfb\xdb\x10\xc0\x18\x34\x63\x90\x08\x9b\x2d\x24\x7b\x00\x19\x05\x2e\xa9\x1e\x3c\x37\xad\x91\xf4\x9d\x6c\x9f\xba\xc5\x84\xf5\x08\x03\x98\x50\xba\x75\x44\xf0\x29\x16\x51\xac\x81\x33\x93\x3b\x68\x58\xd2\xfe\xf8\xc4\x64\x0b\x7d\x56\xc7\x54\xf4\x5c\x29\x61\xad\xc3\x1a\xab\xd6\x92\x51\x5c\x8c\xb2\x28\xb8\x78\x2a\xcf\xd4\xf7\xa2\x4f\x15\xbd\xc3\xbf\x42\xe5\x40\xb9\x4d\xa4\x70\x2e\xe0\x04\xb2\x15\xc4\x82\x84\xbe\xe6\x84\x1b\xd4\x1c\x3b\x35\x84\x18\x85\x0e\x22\x76\x82\x73\x50\xb4\x97\x3d\xc1\x4e\xba\xa7\xb6\xa3\xda\x58\x9f\x51\xf0\xd5\xe0\x12\x7b\x7e\xd2\x13\x67\xf6\xa1\x67\x98\xd6\x52\x54\x2c\xf2\x2a\xfe\x58\x54\x93\x7a\x4e\x24\x70\xa8\x59\x2b\x1d\x71\xf0\xec\x68\x79\x4c\x5c\xe4\x7f\x74\x49\xc2\x88\xa8\x50\x45\x1f\xf1\x16\xa6\x01\xd5\x26\xf4\x89\x5d\x38\x68\x28\xe1\xcc\xb1\x79\x52\x75\x41\xcb\x73\x76\x27\x51\x3f\xf8\x7c\x39\xfd\xfc\x3c\xef\xba\x6e\x1e\x27\x6f\xde\x1a\x09\xaa\x42\x0e\xfc\x54\xc3\xf1\xf8\xda\x11\xc7\xc3\x50\x9f\xb1\x39\xd8\x1e\xc6\x8e\xd3\xcc\xda\x0e\xcd\xd0\x2b\x6f\x3a\xe8\x64\x6c\x56\x50\x19\x70\x1f\x8d\x8c\xed\xbd\xde\x9b\x96\xe4\xf1\xdf\x41\x49\xef\xa9\x57\xc6\xdb\x19\xd9\x7f\xcc\xc8\xc8\x6f\x18\x93\x0a\x1b\x2d\xc1\xc1\x92\x62\x5d\x27\x9a\x7a\x94\x16\xcb\x4f\xb6\x06\x0e\xa4\x5f\x8e\x1f\x92\x4d\x3b\xf4\x85\xac\x58\x0d\xe3\x4a\x7c\x4d\xae\xf7\x0e\x1a\x2d\x99\x83\xe1\xfb\xeb\x06\x4c\x6b\xf5\x68\xa0\x24\xef\x77\x77\x11\xab\x58\xce\x52\x16\x67\x7f\x03\x00\x00\xff\xff\x45\x67\xd3\x82\xe8\x05\x00\x00"
|
||||
var _repoSettingsWebhookGogsTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x54\xc1\x6e\xdb\x30\x0c\x3d\x27\x5f\x21\x08\xbb\x46\x46\x77\x1a\x86\xc4\x97\x62\x45\x07\x74\x43\xd1\x64\xd8\x31\x50\x2d\x3a\xd1\x22\x8b\xaa\x24\xd7\x0d\x3c\xff\xfb\x20\x59\x4e\xed\x74\x6d\x4e\x91\x19\xea\xe9\x3d\xf2\x91\x6d\x2b\x4b\x02\x4f\x84\xdd\x22\x1e\x36\x47\x03\x84\xee\x70\xe7\x68\xd7\xcd\x67\x4b\x93\xb7\x2d\x93\x57\x5f\x34\xdb\x58\x42\x2d\x18\x64\x0e\xbc\x97\x7a\xe7\x18\x17\x62\xdb\xc0\xe3\x1e\xf1\xb0\x15\xe0\x0a\x4a\xe8\xde\x7b\xe3\xbe\x66\x59\x00\x60\x12\x33\x81\x85\xcb\x4a\xe0\xbe\xb6\xe0\xb2\x94\xcc\xf6\xbe\x52\x94\xfc\x25\x6b\x5e\x42\xd7\x2d\x33\x93\xcf\x67\xcb\x12\x6d\x45\x0a\xc5\x9d\x5b\xd1\x5a\x92\xf0\x49\x09\x2f\xbc\x44\xbd\xa2\x91\x23\xbb\xe7\x3b\xf8\xee\xd6\xe9\xfd\x40\xd7\xfd\x84\xa6\xeb\xda\xf6\x13\xbb\x93\xfa\x10\x4e\xa0\x1c\x84\x5f\x76\x83\xb6\xfa\xf5\x70\x17\x63\x5a\x74\x1d\x25\x15\xf8\x3d\x8a\x15\x35\xe8\x3c\xcd\xe7\xb3\x59\xdb\xb2\xeb\xf5\xc3\xcd\x06\x0f\xa0\x6f\x37\x3f\xee\x82\xe2\xd9\x52\xc8\xe7\x81\x87\x85\xa7\x5a\x5a\x10\xa4\x94\xa0\x04\xe9\x59\x7c\xb3\x76\x7b\xcf\x8f\x0a\xb9\x88\xf8\x60\x2d\xda\xe1\x91\x00\x3b\x5b\x2a\xfe\x08\x2a\x48\x58\x51\xd3\x67\x6e\x6b\xab\xe8\x07\xb5\x1c\xa7\x85\x92\x44\x84\x1e\x4c\x6a\x53\x7b\x22\xc5\x14\x8b\x68\x5e\xc1\x59\xc8\x1f\x0d\xac\x68\x3c\x3e\x73\x55\x43\xa8\x1b\xfb\x9d\x8a\x1e\xb9\x52\xc2\x6b\x8f\x25\x16\xb5\x23\x83\xb8\xf0\xca\x32\x13\xf2\x39\x3f\x53\x1f\x45\x8f\x15\x7d\xc0\xbf\x40\xed\x41\xfb\x6d\xa0\x70\x2e\x60\x04\x59\x4b\xe2\x40\x41\xec\x2a\x11\x16\x8d\xc0\x46\xf7\x4f\x0c\x42\x7b\x11\x7b\x29\x04\x68\x1a\x65\x4f\xb0\x93\xee\x69\xec\xa4\x36\xf4\x67\x10\x7c\xdd\xa7\x04\x47\x47\x43\xbc\x13\xef\x0d\xc3\x8d\x51\xb2\xe0\x81\x57\xf6\xc7\xa1\x9e\xf4\x73\x22\x41\x40\xc9\x6b\xe5\x89\x87\x17\x4f\xf3\x53\xe1\x02\xff\x53\x4a\x12\x46\x64\x81\x3a\xe4\xc8\xb7\x30\x15\xe8\x3a\xa1\x4f\xe2\xd2\x43\x45\x89\xe0\x9e\x2f\x92\xaa\x2b\x9a\x9f\xb3\x1b\xbd\x7a\xe1\xf2\xe7\xe9\xe5\x97\x45\xd3\x34\x8b\x30\x5b\x8b\xda\x2a\xd0\x05\x0a\x10\x63\x0d\xa7\xe3\xab\x23\x4e\x87\xbe\x3f\x83\x39\xf8\x01\x06\xc7\x19\xee\x5c\x83\xb6\xf7\xca\x1b\x07\x8d\xc6\x66\x0d\x85\x05\x7f\x69\x64\x5c\xcc\xfa\x68\x5a\x52\xc6\xbb\x83\x92\xfe\x4f\x5e\x19\xbe\xce\xc8\xfe\x67\x46\x06\x7e\xfd\x98\x14\x58\x19\x05\x1e\x56\x14\xcb\x32\xd1\x34\x83\xb4\xd0\x7e\xb2\xb3\x70\x24\x71\xf5\x5d\x24\x9b\x36\xe4\x74\xe9\xbd\x16\xb7\x6d\x3d\x54\x46\x71\x0f\xfd\xf5\x6c\xb8\x3e\x2c\xcd\x53\x80\x12\x16\x37\x73\x16\xba\x98\xcf\x53\x15\xe7\xff\x02\x00\x00\xff\xff\xb9\x34\xe8\x84\xc6\x05\x00\x00"
|
||||
|
||||
func repoSettingsWebhookGogsTmplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -2292,8 +2292,8 @@ func repoSettingsWebhookGogsTmpl() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/gogs.tmpl", size: 1512, mode: os.FileMode(0644), modTime: time.Unix(1571173927, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xec, 0x14, 0x96, 0x84, 0xc8, 0x99, 0x2e, 0x49, 0xfb, 0x1e, 0xa8, 0x11, 0x3d, 0x4d, 0x10, 0xbe, 0xea, 0x8a, 0x15, 0xe2, 0xed, 0xd8, 0x54, 0xc6, 0x8d, 0xac, 0x96, 0x63, 0xe6, 0x8c, 0x92, 0xa0}}
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/gogs.tmpl", size: 1478, mode: os.FileMode(0644), modTime: time.Unix(1584876104, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbf, 0x26, 0xa8, 0x9, 0xef, 0xbe, 0x27, 0x7c, 0x4c, 0x80, 0x9f, 0x72, 0x94, 0xa7, 0x13, 0x74, 0xe9, 0x2, 0x4d, 0x5e, 0x6b, 0x67, 0x13, 0x91, 0x49, 0xdd, 0xb8, 0xea, 0x3e, 0x94, 0x2, 0x4c}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
|
@ -2317,7 +2317,7 @@ func repoSettingsWebhookHistoryTmpl() (*asset, error) {
|
|||
return a, nil
|
||||
}
|
||||
|
||||
var _repoSettingsWebhookListTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x96\xcb\x6e\xdb\x3a\x10\x86\xd7\xce\x53\x0c\x88\xb3\xb5\x84\x04\x59\x9c\x85\x22\xa0\x45\x80\xb6\x80\xbb\xa9\x53\x74\x19\xd0\xe2\x98\x62\x4d\x91\x2a\x39\xb2\x1b\xa8\x7a\xf7\x82\xba\xe7\x22\x23\x45\xe2\x0d\x2d\x51\xfa\xe7\xfb\xc9\x99\xa1\x12\xa1\x8e\x90\x69\xee\xfd\x0d\xa3\x13\xea\x23\xc2\x49\x09\x84\xcc\xea\xaa\x30\x90\x59\x43\x68\x88\xa5\x17\xab\xba\x26\x2c\x4a\xcd\x09\x81\xed\xb8\xc7\x98\x6b\x74\xc4\x20\x6a\x9a\x8b\x55\x92\x5f\x0f\x2a\x95\x02\xb2\x25\x70\x22\x9e\xe5\x28\x20\x47\x2e\xd0\x05\x85\x55\x5d\x47\xea\xf2\x7f\x13\xdd\x39\x60\x0e\x4b\x1b\x79\x24\x52\x46\xfa\x28\xb7\xf6\xe0\x59\x50\x5a\xcd\x89\x2a\x05\x4e\xc9\xbc\x8d\xff\x6c\x86\x1e\x4a\xf4\xf0\xb3\x2a\x4a\x10\xce\x96\xc2\x9e\x4c\xf7\xdc\xaa\xae\xd5\x1e\xa2\xbb\x30\xdf\x4a\x3e\x7f\x77\xa7\x2b\x04\x52\xe6\x01\x76\x15\x91\x35\x2c\x5d\x66\xe3\x42\xdc\x9f\x70\x17\x10\x59\xd3\x24\xb1\x50\xc7\xf4\xb9\x68\x81\xa6\xea\xc3\x07\x00\xc7\x8d\xc4\x27\x0c\x3d\x18\xfe\x82\x08\x98\xb4\xb2\x37\xdc\xfd\x12\x3e\x28\x29\xc2\x02\xb4\x95\x96\x41\xee\x70\x7f\xc3\xea\xfa\xbf\xe8\x23\xf7\xb8\x51\xe6\xd0\x34\xf1\x00\x16\xb7\x8b\x16\x07\xa1\xd8\xe0\x69\x0c\x1e\xc4\x54\x21\x47\xb9\x42\xae\x2f\xaf\x18\x78\x97\x05\xa9\x0f\x65\xb9\xad\x76\xdf\xbf\x6d\x9a\x26\x56\x85\x8c\xf7\xfc\xa8\x32\x6b\xa2\xd2\x48\x96\x7e\xb2\xd2\x4f\x44\x31\x4f\x27\x70\xd4\x1e\x61\xa4\xf7\x9a\x67\x87\x77\xc1\x6f\x95\xde\xc0\xdf\xbe\xdf\xd1\x6f\xc3\xdf\x57\xe1\x0b\xe5\x33\xeb\xc4\xbb\x18\xe8\xb5\xde\x60\xa1\x57\xe8\x4c\xdc\x76\x17\xaf\xb4\x61\x24\x71\xfd\x3e\x1b\x31\x88\xbd\xc9\x48\x27\x31\x38\xe9\xae\x96\xac\x18\x31\x62\x3f\xba\x9a\x55\xd8\xec\xfe\x78\x77\xf8\x93\xc4\xf9\x75\x18\x1e\x17\xf6\xd8\x76\x88\xef\x34\x82\x47\x59\xf4\xfd\xeb\xe9\x93\xc1\x35\x68\xe5\x5f\x68\x2e\x61\xe5\xc6\x56\x12\xdd\xa2\xcf\x9c\x2a\x49\x59\x03\x7f\x60\x4b\xee\xea\xf3\xdd\xd7\xcd\x13\xaa\xa9\xe4\x7f\x74\xad\x62\xa8\xfa\x05\xdd\xa9\x15\x6c\xb8\xa7\x2d\x71\xaa\x3c\x5c\x8e\x0b\x92\xf8\x92\x9b\xb1\x2f\xe3\x6f\x02\xe9\x10\x0d\x4b\x13\x35\xdc\xb5\x19\x85\xc2\x85\x7e\x5c\x67\x39\x66\x07\x96\x26\xb1\x4a\x93\x38\xbc\x3e\x06\x9a\x27\xcd\x2c\xda\xd5\x99\x68\x0e\xc5\xb9\x58\x5d\xeb\x5f\x8a\x75\xde\xc5\xc3\x39\xe1\xd2\xa9\x42\x91\x3a\xe2\x5a\xd8\x85\x00\xb3\x44\xe1\xaf\x4a\xec\xba\x8e\xbe\xdc\x36\x4d\xdb\xe2\xdb\x5c\x9d\xf2\x70\xf9\xac\x79\x91\x3e\x9c\x1a\x2c\xfd\xd7\xb0\x93\xdb\x3d\x87\x3d\x5f\x97\x68\x32\xa5\x07\x73\xfc\xb1\xc1\xc5\xbd\x18\xcb\x5a\xa0\x46\xc2\x75\x7f\x6e\x81\xe0\xc4\xd7\x95\xd3\x1d\x4e\x8f\xd2\x3d\xd3\x4f\x2a\x11\xe6\x16\x60\x48\x15\xe8\x17\x58\x66\x85\x38\xcf\xf3\x61\x07\xa6\x42\x6c\xc7\x7e\xb8\x98\x7f\x27\x84\x83\x74\x5a\x97\xfe\x10\xed\xe9\xee\x0b\x2b\xb8\xee\xbe\x1f\xfe\x06\x00\x00\xff\xff\x82\x77\x58\x0f\x86\x08\x00\x00"
|
||||
var _repoSettingsWebhookListTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x55\xcb\x6f\x9b\x30\x18\x3f\x93\xbf\xe2\x93\xb5\x6b\x40\xad\x7a\xd8\x81\x22\x4d\xaa\x34\x4d\xea\x69\xe9\xb4\x63\x64\xf0\x17\xf0\x62\x6c\xcf\xfe\x48\x56\x31\xfe\xf7\xc9\xbc\xf2\x58\x93\xb5\xdd\x09\x63\xfc\x7b\xf8\x7b\x91\x0a\xb9\x83\x42\x71\xef\xef\x19\xed\x51\xed\x10\xf6\x52\x20\x14\x46\x35\xb5\x86\xc2\x68\x42\x4d\x2c\x5b\x44\x6d\x4b\x58\x5b\xc5\x09\x81\xe5\xdc\x63\xc2\x15\x3a\x62\x10\x77\xdd\x22\x4a\xab\xbb\x89\xa5\x91\x40\xc6\x02\x27\xe2\x45\x85\x02\x2a\xe4\x02\x5d\x60\x88\xda\x36\x96\x37\x1f\x75\xfc\xe4\x80\x39\xb4\x26\xf6\x48\x24\x75\xe9\xe3\xca\x98\xad\x67\x3d\x53\x52\xdd\x65\x8b\xe8\xd8\x57\x23\x0f\x6c\x1e\xcb\x7a\x34\x14\xa5\x36\x6b\xdb\xf8\x01\x7d\xe1\xa4\x25\x69\x34\xfc\x86\x15\xdf\x60\xd7\xa5\x89\xed\x0f\x9c\x92\x04\x11\x50\xd2\x0f\xe8\xa8\x6d\x1d\xd7\x25\x42\xfc\x1d\xf3\x5e\x3f\xc8\x47\xa7\x28\x49\x58\x0f\xa7\xc3\x79\xb9\x01\xfc\x09\xf1\x23\xf7\xb4\x22\x4e\x8d\x87\x9b\x11\x13\x45\xa9\xb7\x5c\xcf\x91\xc4\x5f\x04\xa5\x43\xd4\x2c\x4b\xe5\xb4\x6b\x0a\x92\x85\xd1\x30\x3e\x97\x45\x85\xc5\x96\x65\x69\x22\xb3\x34\x09\xf0\x59\x08\x95\x47\xf8\x5b\xed\xf6\x8a\x9a\x43\x71\x4d\x6b\x48\xd6\x25\xad\xeb\xb7\x78\xbe\x46\x6c\x9d\xac\x25\xc9\x1d\x2e\x85\xb9\x20\xa0\xc5\xc4\x9f\x72\xa8\x1c\x6e\xee\x59\xdb\x7e\x88\x1f\xa5\xde\x76\x5d\xd2\xb6\xf1\x97\x87\xae\x63\x21\x97\xdf\xbe\x3e\x86\xe4\xf1\x11\x7b\x96\x3f\x27\xcb\x8a\xa6\x6c\x04\xae\x63\x9f\xb9\x6a\x90\x5d\x61\x3f\xdc\x60\xc3\x61\xc3\x97\x16\x75\x21\xd5\x64\x98\x5f\x60\x75\x28\x40\xa0\x42\xc2\x65\xde\x10\x19\xcd\x40\x70\xe2\xcb\xc6\xa9\x13\x99\xe1\xcc\xf8\x51\x8a\xf0\xed\x82\x2e\x39\xee\xab\xa5\x39\x17\x4e\x13\x21\x77\xc3\xfa\xb0\x3c\xc4\x6e\xda\x9b\x9f\xa7\x91\xc9\x0d\x91\xa9\x2f\x74\x49\x9f\x8c\x34\xcf\x2e\x77\xdf\x7e\x6c\x80\x98\x0b\xb1\xd6\xb8\x67\x21\x09\xf9\x51\x1e\xcf\xe4\x3c\x2a\x2c\xfa\x86\xfb\xd1\xd4\x16\x84\x33\x56\x98\xbd\x1e\x52\x73\xb8\xf0\xb4\x0f\xa1\x50\x86\x0b\x2f\xce\xb2\x2a\x70\xc3\x1b\x45\x10\x82\xcd\x5e\xe3\xb0\xa8\x8c\xf1\xb8\xe6\x6b\x7a\xb6\xd8\xfb\x9c\x82\x75\x4c\x5b\xa3\x6e\xc6\x42\x99\xbb\xfc\xe9\xd9\xe2\xd4\xe2\x87\x5e\x06\x56\x9a\x72\x98\x3c\x67\xf9\x0f\xad\x0f\xca\x94\xe6\x85\xaa\x0a\x98\x24\x04\x6a\x2a\x9b\x28\x95\x75\x39\x23\xeb\x72\x79\x73\xcb\xc0\xbb\x22\xa0\x3e\x59\xbb\x6a\xf2\xbe\xb4\x13\x59\x97\xc9\x86\xef\x42\x40\x62\xab\x4b\x96\x7d\x36\xa5\x9f\xa4\xe7\x62\x38\x1d\x00\xc0\xbc\xe2\xc5\xf6\xad\x1e\x7b\xd0\xbb\x4d\xf6\xe8\xc1\xe2\x2a\x2c\xff\xe9\x51\x48\x5f\x18\x27\xde\xea\x72\x84\xbd\xdb\xe7\x88\x1f\x9c\x3e\x0c\x2f\xaf\xf0\xaa\x4b\xe2\xea\xcd\x21\x9d\x70\xff\xe1\x76\x20\x98\xec\x0e\x6f\x2f\xf9\x9d\x67\xe6\xd1\x7a\xae\xf5\xb3\x69\x30\x3e\x16\xc7\x7f\xe8\xd0\x3e\xc9\xd4\x3e\xc9\xd8\x3e\xe3\x98\x5a\xd7\x46\x70\x35\xfc\xb9\xff\x04\x00\x00\xff\xff\x96\xb7\x0d\x96\x00\x08\x00\x00"
|
||||
|
||||
func repoSettingsWebhookListTmplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -2332,8 +2332,8 @@ func repoSettingsWebhookListTmpl() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/list.tmpl", size: 2182, mode: os.FileMode(0644), modTime: time.Unix(1571173927, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xea, 0x45, 0x73, 0x82, 0x86, 0x7d, 0x44, 0xe, 0xf6, 0x3, 0x15, 0xb1, 0xd1, 0x65, 0xab, 0xf4, 0x65, 0x87, 0x9e, 0x15, 0x5d, 0xcd, 0xaa, 0x6f, 0x64, 0x62, 0xf6, 0x29, 0x6d, 0xa5, 0x32, 0xdb}}
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/list.tmpl", size: 2048, mode: os.FileMode(0644), modTime: time.Unix(1584878453, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x27, 0xc4, 0xff, 0x53, 0xd3, 0x99, 0x7c, 0xfb, 0x28, 0x44, 0x9f, 0xb5, 0x7c, 0xe7, 0xb0, 0xad, 0xbe, 0xe4, 0x77, 0x7b, 0x25, 0xc4, 0x63, 0x9, 0xd2, 0x35, 0x28, 0x7a, 0xb4, 0x24, 0x19, 0x46}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
|
@ -2357,7 +2357,7 @@ func repoSettingsWebhookNewTmpl() (*asset, error) {
|
|||
return a, nil
|
||||
}
|
||||
|
||||
var _repoSettingsWebhookSettingsTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x98\x5f\x4f\xf3\x36\x14\xc6\xaf\xcb\xa7\xf0\x7c\xdf\x74\x9b\xb8\x98\xa6\x16\x69\x03\x26\x90\xd8\x86\x00\x69\x97\x91\x1b\x1f\x1a\xab\xae\x9d\xd9\x4e\xa1\xca\xf2\xdd\x27\xff\x49\x48\x4b\xde\xd2\x34\x79\x95\xab\xa2\xda\x7e\xce\xe3\xdf\xe3\x43\xe3\xcc\x29\xdb\xa2\x84\x13\xad\x17\xf8\x95\x01\xa7\xf8\xea\x62\x32\x4f\x2f\xaf\x8a\x22\x62\x3f\xfd\x22\xa2\x17\x85\xb0\x82\x4c\x46\x1a\x8c\x61\x62\xa5\x23\xd8\x82\x30\x31\x05\x9d\xe0\xb2\x9c\xcf\xd2\x4b\xbb\xa2\x21\xb3\x52\x32\xcf\x80\x22\x37\x0f\x99\x5d\x06\xc8\x29\x6b\x2b\x3d\x69\x2d\xb8\xff\x75\xce\x90\x22\x94\x49\x24\xa4\x98\x3a\x15\x8d\x92\x14\x92\xf5\x52\xbe\xfb\xd9\x93\x39\x13\x59\x6e\xaa\x05\x29\xa3\x14\x04\x46\x82\x6c\x60\x81\xfd\x0a\xec\x2a\x2f\xb0\x53\xc2\x68\x4b\x78\x0e\x0b\x9c\xe5\x3a\x8d\xa5\xe0\x3b\x8c\x8a\x82\xbd\x22\xa9\x50\xf4\x48\x56\x70\xaf\x9f\xc3\xf6\xee\xa4\x5c\xeb\xbf\xe0\x0d\x45\xff\xc0\x32\x95\x72\x1d\x3d\xe6\x3a\xfd\x5b\xf0\x5d\x59\x3a\x13\x40\x8b\x02\x04\x2d\xcb\xe0\x84\x93\x25\xf0\x2f\x71\x35\x0a\xff\x87\x9e\x8d\xfa\xf9\xee\xe5\xcf\x07\x8b\xcf\x2f\x77\x08\x66\x94\x6d\x1d\xa2\xfa\x8f\x51\x59\x69\x10\x34\x86\x2d\xa8\x9d\x49\x99\x58\x05\x62\x35\x96\x67\x10\xf4\xb6\x1e\xed\x05\xe7\x53\xa5\xef\x83\x68\x58\x3c\x49\x2a\xa5\x86\xb8\x9a\xb2\x0f\xe7\xda\x0d\xde\xba\xb1\x5e\x68\x7c\x95\x0e\x44\xc2\xe7\x7e\x4b\x86\x9d\xfb\x36\x44\x39\x43\x2b\xc5\x68\xf0\x2c\xa4\xf9\x96\x6f\x6d\x76\x1c\x16\x98\x32\x9d\x71\xb2\xfb\x55\x48\x01\xb8\xb1\x89\xf9\x0f\xd3\x29\xba\x56\x40\x0c\xa0\xe9\xf4\x30\x0d\x6d\x8b\xa2\x37\x46\x01\x25\x92\xe7\x1b\xf1\x39\x99\x46\x60\x87\x89\x1d\x84\x74\x34\xa5\xc4\x59\xa8\x52\xaa\x57\x22\x43\x96\x4c\x50\x78\x5f\xe0\x1f\x3f\xe5\xe3\x96\xb4\x27\x73\x72\x34\xbe\xec\x7e\x1e\x93\xc9\x5c\x67\x44\xd4\x46\x81\x67\xf8\x44\xa5\x8f\x7f\xa9\x56\x21\x50\xa9\xe2\x6d\x3b\xfa\x16\xff\x0d\x70\x18\x19\x3f\x75\x16\x3a\xe1\xf7\xae\xfb\xe1\x0f\x65\x07\xc0\xef\x95\xce\xc2\xff\x87\x54\xeb\x51\xe1\xbf\x4a\xb5\xee\x84\xde\x3a\xee\x07\xde\x95\x1c\x00\xbb\xd5\x39\x0b\xba\xfd\x41\x1e\x15\xba\xfd\x31\xef\x04\xdd\x3a\xee\x07\xdd\x95\x1c\x00\xba\x7b\x0e\x39\x07\xfa\xbd\xd6\x39\xe8\x51\xb1\x33\x67\xa1\x13\x78\xef\xba\x1f\xfa\x50\x76\x00\xf8\x5e\xe9\xcc\x33\xcf\x39\x7a\x82\x7f\x73\xd0\x66\xe4\xb3\xcf\x79\xac\xbc\x91\x8e\x3d\xc0\x79\xd8\x40\xdf\x56\x68\x38\x18\xa4\x25\x3e\xf4\xce\x6f\x0d\x74\x2d\x37\x1b\x7b\xe1\x19\xbd\x43\xe2\xc4\x3b\xe9\xde\x28\x61\x0b\x03\xb4\x4b\xed\x61\xa8\xae\xa9\x04\xcf\x0a\xe8\x09\x38\x10\x3d\xee\x53\x92\xf2\x1e\x3a\x85\x12\x7c\xf7\xcb\xa3\x2a\x3c\x40\x12\x41\xaa\x63\x06\xe1\xb3\xba\x98\x1c\x30\xa4\x6c\xcb\x28\x28\x7c\xd5\x36\xce\x04\x67\x22\xbc\x3e\xc0\x07\xaf\x19\x0e\xf9\x1f\x83\x4f\x12\xc3\xb6\x27\xb1\x3f\xe5\x85\xc0\xbd\xfe\xcd\xe9\xb5\xe5\xf2\x65\x28\xc1\xca\x5e\x1a\x9d\xa2\xf0\x02\xb1\x9d\x06\xaa\x99\xc2\x3e\xe7\xd6\x23\xec\x8f\x57\xfb\xfe\xca\xd2\x3a\x59\xe6\xc6\x48\xd1\x60\xbc\x52\x00\x02\xf9\xaf\x8f\xda\xa2\x34\x7e\xf3\x80\x9c\x29\xbf\xc2\xd5\x04\x6e\xcf\x70\x2f\xf5\x3c\xa3\xf6\x86\xd4\x5a\x60\x32\x27\xcd\xab\x3e\x50\xe4\x1f\xe8\xa7\xa1\x5a\x50\x47\x94\x18\x32\xcd\x15\x5f\xe0\xa2\x88\x7e\x27\x1a\x1e\x98\x58\x97\xe5\xac\x2a\x32\xb3\xd2\x7a\x56\x5d\x67\xdc\x74\x46\xdd\xec\x3a\xf9\x9b\xb2\x3c\x66\x33\xdc\x24\x9a\x36\x89\x47\x60\xcf\x47\xdd\x02\x45\x61\x60\x93\x71\x7b\x6f\x76\x02\x1f\x16\xc2\xca\x60\x22\xde\x48\x4a\x38\x46\x51\x59\x5e\xfc\x1f\x00\x00\xff\xff\xc7\x60\x64\x7b\xa9\x13\x00\x00"
|
||||
var _repoSettingsWebhookSettingsTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x98\x5f\x4f\xf3\x36\x14\xc6\xaf\xcb\xa7\xf0\x7c\xdf\x74\x9b\xb8\x98\xa6\x16\x69\x02\x26\x90\xd8\x86\x80\x69\x97\x91\x1b\x1f\x1a\xab\xae\x9d\xd9\x4e\xa1\xca\xf2\xdd\x27\xff\x49\x48\x4b\xde\xd2\x34\x79\x95\xab\xa2\xda\x7e\xce\xe3\xdf\xe3\x43\xe3\xcc\x29\xdb\xa2\x84\x13\xad\x17\xf8\x95\x01\xa7\xf8\xea\x62\x32\x4f\x2f\xaf\x8a\x22\x62\x3f\xfd\x22\xa2\x17\x85\xb0\x82\x4c\x46\x1a\x8c\x61\x62\xa5\x23\xd8\x82\x30\x31\x05\x9d\xe0\xb2\x9c\xcf\xd2\x4b\xbb\xa2\x21\xb3\x52\x32\xcf\x80\x22\x37\x0f\x99\x5d\x06\xc8\x29\x6b\x2b\x3d\x69\x2d\xb8\xff\x75\xce\x90\x22\x94\x49\x24\xa4\x98\x3a\x15\x8d\x92\x14\x92\xf5\x52\xbe\xfb\xd9\x93\x39\x13\x59\x6e\xaa\x05\x29\xa3\x14\x04\x46\x82\x6c\x60\x81\xfd\x0a\xec\x2a\x2f\xb0\x53\xc2\x68\x4b\x78\x0e\x0b\x9c\xe5\x3a\x8d\xa5\xe0\x3b\x8c\x8a\x82\xbd\x22\xa9\x50\xf4\x48\x56\x70\xaf\x9f\xc3\xf6\xee\xa4\x5c\xeb\x3f\xe1\x0d\x45\xff\xc0\x32\x95\x72\x1d\x3d\xe6\x3a\xfd\x4b\xf0\x5d\x59\x3a\x13\x40\x8b\x02\x04\x2d\xcb\xe0\x84\x93\x25\xf0\x2f\x71\x35\x0a\xff\x87\x9e\x8d\xfa\xf9\xee\xe5\x8f\x07\x8b\xcf\x2f\x77\x08\x66\x94\x6d\x1d\xa2\xfa\x8f\x51\x59\x69\x10\x34\x86\x2d\xa8\x9d\x49\x99\x58\x05\x62\x35\x96\x67\x10\xf4\xb6\x1e\xed\x05\xe7\x53\xa5\xef\x83\x68\x58\x3c\x49\x2a\xa5\x86\xb8\x9a\xb2\x0f\xe7\xda\x0d\xde\xba\xb1\x5e\x68\x7c\x95\x0e\x44\xc2\xe7\x7e\x4b\x86\x9d\xfb\x36\x44\x39\x43\x2b\xc5\x68\xf0\x2c\xa4\xf9\x96\x6f\x6d\x76\x1c\x16\x98\x32\x9d\x71\xb2\xfb\x55\x48\x01\xb8\xb1\x89\xf9\x0f\xd3\x29\xba\x56\x40\x0c\xa0\xe9\xf4\x30\x0d\x6d\x8b\xa2\x37\x46\x01\x25\x92\xe7\x1b\xf1\x39\x99\x46\x60\x87\x89\x1d\x84\x74\x34\xa5\xc4\x59\xa8\x52\xaa\x57\x22\x43\x96\x4c\x50\x78\x5f\xe0\x1f\x3f\xe5\xe3\x96\xb4\x27\x73\x72\x34\xbe\xec\x7e\x1e\x93\xc9\x5c\x67\x44\xd4\x46\x81\x67\xf8\x44\xa5\x8f\x7f\xa9\x56\x21\x50\xa9\xe2\x6d\x3b\xfa\x16\xff\x0d\x70\x18\x19\x3f\x75\x16\x3a\xe1\xf7\xae\xfb\xe1\x0f\x65\x07\xc0\xef\x95\xce\xc2\xff\xbb\x54\xeb\x51\xe1\xbf\x4a\xb5\xee\x84\xde\x3a\xee\x07\xde\x95\x1c\x00\xbb\xd5\x39\x0b\xba\xfd\x41\x1e\x15\xba\xfd\x31\xef\x04\xdd\x3a\xee\x07\xdd\x95\x1c\x00\xba\x7b\x0e\x39\x07\xfa\xbd\xd6\x39\xe8\x51\xb1\x33\x67\xa1\x13\x78\xef\xba\x1f\xfa\x50\x76\x00\xf8\x5e\xe9\xcc\x33\xcf\x39\x7a\x82\x7f\x73\xd0\x66\xe4\xb3\xcf\x79\xac\xbc\x91\x8e\x3d\xc0\x79\xd8\x40\xdf\x56\x68\x38\x18\xa4\x25\x3e\xf4\xce\x6f\x0d\x74\x2d\x37\x1b\x7b\xe1\x19\xbd\x43\xe2\xc4\x3b\xe9\xde\x28\x61\x0b\x03\xb4\x4b\xed\x61\xa8\xae\xa9\x04\xcf\x0a\xe8\x09\x38\x10\x3d\xee\x53\x92\xf2\x1e\x3a\x85\x12\x7c\xf7\xcb\xa3\x2a\x3c\x40\x12\x41\xaa\x63\x06\xe1\xb3\xba\x98\x1c\x30\xa4\x6c\xcb\x28\x28\x7c\xd5\x36\xce\x04\x67\x22\xbc\x3e\xc0\x07\xaf\x19\x0e\xf9\x1f\x83\x4f\x12\xc3\xb6\x27\xb1\x3f\xe5\x85\xc0\xbd\xfe\xcd\xe9\xb5\xe5\xf2\x65\x28\xc1\xca\x5e\x1a\x9d\xa2\xf0\x02\xb1\x9d\x06\xaa\x99\xc2\x3e\xe7\xd6\x23\xec\x8f\x57\xfb\xfe\xca\xd2\x3a\x59\xe6\xc6\x48\xd1\x60\xbc\x52\x00\x02\xf9\xaf\x8f\xda\xa2\x34\x7e\xf3\x80\x9c\x29\xbf\xc2\xd5\x04\x6e\xcf\x70\x2f\xf5\x3c\xa3\xf6\x86\xd4\x5a\x60\x32\x27\xcd\xab\x3e\x50\xe4\x1f\xe8\xa7\xa1\x5a\x50\x47\x94\x18\x32\xcd\x15\x5f\xe0\xa2\x08\x37\x90\xbf\x9f\x1e\xca\x32\x8c\x30\xea\x06\xea\x90\x6f\xca\xf2\x98\xa3\x70\x69\x68\x3a\x22\x7e\xb7\xf6\x28\xd4\xa7\xbd\x28\x0c\x6c\x32\x6e\xaf\xc8\x4e\x60\x56\x09\xcc\xc2\xca\x59\x10\xda\x48\x4a\x38\x46\x51\x59\x5e\xfc\x1f\x00\x00\xff\xff\x66\xb5\x31\xdc\x94\x13\x00\x00"
|
||||
|
||||
func repoSettingsWebhookSettingsTmplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -2372,12 +2372,12 @@ func repoSettingsWebhookSettingsTmpl() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/settings.tmpl", size: 5033, mode: os.FileMode(0644), modTime: time.Unix(1571173927, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x56, 0x51, 0x47, 0xf3, 0xb5, 0xca, 0xf7, 0x12, 0x55, 0xf1, 0x6b, 0xaa, 0x1d, 0x98, 0x43, 0x11, 0x63, 0x5f, 0xf4, 0x89, 0x3e, 0x5c, 0x19, 0x2c, 0x36, 0x9b, 0x9f, 0x4c, 0x7a, 0x7b, 0x3e, 0xd5}}
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/settings.tmpl", size: 5012, mode: os.FileMode(0644), modTime: time.Unix(1584876630, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x47, 0xca, 0xf8, 0xb1, 0x40, 0xb, 0x78, 0xcc, 0x74, 0x3e, 0x89, 0xde, 0xfa, 0xda, 0x23, 0x76, 0x81, 0xda, 0xb1, 0x3f, 0xef, 0xec, 0x3d, 0x98, 0xa7, 0xd0, 0xa8, 0x16, 0xea, 0x3d, 0x8d, 0x45}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _repoSettingsWebhookSlackTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x94\xcb\x6e\xdb\x3c\x10\x85\xd7\xd2\x53\x10\xfc\xb7\x01\x85\xbf\xed\xa2\x2d\x24\x2f\x9a\x5e\x12\x20\x2d\x82\xd8\x41\x97\x06\x2d\x8e\x65\xc2\x14\xc9\x90\x94\x5d\x83\xe5\xbb\x17\xd4\xcd\x4d\x62\xc5\xe9\xce\x23\x1e\x0f\xcf\x37\x3a\x1a\xef\xf9\x1a\xc1\x03\x22\x57\x4a\x6d\x17\x07\x0d\x08\x5b\x41\xcb\x2d\x0e\x21\x4d\x72\x3d\xf3\x9e\xf0\xff\xdf\x4b\xb2\x30\x08\x1b\xd0\x8a\x58\x70\x8e\xcb\xca\x12\xca\xd8\xb2\x95\x2e\x37\x4a\x6d\x97\x0c\x6c\x89\x11\xde\x38\xa7\xed\xc7\x2c\x6b\x4f\x48\xa9\x6a\x8c\x7e\xa3\xb9\x33\x6f\xae\x16\xdf\x6f\x42\xc8\x33\x3d\x4b\x93\x7c\xad\x4c\x8d\x4a\x41\xad\x2d\x70\xc3\x51\x2c\x31\xa2\xa5\xe3\x4a\x16\xd8\x7b\xf2\x89\x5a\xb8\xe1\x72\x1b\x42\x36\xdc\x97\xc5\x5b\x6c\xd7\x37\x6b\x5d\x93\x5b\x5a\xc1\xb5\x9d\xf7\x82\x08\x60\x7f\xc0\x3e\x04\x09\x7b\xef\x41\x58\x08\xc1\x7b\xf2\x13\x56\xf1\xaf\xe4\xfa\x73\x2c\x41\xb2\x10\x30\xaa\xc1\x6d\x14\x2b\xb0\x56\xd6\xe1\x59\x9a\x24\xde\x93\xcb\xf9\xdd\xd7\x85\xda\x82\xec\xac\xa6\x49\x92\x33\xbe\x1b\x6c\x1a\x78\x68\xb8\x01\x86\xd6\x1c\x04\x43\x9d\x83\x2f\xc6\x2c\x6f\xe9\x41\x28\xca\xee\xef\x6e\x42\x00\x63\x94\x19\x2e\x89\x6d\x93\x5c\xd0\x15\x88\x48\x58\x60\xdd\x29\x97\x8d\x11\xf8\x85\xc1\xfe\x2d\x8b\x13\x6b\x3b\x74\xcd\xb8\xd4\x8d\x43\x9c\x3d\xee\x85\x24\xad\xe1\xc9\x23\x77\xd0\x50\xe0\xf6\xe7\x8e\x8a\x06\xda\xb1\x0e\xa3\x68\xbd\x62\x44\x1b\xa7\xd6\xaa\x6c\x2c\x1a\xe0\xe2\x2d\x79\xc6\xf8\x6e\xf6\x5a\xfa\xcb\x0d\x95\x12\xc4\x39\xf4\xb2\x93\xbd\x84\xdd\x65\x69\x10\x4e\x82\x0f\x82\x1e\x7a\x2c\x8f\x94\xf3\xd8\x28\xa6\x81\x8c\xe6\x30\xd2\x82\x96\xb0\x51\x82\x81\x29\x30\x90\x8a\xa0\xff\x2a\x90\x60\xa8\xc0\xa7\xe8\x9f\xe0\xb7\xd4\xcf\xa9\x1a\x0b\x26\xda\x38\x8f\x35\x2a\x27\xb9\x46\x45\x0f\x76\xac\x4f\x91\xdd\xf7\xa7\xa7\xd1\xbe\xa9\xca\xe2\xc9\x77\x39\x01\xc3\x4b\x25\xcf\x45\xb3\x83\x19\x95\x93\x30\xa3\xa2\x87\x39\xd6\xa7\x60\xae\x4b\x25\xfb\x48\x3e\x67\x19\x16\x0a\xfc\xa2\xb5\x16\x10\x57\x4a\xc6\xeb\x2a\x5b\xd3\x5d\xec\x4a\xb4\xac\xfe\x19\xb5\x54\x42\x99\x57\x64\xb1\x95\x4d\x27\xb1\x3d\x1e\x72\xd8\x15\x27\x53\x18\x8f\x26\x32\xc8\xd8\xbb\xd5\xdb\x0f\x17\xa8\x52\x8a\x5d\xa0\x3d\x35\x92\xcb\xea\x02\x31\x2a\x2b\x30\x8f\xb9\xbc\x77\x50\x6b\x41\x1d\x74\x6e\x8f\x9b\x71\xdf\x7d\xd6\xe3\x03\x8c\x48\xbb\xbd\xb3\xb8\x57\x67\x69\xff\x51\xa6\x7f\x02\x00\x00\xff\xff\x60\x86\xa1\x25\xeb\x05\x00\x00"
|
||||
var _repoSettingsWebhookSlackTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x94\x4f\x4f\xdc\x3c\x10\xc6\xcf\xd9\x4f\x61\xf9\x7d\x8f\xc8\x51\xd5\x1e\xda\x2a\xd9\x0b\x2a\x05\x09\x2a\xc4\x2e\xea\x71\x65\xe2\x49\xd6\x5a\xc7\x63\x6c\x67\x29\x4a\xf3\xdd\x2b\x3b\x7f\x28\xb0\x61\xe9\x29\x19\xfb\xd1\xf8\xf9\x39\x4f\xa6\x6d\x65\x49\xe0\x9e\xb0\x73\xc4\xdd\xfa\xd1\x00\xa1\x4e\xf1\x62\x47\xbb\x6e\x91\x64\x66\xd9\xb6\x4c\x7e\xf8\xac\xd9\xda\x12\x6a\xc1\x20\x73\xe0\xbd\xd4\x95\x63\x5c\x88\x4d\x94\x6e\xb6\x88\xbb\x8d\x00\x57\x50\x42\xb7\xde\x1b\xf7\x35\x4d\xe3\x0e\x2b\xb0\xa6\xe4\x37\x59\xf1\x12\xba\x2e\x4b\xcd\x72\x91\x64\x25\xda\x9a\x14\x8a\x3b\x97\xd3\x46\x92\x50\x52\xc2\x0b\x2f\x51\xe7\x34\xda\x61\xd7\xbc\x82\x0b\xb7\x1a\x4e\x0a\xce\xdc\x0f\x78\xe8\xba\xb6\xfd\x9f\x5d\x4a\xbd\x0b\x6f\xa0\x1c\x84\x27\x3b\x43\x5b\xdf\xde\x5c\xc6\x35\x2d\xba\x8e\x92\x1a\xfc\x16\x45\x4e\x0d\x3a\x4f\x97\x8b\x24\x69\x5b\x76\xba\xba\x39\x5b\xe3\x0e\xf4\xf9\xfa\xea\x32\xb0\x25\x99\x90\xfb\xd1\x87\x85\xfb\x46\x5a\x10\xa4\x94\xa0\x04\xe9\x5d\x7c\xb3\x76\x73\xcd\x1f\x15\x72\x11\xfb\x83\xb5\x68\xc7\x43\x42\xdb\x24\x53\xfc\x0e\x54\x40\xc8\xa9\xe9\x95\x9b\xc6\x2a\xfa\xc6\xad\xfd\x2d\x0b\x57\x12\x3b\xf4\xcd\xa4\x36\x8d\x27\x52\x3c\xef\x45\x34\xaf\xe1\xc5\x92\x7f\x34\x90\xd3\xf8\xba\xe7\xaa\x81\x70\x6f\xec\x27\xdc\x85\x0f\xc1\xa2\x57\x4a\x78\xe3\xb1\xc4\xa2\x71\x64\x84\x0b\xa7\x64\xa9\x90\xfb\xe5\x7b\xe9\x4f\xb7\x5c\x6b\x50\xc7\xd0\x8b\x5e\xf6\x16\x76\x1f\x94\x51\x38\x0b\x3e\x0a\x06\xe8\xa9\x7c\xa2\x5c\x85\x46\x57\xe0\x39\x9b\xcc\x51\x62\x14\x2f\x60\x8b\x4a\x80\xcd\x29\xb0\x8a\x91\xff\x2a\xd0\x60\xb9\xa2\x87\xe8\x5f\xe0\x47\xea\xd7\x54\x8d\x03\x1b\x6c\x1c\xc7\x9a\x94\xb3\x5c\x93\x62\x00\x7b\xaa\x0f\x91\xdd\x0e\xbb\x87\xd1\xbe\x63\xe5\xe8\xec\xb7\x9c\x81\x91\x05\xea\x63\xd1\xec\x61\x26\xe5\x2c\xcc\xa4\x18\x60\x9e\xea\x43\x30\x17\x05\xea\x21\x92\xaf\x59\xc6\x69\x01\xbf\x78\x6d\x14\x84\x79\x91\xca\xba\x4a\x4b\xbe\x0f\x5d\x99\xd1\xd5\x3f\xa3\x16\xa8\xd0\xbe\x23\x8b\x51\x36\x9f\xc4\xb8\x3d\xe6\xb0\x2f\x0e\xa6\x30\x6c\xcd\x64\x50\x88\x4f\x77\x1f\xbf\x9c\x90\x0a\x51\x9c\x90\x07\x6e\xb5\xd4\xd5\x09\x11\x5c\x57\x60\x9f\x73\xb5\xad\x87\xda\x28\xee\xa1\x77\x9b\x8e\x6e\xd3\x87\xfe\xb7\x9e\x16\x28\x61\x71\x34\xa7\x61\x70\x2e\x17\xc3\x4f\xb9\xf8\x13\x00\x00\xff\xff\x7a\x06\x06\x34\xc8\x05\x00\x00"
|
||||
|
||||
func repoSettingsWebhookSlackTmplBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -2392,8 +2392,8 @@ func repoSettingsWebhookSlackTmpl() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/slack.tmpl", size: 1515, mode: os.FileMode(0644), modTime: time.Unix(1571173927, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc4, 0x75, 0x17, 0x60, 0x6c, 0x13, 0x5b, 0x58, 0x67, 0x95, 0xf8, 0xad, 0x23, 0x90, 0x83, 0x18, 0x11, 0xb9, 0x3d, 0xf8, 0x6e, 0x55, 0x29, 0x5c, 0x25, 0x11, 0xc5, 0xa9, 0x77, 0x5c, 0xc2, 0x4e}}
|
||||
info := bindataFileInfo{name: "repo/settings/webhook/slack.tmpl", size: 1480, mode: os.FileMode(0644), modTime: time.Unix(1584877665, 0)}
|
||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd0, 0x90, 0xae, 0xea, 0xe4, 0x8, 0x4, 0xfe, 0x98, 0xe6, 0xa3, 0x79, 0x5e, 0x79, 0x21, 0xdb, 0x16, 0xc8, 0xcd, 0x46, 0x18, 0x7a, 0xb2, 0xea, 0x2e, 0xd2, 0xa5, 0xe1, 0xf5, 0x99, 0xab, 0xf9}}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -356,6 +356,23 @@ func runWeb(c *cli.Context) error {
|
|||
reqRepoAdmin := context.RequireRepoAdmin()
|
||||
reqRepoWriter := context.RequireRepoWriter()
|
||||
|
||||
webhookRoutes := func() {
|
||||
m.Group("", func() {
|
||||
m.Get("", repo.Webhooks)
|
||||
m.Post("/delete", repo.DeleteWebhook)
|
||||
m.Get("/:type/new", repo.WebhooksNew)
|
||||
m.Post("/gogs/new", bindIgnErr(form.NewWebhook{}), repo.WebhooksNewPost)
|
||||
m.Post("/slack/new", bindIgnErr(form.NewSlackHook{}), repo.WebhooksSlackNewPost)
|
||||
m.Post("/discord/new", bindIgnErr(form.NewDiscordHook{}), repo.WebhooksDiscordNewPost)
|
||||
m.Post("/dingtalk/new", bindIgnErr(form.NewDingtalkHook{}), repo.WebhooksDingtalkNewPost)
|
||||
m.Get("/:id", repo.WebhooksEdit)
|
||||
m.Post("/gogs/:id", bindIgnErr(form.NewWebhook{}), repo.WebhooksEditPost)
|
||||
m.Post("/slack/:id", bindIgnErr(form.NewSlackHook{}), repo.WebhooksSlackEditPost)
|
||||
m.Post("/discord/:id", bindIgnErr(form.NewDiscordHook{}), repo.WebhooksDiscordEditPost)
|
||||
m.Post("/dingtalk/:id", bindIgnErr(form.NewDingtalkHook{}), repo.WebhooksDingtalkEditPost)
|
||||
}, repo.InjectOrgRepoContext())
|
||||
}
|
||||
|
||||
// ***** START: Organization *****
|
||||
m.Group("/org", func() {
|
||||
m.Group("", func() {
|
||||
|
@ -396,20 +413,7 @@ func runWeb(c *cli.Context) error {
|
|||
m.Post("/avatar", binding.MultipartForm(form.Avatar{}), org.SettingsAvatar)
|
||||
m.Post("/avatar/delete", org.SettingsDeleteAvatar)
|
||||
|
||||
m.Group("/hooks", func() {
|
||||
m.Get("", org.Webhooks)
|
||||
m.Post("/delete", org.DeleteWebhook)
|
||||
m.Get("/:type/new", repo.WebhooksNew)
|
||||
m.Post("/gogs/new", bindIgnErr(form.NewWebhook{}), repo.WebHooksNewPost)
|
||||
m.Post("/slack/new", bindIgnErr(form.NewSlackHook{}), repo.SlackHooksNewPost)
|
||||
m.Post("/discord/new", bindIgnErr(form.NewDiscordHook{}), repo.DiscordHooksNewPost)
|
||||
m.Post("/dingtalk/new", bindIgnErr(form.NewDingtalkHook{}), repo.DingtalkHooksNewPost)
|
||||
m.Get("/:id", repo.WebHooksEdit)
|
||||
m.Post("/gogs/:id", bindIgnErr(form.NewWebhook{}), repo.WebHooksEditPost)
|
||||
m.Post("/slack/:id", bindIgnErr(form.NewSlackHook{}), repo.SlackHooksEditPost)
|
||||
m.Post("/discord/:id", bindIgnErr(form.NewDiscordHook{}), repo.DiscordHooksEditPost)
|
||||
m.Post("/dingtalk/:id", bindIgnErr(form.NewDingtalkHook{}), repo.DingtalkHooksEditPost)
|
||||
})
|
||||
m.Group("/hooks", webhookRoutes)
|
||||
|
||||
m.Route("/delete", "GET,POST", org.SettingsDelete)
|
||||
})
|
||||
|
@ -454,20 +458,9 @@ func runWeb(c *cli.Context) error {
|
|||
})
|
||||
|
||||
m.Group("/hooks", func() {
|
||||
m.Get("", repo.Webhooks)
|
||||
m.Post("/delete", repo.DeleteWebhook)
|
||||
m.Get("/:type/new", repo.WebhooksNew)
|
||||
m.Post("/gogs/new", bindIgnErr(form.NewWebhook{}), repo.WebHooksNewPost)
|
||||
m.Post("/slack/new", bindIgnErr(form.NewSlackHook{}), repo.SlackHooksNewPost)
|
||||
m.Post("/discord/new", bindIgnErr(form.NewDiscordHook{}), repo.DiscordHooksNewPost)
|
||||
m.Post("/dingtalk/new", bindIgnErr(form.NewDingtalkHook{}), repo.DingtalkHooksNewPost)
|
||||
m.Post("/gogs/:id", bindIgnErr(form.NewWebhook{}), repo.WebHooksEditPost)
|
||||
m.Post("/slack/:id", bindIgnErr(form.NewSlackHook{}), repo.SlackHooksEditPost)
|
||||
m.Post("/discord/:id", bindIgnErr(form.NewDiscordHook{}), repo.DiscordHooksEditPost)
|
||||
m.Post("/dingtalk/:id", bindIgnErr(form.NewDingtalkHook{}), repo.DingtalkHooksEditPost)
|
||||
webhookRoutes()
|
||||
|
||||
m.Group("/:id", func() {
|
||||
m.Get("", repo.WebHooksEdit)
|
||||
m.Post("/test", repo.TestWebhook)
|
||||
m.Post("/redelivery", repo.RedeliveryWebhook)
|
||||
})
|
||||
|
|
|
@ -60,7 +60,7 @@ var File *ini.File
|
|||
//
|
||||
// NOTE: The order of loading configuration sections matters as one may depend on another.
|
||||
//
|
||||
// ⚠️ WARNING: Do not print anything in this function other than wanrings.
|
||||
// ⚠️ WARNING: Do not print anything in this function other than warnings.
|
||||
func Init(customConf string) error {
|
||||
var err error
|
||||
File, err = ini.LoadSources(ini.LoadOptions{
|
||||
|
|
|
@ -136,10 +136,10 @@ func (w *Webhook) AfterSet(colName string, _ xorm.Cell) {
|
|||
}
|
||||
}
|
||||
|
||||
func (w *Webhook) GetSlackHook() *SlackMeta {
|
||||
func (w *Webhook) SlackMeta() *SlackMeta {
|
||||
s := &SlackMeta{}
|
||||
if err := jsoniter.Unmarshal([]byte(w.Meta), s); err != nil {
|
||||
log.Error("GetSlackHook [%d]: %v", w.ID, err)
|
||||
log.Error("Failed to get Slack meta [webhook_id: %d]: %v", w.ID, err)
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright 2020 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package mock
|
||||
|
||||
import (
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
var _ macaron.Locale = (*Locale)(nil)
|
||||
|
||||
// Locale is a mock that implements macaron.Locale.
|
||||
type Locale struct {
|
||||
lang string
|
||||
tr func(string, ...interface{}) string
|
||||
}
|
||||
|
||||
// NewLocale creates a new mock for macaron.Locale.
|
||||
func NewLocale(lang string, tr func(string, ...interface{}) string) *Locale {
|
||||
return &Locale{
|
||||
lang: lang,
|
||||
tr: tr,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *Locale) Language() string {
|
||||
return l.lang
|
||||
}
|
||||
|
||||
func (l *Locale) Tr(format string, args ...interface{}) string {
|
||||
return l.tr(format, args...)
|
||||
}
|
|
@ -75,7 +75,7 @@ func ToHook(repoLink string, w *db.Webhook) *api.Hook {
|
|||
"content_type": w.ContentType.Name(),
|
||||
}
|
||||
if w.HookTaskType == db.SLACK {
|
||||
s := w.GetSlackHook()
|
||||
s := w.SlackMeta()
|
||||
config["channel"] = s.Channel
|
||||
config["username"] = s.Username
|
||||
config["icon_url"] = s.IconURL
|
||||
|
|
|
@ -17,9 +17,8 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
SETTINGS_OPTIONS = "org/settings/options"
|
||||
SETTINGS_DELETE = "org/settings/delete"
|
||||
SETTINGS_WEBHOOKS = "org/settings/webhooks"
|
||||
SETTINGS_OPTIONS = "org/settings/options"
|
||||
SETTINGS_DELETE = "org/settings/delete"
|
||||
)
|
||||
|
||||
func Settings(c *context.Context) {
|
||||
|
@ -136,32 +135,3 @@ func SettingsDelete(c *context.Context) {
|
|||
|
||||
c.Success(SETTINGS_DELETE)
|
||||
}
|
||||
|
||||
func Webhooks(c *context.Context) {
|
||||
c.Title("org.settings")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["BaseLink"] = c.Org.OrgLink
|
||||
c.Data["Description"] = c.Tr("org.settings.hooks_desc")
|
||||
c.Data["Types"] = conf.Webhook.Types
|
||||
|
||||
ws, err := db.GetWebhooksByOrgID(c.Org.Organization.ID)
|
||||
if err != nil {
|
||||
c.Error(err, "get webhooks by organization ID")
|
||||
return
|
||||
}
|
||||
|
||||
c.Data["Webhooks"] = ws
|
||||
c.Success(SETTINGS_WEBHOOKS)
|
||||
}
|
||||
|
||||
func DeleteWebhook(c *context.Context) {
|
||||
if err := db.DeleteWebhookOfOrgByID(c.Org.Organization.ID, c.QueryInt64("id")); err != nil {
|
||||
c.Flash.Error("DeleteWebhookByOrgID: " + err.Error())
|
||||
} else {
|
||||
c.Flash.Success(c.Tr("repo.settings.webhook_deletion_success"))
|
||||
}
|
||||
|
||||
c.JSONSuccess( map[string]interface{}{
|
||||
"redirect": c.Org.OrgLink + "/settings/hooks",
|
||||
})
|
||||
}
|
||||
|
|
|
@ -7,13 +7,13 @@ package repo
|
|||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/unknwon/com"
|
||||
|
||||
git "github.com/gogs/git-module"
|
||||
"github.com/gogs/git-module"
|
||||
api "github.com/gogs/go-gogs-client"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"gopkg.in/macaron.v1"
|
||||
|
||||
"gogs.io/gogs/internal/conf"
|
||||
"gogs.io/gogs/internal/context"
|
||||
|
@ -23,89 +23,163 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
WEBHOOKS = "repo/settings/webhook/base"
|
||||
WEBHOOK_NEW = "repo/settings/webhook/new"
|
||||
ORG_WEBHOOK_NEW = "org/settings/webhook_new"
|
||||
tmplRepoSettingsWebhooks = "repo/settings/webhook/base"
|
||||
tmplRepoSettingsWebhookNew = "repo/settings/webhook/new"
|
||||
tmplOrgSettingsWebhooks = "org/settings/webhooks"
|
||||
tmplOrgSettingsWebhookNew = "org/settings/webhook_new"
|
||||
)
|
||||
|
||||
func Webhooks(c *context.Context) {
|
||||
c.Data["Title"] = c.Tr("repo.settings.hooks")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["BaseLink"] = c.Repo.RepoLink
|
||||
c.Data["Description"] = c.Tr("repo.settings.hooks_desc", "https://github.com/gogs/docs-api/blob/master/Repositories/Webhooks.md")
|
||||
c.Data["Types"] = conf.Webhook.Types
|
||||
|
||||
ws, err := db.GetWebhooksByRepoID(c.Repo.Repository.ID)
|
||||
if err != nil {
|
||||
c.Error(err, "get webhooks by repository ID")
|
||||
return
|
||||
func InjectOrgRepoContext() macaron.Handler {
|
||||
return func(c *context.Context) {
|
||||
orCtx, err := getOrgRepoContext(c)
|
||||
if err != nil {
|
||||
c.Error(err, "get organization or repository context")
|
||||
return
|
||||
}
|
||||
c.Map(orCtx)
|
||||
}
|
||||
c.Data["Webhooks"] = ws
|
||||
|
||||
c.Success(WEBHOOKS)
|
||||
}
|
||||
|
||||
type OrgRepoCtx struct {
|
||||
OrgID int64
|
||||
RepoID int64
|
||||
Link string
|
||||
NewTemplate string
|
||||
type orgRepoContext struct {
|
||||
OrgID int64
|
||||
RepoID int64
|
||||
Link string
|
||||
TmplList string
|
||||
TmplNew string
|
||||
}
|
||||
|
||||
// getOrgRepoCtx determines whether this is a repo context or organization context.
|
||||
func getOrgRepoCtx(c *context.Context) (*OrgRepoCtx, error) {
|
||||
// getOrgRepoContext determines whether this is a repo context or organization context.
|
||||
func getOrgRepoContext(c *context.Context) (*orgRepoContext, error) {
|
||||
if len(c.Repo.RepoLink) > 0 {
|
||||
c.Data["PageIsRepositoryContext"] = true
|
||||
return &OrgRepoCtx{
|
||||
RepoID: c.Repo.Repository.ID,
|
||||
Link: c.Repo.RepoLink,
|
||||
NewTemplate: WEBHOOK_NEW,
|
||||
c.PageIs("RepositoryContext")
|
||||
return &orgRepoContext{
|
||||
RepoID: c.Repo.Repository.ID,
|
||||
Link: c.Repo.RepoLink,
|
||||
TmplList: tmplRepoSettingsWebhooks,
|
||||
TmplNew: tmplRepoSettingsWebhookNew,
|
||||
}, nil
|
||||
}
|
||||
|
||||
if len(c.Org.OrgLink) > 0 {
|
||||
c.Data["PageIsOrganizationContext"] = true
|
||||
return &OrgRepoCtx{
|
||||
OrgID: c.Org.Organization.ID,
|
||||
Link: c.Org.OrgLink,
|
||||
NewTemplate: ORG_WEBHOOK_NEW,
|
||||
c.PageIs("OrganizationContext")
|
||||
return &orgRepoContext{
|
||||
OrgID: c.Org.Organization.ID,
|
||||
Link: c.Org.OrgLink,
|
||||
TmplList: tmplOrgSettingsWebhooks,
|
||||
TmplNew: tmplOrgSettingsWebhookNew,
|
||||
}, nil
|
||||
}
|
||||
|
||||
return nil, errors.New("Unable to set OrgRepo context")
|
||||
return nil, errors.New("unable to determine context")
|
||||
}
|
||||
|
||||
func checkHookType(c *context.Context) string {
|
||||
hookType := strings.ToLower(c.Params(":type"))
|
||||
if !com.IsSliceContainsStr(conf.Webhook.Types, hookType) {
|
||||
c.NotFound()
|
||||
return ""
|
||||
func Webhooks(c *context.Context, orCtx *orgRepoContext) {
|
||||
c.Title("repo.settings.hooks")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.Data["Types"] = conf.Webhook.Types
|
||||
|
||||
var err error
|
||||
var ws []*db.Webhook
|
||||
if orCtx.RepoID > 0 {
|
||||
c.Data["Description"] = c.Tr("repo.settings.hooks_desc")
|
||||
ws, err = db.GetWebhooksByRepoID(orCtx.RepoID)
|
||||
} else {
|
||||
c.Data["Description"] = c.Tr("org.settings.hooks_desc")
|
||||
ws, err = db.GetWebhooksByOrgID(orCtx.OrgID)
|
||||
}
|
||||
return hookType
|
||||
}
|
||||
|
||||
func WebhooksNew(c *context.Context) {
|
||||
c.Data["Title"] = c.Tr("repo.settings.add_webhook")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["PageIsSettingsHooksNew"] = true
|
||||
c.Data["Webhook"] = db.Webhook{HookEvent: &db.HookEvent{}}
|
||||
|
||||
orCtx, err := getOrgRepoCtx(c)
|
||||
if err != nil {
|
||||
c.Error(err, "get organization repository context")
|
||||
c.Error(err, "get webhooks")
|
||||
return
|
||||
}
|
||||
c.Data["Webhooks"] = ws
|
||||
|
||||
c.Data["HookType"] = checkHookType(c)
|
||||
if c.Written() {
|
||||
return
|
||||
}
|
||||
c.Data["BaseLink"] = orCtx.Link
|
||||
|
||||
c.Success(orCtx.NewTemplate)
|
||||
c.Success(orCtx.TmplList)
|
||||
}
|
||||
|
||||
func ParseHookEvent(f form.Webhook) *db.HookEvent {
|
||||
func WebhooksNew(c *context.Context, orCtx *orgRepoContext) {
|
||||
c.Title("repo.settings.add_webhook")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.PageIs("SettingsHooksNew")
|
||||
|
||||
allowed := false
|
||||
hookType := strings.ToLower(c.Params(":type"))
|
||||
for _, typ := range conf.Webhook.Types {
|
||||
if hookType == typ {
|
||||
allowed = true
|
||||
c.Data["HookType"] = typ
|
||||
break
|
||||
}
|
||||
}
|
||||
if !allowed {
|
||||
c.NotFound()
|
||||
return
|
||||
}
|
||||
|
||||
c.Success(orCtx.TmplNew)
|
||||
}
|
||||
|
||||
var localHostnames = []string{
|
||||
"localhost",
|
||||
"127.0.0.1",
|
||||
"::1",
|
||||
"0:0:0:0:0:0:0:1",
|
||||
}
|
||||
|
||||
// isLocalHostname returns true if given hostname is a known local address.
|
||||
func isLocalHostname(hostname string) bool {
|
||||
for _, local := range localHostnames {
|
||||
if hostname == local {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func validateWebhook(actor *db.User, l macaron.Locale, w *db.Webhook) (field string, msg string, ok bool) {
|
||||
if !actor.IsAdmin {
|
||||
// 🚨 SECURITY: Local addresses must not be allowed by non-admins to prevent SSRF,
|
||||
// see https://github.com/gogs/gogs/issues/5366 for details.
|
||||
payloadURL, err := url.Parse(w.URL)
|
||||
if err != nil {
|
||||
return "PayloadURL", l.Tr("repo.settings.webhook.err_cannot_parse_payload_url", err), false
|
||||
}
|
||||
|
||||
if isLocalHostname(payloadURL.Hostname()) {
|
||||
return "PayloadURL", l.Tr("repo.settings.webhook.err_cannot_use_local_addresses"), false
|
||||
}
|
||||
}
|
||||
|
||||
return "", "", true
|
||||
}
|
||||
|
||||
func validateAndCreateWebhook(c *context.Context, orCtx *orgRepoContext, w *db.Webhook) {
|
||||
c.Data["Webhook"] = w
|
||||
|
||||
if c.HasError() {
|
||||
c.Success(orCtx.TmplNew)
|
||||
return
|
||||
}
|
||||
|
||||
field, msg, ok := validateWebhook(c.User, c.Locale, w)
|
||||
if !ok {
|
||||
c.FormErr(field)
|
||||
c.RenderWithErr(msg, orCtx.TmplNew, nil)
|
||||
return
|
||||
}
|
||||
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
c.Error(err, "update event")
|
||||
return
|
||||
} else if err := db.CreateWebhook(w); err != nil {
|
||||
c.Error(err, "create webhook")
|
||||
return
|
||||
}
|
||||
|
||||
c.Flash.Success(c.Tr("repo.settings.add_hook_success"))
|
||||
c.Redirect(orCtx.Link + "/settings/hooks")
|
||||
}
|
||||
|
||||
func toHookEvent(f form.Webhook) *db.HookEvent {
|
||||
return &db.HookEvent{
|
||||
PushOnly: f.PushOnly(),
|
||||
SendEverything: f.SendEverything(),
|
||||
|
@ -123,25 +197,12 @@ func ParseHookEvent(f form.Webhook) *db.HookEvent {
|
|||
}
|
||||
}
|
||||
|
||||
func WebHooksNewPost(c *context.Context, f form.NewWebhook) {
|
||||
c.Data["Title"] = c.Tr("repo.settings.add_webhook")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["PageIsSettingsHooksNew"] = true
|
||||
c.Data["Webhook"] = db.Webhook{HookEvent: &db.HookEvent{}}
|
||||
func WebhooksNewPost(c *context.Context, orCtx *orgRepoContext, f form.NewWebhook) {
|
||||
c.Title("repo.settings.add_webhook")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.PageIs("SettingsHooksNew")
|
||||
c.Data["HookType"] = "gogs"
|
||||
|
||||
orCtx, err := getOrgRepoCtx(c)
|
||||
if err != nil {
|
||||
c.Error(err, "get organization repository context")
|
||||
return
|
||||
}
|
||||
c.Data["BaseLink"] = orCtx.Link
|
||||
|
||||
if c.HasError() {
|
||||
c.Success(orCtx.NewTemplate)
|
||||
return
|
||||
}
|
||||
|
||||
contentType := db.JSON
|
||||
if db.HookContentType(f.ContentType) == db.FORM {
|
||||
contentType = db.FORM
|
||||
|
@ -149,49 +210,32 @@ func WebHooksNewPost(c *context.Context, f form.NewWebhook) {
|
|||
|
||||
w := &db.Webhook{
|
||||
RepoID: orCtx.RepoID,
|
||||
OrgID: orCtx.OrgID,
|
||||
URL: f.PayloadURL,
|
||||
ContentType: contentType,
|
||||
Secret: f.Secret,
|
||||
HookEvent: ParseHookEvent(f.Webhook),
|
||||
HookEvent: toHookEvent(f.Webhook),
|
||||
IsActive: f.Active,
|
||||
HookTaskType: db.GOGS,
|
||||
OrgID: orCtx.OrgID,
|
||||
}
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
c.Error(err, "update event")
|
||||
return
|
||||
} else if err := db.CreateWebhook(w); err != nil {
|
||||
c.Error(err, "create webhook")
|
||||
return
|
||||
}
|
||||
|
||||
c.Flash.Success(c.Tr("repo.settings.add_hook_success"))
|
||||
c.Redirect(orCtx.Link + "/settings/hooks")
|
||||
validateAndCreateWebhook(c, orCtx, w)
|
||||
}
|
||||
|
||||
func SlackHooksNewPost(c *context.Context, f form.NewSlackHook) {
|
||||
c.Data["Title"] = c.Tr("repo.settings")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["PageIsSettingsHooksNew"] = true
|
||||
c.Data["Webhook"] = db.Webhook{HookEvent: &db.HookEvent{}}
|
||||
func WebhooksSlackNewPost(c *context.Context, orCtx *orgRepoContext, f form.NewSlackHook) {
|
||||
c.Title("repo.settings.add_webhook")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.PageIs("SettingsHooksNew")
|
||||
c.Data["HookType"] = "slack"
|
||||
|
||||
orCtx, err := getOrgRepoCtx(c)
|
||||
if err != nil {
|
||||
c.Error(err, "get organization repository context")
|
||||
return
|
||||
}
|
||||
|
||||
if c.HasError() {
|
||||
c.Success(orCtx.NewTemplate)
|
||||
return
|
||||
}
|
||||
|
||||
meta, err := jsoniter.Marshal(&db.SlackMeta{
|
||||
meta := &db.SlackMeta{
|
||||
Channel: f.Channel,
|
||||
Username: f.Username,
|
||||
IconURL: f.IconURL,
|
||||
Color: f.Color,
|
||||
})
|
||||
}
|
||||
c.Data["SlackMeta"] = meta
|
||||
|
||||
p, err := jsoniter.Marshal(meta)
|
||||
if err != nil {
|
||||
c.Error(err, "marshal JSON")
|
||||
return
|
||||
|
@ -201,47 +245,29 @@ func SlackHooksNewPost(c *context.Context, f form.NewSlackHook) {
|
|||
RepoID: orCtx.RepoID,
|
||||
URL: f.PayloadURL,
|
||||
ContentType: db.JSON,
|
||||
HookEvent: ParseHookEvent(f.Webhook),
|
||||
HookEvent: toHookEvent(f.Webhook),
|
||||
IsActive: f.Active,
|
||||
HookTaskType: db.SLACK,
|
||||
Meta: string(meta),
|
||||
Meta: string(p),
|
||||
OrgID: orCtx.OrgID,
|
||||
}
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
c.Error(err, "update event")
|
||||
return
|
||||
} else if err := db.CreateWebhook(w); err != nil {
|
||||
c.Error(err, "create webhook")
|
||||
return
|
||||
}
|
||||
|
||||
c.Flash.Success(c.Tr("repo.settings.add_hook_success"))
|
||||
c.Redirect(orCtx.Link + "/settings/hooks")
|
||||
validateAndCreateWebhook(c, orCtx, w)
|
||||
}
|
||||
|
||||
// FIXME: merge logic to Slack
|
||||
func DiscordHooksNewPost(c *context.Context, f form.NewDiscordHook) {
|
||||
c.Data["Title"] = c.Tr("repo.settings")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["PageIsSettingsHooksNew"] = true
|
||||
c.Data["Webhook"] = db.Webhook{HookEvent: &db.HookEvent{}}
|
||||
func WebhooksDiscordNewPost(c *context.Context, orCtx *orgRepoContext, f form.NewDiscordHook) {
|
||||
c.Title("repo.settings.add_webhook")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.PageIs("SettingsHooksNew")
|
||||
c.Data["HookType"] = "discord"
|
||||
|
||||
orCtx, err := getOrgRepoCtx(c)
|
||||
if err != nil {
|
||||
c.Error(err, "get organization repository context")
|
||||
return
|
||||
}
|
||||
|
||||
if c.HasError() {
|
||||
c.Success(orCtx.NewTemplate)
|
||||
return
|
||||
}
|
||||
|
||||
meta, err := jsoniter.Marshal(&db.SlackMeta{
|
||||
meta := &db.SlackMeta{
|
||||
Username: f.Username,
|
||||
IconURL: f.IconURL,
|
||||
Color: f.Color,
|
||||
})
|
||||
}
|
||||
c.Data["SlackMeta"] = meta
|
||||
|
||||
p, err := jsoniter.Marshal(meta)
|
||||
if err != nil {
|
||||
c.Error(err, "marshal JSON")
|
||||
return
|
||||
|
@ -251,72 +277,37 @@ func DiscordHooksNewPost(c *context.Context, f form.NewDiscordHook) {
|
|||
RepoID: orCtx.RepoID,
|
||||
URL: f.PayloadURL,
|
||||
ContentType: db.JSON,
|
||||
HookEvent: ParseHookEvent(f.Webhook),
|
||||
HookEvent: toHookEvent(f.Webhook),
|
||||
IsActive: f.Active,
|
||||
HookTaskType: db.DISCORD,
|
||||
Meta: string(meta),
|
||||
Meta: string(p),
|
||||
OrgID: orCtx.OrgID,
|
||||
}
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
c.Error(err, "update event")
|
||||
return
|
||||
} else if err := db.CreateWebhook(w); err != nil {
|
||||
c.Error(err, "create webhook")
|
||||
return
|
||||
}
|
||||
|
||||
c.Flash.Success(c.Tr("repo.settings.add_hook_success"))
|
||||
c.Redirect(orCtx.Link + "/settings/hooks")
|
||||
validateAndCreateWebhook(c, orCtx, w)
|
||||
}
|
||||
|
||||
func DingtalkHooksNewPost(c *context.Context, f form.NewDingtalkHook) {
|
||||
c.Data["Title"] = c.Tr("repo.settings")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["PageIsSettingsHooksNew"] = true
|
||||
c.Data["Webhook"] = db.Webhook{HookEvent: &db.HookEvent{}}
|
||||
|
||||
orCtx, err := getOrgRepoCtx(c)
|
||||
if err != nil {
|
||||
c.Error(err, "get organization repository context")
|
||||
return
|
||||
}
|
||||
|
||||
if c.HasError() {
|
||||
c.Success(orCtx.NewTemplate)
|
||||
return
|
||||
}
|
||||
func WebhooksDingtalkNewPost(c *context.Context, orCtx *orgRepoContext, f form.NewDingtalkHook) {
|
||||
c.Title("repo.settings.add_webhook")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.PageIs("SettingsHooksNew")
|
||||
c.Data["HookType"] = "dingtalk"
|
||||
|
||||
w := &db.Webhook{
|
||||
RepoID: orCtx.RepoID,
|
||||
URL: f.PayloadURL,
|
||||
ContentType: db.JSON,
|
||||
HookEvent: ParseHookEvent(f.Webhook),
|
||||
HookEvent: toHookEvent(f.Webhook),
|
||||
IsActive: f.Active,
|
||||
HookTaskType: db.DINGTALK,
|
||||
OrgID: orCtx.OrgID,
|
||||
}
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
c.Error(err, "update event")
|
||||
return
|
||||
} else if err := db.CreateWebhook(w); err != nil {
|
||||
c.Error(err, "create webhook")
|
||||
return
|
||||
}
|
||||
|
||||
c.Flash.Success(c.Tr("repo.settings.add_hook_success"))
|
||||
c.Redirect(orCtx.Link + "/settings/hooks")
|
||||
validateAndCreateWebhook(c, orCtx, w)
|
||||
}
|
||||
|
||||
func checkWebhook(c *context.Context) (*OrgRepoCtx, *db.Webhook) {
|
||||
c.Data["RequireHighlightJS"] = true
|
||||
|
||||
orCtx, err := getOrgRepoCtx(c)
|
||||
if err != nil {
|
||||
c.Error(err, "get organization repository context")
|
||||
return nil, nil
|
||||
}
|
||||
c.Data["BaseLink"] = orCtx.Link
|
||||
func loadWebhook(c *context.Context, orCtx *orgRepoContext) *db.Webhook {
|
||||
c.RequireHighlightJS()
|
||||
|
||||
var err error
|
||||
var w *db.Webhook
|
||||
if orCtx.RepoID > 0 {
|
||||
w, err = db.GetWebhookOfRepoByID(c.Repo.Repository.ID, c.ParamsInt64(":id"))
|
||||
|
@ -325,57 +316,80 @@ func checkWebhook(c *context.Context) (*OrgRepoCtx, *db.Webhook) {
|
|||
}
|
||||
if err != nil {
|
||||
c.NotFoundOrError(err, "get webhook")
|
||||
return nil, nil
|
||||
return nil
|
||||
}
|
||||
c.Data["Webhook"] = w
|
||||
|
||||
switch w.HookTaskType {
|
||||
case db.SLACK:
|
||||
c.Data["SlackHook"] = w.GetSlackHook()
|
||||
c.Data["SlackMeta"] = w.SlackMeta()
|
||||
c.Data["HookType"] = "slack"
|
||||
case db.DISCORD:
|
||||
c.Data["SlackHook"] = w.GetSlackHook()
|
||||
c.Data["SlackMeta"] = w.SlackMeta()
|
||||
c.Data["HookType"] = "discord"
|
||||
case db.DINGTALK:
|
||||
c.Data["HookType"] = "dingtalk"
|
||||
default:
|
||||
c.Data["HookType"] = "gogs"
|
||||
}
|
||||
c.Data["FormURL"] = fmt.Sprintf("%s/settings/hooks/%s/%d", orCtx.Link, c.Data["HookType"], w.ID)
|
||||
c.Data["DeleteURL"] = fmt.Sprintf("%s/settings/hooks/delete", orCtx.Link)
|
||||
|
||||
c.Data["History"], err = w.History(1)
|
||||
if err != nil {
|
||||
c.Error(err, "get history")
|
||||
return nil, nil
|
||||
return nil
|
||||
}
|
||||
return orCtx, w
|
||||
return w
|
||||
}
|
||||
|
||||
func WebHooksEdit(c *context.Context) {
|
||||
c.Data["Title"] = c.Tr("repo.settings.update_webhook")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["PageIsSettingsHooksEdit"] = true
|
||||
func WebhooksEdit(c *context.Context, orCtx *orgRepoContext) {
|
||||
c.Title("repo.settings.update_webhook")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.PageIs("SettingsHooksEdit")
|
||||
|
||||
orCtx, w := checkWebhook(c)
|
||||
loadWebhook(c, orCtx)
|
||||
if c.Written() {
|
||||
return
|
||||
}
|
||||
c.Data["Webhook"] = w
|
||||
|
||||
c.Success(orCtx.NewTemplate)
|
||||
c.Success(orCtx.TmplNew)
|
||||
}
|
||||
|
||||
func WebHooksEditPost(c *context.Context, f form.NewWebhook) {
|
||||
c.Data["Title"] = c.Tr("repo.settings.update_webhook")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["PageIsSettingsHooksEdit"] = true
|
||||
|
||||
orCtx, w := checkWebhook(c)
|
||||
if c.Written() {
|
||||
return
|
||||
}
|
||||
func validateAndUpdateWebhook(c *context.Context, orCtx *orgRepoContext, w *db.Webhook) {
|
||||
c.Data["Webhook"] = w
|
||||
|
||||
if c.HasError() {
|
||||
c.Success(orCtx.NewTemplate)
|
||||
c.Success(orCtx.TmplNew)
|
||||
return
|
||||
}
|
||||
|
||||
field, msg, ok := validateWebhook(c.User, c.Locale, w)
|
||||
if !ok {
|
||||
c.FormErr(field)
|
||||
c.RenderWithErr(msg, orCtx.TmplNew, nil)
|
||||
return
|
||||
}
|
||||
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
c.Error(err, "update event")
|
||||
return
|
||||
} else if err := db.UpdateWebhook(w); err != nil {
|
||||
c.Error(err, "update webhook")
|
||||
return
|
||||
}
|
||||
|
||||
c.Flash.Success(c.Tr("repo.settings.update_hook_success"))
|
||||
c.Redirect(fmt.Sprintf("%s/settings/hooks/%d", orCtx.Link, w.ID))
|
||||
}
|
||||
|
||||
func WebhooksEditPost(c *context.Context, orCtx *orgRepoContext, f form.NewWebhook) {
|
||||
c.Title("repo.settings.update_webhook")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.PageIs("SettingsHooksEdit")
|
||||
|
||||
w := loadWebhook(c, orCtx)
|
||||
if c.Written() {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -387,35 +401,20 @@ func WebHooksEditPost(c *context.Context, f form.NewWebhook) {
|
|||
w.URL = f.PayloadURL
|
||||
w.ContentType = contentType
|
||||
w.Secret = f.Secret
|
||||
w.HookEvent = ParseHookEvent(f.Webhook)
|
||||
w.HookEvent = toHookEvent(f.Webhook)
|
||||
w.IsActive = f.Active
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
c.Error(err, "update event")
|
||||
return
|
||||
} else if err := db.UpdateWebhook(w); err != nil {
|
||||
c.Error(err, "update webhook")
|
||||
return
|
||||
}
|
||||
|
||||
c.Flash.Success(c.Tr("repo.settings.update_hook_success"))
|
||||
c.Redirect(fmt.Sprintf("%s/settings/hooks/%d", orCtx.Link, w.ID))
|
||||
validateAndUpdateWebhook(c, orCtx, w)
|
||||
}
|
||||
|
||||
func SlackHooksEditPost(c *context.Context, f form.NewSlackHook) {
|
||||
c.Data["Title"] = c.Tr("repo.settings")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["PageIsSettingsHooksEdit"] = true
|
||||
func WebhooksSlackEditPost(c *context.Context, orCtx *orgRepoContext, f form.NewSlackHook) {
|
||||
c.Title("repo.settings.update_webhook")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.PageIs("SettingsHooksEdit")
|
||||
|
||||
orCtx, w := checkWebhook(c)
|
||||
w := loadWebhook(c, orCtx)
|
||||
if c.Written() {
|
||||
return
|
||||
}
|
||||
c.Data["Webhook"] = w
|
||||
|
||||
if c.HasError() {
|
||||
c.Success(orCtx.NewTemplate)
|
||||
return
|
||||
}
|
||||
|
||||
meta, err := jsoniter.Marshal(&db.SlackMeta{
|
||||
Channel: f.Channel,
|
||||
|
@ -430,36 +429,20 @@ func SlackHooksEditPost(c *context.Context, f form.NewSlackHook) {
|
|||
|
||||
w.URL = f.PayloadURL
|
||||
w.Meta = string(meta)
|
||||
w.HookEvent = ParseHookEvent(f.Webhook)
|
||||
w.HookEvent = toHookEvent(f.Webhook)
|
||||
w.IsActive = f.Active
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
c.Error(err, "update event")
|
||||
return
|
||||
} else if err := db.UpdateWebhook(w); err != nil {
|
||||
c.Error(err, "update webhook")
|
||||
return
|
||||
}
|
||||
|
||||
c.Flash.Success(c.Tr("repo.settings.update_hook_success"))
|
||||
c.Redirect(fmt.Sprintf("%s/settings/hooks/%d", orCtx.Link, w.ID))
|
||||
validateAndUpdateWebhook(c, orCtx, w)
|
||||
}
|
||||
|
||||
// FIXME: merge logic to Slack
|
||||
func DiscordHooksEditPost(c *context.Context, f form.NewDiscordHook) {
|
||||
c.Data["Title"] = c.Tr("repo.settings")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["PageIsSettingsHooksEdit"] = true
|
||||
func WebhooksDiscordEditPost(c *context.Context, orCtx *orgRepoContext, f form.NewDiscordHook) {
|
||||
c.Title("repo.settings.update_webhook")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.PageIs("SettingsHooksEdit")
|
||||
|
||||
orCtx, w := checkWebhook(c)
|
||||
w := loadWebhook(c, orCtx)
|
||||
if c.Written() {
|
||||
return
|
||||
}
|
||||
c.Data["Webhook"] = w
|
||||
|
||||
if c.HasError() {
|
||||
c.Success(orCtx.NewTemplate)
|
||||
return
|
||||
}
|
||||
|
||||
meta, err := jsoniter.Marshal(&db.SlackMeta{
|
||||
Username: f.Username,
|
||||
|
@ -473,53 +456,28 @@ func DiscordHooksEditPost(c *context.Context, f form.NewDiscordHook) {
|
|||
|
||||
w.URL = f.PayloadURL
|
||||
w.Meta = string(meta)
|
||||
w.HookEvent = ParseHookEvent(f.Webhook)
|
||||
w.HookEvent = toHookEvent(f.Webhook)
|
||||
w.IsActive = f.Active
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
c.Error(err, "update event")
|
||||
return
|
||||
} else if err := db.UpdateWebhook(w); err != nil {
|
||||
c.Error(err, "update webhook")
|
||||
return
|
||||
}
|
||||
|
||||
c.Flash.Success(c.Tr("repo.settings.update_hook_success"))
|
||||
c.Redirect(fmt.Sprintf("%s/settings/hooks/%d", orCtx.Link, w.ID))
|
||||
validateAndUpdateWebhook(c, orCtx, w)
|
||||
}
|
||||
|
||||
func DingtalkHooksEditPost(c *context.Context, f form.NewDingtalkHook) {
|
||||
c.Data["Title"] = c.Tr("repo.settings")
|
||||
c.Data["PageIsSettingsHooks"] = true
|
||||
c.Data["PageIsSettingsHooksEdit"] = true
|
||||
func WebhooksDingtalkEditPost(c *context.Context, orCtx *orgRepoContext, f form.NewDingtalkHook) {
|
||||
c.Title("repo.settings.update_webhook")
|
||||
c.PageIs("SettingsHooks")
|
||||
c.PageIs("SettingsHooksEdit")
|
||||
|
||||
orCtx, w := checkWebhook(c)
|
||||
w := loadWebhook(c, orCtx)
|
||||
if c.Written() {
|
||||
return
|
||||
}
|
||||
c.Data["Webhook"] = w
|
||||
|
||||
if c.HasError() {
|
||||
c.Success(orCtx.NewTemplate)
|
||||
return
|
||||
}
|
||||
|
||||
w.URL = f.PayloadURL
|
||||
w.HookEvent = ParseHookEvent(f.Webhook)
|
||||
w.HookEvent = toHookEvent(f.Webhook)
|
||||
w.IsActive = f.Active
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
c.Error(err, "update event")
|
||||
return
|
||||
} else if err := db.UpdateWebhook(w); err != nil {
|
||||
c.Error(err, "update webhook")
|
||||
return
|
||||
}
|
||||
|
||||
c.Flash.Success(c.Tr("repo.settings.update_hook_success"))
|
||||
c.Redirect(fmt.Sprintf("%s/settings/hooks/%d", orCtx.Link, w.ID))
|
||||
validateAndUpdateWebhook(c, orCtx, w)
|
||||
}
|
||||
|
||||
func TestWebhook(c *context.Context) {
|
||||
|
||||
var (
|
||||
commitID string
|
||||
commitMessage string
|
||||
|
@ -634,14 +592,20 @@ func RedeliveryWebhook(c *context.Context) {
|
|||
c.Status(http.StatusOK)
|
||||
}
|
||||
|
||||
func DeleteWebhook(c *context.Context) {
|
||||
if err := db.DeleteWebhookOfRepoByID(c.Repo.Repository.ID, c.QueryInt64("id")); err != nil {
|
||||
c.Flash.Error("DeleteWebhookByRepoID: " + err.Error())
|
||||
func DeleteWebhook(c *context.Context, orCtx *orgRepoContext) {
|
||||
var err error
|
||||
if orCtx.RepoID > 0 {
|
||||
err = db.DeleteWebhookOfRepoByID(orCtx.RepoID, c.QueryInt64("id"))
|
||||
} else {
|
||||
c.Flash.Success(c.Tr("repo.settings.webhook_deletion_success"))
|
||||
err = db.DeleteWebhookOfOrgByID(orCtx.OrgID, c.QueryInt64("id"))
|
||||
}
|
||||
if err != nil {
|
||||
c.Error(err, "delete webhook")
|
||||
return
|
||||
}
|
||||
c.Flash.Success(c.Tr("repo.settings.webhook_deletion_success"))
|
||||
|
||||
c.JSONSuccess(map[string]interface{}{
|
||||
"redirect": c.Repo.RepoLink + "/settings/hooks",
|
||||
"redirect": orCtx.Link + "/settings/hooks",
|
||||
})
|
||||
}
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
// Copyright 2020 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package repo
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"gogs.io/gogs/internal/db"
|
||||
"gogs.io/gogs/internal/mock"
|
||||
)
|
||||
|
||||
func Test_isLocalHostname(t *testing.T) {
|
||||
tests := []struct {
|
||||
hostname string
|
||||
want bool
|
||||
}{
|
||||
{hostname: "localhost", want: true},
|
||||
{hostname: "127.0.0.1", want: true},
|
||||
{hostname: "::1", want: true},
|
||||
{hostname: "0:0:0:0:0:0:0:1", want: true},
|
||||
|
||||
{hostname: "gogs.io", want: false},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run("", func(t *testing.T) {
|
||||
assert.Equal(t, test.want, isLocalHostname(test.hostname))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_validateWebhook(t *testing.T) {
|
||||
l := mock.NewLocale("en", func(s string, _ ...interface{}) string {
|
||||
return s
|
||||
})
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
actor *db.User
|
||||
webhook *db.Webhook
|
||||
expField string
|
||||
expMsg string
|
||||
expOK bool
|
||||
}{
|
||||
{
|
||||
name: "admin bypass local address check",
|
||||
actor: &db.User{IsAdmin: true},
|
||||
webhook: &db.Webhook{URL: "http://localhost:3306"},
|
||||
expOK: true,
|
||||
},
|
||||
|
||||
{
|
||||
name: "local address not allowed",
|
||||
actor: &db.User{},
|
||||
webhook: &db.Webhook{URL: "http://localhost:3306"},
|
||||
expField: "PayloadURL",
|
||||
expMsg: "repo.settings.webhook.err_cannot_use_local_addresses",
|
||||
expOK: false,
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
field, msg, ok := validateWebhook(test.actor, l, test.webhook)
|
||||
assert.Equal(t, test.expOK, ok)
|
||||
assert.Equal(t, test.expMsg, msg)
|
||||
assert.Equal(t, test.expField, field)
|
||||
})
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 7.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 5.4 KiB |
|
@ -1,50 +1,50 @@
|
|||
.form {
|
||||
.help {
|
||||
color: #999999;
|
||||
padding-top: .6em;
|
||||
padding-bottom: .6em;
|
||||
display: inline-block;
|
||||
word-break: break-word;
|
||||
}
|
||||
.help {
|
||||
color: #999999;
|
||||
padding-top: 0.6em;
|
||||
padding-bottom: 0.6em;
|
||||
display: inline-block;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
.ui.attached.header {
|
||||
background: #f0f0f0;
|
||||
.right {
|
||||
margin-top: -5px;
|
||||
.button {
|
||||
padding: 8px 10px;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
background: #f0f0f0;
|
||||
.right {
|
||||
margin-top: -5px;
|
||||
.button {
|
||||
padding: 8px 10px;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@create-page-form-input-padding: 250px !important;
|
||||
#create-page-form {
|
||||
form {
|
||||
margin: auto;
|
||||
width: 800px!important;
|
||||
.ui.message {
|
||||
text-align: center;
|
||||
}
|
||||
.header {
|
||||
padding-left: @create-page-form-input-padding+30px;
|
||||
}
|
||||
.inline.field > label {
|
||||
text-align: right;
|
||||
width: @create-page-form-input-padding;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.help {
|
||||
margin-left: @create-page-form-input-padding+15px;
|
||||
}
|
||||
.optional .title {
|
||||
margin-left: @create-page-form-input-padding;
|
||||
}
|
||||
input,
|
||||
textarea {
|
||||
width: 50% !important;
|
||||
}
|
||||
}
|
||||
form {
|
||||
margin: auto;
|
||||
width: 800px !important;
|
||||
.ui.message {
|
||||
text-align: center;
|
||||
}
|
||||
.header {
|
||||
padding-left: @create-page-form-input-padding+30px;
|
||||
}
|
||||
.inline.field > label {
|
||||
text-align: right;
|
||||
width: @create-page-form-input-padding;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.help {
|
||||
margin-left: @create-page-form-input-padding+15px;
|
||||
}
|
||||
.optional .title {
|
||||
margin-left: @create-page-form-input-padding;
|
||||
}
|
||||
input,
|
||||
textarea {
|
||||
width: 50% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user.activate,
|
||||
|
@ -52,72 +52,85 @@
|
|||
.user.reset.password,
|
||||
.user.signin,
|
||||
.user.signup {
|
||||
@input-padding: 200px !important;
|
||||
#create-page-form;
|
||||
form {
|
||||
width: 700px !important;
|
||||
.header {
|
||||
padding-left: @input-padding+30px;
|
||||
}
|
||||
.inline.field > label {
|
||||
width: @input-padding;
|
||||
}
|
||||
}
|
||||
@input-padding: 200px !important;
|
||||
#create-page-form;
|
||||
form {
|
||||
width: 700px !important;
|
||||
.header {
|
||||
padding-left: @input-padding+30px;
|
||||
}
|
||||
.inline.field > label {
|
||||
width: @input-padding;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user.signin.two-factor {
|
||||
form {
|
||||
width: 300px !important;
|
||||
.header {
|
||||
padding-left: inherit !important;
|
||||
}
|
||||
}
|
||||
form {
|
||||
width: 300px !important;
|
||||
.header {
|
||||
padding-left: inherit !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.repository {
|
||||
&.new.repo,
|
||||
&.new.migrate,
|
||||
&.new.fork {
|
||||
#create-page-form;
|
||||
form {
|
||||
.dropdown {
|
||||
.dropdown.icon {
|
||||
margin-top: -7px!important;
|
||||
}
|
||||
.text {
|
||||
margin-right: 0!important;
|
||||
i {
|
||||
margin-right: 0!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.new.repo,
|
||||
&.new.migrate,
|
||||
&.new.fork {
|
||||
#create-page-form;
|
||||
form {
|
||||
.dropdown {
|
||||
.dropdown.icon {
|
||||
margin-top: -7px !important;
|
||||
}
|
||||
.text {
|
||||
margin-right: 0 !important;
|
||||
i {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.new.repo {
|
||||
.ui.form {
|
||||
.selection.dropdown:not(.owner) {
|
||||
width: 50%!important;
|
||||
}
|
||||
#auto-init {
|
||||
margin-left: @create-page-form-input-padding+15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.new.repo {
|
||||
.ui.form {
|
||||
.selection.dropdown:not(.owner) {
|
||||
width: 50% !important;
|
||||
}
|
||||
#auto-init {
|
||||
margin-left: @create-page-form-input-padding+15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.new.webhook {
|
||||
form {
|
||||
.help {
|
||||
margin-left: 25px;
|
||||
}
|
||||
}
|
||||
form {
|
||||
.text.desc {
|
||||
margin-top: 5px;
|
||||
}
|
||||
.help {
|
||||
margin-left: 25px;
|
||||
}
|
||||
.events {
|
||||
.column {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.help {
|
||||
font-size: 13px;
|
||||
margin-left: 26px;
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.new.webhook {
|
||||
.events.fields {
|
||||
.column {
|
||||
padding-left: 40px;
|
||||
}
|
||||
}
|
||||
.events.fields {
|
||||
.column {
|
||||
padding-left: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1436,22 +1436,6 @@
|
|||
margin-top: -4px;
|
||||
}
|
||||
}
|
||||
|
||||
&.webhook {
|
||||
.text.desc {
|
||||
margin-top: 5px;
|
||||
}
|
||||
.events {
|
||||
.column {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.help {
|
||||
font-size: 13px;
|
||||
margin-left: 26px;
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// End of .repository
|
||||
|
@ -1605,11 +1589,11 @@
|
|||
}
|
||||
}
|
||||
.hook.list {
|
||||
> .item:not(:first-child) {
|
||||
border-top: 1px solid #eaeaea;
|
||||
> .item:not(:last-child) {
|
||||
border-bottom: 1px solid #eaeaea;
|
||||
}
|
||||
.item {
|
||||
padding: 10px 20px;
|
||||
padding: 10px 0;
|
||||
.octicon,
|
||||
.fa {
|
||||
width: 20px;
|
||||
|
@ -1622,7 +1606,7 @@
|
|||
}
|
||||
.hook.history.list {
|
||||
.item {
|
||||
padding-left: 13px;
|
||||
padding: 10px 20px;
|
||||
.meta {
|
||||
.ui.right {
|
||||
margin-top: 5px;
|
||||
|
|
|
@ -9,11 +9,9 @@
|
|||
<h4 class="ui top attached header">
|
||||
{{.i18n.Tr "repo.settings.githooks"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<div class="ui attached segment">
|
||||
<p>{{.i18n.Tr "repo.settings.githooks_desc"}}</p>
|
||||
<div class="ui hook list">
|
||||
<div class="item">
|
||||
{{.i18n.Tr "repo.settings.githooks_desc" | Str2HTML}}
|
||||
</div>
|
||||
{{range .Hooks}}
|
||||
<div class="item">
|
||||
<span class="text {{if not .IsSample}}green{{else}}grey{{end}}"><i class="octicon octicon-primitive-dot"></i></span>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{if eq .HookType "dingtalk"}}
|
||||
<p>{{.i18n.Tr "repo.settings.add_dingtalk_hook_desc" "https://open-doc.dingtalk.com/" | Str2HTML}}</p>
|
||||
<form class="ui form" action="{{.BaseLink}}/settings/hooks/dingtalk/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
|
||||
<form class="ui form" action="{{if .PageIsSettingsHooksNew}}{{$.Link}}{{else}}{{.FormURL}}{{end}}" method="post">
|
||||
{{.CSRFTokenHTML}}
|
||||
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
|
||||
<label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{if eq .HookType "discord"}}
|
||||
<p>{{.i18n.Tr "repo.settings.add_discord_hook_desc" "https://discordapp.com/" | Str2HTML}}</p>
|
||||
<form class="ui form" action="{{.BaseLink}}/settings/hooks/discord/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
|
||||
<form class="ui form" action="{{if .PageIsSettingsHooksNew}}{{$.Link}}{{else}}{{.FormURL}}{{end}}" method="post">
|
||||
{{.CSRFTokenHTML}}
|
||||
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
|
||||
<label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
|
||||
|
@ -9,15 +9,15 @@
|
|||
|
||||
<div class="field">
|
||||
<label for="username">{{.i18n.Tr "repo.settings.slack_username"}}</label>
|
||||
<input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="e.g. Gogs">
|
||||
<input id="username" name="username" value="{{.SlackMeta.Username}}" placeholder="e.g. Gogs">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="icon_url">{{.i18n.Tr "repo.settings.slack_icon_url"}}</label>
|
||||
<input id="icon_url" name="icon_url" value="{{.SlackHook.IconURL}}" placeholder="e.g. https://example.com/img/favicon.png">
|
||||
<input id="icon_url" name="icon_url" value="{{.SlackMeta.IconURL}}" placeholder="e.g. https://example.com/img/favicon.png">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="color">{{.i18n.Tr "repo.settings.slack_color"}}</label>
|
||||
<input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="e.g. #dd4b39">
|
||||
<input id="color" name="color" value="{{.SlackMeta.Color}}" placeholder="e.g. #dd4b39">
|
||||
</div>
|
||||
{{template "repo/settings/webhook/settings" .}}
|
||||
</form>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{if eq .HookType "gogs"}}
|
||||
<p>{{.i18n.Tr "repo.settings.add_webhook_desc" "https://gogs.io/docs/features/webhook.html" | Str2HTML}}</p>
|
||||
<form class="ui form" action="{{.BaseLink}}/settings/hooks/gogs/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
|
||||
<p>{{.i18n.Tr "repo.settings.add_webhook_desc" "https://gogs.io/docs/features/webhook.html" | Safe}}</p>
|
||||
<form class="ui form" action="{{if .PageIsSettingsHooksNew}}{{$.Link}}{{else}}{{.FormURL}}{{end}}" method="post">
|
||||
{{.CSRFTokenHTML}}
|
||||
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
|
||||
<label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
|
||||
|
|
|
@ -2,40 +2,10 @@
|
|||
{{template "base/alert" .}}
|
||||
<h4 class="ui top attached header">
|
||||
{{.i18n.Tr "repo.settings.hooks"}}
|
||||
<div class="ui right">
|
||||
<div class="ui types jump dropdown">
|
||||
{{if .Types}}
|
||||
<div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div>
|
||||
<div class="menu">
|
||||
{{range .Types}}
|
||||
{{if eq . "gogs"}}
|
||||
<a class="item logo" href="{{$.BaseLink}}/settings/hooks/gogs/new">
|
||||
<img class="img-12" src="{{AppSubURL}}/img/favicon.png">Gogs
|
||||
</a>
|
||||
{{else if eq . "slack"}}
|
||||
<a class="item logo" href="{{$.BaseLink}}/settings/hooks/slack/new">
|
||||
<img class="img-12" src="{{AppSubURL}}/img/slack.png">Slack
|
||||
</a>
|
||||
{{else if eq . "discord"}}
|
||||
<a class="item logo" href="{{$.BaseLink}}/settings/hooks/discord/new">
|
||||
<img class="img-12" src="{{AppSubURL}}/img/discord.png">Discord
|
||||
</a>
|
||||
{{else if eq . "dingtalk"}}
|
||||
<a class="item logo" href="{{$.BaseLink}}/settings/hooks/dingtalk/new">
|
||||
<img class="img-12" src="{{AppSubURL}}/img/dingtalk.png">Dingtalk
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<div class="ui attached segment">
|
||||
<p>{{.Description | Safe}}</p>
|
||||
<div class="ui hook list">
|
||||
<div class="item">
|
||||
{{.Description | Str2HTML}}
|
||||
</div>
|
||||
{{range .Webhooks}}
|
||||
<div class="item">
|
||||
{{if eq .LastStatus 1}}
|
||||
|
@ -45,15 +15,43 @@
|
|||
{{else}}
|
||||
<span class="text grey"><i class="octicon octicon-primitive-dot"></i></span>
|
||||
{{end}}
|
||||
<a href="{{$.BaseLink}}/settings/hooks/{{.ID}}">{{.URL}}</a>
|
||||
<a href="{{$.Link}}/{{.ID}}">{{.URL}}</a>
|
||||
<div class="ui right">
|
||||
<span class="text blue"><a href="{{$.BaseLink}}/settings/hooks/{{.ID}}"><i class="fa fa-pencil"></i></a></span>
|
||||
<span class="text red"><a class="delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"><i class="fa fa-times"></i></a></span>
|
||||
<a class="text blue" href="{{$.Link}}/{{.ID}}"><i class="fa fa-pencil"></i></a>
|
||||
<a class="text red delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"><i class="fa fa-trash-o"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui bottom attached segment">
|
||||
<span><b>{{.i18n.Tr "repo.settings.webhooks.add_new"}}</b></span>
|
||||
<div class="ui selection jump dropdown">
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="default text">{{.i18n.Tr "repo.settings.webhooks.choose_a_type"}}</div>
|
||||
<div class="menu">
|
||||
{{range .Types}}
|
||||
{{if eq . "gogs"}}
|
||||
<a class="item logo" href="{{$.Link}}/gogs/new">
|
||||
<img class="img-12" src="{{AppSubURL}}/img/favicon.png">Gogs
|
||||
</a>
|
||||
{{else if eq . "slack"}}
|
||||
<a class="item logo" href="{{$.Link}}/slack/new">
|
||||
<img class="img-12" src="{{AppSubURL}}/img/slack.png">Slack
|
||||
</a>
|
||||
{{else if eq . "discord"}}
|
||||
<a class="item logo" href="{{$.Link}}/discord/new">
|
||||
<img class="img-12" src="{{AppSubURL}}/img/discord.png">Discord
|
||||
</a>
|
||||
{{else if eq . "dingtalk"}}
|
||||
<a class="item logo" href="{{$.Link}}/dingtalk/new">
|
||||
<img class="img-12" src="{{AppSubURL}}/img/dingtalk.png">Dingtalk
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "repo/settings/webhook/delete_modal" .}}
|
||||
|
|
|
@ -119,7 +119,7 @@
|
|||
<button class="ui green button">{{.i18n.Tr "repo.settings.add_webhook"}}</button>
|
||||
{{else}}
|
||||
<button class="ui green button">{{.i18n.Tr "repo.settings.update_webhook"}}</button>
|
||||
<a class="ui red delete-button button" data-url="{{.BaseLink}}/settings/hooks/delete" data-id="{{.Webhook.ID}}">{{.i18n.Tr "repo.settings.delete_webhook"}}</a>
|
||||
<a class="ui red delete-button button" data-url="{{.DeleteURL}}" data-id="{{.Webhook.ID}}">{{.i18n.Tr "repo.settings.delete_webhook"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{if eq .HookType "slack"}}
|
||||
<p>{{.i18n.Tr "repo.settings.add_slack_hook_desc" "https://slack.com" | Str2HTML}}</p>
|
||||
<form class="ui form" action="{{.BaseLink}}/settings/hooks/slack/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
|
||||
<p>{{.i18n.Tr "repo.settings.add_slack_hook_desc" "https://slack.com" | Safe}}</p>
|
||||
<form class="ui form" action="{{if .PageIsSettingsHooksNew}}{{$.Link}}{{else}}{{.FormURL}}{{end}}" method="post">
|
||||
{{.CSRFTokenHTML}}
|
||||
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
|
||||
<label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
|
||||
|
@ -8,20 +8,20 @@
|
|||
</div>
|
||||
<div class="required field {{if .Err_Channel}}error{{end}}">
|
||||
<label for="channel">{{.i18n.Tr "repo.settings.slack_channel"}}</label>
|
||||
<input id="channel" name="channel" value="{{.SlackHook.Channel}}" placeholder="e.g. #general" required>
|
||||
<input id="channel" name="channel" value="{{.SlackMeta.Channel}}" placeholder="e.g. #general" required>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="username">{{.i18n.Tr "repo.settings.slack_username"}}</label>
|
||||
<input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="e.g. Gogs">
|
||||
<input id="username" name="username" value="{{.SlackMeta.Username}}" placeholder="e.g. Gogs">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="icon_url">{{.i18n.Tr "repo.settings.slack_icon_url"}}</label>
|
||||
<input id="icon_url" name="icon_url" value="{{.SlackHook.IconURL}}" placeholder="e.g. https://example.com/img/favicon.png">
|
||||
<input id="icon_url" name="icon_url" value="{{.SlackMeta.IconURL}}" placeholder="e.g. https://example.com/img/favicon.png">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="color">{{.i18n.Tr "repo.settings.slack_color"}}</label>
|
||||
<input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="e.g. #dd4b39, good, warning, danger">
|
||||
<input id="color" name="color" value="{{.SlackMeta.Color}}" placeholder="e.g. #dd4b39, good, warning, danger">
|
||||
</div>
|
||||
{{template "repo/settings/webhook/settings" .}}
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue