Commit graph

13540 commits

Author SHA1 Message Date
6543
a3ff170531
Merge branch 'main' into feature-activitypub 2022-06-19 01:28:55 +02:00
Gusted
909fb6ad20
Backtick table name in generic orphan check (#20019) 2022-06-19 07:26:22 +08:00
f602958f3c
Use ctx.ServerError in reqsignature.go 2022-06-18 17:04:02 -05:00
28fd3e796e
Remove accidently added files 2022-06-18 16:33:12 -05:00
4ffb6b64bc
Use ctx.ServerError and remove all remote interaction code from webfinger.go 2022-06-18 16:30:30 -05:00
6543
1bd8eb6ef7
Merge branch 'main' into feature-activitypub 2022-06-18 21:33:13 +02:00
wxiaoguang
e4ceaf65fb
Update document to clarify that ALLOWED_DOMAINS/BLOCKED_DOMAINS support wildcard (#20016) 2022-06-18 15:23:06 -04:00
6543
adfb213211
Merge branch 'main' into feature-activitypub 2022-06-18 20:28:32 +02:00
0231dad173
go mod tidy 2022-06-18 13:20:36 -05:00
7c10ab9fde
Change Gitea user agent from the default to Gitea/Version 2022-06-18 13:08:00 -05:00
37d2d01f8f
Use go-ap/jsonld to add @context and marshal JSON 2022-06-18 12:27:11 -05:00
Wim
439ace607d
Return 404 when tag is broken (#20017)
Fixes #19979
2022-06-18 19:08:34 +02:00
6543
fe18cf7620
Merge branch 'main' into feature-activitypub 2022-06-18 18:36:39 +02:00
wxiaoguang
433443ffa9
Dump should only copy regular files and symlink regular files (#20015) 2022-06-18 22:06:32 +08:00
6543
7bfadb46ff
Merge branch 'main' into feature-activitypub 2022-06-18 15:19:10 +02:00
zeripath
870d7f90e7 [skip ci] Updated translations via Crowdin 2022-06-18 13:10:18 +00:00
zeripath
af7cfdee0e [skip ci] Updated translations via Crowdin 2022-06-18 10:11:27 +00:00
zeripath
90f3365d93
Add fgprof pprof profiler (#20005)
fgprof is a sampling Go profiler that allows you to analyze On-CPU as
well as Off-CPU (e.g. I/O) time together.

Go's builtin sampling CPU profiler can only show On-CPU time, but it's
better than fgprof at that. Go also includes tracing profilers that can
analyze I/O, but they can't be combined with the CPU profiler.

fgprof is designed for analyzing applications with mixed I/O and CPU
workloads. This kind of profiling is also known as wall-clock profiling.

Whilst fgprof can cause significant STW latencies in applications with a
lot of goroutines (> 1-10k), these latencies only occur if the profile
is requested - it doesn't cause a delay by simply being available.

The fgprof profile is mounted on
`http://localhost:6060/debug/fgprof?seconds=3`

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-06-18 11:04:52 +01:00
zeripath
7fbf002403 [skip ci] Updated translations via Crowdin 2022-06-18 09:10:16 +00:00
zeripath
5d653cc10d
Improve action table indices (#19472) 2022-06-18 04:46:50 -04:00
zeripath
dd1ed35f75
Add dbconsistency checks for Stopwatches (#20010)
It appears possible that stopwatches can become orphaned or have been orphaned in
the past.

This PR adds Orphan checks for Stopwatches.

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-06-18 11:31:00 +08:00
Mohamed Sekour
fd0d481de8
fix push mirrors URL are no longer displayed on the UI (#20011)
* fix push mirrors URL are no longer displayed on the UI

Signed-off-by: Mohamed Sekour <mohamed.sekour@exfo.com>

* Update modules/templates/helper.go

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-06-18 11:30:26 +08:00
zeripath
8eefe2af45
Empty log queue on flush and close (#19994)
* Empty log queue on flush and close

It is possible for log events to remain in the buffer off the multichannelledlog
and thus not be logged despite close or flush.

This PR simply adds a function to empty the queue before closing or flushing.
(Except when the logger is paused.)

Reference #19982

Signed-off-by: Andrew Thornton <art27@cantab.net>

* and do similar for ChannelledLog

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-06-18 10:33:13 +08:00
zeripath
46e50bcbfc [skip ci] Updated translations via Crowdin 2022-06-18 00:10:15 +00:00
zeripath
ae446b13f9
Stop spurious APIFormat stopwatches logs (#20008)
If there are dangling stopwatches with missing issues there will be repeated
logging of Unable to APIFormat stopwatches. These are unhelpful and instead
we should only log if the error is not an issue not exist error.

And we should also prevent an error on missing issue in GetActiveStopwatch too

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-06-17 22:47:15 +01:00
zeripath
5d80feb5a6
Fix CountOrphanedLabels in orphan check (#20009)
gitea doctor --run check-db-consistency is currently broken due to an incorrect
and old use of Count() with a string.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-06-17 22:42:51 +01:00
zeripath
1e9ad8eb21
Write Commit-Graphs in RepositoryDumper (#20004)
When migrating git repositories we should ensure that the commit-graph is written.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
2022-06-17 21:19:21 +01:00
zeripath
ea9997a9dd
Add fetch.writeCommitGraph to gitconfig (#20006)
Add fetch.writeCommitGraph to gitconfig to ensure that a commit-graph will be written
on git fetch calls.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-06-17 21:18:35 +01:00
47011db720
Add ed25519 to httpsig algorithms 2022-06-17 13:43:26 -05:00
Lunny Xiao
27ba86d283
move agit dependcy (#19998) 2022-06-17 20:17:12 +02:00
7446583a0d
go mod tidy 2022-06-17 11:38:56 -05:00
8e6f3fbf46
Update go-ap to fix empty liked collection and removed unneeded HTTP headers 2022-06-17 11:10:51 -05:00
wxiaoguang
719eb4a879
Fix a JS error in initRepoCommitLastCommitLoader's entryMap (#19996) 2022-06-17 17:44:35 +08:00
singuliere
a036507204
gitconfig: set safe.directory = * (#19870)
Allow git push to work when networked file systems with mixed
ownership are used with Gitea docker images >= 1.16.6 or Gitea
binaries running alongside git versions published after 04/2022.

There are circumstances independent of Gitea (networked file systems
with various permission systems) by which the git repositories managed
by Gitea may have mixed owners. It is not a behavior that Gitea have
control over nor is it a problem as long as the permissions for Gitea to
operate are correct. Gitea instances have been operating under these
conditions for a number of years.

It is detected as a potential security risk ( see
GHSA-vw2c-22j4-2fh2
) by the most recent git versions. However, Gitea always runs git
commands with a current directory matching the repository on
which it operates. That makes Gitea immune from this security problem
and it is safe to ignore the mixed owner permission check.

This gitconfig modification is done on a file dedicated to the user
exclusively used by Gitea.

Fixes: #19455

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2022-06-17 06:49:38 +01:00
Lunny Xiao
bdde56c95c
Fix Readme render bug (#19992)
Fix #19988 

Co-authored-by: zeripath <art27@cantab.net>
2022-06-17 06:48:10 +01:00
Lunny Xiao
1e05adfc3e
Delete duplicated update btn on pull request view page (#19993)
Fix #19987
2022-06-17 05:52:06 +01:00
oGi4i
9068c784c8
Use DisplayName() instead of FullName in Oauth provider (#19991)
Use DisplayName() in Oauth as this provides a fallback if FullName is not set.

Closes #19382
2022-06-16 23:29:54 +01:00
6543
7e1784fd3f
Merge branch 'main' into feature-activitypub 2022-06-16 22:09:41 +02:00
a1012112796
e3e06d13af
fix permission check for delete tag (#19985)
fix #19970

by the way, fix some error response about protected tags.

Signed-off-by: a1012112796 <1012112796@qq.com>
2022-06-16 22:03:03 +02:00
7a214dd212
More code cleanup 2022-06-16 14:18:30 -05:00
b35490c53d
Merge remote-tracking branch 'upstream/main' into feature-activitypub 2022-06-16 11:42:37 -05:00
c118dacde7
Move getting the RFC 2616 time to a separate function 2022-06-16 11:17:05 -05:00
2a013b8fe4
make generate-swagger
For some reason I didn't realize that /templates/swagger/v1_json.tmpl was machine-generated by make generate-swagger... I've been editing it by hand for three months! 🤦
2022-06-16 11:11:57 -05:00
wxiaoguang
89b0aac374 [skip ci] Updated translations via Crowdin 2022-06-16 16:10:29 +00:00
3a8b8408b4
Fix failing ActivityPubMissingPerson test
We now use ctx.ContextUser so the message printed out when a user does not exist is slightly different
2022-06-16 11:08:24 -05:00
6602fd136e
Add more better comments 2022-06-16 11:03:53 -05:00
0c49fea641
Don't multiply Federation.MaxSize by 1<<20 twice 2022-06-16 11:00:24 -05:00
6336ba2e83
Add better comments 2022-06-16 10:59:36 -05:00
db13e1d6a1
Add a warning about changing settings that can break federation 2022-06-16 10:53:18 -05:00
wxiaoguang
157b405753
Remove legacy git code (ver < 2.0), fine tune markup tests (#19930)
* clean git support for ver < 2.0

* fine tune tests for markup (which requires git module)

* remove unnecessary comments

* try to fix tests

* try test again

* use const for GitVersionRequired instead of var

* try to fix integration test

* Refactor CheckAttributeReader to make a *git.Repository version

* update document for commit signing with Gitea's internal gitconfig

* update document for commit signing with Gitea's internal gitconfig

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-06-16 23:47:44 +08:00