You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/modules
Aaron F 3963625b6e
Webhook for Wiki changes (#20219)
Add support for triggering webhook notifications on wiki changes.

This PR contains frontend and backend for webhook notifications on wiki actions (create a new page, rename a page, edit a page and delete a page). The frontend got a new checkbox under the Custom Event -> Repository Events section. There is only one checkbox for create/edit/rename/delete actions, because it makes no sense to separate it and others like releases or packages follow the same schema.

![image](https://user-images.githubusercontent.com/121972/177018803-26851196-831f-4fde-9a4c-9e639b0e0d6b.png)

The actions itself are separated, so that different notifications will be executed (with the "action" field). All the webhook receivers implement the new interface method (Wiki) and the corresponding tests.

When implementing this, I encounter a little bug on editing a wiki page. Creating and editing a wiki page is technically the same action and will be handled by the ```updateWikiPage``` function. But the function need to know if it is a new wiki page or just a change. This distinction is done by the ```action``` parameter, but this will not be sent by the frontend (on form submit). This PR will fix this by adding the ```action``` parameter with the values ```_new``` or ```_edit```, which will be used by the ```updateWikiPage``` function.

I've done integration tests with matrix and gitea (http).

![image](https://user-images.githubusercontent.com/121972/177018795-eb5cdc01-9ba3-483e-a6b7-ed0e313a71fb.png)

Fix #16457

Signed-off-by: Aaron Fischer <mail@aaron-fischer.net>
2 years ago
..
activitypub Refactor AssertExistsAndLoadBean to use generics (#20797) 2 years ago
analyze Simplify `IsVendor` (#19626) 2 years ago
appstate Use a struct as test options (#19393) 2 years ago
auth Remove legacy `+build:` constraint (#19582) 2 years ago
avatar Go 1.19 format (#20758) 2 years ago
base Add more linters to improve code readability (#19989) 2 years ago
cache Update go-chi/cache to utilize Ping() (#19719) 2 years ago
charset Share HTML template renderers and create a watcher framework (#20218) 2 years ago
container Move reaction to models/issues/ (#19264) 2 years ago
context Support Issue forms and PR forms (#20987) 2 years ago
convert Fix 500 on time tracking in timeline API (#21052) 2 years ago
csv Go 1.19 format (#20758) 2 years ago
doctor Move some files into models' sub packages (#20262) 2 years ago
emoji Go 1.19 format (#20758) 2 years ago
eventsource Move some files into models' sub packages (#20262) 2 years ago
generate Use base32 for 2FA scratch token (#18384) 2 years ago
git test: use `T.TempDir` to create temporary test directory (#21043) 2 years ago
gitgraph Add more linters to improve code readability (#19989) 2 years ago
graceful Support Proxy protocol (#12527) 2 years ago
hcaptcha hCaptcha Support (#12594) 4 years ago
highlight Rework file highlight rendering and fix yaml copy-paste (#19967) 2 years ago
hostmatcher Add proxy host into allow list (#20798) 2 years ago
httpcache Add Cache-Control header to html and api responses, add no-transform (#20432) 2 years ago
httplib refactor httplib (#18338) 2 years ago
indexer test: use `T.TempDir` to create temporary test directory (#21043) 2 years ago
issue/template Support Issue forms and PR forms (#20987) 2 years ago
json Refactor legacy `unknwon/com` package, improve golangci lint (#19284) 2 years ago
lfs Removed some vestigial code related to Range bounds checks (#20312) 2 years ago
log test: use `T.TempDir` to create temporary test directory (#21043) 2 years ago
markup Kd/ci playwright go test (#20123) 2 years ago
mcaptcha Add support mCaptcha as captcha provider (#20458) 2 years ago
metrics Move some files into models' sub packages (#20262) 2 years ago
migration Add more checks in migration code (#21011) 2 years ago
mirror Implement sync push mirror on commit (#19411) 2 years ago
nosql fix broken insecureskipverify handling in rediss connection uris (#20967) 2 years ago
notification Webhook for Wiki changes (#20219) 2 years ago
options Share HTML template renderers and create a watcher framework (#20218) 2 years ago
packages Add support for Vagrant packages (#20930) 2 years ago
paginator Remove legacy unmaintained packages, refactor to support change default locale (#19308) 2 years ago
password Fixed assert statements. (#16089) 3 years ago
pprof Go 1.19 format (#20758) 2 years ago
private Support Proxy protocol (#12527) 2 years ago
process Add more linters to improve code readability (#19989) 2 years ago
proxy Return nil proxy function if proxy not enabled (#16742) 3 years ago
proxyprotocol Support Proxy protocol (#12527) 2 years ago
public Remove legacy `+build:` constraint (#19582) 2 years ago
queue test: use `T.TempDir` to create temporary test directory (#21043) 2 years ago
recaptcha refactor: move from io/ioutil to io and os package (#17109) 3 years ago
references Add more linters to improve code readability (#19989) 2 years ago
regexplru Custom regexp external issues (#17624) 2 years ago
repository Move some files into models' sub packages (#20262) 2 years ago
secret Use `CryptoRandomBytes` instead of `CryptoRandomString` (#18439) 2 years ago
session format with gofumpt (#18184) 2 years ago
setting Only show relevant repositories on explore page (#19361) 2 years ago
sitemap Add sitemap support (#18407) 2 years ago
ssh Support Proxy protocol (#12527) 2 years ago
storage Add more linters to improve code readability (#19989) 2 years ago
structs Webhook for Wiki changes (#20219) 2 years ago
svg Remove legacy `+build:` constraint (#19582) 2 years ago
sync Use queue instead of memory queue in webhook send service (#19390) 2 years ago
templates Share HTML template renderers and create a watcher framework (#20218) 2 years ago
test Refactor AssertExistsAndLoadBean to use generics (#20797) 2 years ago
timeutil Share HTML template renderers and create a watcher framework (#20218) 2 years ago
translation Share HTML template renderers and create a watcher framework (#20218) 2 years ago
typesniffer Rework raw file http header logic (#20484) 2 years ago
updatechecker format with gofumpt (#18184) 2 years ago
upload Simplify parameter types (#18006) 3 years ago
uri Prevent NPE if gitea uploader fails to open url (#18080) 3 years ago
user Add gitea-vet (#10948) 4 years ago
util Go 1.19 format (#20758) 2 years ago
validation Add more checks in migration code (#21011) 2 years ago
watcher Share HTML template renderers and create a watcher framework (#20218) 2 years ago
web refactor webhook *NewPost (#20729) 2 years ago