Commit graph

13464 commits

Author SHA1 Message Date
1da4849ad7
Merge remote-tracking branch 'github/feature-activitypub' into feature-activitypub 2022-06-14 21:33:31 -05:00
14cfd8de23
Revert "If httpsig verification fails, fix Host header and try again"
This reverts commit f53e46c721.

The bug was actually caused by nginx messing up the Host header when reverse-proxying since I didn't have the line `proxy_set_header Host $host;` in my nginx config for Gitea.
2022-06-14 21:11:55 -05:00
6543
c05bad8d41
Merge branch 'main' into feature-activitypub 2022-06-15 03:24:48 +02:00
6543
f8ad1a832f
Apply suggestions from code review
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2022-06-15 03:19:34 +02:00
singuliere
f6e2dbaf1e [skip ci] Updated translations via Crowdin 2022-06-15 00:10:14 +00:00
f53e46c721
If httpsig verification fails, fix Host header and try again
This fixes a very rare bug when Gitea and another AP server (confirmed to happen with Mastodon) are running on the same machine, Gitea fails to verify incoming HTTP signatures. This is because the other AP server creates the sig with the public Gitea domain as the Host. However, when Gitea receives the request, the Host header is instead localhost, so the signature verification fails. Manually changing the host header to the correct value and trying the verification again fixes the bug.
2022-06-14 16:23:08 -05:00
a3120079a5
Make sure Person IRIs are generated correctly
This commit ensures that if the setting.AppURL is something like "http://127.0.0.1:42567" (like in the integration tests), a trailing slash will be added after that URL.
2022-06-14 12:30:36 -05:00
d06772b376
Return if marshalling error 2022-06-14 12:26:06 -05:00
faf2855244
Add new federation settings to app.example.ini and config-cheat-sheet 2022-06-14 12:23:20 -05:00
a4403e4e80
Move httpsig algs constant slice to modules/setting/federation.go 2022-06-14 12:16:32 -05:00
e60158c70b
Make sure API responses always refer to username in original case
Copied from what I wrote on #19133 discussion: Handling username case is a very tricky issue and I've already encountered a Mastodon <-> Gitea federation bug due to Gitea considering Ta180m and ta180m to be the same user while Mastodon thinks they are two different users. I think the best way forward is for Gitea to only use the original case version of the username for federation so other AP software don't get confused.
2022-06-14 12:01:41 -05:00
add8469813
Merge branch 'feature-activitypub' of github.com:Ta180m/Gitea into feature-activitypub 2022-06-14 10:54:19 -05:00
6543
3f2d8b015f
dont drop err 2022-06-14 14:26:41 +02:00
6543
900ceb2dfd
make fmt 2022-06-14 14:12:00 +02:00
6543
2706e89138
Merge branch 'main' into feature-activitypub 2022-06-14 14:10:40 +02:00
08eebffb0e
Make sure HTTP request Date in GMT 2022-06-13 23:10:36 -05:00
d749f8ff4f
Rename pkey to pubKey 2022-06-13 20:51:49 -05:00
singuliere
460c03ca49 [skip ci] Updated translations via Crowdin 2022-06-14 00:10:10 +00:00
3e9a69c8d3
Use UTC instead of GMT 2022-06-13 19:09:09 -05:00
f88979326c
Make sure Person endpoint has Content-Type application/activity+json and includes PreferredUsername, URL, and Icon
Setting the correct Content-Type is essential for federating with Mastodon
2022-06-13 17:14:41 -05:00
ed2a6f5348
make lint-backend 2022-06-13 16:53:17 -05:00
718f35aab6
Merge remote-tracking branch 'upstream/main' into feature-activitypub 2022-06-13 16:49:36 -05:00
b6b7fe27b6
WebFinger: Add CORS header and fix Href -> Template for remote interactions
The CORS header is needed due to https://datatracker.ietf.org/doc/html/rfc7033#section-5 and fixes some Peertube <-> Gitea federation issues
2022-06-13 15:40:26 -05:00
singuliere
1fef9a2d69
Remove singuliere from MAINTAINERS (#19883) 2022-06-13 21:05:41 +01:00
wxiaoguang
0d7eda511f
Fix aria for logo (#19955)
Co-authored-by: 6543 <6543@obermui.de>
2022-06-13 14:46:39 -04:00
Lunny Xiao
ff82a18315
Fix mirror template bug (#19959)
* Fix mirror template bug

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2022-06-13 18:12:59 +02:00
a5b00ec4a5
Force CI rerun 2022-06-13 09:16:42 -05:00
d7b81f551d
make fmt 2022-06-13 09:03:10 -05:00
Lunny Xiao
3c6c150740
Add deprecated log when using MySQL with utf8 charset (#19952) 2022-06-13 20:55:08 +08:00
Lunny Xiao
1a9821f57a
Move issues related files into models/issues (#19931)
* Move access and repo permission to models/perm/access

* fix test

* fix git test

* Move functions sequence

* Some improvements per @KN4CK3R and @delvh

* Move issues related code to models/issues

* Move some issues related sub package

* Merge

* Fix test

* Fix test

* Fix test

* Fix test

* Rename some files
2022-06-13 17:37:59 +08:00
yutotnh
3708ca8e28
fix: some typos (#19956) 2022-06-13 15:34:46 +08:00
d91c61f8fa
Update TestWebFinger to check for ActivityPub IRI in aliases 2022-06-12 21:11:14 -05:00
Lunny Xiao
5f136783d1 [skip ci] Updated translations via Crowdin 2022-06-13 00:10:09 +00:00
5823d8150a
Add actor IRI and remote interaction URL to WebFinger response 2022-06-12 17:01:30 -05:00
191919e7fa
Merge remote-tracking branch 'upstream/main' into feature-activitypub 2022-06-12 14:25:41 -05:00
d1f14ff2c7
Move httpsig algos slice to an init() function 2022-06-12 14:24:47 -05:00
Lunny Xiao
110fc57cbc
Move some code into models/git (#19879)
* Move access and repo permission to models/perm/access

* fix test

* Move some git related files into sub package models/git

* Fix build

* fix git test

* move lfs to sub package

* move more git related functions to models/git

* Move functions sequence

* Some improvements per @KN4CK3R and @delvh
2022-06-12 23:51:54 +08:00
wxiaoguang
a9dc9b06e4
Fix signal loop in graceful manager (#19943) 2022-06-12 21:50:18 +08:00
Gusted
796c4eca0b
Prettify number of issues (#17760)
* Prettify number of issues

- Use the PrettyNumber function to add commas in large amount of issues.

* Use client-side formatting

* prettify on both server and client

* remove unused i18n entries

* handle more cases, support other int types in PrettyNumber

* specify locale to avoid issues with node default locale

* remove superfluos argument

* introduce template helper, octicon tweaks, js refactor

* Update modules/templates/helper.go

* Apply some suggestions.

* Add comment

* Update templates/user/dashboard/issues.tmpl

Co-authored-by: silverwind <me@silverwind.io>

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-06-12 20:08:23 +08:00
Gusted
0097fbc2ac
Improve file header on mobile (#19945)
- File headers can become quite width, so ensure the file size is not
being wrapped into itself(width + padding-right) and allow the overflow
to be scrolled(overflow-x).
2022-06-12 12:30:22 +03:00
Gusted
edf14202fe
Unify repo settings & show better error (#19828)
* Unify context data
* Actually show invalid url in error
2022-06-12 13:43:27 +08:00
76f06cee31
Remove another LogSQL from ActivityPub person test 2022-06-11 21:18:15 -05:00
6074222377
Code cleanup 2022-06-11 21:15:45 -05:00
xkcdstickfigure
3898fc5bda [skip ci] Updated translations via Crowdin 2022-06-12 00:10:13 +00:00
7658649d61
Merge remote-tracking branch 'upstream/main' into feature-activitypub 2022-06-11 18:36:41 -05:00
xkcdstickfigure
47bb06236d
fixed comment typo (#19944) 2022-06-11 14:54:08 -04:00
528c282d68
Correctly add inbox/outbox IRIs to person 2022-06-11 12:40:10 -05:00
cf6aed386d
Use @mariusor's suggestions for idiomatic go-ap usage 2022-06-11 11:00:45 -05:00
6543
f7da251c5d
Merge branch 'main' into feature-activitypub 2022-06-11 16:59:18 +02:00
6543
a9cc9c0f7a
Auto merge pull requests when all checks succeeded via WebUI (#19648)
Add WebUI part of Auto merge feature

close #19621

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2022-06-11 16:44:20 +02:00