Compare commits

...

510 commits

Author SHA1 Message Date
Cat /dev/Nulo 765c518221 Dockerfile: rename user to _gitea instead of git 2024-03-23 17:43:02 -03:00
Earl Warren 4092c544ca Merge pull request '[SEMVER] 6.0.8+0-gitea-1.21.8' (#2720) from earl-warren/forgejo:wip-v1.21-semver into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2720
2024-03-22 08:32:31 +00:00
Earl Warren 9028d061cc Merge pull request '[gitea] v1.21 cherry-pick' (#2716) from earl-warren/forgejo:wip-v1.21-gitea-cherry-pick into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2716
2024-03-22 07:41:50 +00:00
Earl Warren 586b5c6459
[SEMVER] 6.0.8+0-gitea-1.21.8 2024-03-22 08:00:05 +01:00
Earl Warren df98757424
Fix invalid link of the commit status when ref is tag (#29752) (#29908) (step 2)
UpdateRepositoryUnits was moved to repo_service by a refactor that was
not cherry-picked. (Fix schedule tasks bugs (#28691) (#28780))
2024-03-21 17:28:36 +01:00
yp05327 2051763969
Fix invalid link of the commit status when ref is tag (#29752) (#29908)
Backport #29752

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit aae96cc62b6e6642fa1ef3dcacb716d32f5652b9)
2024-03-21 17:09:50 +01:00
Giteabot 120a173e24
Fix PR creation via api between branches of same repo with head field namespaced (#26986) (#29857)
Backport #26986 by @norohind

Fix #20175

Current implementation of API does not allow creating pull requests
between branches of the same
repo when you specify *namespace* (owner of the repo) in `head` field in
http request body.

---------

Co-authored-by: norohind <60548839+norohind@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 408c92938ba6f38eea1210cae2c485e1f19d4982)
2024-03-21 17:09:50 +01:00
Giteabot ee87a652e9
Editor error message misleading due to re-used key. (#29859) (#29876)
Backport #29859 by @buckybytes

The error message:

`editor.file_changed_while_editing = The file contents have changed
since you started editing. <a target="_blank" rel="noopener noreferrer"
href="%s">Click here</a> to see them or <strong>Commit Changes
again</strong> to overwrite them.`

Is re-used in inappropriate contexts. The link in the key goes to a 404
when the key is used in a situation where the file contents have not
changed.

Added two new keys to differentiate commit id mismatch and push out of
date conditions.

Co-authored-by: buckybytes <158571971+buckybytes@users.noreply.github.com>
(cherry picked from commit 00ea9af8e118790a186b4cf78a0ce85ce986bf1d)
2024-03-21 17:09:50 +01:00
Giteabot c060cf0e54
Fix user id column case (#29863) (#29867)
Backport #29863 by @lng2020

Sometimes the column name is case-sensitive and it may cause 500.

Co-authored-by: Nanguan Lin <nanguanlin6@gmail.com>
(cherry picked from commit c044510ca8bed67cb2d50ba741b3d0b520aa3c43)
2024-03-21 17:09:50 +01:00
Giteabot 07da773418
fix double border and border-radius on empty action steps (#29845) (#29850)
Backport #29845 by @silverwind

Before, double border-bottom and incorrect border-radius:

<img width="914" alt="Screenshot 2024-03-16 at 14 46 31"
src="https://github.com/go-gitea/gitea/assets/115237/6ea63c42-754c-420c-a0f5-c889a8507d9f">

After, both fixed:

<img width="917" alt="Screenshot 2024-03-16 at 14 45 59"
src="https://github.com/go-gitea/gitea/assets/115237/9d3f2dba-6b22-441d-8e99-5809d5f1f1c0">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 8242c3c88c43bec4905bd689dbb05f7f64e2c3d7)
2024-03-21 17:09:50 +01:00
6543 a876ac2c79
Make meilisearch do exact search for issues (#29740 & #29671) (#29846)
Backport https://github.com/go-gitea/gitea/pull/29740 (based on #29671
...)

(cherry picked from commit 0cbbcf20e3f83413a88fe3d436451d707639fe55)
2024-03-21 17:09:50 +01:00
Giteabot 655302fc96
Fix for attribute not pointing to the ID of the color picker (#29813) (#29815)
Backport #29813 by @yardenshoham

It didn't include the word picker.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 47dc4598a305ea1e6017803b95c7c60d0be64784)
2024-03-21 17:09:50 +01:00
Earl Warren 510b2ff70e
Update Chroma to v2.13.0 (#29732) (#29805) (step 2)
go mod tidy was missing but compensated in Gitea by another commit merged
afterwards. It is skipped in Forgejo, reason why this is necessary.
2024-03-21 17:09:00 +01:00
Lunny Xiao 1952c3a0a5
Update Chroma to v2.13.0 (#29732) (#29805)
Backport #29732

This adds new lexers and includes some fixes. See
https://github.com/alecthomas/chroma/releases/tag/v2.13.0 for the full
changelog.

Co-authored-by: JakobDev <jakobdev@gmx.de>
(cherry picked from commit 31ab839a6587ea93edfec4d0147282c689d3e312)
2024-03-21 09:38:01 +01:00
Giteabot 6fcea1208d
Fix Safari spinner rendering (#29801) (#29802)
Backport #29801 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/29041
Fixes: https://github.com/go-gitea/gitea/pull/29713

Any of the `width: *-content` properties seem to workaround this Webkit
bug, this one seemed most suitable.

Before:
<img width="184" alt="Screenshot 2024-03-14 at 22 29 58"
src="https://github.com/go-gitea/gitea/assets/115237/6effc5f0-bc64-4752-be74-9c43b3974407">

After:
<img width="177" alt="Screenshot 2024-03-14 at 22 30 30"
src="https://github.com/go-gitea/gitea/assets/115237/5de244d7-6b46-428e-957c-4b10f53e2441">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit df23ec0f8b490bee49dc0e7944b529f3ede35301)
2024-03-21 09:37:30 +01:00
Giteabot 0dcc9b8466
Fix missing translation on milestons (#29785) (#29789)
Backport #29785 by @lunny

Caused by #26569
Fix #29778

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit e03cf66e8b537430d24665b647b5af5716d182ee)
2024-03-21 09:36:50 +01:00
wxiaoguang b68fa8ee09
Fix incorrect package link method calls in templates (#29580) (#29764)
Backport #29580
Fix #29562
Fix #29762
Follow  #29531

(cherry picked from commit bb2640c485071088dd91e47fb510c44e028624fa)
2024-03-21 09:29:05 +01:00
Giteabot 73498c1622
Suppress error from monaco-editor (#29684) (#29758)
Backport #29684 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/29414

I see no way for us to catch this error, so downgrade it until
https://github.com/microsoft/monaco-editor/issues/4325 is fixed, which
will likely take a few weeks to propagate up from vscode.

The entries in `updates.config.js` will make
[`updates`](https://github.com/silverwind/updates) not upgrade these
anymore and I think it's good documentation as well to have the reasons
why we don't upgrade these dependencies.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 462ae88fc2e6295a9376855627ad2a824a6c8f1d)
2024-03-21 09:28:37 +01:00
Giteabot fefe6062b0
Improve CSV rendering (#29638) (#29744)
Backport #29638 by @silverwind

Before:

<img width="1332" alt="Screenshot 2024-03-06 at 21 42 17"
src="https://github.com/go-gitea/gitea/assets/115237/0ea07eee-31f8-4783-bd56-37bd8396f00d">

After:
<img width="1336" alt="Screenshot 2024-03-06 at 21 41 58"
src="https://github.com/go-gitea/gitea/assets/115237/eb7f9cc9-587f-4e3b-92bd-cc67ca639963">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 12b429c0d151178f1dcdb349dc297fdc9b773364)
2024-03-21 09:25:32 +01:00
Lunny Xiao 02ac89c01d
Use Get but not Post to get actions artifacts (#29734) (#29737)
backport #29734

(cherry picked from commit 8c31456a879797e7247d2cbf65b53fd16939c91d)
2024-03-21 09:25:14 +01:00
Giteabot 4543d70216
Fix inconsistent rendering of block mathematical expressions (#29677) (#29711)
Backport #29677 by @yp05327

Fix #28735

GitHub render `\```math\``` ` as a block now.
Add `display` class will render it as a block.

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/2a1c20c7-438e-4ab1-8c66-cf91c8343087)

![image](https://github.com/go-gitea/gitea/assets/18380374/b81b8a93-8bca-46a5-b7db-e0d2f53e1342)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 4bfc43ef8de7c5e42f9502aa23075ee5fe04b26b)
2024-03-21 09:24:31 +01:00
Gusted 5fa3381787 Merge pull request '[BUG] Fix manual merge button' (#2697) from gusted/forgejo-bp-2696 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2697
Reviewed-by: Otto <otto@codeberg.org>
2024-03-19 19:26:58 +00:00
Gusted c70719c59c
[BUG] Fix manual merge button
- Backport of #2696
- Add `form-fetch-action` to indicate that this form POST to an link
that returns JSON and thus should be handled by Javascript code.
- Found by @fnetx
- Regression of https://codeberg.org/forgejo/forgejo/pulls/1793

(cherry picked from commit 9551c1a6f8)
2024-03-19 19:43:58 +01:00
oliverpool 0774e04d6b Merge pull request '[GITEA] Enable mocked HTTP responses for GitLab migration test (backport to v1.21)' (#2667) from wetneb/forgejo:windows-cloning-v1.21 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2667
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-15 19:19:27 +00:00
Gusted b06e953395 Merge pull request '[BUG] Use correct head commit for CODEOWNER' (#2672) from gusted/forgejo-bp-2658 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2672
Reviewed-by: Otto <otto@codeberg.org>
2024-03-15 15:36:38 +00:00
Gusted 02c9304247 Merge pull request '[BUG] Display error message if doer is unable to fork' (#2671) from gusted/forgejo-bp-2649 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2671
Reviewed-by: Otto <otto@codeberg.org>
2024-03-15 15:05:53 +00:00
Gusted d1cebb0e88
[BUG] Use correct head commit for CODEOWNER
Backport of #2658

Regression of #2507, which switched the HEAD from `pr.GetGitRefName()`
to `pr.HeadCommitID` but it had to be `prInfo.HeadCommitID`. Resolves #2656
I was able to reproduce this locally with _some_ pull requests, haven't
been able to get a reproducer trough integration testing.

(cherry picked from commit a4cc37b46a)
2024-03-15 15:43:37 +01:00
Shiny Nematoda 730cc56080
[BUG] Display error message if doer is unable to fork
- Backport of #2649
- Resolves #2504

(cherry picked from commit 773048afa1)
2024-03-15 15:14:28 +01:00
Antonin Delpeuch f609d00e1b [GITEA] Enable mocked HTTP responses for GitLab migration test 2024-03-15 12:58:50 +01:00
Earl Warren bd71bdda26 Merge pull request '[gitea] v1.21 cherry-pick' (#2621) from earl-warren/forgejo:wip-v1.21-gitea-cherry-pick into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2621
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-03-12 23:17:05 +00:00
oliverpool d9418651af [BUG 1.21] prevent error 500 on /user/settings/security when SignedUser has a linked account from a deactivated authentication source (#2626)
This should fix #2266.

This has apparently be fixed in `main` https://github.com/go-gitea/gitea/pull/27798 (but quite a big PR, which was not backported). I should likely push the test to the main branch as well.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2626
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2024-03-11 14:10:51 +00:00
silverwind 4f9b761a06
Don't show AbortErrors on logout (#29639) (#29667)
Backport https://github.com/go-gitea/gitea/pull/29639.

When logging out of Gitea, a error toast can be seen for a split second.
I don't know why or how it happens but I found it it's an `AbortError`
(related to
[AbortController#abort](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)),
so let's hide it.

(cherry picked from commit 346b66230519955fc831e75a9cc6175621d63b02)
2024-03-10 18:45:59 +07:00
Giteabot ac05e205ba
Use more specific selector for name links (#29679) (#29681)
Backport #29679 by @silverwind

Followup https://github.com/go-gitea/gitea/pull/29305. As per discussion
in https://github.com/go-gitea/gitea/pull/29666#discussion_r1517506422,
make this selector only search in the current `.markup` document, as
there can be multiples displayed at the same time.

@DanielMatiasCarvalho maybe you can review.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 25b0c99a41e9024d439deaa55be7ba87f6cd557f)
2024-03-10 18:45:59 +07:00
Giteabot 03caefbb02
Fix user-defined markup links targets (#29305) (#29666)
Backport #29305 by @DanielMatiasCarvalho

This seeks to fix the bug reported on issue #29196.

Cause:
ID's with custom characters (- , _ , etc.), were not linking correctly
in the Markdown file when rendered in the browser because the ID in the
respective destinies would be different than the one in anchor, while
for IDs with only letters, the ID would be the same.

Fix:
It was suggested that to fix this bug, it should more or less like
GitHub does it. While in gitea the anchors would be put in HTML like
this:
```
<p dir="auto"><a href="#user-content-_toc152597800" rel="nofollow">Review</a></p>
<p dir="auto"><a href="#user-content-_toc152597802" rel="nofollow">Staging</a></p>
<p dir="auto"><a href="#user-content-_toc152597803" rel="nofollow">Development</a></p>
<p dir="auto"><a href="#user-content-_toc152597828" rel="nofollow">Testing</a></p>
<p dir="auto"><a href="#user-content-_toc152597829" rel="nofollow">Unit-tests</a></p>

```
In GitHub, the same anchor's href properties would be the same without
"user-content-" trailing behind.

So my code made sure to change those anchors, so it would not include
"user-content-" and then add respective Event Listeners so it would
scroll into the supposed places.

Fixes: #29196

Co-authored-by: DC <106393991+DanielMatiasCarvalho@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit bfc7c8a5985825ec28f3feefe1d050ec52525097)
2024-03-10 18:45:59 +07:00
Giteabot e811f3b185
Fix commit_status problem when testing (#29672) (#29675)
Backport #29672 by @charles7668

Close #29661

fix #29656

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
(cherry picked from commit 1f897637441a9a5c43e01b84e374d836d9260a00)
2024-03-10 18:45:59 +07:00
Lunny Xiao 66061d2828
Fix 500 when deleting account with incorrect password or unsupported login type (#29579) (#29656)
Fix #26210
Backport #29579

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit a129c0c06c91e4994244138687be135dddd4c00d)
2024-03-10 18:45:59 +07:00
Giteabot e151e04673
Fix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize (#29653) (#29663)
Backport #29653 by @yp05327

Fix #29506

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 6651d2d87aa4af96bf2c992e3ecae6a290d07496)
2024-03-10 18:45:59 +07:00
Giteabot bd0978ce72
Fixing the issue when status check per rule matches multiple actions (#29631) (#29655)
Backport #29631 by @charles7668

Close #29628
rule
```
Test / Build*
Test / Build *
Test / Build 2*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)
rule2
```
Test / Build*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)

rule3
```
Test / Build*
Test / Build 1*
NotExist*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/f6a5e832-2e1b-4049-915b-45bec5ef070c)

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 76b6754c3a42e6f1d675fe9f9d66a65954cb85d1)
2024-03-10 18:45:59 +07:00
silverwind 43df4755a3
Update Twitter Logo (#29621) (#29633)
Backport https://github.com/go-gitea/gitea/pull/29621
<img width="430" alt="image"

src="https://github.com/go-gitea/gitea/assets/115237/9cf7b0a3-406b-4dd6-ab3d-d31a96b9335a">

(cherry picked from commit b6a2b9594af06698b29ea4c649b85e40c7f4b82d)
2024-03-10 18:45:59 +07:00
Giteabot 9230e8d035
Avoid issue info panic (#29625) (#29632)
Backport #29625 by wxiaoguang

Fix #29624

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 6ee58a0ac20fa1e7d328ede71f3df4c86fc41ab3)
2024-03-10 18:45:59 +07:00
wxiaoguang 7a32382108
Avoid unexpected panic in graceful manager (#29629) (#29630)
Backport #29629

(cherry picked from commit 2f1eb619bc19a9b172062ba17789356bbdaa259d)
2024-03-10 18:45:59 +07:00
Giteabot 9f7a51d3d7
Fix wrong line number in code search result (#29260) (#29623)
Backport #29260 by @yp05327

Fix #29136

Before:
The result is a table and all line numbers are all in one row.

![image](https://github.com/go-gitea/gitea/assets/18380374/7a18b354-e257-4f57-a5ca-f6d37378edf6)

![image](https://github.com/go-gitea/gitea/assets/18380374/98416e11-89b5-4b4f-920b-91bcf041a87f)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/f189e436-9046-4431-926a-cd0deb58e8f1)

![image](https://github.com/go-gitea/gitea/assets/18380374/07d213ed-2401-4b7f-b951-5df7dc776af4)

~~Updated:~~
~~added `active` class to the target line.~~

![image](https://github.com/go-gitea/gitea/assets/18380374/0b274e48-048a-4c66-ba95-df515212ec08)

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 9db426ad8c7122633fa3e31a427fd1e65ddad334)
2024-03-10 18:45:59 +07:00
Giteabot b76f370a3f
Fix 500 when pushing release to an empty repo (#29554) (#29564)
Backport #29554 by @lng2020

As title.
The former code directly used `ctx.Repo.GitRepo`, causing 500.

22b4f0c09f/routers/api/v1/repo/release.go (L241)

Co-authored-by: Nanguan Lin <nanguanlin6@gmail.com>
(cherry picked from commit b84303ef6e73e2436f0c4c3985020be6bbbb5d1e)
2024-03-10 18:45:59 +07:00
wxiaoguang ecc0107809
Only use supported sort order for "explore/users" page (#29430) (#29443)
Backport #29430

Thanks to inferenceus : some sort orders on the "explore/users" page
could list users by their lastlogintime/updatetime.

It leaks user's activity unintentionally. This PR makes that page only
use "supported" sort orders.

Removing the "sort orders" could also be a good solution, while IMO at
the moment keeping the "create time" and "name" orders is also fine, in
case some users would like to find a target user in the search result,
the "sort order" might help.

(cherry picked from commit 2b059f493e46b8b0fb52492623e36a8375cb5fbb)
2024-03-10 18:45:59 +07:00
Giteabot 19c5642971
Fix incorrect cookie path for AppSubURL (#29534) (#29552)
Backport #29534
Regression of #24107

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 5ca2971ccbc8769f7e6ee41c125db47f818e7599)
2024-03-10 18:45:59 +07:00
Giteabot 446d7bd7a7
Fix incorrect redirection when creating a PR fails (#29537) (#29543)
Backport #29537 by wxiaoguang

This is only a quick fix to make it easier to backport.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 971eab18fa0b29312105df739fba443cf9e84d50)
2024-03-10 18:45:59 +07:00
Giteabot 52f52f60f1
Fix queue worker incorrectly stopped when there are still more items in the queue (#29532) (#29546)
Backport #29532

Without `case <-t.C`, the workers would stop incorrectly, the test won't
pass. For the worse case, there might be only one running worker
processing the queue items for long time because other workers are
stopped. The root cause is related to the logic of doDispatchBatchToWorker.
It isn't a serious problem at the moment, so keep it as-is.

(cherry picked from commit 86cd94cba6d63c84528f6f8d52b1ec22b44ac2f8)
2024-03-10 18:45:59 +07:00
Giteabot 1a65ecb867
Fix incorrect relative/absolute URL usages (#29531) (#29547)
Backport #29531 by wxiaoguang

Add two "HTMLURL" methods for PackageDescriptor.
And rename "FullWebLink" to "VersionWebLink"

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 8723389028bcb5e96359fca61efd7d6da0d6af99)
2024-03-10 18:45:59 +07:00
Giteabot 22419d9f8d
Fix incorrect subpath in links (#29535) (#29541)
Backport #29535 by wxiaoguang

* `$referenceUrl`: it is constructed by "Issue.Link", which already has
the "AppSubURL"
* `window.location.href`: AppSubURL could be empty string, so it needs
the trailing slash

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 401cc394d52c6126d3cbca1e1367c4e4da5110f9)
2024-03-10 18:45:59 +07:00
Giteabot e6441a18d2
Fix issue link does not support quotes (#29484) (#29487) (#29536)
Backport #29487 by @charles7668

Close #29484

![圖片](https://github.com/go-gitea/gitea/assets/30816317/b27e6e16-67e0-469c-8e04-30180c585890)

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
(cherry picked from commit 3a8877c058fd8583f28711750cf26716526200c4)
2024-03-10 18:45:59 +07:00
Giteabot 5099d3c747
Set pre-step status to skipped if job is skipped (#29489) (#29523)
Backport #29489 by @sillyguodong

close #27496
1. Set pre-step (Set up job) status to `skipped` if job is skipped.
2. Apart from pre-step, the other steps should also be set to `skipped`.
The status of other steps are reported from the runner side. This will
be completed by this PR: https://gitea.com/gitea/act_runner/pulls/500

before:

![image](https://github.com/go-gitea/gitea/assets/33891828/4bac2ba9-66de-4679-b7ed-fbae459c0c54)

after:

![image](https://github.com/go-gitea/gitea/assets/33891828/ead4871a-4e0f-4bb1-9fb4-37f4fdb78dfc)

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
(cherry picked from commit 8d085587831d1357ae80046fe0627dbcc8657a79)
2024-03-10 18:45:58 +07:00
Giteabot 2662e74883
Improve contrast on blame timestamp, fix double border (#29482) (#29485)
Backport #29482 by @silverwind

Before, double border on top, bad contrast on dark:
<img width="155" alt="Screenshot 2024-02-29 at 02 06 17"
src="https://github.com/go-gitea/gitea/assets/115237/fc0f1e08-a5ce-47ed-9eb6-135eed5a1abb">
<img width="126" alt="Screenshot 2024-02-29 at 02 07 28"
src="https://github.com/go-gitea/gitea/assets/115237/38ae8483-8d9b-484c-8909-d4466131ea16">

After, no double border on top, good contrast:
<img width="154" alt="Screenshot 2024-02-29 at 02 20 20"
src="https://github.com/go-gitea/gitea/assets/115237/ad91282b-e9f5-4f41-8f5e-6ba28db3beac">
<img width="147" alt="Screenshot 2024-02-29 at 02 20 38"
src="https://github.com/go-gitea/gitea/assets/115237/7ee2ec92-e72a-4981-aec3-98fc8e579bae">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 65b9ffe3c081b54234306b2d6231569bff3ce02d)
2024-03-10 18:45:58 +07:00
Giteabot 581261efb1
Fix/Improve processWindowErrorEvent (#29407) (#29480)
Backport #29407 by @silverwind

- `e.error` can be undefined in some cases which would raise an error
inside this error handler, fixed that.
- The displayed message mentions looking into the console, but in my
case of error from `ResizeObserver` there was nothing there, so add this
logging. I think this logging was once there but got lost during
refactoring.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 9abba8c11a2eddfa8da25946fdd43be8d0c53689)
2024-03-10 18:09:59 +07:00
Giteabot 8babbe7ccf
Fix counter display number incorrectly displayed on the page (#29448) (#29478)
Backport #29448 by @charles7668

issue : #28239

The counter number script uses the 'checkbox' attribute to determine
whether an item is selected or not.

However, the input event only increments the counter value, and when
more items are displayed, it does not update all previously loaded
items.

As a result, the display becomes incorrect because it triggers the
update counter script, but checkboxes that are selected without the
'checked' attribute are not counted

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
(cherry picked from commit 5477728282de19b1638691b88449b1933ed5a4d8)
2024-03-10 18:09:32 +07:00
Giteabot 0b287c4d4c
Fix URL calculation in clone input box (#29470) (#29473)
Backport #29470 by @silverwind

Ported the function as-is and added comments so we don't forget about
this in the future.

Fixes: https://github.com/go-gitea/gitea/issues/29462

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 222f93822eb4d03f5001ef665377a115bc27ccb6)
2024-03-10 18:08:36 +07:00
Giteabot 813577aee1
The job should always run when if is always() (#29464) (#29469)
Backport #29464 by @Zettat123

Fix #27906

According to GitHub's
[documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds),
a job should always run when its `if` is `always()`

> If you would like a job to run even if a job it is dependent on did
not succeed, use the `always()` conditional expression in
`jobs.<job_id>.if`.

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit eabcfd3f7d9321fcf03e52977c178a96627a68da)
2024-03-10 18:08:15 +07:00
Giteabot d97cd15a1b
Fix missed return (#29450) (#29453)
Backport #29450 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 2df38af752c13ca02a899d6a53848c68259d3336)
2024-03-10 18:08:05 +07:00
Lunny Xiao 40c602df9b
Fix template bug (#27581) (#29446)
Fix #29152
Backport #27581

(cherry picked from commit dc48eb070b2e4143739b7ab22bb9e172af90106d)
2024-03-10 18:07:56 +07:00
Giteabot 40318cf9c3
Not trigger all jobs any more, when re-running the first job (#29439) (#29441)
Backport #29439 by @sillyguodong

Previously, it will be treated as "re-run all jobs" when `jobIndex ==
0`. So when you click re-run button on the first job, it triggers all
the jobs actually.

Caused by #26535.

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
(cherry picked from commit 9456deb512db59025cae26d82812ff880c5ea3bc)
2024-03-10 18:06:44 +07:00
Giteabot 47409b2fa0
Ignore empty repo for CreateRepository in action notifier (#29416) (#29424)
Backport #29416 by @yp05327

Fix #29415

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit c758a8afba85fe1847f4d1f5441f6c62b37517ae)
2024-03-10 18:06:30 +07:00
Earl Warren 84449e9288 Merge pull request '[BUG] prevent removing session cookie when redirect_uri query contains ://' (#2606) from oliverpool/forgejo:backport2590 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2606
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-08 15:07:50 +00:00
Earl Warren 4696f4cefd Merge pull request 'Fix /api/v1/{owner}/{repo}/issue_templates' (#2605) from gusted/forgejo-bp-2292 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2605
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-08 15:07:38 +00:00
oliverpool 3877a2332b implement fix 2024-03-07 22:43:38 +01:00
oliverpool 20bc8662b1 [BUG] prevent removing session cookie when redirect_uri query contains :// 2024-03-07 22:41:47 +01:00
Gergely Nagy 969d3f4410
Fix /api/v1/{owner}/{repo}/issue_templates
Backport of #2292

When issue templates were moved into services in
def4956122, the code was also refactored
and simplified. Unfortunately, that simplification broke the
`/api/v1/{owner}/{repo}/issue_templates` route, because it was
previously using a helper function that ignored invalid templates, and
after the refactor, the function it called *always* returned non-nil as
the second return value. This, in turn, results in the aforementioned
end point always returning an internal server error.

This change restores the previous behaviour of ignoring invalid files
returned by `issue.GetTemplatesFromDefaultBranch`, and adds a few test
cases to exercise the endpoint.

Other users of `GetTemplatesFromDefaultBranch` already ignore the second
return value, or handle it correctly, so no changes are necessary there.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit be8d16438a)
2024-03-07 21:50:27 +01:00
Earl Warren 6e877f02ab Merge pull request '[gitea] v1.21 cherry-pick' (#2566) from earl-warren/forgejo:wip-v1.21-gitea-cherry-pick into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2566
2024-03-06 05:50:42 +00:00
Earl Warren 812458206f Merge pull request 'Revert "[CI] pin go v1.21.8 version"' (#2570) from earl-warren/forgejo:wip-v1.21-ci-go-action into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2570
2024-03-06 05:09:16 +00:00
Earl Warren ded6e7a4b2
[SEMVER] 6.0.7+0-gitea-1.21.7 2024-03-06 13:05:29 +08:00
Giteabot 91a2d3ecc4
Add missing space (#29393) (#29399)
Backport #29393 by @KN4CK3R

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 0f35cb5a2a9ad3b1d78f9547148b594adc4bdabf)
2024-03-06 12:20:42 +08:00
Giteabot 40c3a1d2ea
enforce maxlength in frontend (#29389) (#29396)
Backport #29389 by @zokkis

Set maxlength attribute in frontend

to long file-name

![image](https://github.com/go-gitea/gitea/assets/72873130/15111614-55ab-4583-acb2-15c25997601d)

![image](https://github.com/go-gitea/gitea/assets/72873130/4105ddd8-4973-4da8-b3ab-4cfae1b45554)
(same for branch-name and commit-summary)

Co-authored-by: Tim-Niclas Oelschläger <72873130+zokkis@users.noreply.github.com>
(cherry picked from commit 0b3d6c399c88e42e827f422dc4c8458f0d20c613)
2024-03-06 12:20:42 +08:00
Lunny Xiao 2c802fc8f0
Display friendly error message (#29105) (#29363)
Backport #29105

`ctx.Error` only displays the text but `ctx.ServerError` renders the
usual error page.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit a1c0b3a02e54e5fe879dabccb71fba9498b64051)
2024-03-06 12:20:42 +08:00
Giteabot a28d6686fa
Fix validity of the FROM email address not being checked (#29347) (#29360)
Backport #29347 by @carlosfelgueiras

Fixes #27188.
Introduces a check on the installation that tries to parse the FROM
address. If it fails, shows a new error message to the user.

Co-authored-by: Carlos Felgueiras <carlosfelgueiras@tecnico.ulisboa.pt>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 35db5a373babd9af157fd63eeb20d6da53320b73)
2024-03-06 12:20:42 +08:00
Lunny Xiao e4d3067138
Fix project counter in organization/individual profile (#28068) (#29361)
Fix #28052
Backport #28068
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/5f299983-4b38-4d68-ac0e-4be3c62c0558)

![image](https://github.com/go-gitea/gitea/assets/18380374/f0e12afd-483b-4882-80e9-0261beb3fe0c)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/47cccb7b-bb35-4a7d-9c5b-83133be0323a)

![image](https://github.com/go-gitea/gitea/assets/18380374/77825c0c-4bf2-4762-83a2-1a5a173cc22d)

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 5043ad54c7a0d1dc6bf5f1caf21b4646ec9344d3)
2024-03-06 12:20:42 +08:00
Giteabot 8e2c991b35
Fix tarball/zipball download bug (#29342) (#29352)
Backport #29342 by @Zettat123

Fix #29249

~~Use the `/repos/{owner}/{repo}/archive/{archive}` API to download.~~

Apply #26430 to archive download URLs.

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 829b807a91f9895e3f4b262f688a8d0d9a44caf6)
2024-03-06 12:20:42 +08:00
Giteabot 9da608abad
Don't show third-party JS errors in production builds (#29303) (#29333)
Backport #29303 by @silverwind

So we don't get issues like
https://github.com/go-gitea/gitea/issues/29080 and
https://github.com/go-gitea/gitea/issues/29273 any more. Only active in
[production
builds](https://webpack.js.org/guides/production/#specify-the-mode), in
non-production the errors will still show.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 6ca8cb590d510c98610031675e0a316f95efaf61)
2024-03-06 12:20:42 +08:00
Giteabot c4ac72e6a0
Only log error when tag sync fails (#29295) (#29327)
Backport #29295 by @lunny

Fix #28843

This PR will bypass the pushUpdateTag to database failure when
syncAllTags. An error log will be recorded.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit b78f5fc60f510a58d58535af77c5b424a8b5a660)
2024-03-06 12:20:42 +08:00
Lunny Xiao 790a27f38a
Fix SSPI user creation (#28948) (#29323)
Fixes #28945
Backport #28948

Setting the avatar is wrong and creating a random password is equal to
leave it empty.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 7ea2ffaf166780b7786291f7ff022e3f5b49e8c2)
2024-03-06 12:20:42 +08:00
Earl Warren b837bd81d0
Revert "[CI] pin go v1.21.8 version"
This reverts commit e3698d8662.
2024-03-06 12:18:06 +08:00
Earl Warren 2a2b51c5f7 Merge pull request '[CI] pin go v1.21.8 version' (#2568) from earl-warren/forgejo:wip-v1.21-ci-go-action into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2568
2024-03-06 04:17:23 +00:00
techknowlogick e7448699f6
bump protobuf module (#29617)
(cherry picked from commit 06039bf0b7ec4dffe74ae323b8bbbbedec69d0c8)

Conflicts:
	go.mod
	go.sum
	trivial context conflict
2024-03-06 11:53:02 +08:00
Earl Warren e3698d8662
[CI] pin go v1.21.8 version
Because setup-go fails to pick it up.

Refs: https://github.com/actions/setup-go/issues/462
(cherry picked from commit d7aaefcea9d38ca50a96f34ff42efe954bce4acd)

Conflicts:
	.forgejo/workflows/build-release.yml
	.forgejo/workflows/cascade-setup-end-to-end.yml
	.forgejo/workflows/e2e.yml
	.forgejo/workflows/testing.yml
	trivial context conflict
2024-03-06 11:53:02 +08:00
Gusted 9196f0d618 Merge pull request '[BUG] Ensure HasIssueContentHistory takes into account comment_id' (#2535) from gusted/forgejo-bp-2518 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2535
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-01 15:19:38 +00:00
Gusted 8fb027fea5
[BUG] Ensure HasIssueContentHistory takes into account comment_id
- Backport of #2518
- The content history table contains the content history of issues and
comments. For issues they are saved with an comment id of zero.
- If you want to check if the issue has an content history, it should
take into account that SQL has `comment_id = 0`, as it otherwise could
return incorrect results when for example the issue already has an
comment that has an content history.
- Fix the code of `HasIssueContentHistory` to take this into account, it
relied on XORM to generate the SQL from the non-default values of the
struct, this wouldn't generate the `comment_id = 0` SQL as `0` is the
default value of an integer.
- Remove an unncessary log (it's not the responsibility of `models`
code to do logging).
- Adds unit test.
- Resolves #2513

(cherry picked from commit 331fa44956)
2024-03-01 15:48:42 +01:00
Gusted 5d5059f42c Merge pull request '[BUG] Correct changed files for codeowners' (#2519) from gusted/forgejo-bp-2507 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2519
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-28 23:18:08 +00:00
Gusted 9b70caf798
[BUG] Correct changed files for codeowners
- Backport of #2507
- The CODEOWNER feature relies on the changed files to determine which
reviewers should be added according to the `CODEOWNER` file.
- The current approach was to 'diff' between the base and head branch,
which seems logical but fail in practice when the pull request is out of
date with the base branch. Therefore it should instead diff between the
head branch and the merge base of the head and base branch, so only the
actual affected files by the pull requests are used, the same approach
is used by the diff of an unmerged pull request.
- Add integration testing (for the feature as well).
- Resolves #2458

(cherry picked from commit fb2795b5bb)
2024-02-28 20:13:20 +01:00
Earl Warren ab67eb7d8a Merge pull request '[BUG] Remember topic only in repo search' (#2508) from gusted/forgejo-bp-2489 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2508
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-28 10:20:12 +00:00
Gusted 9955e38fa2
[BUG] Remember topic only in repo search
- Backport of #2489
- If the user is searching repositories with an specific topic, adding
any other filter option, such as showing unrelevant repositories or
using another sort Forgejo should remember that 'topic only' was set.
- Adds integration test.
- Resolves #2461

(cherry picked from commit b4360d504c)
2024-02-27 23:37:26 +01:00
Gusted da9473cd4d Merge pull request '[BUG] Log FindRenamedBranch error' (#2468) from gusted/forgejo-fix-error into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2468
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-25 15:13:28 +00:00
Gusted 255b60931f
[BUG] Log FindRenamedBranch error
- Fix error string to add an `%v` verb to log the error correctly.
2024-02-25 15:40:18 +01:00
Earl Warren 031822b8fc Merge pull request '[SECURITY] Fix XSS vulnerabilities' (#2434) from earl-warren/forgejo:wip-v1.21-xss into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2434
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-02-22 15:03:20 +00:00
Gusted d3de80b9cc
[SECURITY] Test XSS in dismissed review
It's possible for reviews to not be assiocated with users, when they
were migrated from another forge instance. In the migration code,
there's no sanitization check for author names, so they could contain
HTML tags and thus needs to be properely escaped.

(cherry picked from commit ca798e4cc2)
2024-02-22 15:35:04 +01:00
Gusted fe2df46d05
[SECURITY] Fix XSS in dismissed review
- It's possible for reviews to not be assiocated with users, when they
were migrated from another forge instance. In the migration code,
there's no sanitization check for author names, so they could contain
HTML tags and thus needs to be properely escaped.
- Pass `$reviewerName` trough `Escape`.
2024-02-22 15:04:36 +01:00
Gusted 92dae3a387
[SECURITY] Test XSS in wiki last commit information
On the wiki and revisions page, information is shown about the last
commit that modified that wiki page. This includes the time it was last
edited and by whom. Verify it is sanitized.

(cherry picked from commit 565e331238)
2024-02-22 15:04:11 +01:00
Earl Warren 5048478147 Merge pull request '[gitea] v1.21 cherry-pick' (#2430) from earl-warren/forgejo:wip-v1.21-gitea-cherry-pick into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2430
2024-02-22 13:00:38 +00:00
Zettat123 9a63c6f39a
Fix error display when merging PRs (#29288) (#29309)
Backport #29288
Partially fix #29071, regression of Modernize merge button #28140

Fix some missing `Redirect` -> `JSONRedirect`.

Thanks @yp05327 for the help in
https://github.com/go-gitea/gitea/issues/29071#issuecomment-1931261075

(cherry picked from commit dcb9c38568dc4e9502fc416de237cce0eac41cba)
2024-02-22 13:10:12 +01:00
Gusted d24c37e132
[SECURITY] Fix XSS in wiki last commit information
- On the wiki and revisions page, information is shown about the last
commit that modified that wiki page. This includes the time it was last
edited and by whom. That whole string is not being sanitized (passed
trough `Safe` in the templates), because the last edited bit is
formatted as an HTML element and thus shouldn't be sanitized. The
problem with this is that now `.Author.Name` is not being sanitized.
- This can be exploited, the names of authors and commiters on a Git
commit is user controlled, they can be any value and thus also include
HTML. It's not easy to actually exploit this, as you cannot use the
official git binary to do use, as they actually strip `<` and `>` from
user names (trivia: this behaviour was introduced in the initial commit
of Git). In the integration testing, go-git actually has to generate
this commit as they don't have such restrictions.
- Pass `.Author.Name` trough `Escape` in order to be sanitized.
2024-02-22 13:04:47 +01:00
jolheiser 33af169223
[SECURITY] review(kn4ck3r): more template escapes
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2024-02-22 12:54:34 +01:00
yp05327 47e70bbf0e
Fix gitea-action user avatar broken on edited menu (#29190) (#29307)
Backport #29190

Fix #29178

(cherry picked from commit f80ea95eb538decad4d982ce96f640b18e430393)
2024-02-22 11:07:39 +01:00
wxiaoguang 3a061083d6
Fix missing link on outgoing new release notifications (#29079) (#29300)
Backport #29079

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Co-authored-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit c4a86b20a4ecef749caed4e9e1381c1736cb0309)
2024-02-22 11:07:31 +01:00
wxiaoguang 8a2c4e9ff2
Fix debian InRelease Acquire-By-Hash newline (#29204) (#29299)
Backport #29204

Co-authored-by: Robin Schoonover <robin@cornhooves.org>
(cherry picked from commit f634982d237b38e0634c5997612f50230898247e)
2024-02-22 11:07:28 +01:00
wxiaoguang a1fb6a2346
Always write proc-receive hook for all git versions (#29287) (#29291)
Backport #29287

(cherry picked from commit 9379352db638aa99ee9f4a7d2755966f3d866541)
2024-02-22 11:07:23 +01:00
Zettat123 c49dd9de9b
Do not show delete button when time tracker is disabled (#29257) (#29279)
Backport #29257
Fix #29233

The delete button of time logs won't be shown when the time tracker is
disabled.

![image](https://github.com/go-gitea/gitea/assets/15528715/5cc4e0c9-d2f9-4b8f-a2f5-fe202b94c191)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit e940443b276fa4f30633902f025fd2adad1b22de)
2024-02-22 11:07:20 +01:00
Earl Warren 2c567ea193 Merge pull request '[BUG] Initialize Git for hook regeneration' (#2421) from gusted/forgejo-bp-2416 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2421
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-21 14:41:45 +00:00
Gusted 2fb2e832c5
[BUG] Initalize Git for hook regeneration
- Backport of #2416
- The hook regeneration code relies on `git.SupportProcReceive` being
set to determine if the `proc-receive` hook should be written, this
variable is set when the git module is initialized.
- Resolves #2414

(cherry picked from commit 815abad84c)
2024-02-21 14:43:43 +01:00
Earl Warren ceca25d374 Merge pull request '[gitea] v1.21 cherry-pick' (#2407) from earl-warren/forgejo:wip-v1.21-gitea-cherry-pick into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2407
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-20 15:47:19 +00:00
Earl Warren 44906f85f7 Merge pull request '[SEMVER] 6.0.6+0-gitea-1.21.6' (#2409) from earl-warren/forgejo:wip-v1.21-semver into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2409
2024-02-20 11:22:31 +00:00
Earl Warren 5e31d1f37f
[SEMVER] 6.0.6+0-gitea-1.21.6 2024-02-20 10:41:03 +01:00
6543 8377ecbfe1
Workaround to clean up old reviews on creating a new one (#28554) (#29264)
close  #28542
backport #28554

---
*Sponsored by Kithara Software GmbH*

(cherry picked from commit c01b266d8680a270b1e8067e757ed25be38eea24)
2024-02-20 09:39:02 +01:00
Jason Song 861d0b9689
Do not use lower tag names to find releases/tags (#29261) (#29262)
Backport #29261.

Fix #26090, see
https://github.com/go-gitea/gitea/issues/26090#issuecomment-1952013206

Since `TagName` stores the original tag name and `LowerTagName` stores
the lower tag name, it doesn't make sense to use lowercase tags as
`TagNames` in `FindReleasesOptions`.

5e72526da4/services/repository/push.go (L396-L397)

While the only other usage looks correct:

5e72526da4/routers/web/repo/repo.go (L416)
(cherry picked from commit f79530c50ee1c7833cae13e56531e5d1fd66f5ba)
2024-02-20 09:36:37 +01:00
Tim-Nicas Oelschläger a40762d929
Convert visibility to number (#29226) (#29244)
Backport #29226

Don't throw error while creating user (Fixes #29218)

---

The backport info from Giteabot
https://github.com/go-gitea/gitea/pull/29226#issuecomment-1951341322
needs to specify the version, because the default is v1.18

(cherry picked from commit 39735c43a8b6f7db3b3e3531ca9115a60335d524)
2024-02-20 09:36:28 +01:00
Lunny Xiao 8782275c9c
Fix push to create with capitalize repo name (#29090) (#29206)
Fix #29073
Backport #29090

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 933cc4da642c13b18423be99574944c43cc558c7)
2024-02-20 09:28:32 +01:00
KN4CK3R aced7547c2
Use ghost user if user was not found (#29161) (#29169)
Backport #29161

(cherry picked from commit d823465d94b3b43945eace060000db9334eca52d)
2024-02-20 09:26:13 +01:00
6543 d3846df1f9
Dont load Review if Comment is CommentTypeReviewRequest (#28551) (#29160)
Backport #28551

RequestReview get deleted on review.
So we don't have to try to load them on comments.

(cherry picked from commit 0ac3186267b717bce7076ef44f883df7720d7a2d)
2024-02-20 09:22:26 +01:00
Earl Warren 60a4c05d23 Merge pull request '[BUG] Restrict when to make link absolute in markdown' (#2406) from gusted/forgejo-bp-2403 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2406
Reviewed-by: Otto <otto@codeberg.org>
2024-02-20 07:12:22 +00:00
Gusted 6c100083c2
[BUG] Restrict when to make link absolute in markdown
- Backport of #2403
- In markdown, links are proccessed to be made absolute against the
relevant base in that context. Such that `./src` will be transformed
into `http://example.com/owner/repo/src/branch/main/src`.
- Don't try to make the link absolute if the link has a schema that's
defined in `[markdown].CUSTOM_URL_SCHEMES`, because they can't be made
absolute and doing so could lead to problems (see test case, double
slash was transformed to single slash).
- Adds unit test.
- Resolves https://codeberg.org/Codeberg/Community/issues/1489

(cherry picked from commit 65b9a959b8)
2024-02-19 23:30:12 +01:00
Earl Warren 6c5121aac5 Merge pull request '[GITEA] Fix cancelled migration deletion modal' (#2405) from gusted/forgejo-bp-1805 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2405
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-19 21:55:09 +00:00
Gusted 53460829f7
[GITEA] Fix cancelled migration deletion modal
- Backport of #1805
- https://codeberg.org/forgejo/forgejo/pulls/1473 made that dangerous
actions such as deletion also would need to type in the owner's name.
This was apparently not reflected to the deletion modal for migrations
that failed or were cancelled.
- Resolves #2404

(cherry picked from commit c38dbd6f889aeb52745eddb276225acd0153cba6)
2024-02-19 21:00:26 +01:00
Gusted 84ef9bba44 Merge pull request '[BUG] Fix relative links on orgmode' (#2391) from gusted/forgejo-bp-2385 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2391
Reviewed-by: Otto <otto@codeberg.org>
2024-02-19 12:29:21 +00:00
Gusted fa700333ba
[BUG] Fix relative links on orgmode
- Backport of #2385
- For regular non-image nonvideo links, they should be made relative,
this was done against `r.Ctx.Links.Base`, but since 637451a45e, that
should instead be done by `SrcLink()` if there's branch information set
in the context, because branch and treepath information are no longer
set in `r.Ctx.Links.Base`.
- This is consistent with how #2166 _fixed_ relative links.
- Media is not affected, `TestRender_Media` test doesn't fail.
- Adds unit tests.
- Ref https://codeberg.org/Codeberg/Community/issues/1485

(cherry picked from commit a2442793d2)
2024-02-19 12:15:40 +01:00
Earl Warren cd8a59e7bd Merge pull request '[BUG] Fix Ctrl+Enter on submitting review comment' (#2374) from gusted/forgejo-bp-2370 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2374
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-17 16:25:27 +00:00
Gusted 1c3a31d851
[BUG] Fix Ctrl+Enter on submitting review comment
- Backport of #2370
- When a event is caused by `Ctrl+Enter` jQuery might not wrap the event
and in that case `originalEvent` is not defined. Check for this case.
- Log the error along with showing an toast.
- Resolves #2363

(cherry picked from commit f04589defd)
2024-02-17 16:19:21 +01:00
Earl Warren 8283305d53 Merge pull request '[BUG] split code conversations in diff tab' (#2362) from oliverpool/forgejo:bg2306 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2362
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-17 10:50:48 +00:00
Earl Warren 91703b7214 Merge pull request 'Preview: set font-size on preview content' (#2366) from gusted/forgejo-bp-2349 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2366
Reviewed-by: Otto <otto@codeberg.org>
2024-02-17 10:48:33 +00:00
Gusted a904558380
Preview: set font-size on preview content
- Backport of #2349
- When previewing the content in a review, no font size was set. This
resulted in the previewed content being bigger than other text and
therefor creating an noticable inconsistency.
- Set the font size of the previewed content, 14px, this is consistent
with how the content would be rendered.
- `comment-code-cloud` is the class used for the review boxes.
`.ui.tab.markup` means it only applies to the preview tab.

(cherry picked from commit b1aabbf174)
2024-02-16 22:29:12 +01:00
oliverpool 07bc099401 [BUG] split code conversations in diff tab (#2306)
Follow-up of #2282 and #2296 (which tried to address #2278)

One of the issue with the previous PR is that when a conversation on the Files tab was marked as "resolved", it would fetch all the comments for that line (even the outdated ones, which should not be shown on this page - except when explicitly activated).

To properly fix this, I have changed `FetchCodeCommentsByLine` to `FetchCodeConversation`. Its role is to fetch all comments related to a given (review, path, line) and reverted my changes in the template (which were based on a misunderstanding).

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2306
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2024-02-16 14:06:43 +01:00
Earl Warren 45c0fa4905 Merge pull request '[BUG] Workaround borked Git version' (#2342) from gusted/forgejo-bp-2335 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2342
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-14 10:55:22 +00:00
Earl Warren 31ca6d8160 Merge pull request '[gitea] v1.21 cherry-pick' (#2340) from earl-warren/forgejo:wip-v1.21-forgejo into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2340
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-14 10:54:42 +00:00
Gusted ff468ab5e4
[BUG] Workaround borked Git version
- Backport #2335
- In Git version v2.43.1, the behavior of `GIT_FLUSH` was accidentially
flipped. This causes Forgejo to hang on the `check-attr` command,
because no output was being flushed.
- Workaround this by detecting if Git v2.43.1 is used and set
`GIT_FLUSH=0` thus getting the correct behavior.
- Ref: https://lore.kernel.org/git/CABn0oJvg3M_kBW-u=j3QhKnO=6QOzk-YFTgonYw_UvFS1NTX4g@mail.gmail.com/
- Resolves #2333.

(cherry picked from commit f68f880974)
2024-02-13 21:07:24 +01:00
CEnnis91 fab6780fda
Fix swift packages not resolving (#29095) (#29102)
(cherry picked from commit 1aaeec6da7fdbbe363e417a0445f21ed3b750aba)
2024-02-13 14:29:41 +01:00
Giteabot 614ba2b257
Avoid showing unnecessary JS errors when there are elements with different origin on the page (#29081) (#29089)
Backport #29081 by wxiaoguang

Try to fix #29080

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 9a4d283e9ac472dca869356c27db05039673c638)
2024-02-13 14:18:07 +01:00
Giteabot 628e1036cf
Fix gitea-origin-url with default ports (#29085) (#29088)
Backport #29085 by @silverwind

When setting `url.host` on a URL object with no port specified (like is
the case of default port), the resulting URL's port will not change.
Workaround this quirk in the URL standard by explicitely setting port
for the http and https protocols.

Extracted the logic to a function for the purpose of testing. Initially
I wanted to have the function in utils.js, but it turns out esbuild can
not treeshake the unused functions which would result in the
webcomponents chunk having all 2kB utils.js inlined, so it seemed not
worth.

Fixes: https://github.com/go-gitea/gitea/issues/29084

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit fb7f28e9a7ee441e85dc957ac507278650af2f63)
2024-02-13 14:17:58 +01:00
Giteabot e6f59f6e14
fix: Elasticsearch: Request Entity Too Large #28117 (#29062) (#29075)
Backport #29062 by @inferno-umar

Fix for gitea putting everything into one request without batching and
sending it to Elasticsearch for indexing as issued in #28117

This issue occured in large repositories while Gitea tries to
index the code using ElasticSearch.

Co-authored-by: dark-angel <70754989+inferno-umar@users.noreply.github.com>
(cherry picked from commit f0d34cd3b97dd2c9f29fc401ec58ea0661b7ca7d)
2024-02-13 14:17:49 +01:00
Giteabot 941c47f08f
Hide code links on release page if user cannot read code (#29064) (#29066)
Backport #29064 by @wolfogre

On the release list page, if the user doesn't have the permission to
read code, the code links will lead to 404 pages or api errors:

<img width="1297" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/a74fbc63-6dd6-43c6-853c-28acdbfdcb4e">

After this PR:

<img width="1297" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/a626373d-c2df-40a9-8fed-1b12ff6bc56f">

And this PR also removed some dead code. After #23465, the tag list page
has an independent template, and all `IsTag` in the release list
template are always false.

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit 7ed79b748f772e931317f941390695be3ac0d0bd)
2024-02-13 14:17:43 +01:00
Giteabot 3c54a1dbf6
Avoid sending update/delete release notice when it is draft (#29008) (#29025)
Backport #29008 by @yp05327

Fix #27157

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 8def405047f003f680be92241ad4db3d1eb88a64)
2024-02-13 14:17:34 +01:00
Giteabot 8c20eb668b
Wrap contained tags and branches again (#29021) (#29026)
Backport #29021 by @delvh

Fixes #29016

## After

![grafik](https://github.com/go-gitea/gitea/assets/51889757/2c72ee8f-439e-4328-85df-77772e0f4aef)

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 5ac41026f9f9b34cd673b66e8552269dd0c809ac)
2024-02-13 14:17:25 +01:00
Giteabot 565b4efe4d
Fix incorrect button CSS usages (#29015) (#29023)
Backport #29015 by @wxiaoguang

Fix 2 problems:

1. Remove the legacy (non-existing) CSS: `class="btn btn-gray
btn-radius"`
2. Remove the button styles inside the `ui message`, according to:
https://fomantic-ui.com/collections/message.html , the button shouldn't
have any border/padding.

### Before

![image](https://github.com/go-gitea/gitea/assets/2114189/4c7e98e2-4e8a-493f-9b7e-446a365066a1)

![image](https://github.com/go-gitea/gitea/assets/2114189/05221251-7a79-4c96-8973-fb4588275672)

### After

![image](https://github.com/go-gitea/gitea/assets/2114189/8bc3edbc-42a6-40bd-85fd-de40e94841d4)

![image](https://github.com/go-gitea/gitea/assets/2114189/93f69143-d835-437c-b5eb-0f6dddde97a1)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 333d02ddfd107edf6862baacc69690f233d1046b)
2024-02-13 14:17:18 +01:00
Giteabot c148156409
Strip trailing newline in markdown code copy (#29019) (#29022)
Behaviour now matches GH. Safeguard added in the for loop because
`textContent` may be null in which case it does not make sense to render
the copy button.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 5d1abdce3ea16064fe22e9bdaa436033bdd6698a)
2024-02-13 14:17:07 +01:00
Earl Warren bb5f4fd81b Merge pull request '[ACTIONS] skip superflous pull request synchronized event (#2314)' (#2338) from earl-warren/forgejo:wip-v1.21-superfluous into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2338
2024-02-13 12:37:58 +00:00
Earl Warren ce96379aef
[ACTIONS] skip superflous pull request synchronized event (#2314)
Skip a HookEventPullRequestSync event if it has the same CommitSHA as an existing HookEventPullRequest event in the ActionRun table. A HookEventPullRequestSync event must only create an ActionRun if the CommitSHA is different from what it was when the PR was open.

This guards against a race that can happen when the following is done in parallel:

* A commit C is pushed to a repo on branch B
* A pull request with head on branch B

it is then possible that the pull request is created first, successfully. The commit that was just pushed is not known yet but the PR only references the repository and the B branch so it is fine.

A HookEventPullRequest event is sent to the notification queue but not processed immediately.

The commit C is pushed and processed successfully. Since the PR already exists and has a head that matches the branch, the head of the PR is updated with the commit C and a HookEventPullRequestSync event is sent to the notification queue.

The HookEventPullRequest event is processed and since the head of the PR was updated to be commit C, an ActionRun with CommitSHA C is created.

The HookEventPullRequestSync event is then processed and also has a CommitSHA equal to C.

Refs: https://codeberg.org/forgejo/forgejo/issues/2009
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2314
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
(cherry picked from commit 7b4dba3aa0)

Conflicts:
	services/actions/notifier_helper.go
	tests/integration/actions_trigger_test.go
	trivial context conficts
	services/actions/main_test.go is different in v1.21
2024-02-13 12:00:27 +01:00
Earl Warren 5697a6e82f Merge pull request '[CI] pin go v1.21' (#2318) from earl-warren/forgejo:wip-v1.21-ci into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2318
2024-02-09 17:48:18 +00:00
Earl Warren 9a61bcb91f
[CI] pin go v1.21 2024-02-09 18:11:08 +01:00
Earl Warren 38800476bd Merge pull request '[GITEA] Generate install if condition for Alpine' (#2286) from earl-warren/forgejo:wip-v1.21-alpine into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2286
2024-02-04 19:23:15 +00:00
oliverpool f8fe66d737 Merge pull request '[GITEA] Internal Server Error when resolving comments' (#2289) from oliverpool/forgejo:forgejo-bp-2282 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2289
Reviewed-by: crystal <crystal@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-04 14:15:08 +00:00
oliverpool ad67d9ef1a [GITEA] always load outdated comments 2024-02-04 12:44:13 +01:00
oliverpool d5bb14de66 [GITEA] add test showing bug on resolving invalidated review comment 2024-02-04 12:44:13 +01:00
Gusted 7afbc62057
[GITEA] Generate install if condition for Alpine
- If the APKINFO contains an install if condition, write it in the APKINDEX.
- No integration testing, as I don't have the files to regenerate the
hardcoded compressed(?) APKINFO in the test.
- Resolves #2174

(cherry picked from commit 11da776befde7ec5d893d4f0579502b891bdd014)
(cherry picked from commit 2824ae4cf25a174004ff78ffa176330782e85821)
2024-02-03 19:30:48 +01:00
Gusted d56bb1bc95 Merge pull request '[GITEA] Fix orgmode link resolver for text descriptions' (#2277) from gusted/forgejo-bp-2276 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2277
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-01 21:05:22 +00:00
Earl Warren 108c984945 Merge pull request 'Revert "Speed up loading the dashboard on mysql/mariadb (#28546)" (#29006) (#29007)' (#2279) from earl-warren/forgejo:wip-v1.21-performance into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2279
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-01 21:02:25 +00:00
Giteabot af98a0a7c6
Revert "Speed up loading the dashboard on mysql/mariadb (#28546)" (#29006) (#29007)
Backport #29006 by @lunny

This reverts commit fa8c3beb26. #28546
Because it seems performance become worse.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit a0b9bd2febdf2aca8f8d162da4f09c0a89b13033)
2024-02-01 20:56:23 +01:00
Gusted 781d2a68cc
[GITEA] Fix orgmode link resolver for text descriptions
- Backport of #2276
- It's possible that the description of an `Regularlink` is `Text` and not
another `Regularlink`. Therefor if it's `Text`, convert it to an
`Regularlink` trough the 'old' behavior (pass it trough `org.String` and
trim `file:` prefix).
- Adds unit tests.
- Resolves https://codeberg.org/Codeberg/Community/issues/1430

(cherry picked from commit 385fc6ee6be25859066a716aa15be09991e2d33c)
2024-02-01 17:13:22 +01:00
6543 faafccbcc7
Update go dependencies and fix go-git (#28893) (#28934)
Backport #28893

(cherry picked from commit c33886b7100f1b92c763435e59af262879817f76)

Conflicts:
	go.sum
	trivial conflict because of 120294c44e * [GITEA] Use maintained gziphandler
2024-01-31 16:46:41 +01:00
Earl Warren ee833fc011
[SEMVER] 6.0.5+0-gitea-1.21.5 2024-01-31 14:18:26 +01:00
Giteabot 7578022870
Don't remove all mirror repository's releases when mirroring (#28817) (#28939)
Backport #28817 by @lunny

Fix #22066

# Purpose

This PR fix the releases will be deleted when mirror repository sync the
tags.

# The problem

In the previous implementation of #19125. All releases record in
databases of one mirror repository will be deleted before sync.
Ref:
https://github.com/go-gitea/gitea/pull/19125/files#diff-2aa04998a791c30e5a02b49a97c07fcd93d50e8b31640ce2ddb1afeebf605d02R481

# The Pros

This PR introduced a new method which will load all releases from
databases and all tags on git data into memory. And detect which tags
needs to be inserted, which tags need to be updated or deleted. Only
tags releases(IsTag=true) which are not included in git data will be
deleted, only tags which sha1 changed will be updated. So it will not
delete any real releases include drafts.

# The Cons

The drawback is the memory usage will be higher than before if there are
many tags on this repository. This PR defined a special release struct
to reduce columns loaded from database to memory.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 2048363f9ed6de485a81afa980ed90bf916bb3b8)
2024-01-31 14:18:26 +01:00
Giteabot b272224918
Preserve BOM in web editor (#28935) (#28959)
Backport #28935 by @silverwind

The `ToUTF8*` functions were stripping BOM, while BOM is actually valid
in UTF8, so the stripping must be optional depending on use case. This
does:

- Add a options struct to all `ToUTF8*` functions, that by default will
strip BOM to preserve existing behaviour
- Remove `ToUTF8` function, it was dead code
- Rename `ToUTF8WithErr` to `ToUTF8`
- Preserve BOM in Monaco Editor
- Remove a unnecessary newline in the textarea value. Browsers did
ignore it, it seems but it's better not to rely on this behaviour.

Fixes: https://github.com/go-gitea/gitea/issues/28743
Related: https://github.com/go-gitea/gitea/issues/6716 which seems to
have once introduced a mechanism that strips and re-adds the BOM, but
from what I can tell, this mechanism was removed at some point after
that PR.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit b8e6cffd317401d980600e339eb21b15b9bc64c1)
2024-01-31 14:18:26 +01:00
Giteabot afdce6bd45
Strip / from relative links (#28932) (#28952)
Backport #28932 by @KN4CK3R

Fixes #28915

Restores the old behaviour:

https://github.com/go-gitea/gitea/pull/26745/files#diff-d78a9d361b1fddc12218e4dd42f42d39d6be1fda184041e06bb6fb30f0d94c59L96

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 1ddcaedb88bc9ea829df8df6b254c73615c70031)
2024-01-31 14:18:26 +01:00
Giteabot 253af55053
Make loading animation less aggressive (#28955) (#28956)
Backport #28955 by @yardenshoham

The current animation loops in a very fast manner, causing a slight
feeling of uncomfortableness. This change slows it a bit for a smoother
experience.

# Before

![before](https://github.com/go-gitea/gitea/assets/20454870/215a722d-feb4-4643-819d-c37a620c5e48)

# After

![after](https://github.com/go-gitea/gitea/assets/20454870/7acb1fab-9157-4f4d-8cc7-45fea0234b47)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 7291fecab34c94a1f677d2ae5b86147f331a3c0c)
2024-01-31 14:18:26 +01:00
Giteabot c69d8c53f5
fix: update enable_prune even if mirror_interval is not provided (#28905) (#28929)
Backport #28905 by @Anthony-Jhoiro

Currently, the `updateMirror` function which update the mirror interval
and enable prune properties is only executed by the `Edit` function. But
it is only triggered if `opts.MirrorInterval` is not null, even if
`opts.EnablePrune` is not null.

With this patch, it is now possible to update the enable_prune property
with a patch request without modifying the mirror_interval.

## Example request with httpie

### Currently:
**Does nothing**
```bash
http PATCH https://gitea.your-server/api/v1/repos/myOrg/myRepo "enable_prune:=false" -A bearer -a $gitea_token
```

**Updates both properties**
```bash
http PATCH https://gitea.your-server/api/v1/repos/myOrg/myRepo "enable_prune:=false" "mirror_interval=10m" -A bearer -a $gitea_token
```

### With the patch
**Updates enable_prune only**
```bash
http PATCH https://gitea.your-server/api/v1/repos/myOrg/myRepo "enable_prune:=false" -A bearer -a $gitea_token
```

Co-authored-by: Anthony Quéré <47711333+Anthony-Jhoiro@users.noreply.github.com>
(cherry picked from commit d6eb6c90f45ebe93709b90691be73ba5c31e843e)
2024-01-31 14:18:26 +01:00
Giteabot 4e3b046afc
Implement MigrateRepository for the actions notifier (#28920) (#28923)
Backport #28920 by @Zettat123

Fixes #28699

This PR implements the `MigrateRepository` method for `actionsNotifier`
to detect the schedules from the workflow files in the migrated
repository.

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 55c53080d146913b29f2f45f05b6035e37338824)
2024-01-31 14:18:26 +01:00
Lunny Xiao 8e8adab88c
Upgrade xorm to v1.3.7 to fix a resource leak problem caused by Iterate (#28891) (#28895)
backport #28891

Mainly fix an error https://gitea.com/xorm/xorm/issues/2393

(cherry picked from commit e95006848efedb74ee489bd8335fee5c78fef5ea)
2024-01-31 14:18:26 +01:00
Jimmy Praet 1c3c6aea47
Don't reload timeline page when (un)resolving or replying conversation (#28654) (#28917)
Backport #28654
Fixes #15981

(cherry picked from commit 9210ce4045897ebd03a5767b8f7fcf56ff11bf6d)
2024-01-31 14:18:26 +01:00
Giteabot 9f2c7c2b7d
Only migrate the first 255 chars of a Github issue title (#28902) (#28912)
Backport #28902 by @JakobDev

Fixes #28846

Co-authored-by: JakobDev <jakobdev@gmx.de>
(cherry picked from commit cebf55f6b1af49afa8e41a3c446d6cf07dfb858e)
2024-01-31 14:18:26 +01:00
Giteabot 1cb29ff6a2
Fix sort bug on repository issues list (#28897) (#28901)
Backport #28897 by @lunny

Fix #28896

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit b508813fe48fde6eff4ea33713305ef6b81e2f4e)
2024-01-31 14:18:26 +01:00
Giteabot 9a1fb689a4
Fix DeleteCollaboration transaction behaviour (#28886) (#28889)
Backport #28886 by @KN4CK3R

The method can't be called with an outer transaction because if the user
is not a collaborator the outer transaction will be rolled back even if
the inner transaction uses the no-error path.

`has == 0` leads to `return nil` which cancels the transaction. A
standalone call of this method does nothing but if used with an outer
transaction, that will be canceled.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit fd1edb9d9d3ca701c6568de75d6ecfeccda88e51)
2024-01-31 14:18:26 +01:00
FuXiaoHei d11597a615
Fix uploaded artifacts should be overwritten (#28726) backport v1.21 (#28832)
Backport https://github.com/go-gitea/gitea/pull/28726 by @fuxiaohei

Fix Uploaded artifacts should be overwritten
https://github.com/go-gitea/gitea/issues/28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.

(cherry picked from commit 7f0ce2dfc7f4a0c50f6895f6d478f5230089f1c7)
2024-01-31 14:18:25 +01:00
Giteabot e2620642bd
Prevent anonymous container access if RequireSignInView is enabled (#28877) (#28882)
Backport #28877 by @KN4CK3R

Fixes #28875

If `RequireSignInView` is enabled, the ghost user has no access rights.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit b7c944b9e4e9f847719fbce421b2f4fee7281187)
2024-01-31 14:18:25 +01:00
Giteabot 80dfa56d2f
Fix migrate storage bug (#28830) (#28867)
Backport #28830 by @lunny

Fix #28728

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit cf9a416d62308186dd51b283976bc2b37c8673f7)
2024-01-31 14:18:25 +01:00
Giteabot 131a8f0324
Fix incorrect PostgreSQL connection string for Unix sockets (#28865) (#28870)
Backport #28865 by @sdvcrx

Fix #28864

Co-authored-by: sdvcrx <memory.silentvoyage@gmail.com>
(cherry picked from commit 8c7bda8755cc5fd1b12c5516fb60b7f63af4aecf)
2024-01-31 14:18:25 +01:00
Giteabot 6aa5554161
Avoid duplicate JS error messages on UI (#28873) (#28881)
Backport #28873 by wxiaoguang

Gitea treat JS errors seriously, so sometimes the JS errors caused by
3rdparty code (eg: browser extensions) would also be reported on Gitea
UI: TypeError: WeakMap key undefined (caused by extension DarkReader's
bug) #28861

To avoid fill the user's screen with a lot of error messages, this PR
merges the same error messages into one.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit b7e32b23828524c6ab274374aff5f28029ff4237)
2024-01-31 14:18:25 +01:00
Giteabot 7db542a029
Fix archive creating LFS hooks and breaking pull requests (#28848) (#28851)
Backport #28848 by @brechtvl

When LFS hooks are present in gitea-repositories, operations like git
push for creating a pull request fail. These repositories are not meant
to include LFS files or git push them, that is handled separately. And
so they should not have LFS hooks.

Installing git-lfs on some systems (like Debian Linux) will
automatically set up /etc/gitconfig to create LFS hooks in repositories.
For most git commands in Gitea this is not a problem, either because
they run on a temporary clone or the git command does not create LFS
hooks.

But one case where this happens is git archive for creating repository
archives. To fix that, add a GIT_CONFIG_NOSYSTEM=1 to disable using the
system configuration for that command.

According to a comment, GIT_CONFIG_NOSYSTEM is not used for all git
commands because the system configuration can be intentionally set up
for Gitea to use.

Resolves #19810, #21148

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
(cherry picked from commit 0d50f274698e7508ad15f61b1eca41db677b762e)
2024-01-31 14:18:25 +01:00
Mihir Joshi 54a6dc73ef
Fix reverting a merge commit failing (#28794) (#28825)
Backport https://github.com/go-gitea/gitea/pull/28794

Fixes #22236

---
Error occurring currently while trying to revert commit using read-tree
-m approach:
> 2022/12/26 16:04:43 ...rvices/pull/patch.go:240:AttemptThreeWayMerge()
[E] [63a9c61a] Unable to run read-tree -m! Error: exit status 128 -
fatal: this operation must be run in a work tree
> 	 - fatal: this operation must be run in a work tree

We need to clone a non-bare repository for `git read-tree -m` to work.

bb371aee6e
adds support to create a non-bare cloned temporary upload repository.

After cloning a non-bare temporary upload repository, we [set default
index](https://github.com/go-gitea/gitea/blob/main/services/repository/files/cherry_pick.go#L37)
(`git read-tree HEAD`).
This operation ends up resetting the git index file (see investigation
details below), due to which, we need to call `git update-index
--refresh` afterward.

Here's the diff of the index file before and after we execute
SetDefaultIndex: https://www.diffchecker.com/hyOP3eJy/

Notice the **ctime**, **mtime** are set to 0 after SetDefaultIndex.

You can reproduce the same behavior using these steps:
```bash
$ git clone https://try.gitea.io/me-heer/test.git -s -b main
$ cd test
$ git read-tree HEAD
$ git read-tree -m 1f085d7ed8 1f085d7ed8 9933caed00
error: Entry '1' not uptodate. Cannot merge.
```

After which, we can fix like this:
```bash
$ git update-index --refresh
$ git read-tree -m 1f085d7ed8 1f085d7ed8 9933caed00
```

(cherry picked from commit 62f2d717b7e04565c5ff260746e43ed64a87b0e0)
2024-01-31 14:18:25 +01:00
Giteabot cdaf0dc752
Remove duplicated checkinit on git module (#28824) (#28831)
Backport #28824 by @lunny

`checkInit` has been invoked in `InitSimple`. So it's unnecessary to
invoke it twice in `InitFull`.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 8b5c9186a54b2e177fc58295ecd83bfc4700cbfd)
2024-01-31 13:36:08 +01:00
Yarden Shoham 84f3ef2586
Bump @github/relative-time-element to 4.3.1 (#28819) (#28826)
Backport #28819

- Fixes https://github.com/go-gitea/gitea/issues/28747

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/65d8dc84-680f-4c16-9aa1-b5986102e4e7)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/7cb288e7-ebde-4e94-a10a-cac28d6bdcfd)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 8b4abb1719d90328e03db8b8f9651c1a32ae025a)
2024-01-31 13:36:02 +01:00
Lunny Xiao 1cee60096a
Add changelog for 1.21.4 (#28812)
(cherry picked from commit f4923854f660c75f75592b9506c0471475ecc7cf)
2024-01-31 13:35:57 +01:00
Giteabot 766305f47c
Render code block in activity tab (#28816) (#28818)
Backport #28816 by @JakobDev

This is a little bugfix. Inline code is usually rendered in issue
titles, but it is missing in the activity tab.

Before:
![Screenshot 2024-01-16 at 14-20-51
Test](https://github.com/go-gitea/gitea/assets/15185051/383370f3-0fb2-49de-81cc-014e5cf86727)
After:

![grafik](https://github.com/go-gitea/gitea/assets/15185051/83eaf973-ce9a-44ce-beea-2db49fc8bd73)

Co-authored-by: JakobDev <jakobdev@gmx.de>
(cherry picked from commit d5906071062cad77f9d672211fb76fffe783b6c7)
2024-01-31 13:35:54 +01:00
Gusted 80b3afb470 Merge pull request '[MODERATION] Refactor excluding watchers mechanism (squash)' (#2218) from gusted/forgejo-bp-2143 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2218
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-01-22 21:55:12 +00:00
Gusted 3d3790ef4c
[MODERATION] Refactor excluding watchers mechanism (squash)
Backport of #2143

This solves two bugs. One bug is that due to the JOIN with the
`forgejo_blocked_users` table, duplicated users were generated if a user
had more than one user blocked, this lead to receiving more than one
entry in the actions table. The other bug is that if a user blocked more
than one user, it would still receive a action entry by a
blocked user, because the SQL query would not exclude the other
duplicated users that was generated by the JOIN.

The new solution is somewhat non-optimal in my eyes, but it's better
than rewriting the query to become a potential perfomance blocker (usage
of WHERE IN, which cannot be rewritten to a JOIN). It simply removes the
watchers after it was retrieved by the SQL query.

(cherry picked from commit c63c00b39b8bd2ed3a69ed044933a9626bfca2c1)
2024-01-22 21:01:08 +01:00
Gusted f6cf951b5d Merge pull request '[GITEA] Fix NPE in UsernameSubRoute' (#2170) from gusted/forgejo-bp-1981 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2170
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-01-18 17:58:44 +00:00
Gusted 3c7a955f05
[GITEA] Fix NPE in UsernameSubRoute
- Backport of #1981
- When the user is not found in `reloadparam`, early return when the
user is not found to avoid calling `IsUserVisibleToViewer` which in turn
avoids causing a NPE.
- This fixes the case that a 500 error and 404 error is shown on the
same page.
- Add integration test for non-existant user RSS.
- Regression by c6366089df

(cherry picked from commit f0e06962786ef8c417b0c6f07940c1909d3b91ba)
(cherry picked from commit 75d806690875a4fc38eb1e3c904096be34657011)
(cherry picked from commit 4d0a1e0637450865c7bbac69e42d92d63b95149c)
(cherry picked from commit 5f40a485da1b2c5f129f32e2ddc2065e3ba9ccd0)
(cherry picked from commit c4cb7812e39add6f7ff3d6f3f2d4e02c66435f0e)
2024-01-18 15:31:04 +01:00
Gusted b1b3ba8013 Merge pull request '[GITEA] Fix relative links rendering' (#2167) from gusted/forgejo-bp-2166 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2167
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-01-17 22:30:58 +00:00
Gusted f8c9ff55b9
[GITEA] Fix relative links rendering
- Backport of #2166
- Relative links were not properly being rendered, because the links
were being made absolute against the repository URL instead of
repository URL + /src/branch, which leads to incorrect links.
- Restore the 'old' behaviour. When there's branch information, that
should be used as base for links.
- Adjusts the test cases.
- Regression of 637451a45e
- Resolves https://codeberg.org/Codeberg/Community/issues/1411

(cherry picked from commit 0e9d52e2918004ac183910c712e9fe486e139e05)
2024-01-17 17:57:22 +01:00
Earl Warren 0f61994e26
[SEMVER] 6.0.4+0-gitea-1.21.4 2024-01-16 14:44:21 +00:00
Giteabot 4df056a14e
Use refname:strip-2 instead of refname:short when syncing tags (#28797) (#28811)
Backport #28797 by @lunny

Fix #28694

Generally, `refname:short` should be equal to `refname:lstrip=2` except
`core.warnAmbiguousRefs is used to select the strict abbreviation mode.`

ref:
https://git-scm.com/docs/git-for-each-ref#Documentation/git-for-each-ref.txt-refname

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 4746291b0863eaf9c629c944bd48295ca2f69d2f)
2024-01-16 14:41:11 +00:00
KN4CK3R 875b398e5e
Rework markup link rendering (#26745) (#28803)
Backport #26745
Fixes #26548

This PR refactors the rendering of markup links. The old code uses
`strings.Replace` to change some urls while the new code uses more
context to decide which link should be generated.

The added tests should ensure the same output for the old and new
behaviour (besides the bug).

We may need to refactor the rendering a bit more to make it clear how
the different helper methods render the input string. There are lots of
options (resolve links / images / mentions / git hashes / emojis / ...)
but you don't really know what helper uses which options. For example,
we currently support images in the user description which should not be
allowed I think:

<details>
  <summary>Profile</summary>

https://try.gitea.io/KN4CK3R

![grafik](https://github.com/go-gitea/gitea/assets/1666336/109ae422-496d-4200-b52e-b3a528f553e5)

</details>

(cherry picked from commit 022552d5b6adc792d3cd16df7de6e52cb7b41a72)
2024-01-16 14:41:11 +00:00
Giteabot 5124be72aa
Forbid removing the last admin user (#28337) (#28793)
Backport #28337 by @yp05327

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 376fa0d8c49ca8a290ebb328281a56af346f5785)
2024-01-16 14:41:11 +00:00
KN4CK3R c287b1383f
Fix GetCommitStatuses (#28787) (#28804)
Backport #28787

Replaces #28802

(cherry picked from commit ae99233db03ac123631d3f98eeaa4bf5c624b292)
2024-01-16 14:40:56 +00:00
Giteabot 215c96e646
Use correct has error check for internal responses (#28796) (#28798)
Backport #28796 by @wxiaoguang

`resp != nil` doesn't mean the request really succeeded. Add a comment
for requestJSONResp to clarify the behavior.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit cbf366643bfbc89a1fbc8a149e31abf19c60d6a9)
2024-01-16 14:40:56 +00:00
Giteabot 367561fff2
Fix nil pointer panic when exec some gitea cli command (#28791) (#28795)
Backport #28791 by @yp05327

panic:

![image](https://github.com/go-gitea/gitea/assets/18380374/7fcde2ad-1d42-4b60-b120-3b60a8926e8e)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/49d9f0ca-e590-4a35-8ca2-1317d1b7c939)

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit df694f6a7d72141e11f12a9cba6f0850a7e8e186)
2024-01-16 14:40:56 +00:00
Giteabot a21fdc881a
Fix when private user following user, private user will not be counted in his own view (#28037) (#28792)
Backport #28037 by @yp05327

Doer: asdasasdasasdasasdasasdasasdasasdasasdas (private user)
Followed: TestUser (public user)

Before:
(From doer's view)

![image](https://github.com/go-gitea/gitea/assets/18380374/9ba16b3b-068c-43c5-a3dd-e3343b5b32f2)
(From followed user's view, can see doer)

![image](https://github.com/go-gitea/gitea/assets/18380374/dfd1b564-d689-4393-b3d3-1e6bf52c94ba)

After:
(From doer's view)

![image](https://github.com/go-gitea/gitea/assets/18380374/1c85c1d1-c9f7-40c8-948c-145f7cae9a04)

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 84282c608cdb4ea5006d2b2f81f7d97c631a2b87)
2024-01-16 14:40:56 +00:00
Chongyi Zheng 82ec85550e
Update github.com/cloudflare/circl (#28789) (#28790)
Backport #28789

cloudflare/circl: https://github.com/advisories/GHSA-9763-4f94-gfch

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit d1db2b72511c5f88bbc23cab45ed92f118b53970)
2024-01-16 14:40:56 +00:00
Giteabot a23ccd2d93
Speed up loading the dashboard on mysql/mariadb (#28546) (#28784)
Backport #28546 by @lunny

Fixes #28155

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 6493085aeeb734a27052b9e998f452b6d649c103)
2024-01-16 14:40:56 +00:00
Giteabot 70c7ee5475
Modernize merge button (#28140) (#28786)
Backport #28140 by @earl-warren

- Make use of the `form-fetch-action` for the merge button, which will
automatically prevent the action from happening multiple times and show
a nice loading indicator as user feedback while the merge request is
being processed by the server.
- Adjust the merge PR code to JSON response as this is required for the
`form-fetch-action` functionality.
- Resolves https://codeberg.org/forgejo/forgejo/issues/774
- Likely resolves the cause of
https://codeberg.org/forgejo/forgejo/issues/1688#issuecomment-1313044

(cherry picked from commit 4ec64c19507caefff7ddaad722b1b5792b97cc5a)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit fbf29f29b5225be8e5e682e45b6977e7dda9b318)
2024-01-16 14:40:18 +00:00
Jack Hay 0841fb63a1
Require token for GET subscription endpoint (#28765) (#28778)
Backport #28765 for 1.21

(cherry picked from commit 56e722f825afacfa88a814d16ac200c7bfa06f91)
2024-01-16 14:39:40 +00:00
Giteabot 10b555a52b
Assign pull request to project during creation (#28227) (#28775)
Backport #28227 by @denyskon

When creating a pull request, allow directly assigning it to a project,
as it is already possible for issues.

After:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/01dc2b3d-d56a-4053-b2fc-138725d7633a)

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 80e564087dc1a89b8b74abcdc879c2de444d3278)
2024-01-16 14:39:23 +00:00
Giteabot 2ab54a9c06
Fix issue dependencies (#27736) (#28776)
Backport #27736 by @lng2020

Fix #27722
Fix #27357
Fix #25837
Fix #28732
1. Fix the typo `BlockingByDependenciesNotPermitted`, which causes the
`not permitted message` not to show. The correct one is `Blocking` or
`BlockedBy`
2. Rewrite the perm check. The perm check uses a very tricky way to
avoid duplicate checks for a slice of issues, which is confusing. In
fact, it's also the reason causing the bug. It uses `lastRepoID` and
`lastPerm` to avoid duplicate checks, but forgets to assign the
`lastPerm` at the end of the code block. So I rewrote this to avoid this
trick.
![I U1AT{GNFY3
1HZ`6L{(2L](https://github.com/go-gitea/gitea/assets/70063547/79acd02a-a567-4316-ae0d-11c6461becf1)
3. It also reuses the `blocks` slice, which is even more confusing. So I
rewrote this too.

![UARFPXRGGZQFB7J$2`R}5_R](https://github.com/go-gitea/gitea/assets/70063547/f21cff0f-d9ac-4ce4-ae4d-adffc98ecd99)

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
(cherry picked from commit 571822b6eca07832f6b5ff633bec8ab8fdb32624)
2024-01-16 14:39:23 +00:00
Giteabot 1069987293
Fix button size in "attached header right" (#28770) (#28774)
Backport #28770 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 2a0fbe23b8b00010aeadd793207033580bac1253)
2024-01-16 14:39:23 +00:00
Giteabot 453d27853c
Fix convert.ToTeams on empty input (#28426) (#28767)
Backport #28426 by @KN4CK3R

Fixes #28420

Don't return `nil` if the input was empty.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 95901a99c0bbbde022afd9e9297c0ee14fc7e9a4)
2024-01-16 14:39:23 +00:00
Giteabot 6a66e8c748
Require token for GET subscription endpoint (#28765) (#28768)
Backport #28765 by @jackHay22

Fixes  #28756

## Changes
- Require and check API token for `GET
/repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.

Co-authored-by: Jack Hay <jack@allspice.io>
(cherry picked from commit cb33623bb6b0cf60417c4a1d84b8f42ef1714ea3)
2024-01-16 14:39:23 +00:00
Giteabot 765aa1479d
Show description as tooltip instead of title for labels (#28754) (#28766)
Backport #28754 by @delvh

Follow GitHubs behavior of showing the label description as a tooltip
instead of the browser native title.

## Before

![grafik](https://github.com/go-gitea/gitea/assets/51889757/70448327-467b-4bee-b799-40a442a5ce16)

## After

![grafik](https://github.com/go-gitea/gitea/assets/51889757/abe7d700-148b-4cef-a487-6b0f8f20b212)

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 9f0c709637c30241224784a7c5e0f376c6b958ef)
2024-01-16 14:39:23 +00:00
Giteabot 703ed272cc
Hide code related setting options in repository when code unit is disabled (#28631) (#28749)
Backport #28631 by @lunny

Since #20805, code can be hidden.
However, the related settings are still shown even though they don't
have any meaning then.

https://github.com/go-gitea/gitea/assets/81045/5fdee54d-ac81-418a-82f7-eadff048cedd

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 5e9fd0ab5e3ce6428d6fe93c0c477fadb918e11f)
2024-01-16 14:39:23 +00:00
Giteabot 464c6e8d73
Add -F to commit search to treat keywords as strings (#28744) (#28748)
Backport #28744 by @me-heer

Fixes #28269

The [default
behavior](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp)
of --grep in git log is to interpret the keyword as a regular
expression. This causes the search to fail in the cases where the search
keyword contains a `[`, since `[` is a special character used in grep.

If we want our keywords to be interpreted as 'strings', we should use
[-F
flag](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp).

Co-authored-by: Mihir Joshi <mihir67mj@gmail.com>
(cherry picked from commit f220f4231af35150eed910cbdc44fac8f85cdfb3)
2024-01-16 14:39:23 +00:00
Giteabot efa0feb734
Concatenate error in checkIfPRContentChanged (#28731) (#28737)
Backport #28731 by @earl-warren

- If there's a error with the Git command in `checkIfPRContentChanged`
the stderr wasn't concatendated to the error, which results in still not
knowing why an error happend.
- Adds concatenation for stderr to the returned error.
- Ref: https://codeberg.org/forgejo/forgejo/issues/2077

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit bce27d0a31b42a68cc3faa52dc0fb23b612b02de)
2024-01-16 14:39:23 +00:00
Giteabot fab93c6393
Add download attribute to release attachments (#28739) (#28740)
Backport #28739 by @JakobDev

Fixes #28736

Co-authored-by: JakobDev <jakobdev@gmx.de>
(cherry picked from commit 12f418a7e80887ec9927eea27f5770736169c17a)
2024-01-16 14:39:23 +00:00
Giteabot 01285dc47c
Fix incorrect URL for "Reference in New Issue" (#28716) (#28723)
Backport #28716 by wxiaoguang

Gitea prefers to use relative URLs in code (to make multiple domain work
for some users)

So it needs to use `toAbsoluteUrl` to generate a full URL when click
"Reference in New Issues"

And add some comments in the test code

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit def178ce323e6c300e02b9aa225227178e5ca2e1)

Conflicts:
	tests/integration/issue_test.go
	https://codeberg.org/forgejo/forgejo/issues/2158
2024-01-16 14:37:07 +00:00
Giteabot d416f94b70
Improve frontend guideline (#28711) (#28713)
(cherry picked from commit ad2cb9863c063c7d016baccda6fcd7aeb5518aad)
2024-01-16 14:16:56 +00:00
Giteabot ad027c2818
Fix panic when parsing empty pgsql host (#28708) (#28709)
Backport #28708 by wxiaoguang

Regression of #27723
Fix #28705

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 7f833d8f71b71b0e983ed979c5ad8088aec7fb7d)
2024-01-16 14:16:56 +00:00
Giteabot 2b8b1ab0ae
Fix wrapping of label list (#28684) (#28688)
Backport #28684 by @denyskon

Before:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/2fbd7ef2-22ad-4515-9c66-81c29bfbb7a3)

After:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/df86d1ae-03db-4543-834c-761859c367be)

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
(cherry picked from commit e67c819cf463695db0d0693a1844f9c9fcd02c58)
2024-01-16 14:16:55 +00:00
wxiaoguang d537b63521
Make template DateTime show proper tooltip (#28677) (#28683)
Backport #28677

(cherry picked from commit 83457805bba667532fa45e9d610f76be056a3f6e)
2024-01-16 14:16:55 +00:00
Giteabot f5764bbf26
Fix: system webhooks API bug (#28531) (#28666)
Backport #28531 by @pulltheflower

- Fix the bug about admin/hooks API that `GET /admin/hooks` can only
fetch system_hooks, `POST /admin/hooks` can only create default_hooks.

Co-authored-by: vincent <38434877+pulltheflower@users.noreply.github.com>
(cherry picked from commit 3c79315cf2308e68caba5bd7f2f94aa3472d9425)
2024-01-16 14:16:55 +00:00
Giteabot 881159f593
Fix alpine package files are not rebuilt (#28638) (#28665)
Backport #28638 by @lng2020

I noticed the `BuildAllRepositoryFiles` function under the Alpine folder
is unused and I thought it was a bug.
But I'm not sure about this. Was it on purpose?

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
(cherry picked from commit 3e1bd61000ca47e2a990032c3b3817d930c9eb3f)
2024-01-16 14:16:55 +00:00
Giteabot 0a157ed950
Upgrade xorm to new version which supported update join for all supported databases (#28590) (#28668)
Backport #28590 by @lunny

Fix https://github.com/go-gitea/gitea/pull/28547#issuecomment-1867740842

Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports
UPDATE JOIN.
To keep consistent from different databases, xorm use
`engine.Join().Update`, but the actural generated SQL are different
between different databases.

For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx
Where xxx`.

For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE
join_conditions`.

For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support
`UPDATE table1 SET xxx FROM table2 WHERE join conditions` from
3.33.0(2020-8-14).

POSTGRES is the same as SQLITE.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 18da3f8483d5359f44bdac5ea46c6d2a54d94358)
2024-01-16 14:16:55 +00:00
Gusted fe3b294f7b
[GITEA] rework long-term authentication
- The current architecture is inherently insecure, because you can
construct the 'secret' cookie value with values that are available in
the database. Thus provides zero protection when a database is
dumped/leaked.
- This patch implements a new architecture that's inspired from: [Paragonie Initiative](https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence#secure-remember-me-cookies).
- Integration testing is added to ensure the new mechanism works.
- Removes a setting, because it's not used anymore.

(cherry picked from commit eff097448b1ebd2a280fcdd55d10b1f6081e9ccd)

[GITEA] rework long-term authentication (squash) add migration

Reminder: the migration is run via integration tests as explained
in the commit "[DB] run all Forgejo migrations in integration tests"

(cherry picked from commit 4accf7443c1c59b4d2e7787d6a6c602d725da403)
(cherry picked from commit 99d06e344ebc3b50bafb2ac4473dd95f057d1ddc)
(cherry picked from commit d8bc98a8f021d381bf72790ad246f923ac983ad4)
(cherry picked from commit 6404845df9a63802fff4c5bd6cfe1e390076e7f0)
(cherry picked from commit 72bdd4f3b9f6509d1ff3f10ecb12c621a932ed30)
(cherry picked from commit 4b01bb0ce812b6c59414ff53fed728563d8bc9cc)
(cherry picked from commit c26ac318162b2cad6ff1ae54e2d8f47a4e4fe7c2)
(cherry picked from commit 8d2dab94a6)

Conflicts:
	routers/web/auth/auth.go
	https://codeberg.org/forgejo/forgejo/issues/2158
2024-01-16 14:14:46 +00:00
wxiaoguang ea8ca5b509
Avoid cycle-redirecting user/login page (#28636) (#28658)
Backport #28636

Fix #28231, and remove some unused code.

(cherry picked from commit 2165729d16cbb56087f38c9c04f8ffb5ccf6fdc0)
2024-01-16 14:11:44 +00:00
Earl Warren d694579bdf
Revert "[GITEA] rework long-term authentication"
This reverts commit 8d2dab94a6.
2024-01-16 14:11:28 +00:00
wxiaoguang fd098cf75b
Improve 1.21 document for Database Preparation (#28643) (#28644)
Backport #28643

Fix #28247

(cherry picked from commit 8ec232817c2a3321054147c83565c134b0990475)
2024-01-16 14:11:02 +00:00
Giteabot 2caf162b77
Extend description for ARTIFACT_RETENTION_DAYS (#28626) (#28630)
Backport #28626 by @hakito

Make it clear that this value is just a default value and that every
artifact can have it's own value.

Co-authored-by: Gerd Katzenbeisser <hakito@users.noreply.github.com>
(cherry picked from commit a5c7ac99809d50d4d8384a6263b019b0a6e90fd5)
2024-01-16 14:11:02 +00:00
Giteabot da1b257733
Use known issue IID to generate new PR index number when migrating from GitLab (#28616) (#28618)
Backport #28616 by wxiaoguang

Fix #13884

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit bf983735fd53673d82679e7e411c285afc0fa5de)
2024-01-16 14:11:02 +00:00
Gusted 120294c44e
[GITEA] Use maintained gziphandler
- https://github.com/NYTimes/gziphandler doesn't seems to be maintained
anymore and Forgejo already includes
https://github.com/klauspost/compress which provides a maintained and
faster gzip handler fork.
- Enables Jitter to prevent BREACH attacks, as this *seems* to be
possible in the context of Forgejo.

(cherry picked from commit cc2847241d82001babd8d40c87d03169f21c14cd)
(cherry picked from commit 99ba56a8761dd08e08d9499cab2ded1a6b7b970f)

Conflicts:
	go.sum
	https://codeberg.org/forgejo/forgejo/pulls/1581
(cherry picked from commit 711638193daa2311e2ead6249a47dcec47b4e335)
(cherry picked from commit 9c12a37fde6fa84414bf332ff4a066facdb92d38)
(cherry picked from commit 91191aaaedaf999209695e2c6ca4fb256b396686)
(cherry picked from commit 72be417f844713265a94ced6951f8f4b81d0ab1a)
(cherry picked from commit 98497c84da205ec59079e42274aa61199444f7cd)
(cherry picked from commit fba042adb5c1abcbd8eee6b5a4f735ccb2a5e394)
(cherry picked from commit dd2414f226)

Conflicts:
	routers/web/web.go
	https://codeberg.org/forgejo/forgejo/issues/2016
2024-01-16 14:09:55 +00:00
wxiaoguang 265cd70bdb
Refactor CORS handler (#28587) (#28611)
Backport #28587, the only conflict is the test file.

The CORS code has been unmaintained for long time, and the behavior is
not correct.

This PR tries to improve it. The key point is written as comment in
code. And add more tests.

Fix #28515
Fix #27642
Fix #17098

(cherry picked from commit 7a2786ca6cd84633784a2c9986da65a9c4d79c78)
2024-01-16 14:08:38 +00:00
Earl Warren 0b872a403d
Revert "[GITEA] Use maintained gziphandler"
This reverts commit dd2414f226.
2024-01-16 14:08:31 +00:00
Giteabot fef19bcf94
Fix the scroll behavior for emoji/mention list (#28597) (#28601)
Backport #28597 by wxiaoguang

Fix #28595 by https://github.com/github/combobox-nav/pull/79 (combobox-nav v2.3.1)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 8a46a6417e7ff181e876e19f8e73d804316e9c1b)
2024-01-16 14:07:46 +00:00
Giteabot c39e9cd9a9
Fix flex container width (#28603) (#28605)
Backport #28603 by wxiaoguang

Fix #28489

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 5b104a55331a5774140a7d35ab363a59a8aec9c8)
2024-01-16 14:07:46 +00:00
Giteabot 75ad9ac50b
Include heap pprof in diagnosis report to help debugging memory leaks (#28596) (#28599)
(cherry picked from commit f2add36a29580f5139e3ac5e1fc67ebf2da3cacd)
2024-01-16 14:07:46 +00:00
Giteabot 29a0e7738c
Fix wrong due date rendering in issue list page (#28588) (#28591)
Backport #28588 by @yardenshoham

It included the hours, minutes, and seconds. By removing these, the date
renders correctly.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 564068aa99be42d18e10247deb458d21b13f1a19)
2024-01-16 14:07:46 +00:00
Giteabot 3fe44b8762
Fix status_check_contexts matching bug (#28582) (#28589)
Backport #28582 by @Zettat123

Fix #28570
Follow #24633

---
Copied from
https://github.com/go-gitea/gitea/issues/28570#issuecomment-1867327999

The feature introduced in #24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.

21229ed2c8/routers/web/repo/pull.go (L653-L663)

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 6a559ad6348b95aa1cbb275003699d709af00bfc)
2024-01-16 14:07:46 +00:00
Giteabot 9ad7a67fc1
Fix 405 method not allowed CORS / OIDC (#28583) (#28586)
Backport #28583 by @morphelinho

Follow #28184
Follow #28515

Fix problem with 405 method not allowed for CORS wrt OIDC

Co-authored-by: morphelinho <morphelinho@users.noreply.github.com>
(cherry picked from commit 4dd39eb54aed03e2939b4fda6ab683756d878f04)
2024-01-16 14:07:46 +00:00
Earl Warren b856b108e9
Revert "[GITEA] Make reference URL absolute"
This reverts commit a8ce03660f.
2024-01-16 13:42:39 +00:00
Earl Warren 74652a6c81
Revert "[GITEA] Fix wrong link in user and organization profile when using relative url"
This reverts commit 658475dd21.
2024-01-16 13:38:07 +00:00
Earl Warren 90d532e778
Revert "[GITEA] Avoid conflicts of issue and PR numbers in GitLab migration (#1790)"
This reverts commit 55b9aed470.
2024-01-16 13:37:45 +00:00
Earl Warren b0295a3153
Revert "[GITEA] Downgrade @github/combobox-nav"
This reverts commit b0874a0912.
2024-01-16 13:37:29 +00:00
Earl Warren 2631d10df0 Merge pull request 'Backport #2139 to v1.21' (#2142) from algernon/forgejo:b/v1.21/missing-branch-makes-server-sad into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2142
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-01-15 13:08:56 +00:00
Gergely Nagy 49efd192e9
tests: More testing in TestDatabaseMissingABranch
In the `TestDatabaseMissingABranch` testcase, make sure that the
branches are in sync between the db and git before deleting a branch via
git, then compare the branch count from the web UI, making sure that it
returns an out-of-sync value first, and the correct one after another
sync.

This is currently tested by scraping the UI, and relies on the fact that
the branch counter is out of date before syncing. If that issue gets
resolved, we'll have to adjust the test to verify the sync another way.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-01-15 00:15:24 +01:00
Gergely Nagy 754f97b1e2
tests: Add a testcase for missing branches
This tests the scenario reported in Codeberg/Community#1408: a branch
that is recorded in the database, but missing on disk was causing
internal server errors. With recent changes, that is no longer the case,
the error is logged and then ignored.

This test case tests this behaviour, that the repo's branches page on
the web UI functions even if the git branch is missing.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-01-15 00:15:22 +01:00
Gergely Nagy c2fa9c308f
services: Gracefully handle missing branches
When loading branches, if loading one fails, log an error, and ignore
the branch, rather than returning and causing an internal server error.

Ideally, we would only ignore the error if it was caused by a missing
branch, and do it silently, like the respective API endpoint does.
However, veryfing that at this place is not very practical, so for the
time being, ignore any and all branch loading errors.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-01-15 00:15:12 +01:00
Gergely Nagy fffd9bb7d5
services: in loadOneBranch, return if CountDivergingCommits fail
If we can't count the number of diverging commits for one reason or
another (such as the branch being in the database, but missing from
disk), rather than logging an error and continuing into a crash (because
`divergence` will be nil), return an error instead.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-01-15 00:15:07 +01:00
Gusted ca25167a03 Merge pull request '[GITEA] Fix panic in canSoftDeleteContentHistory' (#2138) from gusted/forgejo-bp-2134 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2138
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-01-13 21:43:48 +00:00
Gusted ab1ccc55dc
[GITEA] Fix panic in canSoftDeleteContentHistory
- Backport of #2134
- It's possible that `canSoftDeleteContentHistory` is called without
`ctx.Doer` being set, such as an anonymous user requesting the
`/content-history/detail` endpoint.
- Add a simple condition to always set to `canSoftDelete` to false if an
anonymous user is requesting this, this avoids a panic in the code that
assumes `ctx.Doer` is set.
- Added integration testing.

(cherry picked from commit 0b5db0dcc608e9a9e79ead094a20a7775c4f9559)
2024-01-13 22:05:35 +01:00
Gusted bd3e5109ba Merge pull request '[GITEA] Fix wrong link in user and organization profile when using relative url' (#2118) from gusted/forgejo-bp-gt-28617 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2118
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-01-09 20:10:44 +00:00
katsu 658475dd21
[GITEA] Fix wrong link in user and organization profile when using relative url
- Backport of https://github.com/go-gitea/gitea/pull/28617
- Ref: https://codeberg.org/forgejo/forgejo/issues/1947

(cherry picked from commit 42149ff1a8)
2024-01-08 16:40:16 +01:00
Gusted 316b633e62 Merge pull request '[GITEA] Make reference URL absolute' (#2104) from gusted/forgejo-bp-2100 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2104
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-01-06 19:49:11 +00:00
Gusted a8ce03660f
[GITEA] Make reference URL absolute
- Backport of #2100
- Make the reference URL in the "Reference in New issue" feature
absolute again as it wouldn't render as a link otherwise.
- Adds integration test.
- Regression by 769be877f2
- Resolves #2012

(cherry picked from commit c74bae28973092eeeaf2fb9a17cbe41d286648db)
2024-01-06 20:16:52 +01:00
Gusted 2489cb97e7 Merge pull request '[GITEA] Check for Commit in opengraph' (#2098) from gusted/forgejo-bp-2094 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2098
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-01-05 15:03:21 +00:00
Gusted b473a44a2b
[GITEA] Check for Commit in opengraph
- Backport of #2094
- It's possible that `PageIsDiff` is set but not `Commit` resulting in a
NPE in the template. This can happen when the requested commit doesn't exist.
- Regression of c802c46a9b &
5743d7cb5b
- Added 'hacky' integration test.

(cherry picked from commit 8db2d5e4a76f05b34e4f889e7a00ecd6578d3639)
2024-01-05 14:26:20 +01:00
Gusted 0fbf761d19
[GITEA] Handle non-existant commit in Archive request
- When a user requests a archive of a non-existant commit
`git.ErrNotExist` is returned, but was not gracefully handled resulting
in a 500 error.
- Doesn't exist in v1.22 due to it being refactored away in
cbf923e87b
- Adds integration test.
2024-01-04 23:56:33 +01:00
Gusted 95dcc2dd8c Merge pull request '[GITEA] Fix NPE in ToPullReviewList' (#2058) from gusted/bp-forgejo-npe-reviews into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2058
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2023-12-30 15:53:13 +00:00
Gusted f5349b66b7
[GITEA] Fix NPE in ToPullReviewList
- Add condition to ensure doer isn't nil when using it.
- Added unit test.
- Resolves #2055

(cherry picked from commit 32967b2b5a62f7c7adc270aa3e6b123406b7b6d0)
2023-12-30 15:16:53 +01:00
Earl Warren ba222c299c
[CI] Forgejo Actions based release process (squash) no ownca
The private Forgejo instance trusted with the release signing keys no
longer requires the installation of the ownca certificate authority.

Refs: https://codeberg.org/forgejo/docs/pulls/338
(cherry picked from commit 72f9ae796d7d7328e87129485e83251708f3d2fb)
2023-12-28 17:27:34 +01:00
Aravinth Manivannan ac889d4290 [GITEA] notifies admins on new user registration (squash) fix URL
## Changes:

1. Use absolute URL in the admin panel link sent on new registrations
2. Include absolute URL of the newly signed-up user's profile.

New email looks like this:

<details><summary>Please click to expand</summary>

```
--153937b1864f158f4fd145c4b5d4a513568681dd489021dd466a8ad7b770
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

User Information: @realaravinth ( http://localhost:3000/realaravinth )
----------------------------------------------------------------------

* Created: 2023-12-13 19:36:50 +05:30

Please click here ( http://localhost:3000/admin/users/9 ) to manage the use=
r from the admin panel.
--153937b1864f158f4fd145c4b5d4a513568681dd489021dd466a8ad7b770
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
	<title>New user realaravinth just signed up</title>

	<style>
		blockquote { padding-left: 1em; margin: 1em 0; border-left: 1px solid gre=
y; color: #777}
		.footer { font-size:small; color:#666;}
	</style>

</head>

<body>
	<ul>
		<h3>User Information: <a href=3D"http://localhost:3000/realaravinth">@rea=
laravinth</a></h3>
		<li>Created: <relative-time format=3D"datetime" weekday=3D"" year=3D"nume=
ric" month=3D"short" day=3D"numeric" hour=3D"numeric" minute=3D"numeric" se=
cond=3D"numeric" datetime=3D"2023-12-13T19:36:50+05:30">2023-12-13 19:36:50=
 +05:30</relative-time></li>
	</ul>
	<p> Please <a href=3D"http://localhost:3000/admin/users/9" rel=3D"nofollow=
">click here</a> to manage the user from the admin panel. </p>
</body>
</html>

--153937b1864f158f4fd145c4b5d4a513568681dd489021dd466a8ad7b770--
```

</details>

fixes: https://codeberg.org/forgejo/forgejo/issues/1927
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1940
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
Co-committed-by: Aravinth Manivannan <realaravinth@batsense.net>
(cherry picked from commit b8d764e36a0cd8e60627805f87b84bb04152e9c1)
2023-12-24 14:41:12 +00:00
Earl Warren f929d195fd
[ACTIONS] on.schedule: do not cancel jobs
The cancelation of jobs is taken care of by handleWorkflows which is
called right after handleSchedules with the same event.

(cherry picked from commit ad1af2e436f60bc56cbd7528b7e22aa4a2530976)
2023-12-23 15:58:37 +01:00
Earl Warren c6940a6c5a
[ACTIONS] on.schedule: create a new payload
do not reuse the payload of the event that triggered the creation of
the scheduled event. Create a new one instead that contains no other
information than the event name in the action field ("schedule").

(cherry picked from commit 0b40ca1ea5e6b704bcb6c0d370a21f633facc7d6)
2023-12-23 15:58:37 +01:00
Earl Warren 892a8e1f4a
[ACTIONS] on.schedule: the event is always "schedule"
handleSchedules() is called every time an event is received and will
check the content of the main branch to (re)create scheduled events.
There is no reason why intput.Event will be relevant when the schedule
workflow runs.

(cherry picked from commit 9a712bb276f2103cd7bccc4bb07b6cc669537e38)
2023-12-23 15:58:37 +01:00
Earl Warren 248b8bb0fa
Revert "improve possible performance bottleneck (#28547) (#28578)"
This reverts commit 7ddb1291ea.

Does not work at all.
2023-12-22 16:52:28 +01:00
Giteabot 90a650d2b0
Fix 500 error of searching commits (#28576) (#28579)
Backport #28576 by wxiaoguang

Regression of #28454 . Now the string is escaped HTML, so it doesn't
need `| Safe`.

Fix #28575

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit acc8100d47bab3b13311bcf4c330b19e2153d4ca)
2023-12-22 12:10:04 +01:00
Giteabot 7ddb1291ea
improve possible performance bottleneck (#28547) (#28578)
Backport #28547 by @lunny

Replace #28500

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 1a3803effd42df628090b436b44a902482413e45)
2023-12-22 12:10:04 +01:00
Giteabot 1f8d01c74d
Use information from previous blame parts (#28572) (#28577)
Backport #28572 by @KN4CK3R

Fixes #28545

`git blame` output can contain blocks without commit information if it
was outputted before (the `0dafa97ea3f6d9662299579e5be1875cd28baaae 48
26 1` line):
```
fec25436488499df7231f63b857f66457c193d5c 24 25 1
author Bastien Montagne
author-mail <bastien@blender.org>
author-time 1660731031
author-tz +0200
committer Bastien Montagne
committer-mail <bastien@blender.org>
committer-time 1660731031
committer-tz +0200
summary LibOverride: Add Make/Reset/Clear entries to IDTemplate contextual menu.
previous 839ece6477203382b7a7483062961540180ff1cd source/blender/editors/interface/interface_ops.c
filename source/blender/editors/interface/interface_ops.c
        #include "BLT_translation.h"
0dafa97ea3f6d9662299579e5be1875cd28baaae 48 26 1

3d57bc4397fca53bc9702a27bbf50102827829b0 27 27 1
author Hans Goudey
author-mail <hans@blender.org>
author-time 1700131315
author-tz +0100
committer Hans Goudey
committer-mail <hooglyboogly@noreply.localhost>
committer-time 1700131315
committer-tz +0100
summary Cleanup: Move several blenkernel headers to C++
previous 451c054d9b7d3148a646caa5a72fb127a5b5c408 source/blender/editors/interface/interface_ops.cc
filename source/blender/editors/interface/interface_ops.cc
        #include "BKE_context.hh"
```
This PR reuses data from the previous blame part to fill these gaps.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 1183002b3216d265a9180c9a86a1a37dc8226e89)
2023-12-22 12:10:03 +01:00
wxiaoguang 12a8d65a5a
Update mermaid for 1.21 (#28571)
Try to fix #28170

(cherry picked from commit 1fc6bc1be20469a9ff481d55a202b1d04b3b02e1)
2023-12-22 12:10:03 +01:00
Lunny Xiao 004ec9026b
Add changelog for 1.21.3 (#28569)
(cherry picked from commit 2360c7ec6cdddc337a9b4964a64d2e1640c69dad)
2023-12-22 12:10:03 +01:00
Giteabot bea2c52572
Fix merging artifact chunks error when minio storage basepath is set (#28555) (#28568)
Backport #28555 by @fuxiaohei

Related to  https://github.com/go-gitea/gitea/issues/28279

When merging artifact chunks, it lists chunks from storage. When storage
is minio, chunk's path contains `MINIO_BASE_PATH` that makes merging
break.

<del>So trim the `MINIO_BASE_PATH` when handle chunks.</del>

Update the chunk file's basename to retain necessary information. It
ensures that the directory in the chunk's path remains unaffected.

Co-authored-by: FuXiaoHei <fuxiaohei@vip.qq.com>
(cherry picked from commit 8ca32dc8733c0dad147cc7f734097dbe1113e9a9)
2023-12-22 12:10:03 +01:00
Giteabot 1c7c48d96e
Update actions document about comparsion as Github Actions (#28560) (#28564)
Backport #28560 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 47f9b3f48474ba6577642cd15fe07928dd90aaa7)
2023-12-22 12:10:03 +01:00
Giteabot d350add668
Fix inperformant query on retrifing review from database. (#28552) (#28562)
Backport #28552 by @6543

can we please PLEAS PLEASE only use raw SQL statements if it is relay
needed!!!

source is https://github.com/go-gitea/gitea/pull/28544 (before
refactoring)

Co-authored-by: 6543 <m.huber@kithara.com>
(cherry picked from commit 16263af9715afcfa249cf43157b2ae9b4d4765f4)
2023-12-22 12:10:03 +01:00
Giteabot 40fa6a526a
Fix the issue ref rendering for wiki (#28556) (#28559)
Backport #28556 by wxiaoguang

Fix #28526, regression of
* #26365

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit f096635622f117f7552e98d9ab3625369015e6ed)
2023-12-22 12:10:03 +01:00
Giteabot 9693f08812
Fix duplicate ID when deleting repo (#28520) (#28528)
Backport #28520 by @framitdavid

There is an accessibility issue in the interface when attempting to
delete a repository. When I click on "Delete repository," a dialog box
appears, requiring confirmation to proceed with the repository deletion.
However, when I press the "Repo name" label, the wrong input field gains
focus. The focused field is located behind the dialog and is intended
for renaming the repository.

I am submitting these pull requests to ensure that the correct input
field is focused when the user clicks on the label. This change will
also facilitate the writing of tests using Playwright or Testing Library
to retrieve elements based on roles. This PR will also improve
acessibility of this area.

Co-authored-by: David Øvrelid <46874830+framitdavid@users.noreply.github.com>
(cherry picked from commit 932e282e153ca30f6afaac738469137b761cf904)
2023-12-22 12:10:03 +01:00
Giteabot d15f9ee0b0
Only check online runner when detecting matching runners in workflows (#28286) (#28512)
Backport #28286 by @yp05327

Mentioned:
[#28277](https://github.com/go-gitea/gitea/issues/28277#issuecomment-1831325276)

We should only check online runner when detecting matching runners in
workflows,
as if runner is not online, the workflow will not run.

![image](https://github.com/go-gitea/gitea/assets/18380374/11855e9d-7241-4b7a-b8d7-49dbb94ba1c5)

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit d9aeb1f09d3e8e734ccc51c50072a07f822e3033)
2023-12-22 12:10:03 +01:00
Giteabot 5d1d66ac3a
chore(api): support ignore password if login source type is LDAP for creating user API (#28491) (#28525)
Backport #28491 by @appleboy

- Modify the `Password` field in `CreateUserOption` struct to remove the
`Required` tag
- Update the `v1_json.tmpl` template to include the `email` field and
remove the `password` field

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
(cherry picked from commit 411310d698e86bd639b31f2f5a8b856365b4590f)
2023-12-22 12:10:03 +01:00
Giteabot 2878d07926
Improve the prompt for "ssh-keygen sign" (#28509) (#28510)
Backport #28509 by wxiaoguang

Close #28505

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 4462628a262ed9bc667fa9e2a22af24359d02ceb)
2023-12-22 12:07:12 +01:00
wxiaoguang cd5a0ec1c8
Add option to disable ambiguous unicode characters detection (#28454) (#28499)
Backport #28454 (the only conflict is caused by some comments)

* Close #24483
* Close #28123
* Close #23682
* Close #23149

(cherry picked from commit a3f403f438)

Conflicts:
	modules/setting/ui.go
	trivial context conflict
2023-12-22 12:07:01 +01:00
Giteabot c5ac659d1b
Initalize stroage for orphaned repository doctor (#28487) (#28490)
Backport #28487 by @earl-warren

- When a repository is orphaned and has objects stored in any of the
storages such as repository avatar or attachments the delete function
would error, because the storage module wasn't initalized.
- Add code to initialize the storage module.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1954

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit 8ee1ed877b)
2023-12-22 12:05:11 +01:00
Giteabot 6cc170011b
Update docs for DISABLE_QUERY_AUTH_TOKEN (#28485) (#28488)
Backport #28485 by @kdumontnu

As described
[here](https://github.com/go-gitea/gitea/pull/28390#issuecomment-1857553331).

Co-authored-by: Kyle D <kdumontnu@gmail.com>
(cherry picked from commit 2c2e00899d)
2023-12-22 12:05:11 +01:00
Giteabot 1475c1fcc4
Refactor SSH clone URL generation code (#28421) (#28480)
Backport #28421 by wxiaoguang

Refactor the code and add tests, keep the old logic.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 6cbb6f303a)
2023-12-22 12:05:11 +01:00
Giteabot 2b991b32eb
Polyfill SubmitEvent for PaleMoon (#28441) (#28478)
Backport #28441 by wxiaoguang

Fix #28319

It only polyfills if there is no "SubmitEvent" class, so it has no side
effect for most users.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 6af698fb81)
2023-12-22 12:05:11 +01:00
Giteabot 3c6edfa5e2
Fix Chinese translation of config cheat sheet[API] (#28472) (#28473)
Backport #28472 by @CaiCandong

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
(cherry picked from commit 94a05a492d)
2023-12-22 12:05:11 +01:00
Giteabot 066c3f3baa
Fix documents for "custom/public/assets/" (#28465) (#28467)
Backport #28465 by wxiaoguang

Fix #28463

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 6de862abdf)
2023-12-22 12:05:11 +01:00
Giteabot 2a82e2d216
Retry SSH key verification with additional CRLF if it failed (#28392) (#28464)
Backport #28392 by @nekrondev

Windows-based shells will add a CRLF when piping the token into
ssh-keygen command resulting in
verification error. This resolves #21527.

Co-authored-by: nekrondev <heiko@noordsee.de>
Co-authored-by: Heiko Besemann <heiko.besemann@qbeyond.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit b47482d58e)
2023-12-22 12:05:11 +01:00
Giteabot a77398cd34
Add endpoint for not implemented Docker auth (#28457) (#28462)
Backport #28457 by @KN4CK3R

Recently Docker started to use the optional `POST /v2/token` endpoint
which should respond with a `404 Not Found` status code instead of the
current `405 Method Not Allowed`.

> Note: Not all token servers implement oauth2. If the request to the
endpoint returns 404 using the HTTP POST method, refer to Token
Documentation for using the HTTP GET method supported by all token
servers.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 74ab798033)
2023-12-22 12:05:11 +01:00
Giteabot 160ef74363
Fix possible nil pointer access (#28428) (#28440)
Backport #28428 by @KN4CK3R

There could be a nil pointer exception if the file is not found because
that specific error is suppressed but not handled.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 97a0bf151a)
2023-12-22 12:05:11 +01:00
Earl Warren fdf950398b
[SEMVER] 6.0.3+0-gitea-1.21.3 2023-12-22 11:56:45 +01:00
Gusted b0874a0912 [GITEA] Downgrade @github/combobox-nav
- The v2.3.0 update caused to always scroll to the suggestion menu, where
it previously wouldn't work at all or only scroll when it wasn't in the
viewport.
- Ref: https://github.com/github/text-expander-element/issues/50
- Ref: https://github.com/github/combobox-nav/pull/75
- Resolves #1990

(cherry picked from commit 27145be211ff782afe0910adbe200f126961f150)
2023-12-21 13:16:29 +00:00
Earl Warren 580f29d9a2
[GITEA] the ref of a scheduled action is always the default branch
Since a scheduled action is only run from the default branch, it
cannot be anything else.

Refs: https://codeberg.org/forgejo/forgejo/issues/1926
(cherry picked from commit eff0822856fd727915f6e6493a80844cffd7b02a)
2023-12-21 12:13:49 +01:00
Gusted cbe94214e9 [GITEA] Remove redundant syncBranchToDB
- The transaction in combination with Git push was causing deadlocks if
you had the `push_update` queue set to `immediate`. This was the root
cause of slow integration tests in CI.
- Remove the sync branch code as this is already being done in the Git
post-receive hook.
- Add tests to proof the branch models are in sync even with this code
removed.

Backport of https://codeberg.org/forgejo/forgejo/pulls/1962

(cherry picked from commit a064065cb9a6e39597e38c37a405d066cfabf7f7)
2023-12-21 11:07:41 +00:00
Earl Warren 401c2a3c3d
[CI] upgrade moved to https://code.forgejo.org/forgejo/end-to-end/ 2023-12-19 23:44:34 +01:00
Gusted cd4413bdca Merge pull request 'Revert "[TESTS] oauth2: make it possible to use an alternate http.Client"' (#1986) from earl-warren/forgejo:wip-v1.21-oauth-npe into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1986
Reviewed-by: Loïc Dachary <dachary@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2023-12-19 20:48:50 +00:00
Earl Warren cfaa6dc2ed
Revert "[TESTS] oauth2: make it possible to use an alternate http.Client"
This reverts commit 172fdd0d32.

This code was introduced for a test case that is no longer in use. It
should guard against the provider being null but that's not worth the
effort for deadcode. Just remove it.

Refs: https://codeberg.org/forgejo/forgejo/issues/1984
2023-12-19 16:38:35 +01:00
Gusted 9515a0ea38
[GITEA] Update crypto dependency
- https://groups.google.com/g/golang-announce/c/qA3XtxvMUyg & https://terrapin-attack.com/

(cherry picked from commit b38e83c9ef18c83e26a54b19a196fa4611eb1859)
2023-12-19 15:24:20 +01:00
Earl Warren a86fa739dc Merge pull request '[GITEA] Revert "Make user-content-* consistent with github (#26388)"' (#1945) from earl-warren/forgejo:wip-v1.21-markdown-anchors into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1945
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2023-12-13 17:47:29 +00:00
Earl Warren 76d58fa269
[GITEA] test markdown CleanValue to prevent regression
It will determine how anchors are created and will break existing
links otherwise.

Adapted from Revert "Make `user-content-* ` consistent with github (#26388)
2023-12-13 18:12:08 +01:00
Earl Warren dbd896ce42
[GITEA] Revert "Make user-content-* consistent with github (#26388)"
Refs: https://codeberg.org/forgejo/forgejo/issues/1943

This reverts commit d41aee1d1e.

(cherry picked from commit d29ec91e91362b0657edee631f12cf1d55ba7a2c)
2023-12-13 18:09:56 +01:00
Earl Warren ce3d6b60bd
[SEMVER] 6.0.2+0-gitea-1.21.2 2023-12-12 17:04:38 +01:00
Earl Warren c477780163
Revert "Deprecate query string auth tokens (#28390) (#28430)"
It shows warnings although the setting is not set, this will surely be
fixed later but there is no sense in spaming the users right now. This
revert can be discarded when another fix lands in v1.21.

su -c "forgejo admin user generate-access-token -u root --raw --scopes 'all,sudo'" git
2023/12/12 15:54:45 .../setting/security.go:166:loadSecurityFrom() [W] Enabling Query API Auth tokens is not recommended. DISABLE_QUERY_AUTH_TOKEN will default to true in gitea 1.23 and will be removed in gitea 1.24.

This reverts commit 0e3a5abb69.

Conflicts:
	routers/api/v1/api.go
2023-12-12 17:04:38 +01:00
Giteabot bd264e6aed
Don't show unnecessary citation JS error on UI (#28433) (#28437)
Backport #28433 by wxiaoguang

Fix #28226

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 5e2bae7716)
2023-12-12 15:21:33 +01:00
techknowlogick 6b48228500
1.21.2 changelog (#28387)
To be rebuilt with latest golang version

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 96d3fcf179)
2023-12-12 15:21:33 +01:00
Lunny Xiao 3b672c9791
Do some missing checks (#28423) (#28432)
backport #28423

(cherry picked from commit 265f485295)
2023-12-12 15:21:33 +01:00
Giteabot 0e3a5abb69
Deprecate query string auth tokens (#28390) (#28430)
Backport #28390 by @jackHay22

## Changes
- Add deprecation warning to `Token` and `AccessToken` authentication
methods in swagger.
- Add deprecation warning header to API response. Example:
  ```
  HTTP/1.1 200 OK
  ...
  Warning: token and access_token API authentication is deprecated
  ...
  ```
- Add setting `DISABLE_QUERY_AUTH_TOKEN` to reject query string auth
tokens entirely. Default is `false`

## Next steps
- `DISABLE_QUERY_AUTH_TOKEN` should be true in a subsequent release and
the methods should be removed in swagger
- `DISABLE_QUERY_AUTH_TOKEN` should be removed and the implementation of
the auth methods in question should be removed

## Open questions
- Should there be further changes to the swagger documentation?
Deprecation is not yet supported for security definitions (coming in
[OpenAPI Spec version
3.2.0](https://github.com/OAI/OpenAPI-Specification/issues/2506))
- Should the API router logger sanitize urls that use `token` or
`access_token`? (This is obviously an insufficient solution on its own)

Co-authored-by: Jack Hay <jack@allspice.io>
Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit f144521aea)
2023-12-12 15:21:33 +01:00
Giteabot a0300f0bce
Fix links in docs (#28302) (#28418)
Backport #28302 by @yp05327

Close #28287

## How to test it in local
convert Makefile L34 into:
```
cd .tmp/upstream-docs && git clean -f && git reset --hard && git fetch origin pull/28302/head:pr28302 && git switch pr28302
```

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 40d51188c0)
2023-12-12 15:21:33 +01:00
Lunny Xiao 14750f3d11
Also sync DB branches on push if necessary (#28361) (#28403)
Fix #28056
Backport #28361

This PR will check whether the repo has zero branch when pushing a
branch. If that, it means this repository hasn't been synced.

The reason caused that is after user upgrade from v1.20 -> v1.21, he
just push branches without visit the repository user interface. Because
all repositories routers will check whether a branches sync is necessary
but push has not such check.

For every repository, it has two states, synced or not synced. If there
is zero branch for a repository, then it will be assumed as non-sync
state. Otherwise, it's synced state. So if we think it's synced, we just
need to update branch/insert new branch. Otherwise do a full sync. So
that, for every push, there will be almost no extra load added. It's
high performance than yours.

For the implementation, we in fact will try to update the branch first,
if updated success with affect records > 0, then all are done. Because
that means the branch has been in the database. If no record is
affected, that means the branch does not exist in database. So there are
two possibilities. One is this is a new branch, then we just need to
insert the record. Another is the branches haven't been synced, then we
need to sync all the branches into database.

(cherry picked from commit 87db4a47c8)
2023-12-12 15:21:33 +01:00
Giteabot e4dc14f070
Fix missing check (#28406) (#28411)
Backport #28406 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit cd2dd5a67d)
2023-12-12 15:21:32 +01:00
Earl Warren 69b4fd5fe2
Revert "fix POST /{username}/{reponame}/{type:issues|pulls}/move_pin"
This reverts commit 6483bceee2.
2023-12-12 15:21:32 +01:00
Earl Warren ee1655d5b0
Revert "fix POST /{username}/{reponame}/{type:issues|pulls}/{index}/content-history/soft-delete"
This reverts commit 2a8cb675ca.
2023-12-12 15:21:32 +01:00
Earl Warren d6ae79f78f Merge pull request '[GITEA] GetScheduledMergeByPullID may involve a system user' (#1925) from earl-warren/forgejo:wip-v1.21-actions-register into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1925
2023-12-11 18:39:37 +00:00
Earl Warren 4148fb27db
[GITEA] GetScheduledMergeByPullID may involve a system user
Refs: https://codeberg.org/forgejo/forgejo/issues/1897
(cherry picked from commit ddc3c2255840d347afd13c272d2695c68196d6ef)
2023-12-11 18:43:03 +01:00
Gusted bbdb47dfa1 Merge pull request '[GITEA] Actually recover from a panic in cron task' (#1912) from forgejo-bp-1911 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1912
2023-12-10 20:39:24 +00:00
Gusted 026a4bb02d
[GITEA] Actually recover from a panic in cron task
- Backport #1911
- Currently there's code to recover gracefully from panics that happen
within the execution of cron tasks. However this recover code wasn't
being run, because `RunWithShutdownContext` also contains code to
recover from any panic and then gracefully shutdown Forgejo. Because
`RunWithShutdownContext` registers that code as last, that would get run
first which in this case is not behavior that we want.
- Move the recover code to inside the function, so that is run first
before `RunWithShutdownContext`'s recover code (which is now a noop).
- Resolves #1910

(cherry picked from commit 761e1c83414407b65e331c2eeb4348c47acf0fbb)
2023-12-10 17:20:49 +01:00
Gusted 3981e6fdf3 Merge pull request 'Backport Correct default licenses to work as desired' (#1902) from fnetx/correct-license-defaults into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1902
2023-12-08 18:31:20 +00:00
Otto Richter 5258e8f63d Correct default license selection
The default license choice was not working as expected,
because both the files in options/license were named differently, and
the setting string is not parsed properly.

The documentation will also be corrected.

See conversation on Matrix:
https://matrix.to/#/%23forgejo-chat%3Amatrix.org/%24ue13GJPr2d7D8fEaLx8yh1mFn3a4TVy_khkajrAYtx0?via=matrix.tu-berlin.de&via=turbo.ooo&via=matrix.org&via=catgirl.cloud
2023-12-08 14:38:06 +01:00
Earl Warren 89014eb4fe
[SEMVER] 6.0.1+0-gitea-1.21.2 2023-12-08 13:59:19 +01:00
Giteabot 95a18f778a
Fix Docker meta action for releases (#28232) (#28395)
(cherry picked from commit 3107093394)
2023-12-08 13:41:16 +01:00
Giteabot 31c4a80979
Make gogit Repository.GetBranchNames consistent (#28348) (#28386)
Backport #28348 by @AdamMajer

nogogit GetBranchNames() lists branches sorted in reverse commit date
order. On the other hand the gogit implementation doesn't apply any
ordering resulting in unpredictable behaviour. In my case, the unit
tests requiring particular order fail

    repo_branch_test.go:24:
                Error Trace:
               ./gitea/modules/git/repo_branch_test.go:24
                Error:          elements differ

                                extra elements in list A:
                                ([]interface {}) (len=1) {
                                 (string) (len=6) "master"
                                }

                                extra elements in list B:
                                ([]interface {}) (len=1) {
                                 (string) (len=7) "branch1"
                                }

                                listA:
                                ([]string) (len=2) {
                                 (string) (len=6) "master",
                                 (string) (len=7) "branch2"
                                }

                                listB:
                                ([]string) (len=2) {
                                 (string) (len=7) "branch1",
                                 (string) (len=7) "branch2"
                                }
                Test:           TestRepository_GetBranches

To fix this, we sort branches based on their commit date in gogit
implementation.

Fixes: #28318

Co-authored-by: Adam Majer <amajer@suse.de>
(cherry picked from commit 272ae03341)
2023-12-08 13:41:16 +01:00
Giteabot 91e49c45ec
Fix margin in server signed signature verification view (#28379) (#28381)
Backport #28379 by @lafriks

Before:

![image](https://github.com/go-gitea/gitea/assets/165205/e2e2256d-03c5-4ab8-8ed9-08ef68571a43)

After:

![image](https://github.com/go-gitea/gitea/assets/165205/804132ef-18f9-4ab8-949d-f6c71e7f4d24)

Co-authored-by: Lauris BH <lauris@nix.lv>
(cherry picked from commit b56a9f6ded)
2023-12-08 13:41:16 +01:00
Giteabot 1ce155c5a6
Fix object does not exist error when checking citation file (#28314) (#28369)
Backport #28314 by @yp05327

Fix #28264

`DataAsync()` will be called twice.
Caused by https://github.com/go-gitea/gitea/pull/27958.
I'm sorry, I didn't completely remove all unnecessary codes.

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit c5c44d0951)
2023-12-08 13:41:16 +01:00
Giteabot 52f8fde69f
Fix incorrect default value of [attachment].MAX_SIZE (#28373) (#28376)
Backport #28373 by @capvor

In the documents, the `[attachment] MAX_SIZE` default value should be 4.

Reference the source code `modules/setting/attachment.go` line 29.

Co-authored-by: capvor <capvor@sina.com>
(cherry picked from commit 8f2805f757)
2023-12-08 13:41:16 +01:00
Giteabot f484ad6a29
Use filepath instead of path to create SQLite3 database file (#28374) (#28378)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Fix #28300

(cherry picked from commit 5eaf91e919)
2023-12-08 13:41:16 +01:00
Giteabot 3a788340f0
Fix the runs will not be displayed bug when the main branch have no workflows but other branches have (#28359) (#28365)
Backport #28359 by @lunny

The left menu will only display the default branch's workflows but the
right side will display the runs triggered by all branches' workflows.
So we cannot hide right side if default branch has no workflows.

Fix #28332
Replace #28333

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit b7e3adc66c)
2023-12-08 13:41:16 +01:00
Giteabot 6812c5d634
handle repository.size column being NULL in migration v263 (#28336) (#28363)
Co-authored-by: Nate Levesque <nate@thenaterhood.com>
(cherry picked from commit 5b5f8aab19)
2023-12-08 13:41:16 +01:00
Giteabot 346635605d
Convert git commit summary to valid UTF8. (#28356) (#28358)
Backport #28356 by @darrinsmart

The summary string ends up in the database, and (at least) MySQL &
PostgreSQL require valid UTF8 strings.

Fixes #28178

Co-authored-by: darrinsmart <darrin@djs.to>
Co-authored-by: Darrin Smart <darrin@filmlight.ltd.uk>
(cherry picked from commit fef34790bb)
2023-12-08 13:41:16 +01:00
Giteabot 693c2b4f15
Fix migration panic due to an empty review comment diff (#28334) (#28362)
Backport #28334 by @lng2020

Fix #28328
```
func (p *PullRequestComment) GetDiffHunk() string {
	if p == nil || p.DiffHunk == nil {
		return ""
	}
	return *p.DiffHunk
}
```
This function in the package `go-github` may return an empty diff. When
it's empty, the following code will panic because it access `ss[1]`

ec1feedbf5/services/migrations/gitea_uploader.go (L861-L867)

ec1feedbf5/modules/git/diff.go (L97-L101)

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
(cherry picked from commit 8b590de186)
2023-12-08 13:41:16 +01:00
Giteabot ce3a24ef5f
Add HEAD support for rpm repo files (#28309) (#28360)
Backport #28309 by @KN4CK3R

Fixes https://codeberg.org/forgejo/forgejo/issues/1810

zypper uses HEAD requests to check file existence.

https://github.com/openSUSE/libzypp/blob/HEAD/zypp/RepoManager.cc#L2549

https://github.com/openSUSE/libzypp/blob/HEAD/zypp-curl/ng/network/private/downloaderstates/basicdownloader_p.cc#L116

@ExplodingDragon fyi

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 5105d2093c)
2023-12-08 13:41:16 +01:00
Giteabot 171b6a294f
Refactor template empty checks (#28351) (#28354)
Backport #28351 by @KN4CK3R

Fix #28347

As there is no info how to reproduce it, I can't test it.
Fix may be `section_split.tmpl @ 126/130`.

Other changes are "empty check" refactorings.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 08445d5d86)
2023-12-08 13:41:16 +01:00
Giteabot b1b0d9a3fe
Fix RPM/Debian signature key creation (#28352) (#28353)
Backport #28352 by @KN4CK3R

Fixes #28324

The name parameter can't contain some characters
(https://github.com/keybase/go-crypto/blob/master/openpgp/keys.go#L680)
but is optional. Therefore just use an empty string.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit b71d4c3ec0)
2023-12-08 13:41:16 +01:00
Giteabot 8c3e66d604
Keep profile tab when clicking on Language (#28320) (#28331)
Backport #28320 by @JakobDev

Fixes https://codeberg.org/Codeberg/Community/issues/1355

Co-authored-by: JakobDev <jakobdev@gmx.de>
(cherry picked from commit bf537adf8a)
2023-12-08 13:41:16 +01:00
Giteabot 599211efe4
Fix missing issue search index update when changing status (#28325) (#28330)
Backport #28325 by @brechtvl

Changing an issue status, assignee, labels or milestone without also
adding a comment would not update the index, resulting in wrong search
results.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
(cherry picked from commit 8c8c24f8eb)
2023-12-08 13:41:16 +01:00
Giteabot 69bb6c6d71
Fix wrong link in protect_branch_name_pattern_desc (#28313) (#28315)
Backport #28313 by @yp05327

The current href will link to
`https://domain/owner/repo/settings/branches/github.com/gobwas/glob`

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit fee9c05ed3)
2023-12-08 13:41:16 +01:00
Giteabot b69ad623c2
Read previous info from git blame (#28306) (#28310)
Backport #28306 by @KN4CK3R

Fixes #28280

Reads the `previous` info from the `git blame` output instead of
calculating it afterwards.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit e15fe85335)
2023-12-08 13:41:16 +01:00
wxiaoguang 6cc02cdfd4
Ignore "non-existing" errors when getDirectorySize calculates the size (#28276) (#28285)
Backport #28276

The git command may operate the git directory (add/remove) files in any
time.

So when the code iterates the directory, some files may disappear during
the "walk". All "IsNotExist" errors should be ignored.

(cherry picked from commit 4f5122a7fe)
2023-12-08 13:41:16 +01:00
Giteabot 8aee1ae8e9
Use appSubUrl for OAuth2 callback URL tip (#28266) (#28275)
Backport #28266 by @earl-warren

- When crafting the OAuth2 callbackURL take into account `appSubUrl`,
which is quite safe given that its strictly formatted.
- No integration testing as this is all done in Javascript.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1795

(cherry picked from commit 27cb6b7956136f87aa78067d9adb5a4c4ce28a24)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit 84e65afffd)
2023-12-08 13:41:15 +01:00
Giteabot 13c0df40de
Meilisearch: require all query terms to be matched (#28293) (#28296)
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
(cherry picked from commit d2908b2794)
2023-12-08 13:41:15 +01:00
Giteabot 694f748f38
Fix issue will be detected as pull request when checking First-time contributor (#28237) (#28271)
Backport #28237 by @yp05327

Fix #28224

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 76e892317b)
2023-12-08 13:40:59 +01:00
Giteabot 93c3924a56
Check for v prefix on tags for release clean name (#28257) (#28270)
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
(cherry picked from commit 5001f63c07)
2023-12-08 13:40:59 +01:00
Giteabot 6ffcb5f5a5
Use full width for project boards (#28225) (#28245)
Backport #28225 by @denyskon

Inspired by #28182

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
(cherry picked from commit 6d22ca15ab)
2023-12-08 13:40:59 +01:00
Giteabot b63749b94c
Increase "version" when update the setting value to a same value as before (#28243) (#28244)
Backport #28243

Setting the same value should not trigger DuplicateKey error, and the
"version" should be increased

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit ea9f5a57e4)
2023-12-08 13:40:59 +01:00
yp05327 ce5260565c
Revert move installation/upgrade-from-gogs.md in 1.21 (#28235)
https://github.com/go-gitea/gitea/pull/28233#discussion_r1405539630
(cherry picked from commit 96141e4e55)
2023-12-08 13:40:59 +01:00
Giteabot 897f20d3ed
Fix links in docs (#28234) (#28238)
Backport #28234 by @yp05327

Follow #28191

Changes:
- `(doc/administration/config-cheat-sheet.md` is incorrect:

![image](https://github.com/go-gitea/gitea/assets/18380374/1c417dd7-61a0-49ba-8d50-871fd4c9bf20)
- remove `../../`

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit ca5f0c93c6)
2023-12-08 13:40:59 +01:00
Earl Warren b17113bb06
Revert "[GITEA] Ignore temporary files for directory size"
This reverts commit 68dddcc6ff.
2023-12-08 13:40:06 +01:00
Earl Warren 72bbb30f9d Merge pull request '[GITEA] notifies admins on new user registration (squash) fix locale' (#1892) from earl-warren/forgejo:wip-v1.21-notify-admin-new-user into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1892
2023-12-06 18:49:28 +00:00
Aravinth Manivannan bc0078a50a
[GITEA] notifies admins on new user registration (squash) fix locale
(cherry picked from commit 54cd100d8da37ccb0a545e2545995066f92180f0)
2023-12-06 18:36:17 +01:00
Earl Warren a923dad82d Merge pull request '[FEAT] add Forgejo Git Service (squash) register a Forgejo factory' (#1884) from earl-warren/forgejo:wip-v1.21-forgejo-migration into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1884
2023-12-06 12:02:27 +00:00
Earl Warren 61fc5c514a
[FEAT] add Forgejo Git Service (squash) register a Forgejo factory
If the Forgejo factory for the Forgejo service is not registered,
newDownloader will fallback to a git service and not migrate issues
etc.

Refs: https://codeberg.org/forgejo/forgejo/issues/1678
(cherry picked from commit 2ecb2558be696965a49b543d5e843526c105e07a)

Do not include tests so it is kept minimal.
2023-12-06 12:40:06 +01:00
Gusted 69221d84cf Merge pull request '[GITEA] Make pagination test more robust (squash)' (#1885) from Gusted/forgejo:forgejo-bp-1880 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1885
2023-12-05 22:50:42 +00:00
Gusted 114f18f105
[GITEA] Make pagination test more robust (squash)
- Backport #1882
- Be more specific of which element we want and also don't include the
href into the selector, so if the value changes, it will show the value
that was rendered.
- Ensure stable order of passed repository IDs.
- Resolves codeberg.org/forgejo/forgejo/issues/1880

(cherry picked from commit 79bc4cffe5437179543ce5f0e8ebe0f1e2301216)
2023-12-05 18:47:19 +01:00
Gusted 1263d0d416 Merge pull request '[GITEA] Add download URL for executable files' (#1846) from Gusted/forgejo:forgejo-bp-1839 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1846
2023-12-04 18:35:20 +00:00
Gusted 958a20865b [GITEA] Add download URL for executable files
- Backport https://codeberg.org/forgejo/forgejo/pulls/1839
- Consider executable files as a valid case when returning a downloadURL
for them. They are just regular files with the difference being the
executable permission bit being set.
- Not integration testing as it's not possible without adding adjusting
the existing repositories to have a executable file.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1825

(cherry picked from commit ca32891d548c302b0f3b3072647058278ffb9cbf)
2023-12-04 17:19:13 +00:00
Gusted 4de2148ae4 Merge pull request '[GITEA] Only pass selected repository IDs to pagination' (#1865) from Gusted/forgejo:forgejo-bp-1848 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1865
2023-12-01 22:30:27 +00:00
Gusted 2552bb7b6e [GITEA] Only pass selected repository IDs to pagination
- Backport of https://codeberg.org/forgejo/forgejo/pulls/1848
- `ReposParam` is passed to the pagination as value for the `repos`
query. It should paginate to other pages with only the selected
repositories, which was currently not the case, but was already the case
for the links in the selectable items.
- Fix the wrong value being passed for issues/pulls lists.
- Fix the formatting of repository query value for milestones lists.
- Added integration testing.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1836

(cherry picked from commit c648e5ab3a341b97807b9a1c4cf312d4acdc08d4)
2023-12-01 19:59:21 +00:00
Gusted 272d0a4c20 Merge pull request '[GITEA] Avoid conflicts of issue and PR numbers in GitLab migration (backport)' (#1863) from wetneb/forgejo:backport-1790-sql-error-in-gitlab-migration into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1863
2023-12-01 19:49:47 +00:00
Antonin Delpeuch 55b9aed470 [GITEA] Avoid conflicts of issue and PR numbers in GitLab migration (#1790)
Closes #1789.

The bug was due to the fact that GitLab does not guarantee that issue numbers are created sequentially: some identifiers can be skipped. Therefore, the new pull requests numbers should not be offset by the number of issues, but by the maximum issue number.

See for instance https://gitlab.com/troyengel/archbuild/-/issues/?sort=created_date&state=all&first_page_size=20, where there is only a singe issue with number "2".

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1790
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
(cherry picked from commit 2c185c39fe600041701d5f59cb1076a788815cb4)
2023-12-01 19:17:46 +00:00
Antonin Delpeuch 0afc181d20 [GITEA] Introduce HTTP mocking utility for unit tests (#1858)
Closes #1837.

The differences in dates can be explained by commit e19b9653ea, which
changed the order in which "created_date" and "updated_date" are
considered.
2023-12-01 19:17:46 +00:00
Gergely Nagy 1fea3ce659 [GITEA] new doctor check: fix-push-mirrors-without-git-remote (#1853)
Same as https://codeberg.org/forgejo/forgejo/pulls/1853, backported to v1.21/forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1864
Co-authored-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Co-committed-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2023-12-01 13:56:03 +00:00
Gusted 4d54a2b497 Merge pull request '[GITEA] oauth2: use link_account page when email/username is missing (backport)' (#1862) from wetneb/forgejo:backport-1755-oauth2-missing-email into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1862
2023-11-30 21:39:24 +00:00
Antonin Delpeuch e6fb2107f2 [GITEA] oauth2: use link_account page when email/username is missing (#1757)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1757
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
(cherry picked from commit 0f6e0f90359b4b669d297a533de18b41e3293df2)
2023-11-30 15:40:12 +01:00
Gusted 1327ca7178 Merge pull request '[DB] Ensure forgejo migration up to date (squash)' (#1850) from Gusted/forgejo:forgejo-bp-1849 into v1.21/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1850
2023-11-28 23:04:45 +00:00
Gusted b65e44e464
[DB] Ensure forgejo migration up to date (squash)
- Backport https://codeberg.org/forgejo/forgejo/pulls/1849
- Hook Forgejo's `EnsureUpToDate` to Gitea's `EnsureUpToDate`, such that
the Forgejo migrations are also being checked to be up to date.
- I'm not sure how I missed this and if this has caused any problems,
but due to the lack of any open issue about it it seems to not be a big
problem.

(cherry picked from commit 6c65b6dcf6ab0d58e5c2d03a866e4e38294f72ad)
2023-11-28 23:29:02 +01:00
Earl Warren bc59be2fea
[I18N] Add Locale merger script (squash) abort on NOOP
If a string is no longer used in the english version of the locales,
it means the Gitea string was changed and it needs updating. Abort
when it is the case and recommend action.
2023-11-28 17:52:11 +01:00
Loïc Dachary ab7e649668
test GET /{owner}/{repo}/comments/{id}/attachments
(cherry picked from commit 888dda12cf9bc95f9ef85ba5a518cf40152e07ea)
(cherry picked from commit aceeca55da0c2e94f3e495c4a60148411a27c4ac)
2023-11-26 14:12:06 +01:00
Loïc Dachary e140c5c983
test POST /{username}/{reponame}/{type:issues|pulls}/move_pin
(cherry picked from commit 52f50792606a22cbf1e144e1bd480984abf6f53f)
(cherry picked from commit 65b942fa1ee50f9098bebc8948d7924a5a4668fa)
2023-11-26 14:11:46 +01:00
Loïc Dachary 6483bceee2
fix POST /{username}/{reponame}/{type:issues|pulls}/move_pin
(cherry picked from commit 7eda733ed6a22c08a85fdc90deec0c440427cef7)
(cherry picked from commit 2d9d2979e674667cffeeafeef279f749d36bd2f5)
2023-11-26 14:11:36 +01:00
Loïc Dachary 68da5a9cd8
test POST /{username}/{reponame}/{tags,release}/delete
(cherry picked from commit 78dcbb62fe87abe044034d880c9e8c22b44c2c98)
(cherry picked from commit 6707c08c1791926060a7735529f1945650030257)
2023-11-26 14:11:03 +01:00
Loïc Dachary 2a8cb675ca
fix POST /{username}/{reponame}/{type:issues|pulls}/{index}/content-history/soft-delete
(cherry picked from commit a11d82a42729eba02032310f7778a9197f4f8ead)
(cherry picked from commit bebc2441567b6ff6693c9737319e42ff5347f0ac)
2023-11-26 14:09:56 +01:00
Lunny Xiao e619ce8ff5
Change log for 1.21.1 (#28222)
As title.

---------

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 196100a07a)
2023-11-26 13:56:51 +01:00
Lunny Xiao f4310d74ee
Fix comment permissions (#28213) (#28216)
backport #28213

This PR will fix some missed checks for private repositories' data on
web routes and API routes.

(cherry picked from commit bc3d8bff73)
2023-11-26 13:56:50 +01:00
Giteabot 29556fafb5
Fix actions when tagging (#28061) (#28218)
Backport #28061 by @lunny

close https://github.com/go-gitea/gitea/issues/28053

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 7f81110461)
2023-11-26 13:56:50 +01:00
Giteabot 620e428117
Docs: Replace deprecated IS_TLS_ENABLED mailer setting in email setup (#28205) (#28208)
Backport #28205 by @CodeShakingSheep

In the [docs for email
setup](https://docs.gitea.com/administration/email-setup)
`mailer.IS_TLS_ENABLED` is mentioned which was replaced by
`mailer.PROTOCOL` in release 1.18.0 according to
https://blog.gitea.com/release-of-1.18.0/ . This change wasn't reflected
in the docs for email setup. I just replaced the deprecated mailer
setting.

Co-authored-by: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com>
(cherry picked from commit 5ed0eefc9a)
2023-11-26 13:56:50 +01:00
Earl Warren e672322ca8
[MODERATION] User blocking (squash) do not use shared fixture
It conflicts with a fixtured added in the commit
Fix comment permissions (#28213) (#28216)
2023-11-26 13:56:00 +01:00
Giteabot 84f8a8292e
Fix some incorrect links in docs (#28191) (#28201)
Backport #28191 by @yp05327

https://gitea.com/gitea/gitea-docusaurus/actions/runs/661/jobs/0#jobstep-9-39
I noticed that there are many warning logs in building docs.
It is causing 404 in docs.gitea.com now, so we need to fix it.
And there are also some other problems in v1.19 which can not be done in
this PR.

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 4b89c0f996)
2023-11-25 07:27:39 +01:00
pitpalme 453ff1a57d
Fix delete-orphaned-repos (#28200) (#28202)
Backport #28200

gitea doctor failed at checking and fixing 'delete-orphaned-repos',
because table name 'user' needs quoting to be correctly recognized by at
least PostgreSQL.

fixes #28199

(cherry picked from commit 7cae4dfc00)
2023-11-25 07:27:39 +01:00
Giteabot a019cbde48
Use full width for PR comparison (#28182) (#28186)
Backport #28182 by @lng2020

Follow-up #22844
close #28142
Before

![ksnip_20231123-183906](https://github.com/go-gitea/gitea/assets/70063547/78428a22-b0a0-45f9-9458-7fd5ec73aa29)
After

![full](https://github.com/go-gitea/gitea/assets/70063547/047242cf-9d6c-4b3a-9f92-54102740c27e)

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
(cherry picked from commit 28b8e0b43e)
2023-11-25 07:27:39 +01:00
Giteabot 3175a984f2
Make CORS work for oauth2 handlers (#28184) (#28185)
Backport #28184

Fix #25473

Although there was `m.Post("/login/oauth/access_token", CorsHandler()...`,
it never really worked, because it still lacks the "OPTIONS" handler.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 23838c2c2e)
2023-11-25 07:27:39 +01:00
Giteabot d88f0f81ee
Fix missing buttons (#28179) (#28181)
Backport #28179 by @lng2020

fix #28173
regression #25948
That PR is supposed to only change the style but somehow delete a code
snippet. See the
diff(https://github.com/go-gitea/gitea/pull/25948/files#diff-7c36d66fe058f4ff9f2beaac73cf710dca45b350d0dd98daf806828a4745fe62L125-L129)
for details.

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit f9763f1366)
2023-11-25 07:27:39 +01:00
Giteabot 3b66d03c3b
Revert "Fix EOL handling in web editor" (#28101) (#28172)
Backport #28101 by @lng2020

Reverts go-gitea/gitea#27141
close #28097

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
(cherry picked from commit a2314ca9c5)
2023-11-22 17:14:40 +01:00
Gusted 36cc9a3aed
[BRANDING] Replace branding in Swagger
- "Gitea" is automatically being determined in Swagger and cannot be
overridden, therefor we override it after `swagger generate spec` is run.
- Resolves https://codeberg.org/forgejo/forgejo/issues/226

(cherry picked from commit 0b453807656b6fbe54284d865e59880460f3d253)

[BRANDING] Change Swagger title to Forgejo API

(cherry picked from commit 79f6a70b53421be9984a9ad96ebd0d06ab5af02e)
(cherry picked from commit 6cd47afe3366a615d40655a435275d5543910065)
(cherry picked from commit a7ae2e4c09431cd7a1f18c5b87b9dd87981b538d)
(cherry picked from commit 59f837e4661233dafc202ded9ad907dbdf7e3e69)
(cherry picked from commit c1c3d1f0e63b880baa32d285d3eba6034137b45a)
(cherry picked from commit 4b088713fb0a55c2c37f734ce82f13190ca412dd)
(cherry picked from commit 3df1d2137112a95279a8c84a8601e4c137d75d4f)
(cherry picked from commit a4a5fdbde4f9ebbf5ba6ba66c8f20a89e54860de)
(cherry picked from commit 57aa9ed710a95aa51ae3824873c3766b38da7850)
(cherry picked from commit 948b49bf9449af744a1f2e1324187897ed1c0809)
(cherry picked from commit be4929ab6a802d7d748f537ab8b798e30588c1d4)
(cherry picked from commit 9ecb507457d8a6aa60713762a1a5d2995ed986e5)

Conflicts:
	templates/swagger/ui.tmpl
(cherry picked from commit 8e57e688637b9fbd3c33d3e38aed8768a2c07208)
(cherry picked from commit f0b3f621e34130c75b35c113ad509ab73118e123)
(cherry picked from commit 5b0a6d093ea5210a5ba27705b1d1636e23da8738)
(cherry picked from commit 2e0f6b5de8837a439ecadaf3434d006d7014016c)
(cherry picked from commit bb08076f5c26481d78855823c2daa1a76d3865fb)
(cherry picked from commit 5c9360e38a41a4494b1b1b247f9d57b1a0d91ef0)
(cherry picked from commit 2f277561489e1228af163fa4e5d153ceb7eec864)
(cherry picked from commit 6fce7eeb511d949249e045a995cc637d3788a1f0)
(cherry picked from commit 8d27e7bebd961468bd492c4d64e132a46d97f62b)
(cherry picked from commit fda2ee2aaedac8f394d9fc38085f768c775d2c38)
(cherry picked from commit fe0489a4d856655fdcf93c16a41995709c47f78f)
(cherry picked from commit fe9479b357d2ef0f5fd8247e8356ce7c75135b88)
(cherry picked from commit 1deadb2f35c8c0c87cd93b6f04675312b1e667bb)
(cherry picked from commit d1cb84b2f225c484755172735841e3b75abce409)
(cherry picked from commit 9de15d49f8ff0ef0803e8b3a7437a45358e924b9)
(cherry picked from commit 461fbe219c30de7e756ce2cb6dbc354417655a6f)
(cherry picked from commit f39bf3ba5b6325898968533e79fdfc5fe74c3810)
(cherry picked from commit b3f31c2f7bc5b4f5ed3f7fb6e6a6649331eb179a)
(cherry picked from commit b9f493c139bc40bb5aaf361b813019968be75968)
(cherry picked from commit 83781b16411d49f2f27b622ac3e806234b477984)
(cherry picked from commit 4438ee0434f88fc0dcb917304a5baf5b8c2d11a8)
(cherry picked from commit 56b6b368334fe3d11fb55b8e35bbfc314f45405a)
(cherry picked from commit d42aa19f27cb984693d3be7084059f5bd946ae3e)
(cherry picked from commit 4b7eb6a93bf9700e491e8bf99cf76b19f481cac4)
(cherry picked from commit 9d17e95951e17528cd912028544421264f531eca)
(cherry picked from commit 31d3f4bb01d0260da4b6e71b055b28f11dc6cce3)
(cherry picked from commit c428c3f14c770dd2f4a2f1320f7bf047933d1057)
(cherry picked from commit 07fbe2ba69)

Conflicts:
	templates/swagger/v1_json.tmpl
	remove trailing dot
2023-11-22 17:14:07 +01:00
Giteabot 62474c84cc
Fix swagger title (#28164) (#28167)
Backport #28164 by @yp05327

![image](https://github.com/go-gitea/gitea/assets/18380374/380859b2-a643-42fd-b53e-78c93c05c826)
Don't know why there's a `.` behind. 🤔

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 994ba35f11)
2023-11-22 17:13:09 +01:00
Earl Warren b0afde6d64
Revert "[BRANDING] Replace branding in Swagger"
This reverts commit 07fbe2ba69.
2023-11-22 17:12:37 +01:00
Giteabot 9078aef244
Fix the description about the default setting for action in quick start document (#28160) (#28168)
Backport #28160 by @yp05327

Since #27054, Actions are enabled by default. so we should also edit the
document. 😃

ps: I think this should be backport to 1.21.0.

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 447422fe27)
2023-11-22 17:12:12 +01:00
Giteabot c5bb91a9eb
Add guide page to actions when there's no workflows (#28145) (#28153)
Backport #28145 by @yp05327

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/599d40c1-9b8d-4189-9286-c9c36fb780dd)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/848a73d1-aaec-478f-93a7-adcc7ee18907)

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 9bfee5014b)
2023-11-22 17:12:12 +01:00
Giteabot 2f8672c4dc
Do not display search box when there's no packages yet (#28146) (#28159)
Backport #28146 by @yp05327

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/3012f544-7ff5-4ccb-ac80-ce24d50abe97)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/4084312a-9ac0-4103-8c93-ea178ae24493)

![image](https://github.com/go-gitea/gitea/assets/18380374/3c47d175-0735-476d-8979-da2bc0a4fc95)

![image](https://github.com/go-gitea/gitea/assets/18380374/033c6a81-d1f7-4426-8063-5793d0b47462)

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 7128929a0d)
2023-11-22 17:12:12 +01:00
Giteabot 40ded966ce
Fix no ActionTaskOutput table waring (#28149) (#28152)
Backport #28149 by @yp05327

Reproduce:
- Create a new Gitea instance
- Register a runner
- Create a repo and add a workflow
- Check the log, you will see warnings:

![image](https://github.com/go-gitea/gitea/assets/18380374/5f1278e0-114b-48bc-8113-8ba1404d9975)
It comes from:

![image](https://github.com/go-gitea/gitea/assets/18380374/c2807831-e137-4229-9536-87f6114c8a5b)

The reason is that we forgot registering `ActionTaskOutput` model.
So `action_table_output` table will be missing in your db.

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit efcbaf8fa8)
2023-11-22 17:12:12 +01:00
Giteabot 4da95b7cf7
Fix empty action run title (#28113) (#28148)
Backport #28113 by @lunny

Fix #27901

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit c997e90738)
2023-11-22 17:12:12 +01:00
Giteabot 2969745b0c
Use "is-loading" to avoid duplicate form submit for code comment (#28143) (#28147)
Backport #28143 by @wxiaoguang

Compare by ignoring spaces:
https://github.com/go-gitea/gitea/pull/28143/files?diff=split&w=1

When the form is going to be submitted, add the "is-loading" class to
show an indicator and avoid user UI events.

When the request finishes (success / error), remove the "is-loading"
class to make user can interact the UI.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit ffab076b72)
2023-11-22 17:12:12 +01:00
Giteabot e627592402
Fix typo in packages.cleanup.success (#28133) (#28136)
Backport #28133 by @wolfogre

Follow
https://github.com/go-gitea/gitea/pull/28129#discussion_r1398971596

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit 117d9a117f)
2023-11-22 17:12:12 +01:00
Giteabot 70fcf38205
Add missing packages.cleanup.success (#28129) (#28132)
Backport #28129 by @wolfogre

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit f8c5f202b7)
2023-11-22 17:12:12 +01:00
John Olheiser 47ca0cd0c5
Update docs for docusaurus v3 (#28126)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
(cherry picked from commit 7213506680)
2023-11-22 17:12:12 +01:00
Giteabot b389926f4c
Fix Matrix and MSTeams nil dereference (#28089) (#28105)
Backport #28089 by @KN4CK3R

Fixes #28088
Fixes #28094

Added missing tests.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 1f82be6604)
2023-11-22 17:12:12 +01:00
Giteabot c1595117ce
Change default size of attachments and repo files (#28100) (#28106)
Backport #28100 by @lng2020

https://github.com/go-gitea/gitea/pull/27946 forgets to change them in
code. Sorry about that.

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
(cherry picked from commit 56bedf2bcc)
2023-11-22 17:12:12 +01:00
Giteabot 9584a3619a
Fix incorrect pgsql conn builder behavior (#28085) (#28098)
Backport #28085 by @wxiaoguang

Fix #28083 and fix the tests

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit f7567f798d)
2023-11-22 17:12:12 +01:00
Giteabot 702ef8d12f
Fix permissions for Token DELETE endpoint to match GET and POST (#27610) (#28099)
Backport #27610 by @evantobin

Fixes #27598

In #27080, the logic for the tokens endpoints were updated to allow
admins to create and view tokens in other accounts. However, the same
functionality was not added to the DELETE endpoint. This PR makes the
DELETE endpoint function the same as the other token endpoints and adds
unit tests

Co-authored-by: Evan Tobin <me@evantob.in>
(cherry picked from commit 93ede4bc83)
2023-11-22 17:12:11 +01:00
Giteabot 1eb83ea8cc
Fix system config cache expiration timing (#28072) (#28090)
Backport #28072

To avoid unnecessary database access, the `cacheTime` should always be
set if the revision has been checked.

Fix #28057

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 9f63d27ec4)
2023-11-22 17:12:11 +01:00
Giteabot c51dd2b4fd
Restricted users only see repos in orgs which their team was assigned to (#28025) (#28051)
Backport #28025 by @6543

---
*Sponsored by Kithara Software GmbH*

Co-authored-by: 6543 <m.huber@kithara.com>
(cherry picked from commit 073d8c50dd)
2023-11-22 17:12:11 +01:00
Denys Konovalov e4b92a1d47
Add v1.21.0 changelog (#28005) (#28048)
Backport changelog for v1.21.0 as Giteabot doesn't seem to be in the
mood for it

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit bc6477b36b)
2023-11-22 17:12:11 +01:00
Giteabot 0e9243bd8f
Fix viewing wiki commit on empty repo (#28040) (#28044)
Backport #28040 by @JakobDev

Fixes https://codeberg.org/forgejo/forgejo/issues/1758

For some weird reason we need to cast this nil.

Co-authored-by: JakobDev <jakobdev@gmx.de>
(cherry picked from commit 124a9957d0)
2023-11-22 17:11:57 +01:00
Giteabot 1600b2c8ff
Add word break to the repo list in admin settings page (#28034) (#28035)
Backport #28034 by @yp05327

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/ed464937-e20d-4f5b-b997-e86c2d96469d)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/471e77b3-516e-4ae9-b901-0cf8745eb9aa)

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit d72e20627d)
2023-11-22 17:11:57 +01:00
Giteabot ab609f3610
fixed duplicate attachments on dump on windows (#28019) (#28031)
Backport #28019 by @anudeepreddy

Hi,

This PR fixes #27988. The use of `path.join`(which uses `/` as the file
separator) to construct paths and comparing them with paths constructed
using `filepath.join`(which uses platform specific file separator) is
the root cause of this issue.

The desired behavior is to ignore attachments when dumping data
directory. Due to the what's mentioned above, the function
`addRecursiveExclude` is not actually ignoring the attachments directory
and is being written to the archive. The attachment directory is again
added to the archive (with different file separator as mentioned in the
issue) causing a duplicate entry on windows.

The solution is to use `filepath.join` in `addResursiveExclude` to
construct `currentAbsPath`.

Co-authored-by: Anudeep Reddy <anudeepc85@gmail.com>
(cherry picked from commit 00cd5ba6f4)
2023-11-22 17:11:57 +01:00
Giteabot 21a8fae8d6
Dont leak private users via extensions (#28023) (#28029)
Backport #28023 by @6543

there was no check in place if a user could see a other user, if you
append e.g. `.rss`

(cherry picked from commit eef4148935)
2023-11-22 17:11:57 +01:00
Giteabot 5770f694f5
Change default size of issue/pr attachments and repo file (#27946) (#28017)
Backport #27946 by @lng2020

As title. Some attachments and file sizes can easily be larger than
these limits

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
(cherry picked from commit d4122712f7)
2023-11-22 17:11:57 +01:00
Earl Warren 8869464c1d
Merge branch 'rebase-v1.21/forgejo-branding' into wip-v1.21-forgejo 2023-11-13 16:47:18 +01:00
Earl Warren 30a15784d4
Merge branch 'rebase-v1.21/forgejo-dependency' into wip-v1.21-forgejo 2023-11-13 16:47:12 +01:00
Earl Warren 2f84786d0c
Merge branch 'rebase-v1.21/forgejo-moderation' into wip-v1.21-forgejo 2023-11-13 16:47:07 +01:00
Earl Warren 13c05ade07
Merge branch 'rebase-v1.21/forgejo-i18n' into wip-v1.21-forgejo 2023-11-13 16:47:01 +01:00
Gusted 68dddcc6ff
[GITEA] Ignore temporary files for directory size
- Backport https://codeberg.org/forgejo/forgejo/pulls/1742
  - While looking trough the logs for unrelated things I noticed errors
for directory size calculations in `pushUpdates` that were being caused
by a race condition in which git was making temporary file,
`filepath.WalkDir` noticed that but by the time the second lstat
came(`info.Info()`) it was already gone and it would error.
  - Ignore temporary files created by Git.
  - There are other cases but much much more rarer and not trivial to detect.

Examples:

...s/repository/push.go:96:pushUpdates() [E] Failed to update size for repository: updateSize: lstat [...]/objects/info/commit-graphs/tmp_graph_Wcy9kR: no such file or directory
...s/repository/push.go:96:pushUpdates() [E] Failed to update size for repository: updateSize: lstat [...]/packed-refs.lock: no such file or directory

(cherry picked from commit 16ce00772d4bfba929168533ad58c3a618f28353)
(cherry picked from commit 2aebef847ff998b8c2aa3aad12706698cef078c9)
2023-11-13 14:06:32 +01:00
Gusted 9080bb1fdc
[GITEA] Fix required error for token name
- Say to the binding middleware which locale should be used for the
required error.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1683

(cherry picked from commit 64faeb6bef900093a703e00ed0be452d70c3d326)
(cherry picked from commit c93dbe1a6a0cb88d34127f68e819d27d298c7077)
(cherry picked from commit 81fcaee761b0ac18ce836504e66b9f8c4ddb0767)
2023-11-13 14:06:32 +01:00
Gusted 0944b7a92a
[GITEA] Add repo empty check for branch feed
- If you attempted to get a branch feed on a empty repository, it would
result in a panic as the code expects that the branch exists.
- `context.RepoRefByType` would normally already 404 if the branch
doesn't exist, however if a repository is empty, it would not do this
check.
- Fix bug where `/atom/branch/*` would return a RSS feed.

(cherry picked from commit d27bcd98a41b69e313535e5e91e4272136a4bab1)
(cherry picked from commit 07916c87235f246c809d61b74c55e796eca23fc8)
(cherry picked from commit 2eedbe0c55cb7109eb722ab9172933a26e878307)
(cherry picked from commit 3810d905c6f90e3c44e61c6ba8b8f4a219976c0b)
2023-11-13 14:06:32 +01:00
Earl Warren c6a572cc0b
[GITEA] Add anchor to review types (#26894)
- The review type '22' is a general comment type that is attached to
single codecomments, reviews with multiple comments or to simple approve
and request changes comment. This comment can be used to create a link
towards this action on an pull request.
- Adds an anchor to the review comment type, so that when its getting
linked to it, it actually jumps towards that event.
- This also now fixes the behavior that after you created a review you
will be redirected to that review and because this is an general comment
type other mails will also be 'fixed' such as the approved or request
changes.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1248

(cherry picked from commit 1741a5f1fe6adc68bb5f87bdd1c5bdc5bfaa45c7)

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
(cherry picked from commit 89c9a498fd)
(cherry picked from commit a2e2ce79f4bf56e4a002b77f3ffbbf6cf739f469)
(cherry picked from commit 299e437379863b7b3a36b97862d3789a8be28c78)
(cherry picked from commit 91a224ce2d961930e41efb9695cef31b9afe0275)
(cherry picked from commit 3a89b23b3b1800dc2be466c2ffa6192a4edff2e1)
2023-11-13 14:06:31 +01:00
Gusted 8d2dab94a6
[GITEA] rework long-term authentication
- The current architecture is inherently insecure, because you can
construct the 'secret' cookie value with values that are available in
the database. Thus provides zero protection when a database is
dumped/leaked.
- This patch implements a new architecture that's inspired from: [Paragonie Initiative](https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence#secure-remember-me-cookies).
- Integration testing is added to ensure the new mechanism works.
- Removes a setting, because it's not used anymore.

(cherry picked from commit eff097448b1ebd2a280fcdd55d10b1f6081e9ccd)

[GITEA] rework long-term authentication (squash) add migration

Reminder: the migration is run via integration tests as explained
in the commit "[DB] run all Forgejo migrations in integration tests"

(cherry picked from commit 4accf7443c1c59b4d2e7787d6a6c602d725da403)
(cherry picked from commit 99d06e344ebc3b50bafb2ac4473dd95f057d1ddc)
(cherry picked from commit d8bc98a8f021d381bf72790ad246f923ac983ad4)
(cherry picked from commit 6404845df9a63802fff4c5bd6cfe1e390076e7f0)
(cherry picked from commit 72bdd4f3b9f6509d1ff3f10ecb12c621a932ed30)
(cherry picked from commit 4b01bb0ce812b6c59414ff53fed728563d8bc9cc)
(cherry picked from commit c26ac318162b2cad6ff1ae54e2d8f47a4e4fe7c2)
2023-11-13 14:06:31 +01:00
Grigory Kirillov d7268d7266
[GITEA] convert feed items' titles to plain text
Refs: https://codeberg.org/forgejo/forgejo/pulls/1595

(cherry picked from commit 35b962e6313df748e8855b4dfbf748f095ea1003)
(cherry picked from commit 1004e35b84a4a0deae999cb8a4c2924b85b47c8b)
(cherry picked from commit af51dd594db229f7a986325a6070d33782d85d28)
(cherry picked from commit 7fb66b455647f2df592ace354cc65cb6eca6ec2a)
(cherry picked from commit 0c409950f14e0eee576e7206a838126cf810a494)
(cherry picked from commit edf1cb72b4494549c96ad1bed4e9de0143b1b27c)
(cherry picked from commit d1e5d9d6645f80128d8a51771a376a4dc9e935d4)
2023-11-13 14:06:31 +01:00
Gusted dd2414f226
[GITEA] Use maintained gziphandler
- https://github.com/NYTimes/gziphandler doesn't seems to be maintained
anymore and Forgejo already includes
https://github.com/klauspost/compress which provides a maintained and
faster gzip handler fork.
- Enables Jitter to prevent BREACH attacks, as this *seems* to be
possible in the context of Forgejo.

(cherry picked from commit cc2847241d82001babd8d40c87d03169f21c14cd)
(cherry picked from commit 99ba56a8761dd08e08d9499cab2ded1a6b7b970f)

Conflicts:
	go.sum
	https://codeberg.org/forgejo/forgejo/pulls/1581
(cherry picked from commit 711638193daa2311e2ead6249a47dcec47b4e335)
(cherry picked from commit 9c12a37fde6fa84414bf332ff4a066facdb92d38)
(cherry picked from commit 91191aaaedaf999209695e2c6ca4fb256b396686)
(cherry picked from commit 72be417f844713265a94ced6951f8f4b81d0ab1a)
(cherry picked from commit 98497c84da205ec59079e42274aa61199444f7cd)
(cherry picked from commit fba042adb5c1abcbd8eee6b5a4f735ccb2a5e394)
2023-11-13 14:06:31 +01:00
Gusted 7e15173c16
[GITEA] Use existing jsonschema library
- Use the 'existing' jsonschema library for the nodeinfo integration test.

(cherry picked from commit 73864840f27274d4cdaef23d47a6a71fc60529c3)
(cherry picked from commit da36df306b7a75434c75ed5f63608e06266ca480)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/1581
(cherry picked from commit 2b4ab46d8eacd2e6b2318f26e327ec59b804ea23)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/1617
(cherry picked from commit 8064130344eb0d797838f8444a6d5c0e3d425716)
(cherry picked from commit ca32f14bc215cdeabbf1643ef46a0c8c9e7f3ae8)
(cherry picked from commit 6a4abb928f556796041e2e59ec3b772d9b577009)
(cherry picked from commit 0059a44ae8066211c56754c56f3570076476af51)
(cherry picked from commit 8dc8451fd080bacea9947ab8da3ea33d0a4249ac)
2023-11-13 14:06:31 +01:00
Gusted d6432cab25
[GITEA] Make atomic ssh keys replacement robust
- After stumbling upon https://github.com/golang/go/issues/22397 and
reading the implementations I realized that Forgejo code doesn't have
`Sync()` and it doesn't properly error handle the `Close` function.
- (likely) Resolves https://codeberg.org/forgejo/forgejo/issues/1446

(cherry picked from commit 0efcb334c2f123d0869a30d684189eb31e8b983f)
(cherry picked from commit 04ef02c0dd98c7437acb39383d311c0901366508)
(cherry picked from commit 85f2065c9bc6ded9c21909ec76a9e8fc2d22f462)
(cherry picked from commit 8d36b5cce66864e190bad3c9b0973e37ca774a22)
(cherry picked from commit 0f406dc4d2a440b6109f07223f387bd11e2e7e80)
(cherry picked from commit 347a2e7372583aa63e54dc906091437b45ecdb72)
(cherry picked from commit f6c04d6b8626c1c500f773e10e9839469149f285)
(cherry picked from commit cf8b64f937c533efddbe94f050851e8db72d7e06)
2023-11-13 14:06:31 +01:00
Gusted a7a74706ec
[GITEA] Remove SSH workaround
- Update github.com/gliderlabs/ssh to include 02f9d57300.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1230

(cherry picked from commit 05a0fd8c9f4ba8876e8845dfad49b449681a1341)
(cherry picked from commit fcd68716a39333d5c00c74e44da27b913a3da20c)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/1581
(cherry picked from commit ff60267b91232c133de577e7fcb3436c29b98725)
(cherry picked from commit cff3238a217794cb4c1eb95f4cd6494d7679a566)
(cherry picked from commit 93a3cc6bda8eee04f5c58c295458366c11e8c34a)
(cherry picked from commit 213f1edbdc5dc312e85a40021a0b6758a8bd29dd)
(cherry picked from commit c249b0b0aa7397b5f1832d703cbca70f5a095769)
(cherry picked from commit 43abe08aff7d22c6fa007d50532875394626ef7a)
2023-11-13 14:06:31 +01:00
Gusted 0d8478cff8
[GITEA] Drop sha256-simd in favor of stdlib
- In Go 1.21 the crypto/sha256 [got a massive
improvement](https://go.dev/doc/go1.21#crypto/sha256) by utilizing the
SHA instructions for AMD64 CPUs, which sha256-simd already was doing.
The performance is now on par and I think it's preferable to use the
standard library rather than a package when possible.

```
cpu: AMD Ryzen 5 3600X 6-Core Processor
                │  simd.txt   │               go.txt                │
                │   sec/op    │    sec/op     vs base               │
Hash/8Bytes-12    63.25n ± 1%    73.38n ± 1%  +16.02% (p=0.002 n=6)
Hash/64Bytes-12   98.73n ± 1%   105.30n ± 1%   +6.65% (p=0.002 n=6)
Hash/1K-12        567.2n ± 1%    572.8n ± 1%   +0.99% (p=0.002 n=6)
Hash/8K-12        4.062µ ± 1%    4.062µ ± 1%        ~ (p=0.396 n=6)
Hash/1M-12        512.1µ ± 0%    510.6µ ± 1%        ~ (p=0.485 n=6)
Hash/5M-12        2.556m ± 1%    2.564m ± 0%        ~ (p=0.093 n=6)
Hash/10M-12       5.112m ± 0%    5.127m ± 0%        ~ (p=0.093 n=6)
geomean           13.82µ         14.27µ        +3.28%

                │   simd.txt   │               go.txt                │
                │     B/s      │     B/s       vs base               │
Hash/8Bytes-12    120.6Mi ± 1%   104.0Mi ± 1%  -13.81% (p=0.002 n=6)
Hash/64Bytes-12   618.2Mi ± 1%   579.8Mi ± 1%   -6.22% (p=0.002 n=6)
Hash/1K-12        1.682Gi ± 1%   1.665Gi ± 1%   -0.98% (p=0.002 n=6)
Hash/8K-12        1.878Gi ± 1%   1.878Gi ± 1%        ~ (p=0.310 n=6)
Hash/1M-12        1.907Gi ± 0%   1.913Gi ± 1%        ~ (p=0.485 n=6)
Hash/5M-12        1.911Gi ± 1%   1.904Gi ± 0%        ~ (p=0.093 n=6)
Hash/10M-12       1.910Gi ± 0%   1.905Gi ± 0%        ~ (p=0.093 n=6)
geomean           1.066Gi        1.032Gi        -3.18%
```

(cherry picked from commit abd94ff5b59c86e793fd9bf12187ea6cfd1f3fa1)
(cherry picked from commit 15e81637abf70576a564cf9eecaa9640228afb5b)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/1581
(cherry picked from commit 5caea2d75aeac78fb306f58a3cf7809d5b70c7f2)
(cherry picked from commit 08da542cce2c1571cedd4183268a903ab581d2e3)
(cherry picked from commit d71a8cc9fb816a3b6562a661286f1d3961821b67)
(cherry picked from commit 63c9fc2bee5b71e6ce3898bbf9b9bce827705acc)
(cherry picked from commit e1db85d48a2de7cff0d438aac81023c4b50cdae4)
(cherry picked from commit 5e86a5d2d13319c09199a35a4c0568389b03a2a2)
2023-11-13 14:06:31 +01:00
rome-user d3abb8a964
[GITEA] fix indentation in Maven package install instructions
The installation instructions of a Maven package places the `url` child
of the `repository` node in an extra indentation level. This indentation
is unnecesary since both the `id` and `url` nodes are direct children of
the `repository` node.

This commit removes the unnecessary indentation.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1534

(cherry picked from commit 82f0ddad7bfcb40595d0f79220834377b04382d8)
(cherry picked from commit 905e546549bc69460d93f6e30bbe93124e924e57)
(cherry picked from commit 4e58ab82b77a8f4e6f994fc21b42fb70f0629778)
(cherry picked from commit 2f207e7deb692e8b356881017f615cf03c27fc38)
(cherry picked from commit c3552fb2be0704edb7056f312e32244449a7b35b)
(cherry picked from commit 6c8e4d4fc9a2b6d42861ac603736a85806d88f7c)
(cherry picked from commit a9f7fa924cf6e07e2cf938b9cda59cfc76622bac)
(cherry picked from commit 4592a73f57b7ad758fe9b723ba98398ab7141012)
2023-11-13 14:06:31 +01:00
Gusted f9cdbb889a
[GITEA] Detect file rename and show in history
- Add a indication to the file history if the file has been renamed,
this indication contains a link to browse the history of the file
further.
- Added unit testing.
- Added integration testing.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1279

(cherry picked from commit 72c297521b1830360aab4b50e37efcc7e67e0d5d)
(cherry picked from commit 283f9648947f8dd2f315ecca19566ccca2b49c18)

Conflicts:
	options/locale/locale_en-US.ini
	https://codeberg.org/forgejo/forgejo/pulls/1550
(cherry picked from commit 7c30af7fdee08efd02041c01abca47394a69bb8b)
(cherry picked from commit f3be6eb269526a9f4ea7861189f07977f2d4a32f)
(cherry picked from commit 78e1755b94c18c043e0c8f8c2849803cc8069feb)
(cherry picked from commit 9f30b92009e8911c99412944bcd7cff55a7b98dc)
(cherry picked from commit bb694684a4045150924c15aa5647e8e112321f02)
(cherry picked from commit 721f0ccf3ea7196dbb877a6c159d23d05c37978b)
(cherry picked from commit 6a6ec50130f9f31b5f9387ea6e43bc93b214dca4)

[GITEA] Detect file rename and show in history (squash) ctx.Locale

(cherry picked from commit 08698d747f5fd325327c21947f62326169329265)
2023-11-13 14:06:30 +01:00
Gusted b39452fc1d
[GITEA] Skip unsupported code comment
- If there's a code comment that's received during the migration that
contains no diffhunk, skip it. This either means it was commenting on
old diffhunk or it's just a general codecomment. Forgejo supports
neither of such type of code comment.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1407

(cherry picked from commit ae463c7c559e02975ce5e758d8780def978eebee)
(cherry picked from commit bf48f02a86d6a193417f13a77031b8207a173dca)
(cherry picked from commit 10c3f102fa9135de37e9f73137ae5a9cf7072635)
(cherry picked from commit 828b4cc10cd0fc7e2540fe75e88b6ebf978c5c84)
(cherry picked from commit 6427fa65b641a32ead53779e3e7bda97704567df)
(cherry picked from commit 5b7a43c43fed0eb39e84edd652a699461f14fbbb)
(cherry picked from commit 49eb2566488a4857b2d2d2b0bd1d692c39beb028)
(cherry picked from commit 0be26ca144518f5961f88c0da99e37270bfb0005)
(cherry picked from commit c083236a589ae100128ba66b704c18fcd16201cf)
(cherry picked from commit 85738bc0a1058e0ac10a2ba9966d8e11d05544ad)
2023-11-13 14:06:30 +01:00
Gusted 6836149d45
[GITEA] Fix issue card links on projects
- Don't expect that rendering is done on a repository, use the given
issue to figure out the repository link.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1321

(cherry picked from commit 63f16652ca21809d2e088c46ddb88b84c08a5ad6)
(cherry picked from commit 821785d0af2fc2a41997675fc2809e1e45c0cdd8)
(cherry picked from commit 345742a0dc2b505a5bdc0747d4e2cda7136e735d)
(cherry picked from commit 2a37b91d7ced112b06d04950a9970cbd2d52f0f2)
(cherry picked from commit 9d40b409d715d336f68ec6306d8a928c171c85fc)
(cherry picked from commit c4c377e73312f36111d5f874195c9aebbb9c8635)
(cherry picked from commit 41f85e3bca361dbd1d58ea1573c9086ad82597b5)
(cherry picked from commit b5a2da8210a41e4ee8ab44a1d06893d66a70f906)
(cherry picked from commit 3a01437704a72a826c1bf3ce64fcd56303989ba4)
(cherry picked from commit a007f67f74fec914d9783f1b02b960a5dbbff26f)
2023-11-13 14:06:30 +01:00
Gusted 17e70e401c
[GITEA] Use restricted sanitizer for repository description
- Currently the repository description uses the same sanitizer as a
normal markdown document. This means that element such as heading and
images are allowed and can be abused.
- Create a minimal restricted sanitizer for the repository description,
which only allows what the postprocessor currently allows, which are
links and emojis.
- Added unit testing.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1202
- Resolves https://codeberg.org/Codeberg/Community/issues/1122

(cherry picked from commit a8afa4cd181d7c31f73d6a8fae4c6a4b9622a425)
(cherry picked from commit 0238587c51e2c749413ca5a63e47590399fe5a2b)
(cherry picked from commit a8c7bbf728326b992e000a3d19c8833610f960c9)
(cherry picked from commit 80e05a8245092b4158c6c970ca0563181b40f2eb)
(cherry picked from commit f5af5050b34891ff16a4ef1f8e3d805fe135238d)
(cherry picked from commit 608f981e551db5f38550b622646cc307fe0566b9)
(cherry picked from commit 659186750201672391223fe4584b292e2ae26c62)
(cherry picked from commit b7e6dedafd84a7f240d7e36ce414659d3ecb7a84)
(cherry picked from commit 1cd196da49cbc352280affe8b391c70c95f64a81)
(cherry picked from commit 4c74fd4a041d19a9e0fd2280e00c1476e3f162a3)
2023-11-13 14:06:30 +01:00
Gusted e8b93e8de6
[GITEA] Tidy up archive modal
- Make it consistent with the other modals of the dangerous actions.

(cherry picked from commit 576d7ec759baefd2382d565212c3168e38bbdd75)
(cherry picked from commit 8b1225f9742cc0d3942824895923cbc8e9d49d04)
(cherry picked from commit c2c47972ee492686842b1623f9fe941a0e599f0a)
(cherry picked from commit eec301806b925388585546edc6407e3f6d644f44)
(cherry picked from commit 6b5e728f0aaa87e2711c1c2d2111446fc412e0ca)
(cherry picked from commit 3681691e65a73ef59205b066320c9ce58d4d80e4)
(cherry picked from commit 0d6f131e2108f2d5657f946f8572ae6d6047d385)
(cherry picked from commit 7ac510074bf3c1d95b66a2ecd472435146efc52b)
(cherry picked from commit 2d561205d24b27235439ae756c8d3f82b8b4899a)
(cherry picked from commit dbb4737afe87a7d6927a8496fefbe0380e5fb03d)

[GITEA] Tidy up archive modal (squash) ctx.Locale

(cherry picked from commit aa682a5f045170873996ad5e64e229b5d1d8fb6a)
2023-11-13 14:06:29 +01:00
Earl Warren 00c8b16b8c
[GITEA] enable system users for comment.LoadPoster
System users (Ghost, ActionsUser, etc) have a negative id and may be
the author of a comment, either because it was created by a now
deleted user or via an action using a transient token.

The GetPossibleUserByID function has special cases related to system
users and will not fail if given a negative id.

Refs: https://codeberg.org/forgejo/forgejo/issues/1425
(cherry picked from commit 97667e06b384d834a04eaa05e8f91563481709b1)
(cherry picked from commit 8ef73a09c9cb08e536aff7df8fc715c8d48c7c4f)
(cherry picked from commit fa8a00d26420ef56497203a5c607b3d336feb813)
(cherry picked from commit 2ada2074b56f3cd981dbacac0a7b1033ff486ffd)
(cherry picked from commit f9a59b940a2ab2c9abac7c346da24b22d15017f1)
(cherry picked from commit cd82834043c14a679cc55eba980c27549b2f87e5)
(cherry picked from commit 7fb032c2400386d6edba769452e1735f32ac3f78)
(cherry picked from commit 64438ff837f411656c0456864bd9be2c47f37311)
(cherry picked from commit 8174592b298eb2f3a34ed67a836739cc9c9e5a42)
(cherry picked from commit 46d36555f91313fef6c15a74cefe9860650b1b86)
2023-11-13 14:06:29 +01:00
Earl Warren e54348f67c
[GITEA] enable system users search via the API
Refs: https://codeberg.org/forgejo/forgejo/issues/1403
(cherry picked from commit 87bd40411e3af7eefce55e2a05475a8b366caa6f)

Conflicts:
	routers/api/v1/user/user.go
	https://codeberg.org/forgejo/forgejo/pulls/1469
(cherry picked from commit 74f70ca873fa516e19eeb379dccd0f1fc8fba73b)
(cherry picked from commit 673a75bb43fb2808e49df9cd1dc51c075ed1463c)
(cherry picked from commit fcd4535ac66609d6e76079af4f97300d31554bee)
(cherry picked from commit 56b229f22e55f6e2f6cca8e596cc6d749026eceb)
(cherry picked from commit 45b922ae76ef27c368afdb2fe2003f27f65cb470)
(cherry picked from commit 03805f3bf45a5617bb92ee2d473605e74a405abb)
(cherry picked from commit 16c67f70d54f78613ca8c894613154079e8f0761)
(cherry picked from commit 1b862a14adfd0673c65b44485d5a705e0905a60c)
(cherry picked from commit 4a5cdcf64934ac905c2cb319ed6518900b329693)
2023-11-13 14:06:29 +01:00
Aravinth Manivannan 9acd6ff137
[GITEA] notifies admins on new user registration
Sends email with information on the new user (time of creation and time of last sign-in) and a link to manage the new user from the admin panel

closes: https://codeberg.org/forgejo/forgejo/issues/480

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1371
Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
Co-committed-by: Aravinth Manivannan <realaravinth@batsense.net>
(cherry picked from commit c721aa828ba6aec5ef95459cfc632a0a1f7463e9)
(cherry picked from commit 6487efcb9da61be1f802f1cd8007330153322770)

Conflicts:
	modules/notification/base/notifier.go
	modules/notification/base/null.go
	modules/notification/notification.go
	https://codeberg.org/forgejo/forgejo/pulls/1422
(cherry picked from commit 7ea66ee1c5dd21d9e6a43f961e8adc71ec79b806)

Conflicts:
	services/notify/notifier.go
	services/notify/notify.go
	services/notify/null.go
	https://codeberg.org/forgejo/forgejo/pulls/1469
(cherry picked from commit 7d2d9970115c94954dacb45684f9e3c16117ebfe)
(cherry picked from commit 435a54f14039408b315c99063bdce28c7ef6fe2f)
(cherry picked from commit 8ec7b3e4484383445fa2622a28bb4f5c990dd4f2)

[GITEA] notifies admins on new user registration (squash) performance bottleneck

Refs: https://codeberg.org/forgejo/forgejo/issues/1479
(cherry picked from commit 97ac9147ff3643cca0a059688c6b3c53479e28a7)
(cherry picked from commit 19f295c16bd392aa438477fa3c42038d63d1a06a)
(cherry picked from commit 3367dcb2cf5328e2afc89f7d5a008b64ede1c987)

[GITEA] notifies admins on new user registration (squash) cosmetic changes

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 9f1670e040b469ed4346aa2689a75088e4e71c8b)
(cherry picked from commit de5bb2a224ab2ae9be891de1ee88a7454a07f7e9)
(cherry picked from commit 8f8e52f31a4da080465521747a2c5c0c51ed65e3)
(cherry picked from commit e0d51303129fe8763d87ed5f859eeae8f0cc6188)
(cherry picked from commit f1288d6d9bfc9150596cb2f7ddb7300cf7ab6952)
(cherry picked from commit f664f41658e4f2b7948a394822d77f2b9f1d0235)
(cherry picked from commit e44e6c7e47b33aafb97ae61268aebe33453db063)
(cherry picked from commit c0d958cc4c31242fc91a85a4bc2ca6dcc02cebb7)
(cherry picked from commit a88baa5e48d49e0bb33edee332802a4c2b55a510)

[GITEA] notifies admins on new user registration (squash) ctx.Locale

(cherry picked from commit 2f6329f6935c4d9055dc6198e41ee01e46b3b494)
2023-11-13 14:06:27 +01:00
Earl Warren df257aee22
[GITEA] [picture].*AVATAR_UPLOAD_PATH is legacy
(cherry picked from commit cb4cc01825458752efe01628f705b4f8676e49a2)
(cherry picked from commit bef11d61318a462e34202f78fad7f883b0756a88)
(cherry picked from commit 077b1c52b6e330a66aa55c4e29562278e94026d1)
(cherry picked from commit aff7aa08587855b71495fa52c301d653a42da38f)
(cherry picked from commit d2f8f6eacbc669a3ae800304f0f8b3f5a11e1a11)
(cherry picked from commit 476bd3c4910d15fe7e5f68abc304fd4e3166edaa)
(cherry picked from commit 2b39e973be4e72b20f26a40aed894b67371f563f)
(cherry picked from commit 822f25de53ed9afaba3d6d8a2200a717fde189db)
(cherry picked from commit ea4a31da3f026bc8574e16ea0459aec4045a4d92)
(cherry picked from commit a066b3d24f88e2b33fdfee65a3c855ea26aabfef)
(cherry picked from commit a5e05a53b2a702e683bef802a713423fc2157234)
(cherry picked from commit b2ec269f4b2b398291f542461774740c8d99f354)
2023-11-13 14:04:16 +01:00
Gusted 3715a6af2e
[GITEA] Use vertical tabs on issue filters
- This is actually https://github.com/go-gitea/gitea/pull/19978 &
https://github.com/go-gitea/gitea/pull/19486 but was removed in one of
the UI refactors of v1.20
- This is a very technical fix and is best explained in the CSS
comments. But the short version: When there's an overflow being set, but
you want an element to 'break out' of that overflow with `position:
absolute`, it sometimes doesn't work! You need to set some CSS to let
the browser know that the element needs to use an element outside of
that overflow as 'clip parent'.
- Resolves my internal frustration with the mobile UI constantly getting broken.

(cherry picked from commit 879f842bed999190506e1d60508e7aede1a4be21)
(cherry picked from commit 6099c9b41b9a135fb14b41304459056050abbbe2)
(cherry picked from commit 0749d00b160033de0457e17baa1e000e68810d94)
(cherry picked from commit ec6a5428a7f05d8e6d2e8a6c476b2b9d35656b0f)
(cherry picked from commit 9d0bee784d387fac026d3dcc09f10e496a99a7c5)
(cherry picked from commit 61d6ae48828cb83ca3668a28ba8ddcb7fcb471d5)
(cherry picked from commit 8b3f3639b60ac6f3de8f9fcd83ac7a48bbd659f0)
(cherry picked from commit 2c600ddb2c3e76598b9bdbd58026ab76d7590470)
(cherry picked from commit 960a9786ef62eb8664bca129e9d4fae22e98f378)
(cherry picked from commit b194354c3b489879b10774174cc91a6915b43abc)
(cherry picked from commit 4f00fa10469219c33c6ff0da8fbc788a84c36494)
(cherry picked from commit 1016f7e71a9baa9c450b70717472fafda1754f9b)
(cherry picked from commit 9a1a59a998e461d8e8c5d010356ab421764bda2c)
(cherry picked from commit 39563c5c84cc87848223ea4402c45e6257bd2172)
2023-11-13 14:04:16 +01:00
Gusted 0418c19287
[GITEA] Add slow SQL query warning
- Databases are one of the most important parts of Forgejo, every
interaction with Forgejo uses the database in one way or another.
Therefore, it is important to maintain the database and recognize when
Forgejo is not doing well with the database. Forgejo already has the
option to log *every* SQL query along with its execution time, but
monitoring becomes impractical for larger instances and takes up
unnecessary storage in the logs.
- Add a QoL enhancement that allows instance administrators to specify a
threshold value beyond which query execution time is logged as a warning
in the xorm logger. The default value is a conservative five seconds to
avoid this becoming a source of spam in the logs.
- The use case for this patch is that with an instance the size of Codeberg, monitoring SQL logs is not very fruitful and most of them are uninteresting. Recently, in the context of persistent deadlock issues (https://codeberg.org/forgejo/forgejo/issues/220), I have noticed that certain queries hold locks on tables like comment and issue for several seconds. This patch helps to identify which queries these are and when they happen.
- Added unit test.

(cherry picked from commit 24bbe7886fb4cb9a38c8dab8c44f4c9cbfa25481)
(cherry picked from commit 6e29145b3c1455498531593d38e6a914941a12cb)
(cherry picked from commit 63731e30712872bd2395eb3cf36d9996e5793645)
(cherry picked from commit 3ce1a097369c132654de70df707b867e47bd1c40)
(cherry picked from commit a64426907de788cc0937a7a2b16af4d2f26f7fe6)
(cherry picked from commit 4b1921569156445c58d9889602733da5934c7b95)
(cherry picked from commit e6356744359fa947c049827d60c2ea0e277e03dc)
(cherry picked from commit 9cf501f1af4cd870221cef6af489618785b71186)
(cherry picked from commit 0d6b934eba1c0e9b27b364791113aae816b6b366)
(cherry picked from commit 4b6c2738795002887844a106f2fed2ef1673eed1)
(cherry picked from commit b50517139cc62f214c1629ef2fd9bcaa37b46202)
(cherry picked from commit 6546dd1fc946e620a02b6d1afed7d5ac50655fa8)
(cherry picked from commit 3eda6890e6b840237f675a2873c102a6fc86b8f1)

[GITEA] Add slow SQL query warning (squash) document the setting

(cherry picked from commit ce38599c5141c7fc6bc054819f5ff1c1b45bda1f)
(cherry picked from commit 794aa67c68c8e24ac7301eb7ef767c6e2499a78d)
(cherry picked from commit 8227673deb1b93015f56e446b27c52a0013eba29)
(cherry picked from commit 8854d1d4dda72304f43ea8aa61a941701a5deede)
(cherry picked from commit 9121a0e21f7c5de89ba2d8afa9054c5fbf210fb1)
(cherry picked from commit 41bae2e42506e7db1d2b5e0af28ed3ac1f5d5713)
2023-11-13 14:04:16 +01:00
Gusted 67e512c863
[GITEA] Improve HTML title on repositories
- The `<title>` element that lives inside the `<head>` element is an important element that gives browsers and search engine crawlers the title of the webpage, hence the element name. It's therefor important that this title is accurate.
- Currently there are three issues with titles on repositories. It doesn't use the `FullName` and instead only uses the repository name, this doesn't distinguish which user or organisation the repository is on. It doesn't show the full treepath in the title when visiting an file inside a directory and instead only uses the latest path in treepath. It can show the repository name twice if the `.Title` variable also included the repository name such as on the repository homepage.
- Use the repository's fullname (which include which user the repository is on) instead of just their name.
- Display the repository's fullname if it isn't already in `.Title`.
- Use the full treepath in the repository code view instead of just the
last path.
- Adds integration tests.
- Adds a new repository (`repo59`) that has 3 depths for folders, which
wasn't in any other fixture repository yet, so the full treepath for
could be properly tested.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1276

(cherry picked from commit ff9a6a2cda34cf2b2e392cc47125ed0f619b287b)
(cherry picked from commit 76dffc862103eb23d51445ef9d611296308c8413)
(cherry picked from commit ff0615b9d0f3ea4bd86a28c4ac5b0c4740230c81)
(cherry picked from commit 8712eaa394053a8c8f1f4cb17307e094c65c7059)
(cherry picked from commit 0c11587582b8837778ee85f4e3b04241e5d71760)
(cherry picked from commit 3cbd9fb7922177106b309f010dd34a68751873dc)

Conflicts:
	tests/integration/repo_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1512
(cherry picked from commit fbfdba8ae9e7cb9811452b30d5424fca41231a1f)

Conflicts:
	models/fixtures/release.yml
	https://codeberg.org/forgejo/forgejo/pulls/1550
(cherry picked from commit 8b2bf0534ca6a2241c2a10cbecd7c96fb96558a6)
(cherry picked from commit d706d9e222469c689eb069ec609968296657dfdc)
(cherry picked from commit 6d46261a3f81d3642b313e76ad93c5f72fbd6bf8)
(cherry picked from commit 87e8ad2307da84ade5b201dc38028ba24d9a01ce)
(cherry picked from commit f728a5e89d45f4e55646829f43d2f7016a387616)
(cherry picked from commit 97534cd4a19bd6fc3ebecc3a5e3465efb1a91fb6)

[GITEA] Improve HTML title on repositories (squash) do not double escape

(cherry picked from commit 22882fe25cde57837a31738a10c71c9478e16662)
(cherry picked from commit 63e99df3d1ecb50da3b723848ca85d56b831a8d7)
(cherry picked from commit b65d777bc78fabf7e3d1bf8c50aff4eb5395d783)
(cherry picked from commit 2961f4f6320b4b38c33f33e7133e7f3d3f86bd0f)
(cherry picked from commit f7f723628c76c5c2a0678139fbc4264feea352ea)
(cherry picked from commit 9ed79158268160f62dc1b32183c9a487cd521ef7)
(cherry picked from commit 6d83f86cf0170a74299ab9d7f1556edb1e2ec891)
(cherry picked from commit 525f95cf1aab03ac22664670b43bc382b21e12f6)
(cherry picked from commit b68aebe0f58535395d4b94efff26d3c6f9551cf1)
(cherry picked from commit c7c12904ba2bbdf135da872fae0c7f20428bdc7c)
2023-11-13 14:04:16 +01:00
Gusted cd53d56c68
[GITEA] Allow release creation on commit
- The code and tests are already there to allow releases to be created
on commits.
- This patch modifies the web code to take into account that an commitID
could've been passed as target.
- Added unit test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1196

(cherry picked from commit 90863e0ab51d1b243f67de266bbeeb7a9031c525)
(cherry picked from commit c805aa23b5c6c9a8ab79e2e66786a4ef798e827a)
(cherry picked from commit cf45567ca60b2a9411694c8e9b649fd77c64bdae)
(cherry picked from commit 672a2b91e5612f438bd7951d173f42c223629fd1)
(cherry picked from commit 82c930152cd693f8451e9553504365c724e1fced)
(cherry picked from commit 95ac2508b3e8dd9fc2b0168600d989dbce0744ec)
(cherry picked from commit b13a81ab98a02e30d1b508bb89cdd67a05eae782)
(cherry picked from commit 9f463a7c1fa74ce17ab6ff8df49e2bcea3c1bc89)
(cherry picked from commit 758ce84dc58e0c689e0fcc34386c7a8ed50f3df9)

Conflicts:
	tests/integration/release_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1550
(cherry picked from commit edf0531aeead2f68bbb283e437494ace33a8d3b8)
(cherry picked from commit 44b29f3a1df81c072737b139cad34435313f086c)
(cherry picked from commit b851b674195ecf3020aba55c5f46704fa3405289)
(cherry picked from commit 59c22547d752f021d8747391dea66e51de7e5078)
(cherry picked from commit 1eae28475bc3d3f13fbf3b2e039f76ac87d593bd)
(cherry picked from commit a7b25047b11a14bbe7d585f686f0338dd3437434)
(cherry picked from commit 867cdf9fd13e9bc11d0f0f0007f667adeee8a58e)
2023-11-13 14:04:16 +01:00
Gusted 81647c185f
[GITEA] Add password length check on install page
- Resolves #271
- Ensure that the adminstrator password is at least `MIN_PASSWORD_LENGTH`.

(cherry picked from commit 28cb04c3f5040980e716ce66cd5906f324257e02)
(cherry picked from commit 95371ebd92cd005e2d50a4754e60525cf6135b86)
(cherry picked from commit a134288ab6b0291082d913c4e22456b31af58af9)
(cherry picked from commit 4202f052cb32aec71a61dd2afd814035a9d85eea)
(cherry picked from commit 510b7467d3ee0bf346ad1843775affe1df0675ae)
(cherry picked from commit f3a6e1f121e89aaf608fd9890eaf06ed939d1006)
(cherry picked from commit f340508819866f355feec6d01b349fa7df29ace9)
(cherry picked from commit b891bb176d48c3855cc5b6e4573e7a337af9d382)
(cherry picked from commit 1a1bfc38cc7863f5cb3022560cacb2006d08f113)
(cherry picked from commit 083d5aefed10e54814c4438eabcd01973d305502)
(cherry picked from commit 4586096be9b6214058245da3227541866ea4312f)
(cherry picked from commit 039fa20cc8a5b50d5cc37de4503e8a9a80042bcc)
(cherry picked from commit 3ec9cb5f5915cd0bd46ca0d20d0ab798dc7bd135)
(cherry picked from commit 00be0eee3727130966c34a3b95b10f2af06ea2ec)
(cherry picked from commit a1566030025df8cc83d20cbe2b6fb0f87304a1a5)
(cherry picked from commit 4d305e77742c181f68cd24724dfc685723a41b31)
(cherry picked from commit 51e8f21202ea766d69a4b3c26f44c6db07f47844)
(cherry picked from commit 9c3c4dd6725d34d00da215e24fad62b23e5c60df)
(cherry picked from commit 4c017d931b7cccba7d6463446bc5e6c827ba4c37)
(cherry picked from commit dae122958b5b4bf6479c367874435a2657b46065)
(cherry picked from commit ff583ed7d7afbe7947abec10ef737ffd6734ab77)
2023-11-13 14:04:16 +01:00
Panagiotis "Ivory" Vasilopoulos 97496c6c62
[GITEA] add option for banning dots in usernames
Refs: https://codeberg.org/forgejo/forgejo/pulls/676

Author:    Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Date:      Mon Jun 12 13:57:01 2023 +0200

Co-authored-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit fabdda5c6e84017bf75ab5f9ab6cc0e583b70d09)
(cherry picked from commit d2c7f45621028d37944659db096bc92c031dd8e7)
(cherry picked from commit dfdbaba3d6b7abf1c542b0ea41b7812b729cc217)
(cherry picked from commit a3cda092b8897e4d669cfcf2cb8b16236e3c9b32)
(cherry picked from commit f0fdb5905c3b22bec043530da15d2c52f6bc41c9)
(cherry picked from commit 9697e48c1f8b23d3dd1da246b525b63c3756353d)
(cherry picked from commit 46e31009a86db18a9b5bd8e2f535b198df90c437)
(cherry picked from commit 5bb2c54b6f55499937396339bcacd3b4d8fb6b5e)
(cherry picked from commit 682f9d24e13b83d89bd6b86324960f1b4fc72eeb)
(cherry picked from commit 18634810057ef88fd01b54cec33bd4bd04c53221)
(cherry picked from commit 4f1b7c4ddbc4099aa9b6fda1e0145d37f638e567)
(cherry picked from commit 6afe70bbf1290e604fc476ee27901d1722ac1272)
(cherry picked from commit 5cec1d9c2d2a731fa44f761e6c90f0d20ab3ccc4)

Conflicts:
	templates/admin/config.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1512
(cherry picked from commit de2d172473217e3437238fd9c691edc8d8524e1a)
(cherry picked from commit 37a3172dd9e2646157ec49ca46f94b9b0012b061)
(cherry picked from commit 92dfca0c5a8a8d4fd8a93b5468ba593283fc9452)
(cherry picked from commit a713d59b0cbeaf2fe023be1daa42165cd0df3b1d)
(cherry picked from commit bf18b10982dd2465edd91ea63dfcdf8df994b435)
(cherry picked from commit 11d77f40a1dbc6278d5b2b556526d7f0a128419e)
(cherry picked from commit 17ca5ff2d6ae6fdc54a047a037cb597c2c372aac)
(cherry picked from commit fc50a7f74eeb7514143527fc7983910932780a7d)
2023-11-13 14:04:16 +01:00
Earl Warren 7d86cbbba1
[GITEA] silently ignore obsolete sudo scope
Fixes: https://codeberg.org/forgejo/forgejo/issues/820
(cherry picked from commit 6a7022ebbb83bda162974028cff01ebcc7c574ec)
(cherry picked from commit 764eac47b50688d76fe90aad4819a426444ddb4a)
(cherry picked from commit 1141eb7b6f2deeeca0acf1714058823d32097cfd)
(cherry picked from commit 826b6509b6405ac0a0731ee0e1477ad2cbac585a)
(cherry picked from commit 9990d932b8b72f9a27b6529b350eb09d44b7ef88)
(cherry picked from commit 7eca57074385f296427d06c059d331d3704ccf15)
(cherry picked from commit 66e1d3f082a99bb0006daf0f337850f251c235dc)
(cherry picked from commit 188226a8e6b2926f1f276462741f7cc4d7a050b0)
(cherry picked from commit 4cd1bff25c6cafa33464594c99b39326a6dd5740)
(cherry picked from commit fad6b6d2c49492297d9d8512afc0369e544a6e75)
(cherry picked from commit 5b25c3d8512466fd5fceea86b550bdb35c3aa04b)
(cherry picked from commit 4746ece4dd018af781181744fb8743e83b64c6df)
(cherry picked from commit 2a6f85afb33a1a0b7424c30de3cdff030f483294)
(cherry picked from commit c027d724ee0b694e48d2b7ee1915ba55222a03e0)
(cherry picked from commit be2f1eeaeb92e552b5defcf8b374ceb4c3a6b1ee)
(cherry picked from commit 3058a54fe99c7cf0a015166b8b3f56f9ef9e45d9)
(cherry picked from commit 53936d38a0cb1649748f02cf86ec684fa76825b6)
(cherry picked from commit 311983cc978cc0a3128cdd8a9c12ac9605be62b9)
(cherry picked from commit 1651ae757b31c31023d5e780a4446da5be8951bf)
(cherry picked from commit d3dd8ea24dfd6fcf737eb16dcd0871a835b90477)
(cherry picked from commit dd9d929ff0da9bdd359e20975f9cb57f835af4a4)
(cherry picked from commit ed8c1a4a3674733f07ea5ff42e1a33b19b2a408c)
(cherry picked from commit 4a4cb830de79406bbc1c2a3609e3c24fe5de5310)
(cherry picked from commit 06a985238a033fc51ff8db2017248f5b6413af33)
2023-11-13 14:04:15 +01:00
Loïc Dachary dd7f17c279
[BRANDING] X-Forgejo-OTP can be used instead of X-Gitea-OTP
(cherry picked from commit 7b0549cd70aa7cafec853e15b25270847c59850b)
(cherry picked from commit 13e10a65d974c7b594681bfa36402a6144862116)
(cherry picked from commit 65bdd73cf27895a9fb8db2a95ef4f5b08951481d)
(cherry picked from commit 64eba8bb923176b4c286b1d0c83792f3c3005ca8)
(cherry picked from commit 4c49b1a759abe3604afc1121e83c9a942016ad6a)
(cherry picked from commit 93b4d0640683ea986657453b1fce49a00c861764)
(cherry picked from commit e2bc5f36d958f4349160ec145719c302d4023cd0)
(cherry picked from commit 2bee76f9dfa998c83ea4fe648997fad0b6224fa9)
(cherry picked from commit 3d8a1b4a9fb9dc55bbd62fd8855ea85e58dc263f)
(cherry picked from commit 99dd092cd02d7af8374acf454833ce1c05fd4fd9)
(cherry picked from commit 0fdbd02204d533f907cd22c83c73bf0156ec4a88)
(cherry picked from commit 70b277a183c0d85966fa84e9b054f164ae2d2a44)
(cherry picked from commit 3eece7fbb4e67d970d8979d0d60a58ee2a195ea5)
(cherry picked from commit 4838fc9e1145a74c56926de68854234604b5e38f)
(cherry picked from commit b76ed541cf4d73702a83d6b96f8618b6f8c44393)
(cherry picked from commit dcdfb5b65c6fbf50798a0c49d0f879dd1285ee41)
(cherry picked from commit 377dc48cdc3b1c2bcc95f86a7bf3602468ac5c39)
(cherry picked from commit acc862f411c79f7832c8ba2c182af738f25f4f8b)
(cherry picked from commit ac75ef101f89d58442760cec21a3f3f9199d4710)
(cherry picked from commit 08f2d9f7c5b0d51358b009b0b38b626b231ec32b)
(cherry picked from commit e4096f0b6441ba68719146e5a48ef44233e27a86)
(cherry picked from commit bf5876f06224ac90e931f2f47b66a5b9c38b2a87)
(cherry picked from commit 7dc60637e5e097b5dbc38e068ee7ba553385b496)
(cherry picked from commit ef3101774ba5083e259d84db9997ff0aaddab14c)
(cherry picked from commit ecb9e8867c3503387cbaf97df27d8c60a840f4a4)
(cherry picked from commit 64f0ae72fec30ea443d73f8566c140682e7b9838)
(cherry picked from commit 8dd6ec786294741361f79c08b0c051d2258bda02)
(cherry picked from commit b36723e52b975d2e57af363db1d9118f48feade1)

Conflicts:
	modules/context/api.go
	https://codeberg.org/forgejo/forgejo/pulls/1466
(cherry picked from commit 5c378e0cb823f2bad52224859ca326afb33bfd4b)
(cherry picked from commit 1d87602819be9f87bf9d06203c37160568c18e78)
(cherry picked from commit 0f72002d667224a75a4924ebb5557eca8bddbe70)
(cherry picked from commit da2556eb13a2c976d1630315dbee8c3bc5444a11)
(cherry picked from commit c01688cd900369b8cbed961f6a841ea536b07207)
(cherry picked from commit af4bba832962ce4db3327c140283ce5b8d2cf6a5)
(cherry picked from commit 33ca322c2ea7b05fcab084e06f8b3a6d65125808)

Conflicts:
	modules/context/api.go
	https://codeberg.org/forgejo/forgejo/pulls/1739
(cherry picked from commit c18e374d4481592681ae127b723f11076c37bb91)
(cherry picked from commit 27c4797c9fb3c42be252223ac0add0605f18acba)
2023-11-13 14:01:40 +01:00
Earl Warren 76388e2c38
[BRANDING] add the forgejo webhook type & update webhook docs URLs (squash) ctx.Locale
(cherry picked from commit ecbc5c6b7add40122914fd3f11a2b43e63a3a5fb)
2023-11-13 14:01:11 +01:00
Gusted 8fdfecea8e
[BRANDING] security.txt
- The [security.txt](https://securitytxt.org/) is a standardized file to
help with reporting security vulnerabilities, by having the most essential
information served at `.well-known/security.txt`.
- Brand this file to point to the Forgejo security team.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1192

(cherry picked from commit 7ca1d0ec87bc23881f59ce3ea04390bf508ec0fa)
(cherry picked from commit ba974b016199cd279b8c7aca76a936910e9f4d69)
(cherry picked from commit 966fbcdcfdc8027aa31fe46eafa229854fe120ad)
(cherry picked from commit 8b9efebc6e5a211b64b003284bf3bb8c66c85662)
(cherry picked from commit 91b1c84c1873b6e07ff7e700429a4fc6f6c1e3bf)
(cherry picked from commit 30ade1ea0b6de3b634283bd3741b49abf37f9bf0)
(cherry picked from commit 15ec35014e1afda4010e1956722ab9ba78d53093)
(cherry picked from commit a5e8bb4a93ede29c077d246c984d4aa0da70a4ec)
(cherry picked from commit 273b03888f4e71009474a384c38cef605d2763a2)
(cherry picked from commit 69b6b53fe5d94ab34d3f47d2327e1915fa883cde)
(cherry picked from commit b00a74917ce3167344140786be49c185a5b8cd79)
(cherry picked from commit 3ea219777b0bdfba6b1063c5eb20c4546710a208)
(cherry picked from commit 4be13aa6265e7f552ac6a4df9e5763b944b6fb1a)
(cherry picked from commit 03ddd40ab9cc28ae759f08d2af09171cb5b4aed6)
(cherry picked from commit 5a93b267b0a298faa084f90743dfc1dc9a284f31)
2023-11-13 14:01:11 +01:00
Rodion Borisov e1ad43dc0f
[BRANDING] Replace links to GitHub with Codeberg guides about adding SSH/GPG keys
(cherry picked from commit f409deabe6e45d9300b6195ec37868cdf3e3c65f)
(cherry picked from commit a62a3d0cf6b9a0bd119739c69086f25d61a66bd3)
(cherry picked from commit a28d2ddd5e4a0bff6a911f5c2cf1c4dedbea1fff)
(cherry picked from commit 2f8ac92a1772f388f2b491dab92c097e9271602c)
(cherry picked from commit d43c158a2fc68864898b4a9622462a5becf734ff)
(cherry picked from commit a2fc2dd1e28c9ec555b67c2f0271ab83749ef709)
(cherry picked from commit 00e6fa60d788d84c9a30f0fb3ef9f2ef7fcc5d52)
(cherry picked from commit 350f14bc8a1d88a2b0f9aaec6fbb36ac6fa908c4)

Conflicts:
	templates/user/settings/keys_gpg.tmpl
	templates/user/settings/keys_ssh.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1420
(cherry picked from commit b325b2653faa5e7069b1bf611363e91a6c403390)
(cherry picked from commit cb5f0513f27eb407818a20ce6d9689a535887fb9)
(cherry picked from commit 4d0fd211e007a275a92836e76e34a2dff06d536e)
(cherry picked from commit 91037812c363d8c698708ce896eeb7e2bf3ad11f)
(cherry picked from commit 636c505ad462f3524d0abd6cbc544e993e9386c1)
(cherry picked from commit 3a97587bd14f7b2fb05a62e85173644acbf54151)
(cherry picked from commit 17cdb0ec236f9865cc110161dd2aefde6e0ac99b)
(cherry picked from commit 32a4a7bb8d926daeae432648e2c3131794f8fbd7)
(cherry picked from commit 8ef217448bd6bf69364418b83bcc46a010cd2ec5)
(cherry picked from commit 2c20466a3fa6099f76a92a06217ecf1fc352004b)
2023-11-13 14:01:11 +01:00
Loïc Dachary b5b73fe667
[BRANDING] add forgejo target to Makefile
The gitea target is kept as is, for the sake of compatibility with
build systems that rely on it. The forgejo target creates a hard link
with forgejo.

(cherry picked from commit ce156c7cb4265e3d94ad41db26d6a5be9667200e)
(cherry picked from commit b2cb23282534cfdf756fcce3e494be756841a9d1)
(cherry picked from commit 85543c22bdd3cf268c77055f644dad42ff4f456e)
(cherry picked from commit 302955a20d3130ef83458810ca6368c612c0a76f)
(cherry picked from commit 4b1be0858ef652ad79c69c1d6331884408cbc2cb)
(cherry picked from commit afed1a6e202386588738a7af08562b9073a5f992)
(cherry picked from commit e81304bcd167c2ca838b2c89db47c44c59a48543)
(cherry picked from commit 479cd51a038b7f98f576dda946595885327082f7)
(cherry picked from commit 8baab7c0c1b826884b02649ec5ccf34d01f0e9d5)
(cherry picked from commit 5d25ad9f092e9ee3066de6c002d1e3169aec884f)
(cherry picked from commit f36942789feb73f48944e570dbf65a570a8dfb23)
(cherry picked from commit 9abfbae8a0f9eafa762c002951494fbd520c6bd4)
(cherry picked from commit 079e0efb011b761b1948623b26737d55ad2e6b36)
(cherry picked from commit 9c8202f438d572474bdf0e61302982fcaaf767ae)
(cherry picked from commit 6c33975513ecda503f021f1be4770b594981b061)
(cherry picked from commit 82d60ad05817febaa09f3ac9a78eb4f3029a92c5)
(cherry picked from commit b4593e0668a1678dc066fd99607c81cb1598234c)
(cherry picked from commit 3172c99a08c9f49eb748292dea5d57c2ce8a3e63)
2023-11-13 14:01:11 +01:00
Earl Warren 24fed529fc
[BRANDING] parse FORGEJO__* in the container environment
(cherry picked from commit b0759917479ee17ccb11773176dbc8a75323c5cb)
(cherry picked from commit da3f76228e24d2276784ad7e1a03a34d094750e0)
(cherry picked from commit 20d196e74f9d7827cd812e3eb714eb87e888b6db)
(cherry picked from commit 0bf8b1824eac416ddb40fd2e0d7605573ba087a3)
(cherry picked from commit 655bb770a7cf65ada5d3e214ec23219e6cb19df0)
(cherry picked from commit d69d5c2c46f00b041beeb67a6238c5193ce9710a)
(cherry picked from commit 00b55e5a5396a49a6798a3ae2588e412637a77c6)
(cherry picked from commit 456121fd8a4c0c30f7854bd04907f2a0a583d27f)
(cherry picked from commit 9716a158e48ad6333f46fc0806a838603606e5ea)
(cherry picked from commit 7d60a6f5116124b72927a52db0dd36af7a9c3621)
(cherry picked from commit d32a6d9437a38ac35320ad7329eece1ab2bd54d1)
(cherry picked from commit ee1de38527ea1fbd52c319cfbbca24deef951fc1)
(cherry picked from commit 54e7799d13fa041be172d4a05d036cee43e390d4)
(cherry picked from commit 4f04da7ab716ccb1f2816842cde62965e89a852a)
(cherry picked from commit 3e001364ebef3c670e21ed0b7c91a1b4ec8b1577)
(cherry picked from commit d2d5193b388d4b36006a36a5d2145356ff28eec9)
(cherry picked from commit eb1f015c4218c93067f92ab401d6a6973aabf952)
(cherry picked from commit c4587aa893f809dd64418519e2bfc7ebbde4c48f)
(cherry picked from commit 6e340be917725254000c4bc01c22ca00f48142bd)

Conflicts:
	contrib/environment-to-ini/environment-to-ini.go
	https://codeberg.org/forgejo/forgejo/pulls/1773
2023-11-13 14:00:15 +01:00
Gusted e35b0a2130
[BRANDING] Use forgejo binary name
- Use `forgejo` binary name for migration suggestions.
- Resolves https://codeberg.org/forgejo/forgejo/issues/869#issuecomment-944501

(cherry picked from commit 418a0bed8f831b72b206ca415d99c99824bec839)
(cherry picked from commit 734579ce9b0f66b61b4a08f605695af9db1d4f4e)
(cherry picked from commit 34bce5be193505cfc58a115dcd42a5d5912cb250)
(cherry picked from commit 9c788a6ec03ab413fc346386a6db846d1ca3b3e2)
(cherry picked from commit 6cabe323115d3e56f0eab1fe1d9eb384e32486d5)
(cherry picked from commit eba83a24408d40a922aee168ab7518fda0d488bb)
(cherry picked from commit 271c4586b2f2d88c8abcb3a514e02d579ee0fdb6)
(cherry picked from commit 60883a4d68e0d15faec91df3a88644f5a4761ac5)
(cherry picked from commit ec1f866ccb22fba03ebdabb2a09fb149c9efcd4a)
(cherry picked from commit 3689fbe53c426e7bd728ba35c0c744b952c93298)
(cherry picked from commit 8019b115b640d744233b9652efc8895294ad4103)
(cherry picked from commit 0d565d655b282382f910e6a6b74808852ebc6c0f)
(cherry picked from commit b3f72a1e118da558bfc72cc2ba42adb38f7b2e4b)
(cherry picked from commit 1bd8eab96db30c4690d7f39c9585d9edcbb80032)
(cherry picked from commit 1b0e01e40713f0e5e41318857c96e18d8156ae96)
(cherry picked from commit d2551dc9b75b002c35ffcd2d9d49a53e79f29341)
(cherry picked from commit cbaead8c387f8d9f25f3e914d26fe80ced5a5e17)
(cherry picked from commit cdab2d7a542ccea3e7d983f8993a14549e8f215e)
(cherry picked from commit c168d9596eb3ce4f2138371aa98954923b4659da)
(cherry picked from commit 8f2bddd1d0aa2b5daf73f9493cf017a887a84f37)
(cherry picked from commit e3e948e7dacb1548d74968efb6434d46fb42074d)
(cherry picked from commit 487335064164d9464dcdf6bd948f7772aeb5282c)
(cherry picked from commit 218eb62bb6f8f595c01b8f7a1ec91b74a84bae51)
2023-11-13 13:59:40 +01:00
Earl Warren ccae772031
[BRANDING] systemd service trim WatchdogSec=30s
Refs: https://codeberg.org/forgejo/forgejo/issues/777
(cherry picked from commit 11b646dc6a59b3fe3873b8f70d08498e655b5cc1)
(cherry picked from commit e37847b9e689405a414d05a9875a28fadfde0910)
(cherry picked from commit 794aa9dbc8d6e8739b709f138ac7173d02f00a33)
(cherry picked from commit f4d3bfbc0da58505331c8d1060e44be2dbddffbb)
(cherry picked from commit b48faeaf29e783c397bccfd45e62303aa43139da)
(cherry picked from commit 150c44c903c7d77733836947e6829560816eb3ae)
(cherry picked from commit f1b4bc7c908045b58655196f86a28843c6e30cc1)
(cherry picked from commit e1ef3c5a71b22392a96eccf88b00f8ec95fab2bf)
(cherry picked from commit 84399c24e0bd2bfba9cc8a0bdc9c946270c81628)
(cherry picked from commit 8242651ab3ffb4a04e3fe3e35745b7772ab40b03)
(cherry picked from commit 97a13e6a263f41f6d15e18da7260ed70c41e6c28)
(cherry picked from commit 2b00b6477bd2e397c7c5327c3e3e4a8633b3218c)
(cherry picked from commit f3870ed880eced44e1ea7d214cc8a6d2207de0ee)
(cherry picked from commit 4d14ded61108e9d43dfc8da9d779620ea1388004)
(cherry picked from commit 07c4ac8a33fd067481d11527df4ee29007ef2f1c)
(cherry picked from commit f5b206fa8015c8ac302fcfcda9eee97642ebf06f)
(cherry picked from commit f078734a9a16461f524baaa305d14a1382d10103)
(cherry picked from commit 37de4c1d54eafef63f8c346f43b8ca8c9bdf461b)
(cherry picked from commit a2c15661310afcfb2bac5d2e6eb8442069a42d3a)
(cherry picked from commit 948265fbc37c8468eb43d845a24f86db9da97ace)
(cherry picked from commit e108e63ceaf4eda287ab3fa0f31293ab74ca9d87)
(cherry picked from commit da8008137b3e1d5c1cdef3a857c8c93c02540aaa)
(cherry picked from commit d6012dc11434c3ba68196632a4e263d2fe82bbfc)
(cherry picked from commit 4355babfe55a5acafac66b70a2a2ce4019c01500)
2023-11-13 13:59:40 +01:00
Earl Warren 19ac06d7a7
[BRANDING] systemd service Type=simple
The problem is Type=notify - when that is set, systemd waits for a
signal from the service that it's ready so systemctl start forgejo
takes forever (or until it runs into a timeout).

Refs: https://codeberg.org/forgejo/forgejo/issues/777
(cherry picked from commit c127369bba3d36f34ef944679a4c40680cad4d2e)
(cherry picked from commit 883a7eb570d74c4fd7f44396556148ab88d54f58)
(cherry picked from commit 4dfa4c7d210fe33effe26d7a4b74395acd2436b1)
(cherry picked from commit 961163d010e107baf6b30d6da334dc569c1d2f9a)
(cherry picked from commit 6a058126287ed25f8b5a7790dea616d2a5506098)
(cherry picked from commit 112c419f0b365d64a025e56aaa9e424c7256b06a)
(cherry picked from commit f3cd60dee739e09189c3821d07c9330d7c247c57)
(cherry picked from commit 6fccc6bf0b11f973e911e95cb3d005a0c21216ca)
(cherry picked from commit 556862de70314d4c71a5cf60f5637fec673bac48)
(cherry picked from commit eb8e2880f717f84876d7155d20768a95172bf72f)
(cherry picked from commit 264d85330c38bff2590168d9cd149d55588613d6)
(cherry picked from commit 083e66a2b6f00d7b8ff247fd35572dfa13094714)
(cherry picked from commit c1385bca5521e34ac854f13467a57015558d368f)
(cherry picked from commit d61930730d1f89ff9150e89a2809d3d0184d6af8)
(cherry picked from commit cfc815254f56719bbd2c09faa3f3f39f1d9753a9)
(cherry picked from commit 613192ae64fbcfb8f0a10ab6fccd2e227c8e0957)
(cherry picked from commit bf830a0dab534efc33ca5376bccc72ea18e934df)
(cherry picked from commit 448ab09c560ca119fe7dc1f9c911b23bb97b7f9b)
(cherry picked from commit fb3e99edfd607f5f8e464329ecf9d0d85bc8cbff)
(cherry picked from commit eec550a9a4038e177d6c44a9ec4b72218e8269f8)
(cherry picked from commit a0ecc33160965acb661cac02c8f3f22fdd9ab060)
(cherry picked from commit 7f8b93e5dcae4e6b74cb6fb2fe54f1cd558ec597)
(cherry picked from commit 45a8af817acf75012a96d622748364156ea46c44)
(cherry picked from commit ded35c0c1ec725c96748f9106a15255f36737617)
(cherry picked from commit 710636a8fac67aef280e1a40019fd12ab3b39293)
(cherry picked from commit 38da0f9b290bab3d863837b7ed2bf1d22fea1871)
2023-11-13 13:59:40 +01:00
lauralani f1abce6ff0
[BRANDING] adapt forgejo/contrib/upgrade.sh
Reviewed at: https://codeberg.org/forgejo/forgejo/pulls/605

(cherry picked from commit ab986185d08a30e0172c4fcd7870803c31f843bd)
(cherry picked from commit 6068aed2a7f413e3196dd4cf704bc2cf63b36329)
(cherry picked from commit 0cbd599c0c418f9a53a039fd06d9861ac58dcc68)
(cherry picked from commit c3ef13588230e8eba9c42ddfddf966a20ab3f745)
(cherry picked from commit 0ba7194fa1cb709b40a6699a8bda29292999277b)
(cherry picked from commit 572a2a51252075c5e0e64b91c5a09c5b34353f71)
(cherry picked from commit dd0a7265e12abec694828381aaa4e1f1c4c634e7)
(cherry picked from commit 06bd195f4e9a963fead7295d9ca76ed185176675)
(cherry picked from commit 7f6100ab6ba2e0671cc2450f65d7b0933afec936)
(cherry picked from commit 58af04560a00b0f09ee8ba6ef3aa75cdf577edc2)
(cherry picked from commit 67a951f726dee99d7c035bf781c9c7253eba228f)
(cherry picked from commit 46e68309adf44ef2c6795d9de673a9327803cf7e)
(cherry picked from commit 9002654915ec16f1962f8408c39d5360dfd7dad5)
(cherry picked from commit 3f1a3a13113f186993856c77e784abb9f5917c7c)
(cherry picked from commit df1716deb446bd021c7ee4bd610fb0f06706613a)
(cherry picked from commit 8ace62b4135a944921d3ba1465bf89cb702b74b9)
(cherry picked from commit 30ab21f2642e29833eba9fbe75f9e7bd8b6ec3da)
(cherry picked from commit 7ec99bfc0da0b3c70c8ff9e5bc770c3e8a4dd495)
(cherry picked from commit 47a554c9b41db0bfe4e612838a5e30e234d067cd)
(cherry picked from commit c5aaf49d88c14f11b733ec6fb23f85f633a48196)
(cherry picked from commit 7fb42a78a41f1d3522a50d8193cb61e4df282acd)
(cherry picked from commit 336fd64a1f1fc70a9ebe3f238c591128abbfbb16)
(cherry picked from commit a7d590f7d71c2cdb37088f6f84ca3e493189583a)
(cherry picked from commit b6aa4a40e4eb4de1615c13a1aa5a511d668be967)
(cherry picked from commit fc195b0349d8c23d00ec070f6ca0448a4ae36903)
(cherry picked from commit 3c6799ad041ee5b749099b0852a1fa3f92847c40)
(cherry picked from commit 86830ae32be2fd31ac1287552d00cba0d11155b0)
(cherry picked from commit d269a417e60b3c0ed73e159810f78ef1ed54e127)
(cherry picked from commit dd023ffec9c96d0bccbd433f372aa7bda5877f58)
(cherry picked from commit 3bf68f71e0c8a787a42d74b4480bea68bb0492b0)
(cherry picked from commit 52002884b4a99d5cb25dad8f2a7bf1859bcd7c38)
(cherry picked from commit e276884b3b4591ebd87d96f404da53d2867da716)
2023-11-13 13:59:40 +01:00
Rychart Redwerkz 122d4b571b
[BRANDING] Rebrand dump log
(cherry picked from commit b92a65a23f8d586d30336c79596ee8a73e6c2dad)
(cherry picked from commit eaeb9f183ff9fdb9710b776bb26b0920e34065c0)
(cherry picked from commit cdbd0ebe5eb4db0c89e82893cba503bcdbfe7bbf)
(cherry picked from commit 8aaa4e3f4d67cb8f077ca1d115d04a9c966c18ee)
(cherry picked from commit 6d7d3f048e3639bc9683ff157f7d9530dfc2e1cb)
(cherry picked from commit 1b6a2971ad4c84e33ff882fdf81ca6f46ba3cb44)
(cherry picked from commit 4f7f35043daecefa0ddb5c6f3afcf033d091c362)
(cherry picked from commit 495a4351b160800723e159244f7aa843f536c926)
(cherry picked from commit 12d89b03a97dba8468a4526d9ee6af40643f9885)
(cherry picked from commit 476d49ff11d32deba7d087f097e656669f3a840a)
(cherry picked from commit d6e95828c3f13f6a79d5657764d245701500a57c)
(cherry picked from commit d043e8d69d942c0950180bbb3ab2c97783a022e3)
(cherry picked from commit b06027344270d2dbd724695e8084a39b2e7563b8)
(cherry picked from commit 20437285c553f8aa5c7a857c98d1680798eac592)
(cherry picked from commit 0bc9eee5f31eacae875668e3cd4ba399ad98d9f5)
(cherry picked from commit b9f843776f4a80d646743fd5cca2579ddf46dd5b)
(cherry picked from commit e6d64de500e4324d574d1715cb5dc49b7bf672fb)
(cherry picked from commit 5ce2ff2f8b7049c5b3e1ce5bebcaf40368ea7641)
(cherry picked from commit 659677cf886c396a76aa7426df312d5ff44ce094)
(cherry picked from commit 648a5d944e9e9bb1a9a09cdc37b311db0a7f3f79)
(cherry picked from commit a77c8be7042cc67c6043732cffabdeabd42d117d)
(cherry picked from commit 012cb570464deb87060322b43da872362ce69533)
(cherry picked from commit 2da63c976eacf9c481d9561539e2abd04c0b5ea6)
(cherry picked from commit 792ce8b1b7045c8559d39aaa4dc86ef24609034f)
(cherry picked from commit a4b3244712317fa64e27f8d471203648113759f6)
(cherry picked from commit 9ffc3571f184430502ce2b63c80e6f25661dd885)
(cherry picked from commit 6aadfd01201f5c715b2aed1a73a3832b9722d81b)
(cherry picked from commit bdfc590b568b72c6687e94c512ae06bb864d032a)
(cherry picked from commit 6d4f25799f1fa60ba586cf211ddb6aa8c59b4739)
(cherry picked from commit fa39bb1b0e5183481f1c8c6c9e27e37377561d54)
(cherry picked from commit b9f86b4dc5e600dedd5cbd9414268f3c247bbf98)
(cherry picked from commit d7102c20f3482856e3655d95dd1177c8a288ab6f)
(cherry picked from commit 9693ebfadb8cb2ef1625248fe5c803907f3ae0a6)
(cherry picked from commit cfb885b3a62f81310b68b1612df7bf32b27fe6cf)
(cherry picked from commit 35af68812be2ece8e45d7c717d90ef91403ce98b)
(cherry picked from commit 6264a883b5063d81c7dd4ea48a8ab638eef60ba5)
2023-11-13 13:59:40 +01:00
Loïc Dachary 6c03ad19f1
[BRANDING] alias {FORGEJO,GITEA}_{CUSTOM,WORK_DIR}
FORGEJO_* environment variables are set to the corresponding GITEA_*
variable when the cli starts. This approach is intended to minimize
the conflicts on rebase. All occurences of GITEA_* are left untouched
in the codebase and they are only changed to FORGEJO_* if exposed to
the user.

(cherry picked from commit e466f9d10e145a3ed750f0c86cfcafad5f141ea8)
(cherry picked from commit e33e95931b0d91c41433db68ddb19a8724b8ed80)
(cherry picked from commit 2cfc6519b7cbc758f8322fd7f7b84dfc6d14ae73)
(cherry picked from commit af8864373a65441c817dad1c3b696157c4024a7e)
(cherry picked from commit a0550ff3391f0575b72c3d0d1fdf1fcd9b51e4d6)
(cherry picked from commit 24dc0a5191a26fac0aef6b3a53fd58b9185edc88)
(cherry picked from commit e255eea2b48ad39eeb3eae227ca0d4fd4b667d99)
(cherry picked from commit 0c4f5afa7a37e6b805efb452b9d4166f7e2cec61)
(cherry picked from commit 42fce708d05d616ebbdfb2eecf384ad2fdaa1d7a)
(cherry picked from commit e7278c3c22b656e5730ec2ba0c1b4ee2ef6627ce)
(cherry picked from commit 0fb9ed7e0eb5db59ab5b574d3d69b4b161f50b0b)
(cherry picked from commit a98308aa4d6659f46f7f69996167f9c2f3c4e859)
(cherry picked from commit b8695fcbe04792cb75acb62fdf9c6dee237e8365)
(cherry picked from commit 4aee8719f57b40f8645905c10ba8966b29052295)
(cherry picked from commit 1c503c1ba7414fe0b960187bcc370b44c536ec7f)
(cherry picked from commit cf1ed8551e6a8abc56d3ed45b65b0e6ca4e1e891)
(cherry picked from commit c52459b088cd52bf3b11b68cadf95d738fd09269)
(cherry picked from commit 92cac277b28f9b68d3346f5dd463bc41c1952af6)
(cherry picked from commit 2c744f11189ca76de62be908069500d7dbfc2a8f)
(cherry picked from commit 989a98a8c52342fb146938c41c1db9a0818013f4)
(cherry picked from commit 9cf7052bd4c126618833487134cb39dbe6d58297)
(cherry picked from commit a13c9667e04555d38106bf7e63d57b05002b20ee)

Conflicts:
	main.go
	https://codeberg.org/forgejo/forgejo/pulls/1216
(cherry picked from commit a9c3cf060d76ece0664b05f03690bd3a7d8f7089)
(cherry picked from commit eb6d904b23bce2bc02ea96db0459b7b7a8e55cae)
(cherry picked from commit fd4878e4877ced8a65cb348c69220b688556a214)
(cherry picked from commit cc2cab92410e13abdd88c6ae8acfd17ee6e7fb0a)
(cherry picked from commit be523c63dbc7d3dc1f852bb7aee045cf2d9f74fa)
(cherry picked from commit 254d1a2f9a9751cb2e0d9475f2f6c7579120cd32)
(cherry picked from commit 1eecf4200e2c073c13675f769bd1254fdcc4079f)
(cherry picked from commit a01f5c3475991ae2dfceaa17ac3dd7adccce3d5f)
(cherry picked from commit b1ba7ce32131a4868a734fec1aef64bd96150fbd)
(cherry picked from commit eddfd96beb24604179ac80175e717c334cdb6d75)
(cherry picked from commit 7a780758c250f92344e9b49e578252e9ca04801b)
(cherry picked from commit afb88332dc50edd9f70c78d6e19b3b999fc87347)
(cherry picked from commit af0448d0003a7597887451beb69a59ab7a7ae614)
(cherry picked from commit bdfdc7e169d7ff93d4f284b6d14d934b74288e72)
(cherry picked from commit 01ba057565d8e7c0b7c852c16cc1c10ba10a44b7)
2023-11-13 13:58:18 +01:00
Loïc Dachary 3893187f7b
[CI] Forgejo Actions based release process (squash) gitea to forgejo
(cherry picked from commit 9c06a318b867ea8c60dd194ca393bac3b718b07b)
(cherry picked from commit 95859da3b40306c1e07277230c2f401ef8b82a13)
(cherry picked from commit e3a5f6c1ed4e5452f3664aa8d398805c3b9c0a51)
(cherry picked from commit 7b9b259c75e0b2b805a2239ecf7c85a3f0dbd648)
(cherry picked from commit c4a152c8dc4ab5d20c72f9f7d60ce6eee3be5cda)
(cherry picked from commit b00bf599efa97a18adac134a1402418785c5bae2)
(cherry picked from commit a7836ee2ee2638091f0f9ff5543548ae0bb94060)
(cherry picked from commit 3ea7dcbd5b196b6fc9115d49d50678a1a5940c0b)
(cherry picked from commit 454d705e830ade3a41a33341b82d4c8aff584dcd)
(cherry picked from commit 35e06c3009f4a1942222dc35cc0993a623164b25)
(cherry picked from commit 904468a38ffdfb8157dc4eaf92b3ba10c3a957db)
(cherry picked from commit 890e86815a5a33b2930150a7460cd96b4360ac88)
(cherry picked from commit bf9f94c63d8c15ce62881ccadc28681848b7ebd7)
(cherry picked from commit d025d061d14929aaabbfc4603099e32cb888ac3b)
(cherry picked from commit 32f209a8e1b2ee109f7ae8b150d4390318c0ff2a)
(cherry picked from commit 38ef6802fca7301f4cb03769e8d6dae1e256933f)
(cherry picked from commit 8a19bbd2a8160b7d3d5a1ea083507b4311070ab6)
(cherry picked from commit f352dee786d2541fbe360fe8f859d3182c632240)
(cherry picked from commit b53d9fc090b58848876b4f97e8ed03face85a63b)
(cherry picked from commit 3dae21f4c87c82b75515d3db43c1bbd4d9f3f1ac)
(cherry picked from commit 8b59e016c7a1eb3f6d0077d8e6f205b8bcefe402)
(cherry picked from commit 6f54ea6a0eb0f9c4360237f78eb76c55678547e2)
(cherry picked from commit ed8d90de6bb9513a2dcdc70aac446bbcaf0855c9)
(cherry picked from commit 26ffd3fcace55279091fe95074a65dd1c4b7758a)
(cherry picked from commit 287b3bbfb5a66e64d3490a282153bfd2393b7afa)
(cherry picked from commit ab81378d0c88def332f43843eeac23ef768bb143)
(cherry picked from commit f6bbe7e875e707fcbadf7434818edb897467a5ef)
(cherry picked from commit 8968f34edf064e6bffc3cc7054307c6303256acd)
(cherry picked from commit d3d914bba2bec4f50f9d71d347b510771df99656)
(cherry picked from commit 4e4006a990dd22c23ffd6e9b7e3af6aac1855d52)
(cherry picked from commit edb333569b38e38f94dbb769d793b53cdf39b96f)
(cherry picked from commit 6c1a4baa15aebd1b27b742097181b1ca4afbd31c)
(cherry picked from commit 51bda3bfc734eccee198d4ccb377520d7f16ccb3)
(cherry picked from commit 20fe02d76e132eb90ab870f24011705728c892d3)
(cherry picked from commit 953ef5e72389f64c94cbf2afd18ac2001d61b743)
(cherry picked from commit 9956151c29754c98aedef41772cdb84f246db59c)
(cherry picked from commit 94e0710fe756b4e00b1c76dfadac4f9d7f95001f)
(cherry picked from commit 0ff780ec3c7214bcfbdadfcc10bc0442d263fec4)
2023-11-13 13:58:18 +01:00
Loïc Dachary e003d403cc
[BRANDING] reserve forgejo-actions username
(cherry picked from commit 2a25be788bdf3b58b236cb2a9f503b569703a0c6)
(cherry picked from commit b270d5815c80f387759eecbfcb588e548f5ed956)
(cherry picked from commit e7382cc71e43c52abcabc59d09128450ce415d26)
(cherry picked from commit 665400ea1e92405f41590bccf800714440ded50a)
(cherry picked from commit f5b2c691f17d6a66fd8041a83b36194f7d630339)
(cherry picked from commit 3df97adfefac63ddd1d44cc553a2c81087706d47)
(cherry picked from commit 494f6eafc15f235cd7ca5d4f01e7ac16eea8bd5b)
(cherry picked from commit 822e3d2c833e2a92d337812a93a6c78638b14456)
(cherry picked from commit 7460f1256852256048e7a7eb1dad108a0caa3567)
(cherry picked from commit f6cd70881e828688a73f277252cdf1bf1904fbe2)
(cherry picked from commit c669ce8173f0f819834436fd571d25c8678ec187)
(cherry picked from commit 1d5a433e0282681c6ebcd9ee0cb5deb644509f7d)
(cherry picked from commit c1a4dc150c617a8210c5907e9d93e41f01a01a2f)
(cherry picked from commit dd1c971c6c86ae80323c47084eb724d305428943)
(cherry picked from commit 8d2dcd9b1ed055875bdc123aab6bf6ea54539296)
(cherry picked from commit b6bb8fd2750c76454cbc014134d3a6049021ca5a)
(cherry picked from commit d4b71fe96e043389453a6595ccae0faae0113ca3)
(cherry picked from commit e204ec0b2359b85bde65d2b56463dd8e3655405f)
(cherry picked from commit 8d9f1174bd568fa8c74e433981b3bf79ba91bfbf)
(cherry picked from commit e314a7d5ba2aea572bffe8c69e36cc60ef7663f5)
(cherry picked from commit 48b3ad5a303900474ad87014d90889c9fd4a9b9c)
(cherry picked from commit 71ed4b7c694ab6ac7e2647274b202f49c9502e0f)
(cherry picked from commit d63324ccb647a93c026a5a01ccd79cd73ec8b600)
(cherry picked from commit 9249e893dbb096418945a462d35327013f865bbc)
(cherry picked from commit 78f156427b6ff2dd6e7dc4092f7ea4e18786cdb0)
(cherry picked from commit c3d4a1a602712ff64f152a0c78d2ac438b957dd4)
(cherry picked from commit 83b1855f559e315143cdd82bc9f028c1302cf9b2)
(cherry picked from commit 319815d9b1634dfe99b00fb8334d4342280b5d57)
(cherry picked from commit c4fcbfd2972b533e85e934ba5f23478c52b86dea)
(cherry picked from commit fb58c852229b8944725d1fe48496cf2e7878af34)
(cherry picked from commit 69c24e3e8b2775e0ff8d4dc95573ad922f8f0be8)
(cherry picked from commit 1e9ec4737a2a514253038ccda5b05436c216ab7b)
(cherry picked from commit 70439970c1f1b0d19e8084fe819665a780a9f6e7)
(cherry picked from commit 7e6146c1a85108fd2226e3d403cfd81617fdf3f1)
(cherry picked from commit 2668d9222096fd4f4616f493ddd1156d52486e8b)
(cherry picked from commit f60fe5c8ead888ee6969209105844fda33a1eb5e)
(cherry picked from commit 1167fd8352a3b474750b9435e9b1ca56e1987dcc)
(cherry picked from commit 92a49af7ca1a183dd2be1b275851cae9da7a3157)
(cherry picked from commit ee9501444847a8cfbc8913d94b1ee64fc06e70f0)
2023-11-13 13:58:18 +01:00
Gusted 2f6eae911f
[BRANDING] Update nodeinfo branding
- Change the values for the nodeinfo API, to use branded values.
- Resolves https://codeberg.org/forgejo/forgejo/issues/257

(cherry picked from commit 4608c57688d8b12dbc265dd21bfe7cd269efb116)
(cherry picked from commit e837e8a52943f803a40cd0151e24f7fe8edb11ec)
(cherry picked from commit 6601328d3ce9b57dbaa768dd2d41295293ff94f9)
(cherry picked from commit c6be21d4870e6b748a85f0da19bd4b717875b224)
(cherry picked from commit 5adc6ffee2e6f1af72039747df809aa6ebd2198f)
(cherry picked from commit 2ff8d166ac1e56ab7a349d70f875bd2ae9763418)
(cherry picked from commit b6a90e7e5af0e998cbbf1fc1edb901ae31090999)
(cherry picked from commit d1089e706cda009a6a23462adf498fd24a609b0a)

Conflicts:
	tests/integration/api_nodeinfo_test.go
(cherry picked from commit 7a29df737d979abed4d37f084e3a92ee788d2c6e)
(cherry picked from commit 3655a30c60229167bc007e139d0461a5648741d5)
(cherry picked from commit c90d61141016ffbbaaa6b4f4657dacf5446f30c0)
(cherry picked from commit 0274bd8860bd00de628fba990e42bf7385ddf5b9)
(cherry picked from commit fdb786b71decd1c968f7c473c94463140f192fc3)
(cherry picked from commit 4f08f100a19886210b89d1cacfd09e6db0e48fb7)
(cherry picked from commit 56a27118227521fae93e052bb77265fb10c6dcf8)
(cherry picked from commit 3b2cfa452df0d2651a75c5e3fcd442c38acff109)
(cherry picked from commit 773ddcf956a897bbaa75aff3087f8a64b254239c)
(cherry picked from commit fe8321ed4e9dcf0df2dffb64b0245ec1ae8f075d)
(cherry picked from commit a94833643b6796000a69c7ff4dfbc0b5df98b0f4)
(cherry picked from commit 3fdbda7639f0690b1dc8b046a9b1979571714d41)
(cherry picked from commit 7bc63d2cd3144d00cbc9429297b994382140bd5d)
(cherry picked from commit a36400d9cf4392573d8bd13ded54a4c5689dd541)
(cherry picked from commit 2535ab42016132c2ee7882d3eb5eb42c00ed7e63)
(cherry picked from commit 692e72f4f64b4a0251ac7ac99a268b531d73c6fc)
(cherry picked from commit 265021f3e9f327da96df695f90d6e9d0a23dd824)
(cherry picked from commit bc833125d6b0a3c7b0fc117e3bb081cb9ec6f02c)
(cherry picked from commit f1f9f881559c4117a547afaa379bcd0c26afb1aa)
(cherry picked from commit 6076461ad7a77e77ecbd9963689435496d1852e6)
(cherry picked from commit cd1da0aa2bac7270b3da2c5b76da2ea197a2f32d)
(cherry picked from commit f4e9a251d80363360bbcd9280c68421e87ec1630)
(cherry picked from commit fed4a421acf90bbce18c120ed08995f8f212bcf6)
(cherry picked from commit cb3ef3211768a1725198aeb547937329a5f98b8e)
(cherry picked from commit 232eec1945c0adcc61b6a4e855fcff0d346c3ab0)
(cherry picked from commit 1390cd433a51f99c0fa5508a78f3160e5af8da69)
(cherry picked from commit 26538623f8bf6d11fcd24c6f5d35933131dc804f)
(cherry picked from commit 4991098dde015855e89c746580b7891d4939070e)
(cherry picked from commit 751103939332b2f7bfbb1fb044c402d72bc2ed99)
(cherry picked from commit 54c4fa77ee00587b93ed43967d77522a8a4a12ed)
(cherry picked from commit b93b2bf0b5bf63e5db8caa8f467e0a27a16c3df5)
2023-11-13 13:58:18 +01:00
Earl Warren 5f980346a9
[BRANDING] add the forgejo webhook type & update webhook docs URLs
templates/swagger/v1_json.tmpl updated with `make generate-swagger`

(cherry picked from commit 88899c492efeedd138ba088a36b9c0bc733ead7b)
(cherry picked from commit 7171bd9617c32c4911e3bdbc23c02a19e80d2465)
(cherry picked from commit 1a742446c17aef9ca62fe75bfc0a388d40138154)
(cherry picked from commit d7c189d7b2f9fea299a31adf068db969920ae39d)

Conflicts:
	routers/web/web.go
(cherry picked from commit cbdea868e41fb38ca491f8b449c3e525ec82d6b9)
(cherry picked from commit 6cd150483b06e17aee023c0afd01a3f2460b3415)
(cherry picked from commit 47246da8d3f50a02d11b77b3d402618b144aa720)
(cherry picked from commit f2aa0e6b769d432e627798bcf294b04b7d253213)
(cherry picked from commit 5a4fc69a16de8d6199ea24198299297ef7a3587b)
(cherry picked from commit 48e444ca09c22f930514a01846b0c8bc3cef35ab)
(cherry picked from commit 888e53781175d8d977f66d78991bd66563fcddfb)
(cherry picked from commit 5121f493c99f19d8050aa09224ac3532b4100ec7)
(cherry picked from commit 9394e55fdf80bf3d7bf8b2aba561ad44a84e3913)
(cherry picked from commit 3a2ce51768de65892e3ec73596e3862354c9502e)
(cherry picked from commit 719ead3a651f12afbb59c856914b0085e5cee157)
(cherry picked from commit 83e6f82e2aea619a3cd502e133773d33c0e60133)
(cherry picked from commit 494a429b21c6234be38b9e3db0f930fbb8118205)
(cherry picked from commit 4d775db6b41f731e956cc6bb9217ef349b4a3635)
(cherry picked from commit b68f777dc2822ec5c4e30186675cc82daec092a9)
(cherry picked from commit 5b934023fa58820f27c349c26f2a1ce89aee6795)
(cherry picked from commit 3b1ed8b16c73374cd5b6339f5315229dc82488da)
(cherry picked from commit 6bc4a46c9fc6472e1c4bf0bb20dea6867f1b392f)
(cherry picked from commit 8064bb24a3c752a86271f154ad4d0c4763e07295)

Conflicts:
	templates/admin/hook_new.tmpl
	templates/org/settings/hook_new.tmpl
	templates/repo/settings/webhook/base_list.tmpl
	templates/repo/settings/webhook/new.tmpl
	templates/user/settings/hook_new.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1181
(cherry picked from commit 55f5588a9150d8912c0f8342495f858e4e1e2959)
(cherry picked from commit a428bc06b353e7b678acc6a1ec2576608f1a5d9a)
(cherry picked from commit d2186eceb960773d037756c991f50d177fd63954)
(cherry picked from commit b4e126e9afd1c51b214e36a585bb454dac32862f)
(cherry picked from commit e4c7a92c2d7142cac74cf05a2b1fe3f0bd0c7373)
(cherry picked from commit a7165c8146a604b6ec5f8ee4db4c926fef180857)

Conflicts:
	templates/admin/hook_new.tmpl
	templates/repo/settings/webhook/new.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1420

[BRANDING] add the forgejo webhook type & update webhook docs URLs (squash) gitea logo for gitea webhooks

Refs: https://codeberg.org/forgejo/forgejo/issues/1367
(cherry picked from commit 2d8c1b93734acec918729e27c5613a8f9fb41ceb)
(cherry picked from commit 9135a5e1dbcff07e9fff4c1001fcac8c05e0c82b)
(cherry picked from commit 270f4020b0714ac553498fc986457b0c627d85a6)
(cherry picked from commit 33e5e2f0d898639bae05225437aeb4afa2678360)
(cherry picked from commit 7af8bcf4791ade3ca80d449629bb2eadd0ad25ba)

Conflicts:
	tests/integration/links_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1548
(cherry picked from commit ce2a434dcf9ad23337aaa0cc30dc069bbc79744c)
(cherry picked from commit c2fa42b4fda37db8d5d4efc11834546d5de3d6ad)
(cherry picked from commit b04e3ab5bd390498d34bf3973846a1cf8d9c1c7b)
(cherry picked from commit de7d892884b7e4387d6a1f88fc394e6dc2092f2a)
(cherry picked from commit 0bc1651c36c26ca2611350502c1de30df134f7b8)
(cherry picked from commit 85708157422a524a989d42c27eaf46c540f3ebe7)
(cherry picked from commit 0666253dbb2265e79a130af84e5b867671a729a1)
2023-11-13 13:58:18 +01:00
Earl Warren fc9765d573
[BRANDING] add X-Forgejo-* headers
(cherry picked from commit 0a3388f93f53f53cce79ebcc194d67979cbe61cc)
(cherry picked from commit 7eba0a440a3138443d0b7461560f9f6f1c46b256)
(cherry picked from commit eb9646c7ef0b1a9e73bf22806acbc2caeaee7ff3)
(cherry picked from commit f1972578f5cb72ad9e1ef1ded9aa324b1d669864)

Conflicts:
(cherry picked from commit 7f96222fb4b4a773193a11d4ba76f449013c30ef)
(cherry picked from commit e3c7c9fe7b5809cdb75f1eb629c82b27986f7e98)
(cherry picked from commit 84fdead90242e68493efb96a7fee1e3b5fd417e9)
(cherry picked from commit 85148e11961b86269b7cda30294a4cdc817787d0)
(cherry picked from commit c0086bd70d39d9a1075fa624cdbfdf5ef26f7a2c)
(cherry picked from commit d1e31ef31817e5e811f6bea7aee5582383d53b12)
(cherry picked from commit 681d3ed5c43d45f802dc13c58c5b821da938374d)
(cherry picked from commit 76a3001f5bc5a064054514c179ba14008952e914)
(cherry picked from commit a55a9567d36f6b60557df3df3a0801c0fccec963)
(cherry picked from commit aa7adc167d4e4ee7879b88fe799f2afca2fd5531)
(cherry picked from commit d5354cb52c26ab0090388d019efe61770e7ec452)
(cherry picked from commit 472c48999699420d15aaa7c61a42db8136221616)
(cherry picked from commit dc816d065b715f2bfdc7fa68fa2d254f3d481b35)
(cherry picked from commit 4795f9ea85eac21c70db1159914a7b7b035b7374)
(cherry picked from commit ddd4ae53433d4adab823aa974c0f1c39d0394414)
(cherry picked from commit 0e95f2a36b1c0f480f94fef85d341792c7a7b759)
(cherry picked from commit 47a41a4e7b3c5d3cf247dafef17a64415069f171)
(cherry picked from commit d4416fcd3ee0f1d74c2b03fbe40c15b83f80b56d)
(cherry picked from commit f279d153b61677e2a766859c7a7688b0327e7c9a)
(cherry picked from commit 959f908ffdc9dd2fb07aefdf7cb85ba34f9071a3)
(cherry picked from commit 82df95310176a083abb9eaa51de9e9754d4f72c6)
(cherry picked from commit 8f8c9fd9e3deca0af0f087fc44fcd271e8440a7b)
(cherry picked from commit d4a0db7706f30a394192c6023072ad5185a7d600)
(cherry picked from commit 44594d623942128072bd86a20b5b90603517005e)
(cherry picked from commit 62b1de579ebfe326340b218cc9a980b705b8e6a2)
(cherry picked from commit 507abee353f120247276fe9165f09976421f926d)
(cherry picked from commit 8c36ac42c7091661b2f3fec70fc88a74043628fc)
(cherry picked from commit 72f74067f4c781e1c4936f0da2653a35a6f1c82b)
(cherry picked from commit 8e5a9e187b50a6eb8523c6dda4ce1a23c08a0b5a)
(cherry picked from commit cff8f43c7e4ab86a468ea49f7b945412d9911151)
(cherry picked from commit 13544bbde89078aae9dc068b827df82484f813f1)
(cherry picked from commit 5b7a11734710f1f8e1cf64b3cc678d7e78747b94)
(cherry picked from commit ab61310f1089dea957ccdd7c0c214c3c0033aad9)
(cherry picked from commit 537c214c284dd3860450b5082a469dc64b6ec758)
(cherry picked from commit 91a6c59c9d865f2b30ec00003520dfeb3c47b8d6)
2023-11-13 13:58:18 +01:00
Gusted 07fbe2ba69
[BRANDING] Replace branding in Swagger
- "Gitea" is automatically being determined in Swagger and cannot be
overridden, therefor we override it after `swagger generate spec` is run.
- Resolves https://codeberg.org/forgejo/forgejo/issues/226

(cherry picked from commit 0b453807656b6fbe54284d865e59880460f3d253)

[BRANDING] Change Swagger title to Forgejo API

(cherry picked from commit 79f6a70b53421be9984a9ad96ebd0d06ab5af02e)
(cherry picked from commit 6cd47afe3366a615d40655a435275d5543910065)
(cherry picked from commit a7ae2e4c09431cd7a1f18c5b87b9dd87981b538d)
(cherry picked from commit 59f837e4661233dafc202ded9ad907dbdf7e3e69)
(cherry picked from commit c1c3d1f0e63b880baa32d285d3eba6034137b45a)
(cherry picked from commit 4b088713fb0a55c2c37f734ce82f13190ca412dd)
(cherry picked from commit 3df1d2137112a95279a8c84a8601e4c137d75d4f)
(cherry picked from commit a4a5fdbde4f9ebbf5ba6ba66c8f20a89e54860de)
(cherry picked from commit 57aa9ed710a95aa51ae3824873c3766b38da7850)
(cherry picked from commit 948b49bf9449af744a1f2e1324187897ed1c0809)
(cherry picked from commit be4929ab6a802d7d748f537ab8b798e30588c1d4)
(cherry picked from commit 9ecb507457d8a6aa60713762a1a5d2995ed986e5)

Conflicts:
	templates/swagger/ui.tmpl
(cherry picked from commit 8e57e688637b9fbd3c33d3e38aed8768a2c07208)
(cherry picked from commit f0b3f621e34130c75b35c113ad509ab73118e123)
(cherry picked from commit 5b0a6d093ea5210a5ba27705b1d1636e23da8738)
(cherry picked from commit 2e0f6b5de8837a439ecadaf3434d006d7014016c)
(cherry picked from commit bb08076f5c26481d78855823c2daa1a76d3865fb)
(cherry picked from commit 5c9360e38a41a4494b1b1b247f9d57b1a0d91ef0)
(cherry picked from commit 2f277561489e1228af163fa4e5d153ceb7eec864)
(cherry picked from commit 6fce7eeb511d949249e045a995cc637d3788a1f0)
(cherry picked from commit 8d27e7bebd961468bd492c4d64e132a46d97f62b)
(cherry picked from commit fda2ee2aaedac8f394d9fc38085f768c775d2c38)
(cherry picked from commit fe0489a4d856655fdcf93c16a41995709c47f78f)
(cherry picked from commit fe9479b357d2ef0f5fd8247e8356ce7c75135b88)
(cherry picked from commit 1deadb2f35c8c0c87cd93b6f04675312b1e667bb)
(cherry picked from commit d1cb84b2f225c484755172735841e3b75abce409)
(cherry picked from commit 9de15d49f8ff0ef0803e8b3a7437a45358e924b9)
(cherry picked from commit 461fbe219c30de7e756ce2cb6dbc354417655a6f)
(cherry picked from commit f39bf3ba5b6325898968533e79fdfc5fe74c3810)
(cherry picked from commit b3f31c2f7bc5b4f5ed3f7fb6e6a6649331eb179a)
(cherry picked from commit b9f493c139bc40bb5aaf361b813019968be75968)
(cherry picked from commit 83781b16411d49f2f27b622ac3e806234b477984)
(cherry picked from commit 4438ee0434f88fc0dcb917304a5baf5b8c2d11a8)
(cherry picked from commit 56b6b368334fe3d11fb55b8e35bbfc314f45405a)
(cherry picked from commit d42aa19f27cb984693d3be7084059f5bd946ae3e)
(cherry picked from commit 4b7eb6a93bf9700e491e8bf99cf76b19f481cac4)
(cherry picked from commit 9d17e95951e17528cd912028544421264f531eca)
(cherry picked from commit 31d3f4bb01d0260da4b6e71b055b28f11dc6cce3)
(cherry picked from commit c428c3f14c770dd2f4a2f1320f7bf047933d1057)
2023-11-13 13:58:17 +01:00
TomZ ff876ff21f
[BRANDING] cosmetic s/Gitea/Forgejo/ in logs, messages, etc.
As the docs of codeberg refer to the strings printed by the Forgejo
ssh servers, this is user-facing and is nice to update to the new
product name.

(cherry picked from commit 103991d73f0f78f31a5f1dae47824c2fe481bcc6)
(cherry picked from commit 2a0d3f85f199d28a4180becdebcb90af0d6f3504)
(cherry picked from commit eb2b4ce388810dc145dd90d3358d4d4373e31b80)
(cherry picked from commit 0998b51716ef5d3c25e139886aa8b7bfde703b20)

[BRANDING] forgejo log message

(cherry picked from commit d51a046ebe774236f8b902c45486dc8cbd041e0e)
(cherry picked from commit d66e1c7b6e2fbfefb976103805b18eb29b6406af)
(cherry picked from commit b5bffe4ce8a8353c9e5529350a7932d4a2d9e53e)
(cherry picked from commit 3fa776d8566c42ce31540024ce5bf5a6cb5cd4e4)
(cherry picked from commit 18d064f47214327dc5b6c55c2d02a3da53358dbc)
(cherry picked from commit c95094e355212d4baf607f3778152ceb455d4f82)
(cherry picked from commit 5784290bc46afffca9b93e0faa3bd88944e54919)
(cherry picked from commit aee336886b2606beaf8c27a2992c21aa2a574966)
(cherry picked from commit ec2f60b516b1ee11b5e7c52ecb02fdf8e5bbcaec)
(cherry picked from commit 7af742a28469d6725248d5519e69217b844ed792)
(cherry picked from commit f279e2a264ae028ab511ba61a71e00739dc5020a)
(cherry picked from commit fd38cfb14eebe34dc72b8358479e53d27fe01180)
(cherry picked from commit 64c82266183943f062016479c2d1868ccdee2cec)
(cherry picked from commit b546fb23042c6d231ce29241d1991c9cb1bf1bba)
(cherry picked from commit ad102021776a8dd407ef19cbfadc42b3ca7fabd5)
(cherry picked from commit c89cab9c2b019a592dffe4b6de29482feca1bb33)
(cherry picked from commit 9579322ec2eec40cb8f113458c1d5669f5d4b818)
(cherry picked from commit 16b44ad18de82b0429a8b0a05ed93445d1524241)
(cherry picked from commit 2571ff703b77cc8527f37f82c36e9260a80ac673)
(cherry picked from commit ad61d9ce9b93503b04deb9ecdb5f214566caf820)
(cherry picked from commit 9b2c45d4d3b1c6401a3d7d0a5544213e1486ab9e)
(cherry picked from commit ed01b79a598a0698324392dab66a2cd3d41c628c)
(cherry picked from commit d040b664279292f9f7304f96db0d172672c1e904)
(cherry picked from commit ffe0bbea48d036c26149d98856add938bb08a475)
(cherry picked from commit 4c1b2c409bb90a0c2876f3a7323cf162a7e58765)
(cherry picked from commit 3d8338ed106cb6260a4dae249ddef71489c47357)
(cherry picked from commit a92f044ea96bbe9c47689455a417e4f1bc3cd648)

[BRANDING] link to forgejo.org/docs instead of docs.gitea.io

(cherry picked from commit 3efafd0e083eb331ce06681351a40c4f46d7c96f)
(cherry picked from commit 148185e34b2be36fa46e8630928ee64a73768883)
(cherry picked from commit 834e264698f710049f20491b91b3c39b853de867)
(cherry picked from commit e72fa6eb1ef8f4355197ced3c619d8ff6d9c1c9f)

[BRANDING] link to forgejo.org/docs instead of docs.gitea.io

Fix the link that was 404.

(cherry picked from commit ae515d7258602a0fe4bb4471f2017e4ccc7dd0e7)
(cherry picked from commit facc2367f0e5fc1e1162cc2478a658f050c07718)
(cherry picked from commit 25784b9f21a37d9161b050503b0d45d87cd8863d)
(cherry picked from commit 2efc6138d92e958ee6a6091e579fa269aea45ce4)
(cherry picked from commit b9d0871631ef70abe88de64ccbabcfc94a49274b)
(cherry picked from commit f0446e51b9c2268f274a1c4b8c25abfcf417975c)
(cherry picked from commit 1638aa67fb384bdcd97386861054447a8d53e832)
(cherry picked from commit 290db6a018d4f82173446799b8726a320c209bb4)
(cherry picked from commit 89b87cf5426b7407ba0e23912fbbd3c521a8bae4)
(cherry picked from commit 656ed949625652a3a0e8d0b1381e76f75688e461)
(cherry picked from commit 036f879f96d606af691326474cefe77441c8c4ed)
(cherry picked from commit 69eea35f813d03f578ca143e45292289b0ad92a8)
(cherry picked from commit b72e3f4a92a04ac065b5b72ca25f7eb0c96ba69d)
(cherry picked from commit af606b8574d67c8c7a3699cf41d6a96fc3852547)
(cherry picked from commit 7e47f8135c08be3f48ccad6b8d8a940bc5713e53)
(cherry picked from commit 0e5218cc5374a0e16a273298f862dd3d6cebe020)
(cherry picked from commit 7c2a20a528a6911412986ff8eb479f3a19d7f226)
(cherry picked from commit 4e94006363227435b53769b92882b51a6109ba52)
(cherry picked from commit e47cdfc43fb693dfd0507bb1fe943da41fd2ebb4)
(cherry picked from commit 1dcb3e1da4ab4d8dbb659e87c4f542245b066409)
(cherry picked from commit 67367c4e0f4b755879350e9311e44deff95c137c)
(cherry picked from commit 252087d1ffcae00dfa7e8edc7face8775412d4cc)
(cherry picked from commit f5977a43e5cb2c869af0cd8c993cd0d3eeccb622)

Conflicts:
	templates/base/head_navbar.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1351
(cherry picked from commit 594938eb1505f6d81d8c0cce84a34c20a18b5c7a)
(cherry picked from commit 0257d038a7416fd208571d8be0a14a9ea6ac4d95)
(cherry picked from commit 72821dd14052505814df556e09a500981256f709)

[BRANDING] s/gitea/forgejo/ in HTML placeholders

Replaced Gitea branding with Forgejo for input placeholders

Closes: #686
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/752

(cherry picked from commit 6160d37ca972566017aee46b2ef42f398f969dca)
(cherry picked from commit df61138c7eaa25068fe0012644fd15b407a4816e)
(cherry picked from commit 1f30566c3f63925ca56eaa21b4fa580b4bb1ffaf)
(cherry picked from commit 539bb825f555585f0a52ea4c8747c5b589254633)
(cherry picked from commit bee0f66c869d2632a1ad3cda731caaba74c3634c)
(cherry picked from commit 60ad005c95a6d53f615a720445eef77e4bc499ef)
(cherry picked from commit 282e26222ef4aea1720b4b121ac29264876069c7)
(cherry picked from commit f9ca551f3dbc0f75250445b4e731396dc34fc041)
(cherry picked from commit b2e04b04c381549557873b1956065dc5a5132a97)
(cherry picked from commit c8f395a03c688bcc1413c6ed6b6f820aab7851d5)
(cherry picked from commit 0d58ce49aeefd43b3316c0238dcd04e019b6be25)
(cherry picked from commit c602ddf91efd95347de433cfad8ac20995d12283)
(cherry picked from commit 029e37271ead5405daa11945bd64104f12c8ba77)
(cherry picked from commit fdaa96b3ccca76cba877f8f5dafcf4cf9d160af8)
(cherry picked from commit 515d99e27d5db12c5495e31e104ccb6b7ad0ce7a)
(cherry picked from commit da73274ba1cb55d1c425b95890a55aecee2bb246)
(cherry picked from commit ce90b696a01619d86ac7dac7b0cd78be8f06e4b1)
(cherry picked from commit b6bf98763be1855b5613dc8db627fd889bff8308)
(cherry picked from commit 5b380d22d78568c2c4f26a3e8aa90a42006969e9)

[BRANDING] How to start a runner: URL to Actions admin documentation

(cherry picked from commit da91799e6f06ac3c91c1cfc763f4ec0b5cc3cf21)
(cherry picked from commit 28231663b634f6d877173ba4956f6c0a5d128b2b)
(cherry picked from commit 533a90345bb0236c8fc088f2ab1b92535f8a4269)
(cherry picked from commit 6a0e4e55dd02beff179b8503259d1cc774e8e81b)
(cherry picked from commit f47cd611c68f9da2df9b0e5e0a8332f6fcc17932)
(cherry picked from commit 001264b7840aaad6aa25e0b06a927300751ef20e)
(cherry picked from commit e4099e9bb9f557e99bb0117eaf6ad88467684527)
(cherry picked from commit 3a1885649ff1dcaf5acdb1bb237c477a92aeb01f)
(cherry picked from commit c42802c710c0fce2eea06a93a7f4373557515616)
(cherry picked from commit a611ce8d6d293573534d4ce1efde81d32129723a)
(cherry picked from commit a3d7d10a80ba6104ee6f260290518936b210c16b)
(cherry picked from commit 52adde671f8dcb309235506a3c39a38db87e9537)
(cherry picked from commit c9a3820fef10ef0b20e52f5f70d7794dde0974b3)
(cherry picked from commit dce40997c956244742325b5b10d13e8ec918082c)
(cherry picked from commit 312a6b92f384fdb09fc26e5da5a4acf0680ff698)

[BRANDING] package templates & links

- Change Gitea to Forgejo where necessary.
- Point all documentation to Forgejo's documentation.
- Resolves #992

(cherry picked from commit d0b78a6edea0abba54ef537781234d8f778e0ad8)
(cherry picked from commit e2382f30ba07586fd3ea4c8a535ab550ecc33408)
(cherry picked from commit c41cf05a334944a66129425c4a9abb973fbb4687)
(cherry picked from commit 797e598ae73441c66f25849bf643e0c11a737c41)
(cherry picked from commit 970031a1c2974cf0c6ce057ad82afdd6380f6882)
(cherry picked from commit 0c1180e2e142852248787185e2c01582413de8c3)

Conflicts:
	templates/package/content/alpine.tmpl
	templates/package/content/cargo.tmpl
	templates/package/content/chef.tmpl
	templates/package/content/composer.tmpl
	templates/package/content/conan.tmpl
	templates/package/content/conda.tmpl
	templates/package/content/container.tmpl
	templates/package/content/cran.tmpl
	templates/package/content/debian.tmpl
	templates/package/content/generic.tmpl
	templates/package/content/go.tmpl
	templates/package/content/helm.tmpl
	templates/package/content/maven.tmpl
	templates/package/content/npm.tmpl
	templates/package/content/nuget.tmpl
	templates/package/content/pub.tmpl
	templates/package/content/pypi.tmpl
	templates/package/content/rpm.tmpl
	templates/package/content/rubygems.tmpl
	templates/package/content/swift.tmpl
	templates/package/content/vagrant.tmpl

	https://codeberg.org/forgejo/forgejo/pulls/1351
(cherry picked from commit 42ac9ff2abe55826047c36e041f1bcd70caf7581)
(cherry picked from commit e390000bcee673c2d15c8777c2d2da316967ce62)
(cherry picked from commit 56a437b29b71976b9b0816d0de2ce8169a84f288)

Conflicts:
	templates/package/content/cargo.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1466

[BRANDING] s/Gitea/Forgejo/ in user visible help & comments

- Modify the README of the docker directory to point to the relevant
docker files and documentation for Forgejo.

(cherry picked from commit aca6371215c1bf95b6c0b19b9fadb797544adc48)
(cherry picked from commit 0ba96b1bc4c4df84ce3dca9875ad4a9ac8f1f759)
(cherry picked from commit 5c8e6b53f164dd16b527c603a3089735ff16df89)

Conflicts:
	docker/README.md
	https://codeberg.org/forgejo/forgejo/pulls/1351
(cherry picked from commit b3121c8004f675b31482cdbd564f9a830be48acd)
(cherry picked from commit 607f8704163bd24bfc7ff1d6a812b5e887746797)
(cherry picked from commit 191d96afe4198d3b6498aa21eaeb7686a59865bc)

[BRANDING] healthcheck/check.go

(cherry picked from commit d703a236cebadc0186b7b2431b3b42a54b3d1f09)
(cherry picked from commit d84ce3ff2098e9ba3c7241605ea25951dcb57ca6)
(cherry picked from commit 2dbb8446069c79017dcc4a9921dffcb73594d02c)
(cherry picked from commit 14d3ae7e3ae67dff3443db17e4373e5947ed6c6c)

[BRANDING] s/Gitea/Forgejo/g in CLI output

(cherry picked from commit 7543c126bbb78d5d29c253a88b56ccd2dd394928)
(cherry picked from commit b66f422fc3b9018aa948a869045cb3684e80f5f2)
(cherry picked from commit a81e4e46f3b0e619cea959de5ffde2e811d6008e)

[BRANDING] Gitea->Forgejo in mailer code

(cherry picked from commit b91afea4ff5e092452b5848900fc426b1c7289d5)
(cherry picked from commit 5d7428167c8ee5f25fb719f32a561472ef1aee68)
(cherry picked from commit ed8101ba6cc87526554a69f58a49507a79eadb35)

[BRANDING] use 'Forgejo' for Discord, Packagist, and Slack webhooks

Refs: https://codeberg.org/forgejo/forgejo/issues/1387

(cherry picked from commit 7dc3a05f5b9013a0696f071ebea4d2403c1c36a8)
(cherry picked from commit 133f2fc6cc2e977a5f7660ca4c214c92ac036421)

[BRANDING] cmd/manager.go

(cherry picked from commit d1dba2c79db63a6fc23e6bbab2b8dcbdaf43b679)

[BRANDING] pyproject.toml

(cherry picked from commit 7e8c868db2d5331778a87b5a1b493a81bf6863a4)
(cherry picked from commit 2395995c8b61c0674278db4321aa7d79e4c0eb91)
(cherry picked from commit dd6fbbf332f7833175634ef6d48eb5ad384aabb9)

Conflicts:
	templates/package/content/cargo.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1548
(cherry picked from commit 6f9a5d5cabc9bf7b57dc199a332261b8fe53e52d)
(cherry picked from commit d0635c4a07bb080e509f5578a995c7378b995691)
(cherry picked from commit 5d3b4594df9af99c8962aa99f0b628e8fb2e89fe)
(cherry picked from commit 6da3b43eff5b77ebc75cb5d38e4ddab6fa18a61b)
(cherry picked from commit b60dfaba10158abaa279049fbb064354cd67baab)
(cherry picked from commit bcb9bb4deea857ae8c7e888680423fdc89676077)
(cherry picked from commit d5301b6a24011ea2826a79f834cda45290bb259a)
2023-11-13 13:58:17 +01:00
Caesar Schinas 84fee487c7
[BRANDING] Rebrand default meta tags
(cherry picked from commit b1a792b63547df1471a125c2384a9623ffae409e)
(cherry picked from commit ba71acccdb8eb4d1c87b50708fe3b03a3324dd9c)
(cherry picked from commit ef58efb8e0c48a782e01aac8d754e70b7611a2c8)
(cherry picked from commit 6a1b08241ebb862bdd39c708852e3e23c4d96c9d)
(cherry picked from commit 132c7a3a07d5a11b9b165295ef12111ce74aea70)
(cherry picked from commit a1f07975d67ceccedc808ddaf657f8e7e0da74b1)
(cherry picked from commit f3793598b24d00ca3ae80dbde4ef9909b298ca03)
(cherry picked from commit 60f38116afc60b055c6b40be8a1e94f646252bf6)
(cherry picked from commit 88884cf2833429749b9a6ec6110b4c4727304903)
(cherry picked from commit 520de41aefa6c1f5c939b2345878697094962812)
(cherry picked from commit cfd5e5b95ab081d10d4f5d6022d09db4877f51fc)
(cherry picked from commit 5cf1738f0a08d99aba2016100f3f0083b51efcf4)
(cherry picked from commit b95f9b3142089d90df93708638b2ae6c857dbc87)
(cherry picked from commit 0118fba9703a1e3f9da6c7b5c479b8b919a5f5e2)
(cherry picked from commit ef213ec79d8d0ae006bfda0b9e49d2da2be47ca3)
(cherry picked from commit f6794f694b9fb262c66f8d3958dd5145c7ef0dbb)
(cherry picked from commit 639110c03bc2d2f91fb6a5c619f1138a0522f836)
(cherry picked from commit 2be6eca1e1c8488bdc9e6ce164dbd9f3d79771ce)
(cherry picked from commit eb929d0d566b3dff8454e62ff9f2384a896fb549)
(cherry picked from commit c49dd4ed7f771e8fa1573add6cbadc193a473ead)
(cherry picked from commit 8ea074c4ddaa737c4faa83c1b4746dbd7cb84440)
(cherry picked from commit 3145df43d60593700b60409a8d5ac12e4fbbc197)
(cherry picked from commit d0df3e306a4f0a4f773c7cbc1409922fe69973aa)
(cherry picked from commit 8f4850705eb4e016ebebc738f629bcc9ce87ca61)
(cherry picked from commit 5a24d4319cf7ac2e56b9e43e4181b066d76d6d8d)
(cherry picked from commit 756c04c6c46a55852089711f7859f533b85fd042)
(cherry picked from commit ea627e79e36d0bc7514b28e6b7d5847b5bdf5922)
(cherry picked from commit c52b141902ef0be06c100f4a1285f28419e6f497)
(cherry picked from commit 49ab0c55597dc12a50be39a2bd35cb870ba8e361)
(cherry picked from commit f14f26c940abd341ae6bd8e20e93bd736e907b52)
(cherry picked from commit 4caebbb6becb26732f4d72d3e73a71ea821edf8f)
(cherry picked from commit 7c3d0bca9e8868529e4496b6b17fbe1c0736c425)
(cherry picked from commit 171a207006f82d5dfed4abb9c957a837a8aa53ba)
(cherry picked from commit 2a4a7d05fbcc67f603f81c5a4adab016dccf7460)
(cherry picked from commit bf19c35f846d2004aca20c837e47a688a228091b)
(cherry picked from commit bff760c91aed97d60bd4f939b1e657c06aecdce7)
(cherry picked from commit ab648f7b678f492597b21eceecd1504d3f1bc900)
(cherry picked from commit 0e3bd4b4ab4215a02202840450fc75fae822e0a6)
(cherry picked from commit f75b95c2f6ecc2e269edf1ff2878ccd9d7308ccc)
2023-11-13 13:58:17 +01:00
Caesar Schinas 86bb0952a5
[BRANDING] Add Forgejo light, dark, and auto themes
(cherry picked from commit faab0c670e22588bc643d71b650560c2ccca2c8e)
(cherry picked from commit b6d59493c7fa0bfa62095abb99c5c5a29bcf1659)
(cherry picked from commit 837da0c1f41b40853eb4aebc40af16433cf7a9c2)
(cherry picked from commit 71ad245e1d6f7f5b002c1c5e9831e872d157f906)
(cherry picked from commit 85a7032f1b1c0d80e3d3960e9d902e9e66e687a5)

Conflicts:
	web_src/css/themes/theme-forgejo-auto.less
	web_src/css/themes/theme-forgejo-dark.less
	web_src/css/themes/theme-forgejo-light.less
	web_src/less/_home.less
        see https://codeberg.org/forgejo/forgejo/pulls/552
(cherry picked from commit 0c2c131bb06024fca7d5c8ef6a2696d5f6aa4a1b)

[BRANDING] Add Forgejo light, dark, and auto themes: fix import

Closes: https://codeberg.org/forgejo/forgejo/issues/562
(cherry picked from commit 2b0dc1f80ff18d1c94df74c77a80e3651e7cb2ed)
(cherry picked from commit 494ad6a3b7cd3328c835e6c7c76a55a77d47a60d)
(cherry picked from commit 6940fc22c4917e86b25cf3c6c2ead9057ae726d4)
(cherry picked from commit bd6f00656c457339ef3d08612911594358a15f14)
(cherry picked from commit ebb506a1247751b1182348b281089dc00a65c741)
(cherry picked from commit 43d72d37811c8b9d00b1d046341401643f66b289)
(cherry picked from commit 1a87adca018545f6d2db0dad9e5d7cb59f6a97b8)
(cherry picked from commit 0704c410b4e8a0b610e82f6ebe9209fb485ee722)
(cherry picked from commit 9039b47c160e7fce2bd75167a0358eb7e7458e2d)
(cherry picked from commit e32bb7892481a80156163dbf5063da0c8ead27d4)
(cherry picked from commit 053ad84f91f994f96f4d9d037ff37e25b468c424)
(cherry picked from commit a35f1b6da7a061a3d0717548d8f4e0972e7bb0ec)
(cherry picked from commit 8cb94c01d5bcd453938924ce6c6a6804ce9ec255)

[BRANDING] fix invisible label in branch protection settings

(cherry picked from commit 23e5d457219a68f49938395b5532231ce4ac0022)
(cherry picked from commit f02e4582e51a6a2eba93ddd599b7ea3679388e55)

[BRANDING] Fix commit label for Forgejo Dark theme (#843)

- Define the `--color-label-text` variable with a light color, which is currently used for commit's SHA

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/843
(cherry picked from commit 74c186a3806e37fcca8087ad79ba7c1f8e0d559e)
(cherry picked from commit 7e185c5ca5298fad12fcc78b504d96163e71ad71)

[BRANDING] Add Forgejo light, dark, and auto themes (squash) variables

Adapt to b6bcb79987 Improve notification
icon and navbar

Refs: https://codeberg.org/forgejo/forgejo/issues/893

[BRANDING] Add Forgejo light variables

Updates the Forgejo light theme with the changes in b6bcb7998

These are the same changes as made in 2574dbcff to the dark theme

Refs: forgejo/forgejo#893
(cherry picked from commit 9e99fe4f9ec79aebbf34490e12b0acf3097dd5c7)
(cherry picked from commit acbb98bd912fc3a28d464eaef1d756f54fd87e8e)
(cherry picked from commit c80245ed87d09067d880d6f91c3edaa35e4346de)

[BRANDING] fix code highlight color in Forgejo themes

(cherry picked from commit ffc49a4e992162a480d5056e1211fc7496e4aa06)
(cherry picked from commit c5f45a941e3dd8882164a88b2653407fedf6dea0)
(cherry picked from commit eee5427c9d581b8e2cd254d4a15508200622aef0)
(cherry picked from commit 89be50ca27a7ad33f109bbc3549220b37875206a)
(cherry picked from commit 74e4776ef504870d9831818ee141b12afd5f46ab)
(cherry picked from commit 6c4e07a6a718c375ee2d3975ea7bb01d382d1d90)

[BRANDING] more accessible text selection color in Forgejo themes

(cherry picked from commit 7407605ffdedef8fa320477a3bd7efa06df263e2)
(cherry picked from commit 5aab3872cc5bd267bc16bfbcedef66fd03616488)
(cherry picked from commit 1ec77d8bd00bc6914d0926d98d503debe41cc6fd)
(cherry picked from commit 964c89fce7bb5b4be06d4cd1cac247426061ec2e)
(cherry picked from commit 8a8023a4414e27d28f4503e2d2fb12afc4b7aac6)
(cherry picked from commit 1c9ffeadf5ce419d576afc89faff9fdd6c1b5478)

[BRANDING] Fix navigation hover color (squash)

- For items in the navigation bar, use different background colours for hover.
- Regression since https://github.com/go-gitea/gitea/pull/25343

(cherry picked from commit 8f3f4b219c449011a810c6a9f946fe216d841778)
(cherry picked from commit edfb0eef06e798009389b12b2c0a417c4c845887)
(cherry picked from commit a6367fa48a2d10465b5d00aa6fb3db886f3c238f)
(cherry picked from commit d5697abe4257390a687102d0964fee15f9214b73)
(cherry picked from commit eaf537091997650d9370457b7eb53205a552d267)
(cherry picked from commit 58f11e7310dfec6fc6f195aa36e465c846a431c5)
(cherry picked from commit 732e1b35d58e1ac5307b80819bd788ac8dc9b71f)
(cherry picked from commit 0d794ae1c91fa926d1ddac5eb7b1bc27a9271793)
(cherry picked from commit ccc8aed308253aaf7aa81f49d3a8025cf759cfce)
(cherry picked from commit f3be4a75ebf2f2641931bde29207e2714c02491d)
(cherry picked from commit e7fdff35997434bdc159b4050bd2c0306ee7fede)
(cherry picked from commit bb2f3c9664beae02590cbcb47dfa4bcc9f4b4b80)
(cherry picked from commit edb8b4d8a6678d4d6793d69681f78583aec74fd5)
(cherry picked from commit 3bfeaec5fc28cb0706b336d46524daefd958bcb4)
(cherry picked from commit b1bb9627888632c1b1ebc65dde8ad715ea8cd1ff)
2023-11-13 13:58:17 +01:00
Loïc Dachary 099afce3ad
[BRANDING] container images: set APP_NAME
(cherry picked from commit 12d7bc447edb272327200389c73bb04bb5fccc14)
(cherry picked from commit 1335b17fc35b8b873b94435fddcc23c5cdf0117e)
(cherry picked from commit 0d7da06c47ac3a7278602871b95234f823e11f1d)
(cherry picked from commit 095c1ab679bce39dbaa89e8a86eaeab8a9b823ad)
(cherry picked from commit 2220f00d09e2692d10e0d07f1e8ae2232a636a7d)
(cherry picked from commit f0be8bbdbfb758fd13f2f9325358ad292f6c030c)
(cherry picked from commit 15188180a15adb58bbde418018612561b68b6927)
(cherry picked from commit 96c471d7d36a24824835b254bf785689f898d715)
(cherry picked from commit 709052f1e79bbb0ee417f8001c9c0dbd03e78791)
(cherry picked from commit 98cd2f5deee05ae9be67250c85fc17e31eaaf28a)
(cherry picked from commit a1014654b13e338eaf35cd96d6115fe88459480f)
(cherry picked from commit a16f4dc51dce3f9d22cf899186fc61931a82f35e)
(cherry picked from commit abbed33d1699daa99620acdec5322846f562cb8d)
(cherry picked from commit 4871447def0794027227280059bdfa29cacc0a23)
(cherry picked from commit ea1218b237017fa3ca3e5204afd56a18e8336650)
(cherry picked from commit 6dd67d60de567e70a36524db940b8e88420251c0)
(cherry picked from commit 71761f04afff6d1552c5604fcf7f9b5a27cf01ba)
(cherry picked from commit 7cb28a3a06b1b665a6ac9d2687c79ef5ceed0dba)
(cherry picked from commit d116336cb5a2df68260fbec42b606fa35c27ba30)
(cherry picked from commit 4138a698b2744f504cc6e3590ab8b14753cb719d)
(cherry picked from commit 38c572bc1928fc138503a88b66aa8e6d1c06aa6e)
(cherry picked from commit 94c759b47f93dde23473d45eff2309dce5055d8a)
(cherry picked from commit e1f52bf1d5087df6c7905afc08a7cbada6854f7f)
(cherry picked from commit 8bc7000cfa7d0caa87f99c07543f36925fbe984b)
(cherry picked from commit fa60007c3464a8d7fc278df1f6d51fb40c6ed130)
(cherry picked from commit 0328db39c9a9359046aea0a422002a3072509345)
(cherry picked from commit d028010b64e9d12dc3698fadd8b6f017ea2762ef)
(cherry picked from commit 0283c920f01e8ec599613f8e28fa39157f698e4c)
(cherry picked from commit f5bdf3e11f93c508d03ce38d66550aadeb41abdd)
(cherry picked from commit e3beb523007fe87951a4e901596aaef965de0771)
(cherry picked from commit a63d5afc91a5c7f29969c5ed722c6718c1452e6d)
(cherry picked from commit 7d43e1a828139d20b5baafe1df706e11ed4d83a8)
(cherry picked from commit a551fbd0fa00231a886c101d5fe438b184c01b93)
(cherry picked from commit cdff0ddbb67237638d60ed5a6180670813ce24d0)
(cherry picked from commit e0aadc9f4a04e7e6386ec7b6c0793fecd34059b2)
(cherry picked from commit a448c06caf1abd705dc6daca8010a5404c80519e)
(cherry picked from commit bd2055bff67e43056934d445bfe060762b3a579f)
(cherry picked from commit 70400183e1353a1904e828bee0ea712d2e5e4e16)
(cherry picked from commit 05b44a0ea30101cf1fd47ea9c06cbb28b3b79fa0)
2023-11-13 13:58:17 +01:00
Caesar Schinas 1f364cfeee
[BRANDING] Custom loading animation for Forgejo
(cherry picked from commit a3b3b8a2dfb31f3b8000f1bfeae63ef3190c211f)
(cherry picked from commit de0fd2d2e459aec24dae1293cc1f8f04069dedac)
(cherry picked from commit e1bf4de211a92a2f4645b3f34039749456a10ea3)
(cherry picked from commit 60ffc88a47a158fe4920f05875ea8d156eecaa70)
(cherry picked from commit 7d2beea9ca4b47a29a1737b3a4d1d5486f2db1d3)
(cherry picked from commit 171eadb95225183b3c1a1dfd3a5181953868b7d2)
(cherry picked from commit 5e81f75ed2541fafb72d20911fa1db01154f8ff9)

Conflicts:
	templates/install.tmpl
	templates/post-install.tmpl
	templates/repo/migrate/migrating.tmpl
(cherry picked from commit 641c4a36c5c576d92d3dca952130542496c8c07f)
(cherry picked from commit f1dbb2dcff94bcd734309c55808470d29f497577)
(cherry picked from commit b66de5e5316b09eeaf6c3463542994293f7b2995)
(cherry picked from commit eeccdf21a11e13f796caa45c206c89d9c273bc6b)
(cherry picked from commit af37663f4d12aec35ee42769468e1e733a8bd4a0)
(cherry picked from commit ed3739dccbfdacb6e0c8408ff6a26fcac20f8eb4)
(cherry picked from commit f0036e37cf4f6e4402e2fbbe42763553399b51a8)
(cherry picked from commit 90d453898a5c6481b9b2b6fe356f0a7b3ad2eafc)
(cherry picked from commit c01154323832c57af7a84cadc4580a00bcc96e5e)
(cherry picked from commit a294f34165c4df7100589dd2b44baf60af9d14b3)
(cherry picked from commit cc00759140bc6bf3f68129ab97995c3bf01db276)
(cherry picked from commit abe6d83b85759a80d82d52faacd36e8f315d5777)
(cherry picked from commit 274d2863398cbb94f075a7532152eb9a090b504d)
(cherry picked from commit 594aaf3c95e9cf671d02a81195653e0dabb1cae9)
(cherry picked from commit 6059a376f48d96dccfaf99ff1eede2d4ba38afc5)
(cherry picked from commit 676eb49a123694beba3bed8c0f00608f80b6b03b)
(cherry picked from commit fc834fdb86e3678c3092d0e64be6ca2e0adb3a54)
(cherry picked from commit e1e89a43495612c4e9a2e57c717c2996f1ad8cce)
(cherry picked from commit 89e0d29cdb9ca413e0e31062997b9276482e5294)
(cherry picked from commit eb7fc7a27eaf7e32d53228b660dfb98049f89b4d)
(cherry picked from commit caa41ff62928df3b032234a945277bddb3c70f4f)
(cherry picked from commit a74b6adb6ae77332638fcc8325072e82ae7f0a2c)
(cherry picked from commit 4fc629b0d4c9fbc3f5933e4d5111dc67af59b393)
(cherry picked from commit 66a3fb5dcdb74c5b4d61f9aa80d14517744776f2)
(cherry picked from commit b26ec6315aa8c5ba2971affa2ac7d78fcfa4a9f4)
(cherry picked from commit 8d9d4d6f6baaa0974455949aa6f122b02062ff89)
(cherry picked from commit aa8e8666569fbf3993258568430d0b8d7ea318a3)
(cherry picked from commit d23f3bd60fb4d93f98c46247daa2263a5412b193)
(cherry picked from commit fab2d1cafa8fc43d3d7831847964dd85bb0eaa19)
(cherry picked from commit 39d9d405c3b468776a40b613db8e7fae58e843bc)
(cherry picked from commit d88db97d41ca946d64ab6b77e2bcd308b13f4393)
(cherry picked from commit 64f5a911ec25a1c134dd930ed4e1a0d9890ac1df)
2023-11-13 13:58:17 +01:00
Caesar Schinas e70cc4de6f
[BRANDING] Rebrand default config settings for new installs (#140)
Replaces `Gitea` with `Forgejo` in the default config settings for new installs.

This will not affect existing installs.

Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/140
Co-authored-by: Caesar Schinas <caesar@noreply.codeberg.org>
Co-committed-by: Caesar Schinas <caesar@noreply.codeberg.org>
(cherry picked from commit ca1319aa16128516e50dabdc8e8cadc23eb71d2f)
(cherry picked from commit 52a4d238a0b5bbea28b28e55e35f28c51ecbb2de)
(cherry picked from commit f63536538cfe4b010ebb5a6323f4b5e5b6ec7232)

Conflicts:
	web_src/js/features/install.js
(cherry picked from commit 861cc434e129f3fbd932ee36067c560e754dab9a)
(cherry picked from commit 0e6ea60c802d6cfd95dea4aad5df96bb6e4bc7a5)
(cherry picked from commit 0cbc0ec15d9d952b0ecfb68a36bf58cbae0c43dd)
(cherry picked from commit 3cc19b0ae214ae163f23efa52ab0aa53eb7c935b)
(cherry picked from commit 50fcb885fe2f87a27e6ff778cdd0c7cd97bbe9e9)
(cherry picked from commit f6039d4df481fc58b8db3e863158665d24cac847)
(cherry picked from commit 5ae5c6ba2deefe829f768900f5e1bbcbe9389e15)
(cherry picked from commit f0b565e0ed7fe52f0264e92c49736b487b9bff8a)
(cherry picked from commit adbd4d2015e8e2c4789849c84cfa4032acd40b7f)
(cherry picked from commit d26c540ffdbfb7ec83412635576ab39653d1b531)
(cherry picked from commit 6df6781b42ea126d029ba9e85485dbcb9bf6601d)
(cherry picked from commit b6fb56e1c407195bedfe09f91ecb6537024d5189)
(cherry picked from commit bb4f98a0ca7515aa6c44529df0573195f779a643)
(cherry picked from commit 6779229f2732f6791aba3bd1ba51a338a88ca1f3)
(cherry picked from commit c216c85aee552aa15e9d6316002ee9e170de64d7)
(cherry picked from commit dff780bced1dc78ddd7fa4952766969ee528c538)
(cherry picked from commit 4e036aa3b6d1bc5f2041c3b30ec289cb082fe824)
(cherry picked from commit 8b3bc3e8a64edaba64cb759ea31248eea7307937)
(cherry picked from commit 1e4d8523321efaf6c5febdd77ba5150effe5c1ac)
(cherry picked from commit 07a15d18447bb03bb04001f1f65305670d1467ef)
(cherry picked from commit fb44b3e10d685dd180f37678a3e2a64ee641f2b2)
(cherry picked from commit b212d833190ce59230b3fc288c1aac5106cf33a0)
(cherry picked from commit 5754971be5c37e97f3165878af3760117e40af01)
(cherry picked from commit 0c43b4e82cab028fae1b709c549251d63a3ffc04)

Conflicts:
	routers/install/install.go
	https://codeberg.org/forgejo/forgejo/pulls/1351
(cherry picked from commit 2e22a7208a0f149afc3794425c7b5b2b0181a939)
(cherry picked from commit 676b0a8a48f99d751b677b9eca5b57238b5003a5)
(cherry picked from commit bc4a8bf9bcb75e92b7802c477b1bb14a047344a6)
(cherry picked from commit 5e09a4e174cc6d62b08fa718d0309275effadbd8)
(cherry picked from commit 712c52a32a3b6ce9aafaefaf9e63729522d1e0c5)
(cherry picked from commit ba3d93cc4a5dca5d0daef647fab557e0136925e2)
(cherry picked from commit a5a0396abc512834ca7b0b247277e4d753a87659)
(cherry picked from commit c1f389f0cb237dcce05db4ade342d48e260ae144)
(cherry picked from commit 87d4d2da9faf9cacdd6f0441914c806efe4d1e36)
(cherry picked from commit 89d7559054c8d99d1eb4bb151f3514cbb865e82f)
(cherry picked from commit 7698cc0c8553d0135d41344ece12f18ad8fc15aa)
(cherry picked from commit 69e24c60e131694ea65ba99eef29834f7b0e8365)
2023-11-13 13:58:17 +01:00
Caesar Schinas 3d90531df2
[BRANDING] Add forgejo emoji
(cherry picked from commit ade55ad308ea0ac6bb36903e3a69b02d18228adb)
(cherry picked from commit 107f7266183584b51299351961b73ab2b185f24b)
(cherry picked from commit f29cf9cfc107692cd79a4ba4062a66f90813bc4e)
(cherry picked from commit 0761a41eee30a32c822834ca2b989ad6343ed1e0)
(cherry picked from commit 2b1fd9565f615dde8bdd07d86ff3a5ca3815af67)
(cherry picked from commit 6a7c82f13b17df1fa647130d086fbcdbeb086571)
(cherry picked from commit 4a56d404942562e3f5a45abd45518bc8679109b6)
(cherry picked from commit b48e3e896d0d3942362b5a1c18f847ffd64609cb)
(cherry picked from commit bde83340cbcce8370d524da9c909731c78544c49)
(cherry picked from commit 74e0603d6be22d8d74d38f9c99c8bcf26dd83482)
(cherry picked from commit 84bd1ddc082aa55a7d7c03eeac55478f0e15e019)
(cherry picked from commit 62d9acde2a0692f46257dc3db329e0196b74837a)
(cherry picked from commit 5b84a909135a4d71c778a2d0719a20ff01abef64)
(cherry picked from commit 5362f7d053f4e8bd6a91d93ddbcb6d291a250efe)
(cherry picked from commit 65ad7d1bd9875b6dd00f3ef31bc1d5ef2b9e84f5)
(cherry picked from commit 6e42d545a97ef7d470b57f6ae43ae15fa1581a37)
(cherry picked from commit 24d3bb33e2031a44c535602a7a083194acacbff1)
(cherry picked from commit 704935cadd997dcc1dea5e51a089ed25ec1ccab1)
(cherry picked from commit 5d9fc59e17c9be563432376c3b7d1851300ccdac)
(cherry picked from commit 4c95df3f86f9e778a9d1267cdca22c4ce15ffb94)
(cherry picked from commit 1ac704762ac78ba2a86a787f02de45779d765673)
(cherry picked from commit 0da9fb13189b0bff21a734c0f635ec196731a91f)
(cherry picked from commit bc2de51eeffea7fb4c5b53e7a72cab315af8215a)
(cherry picked from commit ea897a20b91e89be48570ca923dcbea1b4baf81e)
(cherry picked from commit 66f3f9c6effd19ca6762437e7756bd3ac564a6f3)
(cherry picked from commit edc5c3c3043867ea01b93f50ca83014592ef89b6)
(cherry picked from commit 11dd4f31a49b5448d4207c928df6be647adf5ce0)
(cherry picked from commit bf0fb77afb91dfff7ba81a59bbf5506a6b0a6462)
(cherry picked from commit 3a823b1001817b906c31453ff86d43ebe6bf9719)
(cherry picked from commit e1f6cb4ed607f17da4bedf36fe60af9d4a492089)
(cherry picked from commit 0b3f45972ff338a00ca084b1c3371714fc1b7011)
(cherry picked from commit a9579c967946436338e44d323db2303f108dbf69)
(cherry picked from commit 0dea1aadf25e120ee1f19ffa6f15caa285ad3c7b)
(cherry picked from commit aeed23b96ee384054068633cb3bae71893d9382c)
(cherry picked from commit 31aa43a8bc14b47963ff1e3f7b1ca8da54ca17c3)
(cherry picked from commit 676cd339af1072b3c7b58a035e9f18762211957f)
(cherry picked from commit beff769f0ae952897f8164cfa2689d073ff5b35e)
(cherry picked from commit 366b3301ae624daaab1579d8af9d6b07eb0ff6bb)
(cherry picked from commit 641dd94cbc3cc02407bb6b7b91a01448addd90e6)
2023-11-13 13:58:17 +01:00
Caesar Schinas 4562f674b2
[BRANDING] Rebrand footer "powered by" links
(cherry picked from commit 8b9237e47e067db4cb8b1d477865d75b258bee1e)
(cherry picked from commit 47e5543f33a9dafac5517cb5cb29d0fe6d266e2a)
(cherry picked from commit 456abff8c0567168b1a6c0d02d6830404d1b0dd3)
(cherry picked from commit 2d2588187ec20cb2f552cd3ee2b04a541909dc5c)
(cherry picked from commit a81e4e2588af2d1e9db253ca51649451d8dd94cf)
(cherry picked from commit 70c4ee8fbad69efcc02493ab8e1c692573ac0409)
(cherry picked from commit f12b0577e89ae223dc239c7ace5c692d30cd0e9b)
(cherry picked from commit 025e6e1974c8066c27e918020a6094fc8372f521)
(cherry picked from commit e051684c83e369177d22a77bff46e82998495267)
(cherry picked from commit ee370f3f3cf5ec81e170fc16c8ef982b47c99797)
(cherry picked from commit a1b53a8b883559a31b16a15a383ac5fe25a62189)
(cherry picked from commit e01158af9b037cff4248b0b577505023c9564b7e)
(cherry picked from commit c9f6b6c8a18b39e804e8464dfc80178af3efdada)
(cherry picked from commit 6abaa468d5cc1ae7f59b9026f4221b15911f3ba1)
(cherry picked from commit d039148bc83d6957435f2d3fd00b5f18c9af99e2)
(cherry picked from commit d3aadcac8bf4e136bb16e86702831cbcb6e6692f)
(cherry picked from commit e739f46aaef7d162bf42f152b665349e25aadc1b)
(cherry picked from commit 228671e72353a1366488cd28406478ee866f823f)
(cherry picked from commit 8965f9bdf248dfb80b80269d565ff17e8437a411)
(cherry picked from commit 5e97896da347dcfb592eb0bcef172652f43fed90)
(cherry picked from commit df8bdce12a1ef0d4578fca2b55d30c9f981feabb)
(cherry picked from commit 33ecf86e423c4481cb34de4a2c6d743602631891)
(cherry picked from commit 038ac822db5be6ad65f09050bb60cb0f2afffe66)
(cherry picked from commit 6decbafd3a3d53f9dc9ae58da302968b31aca32a)
(cherry picked from commit ad2b719be5629bf4ed544666a294a2f5c040da92)
(cherry picked from commit d9b2f11a7b778b71f06f0256ccba188dee445f79)
(cherry picked from commit 102033346275114f8de5f682749bda125c15a769)
(cherry picked from commit c1279c7d45fe91cae6e88c143280601e9b866bee)
(cherry picked from commit a0dfccbba42b498aa4024956eedcb3de12ed2db5)

Conflicts:
	templates/base/footer_content.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1420
(cherry picked from commit 9651bcf9c6c81451b6e2fdb736f3f6c1e133afe1)
(cherry picked from commit 73cd49d3e52de053e852599efdc677dca04a94fb)
(cherry picked from commit c4778ed2ec654001b3d579c73fa2dc791d87bf34)
(cherry picked from commit ca0bd91ab75371fbbd1c5b871bafd163221ae182)
(cherry picked from commit e3720f5b138d423322c925d6b74bf3e62858239b)
(cherry picked from commit e951185ce195f83224ba30c62c945b7187e2a336)
(cherry picked from commit 3f469c96359e29dd84064ae6be44f178c58dc7b7)
(cherry picked from commit 6a1fbb01c8a861f9ff182ecd61732dc37d54e7de)
(cherry picked from commit ddb426df0462bef5de94508b112837c3cbb2b21e)
(cherry picked from commit fe9e0d6083ca97a1375ce4c7431b6886534f4b20)
2023-11-13 13:58:17 +01:00
Gusted af2f7a9ee1
[BRANDING] Rebrand systemd service (#137)
- We can rebrand this quite safely, as only new installations would likely look into this file and configure the correct folders(to use forgejo instead of gitea).

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/137
(cherry picked from commit fa78e52b5d25556b4a4313c4ac78edf6306c5bbe)
(cherry picked from commit e36d649989a69a1761c3d7cc709f97f80c8d378a)
(cherry picked from commit 37e15a2f4108c4b7e082a69fb8cb77068fa6dc15)
(cherry picked from commit a09a4b3ce0b6f63ac44bf4ea0f4ba275a9915598)
(cherry picked from commit 3096b37c950db77296f22d16d64efe3737246a4b)
(cherry picked from commit 187ad96c94b7fbc261c88a4ff513066acc562642)
(cherry picked from commit e15eb31c6e6310d14175cc270707d7cbfb95b819)
(cherry picked from commit e276abe3410cef5fe63bf05c6f089ed4a3da49dc)
(cherry picked from commit 31223db5e3290ccf67a504db1937e5adb903b204)
(cherry picked from commit 8ebffe0b71db27b40f2049ca77878748e6756ec1)
(cherry picked from commit 1d198363469814584c50e4717a7f96cafb06aa46)
(cherry picked from commit baaf749ce07f978466d6c397c1ed6bb6a1c75330)

Conflicts:
	contrib/systemd/forgejo.service
(cherry picked from commit c309b1a1f4fa2942218352a6ec3edbf39efb9a11)
(cherry picked from commit d6f57409dacf2645cd19bcd8a79219a9a8c1bffe)
(cherry picked from commit c6e665b0380f1d70c8c378b65c369a85eab9664c)
(cherry picked from commit 8764e26c434ec8027acaaabdf65e3122e5965178)
(cherry picked from commit a0560e454b4d5d7dac357a95dbaeb2b187a173ff)
(cherry picked from commit e074e83094866421f94cb3cef912794a31b88c82)
(cherry picked from commit 605b84bc779d41deac03595c8ddb7fa12b2b24e8)
(cherry picked from commit 35b233202058e219dec5acfc72ff0d7085a41318)
(cherry picked from commit b9c396f29566ec064a7c4031d4f766a25594eba4)
(cherry picked from commit 83a7e91bad1d99092c8c553ce740c65256901abb)
(cherry picked from commit 3794ad271a40bb4212cb14e24a6100b539d3a776)
(cherry picked from commit 818451287d166658f6ce18892a6ed9811324aa67)
(cherry picked from commit ec9bc9e6417fd7df3e636c231fb80a3442972542)
(cherry picked from commit 8434efaed8637351f6fe53c01dd4fb3edf09fce1)
(cherry picked from commit 3b1a4b7f389e7548f94d2d1b742de086aa77bfc6)
(cherry picked from commit c186b5a3e51c24f795967dc4811d89ed0b841b24)
(cherry picked from commit e35d92de1f37bea0a593093678f093845955e3fc)
(cherry picked from commit c8bb51718360d1e90716c5c6253c55a6d7817a7e)
(cherry picked from commit 9ac843d662122c5585a53a1aa9df1662adecb41f)
(cherry picked from commit 86c723ca0a1b68ee204188cc45977d78ab7d8c7c)
(cherry picked from commit c662da2a84e2266e571cea91cdedcf1a9906cd1a)
(cherry picked from commit 6f9390ed438fbae94698f56be1f98a63c88241c1)
(cherry picked from commit dd4418215ee28ab076032dfd9e26a598d24deb7c)
(cherry picked from commit 6703caec3b268bac24d3de6d7b1b61065ba75727)
(cherry picked from commit 1d86d4d6f2424e81b08e9a95e7d50253ddaf802c)
(cherry picked from commit 49c7cead23575dfe6770e66a64984281c4120ebd)
(cherry picked from commit d64deb47fac396967538830a2b794b5585838ba4)
2023-11-13 13:58:17 +01:00
Caesar Schinas 66a6726a28
[BRANDING] add Forgejo logo
(cherry picked from commit f42622c7d5a28859f535e0d86ece06101baad1ef)
(cherry picked from commit a39e7f2a79f6527d45439f21bd88378264160c3a)
(cherry picked from commit afa2a31bb99c0fd9cd25c3c0279e6c49695b1900)
(cherry picked from commit 276e8856e594ad7e73414382d34fdf0278cbca6a)
(cherry picked from commit 68e3bd469f2e8190db70d4e1564fb46d01feb5f4)
(cherry picked from commit af124b9ccbb0b699ea5d1bf1530613cb9a96f205)
(cherry picked from commit b89ab4874d403c784c92e579f4f6a854621c0078)
(cherry picked from commit 0f2a2f0d0ff9851428d6899e307f3547d7651f87)
(cherry picked from commit 80999363c73e4e01cbf9116491743c87baa952af)
(cherry picked from commit f8880b5463aa1db047d89080d21e7a69979eb4a6)
(cherry picked from commit 5f4cf4f6e143237c81da3e80875727cef4b76343)
(cherry picked from commit b38e26bc1a8bb117f571672961a8445cfc02c953)
(cherry picked from commit d839e0033244b63df16c8b548cc52106fc693629)
(cherry picked from commit 32ffe2e4f12c16a44a759c906078d40731c1a0c7)
(cherry picked from commit f1fd0504add78ae3fb5c710ab5a9ada20321afac)
(cherry picked from commit 6d77ea4d60a193d9d4175c4943b34077228e5964)
(cherry picked from commit 61a0a4a276303c3fd56f93fd109e3416cfdf7c60)
(cherry picked from commit a90b4126fdd55feef43f45d1dc3e3400806a476b)
(cherry picked from commit 9a20538fb4e88682e213a20813b77cc0f602fbfd)
(cherry picked from commit ce0fc02f0fbaa45b146fed175ce68bd02c507f3e)
(cherry picked from commit 541f7cb026f976d078ecb6da3a6c9e13cc4336f2)
(cherry picked from commit d6d0c2ab78a14d7aac8d7b6b0d007149de2f7295)
(cherry picked from commit 2c28f5ad2496cf30eb15d6caf9171b79e5017141)
(cherry picked from commit 9571bddb3308e3c1f0383e60f972ca61a0a467b7)
(cherry picked from commit c83ba08d01f149ecd52d983eec76bd60822c1ddd)
(cherry picked from commit 30e7d567ede79c015d0d115d9a2d535e6c681cb9)
(cherry picked from commit a8b8c3eba75511449dc97fa27b37db1076ce95f0)
(cherry picked from commit 8e053e1ade4710ade3b6e4bc6aa04fe9281243d7)
(cherry picked from commit 9e3b0f7520a56e5eb22cd0e33e231ea9063f0e1f)
(cherry picked from commit 2343b9bd09cda3e474b36842fae419f9fe32b134)
(cherry picked from commit 56572d4156050c2beb62f63a871375fdc2424271)
(cherry picked from commit 9b09eda1680282f8114f752e52afd544ef30350c)
(cherry picked from commit 86a8b7b4904158ea80d259d7a1846528a9b3c403)
(cherry picked from commit 99a550c0e3de3bd8d17a610b849da0c04f776dbd)
(cherry picked from commit d68422d18769ddb37ef594904367220a6ce77e77)
(cherry picked from commit 4eb58c117d50744f45ca94403bcfd930f7ee2351)
(cherry picked from commit 78142114b624e6eafed3711d599b3b955af17a5e)
(cherry picked from commit 461c883396facd2e22a662dc538795a78202fe49)
(cherry picked from commit e1f97e5307b6f61ae6ed026a9df45e4730fbc8a7)
2023-11-13 13:58:17 +01:00
Lunny Xiao 6dcef7f2f7
Test more templates for if they contain an error (#27367)
(cherry picked from commit 439a0cca2c)
(cherry picked from commit a4ee21cb5be71a5e07a161f5e92079f1c42feea6)
(cherry picked from commit 22a32ef309cc1028e01c4533bf1d394d7e6941e9)
(cherry picked from commit 7d748224000245b97aa56a0e0e48d2b9aaa175b9)
(cherry picked from commit cb92fad0efbc888caaf2bfdabb7919d1253abe9b)
(cherry picked from commit a647f7d9aaf21f04e686cf28a631246713bd2838)
(cherry picked from commit abe5a0343d8084481a70d24a845a6469bfa84eaf)
2023-11-13 13:58:17 +01:00
merlleu 82a767dc76
Cargo package - Fix missing domain in cargo sparse url (#27370)
Hello, it seems that one my previous PR (adding the sparse index to the
cargo package content page), did not worked as expected: the
gitea-origin-url does not add the AppURL because of the `sparse+` prefix
in the url.
Currently the rendered page gives the following:
```toml
[registry]
default = "gitea"

[registries.gitea]
index = "sparse+/api/packages/ownername/cargo/" # Sparse index
# index = "https://git.example.com/ownername/_cargo-index.git" # Git

[net]
git-fetch-with-cli = true
```

(cherry picked from commit a112cf34d3)
(cherry picked from commit 4e30c94a40c5c959a2d83498c24095556bfd9e80)
(cherry picked from commit 72a1d0403f28146a057aada3be1a6ebfce262db0)
(cherry picked from commit 9c3d42f69754d36741b58a581cfa10647aa67f72)
(cherry picked from commit b66322a5e388ed3e5e2a0d88830a2d4725fec7c8)
(cherry picked from commit 25019a6d283d395adc51c6929edc6b27853452f3)
(cherry picked from commit 124b4dc6e4ed82eccf466877e13c73fc87d00061)
2023-11-13 13:58:17 +01:00
Gusted fa7b6ca335
[MODERATION] Prepare moderation for context locale changes (squash)
- Resolves https://codeberg.org/forgejo/forgejo/issues/1711

(cherry picked from commit 2e289baea943dcece88f02d110b03d344308a261)
(cherry picked from commit 07ecf49c0596b8b49aec1a5c3aeff1ef93f0655c)
(cherry picked from commit e06190b39400904137e4ed69b1b2f93adfd8751d)
2023-11-13 13:58:02 +01:00
Gusted bfd4c8a15d
[MODERATION] User blocking
- Add the ability to block a user via their profile page.
- This will unstar their repositories and visa versa.
- Blocked users cannot create issues or pull requests on your the doer's repositories (mind that this is not the case for organizations).
- Blocked users cannot comment on the doer's opened issues or pull requests.
- Blocked users cannot add reactions to doer's comments.
- Blocked users cannot cause a notification trough mentioning the doer.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/540
(cherry picked from commit 687d852480388897db4d7b0cb397cf7135ab97b1)
(cherry picked from commit 0c32a4fde531018f74e01d9db6520895fcfa10cc)
(cherry picked from commit 1791130e3cb8470b9b39742e0004d5e4c7d1e64d)
(cherry picked from commit 37858b7e8fb6ba6c6ea0ac2562285b3b144efa19)
(cherry picked from commit a3e2bfd7e9eab82cc2c17061f6bb4e386a108c46)
(cherry picked from commit 7009b9fe87696b6182fab65ae82bf5a25cd39971)

Conflicts: https://codeberg.org/forgejo/forgejo/pulls/1014
        routers/web/user/profile.go
        templates/user/profile.tmpl
(cherry picked from commit b2aec3479177e725cfc7cbbb9d94753226928d1c)
(cherry picked from commit e2f1b73752f6bd3f830297d8f4ac438837471226)

[MODERATION] organization blocking a user (#802)

- Resolves #476
- Follow up for: #540
- Ensure that the doer and blocked person cannot follow each other.
- Ensure that the block person cannot watch doer's repositories.
- Add unblock button to the blocked user list.
- Add blocked since information to the blocked user list.
- Add extra testing to moderation code.
- Blocked user will unwatch doer's owned repository upon blocking.
- Add flash messages to let the user know the block/unblock action was successful.
- Add "You haven't blocked any users" message.
- Add organization blocking a user.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/802
(cherry picked from commit 0505a1042197bd9136b58bc70ec7400a23471585)
(cherry picked from commit 37b4e6ef9b85e97d651cf350c9f3ea272ee8d76a)
(cherry picked from commit c17c121f2cf1f00e2a8d6fd6847705df47d0771e)

[MODERATION] organization blocking a user (#802) (squash)

Changes to adapt to:

  6bbccdd177 Improve AJAX link and modal confirm dialog (#25210)

Refs: https://codeberg.org/forgejo/forgejo/pulls/882/files#issuecomment-945962
Refs: https://codeberg.org/forgejo/forgejo/pulls/882#issue-330561
(cherry picked from commit 523635f83cb2a1a4386769b79326088c5c4bbec7)
(cherry picked from commit 4743eaa6a0be0ef47de5b17c211dfe8bad1b7af9)
(cherry picked from commit eff5b43d2e843d5d537756d4fa58a8a010b6b527)

Conflicts: https://codeberg.org/forgejo/forgejo/pulls/1014
        routers/web/user/profile.go
(cherry picked from commit 9d359be5ed11237088ccf6328571939af814984e)
(cherry picked from commit b1f3069a22a03734cffbfcd503ce004ba47561b7)

[MODERATION] add user blocking API

- Follow up for: #540, #802
- Add API routes for user blocking from user and organization
perspective.
- The new routes have integration testing.
- The new model functions have unit tests.
- Actually quite boring to write and to read this pull request.

(cherry picked from commit f3afaf15c7e34038363c9ce8e1ef957ec1e22b06)
(cherry picked from commit 6d754db3e5faff93a58fab2867737f81f40f6599)
(cherry picked from commit 2a89ddc0acffa9aea0f02b721934ef9e2b496a88)
(cherry picked from commit 4a147bff7e963ab9dffcfaefa5c2c01c59b4c732)

Conflicts:
        routers/api/v1/api.go
        templates/swagger/v1_json.tmpl
(cherry picked from commit bb8c33918569f65f25b014f0d7fe6ac20f9036fc)
(cherry picked from commit 5a11569a011b7d0a14391e2b5c07d0af825d7b0e)
(cherry picked from commit 2373c801ee6b84c368b498b16e6ad18650b38f42)

[MODERATION] restore redirect on unblock

 ctx.RedirectToFirst(ctx.FormString("redirect_to"), ctx.ContextUser.HomeLink())

was replaced by

 ctx.JSONOK()

in 128d77a3a Following up fixes for "Fix inconsistent user profile layout across tabs" (#25739)

thus changing the behavior (nicely spotted by the tests). This
restores it.

(cherry picked from commit 597c243707c3c86e7256faf1e6ba727224554de3)
(cherry picked from commit cfa539e590127b4b953b010fba3dea21c82a1714)

[MODERATION] Add test case (squash)

- Add an test case, to test an property of the function.

(cherry picked from commit 70dadb1916bfef8ba8cbc4e9b042cc8740f45e28)

[MODERATION] Block adding collaborators

- Ensure that the doer and blocked user cannot add each other as
collaborators to repositories.
- The Web UI gets an detailed message of the specific situation, the API
gets an generic Forbidden code.
- Unit tests has been added.
- Integration testing for Web and API has been added.
- This commit doesn't introduce removing each other as collaborators on
the block action, due to the complexity of database calls that needs to
be figured out. That deserves its own commit and test code.

(cherry picked from commit 747be949a1b3cd06f6586512f1af4630e55d7ad4)

[MODERATION] move locale_en-US.ini strings to avoid conflicts

Conflicts:
        web_src/css/org.css
        web_src/css/user.css
        https://codeberg.org/forgejo/forgejo/pulls/1180

(cherry picked from commit e53f955c888ebaafc863a6e463da87f70f5605da)

Conflicts:
        services/issue/comments.go
        https://codeberg.org/forgejo/forgejo/pulls/1212
(cherry picked from commit b4a454b576eee0c7738b2f7df1acaf5bf7810d12)

Conflicts:
        models/forgejo_migrations/migrate.go
        options/locale/locale_en-US.ini
        services/pull/pull.go
        https://codeberg.org/forgejo/forgejo/pulls/1264

[MODERATION] Remove blocked user collaborations with doer

- When the doer blocks an user, who is also an collaborator on an
repository that the doer owns, remove that collaboration.
- Added unit tests.
- Refactor the unit test to be more organized.

(cherry picked from commit ec8701617830152680d69d50d64cb43cc2054a89)
(cherry picked from commit 313e6174d832501c57724ae7a6285194b7b81aab)

[MODERATION] QoL improvements (squash)

- Ensure that organisations cannot be blocked. It currently has no
effect, as all blocked operations cannot be executed from an
organisation standpoint.
- Refactored the API route to make use of the `UserAssignmentAPI`
middleware.
- Make more use of `t.Run` so that the test code is more clear about
which block of code belongs to which test case.
- Added more integration testing (to ensure the organisations cannot be
blocked and some authorization/permission checks).

(cherry picked from commit e9d638d0756ee20b6bf1eb999c988533a5066a68)

[MODERATION] s/{{avatar/{{ctx.AvatarUtils.Avatar/

(cherry picked from commit ce8b30be1327ab98df2ba061dd7e2a278b278c5b)
(cherry picked from commit f911dc402508b04cd5d5fb2f3332c2d640e4556e)

Conflicts:
	options/locale/locale_en-US.ini
	https://codeberg.org/forgejo/forgejo/pulls/1354
(cherry picked from commit c1b37b7fdaf06ee60da341dff76d703990c08082)
(cherry picked from commit 856a2e09036adf56d987c6eee364c431bc37fb2e)

[MODERATION] Show graceful error on comment creation

- When someone is blocked by the repository owner or issue poster and
try to comment on that issue, they get shown a graceful error.
- Adds integration test.

(cherry picked from commit 490646302e1e3dc3c59c9d75938b4647b6873ce7)
(cherry picked from commit d3d88667cbb928a6ff80658eba8ef0c6c508c9e0)
(cherry picked from commit 6818de13a921753e082b7c3d64c23917cc884e4b)

[MODERATION] Show graceful error on comment creation (squash) typo

(cherry picked from commit 1588d4834a37a744f092f2aeea6c9ef4795d7356)
(cherry picked from commit d510ea52d091503e841d66f2f604348add8b4535)
(cherry picked from commit 8249e93a14f628bb0e89fe3be678e4966539944e)

[MODERATION] Refactor integration testing (squash)

- Motivation for this PR is that I'd noticed that a lot of repeated
calls are happening between the test functions and that certain tests
weren't using helper functions like `GetCSRF`, therefor this refactor of
the integration tests to keep it: clean, small and hopefully more
maintainable and understandable.
- There are now three integration tests: `TestBlockUser`,
`TestBlockUserFromOrganization` and `TestBlockActions` (and has been
moved in that order in the source code).
- `TestBlockUser` is for doing blocking related actions as an user and
`TestBlockUserFromOrganization` as an organisation, even though they
execute the same kind of tests they do not share any database calls or
logic and therefor it currently doesn't make sense to merge them
together (hopefully such oppurtinutiy might be presented in the future).
- `TestBlockActions` now contain all tests for actions that should be
blocked after blocking has happened, most tests now share the same doer
and blocked users and a extra fixture has been added to make this
possible for the comment test.
- Less code, more comments and more re-use between tests.

(cherry picked from commit ffb393213d2f1269aad3c019d039cf60d0fe4b10)
(cherry picked from commit 85505e0f815fede589c272d301c95204f9596985)
(cherry picked from commit 0f3cf17761f6caedb17550f69de96990c2090af1)

[MODERATION] Fix network error (squash)

- Fix network error toast messages on user actions such as follow and
unfollow. This happened because the javascript code now expects an JSON
to be returned, but this wasn't the case due to
cfa539e590127b4953b010fba3dea21c82a1714.
- The integration testing has been adjusted to instead test for the
returned flash cookie.

(cherry picked from commit 112bc25e548d317a4ee00f9efa9068794a733e3b)
(cherry picked from commit 1194fe4899eb39dcb9a2410032ad0cc67a62b92b)
(cherry picked from commit 9abb95a8441e227874fe156095349a3173cc5a81)

[MODERATION] Modernize frontend (squash)

- Unify blocked users list.
- Use the new flex list classes for blocked users list to avoid using
the CSS helper classes and thereby be consistent in the design.
- Fix the modal by using the new modal class.
- Remove the icon in the modal as looks too big in the new design.
- Fix avatar not displaying as it was passing the context where the user
should've been passed.
- Don't use italics for 'Blocked since' text.
- Use namelink template to display the user's name and homelink.

(cherry picked from commit ec935a16a319b14e819ead828d1d9875280d9259)
(cherry picked from commit 67f37c83461aa393c53a799918e9708cb9b89b30)

Conflicts:
	models/user/follow.go
	models/user/user_test.go
	routers/api/v1/user/follower.go
	routers/web/shared/user/header.go
	routers/web/user/profile.go
	templates/swagger/v1_json.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1468
(cherry picked from commit 6a9626839c6342cd2767ea12757ee2f78eaf443b)

Conflicts:
	tests/integration/api_nodeinfo_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1508#issuecomment-1242385
(cherry picked from commit 7378b251b481ed1e60e816caf8f649e8397ee5fc)

Conflicts:
	models/fixtures/watch.yml
	models/issues/reaction.go
	models/issues/reaction_test.go
	routers/api/v1/repo/issue_reaction.go
	routers/web/repo/issue.go
	services/issue/issue.go
	https://codeberg.org/forgejo/forgejo/pulls/1547
(cherry picked from commit c2028930c101223820de0bbafc318e9394c347b8)
(cherry picked from commit d3f9134aeeef784586e8412e8dbba0a8fceb0cd4)
(cherry picked from commit 7afe154c5c40bcc65accdf51c9224b2f7627a684)
(cherry picked from commit e6839caa4ec21e4a6d35bbc2a8ee63957263b537)
(cherry picked from commit f546c95c294c4e3d828e469b8e61d7ebe1bdfeef)
(cherry picked from commit 839aa964a0ab2208a3399923f8ade25978e75dcd)

Conflicts:
	services/user/delete.go
	https://codeberg.org/forgejo/forgejo/pulls/1731

[MODERATION] Add repo transfers to blocked functionality (squash)

- When someone gets blocked, remove all pending repository transfers
from the blocked user to the doer.
- Do not allow to start transferring repositories to the doer as blocked user.
- Added unit testing.
- Added integration testing.

(cherry picked from commit 8a3caac33013482ddbee2fa51510c6918ba54466)
(cherry picked from commit a92b4cfeb63b90eb2d90d0feb51cec62e0502d84)
(cherry picked from commit acaaaf07d999974dbe5f9c5e792621c597bfb542)
(cherry picked from commit 735818863c1793aa6f6983afedc4bd3b36026ca5)
(cherry picked from commit f50fa43b32160d0d88eca1dbdca09b5f575fb62b)
(cherry picked from commit e16683643388fb3c60ea478f1419a6af4f4aa283)
(cherry picked from commit e0187b21fe9be69ffb3bcd2ff9262a8b241991f3)
(cherry picked from commit 697a492686a070f87d953509336680e46abac479)
(cherry picked from commit beb4a8a4523b6ede54fad42a6934ab69ac5613a1)

[MODERATION] Fix unblock action (squash)

- Pass the whole context instead of only giving pieces.
- This fixes CSRF not correctly being inserted into the unblock buttons.

(cherry picked from commit 2aa51922ba6a0ea2f8644277baa74fc8f34ab95a)
(cherry picked from commit 7ee8db0f018340bc97f125415503e3e5db5f5082)
(cherry picked from commit e4f8b999bcd3b68b3ef7f54f5b17c3ada0308121)
(cherry picked from commit 05aea60b1302bbd3ea574a9c6c34e1005a5d73bf)
(cherry picked from commit dc0d61b012cfaf2385f71e97cda5f220b58b9fa4)
(cherry picked from commit f53fa583de671ff60a0a1d0f3ab8c260e1ba4e1f)
(cherry picked from commit f3d129247ee1ade960fd2bd785bbf4bb46830e6f)
(cherry picked from commit 2369d918b4f7b172af0914232fdac84ec6886aeb)
(cherry picked from commit 609f56d4f277cf827f9dffe9f5d7bead4f31eefd)

[MODERATION] cope with shared fixtures

* There is one more issue in the fixtures and this breaks some tests
* The users in the shared fixtures were renamed for clarity and that
  breaks some tests

(cherry picked from commit 707a4edbdf67d0eb168d7bb430cf85dd8cd63c52)

Conflicts:
	modules/indexer/issues/indexer_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1508
(cherry picked from commit 82cc044366c749df80ffad44eed2988b8e64211e)
(cherry picked from commit 2776aec7e85850f1d7f01a090a72491550fb9d29)
(cherry picked from commit 1fbde36dc784b5b2cc6193f02ff0d436b0f2a629)
(cherry picked from commit 1293db3c4e5df218501f5add9f9d41101ffcb8aa)
(cherry picked from commit 6dbce742d3a3d3504c4e5e3f4491f1007cf50554)
(cherry picked from commit 652ad8f0f77fb70930e19c82a238ca1f99e1532f)
(cherry picked from commit 6ad40a59dc790213b8e7f111d0009ea2bb1dd14c)

[MODERATION] Fix transfer confirmation (squash)

- Fix problem caused by the clearer confirmation for dangerous actions commit.

(cherry picked from commit 3488f4a9cb1f7f73103ae0017d644f13ca3ab798)
(cherry picked from commit ed7de91f6ace23a1459bc6552edf719d62c7c941)
(cherry picked from commit 2d97929b9b7b8d979eb12bf0994d3f169d41f7fd)
(cherry picked from commit 50d035a7b058b9c4486c38cd4be0b02a4e1bf4d9)
(cherry picked from commit 0a0c07d78a1dee3489b97ab359bb957e3f7fb94b)
(cherry picked from commit 79009609e31f04109aa6a4074f32d02666e24e38)
(cherry picked from commit b576f3cda3f10afd65ed208952e027e6033d7ee2)
(cherry picked from commit c5969abfb4efa87c8f7805324763d35e47dc1fe6)

[MODERATION] Purge issues on user deletion (squash)

(cherry picked from commit 4f529d9596ffbfc4e754c28830ba028f6344dc5b)
(cherry picked from commit f0e3acadd321fcb99e8ea3e3ce1c69df25c4ca4d)
(cherry picked from commit 682c4effe69dc0d4ed304fa7ce6259d9ce573629)
(cherry picked from commit eb99857433fa7e62f7430d9cf21133f7417a6a88)
(cherry picked from commit 9af6e03aabde83a6078fa38390b035f388a86b51)
(cherry picked from commit ad3ad4baecf24226b6f00aa1026b12fb70cb8af9)

[MODERATION] Purge issues on user deletion (squash) revert shared fixtures workarounds

(cherry picked from commit 7224653a40e32186892e89bfedd49edecf5b8f81)
(cherry picked from commit aa6e8672f9473a9100e7575051dec9eda37709a0)
(cherry picked from commit 58c7947e95648f50237ddcd46b6bd025b224a70f)
(cherry picked from commit 149f6b3533190458a067a80ccdf1b3f0416ba1f8)
(cherry picked from commit 65e65e04f360e5fe4e0add94eaced40627e9e241)
(cherry picked from commit 57428561b55265ada37fe745d36547c99516c03a)
(cherry picked from commit 94b6046c52535f7d0e0ec2c9eb9feeda4029cd79)
2023-11-13 13:58:02 +01:00
Gusted f9653f036c
[MODERATION] Purge issues on user deletion
- Forgejo has the option to delete users, in which all data except
issues and comments are removed, this makes sense in some cases where
users need to be removed cleanly but without removing their existing bug
reports or comments to an discussion. In the case of spammers, admins
have the option to enable purging, where comments are removed.
- Add issues to the list of things to be removed if purge is checked.
- No unit testing, as this gigantic function doesn't have one to begin
with.
- Add integration test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1268

(cherry picked from commit 3ed381c75826ffc6834fd54943f71579c060c16d)
(cherry picked from commit 44d00650ce77bd4395892a62a64a90829578c81d)
(cherry picked from commit 7f4da82779fa1d761b5fe045d3e0b4b2627638c0)
(cherry picked from commit d629314def8e3e6d0f78184aa584fa57ece18bb1)

Conflicts:
	models/fixtures/issue.yml
	https://codeberg.org/forgejo/forgejo/pulls/1508
(cherry picked from commit 794dcc218f2c0c53028aaf617407d46bddda57f3)
(cherry picked from commit c433f2ecb60669e5c8748912b30c0433d5fe507a)
(cherry picked from commit bb23683f4b10a504da677843bc2ae2b73ec299c4)
(cherry picked from commit 634c5604d430b1b531467783bc70bb4efbee023d)
(cherry picked from commit 492ff6379adab7dba1f55e6037fd7be7d8804a0d)
(cherry picked from commit 496b04f8e7dfe5e52fa1ab5c81591c548b588897)
(cherry picked from commit 3c6e5fca849ef6621bd5e2767f78139abcf44f2a)
(cherry picked from commit b309d0b54914a73dec2c075265dc2b5a70e62ac2)
2023-11-13 13:58:01 +01:00
fnetx c712aaccea
[I18N] Move source locales to other folder
(cherry picked from commit d38ad85a05cb3547ad1c3f90531811aa9c78ca9d)
(cherry picked from commit b94f9b8c1bdc62d7437c42c4aa333c7ed30a9b9b)
(cherry picked from commit c728ce8b32b0ff52e14083d2118f6b1f233307ce)
(cherry picked from commit 2911286336f93bbf6a6dec63cf62cb1514475eff)
(cherry picked from commit bd4dc797c7cc599d2aca05b7d1ee2a6532dd0358)
(cherry picked from commit 35889addf9ee26e084ff2f525e5fb078b5d261bd)
(cherry picked from commit 9eaf321db44b70613e9f10e32f8e8628bd720610)
(cherry picked from commit 7b64ef0c9b4dc1add73d91e126388cb835a3f472)
(cherry picked from commit 6cd86bf244a29b888eb0218061aa95ee75ced790)
(cherry picked from commit 275dd36f580c9553bc78dd1b7afb672c51e35e9f)
(cherry picked from commit d5ace5a0ae27ad7c30ee5fff0f821cab4144979c)
(cherry picked from commit c067466f8c28229228ae185267e228d552bb38e3)
(cherry picked from commit 0d51a2228fe85c5ab097475987c4faf411df4658)
(cherry picked from commit 4973e19dd3b043ce6de2a33d36dadbf4155a0075)
(cherry picked from commit f553b4d54385439e3496a7890182b2a70d84a42d)
(cherry picked from commit 18312a6f74f664021df7e3beb373ef1e368198ac)
(cherry picked from commit d09dc97f8bdee6279ac9e47d4d45d241f9522251)
(cherry picked from commit 10c552e54ed92bf7f68f64b202585a481780bada)
(cherry picked from commit edf895e866469a3765a2b8cd6bbbd2cdd8c185a8)
(cherry picked from commit 786a486cfcb481844b75da2ccfddf5853fc22486)
(cherry picked from commit 2aa16d5cb9255693c8d2e7cdef854b75e2f7d499)
(cherry picked from commit 1e940cf6cd3f6c64f7ff214b5dc8693b39854ecd)
(cherry picked from commit 7355f3a65350ca325937d1ca715ac997ffb52c95)
(cherry picked from commit e630328f5fad88b570e0e89f57183d436d856ce5)
(cherry picked from commit 4f819cb97c74f727c6556979ab1826107697589a)
(cherry picked from commit 3ffdabd3edd6775641c3989f7366a04bc2a9183f)
(cherry picked from commit df4fb86007c29d08196c545b1b6f7eb77f1cd3ef)
(cherry picked from commit 3826909cbb98e3e107b6fae06b4ad3369510286f)
(cherry picked from commit d9825f7165e8e7cd025eb402df15f5f9d5a2bdc4)
(cherry picked from commit 78ce758e6090ad2bfb5c9af1a591af9e086727da)
(cherry picked from commit e94fb8986b6941ef0f1b203785571f4999242284)
(cherry picked from commit 55043c590c9e4ce2131bd7f0be00c52689223431)
(cherry picked from commit 432885ecc61783940a7da7a956017a5ab09a2a42)
(cherry picked from commit 1f923c92f22a38063edd797a491a1ff109411805)
(cherry picked from commit 3757f133877b9d3236e0516fb357476aa382eff2)
(cherry picked from commit 855f975eada74d49697f2da67860d54ef48e85db)
(cherry picked from commit e06c9f71fd07eea93d1da4435804d2cdbb43b348)
(cherry picked from commit 91dd501a6d11cd9c772554fb6d7066b42bc9c852)
(cherry picked from commit b53d3a46a75b2f59c3ceff85b99f646f6cd05f83)
2023-11-13 13:57:47 +01:00
fnetx ad366ebfdd
[I18N] Makefile + gitignore
(cherry picked from commit 68c744111d02a0cd93716a8f75442ad85f44243b)
(cherry picked from commit 30d7c4a8998baf957b8a156789cc6601d4e87628)
(cherry picked from commit 220ac0a6d3579da5d9c1a028cdd59511f3e97a88)
(cherry picked from commit 21cb16af9502c0c14aae30eee3a65d4c14be3cbe)
(cherry picked from commit 41a9373e3e78f050bb07ea475fdbf3261cf694b2)
(cherry picked from commit 69030f7803c175706946af5fb8956d19aa7d2bec)
(cherry picked from commit 92c4d4d2e6bf7f100feb5c85a9ae78afea2adbd8)
(cherry picked from commit c1bfd1730e79c6c1720df99f367ddc030282f7e3)
(cherry picked from commit 18a9a9e73cdea5bd501b10a2fde0d39be74d7f25)
(cherry picked from commit 07f988207303011b3f645dc515ff855c0317507f)
(cherry picked from commit e71b8061d4297fe2336cbf404046c1fdd8332fc6)
(cherry picked from commit 225b30f1f77cd5edd06ca4a271a64029b0391d7e)
(cherry picked from commit fdf98910039a98009e3c38be00db1785fe4292e7)
(cherry picked from commit df2f4134764a4811a4f012193b93b2d1b8a2749b)
(cherry picked from commit b01c755aaf634dd0f4c436ad90eda47f6e901afd)
(cherry picked from commit acd4275acbada93b49c0baabfc5bd9db2ebbca6c)

[I18N] Add Locale merger script (squash: compile on windows)

Fixes: https://codeberg.org/forgejo/forgejo/issues/798
(cherry picked from commit b47b205e85f115b2493bd4c3a25c199196228d7a)
(cherry picked from commit 1521f0bfd6747d0ad0d9c5e70c4c0b1d948e178e)
(cherry picked from commit 7f988de42c6934105399985c7dd652ce81b79b3f)
(cherry picked from commit d26b4913129e13c3afde69cd6c6db948e7789e3e)
(cherry picked from commit 60136bac666f588179dbe1a9d98df0f82fcfb7de)
(cherry picked from commit 915bb4b3542b14cc5f0e4d9feb3b8fa55a6d8440)
(cherry picked from commit 3e1b42a8ca84a6abb81d4dfaf84ea7be383e7a37)
(cherry picked from commit 18d8fc075fa6002fc1af0374005801cdeffc185d)
(cherry picked from commit 1d9f95687b395df973e19d97294fca16b6f233e6)
(cherry picked from commit e49da1a90d2358f18510d8e2e45448b24386f34e)
(cherry picked from commit a182baed8a6a139dc473aa74797cdc404c206a72)
(cherry picked from commit 3e48a87c0044b38dc8a9594c0dd14921a40f7e0b)
(cherry picked from commit e0bb406c146408739f3140182082e910ac5b874c)
(cherry picked from commit e45ec160f95f35a156423f98d7e8b0479184e197)
(cherry picked from commit e89ec6d0086aedd0fddc2ee282b7a0f2c87b917a)
(cherry picked from commit 80eb392c5c2c6e6decb7f99873c3dc7d6b300dd6)
(cherry picked from commit d0bce1b613ab2c72c960f1e982b5cf7d60a7dfb2)
(cherry picked from commit 8debcf86ea78cfb0e93eb720fb57f18641f1f65f)
(cherry picked from commit a9bc3c54d721dbec8df640ba80f85cf0bfd5b36a)
(cherry picked from commit d5595e4156cb7a613c1ff3cf28bfbfefa6678fd0)
(cherry picked from commit 7b7f162084e29fa5020503c1fc9d4cb1e54795d7)
(cherry picked from commit fd6810ec8ce6ef0bff0b7d54c2302b5069a5d1ef)
(cherry picked from commit 0a0801c0a28a4766c38c4e0518ad5d237a2be56c)
(cherry picked from commit d1567e766a1023d9f364c1127f4f79db3d60b3e1)
2023-11-13 13:57:47 +01:00
fnetx 44ec9b609a
[I18N] Add Locale merger script
(cherry picked from commit ecc3dae2acaf567cd6b2888cc5c582588c7bfc53)
(cherry picked from commit c6c3fc6ace6b6aa4f4877c5a96da54899f2dc2fa)
(cherry picked from commit 4833bd594a49b70896c023b41da8a87ba33add0e)

[I18N] in the home page replace GitHub with Forgejo

The english string that shows on the home page to encourage for
contribution no longer reference GitHub. But some translations still
do. In this context, and this context only, replace it with Forgejo
even though it may not be correct in some cases.

Refs: https://codeberg.org/forgejo/forgejo/pulls/450
(cherry picked from commit 71de77f5ae59617eadda9e4992f1867a7acb7f17)
(cherry picked from commit 0b5195e4e4ee1c4829d7f4e127cc48d5c0eb3d72)
(cherry picked from commit 1252e83f8c7b22e06bb37622900741caa209e9eb)
(cherry picked from commit 2ceb1b2b5faa32ca71716ed4c98d18b0942909e7)
(cherry picked from commit 59233055b1a8e9bc79c5501d6e2c2649a6d1b26b)
(cherry picked from commit 378ed6a21e0a57c3bb5211eb8ade4db499cdd7d9)
(cherry picked from commit 2d661119c3b8a8278458005273f6a32fa3216050)
(cherry picked from commit 2a95ff4107786bbf6c5b141a42e2efbd1bb897f8)
(cherry picked from commit 012b5444a80cf2aaa61b2b65efebfe0691725422)
(cherry picked from commit 2aaee4f7c4132af6f9a6e0d9aafe0218603b8a5c)
(cherry picked from commit 52b3f53cb7dfc86a1287baa40f5f5b6dce946a27)
(cherry picked from commit 24e665abe748ff34163e7c870aa0b90ffca86c26)
(cherry picked from commit 335f8b2bd1971ce3b39b57b2cfd6d8c9af85ab75)
(cherry picked from commit da3890938b7a13a467520fccfa6187376eab3050)
(cherry picked from commit 5d0cdd5fe228906d378152b2472f7399fa9e3c45)
(cherry picked from commit ed8e299b59e903f025cbbae8769e10678372b4b8)
(cherry picked from commit b38db49888a6f627ab6c440899c0f6ccc3d55979)
(cherry picked from commit c19cb35acf947153458707d8431153b8f3de0cf1)
(cherry picked from commit 45fc0e2dda954d57adab7c3fc261c4e89e9f010d)
(cherry picked from commit e7ef7c26d1883977684cf2ab576743c3d4f2f19e)
(cherry picked from commit 11d05b0dc5b4dac8b2f6bad6e1f02e32d93f1704)
(cherry picked from commit 8f7287337e7f316191c78aff01fddb3fc04ba2bb)
(cherry picked from commit 8351803ee197a18d1faf84765ce55ed9b7498f9b)
(cherry picked from commit 0ebf3c0fc73577e4a6fc379efb0164836943644b)
(cherry picked from commit 749d3b4f68db8fc6d1eca61d6b0eeb3b40b20e63)

Replaced gitea links with forgejo - protected tags, webhooks

(cherry picked from commit 12534649d06af0ac518714dc28916ccc08a5a87c)
(cherry picked from commit 5ad3ff69d41502dd8b3ac5cd30729353683c4316)
(cherry picked from commit a7a325b3f5de8fca6be552e0c98a5125858a8e0a)
(cherry picked from commit 31d2cc455f5339fc78de08237b49e4c6200a27e9)
(cherry picked from commit 99b71abfdb4a000f1081fca988bc5295cca18473)
(cherry picked from commit b096317ac9a2436e5c1563c44c5aee4be6dd2f5d)
(cherry picked from commit cbc5cfdfd690278a17f034c2b00d4b48cafba977)
(cherry picked from commit 1c99fa3f709e2ffce36c135d098971152154b7b4)
(cherry picked from commit abf26758f4c09fb411d35a7494eddc675b9ba154)
(cherry picked from commit ccf53ef1d693bf26d4d12955e2543683d1f81654)
(cherry picked from commit 1d5b008655066343d8d5c839569248cbd3b4e0dc)
(cherry picked from commit 2e96b414252dc08e43cc70e9637580a39e86f70b)
(cherry picked from commit bded7a90bea39024ccae996091ccf66ee9eaa453)
(cherry picked from commit d7f6523108710015f8b423772f2978cbfeeb960d)
2023-11-13 13:57:47 +01:00
fnetx ea0b5c2adc
[I18N] Rename upstream files
(cherry picked from commit 2d67a9a62163957eef9dd26379a229b8af741655)
(cherry picked from commit 4eac51f6a4200e01aa72fa0eaac5d72d57ed0c8e)
(cherry picked from commit 34401a28f5d1180ac580c3410209b5291428a156)
(cherry picked from commit 7210b45a61f52b3c6396c339dc525d5b58c32b54)
(cherry picked from commit cc741116d2e1423d005869b244054b41b402dc3e)
(cherry picked from commit 67a160ef0abca208610d1395a2218aab26c181a3)
(cherry picked from commit adb258767259f3e8802485990a0625bc151f364b)
(cherry picked from commit 1b57a3d6011d4b9790199cc1beb4d2220f45bb09)
(cherry picked from commit 02fbbf05384190ca3f81e6bd920e3cbe2a9cd260)
(cherry picked from commit 164af88c4b002cc8fcaaba0551608a25236a836d)
(cherry picked from commit 5102d0aded75df2d171fbc9d5763f5918663fe7e)
(cherry picked from commit f1e1e620f475d2935c2cb487574af93a5e9bb90e)
(cherry picked from commit 2bd4ab7b4635fff63552c003782f05e63fb84f3d)
(cherry picked from commit 28b511a33a2b778cf456bfaae02dc431d3c4d48e)
(cherry picked from commit dc501ba1c160ed5c401c9e21fcfddd21ee00254d)
(cherry picked from commit 252d336537286da57ec486cb43906c026c72943a)
(cherry picked from commit 8208f11db036e2d80b28a03d523f766ed69bfa43)
(cherry picked from commit da711c70b59b1d464a773be95a67eee3360ec6a4)
(cherry picked from commit 62e9a4d9179dc11cb9752fc327fb5788a259b5a2)
(cherry picked from commit 7fe6e090735aa1df498c0b2b9a63b983906fa7ec)
(cherry picked from commit cfd6782313db3e1de219b5cd9d64a556234ea2c9)
(cherry picked from commit 5188e3a0f1eb502b4b6266a828cd06a8ec748a77)
(cherry picked from commit 5d741ae4406ddf04126e689d6320ef29b84bfeda)
(cherry picked from commit b8a72e0111ddc03c583daf6432dd6aa3e507c4f9)
(cherry picked from commit 2fbbf1ef8d4342260eede975e42264a8fde072bb)
(cherry picked from commit 33597ea6c0426c7d218e5fd3511e0582e9e3720e)
(cherry picked from commit 966e0cf8c01a23a7d58583214389d22d96900cd1)
(cherry picked from commit 38d0da916793d4e420f068bb934c5143292177f4)
(cherry picked from commit b740ebf5f6a4db0a802abf7ac1f731ca82b30bc6)
(cherry picked from commit 36e0978f6e2bd59a20752063480f1c85c07947ab)
(cherry picked from commit 98e157c22223b7e4f3dcad34824e7430104848a0)
(cherry picked from commit 1ec680eb7fbfda59bf6336ad83cfdfc98759f205)
(cherry picked from commit 23848b7ce739557cafd9f6aece789f10b7f308da)
(cherry picked from commit 431c925de486848a15b48d5bf8cd5af30ce1fb50)
(cherry picked from commit df9e026d9239f839ac0b8fd35614325ba183e468)
(cherry picked from commit 97e9c735d2150d46bb0670942a9fa0092712cdb9)
(cherry picked from commit 7fa3c15cc16f04b8011c9b5d830067e7e5d25f45)
(cherry picked from commit 5af7e4abd83417914756944ffc43f6c9cd3e773a)
(cherry picked from commit 6930da9a6148b9cf9a8f955dbba84358d7635331)
2023-11-13 13:57:47 +01:00
Gusted e3c6eb4055
[PRIVACY] Add a DNS method to fetch new updates
- Use TXT records in order to determine the latest available version.
- This addresses a valid privacy issue, as with HTTP requests the server
can keep track(estimated) of how many instances are using Forgejo, with
DNS that's basically not possible as the server will never receive any
data, as the only ones receiving data are DNS resolvers.

(cherry picked from commit 0baefb546ab96bc3c06d90feffdb14873c2c2a3a)
(cherry picked from commit e8ee41880b775532e6a68bd2052ed96d369dee78)
(cherry picked from commit 7eca4f3bf1faa3f063c9668d1bb354b842361007)
(cherry picked from commit 6dde3992dc504f105f2285c34fa6445fa24da0b1)
(cherry picked from commit fb3a37fbfc73d35e3ba8d793b6051aeddcbb0634)
(cherry picked from commit 8304af1e9d94b89ee700b0d454d74d0dc5cfac64)
(cherry picked from commit 0543a7d12a4bac012db8b9e683e879e6f265a9dc)
(cherry picked from commit c3a22933b7ca8201c96267d360281848fb2a1c7e)
(cherry picked from commit e24370769413aebe96ba6cfb230da3c2c33e39f4)
(cherry picked from commit 7eb6d1bcf7a0bdae0cbbf06136854d0b29c54899)
(cherry picked from commit 1d7b9535cd73bffda5defd143c25e514cc55dee8)
(cherry picked from commit 05920dce67808ae346c4e9cd9a41c9942e857bc6)
(cherry picked from commit f173f27d7c3bf36c54b7e715a61b2308d1b0d277)
(cherry picked from commit 90e1c9340e72f08e67293647cf5f19b3e3571909)
(cherry picked from commit de68610ea70b81146f6412e42d72b97aad0428ae)
(cherry picked from commit 8d5757ea0459cffeb885462b7a9d1e1c630e1f16)
(cherry picked from commit c7a7fff316c1a88ba9b0984114a25cecfac56bce)
(cherry picked from commit 39ac8b8fc164090eacd5870bf78ea863d2add5fa)
(cherry picked from commit 98892033012ccc4f4bef30e10932fa22bf12ebcd)

[PRIVACY]: Adjust update checker description

- Resolves #323
- Adjust the description of the update check function on the
installation page to describe the privacy method instead of the HTTP
method by checking gitea.io

(cherry picked from commit 61eae5b105e374169fe23fbb150ce080f8f340ec)
(cherry picked from commit 091def20a1180af718209f2bd520cb249b1943ae)
(cherry picked from commit d5d11bf45a77cad6be2194620c4d865231cfbe67)
(cherry picked from commit 71863d470739c743335931f1563e5b63cf3194eb)
(cherry picked from commit 11ece4aab1ba7a154e985a6732c6839d8a688315)
(cherry picked from commit afdd7e714f9e735811dc909a854cfac964e474e7)
(cherry picked from commit 39170e2f1d64d79bb05940b72d7db602bcff1bce)
(cherry picked from commit 4b3a52aab82e8b9f59f247983a4aa7de65c6c747)
(cherry picked from commit 9d763c5fc8cd0ff7898855e1ef088edb264388d5)
(cherry picked from commit 638db15482f6907fa21e27aaccf6795226ae60c0)
(cherry picked from commit a52bfdd8e76466aa293855a35c6ac9e18a228e90)
(cherry picked from commit dc93d00e85dfdd9c090294f5504b8d885a602c60)
(cherry picked from commit 0bc4b3508c8d2e49b57d47b4c5b36a9365580a1b)
(cherry picked from commit 59e524d58644720258bcabe9037cfc072e8f1250)
(cherry picked from commit 329ab6e9348c069e804fa3d474ed3a905758716b)
(cherry picked from commit 44996655e9468707e3ac40a0fa3f8c92b0ffefb8)
(cherry picked from commit 2e0e12bb1938b3609d835e74587fcf9c62df36de)
(cherry picked from commit d0e780d6d7c189eead0a3a006e8c708f9ff29092)
(cherry picked from commit de394c7c50eb2efe611f6e619eeeb1f387be7721)
(cherry picked from commit 3c26d0fd87b27e20cac45ea044de1d813be271b0)
(cherry picked from commit 560424a23ae32944376469baffd6364d02811527)
2023-11-13 13:57:31 +01:00
Gusted 94051645ba
[PRIVACY] Disable update_checker cron tasks
- This is being disabled as it will weekly connect to a domain.
- This only affects existing installations, as new installations will
have a explicit value being written into app.ini due to https://github.com/go-gitea/gitea/pull/21655

(cherry picked from commit cd0b8b6852563118ab8530c01a48bc612efcf58a)
(cherry picked from commit 58d43867cab15a4b93fab6f4b467756e8030fb2d)
(cherry picked from commit f290b91e504933be83d5b9540a195173280ab38d)
(cherry picked from commit 5bd6d7555478713c91a3c00980060041ed34ba22)
(cherry picked from commit e5d0abb59244809f5181dfbadfbee47531246a18)
(cherry picked from commit 4b381ce77e699ce9f0f8af8ac3488bd8e3562b15)
(cherry picked from commit b6a9b1390d9ee3aa70d50b1fae1346aff69cab08)
(cherry picked from commit 367436287118b0fc4030ee6527d6c366db919594)
(cherry picked from commit af0f606fc1f42be49dcbedd04055f0f9a0b7d3df)
(cherry picked from commit 49560da6fb01cd6ee1a69840f48ed9269330c37a)
(cherry picked from commit ca06e27c5b7b8b20e34935885c4ab0ca905b9157)
(cherry picked from commit 163df86df5abdda11b6d337af32e0f0f3837119b)
(cherry picked from commit 0391c6ae42eb364a6db1156af93304aa73c69b2d)
(cherry picked from commit f282f2d42fd850c29b489d02133698e14b21f411)
(cherry picked from commit 68d31cf2478626730324eaa56ad4264580b7030c)
(cherry picked from commit cfd4a479e95597f315d9d75e2b7d22c8f6941ce2)
(cherry picked from commit add969bdf624df9eed3047d60a1bae979e9bfd80)
(cherry picked from commit c0f3f1f1e733b6df0f028a1393549adf7f8936f4)
(cherry picked from commit f11dca9090a77dbd58ff980e97cff07a5b2d27b5)
(cherry picked from commit 283810387ff26fbbf1ac795d56350a7bfb87b874)
(cherry picked from commit 08af1f0ea882bbe3fada3e61988baa9f0d290d1a)
(cherry picked from commit 1c1a6da319f9218cc05693e0b8461f3defe1d891)
(cherry picked from commit c1444bae65daa29497209a0bcc0758b1af9828a0)
(cherry picked from commit 6361df634bd8fda81793e35820f0a42c56e5e55a)
(cherry picked from commit cc8bb3f94605858c3ff9412644d90d80150c3f23)
(cherry picked from commit c7ae4411fd041dde1c73a5fdc64679317b6daef7)
(cherry picked from commit f73f4eef02c41430cc6a7375fc3b73aab8b75de7)
(cherry picked from commit 2122896e8529db6b6158bb9029492f8f5e12efb7)
(cherry picked from commit d469c99671cf6a5a8087b1ad106a04b43f4edc85)
(cherry picked from commit 41dbbd731edf52c1c78d34cba1dfd7e03029e5f7)
(cherry picked from commit e8e742b4376ab2437097a94a5f541576f9da3c81)
(cherry picked from commit 0fa9f87b5fbb81b9205650da918bab02c7f86916)
(cherry picked from commit 870645b963faaa38400bfd179e5ca187f1160d65)
(cherry picked from commit 532a5860eb0957afd37f01d3f178d8686b8c09e3)
(cherry picked from commit 275c671d5f57be23798360a5d97da035f9827f5f)
(cherry picked from commit 2cec78e493e0c5969de0846685788640f84a5e27)
(cherry picked from commit 10ab0befd7dc0e94bf1fb4030f86fbf3d59b346f)
(cherry picked from commit a0a0c0adaf0ad4dec87d01b016228fd2bbd2cce0)
(cherry picked from commit 9f0a37e405fa5defa923d0d86dec11eb1764c597)
2023-11-13 13:57:31 +01:00
fluzz cd38789ab2
[FEAT] allow setting the update date on issues and comments
This field adds the possibility to set the update date when modifying
an issue through the API.

A 'NoAutoDate' in-memory field is added in the Issue struct.
If the update_at field is set, NoAutoDate is set to true and the
Issue's UpdatedUnix field is filled.

That information is passed down to the functions that actually updates
the database, which have been modified to not auto update dates if
requested.

A guard is added to the 'EditIssue' API call, to checks that the
udpate_at date is between the issue's creation date and the current
date (to avoid 'malicious' changes). It also limits the new feature
to project's owners and admins.

(cherry picked from commit c524d33402c76bc4cccea2806f289e08a009baae)

Add a SetIssueUpdateDate() function in services/issue.go

That function is used by some API calls to set the NoAutoDate and
UpdatedUnix fields of an Issue if an updated_at date is provided.

(cherry picked from commit f061caa6555e0c9e922ee1e73dd2e4337360e9fe)

Add an updated_at field to the API calls related to Issue's Labels.

The update date is applied to the issue's comment created to inform
about the modification of the issue's labels.

(cherry picked from commit ea36cf80f58f0ab20c565a8f5d063b90fd741f97)

Add an updated_at field to the API call for issue's attachment creation

The update date is applied to the issue's comment created to inform
about the modification of the issue's content, and is set as the
asset creation date.

(cherry picked from commit 96150971ca31b97e97e84d5f5eb95a177cc44e2e)

Checking Issue changes, with and without providing an updated_at date

Those unit tests are added:

- TestAPIEditIssueWithAutoDate
- TestAPIEditIssueWithNoAutoDate

- TestAPIAddIssueLabelsWithAutoDate
- TestAPIAddIssueLabelsWithNoAutoDate

- TestAPICreateIssueAttachmentWithAutoDate
- TestAPICreateIssueAttachmentWithNoAutoDate

(cherry picked from commit 4926a5d7a28581003545256632213bf4136b193d)

Add an updated_at field to the API call for issue's comment creation

The update date is used as the comment creation date, and is applied to
the issue as the update creation date.

(cherry picked from commit 76c8faecdc6cba48ca4fe07d1a916d1f1a4b37b4)

Add an updated_at field to the API call for issue's comment edition

The update date is used as the comment update date, and is applied to
the issue as an update date.

(cherry picked from commit cf787ad7fdb8e6273fdc35d7b5cc164b400207e9)

Add an updated_at field to the API call for comment's attachment creation

The update date is applied to the comment, and is set as the asset
creation date.

(cherry picked from commit 1e4ff424d39db7a4256cd9abf9c58b8d3e1b5c14)

Checking Comment changes, with and without providing an updated_at date

Those unit tests are added:

- TestAPICreateCommentWithAutoDate
- TestAPICreateCommentWithNoAutoDate

- TestAPIEditCommentWithAutoDate
- TestAPIEditCommentWithNoAutoDate

- TestAPICreateCommentAttachmentWithAutoDate
- TestAPICreateCommentAttachmentWithNoAutoDate

(cherry picked from commit da932152f1deb3039a399516a51c8b6757059c91)

Pettier code to set the update time of comments

Now uses sess.AllCols().NoAutoToime().SetExpr("updated_unix", ...)

XORM is smart enough to compose one single SQL UPDATE which all
columns + updated_unix.

(cherry picked from commit 1f6a42808dd739c0c2e49e6b7ae2967f120f43c2)

Issue edition: Keep the max of the milestone and issue update dates.

When editing an issue via the API, an updated_at date can be provided.
If the EditIssue call changes the issue's milestone, the milestone's
update date is to be changed accordingly, but only with a greater
value.

This ensures that a milestone's update date is the max of all issue's
update dates.

(cherry picked from commit 8f22ea182e6b49e933dc6534040160dd739ff18a)

Rewrite the 'AutoDate' tests using subtests

Also add a test to check the permissions to set a date, and a test
to check update dates on milestones.

The tests related to 'AutoDate' are:
- TestAPIEditIssueAutoDate
- TestAPIAddIssueLabelsAutoDate
- TestAPIEditIssueMilestoneAutoDate
- TestAPICreateIssueAttachmentAutoDate
- TestAPICreateCommentAutoDate
- TestAPIEditCommentWithDate
- TestAPICreateCommentAttachmentAutoDate

(cherry picked from commit 961fd13c551b3e50040acb7c914a00ead92de63f)
(cherry picked from commit d52f4eea44692ee773010cb66a69a603663947d5)
(cherry picked from commit 3540ea2a43155ca8cf5ab1a4a246babfb829db16)

Conflicts:
	services/issue/issue.go
	https://codeberg.org/forgejo/forgejo/pulls/1415
(cherry picked from commit 56720ade008c09122d825959171aa5346d645987)

Conflicts:
	routers/api/v1/repo/issue_label.go
	https://codeberg.org/forgejo/forgejo/pulls/1462
(cherry picked from commit 47c78927d6c7e7a50298fa67efad1e73723a0981)
(cherry picked from commit 2030f3b965cde401976821083c3250b404954ecc)
(cherry picked from commit f02aeb76981cd688ceaf6613f142a8a725be1437)
(cherry picked from commit 2e43e49961c1cd5791744fa4e7994ce929c31837)
(cherry picked from commit 3bfb6cc1c085a1ae11885d0eb138d7e977fa1a16)
(cherry picked from commit 38918d5f5cb148b8f53d6707fe6bc677c19c7f79)
(cherry picked from commit 174f6ac3453c7ba1a88655af5d0fff807eb94dc1)
(cherry picked from commit 08a2bed45dc48547c0ab79fe1de2e3c62c823ae2)
2023-11-13 12:33:49 +01:00
Earl Warren de6474c3c7
[TESTS] tests.AddFixtures helper loads additional per-test fixtures
(cherry picked from commit 93a844dd13904c0ba1b7fd4a0a233002194a504b)
(cherry picked from commit 6d6d1a121ce3fc5cf7cd92ad1a38be3bdcbf7088)
(cherry picked from commit 34646f9886bb6b06dc1bd06b44c49c28ddb29aad)
(cherry picked from commit 83801a64cff076618fe14134c90f38b36a60675c)
(cherry picked from commit c9a1e55a80495effb8bd2b45b833943ba19f31d3)
(cherry picked from commit 6c7292419c2cda5cfaef5dde8bdef024dd9841ab)
(cherry picked from commit 5439218f1a3543fe6941a4dfbbe59784940d092c)
2023-11-13 12:33:49 +01:00
Gusted 12ef8a7937
[GITEA] Make confirmation clearer for dangerous actions
- Currently the confirmation for dangerous actions such as transferring
the repository or deleting it only requires the user to ~~copy paste~~
type the repository name.
- This can be problematic when the user has a fork or another repository
with the same name as an organization's repository, and the confirmation
doesn't make clear that it could be deleting the wrong repository. While
it's mentioned in the dialog, it's better to be on the safe side and
also add the owner's name to be an element that has to be typed for
these dangerous actions.
- Added integration tests.

(cherry picked from commit bf679b24dd23c9ed586b9439e293bbd27cc89232)
(cherry picked from commit 1963085dd9d1521b7a4aa8558d409bd1a9f2e1da)
(cherry picked from commit fb94095d1992c3e47f03e0fccc98a90707a5271b)
(cherry picked from commit e1d1e46afee6891becdb6ccd027fc66843b56db9)
(cherry picked from commit 64e38b3363b77271a3155acfafc7c8f4753c441e)
(cherry picked from commit 0c2a78fa4803d91377d639e6f31a5d2f593b0778)
(cherry picked from commit e8aa66f1dd5067c563a8da9fc0322101b87436d2)
(cherry picked from commit 55b5aa023939c95aa69f6da9b5e3dddf7e27f822)
(cherry picked from commit a448744b7bf7c663c148b315b5ac2485da466624)
2023-11-13 12:33:49 +01:00
Gusted 605f3a21a4
[META] Add CODEOWNERS files
- As per https://codeberg.org/forgejo/discussions/issues/53#issuecomment-1070207
- Using the `CODEOWNERS` feature it should speed up the development
process for contributors as for the most common PRs the right reviewers
will be added by Forgejo automatically. They can be added very
precisely according to the changed files of the PR.
- This feature is implemented in v1.21, which means it's not available
on Codeberg.

(cherry picked from commit 1511ef1c803f31fcf2887611982a114465f3be60)
(cherry picked from commit 99999e3a034b719dcefc63951538d917dfd9e496)
(cherry picked from commit 0b0dd6f7a95ce718c8ff73e8e6fe1b660a4e3277)
(cherry picked from commit d42940034f7fe1f1f706e4fff8f9b5c8465003fc)
(cherry picked from commit 5be6e7d2542e6915d1df3d9f29a8504f851b8f52)
(cherry picked from commit bf5b3994217b1de4470f7bd6201543e9fc688675)
(cherry picked from commit 52c9f9fd8af54ed95361e3ee79fd8001a5461135)
(cherry picked from commit 7e03d2829ba683e0b865773c7fbb2a1f78f0cfdb)
(cherry picked from commit 77d199910b0b0ce74d9a943ddc21eb948b2f8eff)
(cherry picked from commit debf9b1ec9c8246de9fd860898d7b5a177475224)
2023-11-13 12:33:49 +01:00
Caesar Schinas debf2f3ae3
[WORKFLOW] yaml issue templates
(cherry picked from commit 28c0f327cf1f67a53899f8590e9b85aacd485c39)
(cherry picked from commit 1b532f16c79c52b1e03fdf1dd73723542cb70d78)
(cherry picked from commit 6e35d3ffb1a28b5622194866554d3821a4c82b09)
(cherry picked from commit 3e6ba3b3b7d4552f308db08a202ab568a7ece719)
(cherry picked from commit d47d8dd9662a4a1e84de22ba90b41da216b13dbf)
(cherry picked from commit 2716166cd4d96d870275ba04ad5811b79dca4272)
(cherry picked from commit 50c67cb9062f51df8628327234cb3474f50dd93b)
(cherry picked from commit ba0049afc1da6d766b0a37a3a8ca1175e2d98eb4)
(cherry picked from commit 80e010e813b2c268d09a25b928230adda3149736)
(cherry picked from commit 4266fe41a231c9347636e543bde68af20ddf3781)
(cherry picked from commit efe94735464d5489579915ffd0a05de76f8ec103)
(cherry picked from commit 3d79d2ee47aff623642ebb2b9a0ca67a25467b43)
(cherry picked from commit b56ad0325a085f3844cf86c04f72c63411642c92)
2023-11-13 12:33:49 +01:00
cassiozareck 5ef52a873e
[FEAT] add Forgero Git Service
Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
(cherry picked from commit a878adfe628cf6dc367a17c3715fcd3499aa02b6)

Adding description and Forgejo SVG

(cherry picked from commit 13738c03804d019f28550e46a4ebc37dbe3a5cfc)

Undo reordering and tmpl redirection

(cherry picked from commit 9ae51c46f42acecac834371857e638098ebf6d27)
(cherry picked from commit 70fffdc61d06dd1d70b6a31496676a23d3d0c2fc)
(cherry picked from commit c0ebfa9da3db3e60d7b403a1bf8b8a19c32c5dc7)
(cherry picked from commit 9922c92787eccaba0021486ba0a3eb28583969e1)
(cherry picked from commit 00c0effbc74aedc7a4167a69c8a410ef324d576b)
(cherry picked from commit e4c9525b137205fa9ffdb4e0d7492bbbda9be6b5)
(cherry picked from commit 09d7b83211652d045975b0e3bb790856267d52a5)
(cherry picked from commit bbcd5975c91f6932f7f2ee07fbd63e84560ba96a)
(cherry picked from commit 55c70a0e18d33d8ac0da9ffb97f6d994ed88a319)
(cherry picked from commit 0a55a2f38268ec47185ab60ba629d7267aeb9f4e)
(cherry picked from commit ae6b468516a24b214a29ae1e54d016fcf28b0277)
(cherry picked from commit 76adcdff4345a28003875f22a645299b3701a454)
(cherry picked from commit 2934f1c7d6fe7e891a45949726010f441da1fc0d)
(cherry picked from commit 59871154e92893a60835c5516e1a04640a8bb13c)
2023-11-13 12:33:49 +01:00
Earl Warren d2e1734394
[UPGRADE] add sanity check for v1.20.5-0
See https://forgejo.org/2023-10-release-v1-20-5-0/

(cherry picked from commit 7d619f79a0ebebf0de49be6175701769db04f7c2)
(cherry picked from commit ce5c75e1532894c180c66c38f828fd647c3b8174)
(cherry picked from commit 252c81f2bc16a3409c144fd5061c9c249af9be8d)
(cherry picked from commit 552920251decd5a785076df22cb83b3317f8f437)
(cherry picked from commit 15f1c851f0b83088e7c9ec815ee991a81ded94e9)
(cherry picked from commit 9e542dcb302d5696b9fe2ea5889f641fd095c574)
(cherry picked from commit 843f08fefd85ed62231db7aac8be4e1334ba3a41)
2023-11-13 12:33:49 +01:00
Earl Warren 65e37b9940
[TESTS] upgrade tests for storage
(cherry picked from commit 884ca63738cc2e2c7cde31c649e9fa77cd590044)
(cherry picked from commit 0a45d9c37b187249d347020ca79e71c523177d61)

[TESTS] upgrade tests for storage (squash) relative paths

(cherry picked from commit 3bb19285f365ae0b56dedc183db04504946a2a50)
(cherry picked from commit c640c09e6110a8c684dfcc8f9fc05495f30c16f1)
(cherry picked from commit 40ffe2d226f1ea1e78ae40eb0deeccc0838b5d48)

[UPGRADE] S3 storage and fixtures

(cherry picked from commit c466c9c6571b18b1426e07439e7aa6445f5d86dd)
(cherry picked from commit e80abbe2cd7968c5c5601bf5e39de9b265e40ca4)
(cherry picked from commit 50a47df1d17df60cda6504165d5b02ac42e63c86)

[UPGRADE]  add sanity checks for [storage*] (squash) speedup upgrade tests

(cherry picked from commit f578279cfe85d4e23b83d3759ec782790fed869d)
(cherry picked from commit 6dd677f151d3ba3b6f016d788585372958608cd6)
(cherry picked from commit ee7e7eca27a2e123188cdf05fb493f51c8c8a3e4)
(cherry picked from commit 879ffca697e6cd04d364ad46a6d4a2d957ba3eb3)
(cherry picked from commit 60b33cc5af4f8ad4e2f27034a7cff98959f44128)
(cherry picked from commit 3ba984b24269cfb18a72119f148686fb77271f4a)
(cherry picked from commit fceff4ca7b7226c076f2878d4e8a49851143e6ff)
(cherry picked from commit e0d732a4e8c90a78993031d390b37f54a3fa8006)
(cherry picked from commit aee13d282c54e2d482cd392641449662b1260a09)
(cherry picked from commit f9a031ab1661aed7f29a0490b8823f07d3fef636)
2023-11-13 12:33:49 +01:00
Earl Warren 18fd949916
[UPGRADE] add sanity checks for [storage*]
Refs: https://forgejo.org/2023-08-release-v1-20-3-0/
(cherry picked from commit a266dd0ce3fca1296c6713ff1266f0065f0cd72b)
(cherry picked from commit b9eb5eccd83e73ab6fb392557b7036063244f357)
(cherry picked from commit 7fc2028ede6e3a576c3714b27940de9f871c33bd)
(cherry picked from commit 0c988e612028eab277f03c16c0597da08c2c293a)
(cherry picked from commit 7ba05e8c2b51c4c08ab3885f9014f7bdaf3d0f6b)
(cherry picked from commit 2ed5068abe0cb57a257167d669faee207762b1d0)
(cherry picked from commit 353913a26dd749f017cf8b76cf9218f68e8ca408)
(cherry picked from commit 4e63a01a8bf9d0c8a1a6a6d7a3b18c64369bbaf1)
(cherry picked from commit 99f612aed30852b23fe325bd5b6095aee9bd558e)
(cherry picked from commit b4fe189caea9c656edd9c0c20e0d667911e4921c)
(cherry picked from commit 520295a6f5da05b0fbe5af4ed704116803b475a8)
(cherry picked from commit e5a564044b9523f154e1e6f078385eabc270fe3f)
(cherry picked from commit 52cc6c26fc3b6ed6e2a0fcc15685644e7d5316d6)
(cherry picked from commit d58f04bd1d3f6af67e6ab21a8058be04cd821366)
(cherry picked from commit 1b7213a98baf08fb9f0f95177f42abe16717c871)
2023-11-13 12:33:49 +01:00
Earl Warren 2ea0db1a07
[UPGRADE] run sanity checks before the database is upgraded
(cherry picked from commit 69741e4e66932a9ac092089e7ba27399c55dcd1a)
(cherry picked from commit 2a3c7b09cbdfd62cca2619aaf37b6913a373d142)
(cherry picked from commit a1554c1168d897e8db4024d716a837c012bf74e9)
(cherry picked from commit edae2c6d2dda7f44e40ae88fba60a15f61b72232)
(cherry picked from commit 49737cf009a6a0fc119cf8a1a1593493c77c841a)
(cherry picked from commit ec53704c34a3e9491b4f210250d5e053f4b221e5)
(cherry picked from commit 7a1c5c0f323cb5e9235d8fa6e59a0a1b172d3abb)
(cherry picked from commit e658c20c0f21b42f741c0149e0e79ea0bb3b949c)
(cherry picked from commit baf575468f39c5dd0c2ff3498ef9f706d12d114e)
(cherry picked from commit 40cb14eff427c801243e374f7c60fef994bcb792)
(cherry picked from commit bfee7eae52ac4ea6a8cbb3d40c03960e1d331705)
(cherry picked from commit e94541cbf38c89dcf4ec174934c77c385bcf8e89)
(cherry picked from commit dfe672ef4c80f9a09532c07c5af6357b5d470280)
(cherry picked from commit 62fb4986018c773f682a4b921956636ac1f3c494)
(cherry picked from commit 24e17896435c440ba6c38cbcce4bb24104920fbe)
2023-11-13 12:33:49 +01:00
Earl Warren 99ad61c41a
[GITEA] add GetFile to config provider
(cherry picked from commit 88d1b53eeaa0d5ad0ed54c191236db928aadedf0)
(cherry picked from commit f63f71afad2aa8272772dba919485c5e858d2fae)
(cherry picked from commit 1f774145fc731e2d93cf8a6708dbf4c15722fa5e)
(cherry picked from commit 53e637693bcbb9fe9daca9a296c9d2c700fc915b)
(cherry picked from commit 4974cbf10a8b51d51591fa6f6281f4cd7a415c91)
(cherry picked from commit 554bca7fae7fa6f0235ab631598115875711d80e)
(cherry picked from commit 61b8cf83b988a2d8547b81cfb7aaeefaf2e17fba)
(cherry picked from commit d8bcc6f68c6dc972e8c99eb7b46a4f096f85cd61)
(cherry picked from commit ee04c340724cccada2c71db45ec510d19e92e099)
(cherry picked from commit 713153a6d63205984f2a85ee07f08269df3b0a85)
(cherry picked from commit 1d51dfa5107b82a7fac43d39deb39e24a85a895e)
(cherry picked from commit ee7ae29abb8380a30c1f467943bb6f6411d6c793)
(cherry picked from commit b20ebd82542113dea064767e5c439ac2ba34d099)
(cherry picked from commit 2e45c9fdc50584f9541384e7f5f4f81f76029f40)
(cherry picked from commit 0418f7cebd6ba6db03dc37a5c18cdc3b580a8917)
2023-11-13 12:33:48 +01:00
Earl Warren 420c57c606
[TESTS] verify facts for the admin storage documentation
(cherry picked from commit 57e597bf7e1e3bb3b7bcbcea66a4ea170a231f85)
(cherry picked from commit 643a2b0e81570e935779f6c509ebe4633fad74b9)
(cherry picked from commit f10faffb4febeef114d5be4e6abe57bd3cd72894)
(cherry picked from commit b440c5767eebdf406200e9a47446827778514425)

[TESTS] verify facts for the admin storage documentation (squash)

(cherry picked from commit d83d8ce57b8b39b4da849f5403198ecf706117ba)
(cherry picked from commit d8855ef27cd1b219184e95ce055bc6d84350ee26)
(cherry picked from commit 11230466ec0c1c4db1296cdd2ead74fc91a34491)
(cherry picked from commit b2cdd9d971b694fe32bab11f9ccdb41a38d7c6fe)
(cherry picked from commit a0a5e785241ac2c3a7493aa62637351021d48a39)
(cherry picked from commit 846413110fb936c386ba7fa80ff67e4394231464)
(cherry picked from commit 72b92d5a7854f5afbd949e0c6e53f3a4f5b72055)
(cherry picked from commit d51f29b1ba0f01caef966a200ff2946c1b25dd0f)
(cherry picked from commit 58b7ece62a1bc233f73f290782c2e2e7fac732d2)
(cherry picked from commit 751cf469a649b06287c849832b31e46cea3642f1)
(cherry picked from commit 7b2fd5fd17c576a349db659992508f59d686709d)
(cherry picked from commit 6fd7ef78c733ef5e114dff7c8e4d0ead0152596a)
2023-11-13 12:33:48 +01:00
Earl Warren a411a377b0
[SEMVER] store SemVer in ForgejoSemVer after a database upgrade
(cherry picked from commit b7fe7cf401f4bddd6455efc651f7ac054f3fe1cf)
(cherry picked from commit cf339eed4f4851b18448dbdd83df32d00bc6f45b)
(cherry picked from commit 4f3a16168bbeced519a60c32e10e2895d9367238)
(cherry picked from commit 6f5bbc53fcebd614f5ee8627c7d6e3c637ffa694)
(cherry picked from commit aca42b422e76668387769c15868ef77b073bb7db)
(cherry picked from commit 5a7f7580e525694d1f27e12329c8532bd29273f8)
(cherry picked from commit 06c383c807ad49e1e35b429a10c6a11c65aeebe5)
(cherry picked from commit fe831dcb53b81b6cc632be751bfcbfb9bc00efd3)
(cherry picked from commit cd12cd0dbce47c6117ea579ae5019c182155b3a9)
(cherry picked from commit cc79163703ce31706c86b88c38fb8a20ed745e20)
(cherry picked from commit f3ad9d345f7506dbe369567971af73d6c0288e32)
(cherry picked from commit 1a01baaa0f8d8108c64c68263c7c12485af4d296)
(cherry picked from commit 21123afcfd568883774b5e932b20885da28926de)
(cherry picked from commit fdfbda0f9b4ecfa565d9d8cacb718514c99c5d18)
(cherry picked from commit 19eb6b57746990e28b710fcad199dd08b98fe0d4)
2023-11-13 12:33:48 +01:00
Gusted ca778777f5
[DB] forgejo migration v1: add blocked user migration
(cherry picked from commit 66afddd511d2821f648919925ea365cd085e4e77)
(cherry picked from commit 19da0dee9df87cb946d1c8e25b917f7283d95302)
(cherry picked from commit 0b725af693828bd7705b09433fb25d974fbb820e)
(cherry picked from commit 64d4de2b664a9f406b2927c6e6b465ee2b3a8915)
(cherry picked from commit 05bc9d3b7f8d00a37b41615f9caccca84a98c0ee)
(cherry picked from commit 5958553066d275c767018454fbed9470c2cf473d)
(cherry picked from commit c4f77e26c913eb3293bc702e1c65e2d09757cfe1)
(cherry picked from commit 3034832c6637965bf70c766d9169ca3c28c27cd3)
(cherry picked from commit d48931ec5b677989f8b2ef91752b2e3ef25ff2a2)
(cherry picked from commit de3a74e57648c24131d1e3ff83adfb5168e8a686)
(cherry picked from commit 0f6601a37f2cdba41c80b115b9055dbfe62ff862)
(cherry picked from commit ec8bec4fc973f65a3e3250c2cb677ea8257d24d2)
(cherry picked from commit 884560286e902dded3e1cf52322019a0ffd286a1)
(cherry picked from commit 252385151c6ef6693405c7761e25067a8499b1a0)
2023-11-13 12:33:48 +01:00
Earl Warren 631bafc991
[DB] forgejo migration v2: create the forgejo_sem_ver table
(cherry picked from commit 86b26436af85e0eedb732e115e8be024e1d54ca6)
(cherry picked from commit 479cba59aca2b3b73a83e5acc0b754906230f0b2)
(cherry picked from commit 4765f9a889ce7324416b51e7d4524b2368459752)
(cherry picked from commit af771410bfaa511bbc97cbfeefbb279b3836158d)
(cherry picked from commit d1ea9305d8d653d637cbde6d383c095bdc4991f0)
(cherry picked from commit f77e1bb7abd6054851b811fc0d71bf0130085353)
(cherry picked from commit 0b95f8fe899ce14e19e5aeccd3e53e21b8bf8fc1)
(cherry picked from commit 4f8fb2390a415d2f9319c9f23ff653c31efd2409)
(cherry picked from commit 8ea0e22ff6e09f1e46d9a10f1325f7c6997c018b)
(cherry picked from commit 43ac19ac59044210906c96857194231ca7804c92)
(cherry picked from commit 0f51ac12b6e7fcfd24dd9a2a7a14ecfe4869c785)
(cherry picked from commit 35d0875c5e07644c8e49c5aecb308ae67eaa1784)
(cherry picked from commit c30006f45769efecb5d0f605e6c7699f3b1b40b9)
(cherry picked from commit 8696631f5b49b2950fb5d2934a875c569acb9e8e)
(cherry picked from commit e19c79e2daff4c3a651510441b059dfeb3c09012)
2023-11-13 12:33:48 +01:00
Earl Warren cd26537a1f
[DB] run all Forgejo migrations in integration tests
The tests at tests/integration/migration-test/migration_test.go will
not run any Forgejo migration when using the gitea-*.sql.gz files
because they do not contain a ForgejoVersion row which is interpreted
as a new Forgejo installation for which there is no need for migration.

Create a situation by which the ForgejoVersion table exists and has a
version of 0 in tests/integration/migration-test/forgejo-v1.19.0.*.sql.gz
thus ensuring all Forgejo migrations are run.

The forgejo*.sql.gz files do not have any Gitea related records, which
will be interpreted by the Gitea migrations as a new installation that
does not need any migration. As a consequence the migration tests run
when using forgejo-v1.19.0.*.sql.gz are exclusively about Forgejo
migrations.

(cherry picked from commit ec8003859c920ac05a071ad9b1d9d8af5a694ac0)
(cherry picked from commit 697570ff390656930d41bcdc4194aacc5c7a54f4)
(cherry picked from commit f041aec17265ca34943f961d9640e60c96c0f24d)
(cherry picked from commit 60463e3bab9dfa6aae7f379fc77309ab52b1d250)
(cherry picked from commit b2fc2a7c1338ad2a9bd0a6887443e604dccda53f)
(cherry picked from commit fb2759b6afc213d5e2db8f6e523391927c611b23)
(cherry picked from commit 37cfc3b2275afd523f53e149781d69a2914fd83b)
(cherry picked from commit 832607500a576a40ee1e35897e58ef319dba9788)
(cherry picked from commit 143d4007b1b60ad1880b64ce1d4998e77854a05a)
(cherry picked from commit a17e803fbfb7908729c2d92fd58360806cce6fbe)
(cherry picked from commit 5c1cc8d9f6c9974e399d3b7da6dc901374f70583)
(cherry picked from commit 8bfc117458f046d28c6978de17ff407fe4cc43c4)
(cherry picked from commit f6f91a4487a1c06c105251d5b600d1920bfac0ad)
(cherry picked from commit 5123723bccbdcfede68719c212073fe02ec2499b)
(cherry picked from commit e5e7b5dc33b7b390bd05743c05e7acdcad1a9413)
2023-11-13 12:33:48 +01:00
Gusted ee503eb295
[DB] Forgejo database migrations
- Implements https://codeberg.org/forgejo/discussions/issues/32#issuecomment-918737
- Allows to add Forgejo-specific migrations that don't interfere with Gitea's migration logic. Please do note that we cannot liberally add migrations for Gitea tables, as they might do their own migrations in a future version on that table, and that could undo our migrations. Luckily,  we don't have a scenario where that's needed and thus not taken into account.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/795
(cherry picked from commit 8ee32978c0af1f8f71679c87f695df2b90b617c8)
(cherry picked from commit c240b34f595a7a9763f7b748052ac98f9f18954d)
(cherry picked from commit 03936c649243a0a29701393d58e63e33064c7461)
(cherry picked from commit a20ed852f8b6d28872c05d688bffe5c6976bfa03)
(cherry picked from commit 1dfa82676f1feb745633618fde2d362bf19c4f28)
(cherry picked from commit c39ae0bf8abced8fd5dc32589e68515ac308b69b)
(cherry picked from commit cfaff08996c9f42592c95a63fe907b45b8a9317a)
(cherry picked from commit 94a458835a2b0336b26c1c9df64fdfe2de47f496)
(cherry picked from commit 61a3cf77dfe3f612ff110eb19f94dcb08051daf1)
(cherry picked from commit abb350fde879cc495761dc4616b7aa0fc5d94d54)
(cherry picked from commit 5194829d6b4ed702cf50ff875da57d04d77c8a18)
(cherry picked from commit 89239a60f23cad7dad03add744e23a4f3b10d6a4)
(cherry picked from commit 683cfd86efc5fa8cc04973ce3115351515a20917)
(cherry picked from commit f4546cfed92844e3666b80130eadabb9348b88ae)
(cherry picked from commit 86614d5826392b3fbe68355baeab9a0a761883a5)
(cherry picked from commit e4b9c32187a039a83686a82856a9a192919c6e82)
(cherry picked from commit 8c253719afa9b82f169757df007587d38560c06d)
(cherry picked from commit 857365d6c15b5471d63662b1d89d1523151c4f79)
(cherry picked from commit a488b3952f58bbf28bfa101a24e52dad7c9662eb)
(cherry picked from commit 98313c49109c941426beecc1a3e7887f28b99970)
(cherry picked from commit 72e47c3137280dc2b3c19a4edf8497877b79f216)
(cherry picked from commit 22c304d9644cc00b8744323f31649ff2fc413d59)
(cherry picked from commit ecf009b6f1b8dd45492f0772160a64ea907df96b)
(cherry picked from commit 2228b3638993e287b44456c6ade77e613440a6cd)
(cherry picked from commit ddd702fc93888363d1b50f5e16d213f0e10ca241)
2023-11-13 12:33:48 +01:00
Panagiotis "Ivory" Vasilopoulos 5d1d53d33c
[FEAT] Use OpenStreetMap in USER_LOCATION_MAP_URL by default
Follow-up to d58c542579 for Forgejo.

By default, Gitea does not select any map service that can be used
to introduce a 'Show this place on a map' button in the location
field of a user profile. Before I tried upstreaming this change to
Gitea, this was the case in Forgejo. This patch essentially recovers
this functionality, which is nice for public-facing instances and
communities.

Links to original PRs:
- https://codeberg.org/forgejo/forgejo/pulls/1076
- https://github.com/go-gitea/gitea/pull/26214

(cherry picked from commit bb187d5f617f8efceb41810d6ff9adcaa60450bb)
(cherry picked from commit ce02ef9078a8731921caa4f7b0c1b0ac3b59a784)
(cherry picked from commit 6b75c40e2575e23810880ee8e368dc1781e2b4e4)
(cherry picked from commit 6bc8e9f5737f5721ddcd1ef5926a778a7f66a4a3)
(cherry picked from commit 063f8afdf7c2cca014c60dcc3d78d270fd236f8f)
(cherry picked from commit c5cc736b72e1ba980519e9258686f41e4eb78b42)
(cherry picked from commit 7b1bb4bedc6196fb6e8516d9a34092b16d7fab05)
(cherry picked from commit 2a022dceb4b391e2fc25b077193ae22a71380eee)
(cherry picked from commit a946c142d2448cb92daaea11851cf7f00921f062)
(cherry picked from commit 8a4ea0c7ab8960f41a67442fa2f485fe0a901a96)
(cherry picked from commit 37bfb05b34e61194afe407acac5778258315b756)
(cherry picked from commit 28fdcd95a5b6266af4e92f20a79b835b6b31417f)
(cherry picked from commit 65743be85df740f6b9275e36a25e216b82dc89e1)
(cherry picked from commit a3d81d07288eeb0f65afd99e14b76af47977ca87)
(cherry picked from commit 4068219ac6eae39be08c1434dd3856a80ccda186)
(cherry picked from commit b156f5786098c75645b582c6db28e37b4610c628)
2023-11-13 12:33:48 +01:00
Gusted 313132c2c5
[META] Use correct language for .tmpl
- Upstream chosen `Handlebars` as language for the templates, presumenly
because Github doesn't have an syntax highlighter for Go.
- Forgejo does have syntax highlighting support for Go templates, so use that.

(cherry picked from commit a79718522dc432e32cf322498ddf22ec570fa8fd)
(cherry picked from commit 380d847e5cdb179292c7bd1a5e3e6839fb8b31dd)
(cherry picked from commit 4126a9672d93fc33b72fb816a404056aac64dfc8)
(cherry picked from commit afde0ed82271df540348953a811a8e9db1a83343)
(cherry picked from commit 6ddaca00615340958e1aecca2c4807e39a2b1eff)
(cherry picked from commit 454b2f6b35c018cc631dd8847ae9d3243d9adc37)
(cherry picked from commit 58c10e1f93da8d8f193936eff00ebd86ecd8b78c)
(cherry picked from commit 19ec0a5536204105be78744b436a35710d8e8702)
(cherry picked from commit c3717ae4deb8acb43f861675dc44f689def544ed)
(cherry picked from commit 6c74bbe5757b290c2fe5ea13cd980a2b11fb207e)
(cherry picked from commit 9cb48db780c3592a6aa1df2770a309729eca35f6)
(cherry picked from commit 91ce9dccd39292a1d8ed45fd51390f38b1d599a5)
(cherry picked from commit 6d6971b6d6d041b4b5569383168db8cf3a306d84)
(cherry picked from commit cd66dd3ca464ebf845fd6ff92dc764440e1da26c)
(cherry picked from commit 3cd8e15d9be554c578eaa40cf4d5c9e88784b32f)
(cherry picked from commit 07918592c464cfb2944d363a7c03d1fb599af303)
2023-11-13 12:33:48 +01:00
Earl Warren 85340c074f
[SEMVER] 6.0.0+0-gitea-1.21.0
(cherry picked from commit 4107d99f25a9eee1eab2b52cdd579c69523366da)
(cherry picked from commit 7e097b945c0dab444485c68d4a583b9dcef6952c)
(cherry picked from commit 431edaac36e263c4b99cdab076bc402ed1ee4819)
(cherry picked from commit 51ecd89e31f8e4b1fa50422f26e5c01a1961b9a3)
(cherry picked from commit 734d7f5bc7326479d5389a71c2f1bbcc1c03c41a)
(cherry picked from commit f34e88d00cc1077cef3611f8c49406851bdd6d7e)
(cherry picked from commit cd882a75f95bc0612b5f429efd066922db3def73)
(cherry picked from commit 7dfa28db3f8c1d61ecd22e5b52b479c62a6d1ae5)
(cherry picked from commit 4bdaeeb68679e30e1f578fcee418f0c2fb7445f8)
(cherry picked from commit a0e8285914e99312fa6eab657e91e70d05e766f7)
(cherry picked from commit 72991a99f3010b59981133013983b7424605aec4)
(cherry picked from commit c99949bbf7768b6572e414e42ba40c0a110cf82e)
(cherry picked from commit d4dd7df8e7cadd0c3ac7214c0bb1245b4cb965dd)
(cherry picked from commit c0b69434e03221935c99452cb5db58346a939839)
(cherry picked from commit 049f2f083d86f363a987158addab24e9a232b86e)
(cherry picked from commit dd55ad9106b4017f0bd9c3a8c0cead73ada91dc1)
(cherry picked from commit e1d5e9c58f5617cb808189afa0c29f38087e58aa)
(cherry picked from commit a88cfec09dc7464791048f1d92310adb27ad9a3b)
2023-11-13 12:33:48 +01:00
Earl Warren 033729e91f
[TESTS] increase test-sqlite log level to Trace
It does not pollute the output because they go to sqlite-log/gitea.log
and it may provide clues for debugging. When trying to figure out a
problem in production, Debug is likely to be used but in a development
environment a very fine grain log is the most useful. If that's really
too much noise, the lines can be trimmed by removing all those with [T].

(cherry picked from commit 666b02eb9d6e50b3a8d3ec5659fa6fb8451d0d9f)
(cherry picked from commit b69e4d30581258d82d9b2a4daf932f75d7d7171e)
(cherry picked from commit 0c1aecd7ec0d3bf9801c02ae24c89dd5ce074255)
(cherry picked from commit 0304e41345e8ab19537d3686b5487c8cb4b280c2)
(cherry picked from commit 4bcc7e02ce496bea54de39d1059cf39617d2a8d9)
(cherry picked from commit 98364235f2792ce058984c03dde2f609adfbfc88)
(cherry picked from commit ca465e97c1b5d1db684cf9fa1ecbaa14f4bb077c)
(cherry picked from commit 653045ade1e2423ce363ffd2682c1f5cadf8059f)
(cherry picked from commit 9ca2e644ab28c867a92925a6eb83ecbb6805434f)
(cherry picked from commit 47c8a05b37d17201b24bab2d211d672e1fd6c2e0)
(cherry picked from commit 4235d929ed1cb03e96c4f117a33b3120372235e0)
(cherry picked from commit 10541c4b1c61ce6dc8c56481c0999e6ed52dbc80)
(cherry picked from commit c1a0e1eb2f7673de83a57295531675c1ffbcdc8e)
(cherry picked from commit ba5d0193dad6466238afa891166ace513b0c942f)
(cherry picked from commit 58d0e2e138df9cbae514c6bf8d8b9fe0e44d2e93)
(cherry picked from commit d411ab911b31d5e90942ee78658c23d062f160e0)
(cherry picked from commit 454b5d92805153eae89ce8a9b1bd059bce0d05f5)
(cherry picked from commit 2d6ae517450cdfc9c54044fb76f20d9d42380548)
2023-11-13 12:33:48 +01:00
Earl Warren 59a684f038
[TESTS] coverage for SignInOAuthCallback
(cherry picked from commit f8e1619b993943eafb8ee12bf06f4cdb5862de70)
(cherry picked from commit 46d8bc9bdf68b53767211dc103e6130f55bcdb64)
(cherry picked from commit e0c7b7055f5f4eeca84f1d0b1260b7b9622d3aab)
(cherry picked from commit faab747f8e7eb09262f755445462a77f8a6fb953)
(cherry picked from commit 46acb6a9a79e7ce588b2863aa37bf26805afb2b1)
(cherry picked from commit 22d964e74407c52ffcd3d3a84b0a66e2c186b0fa)
(cherry picked from commit 4c8a6031acf760c2383d9e103c703ee5ececb8e8)
(cherry picked from commit 032e8c7a9a357a13f41410063c2f7fb925dba5ac)
(cherry picked from commit 7a17a3b0fb979e2923019de4b9a7318f578b73b8)
(cherry picked from commit 8ea71c2a31ea7492f5f2e3de529c7fd0b232d3e3)
(cherry picked from commit 4b027e2d37cb91c5951f1d10a018778b19590eb0)
(cherry picked from commit d787089a5de09fa11f8e82a66ec43e4abdde1b2e)
(cherry picked from commit 7b9999357a5d34861b5fd7390cc400f497896246)
(cherry picked from commit 80eb531c380914c66d30a29159b81154e7adefeb)
(cherry picked from commit 373b198bfbc29855c409294ee487639f83516a55)
(cherry picked from commit bda02f9e47bdc44be389e8e423d00badde41a74e)
(cherry picked from commit 160b29a137751224c3f3349809a3d3cbcc0932db)
(cherry picked from commit fd5555f18cd9ef1ce406a3a786bc54970aafe761)
(cherry picked from commit 5153cfa639b673608065621515c7bf28d1df4dad)
(cherry picked from commit 31f2a4d61f9dc0f4afedf986a55f2c653257a3b8)
2023-11-13 12:33:48 +01:00
Earl Warren 172fdd0d32
[TESTS] oauth2: make it possible to use an alternate http.Client
(cherry picked from commit aea4ab25a93642b9032544e82299ef652162a092)
(cherry picked from commit d386b212c48d0b1c8b50f947f11f08a0ad8c6d63)
(cherry picked from commit c4935f08adc2830747905fdd051c551a7e3a0434)
(cherry picked from commit dc6ca7cd25d82039a89c6b0d34cb1cfe80d186e9)
(cherry picked from commit 25296d5a3cc48b8a6b3517a8e085f30208f681c8)
(cherry picked from commit 3d54c64c5f7793e70201ed8b1d636aff2160682e)
(cherry picked from commit 6ece0b9d0144b85ef3e3c5814e56f3d87cacf4cc)
(cherry picked from commit 3b39962033fe87494f2318e4db89dd47182ccaef)
(cherry picked from commit 5e2167cd03efc7af5782abb4fcfa009345a550e3)
(cherry picked from commit e676d7b265d0784241c498645dcd7b6127071024)
(cherry picked from commit 9cd258e8658af36f7149249e81a8923284c4802f)
(cherry picked from commit 0a8d58c1592d0677819977bba4f08cad6a178865)
(cherry picked from commit b66d06823a5634ab355e95c6171749c9bac93878)
(cherry picked from commit 4fbe2a0047c2b78b5a329664f6c9442576d65bbf)
(cherry picked from commit a225e0c9b419ed32f35699630af0d7b97e6a3395)
(cherry picked from commit 3cb2cf907ad34045d3b12503c5650127aee4f7d1)
(cherry picked from commit 8e8b2335ccfccc2b43ecf3e8114c189882430d9f)
(cherry picked from commit 02b71042b3d7206d00a227d6c2121c17970c18f5)
(cherry picked from commit 5ec9137eff2f192929c13115cce63110906dd863)
(cherry picked from commit c23c843abf94081c5fac5d3dac2d0e65ad83f292)
2023-11-13 12:33:48 +01:00
Earl Warren 4517a43e7e
[TESTS] oauth2: add integration test helpers
(cherry picked from commit e11dcc60f291f1b882a993f60f8381fe4561d6d0)

use backticks to avoid backslash

(cherry picked from commit 34212791eef2031ef09ea118a2ee5b98082174dc)
(cherry picked from commit bde9473c69eaf6306457b4218d9704af64cb6cc8)
(cherry picked from commit d4deb43084eec4ce0de786a01acef52921a39b13)
(cherry picked from commit 08e91649b0057258ea5d775447d84093c31ad523)
(cherry picked from commit 2b988e5415b35e608726facb5d23a920334fda1c)

[TESTS] auth LinkAccount test coverage (squash)

(cherry picked from commit a2b2e3066bee46ca15ce66d0deb7ef3e89915248)
(cherry picked from commit 841d1b50731a94b9330b6a623a40f8aa0a6befa8)
(cherry picked from commit 35da630ad884a9ffff5bd873123687af169a6cac)
(cherry picked from commit caf2dc4fa7c6fb45a19edc5a025579d42d8db455)
(cherry picked from commit 6eb81e67ba69aeb9f1290f6717ec6c6a367752c3)
(cherry picked from commit d59757239f4fd6353dafd88f2460145b88ef38a1)
(cherry picked from commit 38a121b6880538f381799fb69666e13abf667502)
(cherry picked from commit 20613874ee04286a5ecb28045ec80af0fd850582)
(cherry picked from commit 6d2705e10858baf5e33df0ced047c544ed826fd3)
(cherry picked from commit f177b728142911fed6709339dd0e686017b610b0)
(cherry picked from commit 75e1fc4c8318b378f94065a268b079ac152657ef)
(cherry picked from commit ba64fa9867b06fb0b390a799ef4c3f39f554bb0b)
(cherry picked from commit 0b8ab0893ec6b6d689534b5e4ac50cdfe36c34e9)
(cherry picked from commit 1419d11435b0cdf7c41cb7175dffaf521ecfacd7)
(cherry picked from commit 38766847e0441f4b3841b05b34e3442f4e23af06)
(cherry picked from commit e75177b48202ad65115422aae3c79d008ab7a01d)
(cherry picked from commit 66ebb38ac5f10bebf4e68142d403272862003f56)
(cherry picked from commit fe6f8f9b6c113749771efd036f1ad7aef68bc720)
(cherry picked from commit 6c873fcb8a742a6bc72f884e76c8a8e16d15bfdd)
(cherry picked from commit e6c02024845b3edda4b752e251902a0a22285179)
2023-11-13 12:33:48 +01:00
Earl Warren ae92c399f7
[TESTS] createUser via the user model helper for integration tests
(cherry picked from commit c1d14c5fffeb823385b2984cfcdb3e195bfb151d)
(cherry picked from commit e0e8aabc985af153cf1fcb2064c17f68ec37f3a2)
(cherry picked from commit 392a415070af7f4e872c7bb013f259e2dcc8b7b4)
(cherry picked from commit c7cf1307ca227ff9f4935391582c058823419d7b)
(cherry picked from commit 93b13d092b46c261fc3c0f70ecd9d4f45ee84029)

[TESTS] createUser via the user model helper for integration tests (squash)

(cherry picked from commit 6ff23839528db66ae91e88d6b687b63c769f8f43)
(cherry picked from commit de2a6fe8c374965d50bcd6421d44c3a5d312a689)
(cherry picked from commit 398a6ab072e8364db3c5236bf258ec6bb068dc29)
(cherry picked from commit 16abc89780a228fdc288ed2ce44a95daa6368e36)
(cherry picked from commit 312a3ec5d9d50864af9dbfb8672778789b2e11ca)
(cherry picked from commit 85c6d8e29065641ccbaf57fcebe72b93141a14a4)
(cherry picked from commit 79150d30a4d9a91e9e5272f3d46bd0ee836bcab1)
(cherry picked from commit 436137962d3f150d4c28093461c30c9910f2d32d)
(cherry picked from commit e4eb8d471e8e1c8e14a6a3208418bde0b121472c)
(cherry picked from commit a7257052f49a480dd2ccfbef5c0573c9b5b73adb)
(cherry picked from commit d5eba9a6dd93eb21350dc611edff7c9a13cb2552)
(cherry picked from commit d89ef2ffa9a83249b498867a02996a3dcb17aa31)
(cherry picked from commit f1d25aa30762ae97d7994048dd03c656028dedbe)
(cherry picked from commit 60c7c0735376d7987717c0d375fa409ca9b90e8f)
(cherry picked from commit cfeff3afdb80785019f53312369953e2d996de89)
(cherry picked from commit 652084a6350f9d633a53dff495917a1d9e529373)
(cherry picked from commit d264af41a7866612a8d5ef64b2653c2b30a2abfa)
(cherry picked from commit 10a5450736e2c73ef60827a4eee1b290fd95409c)
(cherry picked from commit d26c541f49ad8e4ee1b942080b2af73b31cfd6f4)
(cherry picked from commit 4461de71feb2e7a788ccb4f6cc853fa0b5163c79)
2023-11-13 12:33:48 +01:00
Loïc Dachary 338d819b58
[SECURITY] default to pbkdf2 with 320,000 iterations
(cherry picked from commit 3ea0b287d74b8fc0dad08b2a539105e1aa1c1e67)
(cherry picked from commit db8392a8ac093d4d3760e8bb40c56d8e194d44fb)
(cherry picked from commit bd2a5fa2923c320e01faeaa1fdc1ad823c337027)
(cherry picked from commit 2436acb3d986bad08aa134e450420fc4a08f5d62)
(cherry picked from commit 62f50e1c521c30729781e5cd58882e743bb8b851)
(cherry picked from commit dba18925217254d22f76306c0fe1c046c419268e)
(cherry picked from commit 4b58e3b6d41f9e42fd34469184a3c7d4c5205c86)
(cherry picked from commit 12470568569fec0644319d3d263a82bc7acdc0c3)
(cherry picked from commit afbaea700972ddd4cb788d0b6d5e78de5558756a)
(cherry picked from commit dcd4813d96f8d4e429914f4c8f951bd25b23afca)
(cherry picked from commit b51dc963d1625bd7b9869302ec1ae70bbafb4442)
(cherry picked from commit 611e895efd28026fdc4661893172356e76f6c3d0)
(cherry picked from commit fd492a03f5335c138e143e784657f7012484bd8c)
(cherry picked from commit 2c99991f44a15466339bb82b29d455c66795721b)
(cherry picked from commit 7426c1edb4b904424cded473c94c9739fde83ed0)
(cherry picked from commit 373244f8b2d449e8811e488e3a3732ba9bc79eaa)
(cherry picked from commit 4f6efecdb9d932459dd9f4d7ee393a121a7bbb96)
(cherry picked from commit 61d500808e443ce770b06fa1b87728a7785bd387)
(cherry picked from commit 65f8384b6361c39d48df95227b047a20977482be)
(cherry picked from commit 12ed28e734f79203ad6bf94774008715da6efd21)
(cherry picked from commit ec6cdc9e1a9544f4f2b0ad7256ed2a8b15cf5335)
(cherry picked from commit 08653ba05119906e066455a3e3913e66c179dbf3)
(cherry picked from commit d5847c87cbcf0fd15953fb7aeadd1cece989b6c9)
(cherry picked from commit 640a96e19be0c7faedf5aedfd90c15df8dc8f376)
(cherry picked from commit 46177814a9ee8596b58055b57bea5441a893de7f)
(cherry picked from commit b0098f5a80356757107cc4dd58bf24e2acba6b26)
(cherry picked from commit ce5ddeeca9fa39180a2f9630c82007f8e9410867)
(cherry picked from commit 5736fa1025681244b8eefef9a14b0715fa37d9a1)
(cherry picked from commit c43ca210fcbc2589158df8c2c3036dedb00eaa52)
(cherry picked from commit 7f92906bf3c72649dd2668263761ded71cf5ee91)
(cherry picked from commit f726525d2dba5e481f758624e62eeaa3d38be564)
(cherry picked from commit db86c93b0b7d2c1a7c17fcb6047b3d75873f9bbe)
(cherry picked from commit 6751bd93c3faf4be0f29b52b4c41626a244a2a54)
(cherry picked from commit 9dc354e0bccb9249c27f22c37111fc4b5689b47b)
(cherry picked from commit e50ba1dbfd5d8f92f8c3fb50ede8b8293dca5afd)
(cherry picked from commit 18f79440327bb0b54813d4848f6f66a89a8b821a)
(cherry picked from commit 51db3f3e4d7abeb4d51eaf5a65c3905a254d66aa)
(cherry picked from commit 13d82d966c27f934c0d32b76cc1fd9e9211b0e55)
2023-11-13 12:33:48 +01:00
Earl Warren 8b4da94996
[API] Forgejo API /api/forgejo/v1
(cherry picked from commit 20b56692693e054bb3c04b4ef12b29b0715b4530)
(cherry picked from commit 1574643a6a9634e5b92c033a4bfb69062a86bd05)

Update semantic version according to specification

(cherry picked from commit 22510f41306f9c133a7e99b61f9c38dabfd4b810)

Mise à jour de 'Makefile'

(cherry picked from commit c3d85d8409f1bb18a45659a167cf1ffee057f3b6)
(cherry picked from commit 5ea23098513c068444226af41faf9be9c4c998e6)
(cherry picked from commit ec5217b9d1b94bb04e34ce8c27eecbdc6f3a247a)
(cherry picked from commit 14f08e364b2ad7e3176b45d3ec8da5f5605b4315)
(cherry picked from commit b4465c67b8737aed9fd79a43046aa3795a298e68)

[API] [SEMVER] replace number with version

(cherry picked from commit fba48e64977a75e77c9c6cf8e3f8a679a5e7b733)
(cherry picked from commit 532ec5d8782703b62d7d02312764e50637cd016e)

[API] [SEMVER] [v1.20] less is replaced by css

(cherry picked from commit 01ca3a4f4291cf4c62df42cbd12a00638f3cdc70)
(cherry picked from commit 1d928c3ab2e1fda6082e1400d89ea96d6605ebaa)
(cherry picked from commit a39dc804cd1da86444ed709455857f069475e7db)

Conflicts:
	webpack.config.js
(cherry picked from commit adc68578b3eb41215338125edfca91804706f8a1)
(cherry picked from commit 9b8d98475fd7efcc15bf0d91b0af6ef3aff64508)
(cherry picked from commit 25161039745a63282257eded9616390241af8013)
(cherry picked from commit 18e6287963a0e1863cd08fd514a4e732a1904a68)
(cherry picked from commit e9694e67ab93ad74f7eae3152d88d95e8493e739)
(cherry picked from commit a9763edaf002c8009a2cca4115cb8b926f8cdc85)
(cherry picked from commit e2b550f4fba144f9637a212b56bfe30cac1adb3b)
(cherry picked from commit 2edac36701e8fa1ff67f87dccfa34cfc00ab66de)

[API] Forgejo API /api/forgejo/v1 (squash)

Update semver as v1.20 is entering release candidate mode

(cherry picked from commit 4995098ec3c6eee19a7ad7bc956b71c6e937c04c)
(cherry picked from commit 578ccfdd27d7a280050bdf61d497d07decf98f2f)
(cherry picked from commit 1bf6ac09520490f0a56b9b55d7836c2d8ea5d22c)
(cherry picked from commit 2fe16b2bfed62c0386d0bfe104f7dcc621d1c3be)
(cherry picked from commit 7cd9d027eec5a2b328d06a47f34545943560fe1b)
(cherry picked from commit eaed4be2ae88055a15dcc96564440c301a13ba8e)
(cherry picked from commit cc94f3115f844a0f16064e49e5eb719d33bc4441)
(cherry picked from commit d7a77e35ccfd2d0fc2ba98932296ab7354edd2db)
(cherry picked from commit cd8eb68ab7b3e2eaacf78d370c762f43cc19fd6a)
(cherry picked from commit 68487ac95f742837e7ff38df902834b6173cd9ab)
(cherry picked from commit 616dceb565456d6fac6f58b1c4de43e9d3254090)
(cherry picked from commit 545fe5975b47d2eab348a57b87c6fd4590f33442)
(cherry picked from commit c042cf8eda2dea805138bd64daa7fbe07865ed5a)
(cherry picked from commit ae5e5a7468aa66312055a26841f658574a9b0dd7)
(cherry picked from commit 8034ef5fa2648a127f8c84c572bec02a1ff6bb9f)
(cherry picked from commit aaf0293034468505449d33ab1483ae65b4175754)
(cherry picked from commit daafa8ce58e5e6077da585b13e5190856228a4a3)
(cherry picked from commit 7ca3681d3e2ed5ec1ae44364cba476d642e2b557)
(cherry picked from commit e8ebceafc4c9a229d1963c7a8d64a645fc1e76cd)
(cherry picked from commit 6954d234d37ec6d86bd2c696a35d1842c059b44c)
(cherry picked from commit e3fe904740c6529f468a47218f9516923884c3d2)
(cherry picked from commit 7cedcd99679f88acabeeda000ed944880e4a0d0e)

[API] Move forgejo api file (squash)

- Move the file to accommodate faa28b5a44

(cherry picked from commit 77076b92163ba28129c6dcda5724d42ab3ccd94f)
(cherry picked from commit 1bbfdf308b7eec41c9af71aee8fa324cfce87230)
(cherry picked from commit e90325f6401667aee6383efd66da84c71404e7a3)
(cherry picked from commit 9626abce95f1c0fa8a812118d0eae9d1d27b681c)
(cherry picked from commit 34ae479ae4e44879021c8dc0a750328a3f9a05ec)
2023-11-13 12:33:48 +01:00
Percy Ma 85335a6aa6
[DOCS] LICENSE: add Forgejo Authors
(cherry picked from commit 7c98a4c54e79e85c08d5449df2bfbb203181df88)
(cherry picked from commit 1ec4a8e6cf23691a595259d3d3e66a6b4b3962fa)
(cherry picked from commit 79de60a5d814ff8a0d475a3ce24bfe20c4e56ceb)
(cherry picked from commit e7fbfb34a900fa09f0828a5fa3cc6e93762d355a)
(cherry picked from commit 7f625d25a3497dffbfbf983d6d250dbcaac57c34)
(cherry picked from commit 9341e184276bf613518a7daf6c5b5e3298a0ad50)
(cherry picked from commit a03e449c01605835ca37b90df7eb5e7e2469a8ed)
(cherry picked from commit b4c7140bec360d6c3530756fcfe7d2777889e774)
(cherry picked from commit 685c9d4a874a34fecbdde7a47cece01c7a9bd22d)
(cherry picked from commit 48b3594a7deb99b2fdb7d9f76dc5cbd123a1db2c)
(cherry picked from commit 8eefd84d386744c4649d71ae017041ee4fe4ee2e)
(cherry picked from commit d42f1028eba5cf7d8ebac12e5858ea669143c76a)
(cherry picked from commit 3bb7f7ed51bff4054aca72d2763c927956392c19)
(cherry picked from commit ac109696e7dc10afa50c43df16497ead4236a1d5)
(cherry picked from commit d39713efb4ff3053e69be8015642bbc000928309)
(cherry picked from commit f0bc5decfbc270490620c70e6c9c26d84227f5f8)
(cherry picked from commit 17088c418866bd4a0b8360902f2aa81ee88b780f)
(cherry picked from commit 6a97494acd15d14b647d59d7c408b23e42f0fb29)
(cherry picked from commit 261705d6a15aab43f509ad149e7edff9f5455768)
(cherry picked from commit 601cb8cf6fac13b14d1347e94956bd51fb7a462d)
(cherry picked from commit 9812c73692271914a6884d2e336105ce6e5025bd)
(cherry picked from commit 430b4c19a4e315e409b12231209050bb0a9e01b0)
(cherry picked from commit 5b5162aae758af44c306853fc4cbf60a69b500cd)
(cherry picked from commit 26a89ded6af3afdbe3f886bc6345a0baaf95f2ee)
(cherry picked from commit 1cfe396d4bc428a34efa93288bf06984c4ddb912)
(cherry picked from commit b9fb3d9f13b84a6e1603d2372cc16e30825ef9af)
(cherry picked from commit 476efc0063880ac8f2cd08abbfcc07bb16b7bb5e)
(cherry picked from commit 8d71e6b2f825cc9adb7761264e0d92b3e3085482)
(cherry picked from commit e9f1631c3dded5ae54000dd5c7fa9fec12bd1af2)
(cherry picked from commit c4d8eef7c5f0dc0227fa3666f4625ecc3a824bba)
(cherry picked from commit 7cfd4147be9168c002b197515def87c9254104f0)
(cherry picked from commit d8cbe27d3028228245e99a3eaea3debf5d4504e7)
(cherry picked from commit d7b3f85db2aee0c9ac1192cc9d18b0d11d6489f2)
(cherry picked from commit b92e54bb36a04235b71c9f4cb741b9dddb3db0d4)
(cherry picked from commit 085b400b15333a1099925f0f70864e1330053268)
(cherry picked from commit da6006e45c3050b93e465957ebfc91692898a450)
(cherry picked from commit 376a3fcbdb17f5053b9df19427603f7834bf0d3b)
(cherry picked from commit 620ed84f24d8d9bec49611383db6c04ebc871875)
(cherry picked from commit 204e6f5e93140243ee319b0e1c7d06ba924ecef2)
2023-11-13 12:33:48 +01:00
Loïc Dachary ca49a708e8
[DOCS] RELEASE-NOTES.md
(cherry picked from commit b07123ee7b441946bdeacf38dfbabde705427f63)
(cherry picked from commit ca85c880b476428b407c30b4b1776b2e008c9330)
(cherry picked from commit 723ead94cb63e8d703f0159a02e2fcaff2f1bb30)
(cherry picked from commit ff148318da221be77813675437026985a19107a7)

[DOCS] RELEASE-NOTES: 1.19.0

(cherry picked from commit e84e43887beae3a2f18afb8ef71fdc17078413bc)

[DOCS] RELEASE-NOTES: add scoped access tokens

(cherry picked from commit 688f831853ef179d511cc7594dd23cc46ccef654)

[DOCS] RELEASE-NOTES: Scoped labels

(cherry picked from commit 747479a07b3b7b329016337025eddbc82c4073a4)

[DOCS] RELEASE-NOTES: OIDC groups

(cherry picked from commit 10c505fe8941b81824f08e4c6a39d12517c182bc)

[DOCS] RELEASE-NOTES: Copy Link is broken

On firefox it fails with Uncaught TypeError: navigator.clipboard is
   undefined
On chromium it fails with Uncaught TypeError: Cannot read properties of undefined (reading 'writeText')

(cherry picked from commit 148b2ff093fa87672aa09d09484b7803bbdecc39)

[DOCS] RELEASE-NOTES: Copy citation

(cherry picked from commit d0f217735f506d0f4fb414f38860d821cd1925b5)

[DOCS] RELEASE-NOTES: Support org/user level projects

(cherry picked from commit de845c7bcf4637f442a612fafb6a663c7dc69473)

[DOCS] RELEASE-NOTES: v1.19 has a documentation

(cherry picked from commit 9a5b46da32fa12c32215a0c0a8b233c14a10c9b0)

[DOCS] RELEASE-NOTES: do not split webhook section

(cherry picked from commit 00ed02032124ca75644ec2365f054c56d7e68d20)

[DOCS] RELEASE-NOTES: Incoming emails

(cherry picked from commit 06c455b33bf39a7595a31a983dbaab7e28795f55)

[DOCS] RELEASE-NOTES: secrets are an implementation detail

(cherry picked from commit 8236dc3a573f9cdb892894416268d3a115c77fd1)

[DOCS] RELEASE-NOTES: Prohibit fork if user reached maximum

(cherry picked from commit 0f80b8c696ef8c407466605588f341b710a023ab)

[DOCS] RELEASE-NOTES: scoped tokens: do not duplicate the docs

(cherry picked from commit 9bc4793c078e115ab5d59fda89fb43765dcb0526)

[DOCS] RELEASE-NOTES: rss feed for tags and releases

(cherry picked from commit 599b36fada5f12a3fb4e0eed4f787606af701e46)

[DOCS] RELEASE-NOTES: protected branches wildcard

(cherry picked from commit 2b316c495056b9ae9191f51f550eb0a5c76ae6c1)

[DOCS] RELEASE-NOTES: disable releases

(cherry picked from commit 9a60773f1dcaf241b43707c2009e0223d0b3eed9)

[DOCS] RELEASE-NOTES: review box

(cherry picked from commit 09867dd1220c66c6ad468f9f0a0a22740510f373)

[DOCS] RELEASE-NOTES: asciicast support

(cherry picked from commit ea9658379b25f9c1dec487fd5d9139d37735e113)

[DOCS] RELEASE-NOTES: attention blocks

(cherry picked from commit 70b387750b2fea65e68aa2b1486ffcfef0dbd2fd)

[DOCS] RELEASE-NOTES: commit cross reference

(cherry picked from commit fe706dad13db9f3ad4fd6699b20337712e7a674b)

[DOCS] RELEASE-NOTES: strip user completion border case

(cherry picked from commit 33ca51b4b699ba347d395796d80eebab09b1a2f6)

[DOCS] RELEASE-NOTES: card preview

(cherry picked from commit 626cd78ca6d2c95dcd90c33d0f9e3e99f48912e7)

[DOCS] RELEASE-NOTES: raw copy button

(cherry picked from commit edfb467d64190df7b8056e5ced164678ea5a1ea7)

[DOCS] RELEASE-NOTES: allow edits by maintainers by default

(cherry picked from commit 7006405bc6113f4b7acd26d91d1f928022d00bdf)

[DOCS] RELEASE-NOTES: database auto migration is a little arcane

(cherry picked from commit 78030fa9af4a05e2092d54e18e7b2dee2037c299)

[DOCS] RELEASE-NOTES: fix typos & minor rewording

(cherry picked from commit ae1d47f656df2c11c140095d8710361ebe545af5)
(cherry picked from commit ad08ca9955304663367fa66e8d2097b78bc5b438)

[DOCS] RELEASE-NOTES: webhook authorization header

(cherry picked from commit c35e2c4f6f985be5763363ae2b03e5d23378f0d2)

[DOCS] RELEASE-NOTES: video element in markdown

(cherry picked from commit bcb0bd51d2114a7f086358b568928c3feeefea57)

[DOCS] RELEASE-NOTES: move scoped labels to the documentation

(cherry picked from commit c5eedaf4f398ca232ca65f132d504425dd8ac3ba)

[DOCS] RELEASE-NOTES: cosmetic improvements

(cherry picked from commit b93df350d96c0cb8b6b6b924a1dd8af1551f2263)

[DOCS] RELEASE-NOTES: 1.19.0-0 is really : 1.19.0-2

(cherry picked from commit 60d770c2c95d841c597f619e73582bbdfcdb0143)

[DOCS] RELEASE-NOTES: relevant repositories

(cherry picked from commit de6ed5b87f845bb86f4d3aa4085f373958797ebe)
(cherry picked from commit 71d91fdf22d04cb8d0c88eac87a9a59e1c558bd7)

[DOCS] RELEASE-NOTES: semantic version

(cherry picked from commit af062d77f0641426aa048e5975585b01652aea01)

[DOCS] RELEASE-NOTES: reflogs

(cherry picked from commit 084713d8aae787e2db76219f29840f006967ff92)
(cherry picked from commit 90ad322a56bd67f717e32e8a1a419033add3655a)

[DOCS] RELEASE-NOTES: fix broken link to OIDC mapping

(cherry picked from commit 802a252eb5ddb411574cd7a8c9645fffd88de469)

[DOCS] RELEASE-NOTES: Fix spaces

(cherry picked from commit a605d36ab63cba34770b14e0073ee6b9dbb3b511)

[DOCS] RELEASE-NOTES: SemVer

(cherry picked from commit 7b29c90035f243944340952c234e2caec84527e7)
(cherry picked from commit 82799195c9208d43a6c6d8da1fd6f7560f224b09)
(cherry picked from commit 5d9c2e9ec67ea7d39532d61bbf5aed3e1161d669)

[DOCS] RELEASE-NOTES: 1.19.0-3

(cherry picked from commit c599b2947d9da682da156fad459be76f09bda999)
(cherry picked from commit 8a37027ae78f42f211e179bc4080488485982a87)

[DOCS] RELEASE-NOTES: v1.19.1-0

(cherry picked from commit 89b9e96cc778a6cc2a063201252e9e2c1042a355)
(cherry picked from commit 2b4e881a4e43ea0ab522e4d8c127a2b4ccdb10d7)

[DOCS] RELEASE-NOTES: 1.19.2-0

(cherry picked from commit 0c0d2ec46cbc34d42b36af7e4096ee8e149a77ae)
(cherry picked from commit 437b8caae4d3045c00f671758dd287f005805cf6)

[DOCS] RELEASE-NOTES: 1.19.3-0

(cherry picked from commit 040740917e24c7d97ace3f46723e88163bafb533)

[DOCS] RELEASE-NOTES: 1.19.3-0 (fix typo)

(cherry picked from commit 24516cb22ab3768d076d5da87afa5f135e4409da)
(cherry picked from commit 429c8e652549072d0c695b7c3e7c9f447aea8b5b)
(cherry picked from commit 8247bddb45de2e5a275551d50a84ccfe5cc28e7d)
(cherry picked from commit d77d7b7be72d0de250d97cdedb9381a1cdc1562e)
(cherry picked from commit a64c899b1dde2ebeb620569b16cf982eb519e475)
(cherry picked from commit 0803eaa2e3b470f866e48fde7c6253666bfc5982)
(cherry picked from commit 8538f2897e49027e6f30e477401a97ddf22beb5b)
(cherry picked from commit 45b9037d3c0c243ffaab84b22d89e00371a2851e)
(cherry picked from commit 928705f8701cb2736c8bd8de688d60345f80f991)
(cherry picked from commit 19e683468c5bfaef5dc4c4a7cedbbdff3af7691c)
(cherry picked from commit 5ae55e8e347c015ca5ce50e10f49d2d509d070fa)
(cherry picked from commit 7c224d84cf1de8ce566533cbab48572735fce8ef)

[DOCS] RELEASE-NOTES: 1.20.0

(cherry picked from commit 3fbcdd235b67c2292162949b1fd24e4fe1a55753)
(cherry picked from commit e7a621acae5ce34c91db41848a4a2bc3e1fae6f6)
(cherry picked from commit 70adac6d6659de22a87f2bdbee7297f677fc7b51)

[DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) rewording

(cherry picked from commit 1b79fab57d370f65b1a22fdec264889044d6ec17)

[DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) time

(cherry picked from commit cfd599a13224f3413abf7e75859224f4e48a3028)

[DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) wiki

(cherry picked from commit 6aa2ab41c60af2bb348971bd5e1110f7abf98727)

pick changes from #829

(cherry picked from commit f5995981015fda2d012597aacfddb62d2b328230)

[DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) ui

(cherry picked from commit 5f0aa769b1691b0f12273d8e48ffda67fbe0ed02)

features

(cherry picked from commit d1e788ff4e3eeb9cb07cfc7ceb682b7d8414ab89)

typos

(cherry picked from commit 088d4b2d61b6c8210cde54a1e001860d2ec0cebc)

Mirror Settings

(cherry picked from commit 161412affd711b6a6ea4e3284d791137c69a6e6a)

features

(cherry picked from commit 10cb0379e2c557d43ce17ef3153e877684605a58)

fix typo

(cherry picked from commit aee096b04098b5a2ecaa75a40701ea7ddf4ad022)

TODO

(cherry picked from commit 0d4e0bb4a973f7bd2f6653ff18f2f0830d04da18)

typo

(cherry picked from commit b76a3c1a84333699c292f33027a80099587322ff)
(cherry picked from commit 4c354196c2202a1f0b3635ad741ad66cbe1989ab)
(cherry picked from commit 6323c6d1a28272f4694e9b213c25164ba1d03312)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) Woodpecker CI archive repository

(cherry picked from commit 154ee5bc9c8a91980db646ce6f17da55445a111c)

[DOCS] RELEASE-NOTES: 1.20.0 (squash)

(cherry picked from commit 656f95544814cfcd6bd28e01e2baf5a524d4a273)

[DOCS] RELEASE-NOTES: 1.19.4-0

(cherry picked from commit 85bd99717683c53cbf133989a20323a7c4f993a9)

[DOCS] RELEASE-NOTES: 1.19.4-0 (squash) fix typo

(cherry picked from commit e5c364c586ef4b848b91a855ce62291780c37307)
(cherry picked from commit c123048e51a42167ade8feeba09c69d24f6ba5f6)
(cherry picked from commit ad2fedb6931df445b4a54a776144862ce78e023a)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) blog

Pick changes from https://blog.gitea.com/release-of-1.20.0/

(cherry picked from commit c8068a9d7b93abbbc852a307f48dda0aef40db86)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) Gitea release notes

Review https://github.com/go-gitea/gitea/releases/tag/v1.20.0

(cherry picked from commit dd58b50403894f84936e26680ce6791f045358e5)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) commits

git log --no-merges --oneline 64ed262e1..gitea/release/v1.20 . ':(exclude,glob)docs/**' ':(exclude)CONTRIBUTING.md' ':(exclude)MAINTAINERS' ':(exclude,glob).github/**' ':(exclude)CHANGELOG.md' ':(exclude,glob)options/locale/**' ':(exclude,glob)options/license/**' ':(exclude,glob)snap/**' ':(exclude).drone.yml' ':(exclude)custom/conf/app.example.ini'

9159964ad Avoid opening/closing PRs which are already merged (#25883) (#25903)
9369b3831 Skip unuseful error message in dev mode when watching local filesystem (#25919) (#25927)
6e82d0bb7 Add shutting down notice (#25920) (#25922)
36b9a86bd Fix incorrect milestone count when provide a keyword (#25880) (#25904)
de8127e78 fix incorrect repo url when changed the case of ownername (#25733) (#25881)
de8127e78 fix incorrect repo url when changed the case of ownername (#25733) (#25881)
186f07bbf Make `add line comment` buttons focusable (#25894) (#25896)
45b1f4dd3 Add support for different Maven POM encoding (#25873) (#25890)
026e745b9 Fix incorrect release count (#25879) (#25887)
c334be828 Fix empty project displayed in issue sidebar (#25802) (#25854)
353dcc5ad Fix the error message when the token is incorrect (#25701) (#25836)
abe9c641c Show correct SSL Mode on "install page" (#25818) (#25838)
052e65e63 Fix incorrect oldest sort in project list (#25806) (#25835)
c1a10be07 Fix activity type match in `matchPullRequestEvent` (#25746) (#25796)
2b79d3fd5 For API attachments, use API URL (#25639) (#25814)
b4460cf54 Make "install page" respect environment config (#25648) (#25799)
a1bc2aa05 Avoid amending the Rebase and Fast-forward merge if there is no message template (#25779) (#25809)
d713cf615 Fix WORK_DIR for docker (root) image (#25738) (#25811)
012b804a9 Clarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764)
372b622c2 Revert package access change from #23879 (#25707) (#25785)
06bcdfe77 Remove unused code (#25734) (#25788)
a5a3c8141 Fix notification list bugs (#25781) (#25787)
ea2c9de3c Test if container blob is accessible before mounting (#22759) (#25784)
348a6bf70 Always pass 6-digit hex color to monaco (#25780) (#25782)
91dadeddd Translate untranslated string in issues list (#25759) (#25761)
32eaba1b4 Hide `add file` button for pull mirrors (#25748) (#25751)
917ca5ded Several fixes for mobile UI (#25634) (#25689)
e595dfeec Allow/fix review (approve/reject) of empty PRs (#25690) (#25732)
03cacf971 Check `ctx.Written()` for `GetActionIssue` (#25698) (#25711)
68e0c802f Show correct naming for 1 comment (#25704) (#25712)
09668b2e2 Correct permissions for `.ssh` and `authorized_keys` (#25721) (#25730)
04eea29ec Fix tags header and pretty format numbers (#25624) (#25694)
511be9fe6 Fix position of org follow button (#25688) (#25692)
24e64fe37 Replace `interface{}` with `any` (#25686) (#25687)
4e310133f Prevent duplicate image loading (#25675) (#25684)
491f36d32 Actions list enhancements (#25601) (#25678)
5510ed34f Fix the nil pointer when assigning issues to projects (#25665) (#25677)
39fce5750 Prevent SVG shrinking (#25652) (#25669)
1f9037604 Fix show more for image on diff page (#25672) (#25673)
0af6542a3 Add unit test for repository collaboration (#25640) (#25658)
69bdcf41f Log the real reason when authentication fails (but don't show the user) (#25414) (#25660)
e610b0389 Fix UI misalignment on user setting page (#25629) (#25656)
13ffa287b  Fix bug of branches API with tests(#25578) (#25579)

(cherry picked from commit 3e9e862e5ed30e82f3b4da1b14f7865fb05464e4)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) reorder breaking

(cherry picked from commit 4e4cdddc5549caa62629955b3803fcf808219c2e)

address rome-user review

(cherry picked from commit 8791fe88b1653ce536ba0596b2defcc6d80fbff1)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) reword breaking

- removed the section about the changed themes: it is an internal
detail and redundant with the above warning regarding themes &
templates

(cherry picked from commit b34e9a7b19e445639144a4cd5371ae23cf0dc77d)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) minor rewording

The CI & Actions sections were grouped together.

(cherry picked from commit ed236e1ee89eeecfaee28fe44e738dc2d96592b3)

[DOCS] RELEASE-NOTES: 1.20.1-0 (squash)

(cherry picked from commit 3c11eb1de542e2c56446108aec9b3b4d3cb8c117)

[DOCS] RELEASE-NOTES: 1.20.1-0 (squash) Forgejo features/optimizations

(cherry picked from commit c516fd0c7a8251420b5fdbc1e27083ae8a552560)

[DOCS] RELEASE-NOTES: 1.20.1-0 (squash) fix typo in Alpine version

(cherry picked from commit 1c2a5b516203db744364387e6d5673c65341f8ac)

[DOCS] RELEASE-NOTES: 1.20.1-0 (squash) comment out obsoleted queue keys

(cherry picked from commit 8c0d9459c5e1fde85bb6e728e53ce137a87dd69d)

[DOCS] RELEASE-NOTES: 1.20.1-0 (squash) WORK_PATH breaking change

(cherry picked from commit f4ea3b27f51fb2ecfb9d08bb3547fea067afa766)
(cherry picked from commit 0557568f613fe072df32c1620bb7e0e060bdd71a)

[DOCS] RELEASE-NOTES.md (squash) obsolete queue `app.ini` keys

(cherry picked from commit e0c943ac3bbd7779c56e77225829eb3ce46b6c93)

[DOCS] RELEASE-NOTES.md (squash) v1.20.2-0

(cherry picked from commit f2c654d1c8f0ed983db7374936962753f430523b)

[DOCS] RELEASE-NOTES.md (squash) fix LFS issue link

(cherry picked from commit 2461355f2a372229b41a2326ac50bfc7c26a3244)
(cherry picked from commit 750652d75ab408736a2b3be77404163087f98a4e)
(cherry picked from commit 6899dbdc118da8cbae2f986f1601ae228926c4e5)
(cherry picked from commit 88b988d08447d46010e885f703c3890c252e200e)

[DOCS] RELEASE-NOTES.md (squash) v1.20.3-0

(cherry picked from commit d566e78d68e79af56a1ed40e25e95f8ad612790c)
(cherry picked from commit 65439eafa43683b304606a06b7c1bbed6f2bdbe9)
(cherry picked from commit a76cc5b8bcbcefc7a54ee9b0381dcb54cb3fe5bf)
(cherry picked from commit b4e1ad6020ccb107da6e005af3a1bf182d735930)

[DOCS] RELEASE-NOTES.md (squash) v1.20.4-0

(cherry picked from commit 8a910c0c339faa59d46a6d838b5614b6f04a5e61)

[DOCS] RELEASE-NOTES.md (squash) link to upgrade docs

Refs: https://codeberg.org/forgejo/forgejo/issues/1199
(cherry picked from commit d4e9030873d2a3ae6dd379837aa1026a30a50aa2)
(cherry picked from commit 7da7b9cef4711fab8a35e477743b6fdc8cce70ce)
(cherry picked from commit 73b64ea8959ec6f5fd6be666d47b546cc523d9cf)

[DOCS] RELEASE-NOTES.md (squash) v1.20.4-1

[DOCS] RELEASE-NOTES.md (squash) v1.21.0-0

(cherry picked from commit e618ea55a54f5cfbd593f8c06be5d94bc0ba69ef)
(cherry picked from commit f3ee9864160ba4120f1fd10c0b4d4925970e4b1a)

[DOCS] RELEASE-NOTES.md (squash) 1.20.5-0

(cherry picked from commit ce5541c78b42cfd441f4af7db004a3fa3af493b5)

[DOCS] RELEASE-NOTES.md (squash) 1.20.5-0 is a security release

(cherry picked from commit 5dd66c06e3aa24d355f0cba7a24ecd6ec43b2021)

slug of the blog post changed

(cherry picked from commit fc5b52049f8f2e2271ef41a633efe3b7f04d05e7)

apply caesar rewording suggestions

(cherry picked from commit 59e9648b7114121fca92c0ba5eb92272b1c45643)

[DOCS] RELEASE-NOTES.md (squash) typo

(cherry picked from commit e8daead2a16303d59d33d0287427cf0428fa8453)
(cherry picked from commit 8af0a2007df9f08c71c79cbb1a55d03fbf499dfa)
(cherry picked from commit e1e61c79965a576c28c19c8e25d75072ba1b29e9)
(cherry picked from commit 93b08de375ad40661fbea8000573181974f83ba1)
(cherry picked from commit 3cf75a4baf456ca00c0dc562bef125ce2ba5b6ca)
(cherry picked from commit 118472e6fadb1140d70f32861fed68f5dcb741c2)
(cherry picked from commit cde7d44adf62eb0497ff9db9a0e95bd56a52324f)
2023-11-13 12:33:48 +01:00
Earl Warren 1c3ad857ab
[TESTS] add GOLANGCI_LINT_ARGS to control golangci calls
It is for instance useful with:

GOLANGCI_LINT_ARGS="--concurrency $(expr $(nproc) / 2)" make lint-backend

on a laptop where overcommitting the CPU degrades the UI performances.

(cherry picked from commit 76023319c4275645b9c8c3bd896c1e60e1d57ae7)
(cherry picked from commit 55eb05b03db15355745af83e612406baccc2b126)
(cherry picked from commit 49c84de3dff883c89a3c0115ab7e0a06aad7bb45)
(cherry picked from commit e8e26f08a6f31fc68797d6e0a927e75565abc350)
(cherry picked from commit 401aa12cac3ad50ffa21c5e141d72e1d7cfd45ff)
(cherry picked from commit 4ae8f663ad287269e1dc8bee19b3edcf41a431f8)
(cherry picked from commit 1ba6b35cd7845c973ed5f41e867aa27333e73504)
(cherry picked from commit 2b671642cb1324802f61ec9def35b994ef5bb31d)
(cherry picked from commit 7fa16f0016ebf6cd6e356670f23113aa895dd6ab)
(cherry picked from commit e6eeb83d54ca3ecd9a72b4c32e6c5c03c019861e)
(cherry picked from commit aebc7808f6895a93b8dbe4166058dda8ffeef915)
2023-11-13 12:33:48 +01:00
Loïc Dachary 40077b0973
[WORKFLOW] issues & pr templates
(cherry picked from commit 9dd224f00c02151642523f31c98b819a2ea9b1b7)
(cherry picked from commit 710af007bccb62c65dd51ae46c77a297c0c58e43)
(cherry picked from commit 2ccd6e2bd60dbc829b98b75daef3b1360cd708e7)
(cherry picked from commit b90dc5fc4f90b7a916348378a089a9d54b23ce60)
(cherry picked from commit bf25d98a981800979073be008d254bfe0efe58bf)
(cherry picked from commit d7c71e598540ffe7586e99d0c9a8af53b564e5df)

[WORKFLOW] Add Forgejo Next and reproducing to issue template

(cherry picked from commit 17a3988fe09125755148380bc906f369b45b9764)
(cherry picked from commit 9ee5b3a619591143bb00bc26ec01fb350f2a0dfa)
(cherry picked from commit bebdd8d5f31cfab4e9fbe90d453305d264a99479)
(cherry picked from commit be7bb96d5c2303dbda5999ac20d32559e2085eed)
(cherry picked from commit 4ae659d63a095dacd01de798db83a8817a97dbf9)
(cherry picked from commit 82426f376d13d38c39364edfc58bf675cfd6918b)
(cherry picked from commit 1cb28e36712554961f16d912a443f86f535b3f42)
(cherry picked from commit c6a2db94c4b7861319fc63bc5e9304b2d4e61a22)
(cherry picked from commit 90d3eb2d1303dfd126c77721c1f3013b7da12db0)
(cherry picked from commit 3c3e656f582a0b3fdc8106ee7a30b4b3eb0b7c64)
(cherry picked from commit 54ece82417746fd725671309b68528db38796247)
(cherry picked from commit 55a042485a4c1d00ddddfb156c8db995af8b4819)
(cherry picked from commit 4e984aeba6e27fe86d11bebeffd5922bbdb7e7be)
(cherry picked from commit 52ea3f32b6f015e97ae84770d7254edcb1ff47d0)
(cherry picked from commit 00b0d0621efd3be8078d2dc9f0924f6ea16dd756)
(cherry picked from commit dc4acfa6db3cf9cce5cbf71cbda139541ca4b3d8)
(cherry picked from commit 0d26574fe3759057b66c43a64302a8f9c11ff17e)
(cherry picked from commit 81acdf5a84a9151b60977b5ca48018ea7ac739c3)
(cherry picked from commit bcb063e157a3fd9d58777f381b7fb894c4fb7149)
(cherry picked from commit 3e3bd36e6d526e53cdca3edd4da024efa351bf8e)
(cherry picked from commit 7767bafbffea48f1c1f06a7feefdbd72ba203496)
(cherry picked from commit c98e1afb4ccfaef14976b27304c07a3b5de5e6fb)
(cherry picked from commit 8ebc60b9495b6e7e4823f13880ae4582ee52281f)
(cherry picked from commit 59555d146e6a52aead047302a2affd5b73616e4a)
(cherry picked from commit 8ec25e8838b96aa4af135113663b8b4d28f5b8bf)
(cherry picked from commit 6e568c70d75a7aef7d64acc66991cae3cb26e378)
(cherry picked from commit 5a36052803d92ce51e3855889bb438e1ac0c7c7d)
(cherry picked from commit c7e6dc6b13b6d25f4c72a08f3e42fe931e309ec2)
(cherry picked from commit 005557f7ef4eb4ae14a8b454efab8b262c012e34)
(cherry picked from commit b5cc6387327cc6fbdb0a57034efc66b44afc5d1a)
(cherry picked from commit 6a3293b179f73780aa9c67f7cb156983061cfbf9)
(cherry picked from commit 87cb0deaf6f92ffa087be20da35525f888c0e639)
(cherry picked from commit ef6b3e6a7efaa6d310a3a2ca6676a5022ab84040)
(cherry picked from commit 4fedfc322a59d662cf6bfd4f98f693dcdb621db3)
2023-11-13 12:33:47 +01:00
Loïc Dachary 42c745a0c6
[DOCS] README
(cherry picked from commit a47b4745861ba2ab7485974d27334aed44feeac3)
(cherry picked from commit 2fcc61c1d929380884dd9aeb143c202a2be0eef9)
(cherry picked from commit 67debe2247c83753173efba53c60845f522857b5)
(cherry picked from commit b90ffbb309bc76968588a024d2ced081989295ea)
(cherry picked from commit 07a744814855a8bcb8d196c6c31f9bde7cfcf249)
(cherry picked from commit a7fe270c08c25e6db42c32019b4a1a0720a57ec1)
(cherry picked from commit 2f15389a9cafa00001c84396a1a88a14c3250e5c)
(cherry picked from commit 16ba587f5dbbfa36398ca55e5210e5233211e224)
(cherry picked from commit 683a23b2ca29f3638a2bd703dad567ae2896f261)
(cherry picked from commit 3e5de3f656fa769317bf1cd1e508682f89e90000)
(cherry picked from commit 5789005c4355f9d6b76a2288376b3b45a7939ba0)
(cherry picked from commit 75c0f11079bc1e376b55186c4994bea71a54cd15)
(cherry picked from commit e78a272e111066950ad5a365e504e1aacb4de5b7)
(cherry picked from commit 464a534a3a712111b5578523bb657cd36cb10f64)
(cherry picked from commit 7c0b73ca6fc28696fd580d7f858f8d814436e9a6)
(cherry picked from commit e66b8edbc6fa1120ea4e66d586ea46c06a865a05)
(cherry picked from commit a91864340d75d16e6afce18e7e5b974cfae8719f)
(cherry picked from commit 504905bc882ad075f821fb4fcd86560191bdada9)
(cherry picked from commit 650137433f44d65570947c8dbad6fb51b18f8a68)
(cherry picked from commit 3e00bdaf2a2d47d168108cd130829d6d864fa4b4)
(cherry picked from commit 43efcc1a29449c802b18a09387af67c24e71b189)
(cherry picked from commit 4984ba13c57fdade1a5744713c98a60e650a5b9a)
(cherry picked from commit 02b7928710ad9446b93598801dff0afae828136a)
(cherry picked from commit 0db0feaee25187bcd4c28c9e66d3d0eabaad7a8d)
(cherry picked from commit 94d141bc7f488ab0e6512218cac409b63cf83700)
(cherry picked from commit 392fb1589178338b8285df7b348754e79611590e)
(cherry picked from commit c5699a7bb71962321b131c9ac4413f8710de0d56)
(cherry picked from commit b975597a781c745463d9db80a220733d99a12e28)
(cherry picked from commit 5395e74d72285490f25067c8ac72899a3e23f3e7)
(cherry picked from commit bc8060dee4355667680dab8935a7abd504ceefbd)
(cherry picked from commit 3b64f1477a50319c3dbf638c89ef04dbd2fc12af)
(cherry picked from commit d40378e1c767194b2207d359378a976f1f0c9090)
(cherry picked from commit a713f7e3f9f6f8231d2cba82833d8eabec8b0dd4)
(cherry picked from commit 87f65ccf78eb19e573971c8c16a76f60d610a5d5)
(cherry picked from commit c650a94dd81a2e020e46aa42e040fc7947796f0a)
(cherry picked from commit 7c2743042c426a14c01c84438eef5ecd8ec00696)
(cherry picked from commit 8bcc23663ebc13a69fa4b5b1390008cb6f70ccb9)
(cherry picked from commit b043519303a4c175eaefaa090894b42f1a05540b)
(cherry picked from commit b53d65811eb97c1a9fc08ade5ac2d00236f3ba97)
2023-11-13 12:33:47 +01:00
Loïc Dachary f6897194c3
[DOCS] CONTRIBUTING
Refs: https://codeberg.org/forgejo/forgejo/issues/8
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/153
Refs: https://codeberg.org/forgejo/forgejo/issues/123
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/299
(cherry picked from commit 08dcef0c8cc9cdf5d786a925f18c1ec0cf3364da)

[DOCS] CONTRIBUTING/RELEASE: https://forgejo.org/docs/admin

Because the version is not displayed on the landing page of Forgejo,
there cannot be a link to a versionned documentation. There must exist
a link that points to the latest version on the website for the
forgejo instance to display.

Better but more complicated approaches could be to:

* Embed the documentation in Forgejo
* Allow the admin to not display the help
* Allow the admin to display a versionned help or not

(cherry picked from commit 83cc38923935dcc7edca22756d6fc10988a58540)
(cherry picked from commit 5df52b8a4f6ebd184999a19dd10138a8e3980869)
(cherry picked from commit 9a66b3d70b6e7d2a3ee146d3708d48d8f9bfe305)

[DOCS] CONTRIBUTING/RELEASE: reminder to update FORGEJO_VERSION

(cherry picked from commit 2a4d0bd164e55fc981d9437d8220a9c1e00ca59b)
(cherry picked from commit d68576ba6762f4af2ed8133fe123fa84c136a90c)

[DOCS] CONTRIBUTING: updates

* Remove obsolete description of the well being & moderation team and
  replace them with a link to the moderation email.

* Remove description of the governance process and replace with a link
  to the governance readme that did not exist at the time.

* Add links to the Forgejo documentation

(cherry picked from commit df749da27225ee13b5e00b689b397b24afebd044)
(cherry picked from commit 4da39128c50e5e754f1404a5b79669a8218344be)
(cherry picked from commit f442ca6f4032bbd61185e488e5a513f4e4264559)
(cherry picked from commit 031928c447e4cbc293de03f6befbba05691810fc)
(cherry picked from commit 1e6ba47216f8cab267f555eb488f4e80ef503fcf)
(cherry picked from commit 8916a1f8c6358a85c2484a465a73a5d657fcb048)
(cherry picked from commit 663e28c41247e98b34cbd6cd32ce1b891f386989)
(cherry picked from commit d56b130baaa4dd13bc64f2f149753b7a2e40ae01)

[DOCS] CONTRIBUTING (squash)

(cherry picked from commit 0dc4b6e5c93e1abc1502149603839ebe30ab4e5a)
(cherry picked from commit 52f2163807abc5dcb35ebee32f695368be720105)
(cherry picked from commit 47d0ae3e10385b7568474c4f3cae1eb79961838b)
(cherry picked from commit 7757a5c34cd61bfc7a96766c6c55baba9d571c3f)
(cherry picked from commit 5b4d25bd037d9142fe274bfdeb6ac43cf371ae95)
(cherry picked from commit 78798cc25e90200474cb1051f97a97e2d8091568)
(cherry picked from commit 3001fb8c7b3eecd6935b3c66f87981d77c0c64d9)
(cherry picked from commit da27bf1bc5a3a4ee9b9bcbd34a9d81d503410de8)
(cherry picked from commit 2fb13da8ed918fce8cc3a4471aefaba78836ffa5)
(cherry picked from commit ea19e0efb33710f36cf2ca300424eca7301922a5)

[DOCS] Add link to build instructions in CONTRIBUTING.md

(cherry picked from commit 50d86aa4ad740938e6089fc7ebde231653da7f9e)

Replace 'v1.20' with 'next'

(cherry picked from commit 3e99f49fc5a9c104f2656a330d497c92368994fc)
(cherry picked from commit f5c89e88cfe05b4ecc753674a24284b2a2af634c)
(cherry picked from commit 8e70433dac072af935676dc42f41b1ef66a0eedd)
(cherry picked from commit 31cc99588c0d456beb0b8493f919b06df3782371)

fixes 404 links in CONTRIBUTING.md

(cherry picked from commit b7326919ab20feaf5650cfb8d284dc074b835e62)
(cherry picked from commit cd88e7d177101a9e3be9ef8c19f1220115ae3851)
(cherry picked from commit 09d33f2050aafe9ffdd8412b1eacdd8aa172dfd1)
(cherry picked from commit 8ea49fc0c7b693ae348738f63a8a6e82fbfeebdc)
(cherry picked from commit a434c76f4b30a376643e3716d14bd0514e9af364)
(cherry picked from commit c61e1b879717406586ea7c60d5fdea6782637e86)
(cherry picked from commit 1ce9dc9defc22837dedfb52f0e8fbf78719204c8)
(cherry picked from commit a90927d0b1b57f06625ef53c2860617f67608b92)
(cherry picked from commit 17ca38d29a63d691817a09d3c53dc29ce1b8d0e2)
(cherry picked from commit 70986dddc958c284a55eca2b8a758d2030a9aebe)
(cherry picked from commit 0f89341eecc7fe17f8b3f029088adac6866892a0)
(cherry picked from commit 504a4988ae347481afbb40aa85f7a0542239336e)
(cherry picked from commit 1f0cc09f1afbd3ad049e808fa89f804d08a3c0b5)
(cherry picked from commit 69b33ca3a8e67bf0967ff706e56f226e18887231)
(cherry picked from commit 1eae013dfbe1b420b7ce7adac8283432507ba0c5)
2023-11-13 12:33:47 +01:00
Loïc Dachary 6deb8f859e
delete Gitea specific files that need rewriting for Forgejo
Although it would be possible to modify these files, it would create
conflicts when rebasing. Instead, this commit removes them entirely
and another commit can start from scratch, borrowing content from the
original files.

The drawback of this approach is that some content updates from Gitea
that also need updating in Forgejo will have to be copy/pasted
instead of being merged.

(cherry picked from commit eb85782115f2f453e13561848925760b1abddb16)
(cherry picked from commit 34401f2004445f225a479b8258180f498ac87847)
(cherry picked from commit ef43b1c6910a01a5f9dbd054e23372f6f17f4d9e)
(cherry picked from commit d17fe25e2f915e778eb968c20939dc253f47bcd5)
(cherry picked from commit 3f65dea3e7a5d0983d96d7011385125bd0063ff1)
(cherry picked from commit 3cacb64a1bae713467d3d9b7ebfe626930f2bd35)
(cherry picked from commit b531b014b751233b46e3220c25108fe95531621b)
(cherry picked from commit adf6e7a840c7f7201eddec3ab2b305200b19fc43)
(cherry picked from commit 68c19d977d6aa8e8eb5714f5915b6557379887c0)
(cherry picked from commit 31aa8647ecaf91704652e149fb5d0e891645412d)
(cherry picked from commit be70dd7208c2b40842cb83affa77f6d15ac4d840)
(cherry picked from commit 7f44bb60b16843b0e127a7e5fc89736a1d35d145)
(cherry picked from commit 5098f1224b10ac7b35c1d4c9ece8fbd066a616e8)
(cherry picked from commit dc7a8591442772f9801bfff7a77f1c8806bedb5c)
(cherry picked from commit f1e78dd0067f8d0e9a6ea4dc292ebebdb8b8bcda)
(cherry picked from commit c41ba7a148d1b35df392a7d2af9a52461e1cb217)
(cherry picked from commit f1da66a918a68237894e220d206a5e0251ec85d0)
(cherry picked from commit 99194a3664dc94296f7e1397be45b6fde9e3e718)
(cherry picked from commit 52f356f6a9dbbbd4e2c68fde99f7c35a3e6f2bd0)
(cherry picked from commit c93ffa72ae35bbdc6cc470823648a1aed0185b5d)
(cherry picked from commit 477c7454d39e813e2bc5107bf84105060acfe743)
(cherry picked from commit 413df23a407547b1a0d480185be9efc388b464eb)

[DOCS] delete Gitea specific files that need rewriting for Forgejo (squash)

(cherry picked from commit df78cedd053e624bcc30b048eac9d6ab10ff5749)
(cherry picked from commit 3b9178b3e5ee1aedff79a6ff5b62fb700f480682)
(cherry picked from commit 9044dcb0e7bb410bbc8a83c8d3610fa6c8355e25)
(cherry picked from commit e138685bacc14138aad46bea2756dc4f6d6b46c0)
(cherry picked from commit 2f1f3fd6b8a7b054bf854ea94ef91c8f87bce996)
(cherry picked from commit 0b47d02df6c93129d825aa1b9d3f481b6cf7f505)
(cherry picked from commit 7625ca6c42b6a333e3a2e25dd3df2744a4180e32)
(cherry picked from commit e0d720a728cf24eaeb1416ac1c5b8de6655ccd44)
(cherry picked from commit 19aa974d120fe5ade8436e5ea0fab6a83f1b9db1)
(cherry picked from commit bb637d398cb02e2d0059a1e7660b88bfe87e3315)
(cherry picked from commit 5357fc952d29b5f38ad95b3c94fca22e16217578)
(cherry picked from commit bee03950445384c4d985617793175bb7b27810a1)
(cherry picked from commit 5e574bfc8f761ad631aaadda6fa4c44ac826153b)
(cherry picked from commit 0b8cb3e3ddb4e71536a0df8046027f318533dc0b)
(cherry picked from commit 8a67a0995583633d6f36902f7b9c9b7a1b425bf7)
(cherry picked from commit b0ddef126e4f0b6af29c26bd54341ebb1ca19ead)
(cherry picked from commit 4434e44d4a8572f370a5d40480fd52e4c95ffa22)
(cherry picked from commit 37d0c1bed10311b56ff8b97ac4acd8cf878b3049)
2023-11-13 12:33:47 +01:00
Earl Warren b15a475ea2
[CI] Forgejo Actions based release process (squash) size optimization
(cherry picked from commit 3c653ff7428dbf898a5131b5c817ce3b13ec0591)
(cherry picked from commit 2c2a1bf191af8d4092a9eff0bd2c64b16a6bac0f)
(cherry picked from commit a81a454802bf68c9b8e92f9f0d59db72ab7d8fb8)
(cherry picked from commit 76b6104a02ca0d669c09ee9c05b7536f8164f138)
2023-11-13 11:52:15 +01:00
Earl Warren 6b4dd37fee
[CI] Forgejo Actions based CI for PR & branches (squash) use node:20-bookworm
No longer use the custom test-env image, it is unecessary technical
debt.

Also upgrade to bitnami/minio:2023.8.31 to align with what Gitea tests

(cherry picked from commit d9b77fd2735a52043b4f8f1baaaa2e15073db621)

Conflicts:
	.forgejo/workflows/testing.yml
	mysql was mysql-8 in v1.21 and below
(cherry picked from commit 04846c6a7855d7275b4abdd90a56b22113944297)
(cherry picked from commit 261026f15447013975822bbcec40bd4c661a641f)
(cherry picked from commit 777ae8f3d9efd30bfc0fb071242c5b8442a2b1fc)
(cherry picked from commit 540522b5e3f4df95a4d34f3364acacfbdebfc0d5)
2023-11-13 11:52:15 +01:00
Earl Warren 3bcf46f75a
[CI] gitignore: emacs backups
(cherry picked from commit 5e418789d930ef8dc27bc5cb32f96350f5d64e06)
(cherry picked from commit 3af6fd2ad38bfbe98ad72e20257704bced7988fa)
(cherry picked from commit 6926787d67778f2a3bb2c9d79137a74b894e8b7d)
(cherry picked from commit fe58e86a97d4ab0017908a55a9a1f240e241e3f8)
(cherry picked from commit 5bf7ead6255889b5cc4ae81c3ce52d6d09e0aef3)
(cherry picked from commit 44480ea79426581df15242d6ee7222be97709268)
(cherry picked from commit 813848cebe61752568b9c28b9e912170e70bffb8)
(cherry picked from commit d41c4b33dfa4f5fa0b37554dcf313a2f9d823fa2)
(cherry picked from commit 86c1456e3dfc522f3ffc5c4811be0f303b3cf373)
(cherry picked from commit 8816e80874879d899c2224061bf4a109fe385c9f)
(cherry picked from commit bee7c2689ef170456d947e95ccdf63231a9437e1)
(cherry picked from commit 100679e94c05b90d21c34f0082350c40940043a6)
(cherry picked from commit 22636621da7467b508048ae7eac3c43b83411fb5)
2023-11-13 11:52:15 +01:00
Earl Warren 20dadef55c
[CI] Makefile: release: only supported platforms
(cherry picked from commit 16381262c5231f5dddf94d3dac7274366f4ca991)
(cherry picked from commit c93f41dcef679f35cb51f93b34b21cfd202ed68a)
(cherry picked from commit cf17c69487cd5ad9e5338d6dadd49c208d604ca1)
(cherry picked from commit 174b8cf3275cfb4efd483b04ad6cb6eaca069030)
(cherry picked from commit ae1b8dd441b9902b098620dbbf4e88592460f91e)
(cherry picked from commit 1b56d9049f2954b852fea1ae6e0c52076fdb4a0c)
(cherry picked from commit 6b00196175db59d2c6b71a8aa01308265c92f26c)
(cherry picked from commit 7f9ca7ea4bb4a33e228fa25e861706214170eb9d)
(cherry picked from commit a89650c9ebd3ad65db1b6470f3dc9415a640bc56)
(cherry picked from commit 375526a7e6692bf8925c7f0e2090862416c8f652)
(cherry picked from commit 77ed7a6cb0de4d2cab4e84ae52c91a7dae578fd9)
(cherry picked from commit 3e0d9279c2af92bfa88b54fc14962f9486394ccc)
(cherry picked from commit 24d440bcf5218db0b0ba7d3dc51081f5bfe85a63)
2023-11-13 11:52:15 +01:00
Earl Warren 93ac1a124e
[CI] lint-go-vet: do not include gitea-vet
(cherry picked from commit 8cbbab7fefa62c66faba72d6f8ddcec33c5e6423)
(cherry picked from commit 51113f0f29e2e7f9281ea568b8acddf6c26accb0)
(cherry picked from commit 0d061e411f60bb4533460e1558646cdbc6a45aae)
(cherry picked from commit 1eb4e7e691bf496b152916e11b991b16786752e2)
(cherry picked from commit 3c3760f3b608303cc11e1cc3fea574e8166aeddc)
(cherry picked from commit c11907373dfb8df7f974c726f46aee20727a9d3e)
(cherry picked from commit d990fcf4469df8a4edede97e2c0980536ca98d86)
(cherry picked from commit 6b008dbf0b705ea27c91532374504020606d7ae7)
(cherry picked from commit 5d246bd693c7027cb81c2d4246cca33365ec9e9f)
(cherry picked from commit 556014cf6f4b522d438876903f4d2823904c16e5)
(cherry picked from commit 3aebff76671f394302b05b74e0d8a44fc75ffc0b)
(cherry picked from commit 17d12dbfa91a754dc8ecb0ff098820883f3c8ae8)
(cherry picked from commit 62495741e2b8aefc6653e69d103eda8bb34dd18d)
2023-11-13 11:52:15 +01:00
oliverpool f85e315cb7
[CI] update DNS on experimental release (#1298)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1298
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
(cherry picked from commit 2aebc5ab4d58a90ed79e5487776d4f3eeea3b33f)
(cherry picked from commit 8d66b6e7bcc1f2eae06e1dee65b4b8736f217824)
(cherry picked from commit c782935f1b3d54a928f81a4dcd19bbca52c6f77c)
(cherry picked from commit 51e071da7304badd0f301771322bde7a86d33ef5)
(cherry picked from commit 81dbc87e1639510c1026541eb944267e9cbdb78b)
(cherry picked from commit 7a9820474341ae05e39e7de92cfe7501014dc91d)
(cherry picked from commit c679954950fb7641f3b281b3d33ae5dfb23aef8a)
(cherry picked from commit 8e4a03f302db5270967cb82ef0371429ba512f85)
(cherry picked from commit 686b770c1e5c44047d34a7ab76df5dcbce2ce60f)
(cherry picked from commit 1b1947747a52cca4b4b73b6631e66fab347ced11)
(cherry picked from commit 46619b4e9cce63e04470d99bbb4fce3f1d348370)
(cherry picked from commit 7d599fe3af775229f22915ffeb2a89984334fd1a)
(cherry picked from commit 358149d614a1e8b953c8ac8a2c323bd382316d29)
(cherry picked from commit 7b210fbf8cb7d9dff7d744da29c96d201d7cdb32)
2023-11-13 11:52:15 +01:00
Earl Warren ce04919711
[CI] Forgejo Actions based release process
Refs: https://codeberg.org/forgejo/website/pulls/230
(cherry picked from commit 87d56bf6c73d726dae8aafbc7e147969f1899931)

[CI] Forgejo Actions based release process (squash)

base64 -w0 to avoid wrapping when the doer name is long as it creates
a broken config.json

(cherry picked from commit 9efdc27e49bdfb3e62401baf27b224385f9f3e5e)

[CI] Forgejo Actions based release process (squash) generate .xz files and sources

Generate .xz files
Check .sha256
Generate the source tarbal

(cherry picked from commit 7afec520c4b1032d7e67a05a41e4e2913bcd9312)

[CI] Forgejo Actions based release process (squash) release notes

(cherry picked from commit d8f4f4807b28297b318d2f555a76d0efef762cf7)

[CI] Forgejo Actions based release process (squash) publish and sign release

(cherry picked from commit a52778c74785fe57cdee3b64b4c6c8a326471532)
(cherry picked from commit cf2ec6274094ac7aebda71d54c64581f528df00a)

[CI] Forgejo Actions based release process (squash) version

use Actions environment variables in Makefile (#25319) (#25318)

uses Actions variable to determine the version. But Forgejo builds
happen in a container where they are not available. Do not use them.

Also verify the version of the binary is as expected for sanity check.

(cherry picked from commit 6decf111a132a869f9e5c6f4d20e368b8f74309f)
(cherry picked from commit 206d0b3886b2d56b585bf552e53d952b35f07284)

[CI] read STORED_VERSION_FILE if available

(cherry picked from commit af74085ebf51c91a51db865a66667fca511838d5)

[CI] backward compatible executable compilation

Add a new static-executable target to use in Dockerfiles and restore
the $(EXECUTABLE) target to what it was before to for backward
compatibility.

The release process now builds static executables instead of
dynamically linked ones which makes them more portable. It changes the
requirements at compile time and is not backward compatible. In
particular it may break packaging that rely on the target that
currently creates a dynamically linked executable.

(cherry picked from commit 84d02a174a4398b1f8ee62e08db5483a9859650f)
(cherry picked from commit 854be47328cc0283119dfb78f9ba0b8306c85f75)

[CI] Forgejo Actions based release process (squash) doc / ca / verbosity

- Document workflow
- Increase verbosity if VERBOSE=true
- Download the Certificate Authority if behind the VPN

(cherry picked from commit 168d5d586904835762d213b2b8815b458a38c78f)
(cherry picked from commit 8756c9a72a40830441124256b7382f900a1052f8)
(cherry picked from commit 2dad7ef20f3bf9ebe2425e2e28b66a4ca21c6786)

[CI] Forgejo Actions based release process (squash) add assets sources-tarbal

Refs: https://codeberg.org/forgejo/forgejo/issues/1115
(cherry picked from commit 5531d01f1981df665f5b8f642e9241e8ea4f4578)

[CI] Forgejo Actions based release process (squash) add assets sources-tarbal

bindata.go is a file, not a directory

Refs: https://codeberg.org/forgejo/forgejo/issues/1115
(cherry picked from commit bd88a4477817be34ea86ebb2f460b9fe8ab5f1b7)
(cherry picked from commit b408085138c578dfaacafbd4b7719ca926456855)

[CI] Forgejo Actions based release process (squash) public/assets moved

(cherry picked from commit d8c921d5a643ed05f2935348531996fe4d08c654)
(cherry picked from commit f29e50b1a09b1a22fc2dbdb77e9a1def1196175b)

[CI] Fix release notes link

- Use substitution to replace all dots with dashes.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1163

(cherry picked from commit 96783728f53a072915cace392aa269adfe9a5c73)
(cherry picked from commit c8d8bf8996beb650cd86cafb110e85e1e05917a0)

[CI] pin go v1.20 for testing

Refs: https://codeberg.org/forgejo/forgejo/issues/1228
(cherry picked from commit fd4b5a013ee0f31453b623d12001a8b810cd7ebc)
(cherry picked from commit 00bb15f57f2ae5a11abc8b044ed99dc949e812a7)

Conflicts:
	Dockerfile
	Dockerfile.rootless
	see https://codeberg.org/forgejo/forgejo/pulls/1303
(cherry picked from commit 6e2be54a6d95412ce770d4bab1a39c77591f44dc)
(cherry picked from commit 346c418b4a8c0e1f8c9aace44b00373a4bf76732)
(cherry picked from commit 49061f8422cb6aa9ddc14edb507f50477624eb7a)
(cherry picked from commit 8229d59b7e1ba61959de6ecd95d9dd49bc2436dc)
(cherry picked from commit 70d45d919309d8127551c8ad44538a730b795638)

[CI] Forgejo Actions based release process (squash) need node 18

(cherry picked from commit 722b1f45902ecca3179a92700a2f5c1080422a04)
(cherry picked from commit a91d786169fb4694aed4af68792437a0a67de3fa)

[CI] Forgejo Actions based release process (squash) fix indentation

(cherry picked from commit fbdf9d6abb88fd5def3d0ced488a4dd72655d433)
(cherry picked from commit 2deff90a13397339796ac5a94d63b0d8cd9760a9)
(cherry picked from commit 9974dc031d69a144e21aaba35275308d71292d7a)
(cherry picked from commit 702aecc50d8795942f3a94715f5ccad5634afb1e)

[CI] Forgejo Actions based release process (squash) FQIN for docker

Refs: https://codeberg.org/forgejo/forgejo/issues/1600

[CI] Forgejo Actions based release process (squash) use forgejo-curl.sh

(cherry picked from commit 9e3de8e9855c6665a4d903d031191e4e3224f0ae)
(cherry picked from commit 07b442f9b71a0b12218c7912a999b462a97ba17a)

Conflicts:
	Dockerfile
	Dockerfile.rootless
	https://codeberg.org/forgejo/forgejo/pulls/1690
(cherry picked from commit 3b567f30eb3e6baccb505a0e654c3f0cb9da3658)
(cherry picked from commit fabc9c67ac4f2f265fc5b5fe91579ff970e119d9)
2023-11-13 11:52:15 +01:00
Earl Warren a0a4721f57
[CI] Forgejo Actions based CI for PR & branches
(cherry picked from commit f9d75d4705ece5c119f2fd5e2bfbaf630d0bf739)
(cherry picked from commit 64f76f4ab269daa6a584305164732c68be0161c5)
(cherry picked from commit 5d024541551f1be98444923f0fa327a855104725)

[CI] Forgejo Actions workflows

(cherry picked from commit 3ff59b5379ebf761f32875f9d869a1d18f79741c)
(cherry picked from commit 8af826a6f7c70d03079ec68f10230041695017cd)
(cherry picked from commit d7c09d9cc80037a28d488da142ae2a2a99f59ac9)

[CI] use the docker label instead of ubuntu-latest

(cherry picked from commit b6a6470db6c8bae9963e204f9c8c408f309e81e3)

[CI] all tests need compliance before proceeding

(cherry picked from commit b35c496f2c3034164b9bb3a3550f35026adf9372)
(cherry picked from commit 36a4148a8ec654ae9fa5a6925a3b8606b96aebcc)
(cherry picked from commit 7ffcffa653808a284f422fdc31f6ea07874b585d)
(cherry picked from commit 8a246d296e502c181c6ee779d1773c9e78ca7acf)
(cherry picked from commit dd0b6e1826ba7699f967de2c00c1332909a53473)

[CI] Forgejo Actions based release process (squash) MySQL optimization

Refs: https://codeberg.org/forgejo/forgejo/issues/976
(cherry picked from commit b4b8c489e6e9fe36349eced5d4249467b25df2a7)
(cherry picked from commit 1e861db4afdc32549784381a96b16dac508ec1c0)
(cherry picked from commit a6c0e00330ded851c2f524039259f0b723d793e4)
(cherry picked from commit f97b336465fd6be15079e756c9ee3a580f0aa339)
(cherry picked from commit 6d65d5f0d6f798556a8f9e547896be03a5ee2f87)
(cherry picked from commit 79bfbadbed3bf84b96f2c027d119a4aa5c60d5e2)
(cherry picked from commit e86c40a34a97fc568c724ee5f8ee5b2bf46ebf19)
(cherry picked from commit da0c454adbcf1b5dbb95d9d74afaa371e32351a0)
(cherry picked from commit b49d892cda968b22ad6c29caade042690d96f2e2)

[CI] enable minio tests

(cherry picked from commit 4d8f4380311b872061bd20f561424662ecd8d817)
(cherry picked from commit c4eeb0a61ef579c21b0382edd61c62adebe93b28)

[CI] Forgejo Actions based CI for PR & branches (squash) cleanup

(cherry picked from commit 80eb20e84267552c971096693558734f0ec7afdd)
(cherry picked from commit d2ff589858961e4f25bc1d903cdf57df1db4c316)
(cherry picked from commit f6eedecb67fce992605bb1fcdd93c866ec47a9d4)
(cherry picked from commit cf458091e245e1c70944e940a214d5127f304303)
(cherry picked from commit ddd322cb2de165126080b222c1b09b2a91fea182)
(cherry picked from commit f0f5729b6467bea053d532c4c64c54a0fe737c98)
(cherry picked from commit 26641662b6bbb1db761e514795bedb9bdbc36d5e)
(cherry picked from commit 4e596bc0028f9329f3196b2e822484c4482ea586)
(cherry picked from commit 6ce4ff732e8c1dbe35d854b32ef44cca66bd3fc7)
(cherry picked from commit 4db9d5e4f9dd182d8307a15bba7aa4f6aa5e4beb)
(cherry picked from commit 8cd3ce255b420d5ac74fa25adb31804c6ac2c976)
(cherry picked from commit 3b380c35eb47561183cad75d2e194e8bbf7f8b2b)
2023-11-13 11:52:15 +01:00
Loïc Dachary 102aac5bea
[CI] Search .forgejo/workflows first
(cherry picked from commit 8b11cab677503be78b1deb17ed9dd5fb1c823a7d)
(cherry picked from commit be5927069674a17a4c09e7f0aa530bc4630851a9)
(cherry picked from commit e068f8b191585e2910d8a45ea78bfa1b78015bed)
(cherry picked from commit 7855bb0c60b5ec2a972ae04e4515ee5adb19a5e7)
(cherry picked from commit 45c4c8f44383dced75ab83f7c817b52e78968fab)
(cherry picked from commit 89520d67ffe0062e1accd39763e1e7dd5058d83a)
(cherry picked from commit 15eeb417a4b8bb948f888c73e20135c1e0fd1f63)
(cherry picked from commit 6db53a26432f02ae50da948483e2010bd962f9ce)
(cherry picked from commit 2f689b321fa275b6412f0b8686edc7aba97c3565)
(cherry picked from commit 04dc478314c3b4927cca78c354ca46ee217f035a)
(cherry picked from commit a554624f40f51c1c75d754d6cca14f7626bb599e)
(cherry picked from commit abca05f0d1c29680bba897cc0de7037053915ced)
(cherry picked from commit dc13e7eb22f2bde817f3845c646574d8f39c1b18)
(cherry picked from commit a161c5740eb5e76c13354ba2388fa34ae925fd8b)
(cherry picked from commit 06d33e2773f01b576ba050afe2b88718a7999434)
(cherry picked from commit f536275161cc4bf5d2f163bd68a4c4498c9fff3d)
(cherry picked from commit 84ac6f314a1840d45bdecb2ccd4482fb925fd2c2)
(cherry picked from commit 1e8126edfc3a6c78cda35f053bd0ac40ba9874ef)
(cherry picked from commit 0287ac3416563e0af05c3aeabc338b791c74ddb2)
(cherry picked from commit 0efa9205ca8a128614aef5d7ffb07e37058ed7dc)
(cherry picked from commit 7b67c3b095680ce518aa13ca79b96ebe01f414d8)
(cherry picked from commit 60a7cf73e8aeecd673bfc9254a6bfa8d07aeb737)
(cherry picked from commit 540084860a91cf26146c6cfa3ca122b6da5d6e44)
(cherry picked from commit cf8e222c4bcf794ae4983ab54d0062a45d0011b1)
(cherry picked from commit a91971f628ef23b5e9d4b49c90bcff89b12b391c)
2023-11-13 11:52:15 +01:00
Earl Warren 5e9c1211db
[CI] disable meilisearch/elasticsearch test, no server yet in CI
(cherry picked from commit a1381d9146fba42cb97d72d38525fa3e721bfb03)
(cherry picked from commit 74714e02461fb47fcc0901211668e4529fac68d0)
(cherry picked from commit 7749dbfe6684498a47e3037088e7bef3542b6ce5)
(cherry picked from commit 437924971136eaed795f77edd3d3dfffa5f68103)
(cherry picked from commit a69f55bebf82a0b68bc0f66bc029eaea836cddb7)
(cherry picked from commit 24dd5fbfdbc27c887dbc24661c1005fb2e14e3c6)
(cherry picked from commit dda856d6b83936fd1c96c84544b086cbd8f63115)
(cherry picked from commit bc14f4fa97fffe82d1c666e961e313f88433cb9e)
(cherry picked from commit 78fef4f1379d8854901151d4bc62135c73db868e)
(cherry picked from commit 69e013cc515e2a50006d8d02f575ff6490d272ff)
(cherry picked from commit de57691e746c555116d7b309544903c2188789f5)
(cherry picked from commit 5d3688602453149a3eb017456edf0debffbd9f44)
(cherry picked from commit 905a3d06203ca6568af00bafb3cf468311a70630)
(cherry picked from commit cc9c743ace0aad96e3d610664032e01f353e3aa0)
(cherry picked from commit de010e6a83e84e9bec1d151a22022c776ee72bb1)
(cherry picked from commit 0179e1d8c15483f2c1b3f5c8bc84edbb3c0ae54e)
2023-11-13 11:52:15 +01:00
Earl Warren 9304cf41bf
[CI] disable redis test, no redis server yet in CI
(cherry picked from commit e1bbfa36197ebab97954e8195f7d36adf7c85d56)
(cherry picked from commit 91245ca9179a46047a351247dacecdace557111d)
(cherry picked from commit 705d0558be2c90d06e9e5b883044fd0b275b1113)
(cherry picked from commit 9247594970c9db109e3e6ca3fd87485450df921c)
(cherry picked from commit 9db1158a487e00e588810459fe402cc2ccea43f7)
(cherry picked from commit 3b36b77d87a90fbea03fc16638657e19328ccedc)
(cherry picked from commit 162fa1d8ae3753dd8ee51698555e495f2c63d925)
(cherry picked from commit d03d0afbb565c8bc8b723e10c8c70b69e7af7b80)
(cherry picked from commit 7b8f92f7871b838bc2eefa34e7dc48bcd141d1d5)
(cherry picked from commit 035abca9691d33e319062325dae402da66683c43)
(cherry picked from commit a8fbf6bb56046665cb2cde0ffcc753f56b2f0f2d)
(cherry picked from commit 3be681d037b07880236cae1aa70245e5eb4d1497)
(cherry picked from commit 7e5d471c832ee3fea378ecc97835b038bd55a8e1)
(cherry picked from commit 323801d935fec2c6d460192b62fa12b5204da76e)
(cherry picked from commit 3fdfe4bfea623111f1f97e50b71b98a63c8b38e7)
(cherry picked from commit 58a07421a4508ca298c1c3a45d33d49737ee98d8)
(cherry picked from commit dbb71a4c8502b640857d3500dda12ab4b5d74b29)
(cherry picked from commit d442113520d21149e155d1e62bbeb6a35a6aec08)
(cherry picked from commit d3329f01f8c7145c422b159509f544ec83604a51)
(cherry picked from commit 069a1d68b856898e2913d1d4456deb7f1e976a6c)
(cherry picked from commit 14919e609a4dd9ae9ca19880ffc459def8bea273)
(cherry picked from commit 2b139fed20bc2f78cd0edf35f3d226ad055f60b5)
(cherry picked from commit 57ee24202472a60c373909dfea9158d057e9cebf)
(cherry picked from commit b46762432f0bdb0c017e752e53a7281c0945af60)
(cherry picked from commit 3cda09ec833c6af4f8ba6c832e6beceb86e208a5)
(cherry picked from commit 449c11e7d31e7d36f7ee21f2ea219d5ab6e15db1)
(cherry picked from commit b831d5ed80db292115f67cfc601877b48954f233)
2023-11-13 11:52:15 +01:00
Loïc Dachary e1c6c42c7e
[CI] set PASSWORD_HASH_ALGO = argon2 for integration tests
(cherry picked from commit 1d7ce2a39c841e77492ef08c0e86c3544ecca88d)
(cherry picked from commit 3af8757583ab9bf8fc5eb05ed1e6901a34682512)
(cherry picked from commit 0b818152096d58e402e3c8bbc2415695af0cdfb9)
(cherry picked from commit 7180a3222a00c33ec7dc9bcaa7e5a1e3ae924735)
(cherry picked from commit 069044f4a6dd7457662e5ca296c714275d16becf)
(cherry picked from commit dd1438f38995e397399d8957fca696f82b73707e)
(cherry picked from commit 4ae6b5d64d59902ce003199b5d652d6c4799ffcf)
(cherry picked from commit c572666d78d0f2cf2a33d5a50ea363430ac9a0a9)
(cherry picked from commit de0a4480bc3e40d61aa5342d93a2ef510abe3826)
(cherry picked from commit 60272ef4f73608407ffedd27892376b6c36a7069)
(cherry picked from commit a68fdde4becef625ce4e654ba6ea8ebee55251e5)
(cherry picked from commit ff448cf3a698dd45c713b734fce3e374c99940bf)
(cherry picked from commit 208498caaab339d4543abfb2b77de3c5793a73c8)
(cherry picked from commit 1abd3efad842f276f1c768ab40213200b62a0d3b)
(cherry picked from commit 818c7f4ca9d59afd75d6cb9597c67cb0564cf775)
(cherry picked from commit 1e552bbe44f79d9a2f5567a0180505b9a41d39d3)
(cherry picked from commit 88dbd6da1d7b4a7faf9dda2d25d68f3202c250a5)
(cherry picked from commit b1c86fb7775dd34511f4d5069db1bd3e5ef68e7a)
(cherry picked from commit 185b1e25b12b56c9ae904adb787854da9b74ddc2)
(cherry picked from commit 0af35605ae8a2594ae0b594278748242bce9d8e0)
(cherry picked from commit 350975b63f12df508e7d8d01845032d32f30035c)
(cherry picked from commit 2788142515ff6bb316a120be60556f39659ee9ea)
(cherry picked from commit b418a53717b247e10d2dda26d1d236400d423a94)
(cherry picked from commit 086cde3f10d786cd3c05bf59e359f08a23183d91)
(cherry picked from commit 3e4818c779bd894b4b86a3672d24623fa45e1824)
(cherry picked from commit f2bf1fe64f9ebf8460a93805289fdba2d5cad6d3)
(cherry picked from commit db4eb288ee464c9a799ff2e059c0a5aa632e633b)
(cherry picked from commit f8db31821b8089d5c9390f902854b7817a0381ef)
(cherry picked from commit 2b13c06f499110ba76d3121d1c2f09df3023564f)
(cherry picked from commit 3fd0092056a4e0f43ff59b2123539ddb1ea0afcc)
(cherry picked from commit 6f7662507f26c34a3de54b3e69ea65ab10921163)
(cherry picked from commit 8a15e41887ee3a72fdb5b7718d2750d48615205b)
(cherry picked from commit 3540ab6d4a215ec7197f1e4907bb33a4a4e97be9)
(cherry picked from commit a207d02ff23b4d6e879c0e06712901f8d4031f30)
(cherry picked from commit 35309db8095fd2aef78a6131f6ac668686f2aa99)
(cherry picked from commit 6ff35732f0570f453f596286fa09747a987d35b3)
(cherry picked from commit e6d922612da7b47462e821cbe2017e34acdac632)
(cherry picked from commit a8df762405a4534ca91cf39e907e72e3c1fac8f2)
2023-11-13 11:52:15 +01:00
Loïc Dachary 074cd112cc
[CI] implementation: forgejo container images
(cherry picked from commit dd1971d4e60f37fb76daeb6cef8b1defcc957a34)
(cherry picked from commit 3981dbaf8c0dd74b0e82a7afc36809998ac775a2)
(cherry picked from commit 8dff3cc2d1a51980439e9ca8f1cad592403c558e)
(cherry picked from commit e7673e5d2237733e4e17b9386c4bb25bb88fe2e2)
(cherry picked from commit 326174064ba6dbd379ea82e9643e23fe684ad96f)
(cherry picked from commit eb769dbde4fb0d7a8a4bd74b6bcdf1f1f180f840)
(cherry picked from commit 335829ade20a187c7fd423909231d198a59545bd)
(cherry picked from commit 5e8e4f549d2224a00387764e93fdbde34e324c3d)

Conflicts:
	Dockerfile
	Dockerfile.rootless
(cherry picked from commit b777fc91d0ba5b1a061bd9cc57c4818a3357b42a)
(cherry picked from commit 02cda642ec7ce2b69de7f0ff4fb4f0d70941f54e)
(cherry picked from commit 96ef93f3bc1b618831f04e1ae5d5c7c74e2ed36c)
(cherry picked from commit aa424551f24364dd43d9b7739b723bb1d914eeaf)

Conflicts:
	Dockerfile
	Dockerfile.rootless
(cherry picked from commit e54fa86e4904047e5670e68a9dd89e76530564a4)
(cherry picked from commit 043fa6d6649272f14a65ee2c9cac15b090e66bc9)
(cherry picked from commit 805b16248015e8d7ab8c4f514969cff333d432c8)
(cherry picked from commit 86bf362a3c8386cc4530c0c4cba46097ed20d8af)
(cherry picked from commit 13e0007959fb5e2496b3bbec916036bd2a05a558)
(cherry picked from commit 00ff6f7cb3c54ae3a8ed2069b0dd0dddd98e7e6e)
(cherry picked from commit 95c7d8e883da495facfbac39db55b5b710ea25a7)
(cherry picked from commit fb033d2bb613c34b7f61c2bad14136f8f110081e)
(cherry picked from commit 1147910a552db9fdf7f4ef0a35e9b1d2405b0e69)
(cherry picked from commit 6590b6e99c9c31389f6b948976fba3fea8da7eb7)
(cherry picked from commit 78938113e4908df1d1e5181c1aa7605e7bc5747d)
(cherry picked from commit 57338224f172e30a72f03f565aa47876e1213e77)
(cherry picked from commit 4266cbcdd415de2deaea8620fe9b7b53866171ba)
(cherry picked from commit bdc766a5a2304fc1826649ac747a2724fed6e7ab)
(cherry picked from commit 6fb9ad85046fedf381a948906841098eb4ac010f)
(cherry picked from commit c4e6383240c4188fd65bf751aaf8f38466fe60e7)
(cherry picked from commit 490fa55b3abab2450073bc2358893687a06305cc)
(cherry picked from commit 802c8e72be88b342d3a285cd76a4d3207813d54f)
(cherry picked from commit 2b1efe20303be52f7ce142bafe48228822a1350c)
(cherry picked from commit fdcdd7389adafc25a158fc510256039e8f98bb2d)
(cherry picked from commit b9ae491650c7b8008149cda504439f092ba019ea)
(cherry picked from commit 6667b50919efe7386bf0be59d0a93d807e6fcf20)
(cherry picked from commit 6d10c63fa8b49f42e54185dd2009b4f9e0e749e8)
(cherry picked from commit 088cdac7b433c40790b6d4f9ce9fc49f0cdcc731)
(cherry picked from commit bf40cce579c8af4918ff04f020ffa9d273817857)
(cherry picked from commit 525db02fbd9a921a637cc2d40c8c8c34c3164610)
(cherry picked from commit e4e43c3265c0a1c35ef5b2a1357842ef537276f7)
2023-11-13 11:52:15 +01:00
Loïc Dachary a56129c3d9
[CI] implementation: publish forgejo- binaries instead of gitea-
(cherry picked from commit 6d910daafb28b79402b8190fa749f4ff18991505)
(cherry picked from commit d447861cc911aa89539cbbcdbbf0e68d0bc23e53)
(cherry picked from commit dc6e9d87990f72d870100934be32a5fc1dc119ad)
(cherry picked from commit ef232fa20c99c6c52599025967a5af2f5839bdce)
(cherry picked from commit 290c55517a84f6e8b80459372b9b63ec19cadcb4)
(cherry picked from commit db48af1784e94851c066845324c3e680e79ab7c3)
(cherry picked from commit 85f33237a2f5da88ec2fcab76ea91ee3cec56065)
(cherry picked from commit 76899ee33e8196c66f882fca5facf5268c8fabf8)
(cherry picked from commit 148b3ee9cb03aa614b59ab98d2d8c11f343d38d1)
(cherry picked from commit 1f6ad8f465819cc6adb8061845822398a33e14e1)
(cherry picked from commit c330afdba3354ff59591bd07046b6993bfeea777)
(cherry picked from commit b1f87075a79c8e0d1a8626958f90bfee4d003de1)
(cherry picked from commit 7da40992cc82d719094a748339c385fbc1251afe)
(cherry picked from commit 7ab19ff5e528b9e1ef53e95639022facca70466e)
(cherry picked from commit e61e44921bbabc7ba12da51afde1c6fe8203679b)
(cherry picked from commit 83646119fb8af975a114601ee7bbaf7c5d25f93f)
(cherry picked from commit 20cf748e61f35378745629dcb38b459818c8ad52)
(cherry picked from commit 0a99919cec90dc1374c67199a0bbb90e7f8c7525)
(cherry picked from commit 21215222a6d036551dca0b54a09c388845c3565f)
(cherry picked from commit 0f6c5658d77fe47d4c67b327190f88af829905da)
(cherry picked from commit 1752e43d3c0d71533680d2dcbcbb056d0c91371e)
(cherry picked from commit 2332080929c9eb65d512956773bf7ac821fa6736)
(cherry picked from commit 590aabf2a2a47f4a5a53a9d0b8b12486f5998400)
(cherry picked from commit 87d8b7b315c3e25bd3fcf9dc9c1d359bcd107281)
(cherry picked from commit ff37de38be04b8c1ca6f04b4ef5566c9f9a125ad)
(cherry picked from commit cee32c9e7ab58af6cb07109df4b88420c30c6156)
(cherry picked from commit 39faade524215d5527c5d24e90a9be62aa40f422)
(cherry picked from commit 0e5ca477b6e7ae926cd32454a6ed372b83626b34)
(cherry picked from commit 70e2730f7b2efe4c2ee9ef047583bf9ee5eed409)
(cherry picked from commit 2ad4003944e0d32d1e45b9276316e189f9b5b176)
(cherry picked from commit 2429de9e87e3fdbfa2df8741c9400e9f056ef124)
(cherry picked from commit c133915fc1a4eb8aa1e4766e720e47de14db0d61)
(cherry picked from commit c607dcaf9f01e454921e07b758bdde1c4dba5504)
(cherry picked from commit 86cb6347111ee3a4eef4a3dd87034765565563e2)
(cherry picked from commit ab96f8765e5704104cd38a452148aa22df89972e)
(cherry picked from commit cbf70f71d06ce98c2988f8d3e884760970bc8f20)
(cherry picked from commit 0e61fc89aa386c099fac2906442d7d9c9702d7bc)
(cherry picked from commit 781ae4384efc165d43f916449f569054ef193286)
(cherry picked from commit 271410a9da096ae96dd9a4b3fbb4a654aba004dc)
2023-11-13 11:52:15 +01:00
Earl Warren 16279d7922
[CLI] implement forgejo-cli
(cherry picked from commit 2555e315f7561302484b15576d34c5da0d4cdb12)
(cherry picked from commit 51b9c9092e21a451695ee0154e7d49753574f525)

[CLI] implement forgejo-cli (squash) support initDB

(cherry picked from commit 5c31ae602a45f1d9a90b86bece5393bc9faddf25)
(cherry picked from commit bbf76489a73bad83d68ca7c8e7a75cf8e27b2198)

Conflicts:
	because of d0dbe52e76
	upgrade to https://pkg.go.dev/github.com/urfave/cli/v2
(cherry picked from commit b6c1bcc008fcff0e297d570a0069bf41bc74e53d)

[CLI] implement forgejo-cli actions

(cherry picked from commit 08be2b226e46d9f41e08f66e936b317bcfb4a257)
(cherry picked from commit b6cfa88c6e2ae00e30c832ce4cf93c9e3f2cd6e4)
(cherry picked from commit 59704200de59b65a4f37c39569a3b43e1ee38862)

[CLI] implement forgejo-cli actions generate-secret

(cherry picked from commit 6f7905c8ecf17d5f74ac9a71a453d6768c212b6d)
(cherry picked from commit e085d6d2737e6238a4ff00f19f40cf839ac16b34)

[CLI] implement forgejo-cli actions generate-secret (squash) NoInit

(cherry picked from commit 962c944eb20268a394030495c3caab3e3d4bd8b7)

[CLI] implement forgejo-cli actions register

(cherry picked from commit 2f95143000e4ccc94ef14332777b58fe778edbd6)
(cherry picked from commit 42f2f8731e876564b6627a43a248f262f50c04cd)

[CLI] implement forgejo-cli actions register (squash) no private

Do not go through the private API, directly modify the database

(cherry picked from commit 1ba7c0d39d0ecd190b7d9c517bd26af6c84341aa)

[CLI] implement forgejo-cli actions

(cherry picked from commit 6f7905c8ecf17d5f74ac9a71a453d6768c212b6d)
(cherry picked from commit e085d6d2737e6238a4ff00f19f40cf839ac16b34)

[CLI] implement forgejo-cli actions generate-secret (squash) NoInit

(cherry picked from commit 962c944eb20268a394030495c3caab3e3d4bd8b7)
(cherry picked from commit 4c121ef022597e66d902c17e0f46839c26924b18)

Conflicts:
	cmd/forgejo/actions.go
	tests/integration/cmd_forgejo_actions_test.go
(cherry picked from commit 36997a48e38286579850abe4b55e75a235b56537)

[CLI] implement forgejo-cli actions (squash) restore --version

Refs: https://codeberg.org/forgejo/forgejo/issues/1134
(cherry picked from commit 9739eb52d8f94d32f61068d7209958e8d2582818)

[CI] implement forgejo-cli (squash) the actions subcommand needs config

(cherry picked from commit def638475122a26082ab3835842c84cd03839154)

Conflicts:
	cmd/main.go
	https://codeberg.org/forgejo/forgejo/pulls/1209
(cherry picked from commit a1758a391043123903607338cb11490161ac946d)
(cherry picked from commit 935fa650c77b151752a58f621d846b166b97cd79)
(cherry picked from commit cd21026bc94922043dce8e2a5baba68111d1e569)
(cherry picked from commit 1700b8973a58f0fc3469492d8a39b931019d2461)
(cherry picked from commit 1def42a37945cfe88947803f9afe9468fb8798fe)
(cherry picked from commit 839d97521d59a012b06e6c2b9b0655c56b41b6cd)
(cherry picked from commit fd8c13be6b45f9aa939be482c0a4e5a60c89344c)
(cherry picked from commit 588e5d552f044d91218a07fa46e84259d4892c5d)
(cherry picked from commit 151a726620f662ff9af37316dfda38a6bd6744bb)
(cherry picked from commit a93f3689a831e77f79499c8ea8565309a9158f24)
(cherry picked from commit 1e7bd54b2811c1def868c8cece0fc5c348d9011f)
(cherry picked from commit 7f6015382f7b4e59ff2ee027f2708d3f4420018b)
(cherry picked from commit 31afac5daf5dc421427f57bd5c883810457559bf)
(cherry picked from commit 6df8a604a52544f45460ab9d661a519aa14c3386)
(cherry picked from commit 912492f603cfd2cff294344f8d909aa614330653)
2023-11-13 11:52:15 +01:00
Earl Warren f67fd7b2e8
[CI] DEFAULT_ACTIONS_URL = https://codeberg.org
[CI] Revert "Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581)"

This reverts commit 67bd9d4f1e.

(cherry picked from commit 0547e94023a545fafe82e280dd809e7efd6d86e2)
(cherry picked from commit d21ad654ad0abc243913532326e916899b0e387c)
(cherry picked from commit b905e9d8386c58206234a417769cc17b3be34b62)
(cherry picked from commit 251a5bf235b1723bc2bc324f9e8c03a8668bb5ae)
(cherry picked from commit b370e4769423bec92b0f265f3e3b2b683640024d)
(cherry picked from commit 2cc28d078507027749c14a5448e949ab54b79c66)
(cherry picked from commit ed870a39e98fbb69c435a3a3ef0434fe6163ebe7)
(cherry picked from commit 7bb0c4654ecbbd2feee2c74034c1e2cdca0d6828)
(cherry picked from commit bab1f552c385e3c7d0faa33d28fb8087780ea834)

Conflicts:
	custom/conf/app.example.ini
	modules/setting/actions.go
	https://codeberg.org/forgejo/forgejo/pulls/1413

[CI] DEFAULT_ACTIONS_URL = https://codeberg.org

(cherry picked from commit 52b364ddbd9ac82b9e6f9c1767db2d6b36165011)
(cherry picked from commit 99887cd5673f6da49664b590ad60c83fdbe25a4a)
(cherry picked from commit cd5788782aa5c2ee8baecd57ca1e7882f0854453)
(cherry picked from commit 71c698a704d307c568f247710550d48f27cca4ce)
(cherry picked from commit 71386241dd741a4fa0b67d59a07d84ac31e0b870)
(cherry picked from commit b7ab05aeac12c44acd117d5a4e8d7b4da2ba4aa7)
(cherry picked from commit e78b9ca59c0af867f94d9c9bfae48f8cc9381224)
(cherry picked from commit edb3adf4606af94ed0ab0bd844ef626a39a99297)
(cherry picked from commit 3e400881975340be9148c4549a744395a6dac665)

[BRANDING] DEFAULT_ACTIONS_URL = https://code.forgejo.org

(cherry picked from commit d0e4512c902dec669da36a055a2ea54adb107e0f)
(cherry picked from commit 8ba6e047095e9ecb107d77361664fa83b03ddaa2)
(cherry picked from commit 63490810449b4189ed8538a22182fde1bc89c057)
(cherry picked from commit e06bd444951d1fd94a71ce3d591a8f397f456363)
(cherry picked from commit d58219d8e13f0b4007108d78f8f6f96a1d842c2c)
(cherry picked from commit 052f2c2aa45ae1aa1d59aaf713db4f771f62773b)
(cherry picked from commit 29dc39538631f65eaaf5dcc4eeb747fbc68d7498)
(cherry picked from commit 9eef3f59f3a1347ccc7d6d3704c9f5b40a3b6555)
(cherry picked from commit d650391fedd5b2cac313e29d51cc8689d885a594)
(cherry picked from commit c2e6e8c55d955f1e2b781c983f05319dddcc4386)
(cherry picked from commit e28a47741dc668421989b6b2310365a6611b23b7)

[CI] DEFAULT_ACTIONS_URL support for self & github (squash)

Refs: https://codeberg.org/forgejo/forgejo/issues/1062
(cherry picked from commit 74cc25376ecd1dbab57abffe286ae1f918057cfd)
(cherry picked from commit 405430708ffbebcfd2cefdcdfd24a540985b817c)
(cherry picked from commit 0274a6dee7f383bcd6b65b995b991b5ab0ee635a)
(cherry picked from commit be5cda0fd03b265367c551aefed83456be257075)
(cherry picked from commit d27474849fc4dd4ec958c04b7be06eced8b74d6e)
(cherry picked from commit 4a5e9e2d81f89b5c9e6782d1c24880d62f802d7f)
(cherry picked from commit 65b31906b27c7a6ecaecf74af748e046c51aa7a8)
(cherry picked from commit 13cf0b0963bb110db7229dc5cd4d202e7dec11fb)

Conflicts:
	custom/conf/app.example.ini
	modules/setting/actions.go
	https://codeberg.org/forgejo/forgejo/pulls/1413
(cherry picked from commit 49529badce0a43a07a786b22e2a8705a6a1dbe63)

Conflicts:
	custom/conf/app.example.ini
	docs/content/administration/config-cheat-sheet.en-us.md
	modules/setting/actions.go
	https://codeberg.org/forgejo/forgejo/pulls/1460
(cherry picked from commit 00327b9b1f8512ddb93a07b57fcaee53b701478b)
(cherry picked from commit 3b322e43d5695d540a52259abdde74505241dda9)
(cherry picked from commit 492cc5205908263a2733ba06a6562237406d4c11)
(cherry picked from commit 294ca47a39598ee90b3503030e4d9d56a1c147c1)

Conflicts:
	modules/setting/actions.go
	https://codeberg.org/forgejo/forgejo/pulls/1574
(cherry picked from commit 1ad8ae5946c4302453364b1a33dd41fc35a9090e)
(cherry picked from commit 93f64f5e32551fe53134ee0995f0f1b853fcfa98)
(cherry picked from commit 8f0e65025ccbecb80fde64b7c410d45d534e01d8)
(cherry picked from commit 8d3e4d31fbf1f1d6289ca6ef6e1c3f34ad1b9367)
(cherry picked from commit edc36d5a7d8cfaac8bed540ae3d086c2e2885dd6)
2023-11-13 11:52:15 +01:00
875 changed files with 20727 additions and 5463 deletions

View file

@ -743,7 +743,7 @@ rules:
wc/no-constructor-params: [2]
wc/no-constructor: [2]
wc/no-customized-built-in-elements: [2]
wc/no-exports-with-element: [2]
wc/no-exports-with-element: [0]
wc/no-invalid-element-name: [2]
wc/no-invalid-extends: [2]
wc/no-method-prefixed-with-on: [2]

View file

@ -0,0 +1,154 @@
name: 'Build release'
author: 'Forgejo authors'
description: |
Build release
inputs:
forgejo:
description: 'URL of the Forgejo instance where the release is uploaded'
required: true
owner:
description: 'User or organization where the release is uploaded, relative to the Forgejo instance'
required: true
repository:
description: 'Repository where the release is uploaded, relative to the owner'
required: true
doer:
description: 'Name of the user authoring the release'
required: true
tag-version:
description: 'Version of the release derived from the tag withint the leading v'
required: true
suffix:
description: 'Suffix to add to the image tag'
token:
description: 'token'
required: true
dockerfile:
description: 'path to the dockerfile'
default: 'Dockerfile'
platforms:
description: 'Coma separated list of platforms'
default: 'linux/amd64,linux/arm64'
release-notes:
description: 'Full text of the release notes'
default: 'Release notes placeholder'
binary-name:
description: 'Name of the binary'
binary-path:
description: 'Path of the binary within the container to extract into binary-name'
verbose:
description: 'Increase the verbosity level'
default: 'false'
runs:
using: "composite"
steps:
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- name: Install dependencies
run: |
apt-get install -y -qq xz-utils
- name: set -x if verbose is required
id: verbose
run: |
if ${{ inputs.verbose }} ; then
echo "shell=set -x" >> "$GITHUB_OUTPUT"
fi
- name: Create the insecure and buildx-config variables for the container registry
id: registry
run: |
${{ steps.verbose.outputs.shell }}
url="${{ inputs.forgejo }}"
hostport=${url##http*://}
hostport=${hostport%%/}
echo "host-port=${hostport}" >> "$GITHUB_OUTPUT"
if ! [[ $url =~ ^http:// ]] ; then
exit 0
fi
cat >> "$GITHUB_OUTPUT" <<EOF
insecure=true
buildx-config<<ENDVAR
[registry."${hostport}"]
http = true
ENDVAR
EOF
- name: Allow docker pull/push to forgejo
if: ${{ steps.registry.outputs.insecure }}
run: |-
mkdir -p /etc/docker
cat > /etc/docker/daemon.json <<EOF
{
"insecure-registries" : ["${{ steps.registry.outputs.host-port }}"],
"bip": "172.26.0.1/16"
}
EOF
- name: Install docker
run: |
echo deb http://deb.debian.org/debian bullseye-backports main | tee /etc/apt/sources.list.d/backports.list && apt-get -qq update
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -qq -y -t bullseye-backports docker.io
- uses: https://github.com/docker/setup-buildx-action@v2
with:
config-inline: |
${{ steps.registry.outputs.buildx-config }}
- name: Login to the container registry
run: |
BASE64_AUTH=`echo -n "${{ inputs.doer }}:${{ inputs.token }}" | base64 -w0`
mkdir -p ~/.docker
echo "{\"auths\": {\"$CI_REGISTRY\": {\"auth\": \"$BASE64_AUTH\"}}}" > ~/.docker/config.json
env:
CI_REGISTRY: "${{ steps.registry.outputs.host-port }}"
- name: Build the container image for each architecture
uses: https://github.com/docker/build-push-action@v4
# workaround until https://github.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba is in @v4 or @v5 is released
env:
ACTIONS_RUNTIME_TOKEN: ''
with:
context: .
push: true
file: ${{ inputs.dockerfile }}
platforms: ${{ inputs.platforms }}
tags: ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ inputs.tag-version }}${{ inputs.suffix }}
- name: Extract the binary from the container images into the release directory
if: inputs.binary-name != ''
run: |
${{ steps.verbose.outputs.shell }}
mkdir -p release
cd release
for platform in $(echo ${{ inputs.platforms }} | tr ',' ' '); do
arch=$(echo $platform | sed -e 's|linux/||g' -e 's|arm/v6|arm-6|g')
docker create --platform $platform --name forgejo-$arch ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ inputs.tag-version }}${{ inputs.suffix }}
binary="${{ inputs.binary-name }}-${{ inputs.tag-version }}-linux"
docker cp forgejo-$arch:${{ inputs.binary-path }} $binary-$arch
chmod +x $binary-$arch
# the displayed version has a + instead of the first -, deal with it
pattern=$(echo "${{ inputs.tag-version }}" | tr - .)
if ! ./$binary-$arch --version | grep "$pattern" ; then
echo "ERROR: expected version pattern $pattern not found in the output of $binary-$arch --version"
./$binary-$arch --version
exit 1
fi
xz --keep -9 $binary-$arch
shasum -a 256 $binary-$arch > $binary-$arch.sha256
shasum -a 256 $binary-$arch.xz > $binary-$arch.xz.sha256
docker rm forgejo-$arch
done
- name: publish release
if: inputs.binary-name != ''
uses: https://code.forgejo.org/actions/forgejo-release@v1
with:
direction: upload
release-dir: release
release-notes: "${{ inputs.release-notes }}"
token: ${{ inputs.token }}
verbose: ${{ steps.verbose.outputs.value }}

View file

@ -0,0 +1,110 @@
name: 'Publish release'
author: 'Forgejo authors'
description: |
Publish release
inputs:
forgejo:
description: 'URL of the Forgejo instance where the release is uploaded (e.g. https://codeberg.org)'
required: true
from-owner:
description: 'the owner from which a release is to be copied (e.g forgejo-integration)'
required: true
to-owner:
description: 'the owner to which a release is to be copied (e.g. forgejo-experimental). It has be an organization in which doer has the required permissions. Or be the same as the doer'
required: true
repo:
description: 'the repository from which a release is to be copied relative to from-owner and to-owner'
default: 'forgejo'
ref-name:
description: 'ref_name of the tag of the release to be copied (e.g. github.ref_name)'
required: true
doer:
description: 'Name of the user authoring the release (e.g. release-team). The user must be authorized to create packages in to-owner and releases in to-owner/repo'
required: true
token:
description: 'application token created on forgejo by the doer, with a scope allowing it to create packages in to-owner and releases in to-owner/repo'
required: true
gpg-private-key:
description: 'GPG Private Key to sign the release artifacts'
gpg-passphrase:
description: 'Passphrase of the GPG Private Key'
verbose:
description: 'Increase the verbosity level'
default: 'false'
runs:
using: "composite"
steps:
- id: hostport
run: |
url="${{ inputs.forgejo }}"
hostport=${url##http*://}
hostport=${hostport%%/}
echo "value=$hostport" >> "$GITHUB_OUTPUT"
- id: tag-version
run: |
version="${{ inputs.ref-name }}"
version=${version##*v}
echo "value=$version" >> "$GITHUB_OUTPUT"
- name: Create the release notes
id: release-notes
run: |
anchor=${{ steps.tag-version.outputs.value }}
anchor=${anchor//./-}
cat >> "$GITHUB_OUTPUT" <<EOF
value<<ENDVAR
See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#$anchor
ENDVAR
EOF
- name: apt-get install docker.io
run: |
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -qq -y docker.io
- name: download release
uses: https://code.forgejo.org/actions/forgejo-release@v1
with:
url: ${{ inputs.forgejo }}
repo: ${{ inputs.from-owner }}/${{ inputs.repo }}
direction: download
release-dir: release
download-retry: 60
token: ${{ inputs.token }}
verbose: ${{ inputs.verbose }}
- name: upload release
uses: https://code.forgejo.org/actions/forgejo-release@v1
with:
url: ${{ inputs.forgejo }}
repo: ${{ inputs.to-owner }}/${{ inputs.repo }}
direction: upload
release-dir: release
release-notes: ${{ steps.release-notes.outputs.value }}
token: ${{ inputs.token }}
gpg-private-key: ${{ inputs.gpg-private-key }}
gpg-passphrase: ${{ inputs.gpg-passphrase }}
verbose: ${{ inputs.verbose }}
- name: login to the registry
uses: https://github.com/docker/login-action@v2
with:
registry: ${{ steps.hostport.outputs.value }}
username: ${{ inputs.doer }}
password: ${{ inputs.token }}
- uses: https://code.forgejo.org/forgejo/forgejo-container-image@v1
env:
VERIFY: 'false'
with:
url: https://${{ steps.hostport.outputs.value }}
destination-owner: ${{ inputs.to-owner }}
owner: ${{ inputs.from-owner }}
suffixes: '-rootless'
project: ${{ inputs.repo }}
tag: ${{ steps.tag-version.outputs.value }}
doer: ${{ inputs.doer }}
token: ${{ inputs.token }}
verbose: ${{ inputs.verbose }}

View file

@ -0,0 +1,3 @@
FROM public.ecr.aws/docker/library/alpine:3.18
RUN mkdir -p /app/gitea
RUN ( echo '#!/bin/sh' ; echo "echo forgejo v1.2.3" ) > /app/gitea/gitea ; chmod +x /app/gitea/gitea

View file

@ -0,0 +1,5 @@
VERSION ?= $(shell cat VERSION 2>/dev/null)
sources-tarbal:
mkdir -p dist/release
echo $(VERSION) > VERSION
sources=forgejo-src-$(VERSION).tar.gz ; tar --transform 's|^./|forgejo-src-$(VERSION)/|' -czf dist/release/forgejo-src-$(VERSION).tar.gz . ; cd dist/release ; shasum -a 256 $$sources > $$sources.sha256

View file

@ -0,0 +1,30 @@
RUN_MODE = prod
WORK_PATH = ${WORK_PATH}
[server]
APP_DATA_PATH = ${WORK_PATH}/data
HTTP_PORT = 3000
SSH_LISTEN_PORT = 2222
LFS_START_SERVER = true
[database]
DB_TYPE = sqlite3
PATH = ${WORK_PATH}/forgejo.db
[log]
MODE = file
LEVEL = trace
ROUTER = file
[log.file]
FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[actions]
ENABLED = true

View file

@ -0,0 +1,187 @@
#!/bin/bash
# SPDX-License-Identifier: MIT
#ONEPIXEL="iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
#
# one pixel scaled to 290x290 because that's what versions lower or equal to v1.19.4-0 want
# by default and any other size will be transformed which make it difficult to compare.
#
ONEPIXEL="iVBORw0KGgoAAAANSUhEUgAAASIAAAEiCAYAAABdvt+2AAADrElEQVR4nOzUMRHAMADEsL9eeQd6AsOLhMCT/7udAYS+OgDAiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDOiICcEQE5IwJyRgTkjAjIGRGQMyIgZ0RAzoiAnBEBOSMCckYE5IwIyBkRkDMiIGdEQM6IgJwRATkjAnJGBOSMCMgZEZAzIiBnREDuBQAA//+4jAPFe1H1tgAAAABJRU5ErkJggg=="
function fixture_get_paths_s3() {
local path=$1
(
echo -n $path/
mc ls --quiet --recursive testS3/$path | sed -e 's/.* //'
) > $DIR/path
}
function fixture_get_paths_local() {
local path=$1
local work_path=$DIR/forgejo-work-path
( cd $work_path ; find $path -type f) > $DIR/path
}
function fixture_get_one_path() {
local storage=$1
local path=$2
fixture_get_paths_$storage $path
if test $(wc -l < $DIR/path) != 1 ; then
echo expected one path but got
cat $DIR/path
return 1
fi
cat $DIR/path
}
function fixture_repo_archive_create() {
retry curl -f -sS http://${HOST_PORT}/root/fixture/archive/main.zip -o /dev/null
}
function fixture_repo_archive_assert_s3() {
mc ls --recursive testS3/forgejo/repo-archive | grep --quiet '.zip$'
}
function fixture_repo_archive_assert_local() {
local path=$1
local work_path=$DIR/forgejo-work-path
find $work_path/$path | grep --quiet '.zip$'
}
function fixture_lfs_create() {
(
cd $DIR/fixture
git lfs track "*.txt"
echo CONTENT > file.txt
git add .
git commit -m 'lfs files'
git push
)
}
function fixture_lfs_assert_s3() {
local content=$(mc cat testS3/forgejo/lfs/d6/1e/5fa787e50330288923bd0c9866b44643925965144262288447cf52f9f9b7)
test "$content" = CONTENT
}
function fixture_lfs_assert_local() {
local path=$1
local work_path=$DIR/forgejo-work-path
local content=$(mc cat $work_path/$path/d6/1e/5fa787e50330288923bd0c9866b44643925965144262288447cf52f9f9b7)
test "$content" = CONTENT
}
function fixture_packages_create() {
echo PACKAGE_CONTENT > $DIR/fixture/package
$work_path/forgejo-api -X DELETE http://${HOST_PORT}/api/packages/${FORGEJO_USER}/generic/test_package/1.0.0/file.txt || true
$work_path/forgejo-api --upload-file $DIR/fixture/package http://${HOST_PORT}/api/packages/${FORGEJO_USER}/generic/test_package/1.0.0/file.txt
}
function fixture_packages_assert_s3() {
local content=$(mc cat testS3/forgejo/packages/aa/cf/aacf02e660d813e95d2854e27926ba1ad5c87299dc5f7661d5f08f076c6bbc17)
test "$content" = PACKAGE_CONTENT
}
function fixture_packages_assert_local() {
local path=$1
local content=$(cat $work_path/$path/aa/cf/aacf02e660d813e95d2854e27926ba1ad5c87299dc5f7661d5f08f076c6bbc17)
test "$content" = PACKAGE_CONTENT
}
function fixture_avatars_create() {
echo -n $ONEPIXEL | base64 --decode > $DIR/avatar.png
$work_path/forgejo-client --form avatar=@$DIR/avatar.png http://${HOST_PORT}/user/settings/avatar
}
function fixture_avatars_assert_s3() {
local filename=$(fixture_get_one_path s3 forgejo/avatars)
local content=$(mc cat testS3/$filename | base64 -w0)
test "$content" = "$ONEPIXEL"
}
function fixture_avatars_assert_local() {
local path=$1
local filename=$(fixture_get_one_path local $path)
local content=$(cat $work_path/$filename | base64 -w0)
test "$content" = "$ONEPIXEL"
}
function fixture_repo_avatars_create() {
echo -n $ONEPIXEL | base64 --decode > $DIR/repo-avatar.png
$work_path/forgejo-client --form avatar=@$DIR/repo-avatar.png http://${HOST_PORT}/${FORGEJO_USER}/${FORGEJO_REPO}/settings/avatar
# v1.21 only
#$work_path/forgejo-api -X POST --data-raw '{"body":"'$avatar'"}' http://${HOST_PORT}/api/v1/repos/${FORGEJO_USER}/${FORGEJO_REPO}/avatar
}
function fixture_repo_avatars_assert_s3() {
local filename=$(fixture_get_one_path s3 forgejo/repo-avatars)
local content=$(mc cat testS3/$filename | base64 -w0)
test "$content" = "$ONEPIXEL"
}
function fixture_repo_avatars_assert_local() {
local path=$1
local filename=$(fixture_get_one_path local $path)
local content=$(cat $work_path/$filename | base64 -w0)
test "$content" = "$ONEPIXEL"
}
function fixture_attachments_create_1_18() {
echo -n $ONEPIXEL | base64 --decode > $DIR/attachment.png
$work_path/forgejo-client --trace-ascii - --form file=@$DIR/attachment.png http://${HOST_PORT}/${FORGEJO_USER}/${FORGEJO_REPO}/issues/attachments
}
function fixture_attachments_create() {
if $work_path/forgejo-api http://${HOST_PORT}/api/v1/version | grep --quiet --fixed-strings 1.18. ; then
fixture_attachments_create_1_18
return
fi
id=$($work_path/forgejo-api --data-raw '{"title":"TITLE"}' http://${HOST_PORT}/api/v1/repos/${FORGEJO_USER}/${FORGEJO_REPO}/issues | jq .id)
echo -n $ONEPIXEL | base64 --decode > $DIR/attachment.png
$work_path/forgejo-client -H @$DIR/forgejo-work-path/forgejo-header --form name=attachment.png --form attachment=@$DIR/attachment.png http://${HOST_PORT}/api/v1/repos/${FORGEJO_USER}/${FORGEJO_REPO}/issues/$id/assets
}
function fixture_attachments_assert_s3() {
local filename=$(fixture_get_one_path s3 forgejo/attachments)
local content=$(mc cat testS3/$filename | base64 -w0)
test "$content" = "$ONEPIXEL"
}
function fixture_attachments_assert_local() {
local path=$1
local filename=$(fixture_get_one_path local $path)
local content=$(cat $work_path/$filename | base64 -w0)
test "$content" = "$ONEPIXEL"
}
function fixture_create() {
local work_path=$DIR/forgejo-work-path
rm -fr $DIR/fixture
mkdir -p $DIR/fixture
(
cd $DIR/fixture
git init
git checkout -b main
git remote add origin http://${FORGEJO_USER}:${FORGEJO_PASSWORD}@${HOST_PORT}/${FORGEJO_USER}/${FORGEJO_REPO}
git config user.email root@example.com
git config user.name username
echo SOMETHING > README
git add README
git commit -m 'initial commit'
git push --set-upstream --force origin main
)
for fun in ${STORAGE_FUN} ; do
fixture_${fun}_create
done
}

View file

@ -0,0 +1,32 @@
RUN_MODE = prod
WORK_PATH = ${WORK_PATH}
[server]
APP_DATA_PATH = ${WORK_PATH}/data
HTTP_PORT = 3000
SSH_LISTEN_PORT = 2222
LFS_START_SERVER = true
LFS_CONTENT_PATH = relative-lfs
[database]
DB_TYPE = sqlite3
PATH = ${WORK_PATH}/forgejo.db
[log]
MODE = file
LEVEL = debug
ROUTER = file
[log.file]
FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[picture]
AVATAR_UPLOAD_PATH = relative-avatars
REPOSITORY_AVATAR_UPLOAD_PATH = relative-repo-avatars

View file

@ -0,0 +1,32 @@
RUN_MODE = prod
WORK_PATH = ${WORK_PATH}
[server]
APP_DATA_PATH = ${WORK_PATH}/data
HTTP_PORT = 3000
SSH_LISTEN_PORT = 2222
LFS_START_SERVER = true
[database]
DB_TYPE = sqlite3
[log]
MODE = file
LEVEL = debug
ROUTER = file
[log.file]
FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[actions]
ENABLED = true
[storage]
PATH = ${WORK_PATH}/merged

View file

@ -0,0 +1,59 @@
RUN_MODE = prod
WORK_PATH = ${WORK_PATH}
[server]
APP_DATA_PATH = ${WORK_PATH}/elsewhere
HTTP_PORT = 3000
SSH_LISTEN_PORT = 2222
LFS_START_SERVER = true
[database]
DB_TYPE = sqlite3
[log]
MODE = file
LEVEL = debug
ROUTER = file
[log.file]
FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[actions]
ENABLED = true
[attachment]
[storage.attachments]
PATH = ${WORK_PATH}/data/attachments
[lfs]
[storage.lfs]
PATH = ${WORK_PATH}/data/lfs
[avatar]
[storage.avatars]
PATH = ${WORK_PATH}/data/avatars
[repo-avatar]
[storage.repo-avatars]
PATH = ${WORK_PATH}/data/repo-avatars
[repo-archive]
[storage.repo-archive]
PATH = ${WORK_PATH}/data/repo-archive
[packages]
[storage.packages]
PATH = ${WORK_PATH}/data/packages

View file

@ -0,0 +1,89 @@
RUN_MODE = prod
WORK_PATH = ${WORK_PATH}
[server]
APP_DATA_PATH = ${WORK_PATH}/elsewhere
HTTP_PORT = 3000
SSH_LISTEN_PORT = 2222
LFS_START_SERVER = true
[database]
DB_TYPE = sqlite3
[log]
MODE = file
LEVEL = debug
ROUTER = file
[log.file]
FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[actions]
ENABLED = true
[attachment]
STORAGE_TYPE = minio
SERVE_DIRECT = false
MINIO_ENDPOINT = 127.0.0.1:9000
MINIO_ACCESS_KEY_ID = 123456
MINIO_SECRET_ACCESS_KEY = 12345678
MINIO_BUCKET = forgejo
MINIO_LOCATION = us-east-1
MINIO_USE_SSL = false
[lfs]
STORAGE_TYPE = minio
SERVE_DIRECT = false
MINIO_ENDPOINT = 127.0.0.1:9000
MINIO_ACCESS_KEY_ID = 123456
MINIO_SECRET_ACCESS_KEY = 12345678
MINIO_BUCKET = forgejo
MINIO_LOCATION = us-east-1
MINIO_USE_SSL = false
[repo-avatar]
STORAGE_TYPE = minio
SERVE_DIRECT = false
MINIO_ENDPOINT = 127.0.0.1:9000
MINIO_ACCESS_KEY_ID = 123456
MINIO_SECRET_ACCESS_KEY = 12345678
MINIO_BUCKET = forgejo
MINIO_LOCATION = us-east-1
MINIO_USE_SSL = false
[avatar]
STORAGE_TYPE = minio
SERVE_DIRECT = false
MINIO_ENDPOINT = 127.0.0.1:9000
MINIO_ACCESS_KEY_ID = 123456
MINIO_SECRET_ACCESS_KEY = 12345678
MINIO_BUCKET = forgejo
MINIO_LOCATION = us-east-1
MINIO_USE_SSL = false
[repo-archive]
STORAGE_TYPE = minio
SERVE_DIRECT = false
MINIO_ENDPOINT = 127.0.0.1:9000
MINIO_ACCESS_KEY_ID = 123456
MINIO_SECRET_ACCESS_KEY = 12345678
MINIO_BUCKET = forgejo
MINIO_LOCATION = us-east-1
MINIO_USE_SSL = false
[packages]
STORAGE_TYPE = minio
SERVE_DIRECT = false
MINIO_ENDPOINT = 127.0.0.1:9000
MINIO_ACCESS_KEY_ID = 123456
MINIO_SECRET_ACCESS_KEY = 12345678
MINIO_BUCKET = forgejo
MINIO_LOCATION = us-east-1
MINIO_USE_SSL = false

View file

@ -0,0 +1,44 @@
RUN_MODE = prod
WORK_PATH = ${WORK_PATH}
[server]
APP_DATA_PATH = ${WORK_PATH}/data
HTTP_PORT = 3000
SSH_LISTEN_PORT = 2222
LFS_START_SERVER = true
[database]
DB_TYPE = sqlite3
[log]
MODE = file
LEVEL = debug
ROUTER = file
[log.file]
FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[attachment]
PATH = relative-attachments
[lfs]
PATH = relative-lfs
[avatar]
PATH = relative-avatars
[repo-avatar]
PATH = relative-repo-avatars
[repo-archive]
PATH = relative-repo-archive
[packages]
PATH = relative-packages

View file

@ -0,0 +1,47 @@
RUN_MODE = prod
WORK_PATH = ${WORK_PATH}
[server]
APP_DATA_PATH = ${WORK_PATH}/elsewhere
HTTP_PORT = 3000
SSH_LISTEN_PORT = 2222
LFS_START_SERVER = true
[database]
DB_TYPE = sqlite3
[log]
MODE = file
LEVEL = debug
ROUTER = file
[log.file]
FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[actions]
ENABLED = true
[attachment]
PATH = ${WORK_PATH}/data/attachments
[lfs]
PATH = ${WORK_PATH}/data/lfs
[avatar]
PATH = ${WORK_PATH}/data/avatars
[repo-avatar]
PATH = ${WORK_PATH}/data/repo-avatars
[repo-archive]
PATH = ${WORK_PATH}/data/repo-archive
[packages]
PATH = ${WORK_PATH}/data/packages

View file

@ -0,0 +1,39 @@
RUN_MODE = prod
WORK_PATH = ${WORK_PATH}
[server]
APP_DATA_PATH = ${WORK_PATH}/elsewhere
HTTP_PORT = 3000
SSH_LISTEN_PORT = 2222
LFS_START_SERVER = true
[database]
DB_TYPE = sqlite3
[log]
MODE = file
LEVEL = debug
ROUTER = file
[log.file]
FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[actions]
ENABLED = true
[storage]
STORAGE_TYPE = minio
SERVE_DIRECT = false
MINIO_ENDPOINT = 127.0.0.1:9000
MINIO_ACCESS_KEY_ID = 123456
MINIO_SECRET_ACCESS_KEY = 12345678
MINIO_BUCKET = forgejo
MINIO_LOCATION = us-east-1
MINIO_USE_SSL = false

View file

@ -0,0 +1,44 @@
RUN_MODE = prod
WORK_PATH = ${WORK_PATH}
[server]
APP_DATA_PATH = ${WORK_PATH}/data
HTTP_PORT = 3000
SSH_LISTEN_PORT = 2222
LFS_START_SERVER = true
[database]
DB_TYPE = sqlite3
[log]
MODE = file
LEVEL = debug
ROUTER = file
[log.file]
FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[storage.attachments]
PATH = relative-attachments
[storage.lfs]
PATH = relative-lfs
[storage.avatars]
PATH = relative-avatars
[storage.repo-avatars]
PATH = relative-repo-avatars
[storage.repo-archive]
PATH = relative-repo-archive
[storage.packages]
PATH = relative-packages

629
.forgejo/upgrades/test-upgrade.sh Executable file
View file

@ -0,0 +1,629 @@
#!/bin/bash
# SPDX-License-Identifier: MIT
#
# Debug loop from the source tree:
#
# ./.forgejo/upgrades/test-upgrade.sh dependencies
# ./.forgejo/upgrades/test-upgrade.sh build_all
# VERBOSE=true ./.forgejo/upgrades/test-upgrade.sh test_downgrade_1.20.2_fails
#
# Everything happens in /tmp/forgejo-upgrades
#
PREFIX===============
HOST_PORT=0.0.0.0:3000
STORAGE_PATHS="attachments avatars lfs packages repo-archive repo-avatars"
STORAGE_FUN="attachments avatars lfs packages repo_archive repo_avatars"
DIR=/tmp/forgejo-upgrades
if ${VERBOSE:-false} ; then
set -ex
PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: '
else
set -e
fi
SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: ${FORGEJO_USER:=root}
: ${FORGEJO_REPO:=fixture}
: ${FORGEJO_PASSWORD:=admin1234}
source $SELF_DIR/fixtures.sh
function maybe_sudo() {
if test $(id -u) != 0 ; then
SUDO=sudo
fi
}
function log_info() {
echo "$PREFIX $@"
}
function dependencies() {
maybe_sudo
if ! which curl daemon jq git-lfs > /dev/null ; then
$SUDO apt-get install -y -qq curl daemon git-lfs jq sqlite3
fi
if ! test -f /usr/local/bin/mc || ! test -f /usr/local/bin/minio > /dev/null ; then
$SUDO curl --fail -sS https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc
$SUDO curl --fail -sS https://dl.min.io/server/minio/release/linux-amd64/minio -o /usr/local/bin/minio
fi
if ! test -x /usr/local/bin/mc || ! test -x /usr/local/bin/minio > /dev/null ; then
$SUDO chmod +x /usr/local/bin/mc
$SUDO chmod +x /usr/local/bin/minio
fi
if ! test -f /usr/local/bin/garage > /dev/null ; then
$SUDO curl --fail -sS https://garagehq.deuxfleurs.fr/_releases/v0.8.2/x86_64-unknown-linux-musl/garage -o /usr/local/bin/garage
fi
if ! test -x /usr/local/bin/garage > /dev/null ; then
$SUDO chmod +x /usr/local/bin/garage
fi
}
function build() {
local version=$1
local semver=$2
if ! test -f $DIR/forgejo-$version ; then
mkdir -p $DIR
make VERSION=v$version GITEA_VERSION=v$version FORGEJO_VERSION=$semver TAGS='bindata sqlite sqlite_unlock_notify' generate gitea
mv gitea $DIR/forgejo-$version
fi
}
function build_all() {
test -f Makefile
build 1.21.0-0 6.0.0+0-gitea-1.21.0
}
function retry() {
rm -f $DIR/wait-for.out
success=false
for delay in 1 1 5 5 15 ; do
if "$@" >> $DIR/wait-for.out 2>&1 ; then
success=true
break
fi
cat $DIR/wait-for.out
echo waiting $delay
sleep $delay
done
if test $success = false ; then
cat $DIR/wait-for.out
return 1
fi
}
function download() {
local version=$1
if ! test -f $DIR/forgejo-$version ; then
mkdir -p $DIR
for owner in forgejo forgejo-experimental forgejo-integration ; do
if wget -O $DIR/forgejo-$version --quiet https://codeberg.org/$owner/forgejo/releases/download/v$version/forgejo-$version-linux-amd64 ; then
break
fi
done
chmod +x $DIR/forgejo-$version
fi
}
function cleanup_logs() {
local work_path=$DIR/forgejo-work-path
rm -f $DIR/*.log
rm -f $work_path/log/*.log
}
function clobber() {
rm -fr /tmp/forgejo-upgrades
}
function start_forgejo() {
local version=$1
download $version
local work_path=$DIR/forgejo-work-path
daemon --chdir=$DIR --unsafe --env="TERM=$TERM" --env="HOME=$HOME" --env="PATH=$PATH" --pidfile=$DIR/forgejo-pid --errlog=$DIR/forgejo-err.log --output=$DIR/forgejo-out.log -- $DIR/forgejo-$version --config $work_path/app.ini --work-path $work_path
if ! retry grep 'Starting server on' $work_path/log/forgejo.log ; then
cat $DIR/*.log
cat $work_path/log/*.log
return 1
fi
create_user $version
}
function start_minio() {
mkdir -p $DIR/minio
daemon --chdir=$DIR --unsafe \
--env="PATH=$PATH" \
--env=MINIO_ROOT_USER=123456 \
--env=MINIO_ROOT_PASSWORD=12345678 \
--env=MINIO_VOLUMES=$DIR/minio \
--pidfile=$DIR/minio-pid --errlog=$DIR/minio-err.log --output=$DIR/minio-out.log -- /usr/local/bin/minio server
retry mc alias set testS3 http://127.0.0.1:9000 123456 12345678
}
function start_garage() {
mkdir -p $DIR/garage/{data,meta}
cat > $DIR/garage/garage.toml <<EOF
metadata_dir = "$DIR/garage/meta"
data_dir = "$DIR/garage/data"
db_engine = "lmdb"
replication_mode = "none"
rpc_bind_addr = "127.0.0.1:3901"
rpc_public_addr = "127.0.0.1:3901"
rpc_secret = "$(openssl rand -hex 32)"
[s3_api]
s3_region = "us-east-1"
api_bind_addr = "127.0.0.1:9000"
root_domain = ".s3.garage.localhost"
[s3_web]
bind_addr = "127.0.0.1:3902"
root_domain = ".web.garage.localhost"
index = "index.html"
[k2v_api]
api_bind_addr = "127.0.0.1:3904"
[admin]
api_bind_addr = "127.0.0.1:3903"
admin_token = "$(openssl rand -base64 32)"
EOF
daemon --chdir=$DIR --unsafe \
--env="PATH=$PATH" \
--env=RUST_LOG=garage_api=debug \
--pidfile=$DIR/garage-pid --errlog=$DIR/garage-err.log --output=$DIR/garage-out.log -- /usr/local/bin/garage -c $DIR/garage/garage.toml server
retry garage -c $DIR/garage/garage.toml status
garage -c $DIR/garage/garage.toml layout assign -z dc1 -c 1 $(garage -c $DIR/garage/garage.toml status | tail -1 | grep -o '[0-9a-z]*' | head -1)
ver=$(garage -c $DIR/garage/garage.toml layout show | grep -oP '(?<=Current cluster layout version: )\d+')
garage -c $DIR/garage/garage.toml layout apply --version $((ver+1))
garage -c $DIR/garage/garage.toml key info test || garage -c $DIR/garage/garage.toml key import -n test 123456 12345678
garage -c $DIR/garage/garage.toml key allow --create-bucket test
retry mc alias set testS3 http://127.0.0.1:9000 123456 12345678
}
function start_s3() {
local s3_backend=$1
start_$s3_backend
}
function start() {
local version=$1
local s3_backend=${2:-minio}
start_s3 $s3_backend
start_forgejo $version
}
function create_user() {
local version=$1
local work_path=$DIR/forgejo-work-path
if test -f $work_path/forgejo-token; then
return
fi
local cli="$DIR/forgejo-$version --config $work_path/app.ini --work-path $work_path"
$cli admin user create --admin --username "$FORGEJO_USER" --password "$FORGEJO_PASSWORD" --email "$FORGEJO_USER@example.com"
local scopes="--scopes all"
if echo $version | grep --quiet 1.18. ; then
scopes=""
fi
#
# forgejo-cli is to use with api/v1 enpoints
#
# tail -1 is because there are logs creating noise in the output in v1.19.4-0
#
$cli admin user generate-access-token -u $FORGEJO_USER --raw $scopes | tail -1 > $work_path/forgejo-token
( echo -n 'Authorization: token ' ; cat $work_path/forgejo-token ) > $work_path/forgejo-header
( echo "#!/bin/sh" ; echo 'curl -f -sS -H "Content-Type: application/json" -H @'$work_path/forgejo-header' "$@"' ) > $work_path/forgejo-api && chmod +x $work_path/forgejo-api
$work_path/forgejo-api http://${HOST_PORT}/api/v1/version
#
# forgejo-client is to use with web endpoints
#
#
# login and obtain a CSRF, all stored in the cookie file
#
( echo "#!/bin/sh" ; echo 'curl --cookie-jar '$DIR/cookies' --cookie '$DIR/cookies' -f -sS "$@"' ) > $work_path/forgejo-client-update-cookies && chmod +x $work_path/forgejo-client-update-cookies
$work_path/forgejo-client-update-cookies http://${HOST_PORT}/user/login -o /dev/null
$work_path/forgejo-client-update-cookies --verbose -X POST --data user_name=${FORGEJO_USER} --data password=${FORGEJO_PASSWORD} http://${HOST_PORT}/user/login >& $DIR/login.html
$work_path/forgejo-client-update-cookies http://${HOST_PORT}/user/login -o /dev/null
local csrf=$(sed -n -e '/csrf/s/.*csrf\t//p' $DIR/cookies)
#
# use the cookie file but do not modify it
#
( echo "#!/bin/sh" ; echo 'curl --cookie '$DIR/cookies' -H "X-Csrf-Token: '$csrf'" -f -sS "$@"' ) > $work_path/forgejo-client && chmod +x $work_path/forgejo-client
}
function stop_daemon() {
local daemon=$1
if test -f $DIR/$daemon-pid ; then
local pid=$(cat $DIR/$daemon-pid)
kill -TERM $pid
pidwait $pid || true
for delay in 1 1 2 2 5 5 ; do
if ! test -f $DIR/$daemon-pid ; then
break
fi
sleep $delay
done
! test -f $DIR/$daemon-pid
fi
}
function stop() {
stop_daemon forgejo
stop_daemon minio
stop_daemon garage
cleanup_logs
}
function reset_forgejo() {
local config=$1
local work_path=$DIR/forgejo-work-path
rm -fr $work_path
mkdir -p $work_path
WORK_PATH=$work_path envsubst < $SELF_DIR/$config-app.ini > $work_path/app.ini
}
function reset_minio() {
rm -fr $DIR/minio
}
function reset_garage() {
rm -fr $DIR/garage
}
function reset() {
local config=$1
reset_forgejo $config
reset_minio
reset_garage
}
function verify_storage() {
local work_path=$DIR/forgejo-work-path
for path in ${STORAGE_PATHS} ; do
test -d $work_path/data/$path
done
}
function cleanup_storage() {
local work_path=$DIR/forgejo-work-path
for path in ${STORAGE_PATHS} ; do
rm -fr $work_path/data/$path
done
}
function test_downgrade_1.20.2_fails() {
local work_path=$DIR/forgejo-work-path
log_info "See also https://codeberg.org/forgejo/forgejo/pulls/1225"
log_info "downgrading from 1.20.3-0 to 1.20.2-0 fails"
stop
reset default
start 1.20.3-0
stop
download 1.20.2-0
timeout 60 $DIR/forgejo-1.20.2-0 --config $work_path/app.ini --work-path $work_path || true
if ! grep --fixed-strings --quiet 'use the newer database' $work_path/log/forgejo.log ; then
cat $work_path/log/forgejo.log
return 1
fi
}
function test_bug_storage_merged() {
local work_path=$DIR/forgejo-work-path
log_info "See also https://codeberg.org/forgejo/forgejo/pulls/1225"
log_info "using < 1.20.3-0 and [storage].PATH merge all storage"
for version in 1.18.5-0 1.19.4-0 1.20.2-0 ; do
stop
reset merged
start $version
for path in ${STORAGE_PATHS} ; do
! test -d $work_path/data/$path
done
for path in ${STORAGE_PATHS} ; do
! test -d $work_path/merged/$path
done
test -d $work_path/merged
done
stop
log_info "upgrading from 1.20.2-0 with [storage].PATH fails"
download 1.20.3-0
timeout 60 $DIR/forgejo-1.20.3-0 --config $work_path/app.ini --work-path $work_path || true
if ! grep --fixed-strings --quiet '[storage].PATH is set and may create storage issues' $work_path/log/forgejo.log ; then
cat $work_path/log/forgejo.log
return 1
fi
}
function test_bug_storage_relative_path() {
local work_path=$DIR/forgejo-work-path
log_info "using < 1.20.3-0 legacy [server].XXXX and [picture].XXXX are relative to WORK_PATH"
for version in 1.18.5-0 1.19.4-0 1.20.2-0 ; do
stop
reset legagy-relative
start $version
test -d $work_path/relative-lfs
test -d $work_path/relative-avatars
test -d $work_path/relative-repo-avatars
done
log_info "using >= 1.20.3-0 legacy [server].XXXX and [picture].XXXX are relative to APP_DATA_PATH"
for version in 1.20.3-0 1.21.0-0 ; do
stop
reset legagy-relative
start $version
test -d $work_path/data/relative-lfs
test -d $work_path/data/relative-avatars
test -d $work_path/data/relative-repo-avatars
done
log_info "using >= 1.20.3-0 relative [storage.XXXX].PATHS are relative to APP_DATA_PATH"
for version in 1.20.3-0 1.21.0-0 ; do
stop
reset storage-relative
start $version
for path in ${STORAGE_PATHS} ; do
test -d $work_path/data/relative-$path
done
done
log_info "using 1.20.[12]-0 relative [storage.XXXX].PATHS are inconsistent"
for version in 1.20.2-0 ; do
stop
reset storage-relative
start $version
test -d $work_path/data/packages
test -d $work_path/relative-repo-archive
test -d $work_path/relative-attachments
test -d $work_path/relative-lfs
test -d $work_path/data/avatars
test -d $work_path/data/repo-avatars
done
log_info "using < 1.20 relative [storage.XXXX].PATHS are inconsistent"
for version in 1.18.5-0 1.19.4-0 ; do
stop
reset storage-relative
start $version
test -d $work_path/relative-packages
test -d $work_path/relative-repo-archive
test -d $work_path/relative-attachments
test -d $work_path/data/lfs
test -d $work_path/data/avatars
test -d $work_path/data/repo-avatars
done
log_info "using < 1.20.3-0 relative [XXXX].PATHS are relative to WORK_PATH"
for version in 1.18.5-0 1.19.4-0 1.20.2-0 ; do
stop
reset relative
start $version
for path in ${STORAGE_PATHS} ; do
test -d $work_path/relative-$path
done
done
log_info "using >= 1.20.3-0 relative [XXXX].PATHS are relative to APP_DATA_PATH"
for version in 1.20.3-0 1.21.0-0 ; do
stop
reset relative
start $version
for path in ${STORAGE_PATHS} ; do
test -d $work_path/data/relative-$path
done
done
stop
}
function test_bug_storage_s3_misplace() {
local work_path=$DIR/forgejo-work-path
local s3_backend=${2:-minio}
log_info "See also https://codeberg.org/forgejo/forgejo/issues/1338"
for version in 1.20.2-0 1.20.3-0 ; do
log_info "Forgejo $version & $s3_backend"
stop
reset misplace-s3
start $version $s3_backend
fixture_create
for fun in ${STORAGE_FUN} ; do
fixture_${fun}_assert_s3
done
done
for version in 1.18.5-0 1.19.4-0 ; do
log_info "Forgejo $version & $s3_backend"
stop
reset misplace-s3
start $version $s3_backend
fixture_create
#
# some storage are in S3
#
fixture_attachments_assert_s3
fixture_lfs_assert_s3
#
# others are in local
#
fixture_repo_archive_assert_local elsewhere/repo-archive
fixture_avatars_assert_local elsewhere/avatars
fixture_packages_assert_local elsewhere/packages
fixture_repo_avatars_assert_local elsewhere/repo-avatars
done
}
function test_storage_stable_s3() {
local work_path=$DIR/forgejo-work-path
local s3_backend=${1:-minio}
log_info "See also https://codeberg.org/forgejo/forgejo/issues/1338"
for version in 1.18.5-0 1.19.4-0 1.20.2-0 1.20.3-0 ; do
log_info "Forgejo $version & $s3_backend"
stop
reset stable-s3
start $version $s3_backend
fixture_create
for fun in ${STORAGE_FUN} ; do
fixture_${fun}_assert_s3
done
done
}
function test_bug_storage_misplace() {
local work_path=$DIR/forgejo-work-path
log_info "See also https://codeberg.org/forgejo/forgejo/pulls/1225"
log_info "using < 1.20 and conflicting sections misplace storage"
for version in 1.18.5-0 1.19.4-0 ; do
stop
reset misplace
start $version
#
# some storage are where they should be
#
test -d $work_path/data/packages
test -d $work_path/data/repo-archive
test -d $work_path/data/attachments
#
# others are under APP_DATA_PATH
#
test -d $work_path/elsewhere/lfs
test -d $work_path/elsewhere/avatars
test -d $work_path/elsewhere/repo-avatars
done
log_info "using < 1.20.[12]-0 and conflicting sections ignores [storage.*]"
for version in 1.20.2-0 ; do
stop
reset misplace
start $version
for path in ${STORAGE_PATHS} ; do
test -d $work_path/elsewhere/$path
done
done
stop
log_info "upgrading from 1.20.2-0 with conflicting sections fails"
download 1.20.3-0
timeout 60 $DIR/forgejo-1.20.3-0 --config $work_path/app.ini --work-path $work_path || true
for path in ${STORAGE_PATHS} ; do
if ! grep --fixed-strings --quiet "[storage.$path] may conflict" $work_path/log/forgejo.log ; then
cat $work_path/log/forgejo.log
return 1
fi
done
}
function test_successful_upgrades() {
for config in default specific ; do
log_info "using $config app.ini"
reset $config
for version in 1.18.5-0 1.19.4-0 1.20.2-0 1.20.3-0 1.21.0-0 ; do
log_info "run $version"
cleanup_storage
start $version
verify_storage
stop
done
done
}
function test_forgejo_database_version() {
local expected_version=$1
local work_path=$DIR/forgejo-work-path
actual_version=$(sqlite3 $work_path/forgejo.db "select version from forgejo_version")
test "$expected_version" = "$actual_version"
}
function test_forgejo_database_v3_upgrades_list_table() {
local table=$1
local work_path=$DIR/forgejo-work-path
sqlite3 $work_path/forgejo.db ".tables $table" .exit | grep --quiet $table
}
function test_forgejo_database_v3_upgrades() {
local table=forgejo_auth_token
stop
reset default
log_info "run 1.20.4-1"
start 1.20.4-1
stop
! test_forgejo_database_v3_upgrades_list_table $table
test_forgejo_database_version 2
log_info "run 1.20.5-0"
start 1.20.5-0
stop
test_forgejo_database_v3_upgrades_list_table $table
test_forgejo_database_version 3
}
function run() {
local fun=$1
shift
echo Start running $fun
mkdir -p $DIR
> $DIR/$fun.out
tail --follow $DIR/$fun.out | sed --unbuffered -n -e "/^$PREFIX/s/^$PREFIX //p" &
pid=$!
if ! VERBOSE=true ${BASH_SOURCE[0]} $fun "$@" >& $DIR/$fun.out ; then
kill $pid
cat $DIR/$fun.out
echo Failure running $fun
return 1
fi
kill $pid
echo Success running $fun
}
function test_upgrades() {
run stop
run dependencies
run build_all
run test_successful_upgrades
run test_bug_storage_misplace
run test_bug_storage_merged
run test_downgrade_1.20.2_fails
run test_bug_storage_s3_misplace
run test_storage_stable_s3 minio
run test_storage_stable_s3 garage
run test_forgejo_database_v3_upgrades
}
"$@"

View file

@ -0,0 +1,99 @@
name: Integration tests for the release process
on:
push:
paths:
- Makefile
- Dockerfile
- Dockerfile.rootless
- docker/**
- .forgejo/actions/build-release/action.yml
- .forgejo/workflows/build-release.yml
- .forgejo/workflows/build-release-integration.yml
jobs:
release-simulation:
runs-on: self-hosted
if: secrets.ROLE != 'forgejo-integration' && secrets.ROLE != 'forgejo-experimental' && secrets.ROLE != 'forgejo-release'
steps:
- uses: actions/checkout@v3
- id: forgejo
uses: https://code.forgejo.org/actions/setup-forgejo@v1
with:
user: root
password: admin1234
image-version: 1.19
lxc-ip-prefix: 10.0.9
- name: publish the forgejo release
run: |
set -x
version=1.2.3
cat > /etc/docker/daemon.json <<EOF
{
"insecure-registries" : ["${{ steps.forgejo.outputs.host-port }}"]
}
EOF
systemctl restart docker
apt-get install -qq -y xz-utils
dir=$(mktemp -d)
trap "rm -fr $dir" EXIT
url=http://root:admin1234@${{ steps.forgejo.outputs.host-port }}
export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"
#
# Create a new project with a fake forgejo and the release workflow only
#
cp -a .forgejo/testdata/build-release/* $dir
mkdir -p $dir/.forgejo/workflows
cp .forgejo/workflows/build-release.yml $dir/.forgejo/workflows
cp -a .forgejo/actions $dir/.forgejo/actions
cp $dir/Dockerfile $dir/Dockerfile.rootless
forgejo-test-helper.sh push $dir $url root forgejo
sha=$(forgejo-test-helper.sh branch_tip $url root/forgejo main)
#
# Push a tag to trigger the release workflow and wait for it to complete
#
forgejo-curl.sh api_json --data-raw '{"tag_name": "v'$version'", "target": "'$sha'"}' $url/api/v1/repos/root/forgejo/tags
LOOPS=180 forgejo-test-helper.sh wait_success "$url" root/forgejo $sha
#
# uncomment to see the logs even when everything is reported to be working ok
#
#cat $FORGEJO_RUNNER_LOGS
#
# Minimal sanity checks. e2e test is for the setup-forgejo
# action and the infrastructure playbook. Since the binary
# is a script shell it does not test the sanity of the cross
# build, only the sanity of the naming of the binaries.
#
for arch in amd64 arm64 arm-6 ; do
binary=forgejo-$version-linux-$arch
for suffix in '' '.xz' ; do
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix > $binary$suffix
if test "$suffix" = .xz ; then
unxz --keep $binary$suffix
fi
chmod +x $binary
./$binary --version | grep $version
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix.sha256 > $binary$suffix.sha256
shasum -a 256 --check $binary$suffix.sha256
rm $binary$suffix
done
done
sources=forgejo-src-$version.tar.gz
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources > $sources
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources.sha256 > $sources.sha256
shasum -a 256 --check $sources.sha256
docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version
docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version-rootless

View file

@ -0,0 +1,190 @@
name: Build release
on:
push:
tags: 'v*'
jobs:
release:
runs-on: self-hosted
# root is used for testing, allow it
if: secrets.ROLE == 'forgejo-integration' || github.repository_owner == 'root'
steps:
- uses: actions/checkout@v3
- name: Increase the verbosity when there are no secrets
id: verbose
run: |
if test -z "${{ secrets.TOKEN }}"; then
value=true
else
value=false
fi
echo "value=$value" >> "$GITHUB_OUTPUT"
- name: Sanitize the name of the repository
id: repository
run: |
set -x # comment out
repository="${{ github.repository }}"
echo "value=${repository##*/}" >> "$GITHUB_OUTPUT"
- name: When in a test environment, create a token
id: token
if: ${{ secrets.TOKEN == '' }}
run: |
apt-get -qq install -y jq
url="${{ env.GITHUB_SERVER_URL }}"
hostport=${url##http*://}
hostport=${hostport%%/}
doer=root
api=http://$doer:admin1234@$hostport/api/v1/users/$doer/tokens
curl -sS -X DELETE $api/release
token=$(curl -sS -X POST -H 'Content-Type: application/json' --data-raw '{"name": "release", "scopes": ["all"]}' $api | jq --raw-output .sha1)
echo "value=${token}" >> "$GITHUB_OUTPUT"
- uses: https://code.forgejo.org/actions/setup-node@v3
with:
node-version: 18
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: ">=1.20"
check-latest: true
- name: Create the version from ref_name
id: tag-version
run: |
version="${{ github.ref_name }}"
version=${version##*v}
echo "value=$version" >> "$GITHUB_OUTPUT"
- name: Create the release notes
id: release-notes
run: |
cat >> "$GITHUB_OUTPUT" <<EOF
value<<ENDVAR
See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#${{ steps.tag-version.outputs.value }}
ENDVAR
EOF
- name: Build sources
run: |
set -x
apt-get -qq install -y make
version=${{ steps.tag-version.outputs.value }}
#
# Make sure all files are owned by the current user.
# When run as root `npx webpack` will assume the identity
# of the owner of the current working directory and may
# fail to create files if some sub-directories are not owned
# by the same user.
#
# Binaries:
# Node: 18.17.0 - /usr/local/node-v18.17.0-linux-x64/bin/node
# npm: 9.6.7 - /usr/local/node-v18.17.0-linux-x64/bin/npm
# Packages:
# add-asset-webpack-plugin: 2.0.1 => 2.0.1
# css-loader: 6.8.1 => 6.8.1
# esbuild-loader: 3.0.1 => 3.0.1
# license-checker-webpack-plugin: 0.2.1 => 0.2.1
# monaco-editor-webpack-plugin: 7.0.1 => 7.0.1
# vue-loader: 17.2.2 => 17.2.2
# webpack: 5.87.0 => 5.87.0
# webpack-cli: 5.1.4 => 5.1.4
#
chown -R $(id -u) .
make VERSION=$version TAGS=bindata sources-tarbal
mv dist/release release
(
tmp=$(mktemp -d)
tar --directory $tmp -zxvf release/*$version*.tar.gz
cd $tmp/*
#
# Verify `make frontend` files are available
#
test -d public/assets/css
test -d public/assets/fonts
test -d public/assets/js
#
# Verify `make generate` files are available
#
test -f modules/public/bindata.go
#
# Sanity check to verify that the source tarbal knows the
# version and is able to rebuild itself from it.
#
# When in sources the version is determined with git.
# When in the tarbal the version is determined from a VERSION file.
#
make sources-tarbal
tarbal=$(echo dist/release/*$version*.tar.gz)
if ! test -f $tarbal ; then
echo $tarbal does not exist
find dist release
exit 1
fi
)
- name: build container & release (when TOKEN secret is not set)
if: ${{ secrets.TOKEN == '' }}
uses: ./.forgejo/actions/build-release
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: root
tag-version: "${{ steps.tag-version.outputs.value }}"
token: ${{ steps.token.outputs.value }}
platforms: linux/amd64,linux/arm64,linux/arm/v6
release-notes: "${{ steps.release-notes.outputs.value }}"
binary-name: forgejo
binary-path: /app/gitea/gitea
verbose: ${{ steps.verbose.outputs.value }}
- name: build rootless container (when TOKEN secret is not set)
if: ${{ secrets.TOKEN == '' }}
uses: ./.forgejo/actions/build-release
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: root
tag-version: "${{ steps.tag-version.outputs.value }}"
token: ${{ steps.token.outputs.value }}
platforms: linux/amd64,linux/arm64,linux/arm/v6
suffix: -rootless
dockerfile: Dockerfile.rootless
verbose: ${{ steps.verbose.outputs.value }}
- name: build container & release (when TOKEN secret is set)
if: ${{ secrets.TOKEN != '' }}
uses: ./.forgejo/actions/build-release
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: "${{ secrets.DOER }}"
tag-version: "${{ steps.tag-version.outputs.value }}"
token: "${{ secrets.TOKEN }}"
platforms: linux/amd64,linux/arm64,linux/arm/v6
release-notes: "${{ steps.release-notes.outputs.value }}"
binary-name: forgejo
binary-path: /app/gitea/gitea
verbose: ${{ steps.verbose.outputs.value }}
- name: build rootless container (when TOKEN secret is set)
if: ${{ secrets.TOKEN != '' }}
uses: ./.forgejo/actions/build-release
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: "${{ secrets.DOER }}"
tag-version: "${{ steps.tag-version.outputs.value }}"
token: "${{ secrets.TOKEN }}"
platforms: linux/amd64,linux/arm64,linux/arm/v6
suffix: -rootless
dockerfile: Dockerfile.rootless
verbose: ${{ steps.verbose.outputs.value }}

View file

@ -0,0 +1,72 @@
# SPDX-License-Identifier: MIT
#
# See also https://forgejo.org/docs/next/developer/RELEASE/#release-process
#
# https://codeberg.org/forgejo-experimental/forgejo
#
# Copies a release from codeberg.org/forgejo-integration to codeberg.org/forgejo-experimental
#
# ROLE: forgejo-experimental
# FORGEJO: https://codeberg.org
# FROM_OWNER: forgejo-integration
# TO_OWNER: forgejo-experimental
# DOER: forgejo-experimental-ci
# TOKEN: <generated from codeberg.org/forgejo-experimental-ci>
#
# http://private.forgejo.org/forgejo/forgejo
#
# Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo
#
# ROLE: forgejo-release
# FORGEJO: https://codeberg.org
# FROM_OWNER: forgejo-integration
# TO_OWNER: forgejo
# DOER: release-team
# TOKEN: <generated from codeberg.org/release-team>
# GPG_PRIVATE_KEY: <XYZ>
# GPG_PASSPHRASE: <ABC>
#
name: Pubish release
on:
push:
tags: 'v*'
jobs:
publish:
runs-on: self-hosted
if: secrets.DOER != '' && secrets.FORGEJO != '' && secrets.TO_OWNER != '' && secrets.FROM_OWNER != '' && secrets.TOKEN != ''
steps:
- uses: actions/checkout@v3
- name: copy & sign binaries and container images from one owner to another
uses: ./.forgejo/actions/publish-release
with:
forgejo: ${{ secrets.FORGEJO }}
from-owner: ${{ secrets.FROM_OWNER }}
to-owner: ${{ secrets.TO_OWNER }}
ref-name: ${{ github.ref_name }}
doer: ${{ secrets.DOER }}
token: ${{ secrets.TOKEN }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
verbose: ${{ secrets.VERBOSE }}
- name: set up go for the DNS update below
uses: https://code.forgejo.org/actions/setup-go@v4
if: secrets.ROLE == 'forgejo-experimental'
with:
go-version: "1.21"
check-latest: true
- name: update the _release.experimental DNS record
if: secrets.ROLE == 'forgejo-experimental'
uses: https://code.forgejo.org/actions/ovh-dns-update@v1
with:
subdomain: _release.experimental
domain: forgejo.com # there is a CNAME from .org to .com (for security reasons)
record-id: 5283602601
value: v=${{ github.ref_name }}
ovh-app-key: ${{ secrets.OVH_APP_KEY }}
ovh-app-secret: ${{ secrets.OVH_APP_SECRET }}
ovh-consumer-key: ${{ secrets.OVH_CON_KEY }}

View file

@ -0,0 +1,189 @@
name: testing
on:
pull_request:
push:
branches:
- 'forgejo*'
- 'v*/forgejo*'
jobs:
lint-backend:
runs-on: docker
container:
image: 'docker.io/node:20-bookworm'
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-backend
env:
TAGS: bindata sqlite sqlite_unlock_notify
checks-backend:
runs-on: docker
container:
image: 'docker.io/node:20-bookworm'
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
check-latest: true
- run: make deps-backend deps-tools
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
test-unit:
runs-on: docker
needs: [lint-backend, checks-backend]
container:
image: 'docker.io/node:20-bookworm'
services:
minio:
image: 'docker.io/bitnami/minio:2023.8.31'
env:
MINIO_ROOT_USER: 123456
MINIO_ROOT_PASSWORD: 12345678
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
- run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata
- run: |
su forgejo -c 'make unit-test-coverage test-check'
timeout-minutes: 50
env:
RACE_ENABLED: 'true'
TAGS: bindata
test-mysql:
runs-on: docker
needs: [lint-backend, checks-backend]
container:
image: 'docker.io/node:20-bookworm'
services:
mysql8:
image: mysql:8-debian
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: testgitea
#
# See also https://codeberg.org/forgejo/forgejo/issues/976
#
cmd: ['mysqld', '--innodb-adaptive-flushing=OFF', '--innodb-buffer-pool-size=4G', '--innodb-log-buffer-size=128M', '--innodb-flush-log-at-trx-commit=0', '--innodb-flush-log-at-timeout=30', '--innodb-flush-method=nosync', '--innodb-fsync-threshold=1000000000']
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install --no-install-recommends -qq -y git-lfs
- name: setup user and permissions
run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata
- run: |
su forgejo -c 'make test-mysql8-migration test-mysql8'
timeout-minutes: 50
env:
TAGS: bindata
USE_REPO_TEST_DIR: 1
test-pgsql:
runs-on: docker
needs: [lint-backend, checks-backend]
container:
image: 'docker.io/node:20-bookworm'
services:
minio:
image: bitnami/minio:2021.3.17
env:
MINIO_ACCESS_KEY: 123456
MINIO_SECRET_KEY: 12345678
pgsql:
image: 'docker.io/postgres:15'
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: postgres
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install --no-install-recommends -qq -y git-lfs
- name: setup user and permissions
run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata
- run: |
su forgejo -c 'make test-pgsql-migration test-pgsql'
timeout-minutes: 50
env:
TAGS: bindata gogit
RACE_ENABLED: true
TEST_TAGS: gogit
USE_REPO_TEST_DIR: 1
test-sqlite:
runs-on: docker
needs: [lint-backend, checks-backend]
container:
image: 'docker.io/node:20-bookworm'
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install --no-install-recommends -qq -y git-lfs
- name: setup user and permissions
run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
- run: |
su forgejo -c 'make test-sqlite-migration test-sqlite'
timeout-minutes: 50
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
RACE_ENABLED: true
TEST_TAGS: gogit sqlite sqlite_unlock_notify
USE_REPO_TEST_DIR: 1

2
.gitattributes vendored
View file

@ -1,5 +1,5 @@
* text=auto eol=lf
*.tmpl linguist-language=Handlebars
*.tmpl linguist-language=go-html-template
/assets/*.json linguist-generated
/public/assets/img/svg/*.svg linguist-generated
/templates/swagger/v1_json.tmpl linguist-generated

View file

@ -1,42 +0,0 @@
<!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue -->
<!--
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your issue doesn't already exist.
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
5. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
-->
- Gitea version (or commit ref):
- Git version:
- Operating system:
<!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package -->
<!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. --->
<!-- If you are using a package or systemd tell us what distribution you are using -->
- Database (use `[x]`):
- [ ] PostgreSQL
- [ ] MySQL
- [ ] MSSQL
- [ ] SQLite
- Can you reproduce the bug at https://try.gitea.io:
- [ ] Yes (provide example URL)
- [ ] No
- Log gist:
<!-- It really is important to provide pertinent logs -->
<!-- Please read https://docs.gitea.com/administration/logging-config#collecting-logs-for-help -->
<!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini -->
## Description
<!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please
disable the proxy/CDN fully and connect to gitea directly to confirm
the issue still persists without those services. -->
...
## Screenshots
<!-- **If this issue involves the Web Interface, please include a screenshot** -->

View file

@ -0,0 +1,63 @@
name: 🦋 Bug Report (web interface / frontend)
description: Something doesn't look quite as it should? Report it here!
title: "[BUG] "
labels: ["bug", "forgejo/ui"]
body:
- type: markdown
attributes:
value: |
**NOTE: If your issue is a security concern, please email <security@forgejo.org> (GPG: `A4676E79`) instead of opening a public issue.**
- type: markdown
attributes:
value: |
- Please speak English, as this is the language all maintainers can speak and write.
- Be as clear and concise as possible. A very verbose report is harder to interpret in a concrete way.
- Be civil, and follow the [Forgejo Code of Conduct](https://codeberg.org/forgejo/code-of-conduct).
- Please make sure you are using the latest release of Forgejo and take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137).
- Please give all relevant information below for bug reports, as incomplete details may result in the issue not being considered.
- type: textarea
id: description
attributes:
label: Description
description: |
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below).
If you think this is a JavaScript error, show us the JavaScript console.
If the error appears to relate to Forgejo the server, please also give us `DEBUG` level logs. (See https://forgejo.org/docs/latest/admin/logging-documentation/)
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: Please provide at least one screenshot showing the issue.
validations:
required: true
- type: input
id: forgejo-ver
attributes:
label: Forgejo Version
description: Forgejo version (or commit reference) your instance is running
validations:
required: true
- type: dropdown
id: can-reproduce
attributes:
label: Can you reproduce the bug on Forgejo Next?
description: |
Please try reproducing your issue at [Forgejo Next](https://next.forgejo.org).
If you can reproduce it, please provide a URL in the Description field.
options:
- "Yes"
- "No"
validations:
required: true
- type: input
id: browser-ver
attributes:
label: Browser Version
description: The browser and version that you are using to access Forgejo
validations:
required: true
- type: input
id: os-ver
attributes:
label: Operating System
description: The operating system you are using to access Forgejo

View file

@ -0,0 +1,90 @@
name: 🐛 Bug Report (server / backend)
description: Found something you weren't expecting? Report it here!
title: "[BUG] "
labels: bug
body:
- type: markdown
attributes:
value: |
**NOTE: If your issue is a security concern, please email <security@forgejo.org> (GPG: `A4676E79`) instead of opening a public issue.**
- type: markdown
attributes:
value: |
- Please speak English, as this is the language all maintainers can speak and write.
- Be as clear and concise as possible. A very verbose report is harder to interpret in a concrete way.
- Be civil, and follow the [Forgejo Code of Conduct](https://codeberg.org/forgejo/code-of-conduct).
- Please make sure you are using the latest release of Forgejo and take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137).
- Please give all relevant information below for bug reports, as incomplete details may result in the issue not being considered.
- type: textarea
id: description
attributes:
label: Description
description: |
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below).
validations:
required: true
- type: input
id: forgejo-ver
attributes:
label: Forgejo Version
description: Forgejo version (or commit reference) of your instance
validations:
required: true
- type: dropdown
id: can-reproduce
attributes:
label: Can you reproduce the bug on Forgejo Next?
description: |
Please try reproducing your issue at [Forgejo Next](https://next.forgejo.org).
If you can reproduce it, please provide a URL in the Description field.
options:
- "Yes"
- "No"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs
description: |
It's really important to provide pertinent logs. You must give us `DEBUG` level logs.
Please read https://forgejo.org/docs/latest/admin/logging-documentation/.
In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of `app.ini`.
Please copy and paste your logs here, with any sensitive information (e.g. API keys) removed/hidden.
You can wrap your logs in `<details>...</details>` tags so it doesn't take up too much space in the issue.
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If this issue involves the Web Interface, please provide one or more screenshots
- type: input
id: git-ver
attributes:
label: Git Version
description: The version of git running on the server
- type: input
id: os-ver
attributes:
label: Operating System
description: The operating system you are using to run Forgejo
- type: textarea
id: run-info
attributes:
label: How are you running Forgejo?
description: |
Please include information on whether you built Forgejo yourself, used one of our downloads, or are using some other package.
Please also tell us how you are running Forgejo, e.g. if it is being run from docker, a command-line, systemd etc.
If you are using a package or systemd tell us what distribution you are using.
validations:
required: true
- type: dropdown
id: database
attributes:
label: Database
description: What database system are you running?
options:
- SQLite
- PostgreSQL
- MySQL
- MSSQL

View file

@ -0,0 +1,17 @@
blank_issues_enabled: false
contact_links:
- name: 🔓 Security Reports
url: mailto:security@forgejo.org
about: "Please email <security@forgejo.org> (GPG: `A4676E79`) instead of opening a public issue."
- name: 💬 Matrix Chat Room
url: https://matrix.to/#/#forgejo-chat:matrix.org
about: Please ask questions and discuss configuration or deployment problems here.
- name: 💬 Matrix Space
url: https://matrix.to/#/#forgejo:matrix.org
about: A collection of Matrix rooms relating to Forgejo in addition to the main chat room.
- name: 📚 Documentation
url: https://forgejo.org/docs/latest/
about: Documentation about Forgejo.
- name: ❓ Frequently Asked Questions
url: https://forgejo.org/faq/
about: Please check if your question is mentioned here.

View file

@ -0,0 +1,31 @@
name: 💡 Feature Request
description: Got an idea for a feature that Forgejo doesn't have yet? Suggest it here!
title: "[FEAT] "
labels: ["enhancement/feature"]
body:
- type: markdown
attributes:
value: |
- Please speak English, as this is the language all maintainers can speak and write.
- Be as clear and concise as possible. A very verbose request is harder to interpret in a concrete way.
- Be civil, and follow the [Forgejo Code of Conduct](https://codeberg.org/forgejo/code-of-conduct).
- Please make sure you are using the latest release of Forgejo and take a moment to [check that your feature hasn't already been suggested](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78139).
- type: textarea
id: needs-benefits
attributes:
label: Needs and benefits
description: As concisely as possible, describe the benefits your feture request will provide or the problems it will try to solve.
validations:
required: true
- type: textarea
id: description
attributes:
label: Feature Description
description: As concisely as possible, describe the feature you would like to see added or the changes you would like to see made to Forgejo.
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If you can, provide screenshots of an implementation on another site, e.g. GitHub.

View file

@ -0,0 +1,4 @@
<!--
Before submitting a PR, please read the contributing guidelines:
https://codeberg.org/forgejo/forgejo/src/branch/main/CONTRIBUTING.md
-->

2
.github/FUNDING.yml vendored
View file

@ -1,2 +0,0 @@
open_collective: gitea
custom: https://www.bountysource.com/teams/gitea

View file

@ -1,91 +0,0 @@
name: Bug Report
description: Found something you weren't expecting? Report it here!
labels: ["kind/bug"]
body:
- type: markdown
attributes:
value: |
NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue.
- type: markdown
attributes:
value: |
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Make sure you are using the latest release and
take a moment to check that your issue hasn't been reported before.
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
5. It's really important to provide pertinent details and logs (https://docs.gitea.com/help/support),
incomplete details will be handled as an invalid report.
- type: textarea
id: description
attributes:
label: Description
description: |
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below)
If you are using a proxy or a CDN (e.g. Cloudflare) in front of Gitea, please disable the proxy/CDN fully and access Gitea directly to confirm the issue still persists without those services.
- type: input
id: gitea-ver
attributes:
label: Gitea Version
description: Gitea version (or commit reference) of your instance
validations:
required: true
- type: dropdown
id: can-reproduce
attributes:
label: Can you reproduce the bug on the Gitea demo site?
description: |
If so, please provide a URL in the Description field
URL of Gitea demo: https://try.gitea.io
options:
- "Yes"
- "No"
validations:
required: true
- type: markdown
attributes:
value: |
It's really important to provide pertinent logs
Please read https://docs.gitea.com/administration/logging-config#collecting-logs-for-help
In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini
- type: input
id: logs
attributes:
label: Log Gist
description: Please provide a gist URL of your logs, with any sensitive information (e.g. API keys) removed/hidden
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If this issue involves the Web Interface, please provide one or more screenshots
- type: input
id: git-ver
attributes:
label: Git Version
description: The version of git running on the server
- type: input
id: os-ver
attributes:
label: Operating System
description: The operating system you are using to run Gitea
- type: textarea
id: run-info
attributes:
label: How are you running Gitea?
description: |
Please include information on whether you built Gitea yourself, used one of our downloads, are using https://try.gitea.io or are using some other package
Please also tell us how you are running Gitea, e.g. if it is being run from docker, a command-line, systemd etc.
If you are using a package or systemd tell us what distribution you are using
validations:
required: true
- type: dropdown
id: database
attributes:
label: Database
description: What database system are you running?
options:
- PostgreSQL
- MySQL/MariaDB
- MSSQL
- SQLite

View file

@ -1,17 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Security Concern
url: https://tinyurl.com/security-gitea
about: For security concerns, please send a mail to security@gitea.io instead of opening a public issue.
- name: Discord Server
url: https://discord.gg/Gitea
about: Please ask questions and discuss configuration or deployment problems here.
- name: Discourse Forum
url: https://discourse.gitea.io
about: Questions and configuration or deployment problems can also be discussed on our forum.
- name: Frequently Asked Questions
url: https://docs.gitea.com/help/faq
about: Please check if your question isn't mentioned here.
- name: Crowdin Translations
url: https://crowdin.com/project/gitea
about: Translations are managed here.

View file

@ -1,24 +0,0 @@
name: Feature Request
description: Got an idea for a feature that Gitea doesn't have currently? Submit your idea here!
labels: ["kind/proposal"]
body:
- type: markdown
attributes:
value: |
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your feature hasn't already been suggested.
- type: textarea
id: description
attributes:
label: Feature Description
placeholder: |
I think it would be great if Gitea had...
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If you can, provide screenshots of an implementation on another site e.g. GitHub

View file

@ -1,66 +0,0 @@
name: Web Interface Bug Report
description: Something doesn't look quite as it should? Report it here!
labels: ["kind/bug", "kind/ui"]
body:
- type: markdown
attributes:
value: |
NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue.
- type: markdown
attributes:
value: |
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your issue doesn't already exist.
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
5. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
6. In particular it's really important to provide pertinent logs. If you are certain that this is a javascript
error, show us the javascript console. If the error appears to relate to Gitea the server you must also give us
DEBUG level logs. (See https://docs.gitea.com/administration/logging-config#collecting-logs-for-help)
- type: textarea
id: description
attributes:
label: Description
description: |
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below)
If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services.
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: Please provide at least 1 screenshot showing the issue.
validations:
required: true
- type: input
id: gitea-ver
attributes:
label: Gitea Version
description: Gitea version (or commit reference) your instance is running
validations:
required: true
- type: dropdown
id: can-reproduce
attributes:
label: Can you reproduce the bug on the Gitea demo site?
description: |
If so, please provide a URL in the Description field
URL of Gitea demo: https://try.gitea.io
options:
- "Yes"
- "No"
validations:
required: true
- type: input
id: os-ver
attributes:
label: Operating System
description: The operating system you are using to access Gitea
- type: input
id: browser-ver
attributes:
label: Browser Version
description: The browser and version that you are using to access Gitea
validations:
required: true

View file

@ -1,9 +0,0 @@
<!-- start tips -->
Please check the following:
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for backports.
2. Make sure you have read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md .
3. Describe what your pull request does and which issue you're targeting (if any).
4. It is recommended to enable "Allow edits by maintainers", so maintainers can help more easily.
5. Your input here will be included in the commit message when this PR has been merged. If you don't want some content to be included, please separate them with a line like `---`.
6. Delete all these tips before posting.
<!-- end tips -->

54
.github/stale.yml vendored
View file

@ -1,54 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 14
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- status/blocked
- kind/security
- lgtm/done
- reviewed/confirmed
- priority/critical
- kind/proposal
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had recent activity.
I am here to help clear issues left open even if solved or waiting for more insight.
This issue will be closed if no further activity occurs during the next 2 weeks.
If the issue is still valid just add a comment to keep it alive.
Thank you for your contributions.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue has been automatically closed because of inactivity.
You can re-open it if needed.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
pulls:
daysUntilStale: 60
daysUntilClose: 60
markComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you
for your contributions.
closeComment: >
This pull request has been automatically closed because of inactivity.
You can re-open it if needed.

View file

@ -1,29 +0,0 @@
name: cron-licenses
on:
schedule:
- cron: "7 0 * * 1" # every Monday at 00:07 UTC
workflow_dispatch:
jobs:
cron-licenses:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make generate-license generate-gitignore
timeout-minutes: 40
- name: push translations to repo
uses: appleboy/git-push-action@v0.0.2
with:
author_email: "teabot@gitea.io"
author_name: GiteaBot
branch: main
commit: true
commit_message: "[skip ci] Updated licenses and gitignores"
remote: "git@github.com:go-gitea/gitea.git"
ssh_key: ${{ secrets.DEPLOY_KEY }}

View file

@ -1,22 +0,0 @@
name: cron-lock
on:
schedule:
- cron: "0 0 * * *" # every day at 00:00 UTC
workflow_dispatch:
permissions:
issues: write
pull-requests: write
concurrency:
group: lock
jobs:
action:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: dessant/lock-threads@v4
with:
issue-inactive-days: 45

View file

@ -1,49 +0,0 @@
name: cron-translations
on:
schedule:
- cron: "7 0 * * *" # every day at 00:07 UTC
workflow_dispatch:
jobs:
crowdin-pull:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v4
- name: download from crowdin
uses: docker://jonasfranz/crowdin
env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
PLUGIN_DOWNLOAD: true
PLUGIN_EXPORT_DIR: options/locale/
PLUGIN_IGNORE_BRANCH: true
PLUGIN_PROJECT_IDENTIFIER: gitea
- name: update locales
run: ./build/update-locales.sh
- name: push translations to repo
uses: appleboy/git-push-action@v0.0.2
with:
author_email: "teabot@gitea.io"
author_name: GiteaBot
branch: main
commit: true
commit_message: "[skip ci] Updated translations via Crowdin"
remote: "git@github.com:go-gitea/gitea.git"
ssh_key: ${{ secrets.DEPLOY_KEY }}
crowdin-push:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v4
- name: push translations to crowdin
uses: docker://jonasfranz/crowdin
env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
PLUGIN_UPLOAD: true
PLUGIN_EXPORT_DIR: options/locale/
PLUGIN_IGNORE_BRANCH: true
PLUGIN_PROJECT_IDENTIFIER: gitea
PLUGIN_FILES: |
locale_en-US.ini: options/locale/locale_en-US.ini
PLUGIN_BRANCH: main

View file

@ -1,179 +0,0 @@
name: compliance
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
lint-backend:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-backend
env:
TAGS: bindata sqlite sqlite_unlock_notify
lint-templates:
if: needs.files-changed.outputs.templates == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install poetry
- run: make deps-py
- run: make lint-templates
lint-yaml:
if: needs.files-changed.outputs.yaml == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install poetry
- run: make deps-py
- run: make lint-yaml
lint-swagger:
if: needs.files-changed.outputs.swagger == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend
- run: make lint-swagger
lint-go-windows:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-go-windows lint-go-vet
env:
TAGS: bindata sqlite sqlite_unlock_notify
GOOS: windows
GOARCH: amd64
lint-go-gogit:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-go
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
checks-backend:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make deps-backend deps-tools
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
frontend:
if: needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend
- run: make lint-frontend
- run: make checks-frontend
- run: make test-frontend
- run: make frontend
backend:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
# no frontend build here as backend should be able to build
# even without any frontend files
- run: make deps-backend
- run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
- name: build-backend-arm64
run: make backend # test cross compile
env:
GOOS: linux
GOARCH: arm64
TAGS: bindata gogit
- name: build-backend-windows
run: go build -o gitea_windows
env:
GOOS: windows
GOARCH: amd64
TAGS: bindata gogit
- name: build-backend-386
run: go build -o gitea_linux_386 # test if compatible with 32 bit
env:
GOOS: linux
GOARCH: 386
docs:
if: needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend
- run: make lint-md
- run: make docs
actions:
if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- run: make lint-actions

View file

@ -1,259 +0,0 @@
name: db-tests
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
test-pgsql:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
pgsql:
image: postgres:15
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
ldap:
image: gitea/test-openldap:latest
ports:
- "389:389"
- "636:636"
minio:
# as github actions doesn't support "entrypoint", we need to use a non-official image
# that has a custom entrypoint set to "minio server /data"
image: bitnami/minio:2021.3.17
env:
MINIO_ACCESS_KEY: 123456
MINIO_SECRET_KEY: 12345678
ports:
- "9000:9000"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- run: make test-pgsql-migration test-pgsql
timeout-minutes: 50
env:
TAGS: bindata gogit
RACE_ENABLED: true
TEST_TAGS: gogit
TEST_LDAP: 1
USE_REPO_TEST_DIR: 1
test-sqlite:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make deps-backend
- run: make backend
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
- run: make test-sqlite-migration test-sqlite
timeout-minutes: 50
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
RACE_ENABLED: true
TEST_TAGS: gogit sqlite sqlite_unlock_notify
USE_REPO_TEST_DIR: 1
test-unit:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: test
ports:
- "3306:3306"
elasticsearch:
image: elasticsearch:7.5.0
env:
discovery.type: single-node
ports:
- "9200:9200"
meilisearch:
image: getmeili/meilisearch:v1.2.0
env:
MEILI_ENV: development # disable auth
ports:
- "7700:7700"
smtpimap:
image: tabascoterrier/docker-imap-devel:latest
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
redis:
image: redis
options: >- # wait until redis has started
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 10
ports:
- 6379:6379
minio:
image: bitnami/minio:2021.3.17
env:
MINIO_ACCESS_KEY: 123456
MINIO_SECRET_KEY: 12345678
ports:
- "9000:9000"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- name: unit-tests
run: make unit-test-coverage test-check
env:
TAGS: bindata
RACE_ENABLED: true
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
- name: unit-tests-gogit
run: make unit-test-coverage test-check
env:
TAGS: bindata gogit
RACE_ENABLED: true
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
test-mysql5:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: test
ports:
- "3306:3306"
elasticsearch:
image: elasticsearch:7.5.0
env:
discovery.type: single-node
ports:
- "9200:9200"
smtpimap:
image: tabascoterrier/docker-imap-devel:latest
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- name: run tests
run: make test-mysql-migration integration-test-coverage
env:
TAGS: bindata
RACE_ENABLED: true
USE_REPO_TEST_DIR: 1
TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
test-mysql8:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mysql8:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: testgitea
ports:
- "3306:3306"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- run: make test-mysql8-migration test-mysql8
timeout-minutes: 50
env:
TAGS: bindata
USE_REPO_TEST_DIR: 1
test-mssql:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/mssql/server:latest
env:
ACCEPT_EULA: Y
MSSQL_PID: Standard
SA_PASSWORD: MwantsaSecurePassword1
ports:
- "1433:1433"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- run: make test-mssql-migration test-mssql
timeout-minutes: 50
env:
TAGS: bindata
USE_REPO_TEST_DIR: 1

View file

@ -1,35 +0,0 @@
name: docker-dryrun
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
regular:
if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
push: false
tags: gitea/gitea:linux-amd64
rootless:
if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
push: false
file: Dockerfile.rootless
tags: gitea/gitea:linux-amd64

View file

@ -1,32 +0,0 @@
name: e2e-tests
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
test-e2e:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend frontend deps-backend
- run: npx playwright install --with-deps
- run: make test-e2e-sqlite
timeout-minutes: 40
env:
USE_REPO_TEST_DIR: 1

View file

@ -44,7 +44,7 @@ jobs:
- name: Get cleaned branch name
id: clean_name
run: |
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\/v//' -e 's/release\/v//')
echo "Cleaned name is ${REF_NAME}"
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
- name: configure aws
@ -56,6 +56,10 @@ jobs:
- name: upload binaries to s3
run: |
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
- name: Install GH CLI
uses: dev-hanz-ops/install-gh-cli-action@v0.1.0
with:
gh-cli-version: 2.39.1
- name: create github release
run: |
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/*
@ -74,6 +78,8 @@ jobs:
id: meta
with:
images: gitea/gitea
flavor: |
latest=false
# 1.2.3-rc0
tags: |
type=semver,pattern={{version}}
@ -105,6 +111,7 @@ jobs:
images: gitea/gitea
# each tag below will have the suffix of -rootless
flavor: |
latest=false
suffix=-rootless
# 1.2.3-rc0
tags: |

View file

@ -46,7 +46,7 @@ jobs:
- name: Get cleaned branch name
id: clean_name
run: |
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\/v//' -e 's/release\/v//')
echo "Cleaned name is ${REF_NAME}"
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
- name: configure aws
@ -58,9 +58,13 @@ jobs:
- name: upload binaries to s3
run: |
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
- name: Install GH CLI
uses: dev-hanz-ops/install-gh-cli-action@v0.1.0
with:
gh-cli-version: 2.39.1
- name: create github release
run: |
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/*
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-from-tag dist/release/*
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
docker-rootful:
@ -82,7 +86,6 @@ jobs:
# 1.2
# 1.2.3
tags: |
type=raw,value=latest
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}
@ -114,14 +117,13 @@ jobs:
images: gitea/gitea
# each tag below will have the suffix of -rootless
flavor: |
suffix=-rootless
suffix=-rootless,onlatest=true
# this will generate tags in the following format (with -rootless suffix added):
# latest
# 1
# 1.2
# 1.2.3
tags: |
type=raw,value=latest
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}

6
.gitignore vendored
View file

@ -1,3 +1,6 @@
# Emacs
*~
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
@ -110,3 +113,6 @@ prime/
# Manpage
/man
# Generated merged Forgejo+Gitea language files
/options/locale/locale_*

View file

@ -4,6 +4,602 @@ This changelog goes through all the changes that have been made in each release
without substantial changes to our git log; to see the highlights of what has
been added to each release, please refer to the [blog](https://blog.gitea.com).
## [1.21.4](https://github.com/go-gitea/gitea/releases/tag/1.21.4) - 2024-01-16
* SECURITY
* Update github.com/cloudflare/circl (#28789) (#28790)
* Require token for GET subscription endpoint (#28765) (#28768)
* BUGFIXES
* Use refname:strip-2 instead of refname:short when syncing tags (#28797) (#28811)
* Fix links in issue card (#28806) (#28807)
* Fix nil pointer panic when exec some gitea cli command (#28791) (#28795)
* Require token for GET subscription endpoint (#28765) (#28778)
* Fix button size in "attached header right" (#28770) (#28774)
* Fix `convert.ToTeams` on empty input (#28426) (#28767)
* Hide code related setting options in repository when code unit is disabled (#28631) (#28749)
* Fix incorrect URL for "Reference in New Issue" (#28716) (#28723)
* Fix panic when parsing empty pgsql host (#28708) (#28709)
* Upgrade xorm to new version which supported update join for all supported databases (#28590) (#28668)
* Fix alpine package files are not rebuilt (#28638) (#28665)
* Avoid cycle-redirecting user/login page (#28636) (#28658)
* Fix empty ref for cron workflow runs (#28640) (#28647)
* Remove unnecessary syncbranchToDB with tests (#28624) (#28629)
* Use known issue IID to generate new PR index number when migrating from GitLab (#28616) (#28618)
* Fix flex container width (#28603) (#28605)
* Fix the scroll behavior for emoji/mention list (#28597) (#28601)
* Fix wrong due date rendering in issue list page (#28588) (#28591)
* Fix `status_check_contexts` matching bug (#28582) (#28589)
* Fix 500 error of searching commits (#28576) (#28579)
* Use information from previous blame parts (#28572) (#28577)
* Update mermaid for 1.21 (#28571)
* Fix 405 method not allowed CORS / OIDC (#28583) (#28586) (#28587) (#28611)
* Fix `GetCommitStatuses` (#28787) (#28804)
* Forbid removing the last admin user (#28337) (#28793)
* Fix schedule tasks bugs (#28691) (#28780)
* Fix issue dependencies (#27736) (#28776)
* Fix system webhooks API bug (#28531) (#28666)
* Fix when private user following user, private user will not be counted in his own view (#28037) (#28792)
* Render code block in activity tab (#28816) (#28818)
* ENHANCEMENTS
* Rework markup link rendering (#26745) (#28803)
* Modernize merge button (#28140) (#28786)
* Speed up loading the dashboard on mysql/mariadb (#28546) (#28784)
* Assign pull request to project during creation (#28227) (#28775)
* Show description as tooltip instead of title for labels (#28754) (#28766)
* Make template `DateTime` show proper tooltip (#28677) (#28683)
* Switch destination directory for apt signing keys (#28639) (#28642)
* Include heap pprof in diagnosis report to help debugging memory leaks (#28596) (#28599)
* DOCS
* Suggest to use Type=simple for systemd service (#28717) (#28722)
* Extend description for ARTIFACT_RETENTION_DAYS (#28626) (#28630)
* MISC
* Add -F to commit search to treat keywords as strings (#28744) (#28748)
* Add download attribute to release attachments (#28739) (#28740)
* Concatenate error in `checkIfPRContentChanged` (#28731) (#28737)
* Improve 1.21 document for Database Preparation (#28643) (#28644)
## [1.21.3](https://github.com/go-gitea/gitea/releases/tag/1.21.3) - 2023-12-21
* SECURITY
* Update golang.org/x/crypto (#28519)
* API
* chore(api): support ignore password if login source type is LDAP for creating user API (#28491) (#28525)
* Add endpoint for not implemented Docker auth (#28457) (#28462)
* ENHANCEMENTS
* Add option to disable ambiguous unicode characters detection (#28454) (#28499)
* Refactor SSH clone URL generation code (#28421) (#28480)
* Polyfill SubmitEvent for PaleMoon (#28441) (#28478)
* BUGFIXES
* Fix the issue ref rendering for wiki (#28556) (#28559)
* Fix duplicate ID when deleting repo (#28520) (#28528)
* Only check online runner when detecting matching runners in workflows (#28286) (#28512)
* Initalize stroage for orphaned repository doctor (#28487) (#28490)
* Fix possible nil pointer access (#28428) (#28440)
* Don't show unnecessary citation JS error on UI (#28433) (#28437)
* DOCS
* Update actions document about comparsion as Github Actions (#28560) (#28564)
* Fix documents for "custom/public/assets/" (#28465) (#28467)
* MISC
* Fix inperformant query on retrifing review from database. (#28552) (#28562)
* Improve the prompt for "ssh-keygen sign" (#28509) (#28510)
* Update docs for DISABLE_QUERY_AUTH_TOKEN (#28485) (#28488)
* Fix Chinese translation of config cheat sheet[API] (#28472) (#28473)
* Retry SSH key verification with additional CRLF if it failed (#28392) (#28464)
## [1.21.2](https://github.com/go-gitea/gitea/releases/tag/1.21.2) - 2023-12-12
* SECURITY
* Rebuild with recently released golang version
* Fix missing check (#28406) (#28411)
* Do some missing checks (#28423) (#28432)
* BUGFIXES
* Fix margin in server signed signature verification view (#28379) (#28381)
* Fix object does not exist error when checking citation file (#28314) (#28369)
* Use `filepath` instead of `path` to create SQLite3 database file (#28374) (#28378)
* Fix the runs will not be displayed bug when the main branch have no workflows but other branches have (#28359) (#28365)
* Handle repository.size column being NULL in migration v263 (#28336) (#28363)
* Convert git commit summary to valid UTF8. (#28356) (#28358)
* Fix migration panic due to an empty review comment diff (#28334) (#28362)
* Add `HEAD` support for rpm repo files (#28309) (#28360)
* Fix RPM/Debian signature key creation (#28352) (#28353)
* Keep profile tab when clicking on Language (#28320) (#28331)
* Fix missing issue search index update when changing status (#28325) (#28330)
* Fix wrong link in `protect_branch_name_pattern_desc` (#28313) (#28315)
* Read `previous` info from git blame (#28306) (#28310)
* Ignore "non-existing" errors when getDirectorySize calculates the size (#28276) (#28285)
* Use appSubUrl for OAuth2 callback URL tip (#28266) (#28275)
* Meilisearch: require all query terms to be matched (#28293) (#28296)
* Fix required error for token name (#28267) (#28284)
* Fix issue will be detected as pull request when checking `First-time contributor` (#28237) (#28271)
* Use full width for project boards (#28225) (#28245)
* Increase "version" when update the setting value to a same value as before (#28243) (#28244)
* Also sync DB branches on push if necessary (#28361) (#28403)
* Make gogit Repository.GetBranchNames consistent (#28348) (#28386)
* Recover from panic in cron task (#28409) (#28425)
* Deprecate query string auth tokens (#28390) (#28430)
* ENHANCEMENTS
* Improve doctor cli behavior (#28422) (#28424)
* Fix margin in server signed signature verification view (#28379) (#28381)
* Refactor template empty checks (#28351) (#28354)
* Read `previous` info from git blame (#28306) (#28310)
* Use full width for project boards (#28225) (#28245)
* Enable system users search via the API (#28013) (#28018)
## [1.21.1](https://github.com/go-gitea/gitea/releases/tag/1.21.1) - 2023-11-26
* SECURITY
* Fix comment permissions (#28213) (#28216)
* BUGFIXES
* Fix delete-orphaned-repos (#28200) (#28202)
* Make CORS work for oauth2 handlers (#28184) (#28185)
* Fix missing buttons (#28179) (#28181)
* Fix no ActionTaskOutput table waring (#28149) (#28152)
* Fix empty action run title (#28113) (#28148)
* Use "is-loading" to avoid duplicate form submit for code comment (#28143) (#28147)
* Fix Matrix and MSTeams nil dereference (#28089) (#28105)
* Fix incorrect pgsql conn builder behavior (#28085) (#28098)
* Fix system config cache expiration timing (#28072) (#28090)
* Restricted users only see repos in orgs which their team was assigned to (#28025) (#28051)
* API
* Fix permissions for Token DELETE endpoint to match GET and POST (#27610) (#28099)
* ENHANCEMENTS
* Do not display search box when there's no packages yet (#28146) (#28159)
* Add missing `packages.cleanup.success` (#28129) (#28132)
* DOCS
* Docs: Replace deprecated IS_TLS_ENABLED mailer setting in email setup (#28205) (#28208)
* Fix the description about the default setting for action in quick start document (#28160) (#28168)
* Add guide page to actions when there's no workflows (#28145) (#28153)
* MISC
* Use full width for PR comparison (#28182) (#28186)
## [1.21.0](https://github.com/go-gitea/gitea/releases/tag/v1.21.0) - 2023-11-14
* BREAKING
* Restrict certificate type for builtin SSH server (#26789)
* Refactor to use urfave/cli/v2 (#25959)
* Move public asset files to the proper directory (#25907)
* Remove commit status running and warning to align GitHub (#25839) (partially reverted: Restore warning commit status (#27504) (#27529))
* Remove "CHARSET" config option for MySQL, always use "utf8mb4" (#25413)
* Set SSH_AUTHORIZED_KEYS_BACKUP to false (#25412)
* FEATURES
* User details page (#26713)
* Chore(actions): support cron schedule task (#26655)
* Support rebuilding issue indexer manually (#26546)
* Allow to archive labels (#26478)
* Add disable workflow feature (#26413)
* Support `.git-blame-ignore-revs` file (#26395)
* Pre-register OAuth2 applications for git credential helpers (#26291)
* Add `Retry` button when creating a mirror-repo fails (#26228)
* Artifacts retention and auto clean up (#26131)
* Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" (#25974)
* Implement auto-cancellation of concurrent jobs if the event is push (#25716)
* Newly pushed branches hints on repository home page (#25715)
* Display branch commit status (#25608)
* Add direct serving of package content (#25543)
* Add commits dropdown in PR files view and allow commit by commit review (#25528)
* Allow package cleanup from admin page (#25307)
* Batch delete issue and improve tippy opts (#25253)
* Show branches and tags that contain a commit (#25180)
* Add actor and status dropdowns to run list (#25118)
* Allow Organisations to have a E-Mail (#25082)
* Add codeowners feature (#24910)
* Actions Artifacts support uploading multiple files and directories (#24874)
* Support configuration variables on Gitea Actions (#24724)
* Support downloading raw task logs (#24451)
* API
* Unify two factor check (#27915) (#27929)
* Fix package webhook (#27839) (#27855)
* Fix/upload artifact error windows (#27802) (#27840)
* Fix bad method call when deleting user secrets via API (#27829) (#27831)
* Do not force creation of _cargo-index repo on publish (#27266) (#27765)
* Delete repos of org when purge delete user (#27273) (#27728)
* Fix org team endpoint (#27721) (#27727)
* Api: GetPullRequestCommits: return file list (#27483) (#27539)
* Don't let API add 2 exclusive labels from same scope (#27433) (#27460)
* Redefine the meaning of column is_active to make Actions Registration Token generation easier (#27143) (#27304)
* Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27251)
* Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27163)
* Allow empty Conan files (#27092)
* Fix token endpoints ignore specified account (#27080)
* Reduce usage of `db.DefaultContext` (#27073) (#27083) (#27089) (#27103) (#27262) (#27265) (#27347) (#26076)
* Make SSPI auth mockable (#27036)
* Extract auth middleware from service (#27028)
* Add `RemoteAddress` to mirrors (#26952)
* Feat(API): add routes and functions for managing user's secrets (#26909)
* Feat(API): add secret deletion functionality for repository (#26808)
* Feat(API): add route and implementation for creating/updating repository secret (#26766)
* Add Upload URL to release API (#26663)
* Feat(API): update and delete secret for managing organization secrets (#26660)
* Feat: implement organization secret creation API (#26566)
* Add API route to list org secrets (#26485)
* Set commit id when ref used explicitly (#26447)
* PATCH branch-protection updates check list even when checks are disabled (#26351)
* Add file status for API "Get a single commit from a repository" (#16205) (#25831)
* Add API for changing Avatars (#25369)
* BUGFIXES
* Fix viewing wiki commit on empty repo (#28040) (#28044)
* Enable system users for comment.LoadPoster (#28014) (#28032)
* Fixed duplicate attachments on dump on windows (#28019) (#28031)
* Fix wrong xorm Delete usage(backport for 1.21) (#28002)
* Add word-break to repo description in home page (#27924) (#27957)
* Fix rendering assignee changed comments without assignee (#27927) (#27952)
* Add word break to release title (#27942) (#27947)
* Fix JS NPE when viewing specific range of PR commits (#27912) (#27923)
* Show correct commit sha when viewing single commit diff (#27916) (#27921)
* Fix 500 when deleting a dismissed review (#27903) (#27910)
* Fix DownloadFunc when migrating releases (#27887) (#27890)
* Fix http protocol auth (#27875) (#27876)
* Refactor postgres connection string building (#27723) (#27869)
* Close all hashed buffers (#27787) (#27790)
* Fix label render containing invalid HTML (#27752) (#27762)
* Fix duplicate project board when hitting `enter` key (#27746) (#27751)
* Fix `link-action` redirect network error (#27734) (#27749)
* Fix sticky diff header background (#27697) (#27712)
* Always delete existing scheduled action tasks (#27662) (#27688)
* Support allowed hosts for webhook to work with proxy (#27655) (#27675)
* Fix poster is not loaded in get default merge message (#27657) (#27666)
* Improve dropdown button alignment and fix hover bug (#27632) (#27637)
* Improve retrying index issues (#27554) (#27634)
* Fix 404 when deleting Docker package with an internal version (#27615) (#27630)
* Backport manually for a tmpl issue in v1.21 (#27612)
* Don't show Link to TOTP if not set up (#27585) (#27588)
* Fix data-race bug when accessing task.LastRun (#27584) (#27586)
* Fix attachment download bug (#27486) (#27571)
* Respect SSH.KeygenPath option when calculating ssh key fingerprints (#27536) (#27551)
* Improve dropdown's behavior when there is a search input in menu (#27526) (#27534)
* Fix panic in storageHandler (#27446) (#27479)
* When comparing with an non-exist repository, return 404 but 500 (#27437) (#27442)
* Fix pr template (#27436) (#27440)
* Fix git 2.11 error when checking IsEmpty (#27393) (#27397)
* Allow get release download files and lfs files with oauth2 token format (#26430) (#27379)
* Fix missing ctx for GetRepoLink in dashboard (#27372) (#27375)
* Absolute positioned checkboxes overlay floated elements (#26870) (#27366)
* Introduce fixes and more rigorous tests for 'Show on a map' feature (#26803) (#27365)
* Fix repo count in org action settings (#27245) (#27353)
* Add logs for data broken of comment review (#27326) (#27345)
* Fix the approval count of PR when there is no protection branch rule (#27272) (#27343)
* Fix Bug in Issue Config when only contact links are set (#26521) (#27334)
* Improve issue history dialog and make poster can delete their own history (#27323) (#27327)
* Fix orphan check for deleted branch (#27310) (#27321)
* Fix protected branch icon location (#26576) (#27317)
* Fix yaml test (#27297) (#27303)
* Fix some animation bugs (#27287) (#27294)
* Fix incorrect change from #27231 (#27275) (#27282)
* Add missing public user visibility in user details page (#27246) (#27250)
* Fix EOL handling in web editor (#27141) (#27234)
* Fix issues on action runners page (#27226) (#27233)
* Quote table `release` in sql queries (#27205) (#27218)
* Fix release URL in webhooks (#27182) (#27185)
* Fix review request number and add more tests (#27104) (#27168)
* Fix the variable regexp pattern on web page (#27161) (#27164)
* Fix: treat tab "overview" as "repositories" in user profiles without readme (#27124)
* Fix NPE when editing OAuth2 applications (#27078)
* Fix the incorrect route path in the user edit page. (#27007)
* Fix the secret regexp pattern on web page (#26910)
* Allow users with write permissions for issues to add attachments with API (#26837)
* Make "link-action" backend code respond correct JSON content (#26680)
* Use line-height: normal by default (#26635)
* Fix NPM packages name validation (#26595)
* Rewrite the DiffFileTreeItem and fix misalignment (#26565)
* Return empty when searching issues with no repos (#26545)
* Explain SearchOptions and fix ToSearchOptions (#26542)
* Add missing triggers to update issue indexer (#26539)
* Handle base64 decoding correctly to avoid panic (#26483)
* Avoiding accessing undefined mentionValues (#26461)
* Fix incorrect redirection in new issue using references (#26440)
* Fix the bug when getting files changed for `pull_request_target` event (#26320)
* Remove IsWarning in tmpl (#26120)
* Fix loading `LFS_JWT_SECRET` from wrong section (#26109)
* Fixing redirection issue for logged-in users (#26105)
* Improve "gitea doctor" sub-command and fix "help" commands (#26072)
* Fix the truncate and alignment problem for some admin tables (#26042)
* Update minimum password length requirements (#25946)
* Do not "guess" the file encoding/BOM when using API to upload files (#25828)
* Restructure issue list template, styles (#25750)
* Fix `ref` for workflows triggered by `pull_request_target` (#25743)
* Fix issues indexer document mapping (#25619)
* Use JSON response for "user/logout" (#25522)
* Fix migrate page layout on mobile (#25507)
* Link to existing PR when trying to open a new PR on the same branches (#25494)
* Do not publish docker release images on `-dev` tags (#25471)
* Support `pull_request_target` event (#25229)
* Modify the content format of the Feishu webhook (#25106)
* ENHANCEMENTS
* Render email addresses as such if followed by punctuation (#27987) (#27992)
* Show error toast when file size exceeds the limits (#27985) (#27986)
* Fix citation error when the file size is larger than 1024 bytes (#27958) (#27965)
* Remove action runners on user deletion (#27902) (#27908)
* Remove set tabindex on view issue (#27892) (#27896)
* Reduce margin/padding on flex-list items and divider (#27872) (#27874)
* Change katex limits (#27823) (#27868)
* Clean up template locale usage (#27856) (#27857)
* Add dedicated class for empty placeholders (#27788) (#27792)
* Add gap between diff boxes (#27776) (#27781)
* Fix incorrect "tab" parameter for repo search sub-template (#27755) (#27764)
* Enable followCursor for language stats bar (#27713) (#27739)
* Improve diff tree spacing (#27714) (#27719)
* Feed UI Improvements (#27356) (#27717)
* Improve feed icons and feed merge text color (#27498) (#27716)
* [FIX] resolve confusing colors in languages stats by insert a gap (#27704) (#27715)
* Add doctor dbconsistency fix to delete repos with no owner (#27290) (#27693)
* Fix required checkboxes in issue forms (#27592) (#27692)
* Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) (#27661)
* Cleanup repo details icons/labels (#27644) (#27654)
* Keep filter when showing unfiltered results on explore page (#27192) (#27589)
* Show manual cron run's last time (#27544) (#27577)
* Revert "Fix pr template (#27436)" (#27567)
* Increase queue length (#27555) (#27562)
* Avoid run change title process when the title is same (#27467) (#27558)
* Remove max-width and add hide text overflow (#27359) (#27550)
* Add hover background to wiki list page (#27507) (#27521)
* Fix mermaid flowchart margin issue (#27503) (#27516)
* Refactor system setting (#27000) (#27452)
* Fix missing `ctx` in new_form.tmpl (#27434) (#27438)
* Add Index to `action.user_id` (#27403) (#27425)
* Don't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408)
* Add support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407)
* Make Actions tasks/jobs timeouts configurable by the user (#27400) (#27402)
* Hide archived labels when filtering by labels on the issue list (#27115) (#27381)
* Highlight user details link (#26998) (#27376)
* Add protected branch name description (#27257) (#27351)
* Improve tree not found page (#26570) (#27346)
* Add Index to `comment.dependent_issue_id` (#27325) (#27340)
* Improve branch list UI (#27319) (#27324)
* Fix divider in subscription page (#27298) (#27301)
* Add missed return to actions view fetch (#27289) (#27293)
* Backport ctx locale refactoring manually (#27231) (#27259) (#27260)
* Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211) (#27253)
* Use mask-based fade-out effect for `.new-menu` (#27181) (#27243)
* Cleanup locale function usage (#27227) (#27240)
* Fix z-index on markdown completion (#27237) (#27239)
* Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225) (#27228)
* Allow copying issue comment link on archived repos and when not logged in (#27193) (#27210)
* Fix: text decorator on issue sidebar menu label (#27206) (#27209)
* Fix dropdown icon position (#27175) (#27177)
* Add index to `issue_user.issue_id` (#27154) (#27158)
* Increase auth provider icon size on login page (#27122)
* Remove a `gt-float-right` and some unnecessary helpers (#27110)
* Change green buttons to primary color (#27099)
* Use db.WithTx for AddTeamMember to avoid ctx abuse (#27095)
* Use `print` instead of `printf` (#27093)
* Remove the useless function `GetUserIssueStats` and move relevant tests to `indexer_test.go` (#27067)
* Search branches (#27055)
* Display all user types and org types on admin management UI (#27050)
* Ui correction in mobile view nav bar left aligned items. (#27046)
* Chroma color tweaks (#26978)
* Move some functions to service layer (#26969)
* Improve "language stats" UI (#26968)
* Replace `util.SliceXxx` with `slices.Xxx` (#26958)
* Refactor dashboard/feed.tmpl (#26956)
* Move repository deletion to service layer (#26948)
* Fix the missing repo count (#26942)
* Improve hint when uploading a too large avatar (#26935)
* Extract common code to new template (#26933)
* Move createrepository from module to service layer (#26927)
* Move notification interface to services layer (#26915)
* Move feed notification service layer (#26908)
* Move ui notification to service layer (#26907)
* Move indexer notification to service layer (#26906)
* Move mail notification logic to service layer (#26905)
* Extract common code to new template (#26903)
* Show queue's active worker number (#26896)
* Fix media description render for orgmode (#26895)
* Remove CSS `has` selector and improve various styles (#26891)
* Relocate the `RSS user feed` button (#26882)
* Refactor "shortsha" (#26877)
* Refactor `og:description` to limit the max length (#26876)
* Move web/api context related testing function into a separate package (#26859)
* Redable error on S3 storage connection failure (#26856)
* Improve opengraph previews (#26851)
* Add more descriptive error on forgot password page (#26848)
* Show always repo count in header (#26842)
* Remove "TODO" tasks from CSS file (#26835)
* Render code blocks in repo description (#26830)
* Minor dashboard tweaks, fix flex-list margins (#26829)
* Remove polluted `.ui.right` (#26825)
* Display archived labels specially when listing labels (#26820)
* Remove polluted ".ui.left" style (#26809)
* Make it posible to customize nav text color via css var (#26807)
* Refactor lfs requests (#26783)
* Improve flex list item padding (#26779)
* Remove fomantic `text` module (#26777)
* Remove fomantic `item` module (#26775)
* Remove redundant nil check in `WalkGitLog` (#26773)
* Reduce some allocations in type conversion (#26772)
* Refactor some CSS styles and simplify code (#26771)
* Unify `border-radius` behavior (#26770)
* Improve modal dialog UI (#26764)
* Allow "latest" to be used in release vTag when downloading file (#26748)
* Adding hint `Archived` to archive label. (#26741)
* Move `modules/mirror` to `services` (#26737)
* Add "dir=auto" for input/textarea elements by default (#26735)
* Add auth-required to config.json for Cargo http registry (#26729)
* Simplify helper CSS classes and avoid abuse (#26728)
* Make web context initialize correctly for different cases (#26726)
* Focus editor on "Write" tab click (#26714)
* Remove incorrect CSS helper classes (#26712)
* Fix review bar misalignment (#26711)
* Add reverseproxy auth for API back with default disabled (#26703)
* Add default label in branch select list (#26697)
* Improve Image Diff UI (#26696)
* Fixed text overflow in dropdown menu (#26694)
* [Refactor] getIssueStatsChunk to move inner function into own one (#26671)
* Remove fomantic loader module (#26670)
* Add `member`, `collaborator`, `contributor`, and `first-time contributor` roles and tooltips (#26658)
* Improve some flex layouts (#26649)
* Improve the branch selector tab UI (#26631)
* Improve show role (#26621)
* Remove avatarHTML from template helpers (#26598)
* Allow text selection in actions step header (#26588)
* Improve translation of milestone filters (#26569)
* Add optimistic lock to ActionRun table (#26563)
* Update team invitation email link (#26550)
* Differentiate better between user settings and admin settings (#26538)
* Check disabled workflow when rerun jobs (#26535)
* Improve deadline icon location in milestone list page (#26532)
* Improve repo sub menu (#26531)
* Fix the display of org level badges (#26504)
* Rename `Sync2` -> `Sync` (#26479)
* Fix stderr usages (#26477)
* Remove fomantic transition module (#26469)
* Refactor tests (#26464)
* Refactor project templates (#26448)
* Fall back to esbuild for css minify (#26445)
* Always show usernames in reaction tooltips (#26444)
* Use correct pull request commit link instead of a generic commit link (#26434)
* Refactor "editorconfig" (#26391)
* Make `user-content-* ` consistent with github (#26388)
* Remove unnecessary template helper repoAvatar (#26387)
* Remove unnecessary template helper DisableGravatar (#26386)
* Use template context function for avatar rendering (#26385)
* Rename code_langauge.go to code_language.go (#26377)
* Use more `IssueList` instead of `[]*Issue` (#26369)
* Do not highlight `#number` in documents (#26365)
* Fix display problems of members and teams unit (#26363)
* Fix 404 error when remove self from an organization (#26362)
* Improve CLI and messages (#26341)
* Refactor backend SVG package and add tests (#26335)
* Add link to job details and tooltip to commit status in repo list in dashboard (#26326)
* Use yellow if an approved review is stale (#26312)
* Remove commit load branches and tags in wiki repo (#26304)
* Add highlight to selected repos in milestone dashboard (#26300)
* Delete `issue_service.CreateComment` (#26298)
* Do not show Profile README when repository is private (#26295)
* Tweak actions menu (#26278)
* Start using template context function (#26254)
* Use calendar icon for `Joined on...` in profiles (#26215)
* Add 'Show on a map' button to Location in profile, fix layout (#26214)
* Render plaintext task list items for markdown files (#26186)
* Add tooltip to describe LFS table column and color `delete LFS file` button red (#26181)
* Release attachments duplicated check (#26176)
* De-emphasize issue sidebar buttons (#26171)
* Fixing the align of commit stats in commit_page template. (#26161)
* Allow editing push mirrors after creation (#26151)
* Move web JSON functions to web context and simplify code (#26132)
* Refactor improve NoBetterThan (#26126)
* Improve clickable area in repo action view page (#26115)
* Add context parameter to some database functions (#26055)
* Docusaurus-ify (#26051)
* Improve text for empty issue/pr description (#26047)
* Categorize admin settings sidebar panel (#26030)
* Remove redundant "RouteMethods" method (#26024)
* Refactor and enhance issue indexer to support both searching, filtering and paging (#26012)
* Add a link to OpenID Issuer URL in WebFinger response (#26000)
* Fix UI for release tag page / wiki page / subscription page (#25948)
* Support copy protected branch from template repository (#25889)
* Improve display of Labels/Projects/Assignees sort options (#25886)
* Fix margin on the new/edit project page. (#25885)
* Show image size on view page (#25884)
* Remove ref name in PR commits page (#25876)
* Allow the use of alternative net.Listener implementations by downstreams (#25855)
* Refactor "Content" for file uploading (#25851)
* Add error info if no user can fork the repo (#25820)
* Show edit title button on commits tab of PR, too (#25791)
* Introduce `flex-list` & `flex-item` elements for Gitea UI (#25790)
* Don't stack PR tab menu on small screens (#25789)
* Repository Archived text title center align (#25767)
* Make route middleware/handler mockable (#25766)
* Move issue filters to shared template (#25729)
* Use frontend fetch for branch dropdown component (#25719)
* Add open/closed field support for issue index (#25708)
* Some less naked returns (#25682)
* Fix inconsistent user profile layout across tabs (#25625)
* Get latest commit statuses from database instead of git data on dashboard for repositories (#25605)
* Adding branch-name copy to clipboard branches screen. (#25596)
* Update emoji set to Unicode 15 (#25595)
* Move some files under repo/setting (#25585)
* Add custom ansi colors and CSS variables for them (#25546)
* Add log line anchor for action logs (#25532)
* Use flex instead of float for sort button and search input (#25519)
* Update octicons and use `octicon-file-directory-symlink` (#25453)
* Add toasts to UI (#25449)
* Fine tune project board label colors and modal content background (#25419)
* Import additional secrets via file uri (#25408)
* Switch to ansi_up for ansi rendering in actions (#25401)
* Store and use seconds for timeline time comments (#25392)
* Support displaying diff stats in PR tab bar (#25387)
* Use fetch form action for lock/unlock/pin/unpin on sidebar (#25380)
* Refactor: TotalTimes return seconds (#25370)
* Navbar styling rework (#25343)
* Introduce shared template for search inputs (#25338)
* Only show 'Manage Account Links' when necessary (#25311)
* Improve 'Privacy' section in profile settings (#25309)
* Substitute variables in path names of template repos too (#25294)
* Fix tags line no margin see #25255 (#25280)
* Use fetch to send requests to create issues/comments (#25258)
* Change form actions to fetch for submit review box (#25219)
* Improve AJAX link and modal confirm dialog (#25210)
* Reduce unnecessary DB queries for Actions tasks (#25199)
* Disable `Create column` button while the column name is empty (#25192)
* Refactor indexer (#25174)
* Adjust style for action run list (align icons, adjust padding) (#25170)
* Remove duplicated functions when deleting a branch (#25128)
* Make confusable character warning less jarring (#25069)
* Highlight viewed files differently in the PR filetree (#24956)
* Support changing labels of Actions runner without re-registration (#24806)
* Fix duplicate Reviewed-by trailers (#24796)
* Resolve issue with sort icons on admin/users and admin/runners (#24360)
* Split lfs size from repository size (#22900)
* Sync branches into databases (#22743)
* Disable run user change in installation page (#22499)
* Add merge files files to GetCommitFileStatus (#20515)
* Show OpenID Connect and OAuth on signup page (#20242)
* SECURITY
* Dont leak private users via extensions (#28023) (#28029)
* Expanded minimum RSA Keylength to 3072 (#26604)
* TESTING
* Add user secrets API integration tests (#27832) (#27852)
* Add tests for db indexer in indexer_test.go (#27087)
* Speed up TestEventSourceManagerRun (#26262)
* Add unit test for user renaming (#26261)
* Add some Wiki unit tests (#26260)
* Improve unit test for caching (#26185)
* Add unit test for `HashAvatar` (#25662)
* TRANSLATION
* Backport translations to v1.21 (#27899)
* Fix issues in translation file (#27699) (#27737)
* Add locale for deleted head branch (#26296)
* Improve multiple strings in en-US locale (#26213)
* Fix broken translations for package documantion (#25742)
* Correct translation wrong format (#25643)
* BUILD
* Dockerfile small refactor (#27757) (#27826)
* Fix build errors on BSD (in BSDMakefile) (#27594) (#27608)
* Fully replace drone with actions (#27556) (#27575)
* Enable markdownlint `no-duplicate-header` (#27500) (#27506)
* Enable production source maps for index.js, fix CSS sourcemaps (#27291) (#27295)
* Update snap package (#27021)
* Bump go to 1.21 (#26608)
* Bump xgo to go-1.21.x and node to 20 in release-version (#26589)
* Add template linting via djlint (#25212)
* DOCS
* Change default size of issue/pr attachments and repo file (#27946) (#28017)
* Remove `known issue` section in Gitea Actions Doc (#27930) (#27938)
* Remove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119)
* Update brew installation documentation since gitea moved to brew core package (#27070)
* Actions are no longer experimental, so enable them by default (#27054)
* Add a documentation note for Windows Service (#26938)
* Add sparse url in cargo package guide (#26937)
* Update nginx recommendations (#26924)
* Update backup instructions to align with archive structure (#26902)
* Expanding documentation in queue.go (#26889)
* Update info regarding internet connection for build (#26776)
* Docs: template variables (#26547)
* Update index doc (#26455)
* Update zh-cn documentation (#26406)
* Fix typos and grammer problems for actions documentation (#26328)
* Update documentation for 1.21 actions (#26317)
* Doc update swagger doc for POST /orgs/{org}/teams (#26155)
* Doc sync authentication.md to zh-cn (#26117)
* Doc guide the user to create the appropriate level runner (#26091)
* Make organization redirect warning more clear (#26077)
* Update blog links (#25843)
* Fix default value for LocalURL (#25426)
* Update `from-source.zh-cn.md` & `from-source.en-us.md` - Cross Compile Using Zig (#25194)
* MISC
* Replace deprecated `elliptic.Marshal` (#26800)
* Add elapsed time on debug for slow git commands (#25642)
## [1.20.5](https://github.com/go-gitea/gitea/releases/tag/v1.20.5) - 2023-10-03
* ENHANCEMENTS
@ -455,7 +1051,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.com).
* Add option to search for users is active join a team (#24093)
* Add PDF rendering via PDFObject (#24086)
* Refactor web route (#24080)
* Make more functions use ctx instead of db.DefaultContext (#24068)
* Make HTML template functions support context (#24056)
* Refactor rename user and rename organization (#24052)
* Localize milestone related time strings (#24051)

32
CODEOWNERS Normal file
View file

@ -0,0 +1,32 @@
# This file describes the expected reviewers for a PR based on the changed
# files. Unlike what the name of the file suggests they don't own the code, but
# merely have a good understanding of that area of the codebase and therefore
# are usually suited as a reviewer.
# Please mind the alphabetic order of reviewers.
# Files related to the CI of the Forgejo project.
.forgejo/.* @dachary @earl-warren
# Files related to frontend development.
# Javascript and CSS code.
web_src/.* @caesar @crystal @gusted
# HTML templates used by the backend.
templates/.* @caesar @crystal @gusted
# Files related to Go development.
# The modules usually don't require much knowledge about Forgejo and could
# be reviewed by Go developers.
modules/.* @dachary @earl-warren @gusted
# Models has code related to SQL queries, general database knowledge and XORM.
models/.* @dachary @earl-warren @gusted
# The routers directory contains the most amount code that requires a good grasp
# of how Forgejo comes together. It's tedious to write good integration testing
# for code that lives in here.
routers/.* @dachary @earl-warren @gusted

View file

@ -1,96 +0,0 @@
# Gitea Community Code of Conduct
## About
Online communities include people from many different backgrounds. The Gitea contributors are committed to providing a friendly, safe and welcoming environment for all, regardless of gender identity and expression, sexual orientation, disabilities, neurodiversity, physical appearance, body size, ethnicity, nationality, race, age, religion, or similar personal characteristics.
The first goal of the Code of Conduct is to specify a baseline standard of behavior so that people with different social values and communication styles can talk about Gitea effectively, productively, and respectfully.
The second goal is to provide a mechanism for resolving conflicts in the community when they arise.
The third goal of the Code of Conduct is to make our community welcoming to people from different backgrounds. Diversity is critical to the project; for Gitea to be successful, it needs contributors and users from all backgrounds.
We believe that healthy debate and disagreement are essential to a healthy project and community. However, it is never ok to be disrespectful. We value diverse opinions, but we value respectful behavior more.
## Community values
These are the values to which people in the Gitea community should aspire.
- **Be friendly and welcoming.**
- **Be patient.**
- Remember that people have varying communication styles and that not everyone is using their native language. (Meaning and tone can be lost in translation.)
- **Be thoughtful.**
- Productive communication requires effort. Think about how your words will be interpreted.
- Remember that sometimes it is best to refrain entirely from commenting.
- **Be respectful.**
- In particular, respect differences of opinion.
- **Be charitable.**
- Interpret the arguments of others in good faith, do not seek to disagree.
- When we do disagree, try to understand why.
- **Be constructive.**
- Avoid derailing: stay on topic; if you want to talk about something else, start a new conversation.
- Avoid unconstructive criticism: don't merely decry the current state of affairs; offer—or at least solicit—suggestions as to how things may be improved.
- Avoid snarking (pithy, unproductive, sniping comments)
- Avoid discussing potentially offensive or sensitive issues; this all too often leads to unnecessary conflict.
- Avoid microaggressions (brief and commonplace verbal, behavioral and environmental indignities that communicate hostile, derogatory or negative slights and insults to a person or group).
- **Be responsible.**
- What you say and do matters. Take responsibility for your words and actions, including their consequences, whether intended or otherwise.
People are complicated. You should expect to be misunderstood and to misunderstand others; when this inevitably occurs, resist the urge to be defensive or assign blame. Try not to take offense where no offense was intended. Give people the benefit of the doubt. Even if the intent was to provoke, do not rise to it. It is the responsibility of all parties to de-escalate conflict when it arises.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject: comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, as well as to ban (temporarily or permanently) any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
This Code of Conduct also applies outside the project spaces when the Project Stewards have a reasonable belief that an individuals behavior may have a negative impact on the project or its community.
### Conflict Resolution
We do not believe that all conflict is bad; healthy debate and disagreement often yield positive results. However, it is never okay to be disrespectful or to engage in behavior that violates the projects code of conduct.
If you see someone violating the code of conduct, you are encouraged to address the behavior directly with those involved. Many issues can be resolved quickly and easily, and this gives people more control over the outcome of their dispute. If you are unable to resolve the matter for any reason, or if the behavior is threatening or harassing, report it. We are dedicated to providing an environment where participants feel welcome and safe.
Reports should be directed to the Gitea Project Stewards at conduct@gitea.com. It is the Project Stewards duty to receive and address reported violations of the code of conduct. They will then work with a committee consisting of representatives from the technical-oversight-committee.
We will investigate every complaint, but you may not receive a direct response. We will use our discretion in determining when and how to follow up on reported incidents, which may range from not taking action to permanent expulsion from the project and project-sponsored spaces. Under normal circumstances, we will notify the accused of the report and provide them an opportunity to discuss it before any action is taken. If there is a consensus between maintainers that such an endeavor would be useless (i.e. in case of an obvious spammer), we reserve the right to take action without notifying the accused first. The identity of the reporter will be omitted from the details of the report supplied to the accused. In potentially harmful situations, such as ongoing harassment or threats to anyones safety, we may take action without notice.
### Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
## Summary
- Treat everyone with respect and kindness.
- Be thoughtful in how you communicate.
- Dont be destructive or inflammatory.
- If you encounter an issue, please mail conduct@gitea.com.

View file

@ -1,563 +1,24 @@
# Contribution Guidelines
# Forgejo Contributor Guide
<details><summary>Table of Contents</summary>
The Forgejo project is run by a community of people who are expected to follow this guide when cooperating on a simple bug fix as well as when changing the governance. For more information about the project, take a look at [the documentation explaining what Forgejo provides](README.md).
- [Contribution Guidelines](#contribution-guidelines)
- [Introduction](#introduction)
- [Issues](#issues)
- [How to report issues](#how-to-report-issues)
- [Types of issues](#types-of-issues)
- [Discuss your design before the implementation](#discuss-your-design-before-the-implementation)
- [Building Gitea](#building-gitea)
- [Dependencies](#dependencies)
- [Backend](#backend)
- [Frontend](#frontend)
- [Design guideline](#design-guideline)
- [Styleguide](#styleguide)
- [Copyright](#copyright)
- [Testing](#testing)
- [Translation](#translation)
- [Code review](#code-review)
- [Pull request format](#pull-request-format)
- [PR title and summary](#pr-title-and-summary)
- [Milestone](#milestone)
- [Labels](#labels)
- [Breaking PRs](#breaking-prs)
- [What is a breaking PR?](#what-is-a-breaking-pr)
- [How to handle breaking PRs?](#how-to-handle-breaking-prs)
- [Maintaining open PRs](#maintaining-open-prs)
- [Getting PRs merged](#getting-prs-merged)
- [Final call](#final-call)
- [Commit messages](#commit-messages)
- [PR Co-authors](#pr-co-authors)
- [PRs targeting `main`](#prs-targeting-main)
- [Backport PRs](#backport-prs)
- [Documentation](#documentation)
- [API v1](#api-v1)
- [GitHub API compatibility](#github-api-compatibility)
- [Adding/Maintaining API routes](#addingmaintaining-api-routes)
- [When to use what HTTP method](#when-to-use-what-http-method)
- [Requirements for API routes](#requirements-for-api-routes)
- [Backports and Frontports](#backports-and-frontports)
- [What is backported?](#what-is-backported)
- [How to backport?](#how-to-backport)
- [Format of backport PRs](#format-of-backport-prs)
- [Frontports](#frontports)
- [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco)
- [Release Cycle](#release-cycle)
- [Maintainers](#maintainers)
- [Technical Oversight Committee (TOC)](#technical-oversight-committee-toc)
- [Current TOC members](#current-toc-members)
- [Previous TOC/owners members](#previous-tocowners-members)
- [Governance Compensation](#governance-compensation)
- [TOC \& Working groups](#toc--working-groups)
- [Roadmap](#roadmap)
- [Versions](#versions)
- [Releasing Gitea](#releasing-gitea)
Sensitive security-related issues should be reported to [security@forgejo.org](mailto:security@forgejo.org) using [encryption](https://keyoxide.org/security@forgejo.org).
</details>
## For everyone involved
## Introduction
- [Documentation](https://forgejo.org/docs/next/)
- [Code of Conduct](https://forgejo.org/docs/latest/developer/coc/)
- [Bugs, features, security and others discussions](https://forgejo.org/docs/latest/developer/discussions/)
- [Governance](https://forgejo.org/docs/latest/developer/governance/)
- [Sustainability and funding](https://codeberg.org/forgejo/sustainability/src/branch/main/README.md)
This document explains how to contribute changes to the Gitea project. \
It assumes you have followed the [installation instructions](https://docs.gitea.com/category/installation). \
Sensitive security-related issues should be reported to [security@gitea.io](mailto:security@gitea.io).
## For contributors
For configuring IDEs for Gitea development, see the [contributed IDE configurations](contrib/ide/).
- [Developer Certificate of Origin (DCO)](https://forgejo.org/docs/latest/developer/dco/)
- [Development workflow](https://forgejo.org/docs/latest/developer/workflow/)
- [Compiling from source](https://forgejo.org/docs/latest/developer/from-source/)
## Issues
## For maintainers
### How to report issues
Please search the issues on the issue tracker with a variety of related keywords to ensure that your issue has not already been reported.
If your issue has not been reported yet, [open an issue](https://github.com/go-gitea/gitea/issues/new)
and answer the questions so we can understand and reproduce the problematic behavior. \
Please write clear and concise instructions so that we can reproduce the behavior — even if it seems obvious. \
The more detailed and specific you are, the faster we can fix the issue. \
It is really helpful if you can reproduce your problem on a site running on the latest commits, i.e. <https://try.gitea.io>, as perhaps your problem has already been fixed on a current version. \
Please follow the guidelines described in [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html) for your report.
Please be kind, remember that Gitea comes at no cost to you, and you're getting free help.
### Types of issues
Typically, issues fall in one of the following categories:
- `bug`: Something in the frontend or backend behaves unexpectedly
- `security issue`: bug that has serious implications such as leaking another users data. Please do not file such issues on the public tracker and send a mail to security@gitea.io instead
- `feature`: Completely new functionality. You should describe this feature in enough detail that anyone who reads the issue can understand how it is supposed to be implemented
- `enhancement`: An existing feature should get an upgrade
- `refactoring`: Parts of the code base don't conform with other parts and should be changed to improve Gitea's maintainability
### Discuss your design before the implementation
We welcome submissions. \
If you want to change or add something, please let everyone know what you're working on — [file an issue](https://github.com/go-gitea/gitea/issues/new) or comment on an existing one before starting your work!
Significant changes such as new features must go through the change proposal process before they can be accepted. \
This is mainly to save yourself the trouble of implementing it, only to find out that your proposed implementation has some potential problems. \
Furthermore, this process gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits inside
the goals for the project and tools.
Pull requests should not be the place for architecture discussions.
## Building Gitea
See the [development setup instructions](https://docs.gitea.com/development/hacking-on-gitea).
## Dependencies
### Backend
Go dependencies are managed using [Go Modules](https://golang.org/cmd/go/#hdr-Module_maintenance). \
You can find more details in the [go mod documentation](https://go.dev/ref/mod) and the [Go Modules Wiki](https://github.com/golang/go/wiki/Modules).
Pull requests should only modify `go.mod` and `go.sum` where it is related to your change, be it a bugfix or a new feature. \
Apart from that, these files should only be modified by Pull Requests whose only purpose is to update dependencies.
The `go.mod`, `go.sum` update needs to be justified as part of the PR description,
and must be verified by the reviewers and/or merger to always reference
an existing upstream commit.
### Frontend
For the frontend, we use [npm](https://www.npmjs.com/).
The same restrictions apply for frontend dependencies as for backend dependencies, with the exceptions that the files for it are `package.json` and `package-lock.json`, and that new versions must always reference an existing version.
## Design guideline
Depending on your change, please read the
- [backend development guideline](https://docs.gitea.com/contributing/guidelines-backend)
- [frontend development guideline](https://docs.gitea.com/contributing/guidelines-frontend)
- [refactoring guideline](https://docs.gitea.com/contributing/guidelines-refactoring)
## Styleguide
You should always run `make fmt` before committing to conform to Gitea's styleguide.
## Copyright
New code files that you contribute should use the standard copyright header:
```
// Copyright <current year> The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
```
Afterwards, copyright should only be modified when the copyright author changes.
## Testing
Before submitting a pull request, run all tests to make sure your changes don't cause a regression elsewhere.
Here's how to run the test suite:
- code lint
| | |
| :-------------------- | :---------------------------------------------------------------- |
|``make lint`` | lint everything (not needed if you only change the front- **or** backend) |
|``make lint-frontend`` | lint frontend files |
|``make lint-backend`` | lint backend files |
- run tests (we suggest running them on Linux)
| Command | Action | |
| :------------------------------------- | :----------------------------------------------- | ------------ |
|``make test[\#SpecificTestName]`` | run unit test(s) |
|``make test-sqlite[\#SpecificTestName]``| run [integration](tests/integration) test(s) for SQLite |[More details](tests/integration/README.md) |
|``make test-e2e-sqlite[\#SpecificTestName]``| run [end-to-end](tests/e2e) test(s) for SQLite |[More details](tests/e2e/README.md) |
## Translation
All translation work happens on [Crowdin](https://crowdin.com/project/gitea).
The only translation that is maintained in this repository is [the English translation](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini).
It is synced regularly with Crowdin. \
Other locales on main branch **should not** be updated manually as they will be overwritten with each sync. \
Once a language has reached a **satisfactory percentage** of translated keys (~25%), it will be synced back into this repo and included in the next released version.
The tool `go run build/backport-locale.go` can be used to backport locales from the main branch to release branches that were missed.
## Code review
### Pull request format
Please try to make your pull request easy to review for us. \
For that, please read the [*Best Practices for Faster Reviews*](https://github.com/kubernetes/community/blob/261cb0fd089b64002c91e8eddceebf032462ccd6/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) guide. \
It has lots of useful tips for any project you may want to contribute to. \
Some of the key points:
- Make small pull requests. \
The smaller, the faster to review and the more likely it will be merged soon.
- Don't make changes unrelated to your PR. \
Maybe there are typos on some comments, maybe refactoring would be welcome on a function... \
but if that is not related to your PR, please make *another* PR for that.
- Split big pull requests into multiple small ones. \
An incremental change will be faster to review than a huge PR.
- Allow edits by maintainers. This way, the maintainers will take care of merging the PR later on instead of you.
### PR title and summary
In the PR title, describe the problem you are fixing, not how you are fixing it. \
Use the first comment as a summary of your PR. \
In the PR summary, you can describe exactly how you are fixing this problem. \
Keep this summary up-to-date as the PR evolves. \
If your PR changes the UI, you must add **after** screenshots in the PR summary. \
If you are not implementing a new feature, you should also post **before** screenshots for comparison. \
If your PR closes some issues, you must note that in a way that both GitHub and Gitea understand, i.e. by appending a paragraph like
```text
Fixes/Closes/Resolves #<ISSUE_NR_X>.
Fixes/Closes/Resolves #<ISSUE_NR_Y>.
```
to your summary. \
Each issue that will be closed must stand on a separate line.
### Milestone
A PR should only be assigned to a milestone if it will likely be merged into the given version. \
As a rule of thumb, assume that a PR will stay open for an additional month for every 100 added lines. \
PRs without a milestone may not be merged.
### Labels
Every PR should be labeled correctly with every label that applies. \
This includes especially the distinction between `bug` (fixing existing functionality), `feature` (new functionality), `enhancement` (upgrades for existing functionality), and `refactoring` (improving the internal code structure without changing the output (much)). \
Furthermore,
- the amount of pending required approvals
- whether this PR is `blocked`, a `backport` or `breaking`
- if it targets the `ui` or `api`
- if it increases the application `speed`
- reduces `memory usage`
are oftentimes notable labels.
### Breaking PRs
#### What is a breaking PR?
A PR is breaking if it meets one of the following criteria:
- It changes API output in an incompatible way for existing users
- It removes a setting that an admin could previously set (i.e. via `app.ini`)
- An admin must do something manually to restore the old behavior
In particular, this means that adding new settings is not breaking.\
Changing the default value of a setting or replacing the setting with another one is breaking, however.
#### How to handle breaking PRs?
If your PR has a breaking change, you must add a `BREAKING` section to your PR summary, e.g.
```
## :warning: BREAKING :warning:
```
To explain how this will affect users and how to mitigate these changes.
### Maintaining open PRs
The moment you create a non-draft PR or the moment you convert a draft PR to a non-draft PR is the moment code review starts for it. \
Once that happens, do not rebase or squash your branch anymore as it makes it difficult to review the new changes. \
Merge the base branch into your branch only when you really need to, i.e. because of conflicting changes in the mean time. \
This reduces unnecessary CI runs. \
Don't worry about merge commits messing up your commit history as every PR will be squash merged. \
This means that all changes are joined into a single new commit whose message is as described below.
### Getting PRs merged
Changes to Gitea must be reviewed before they are accepted — no matter who
makes the change, even if they are an owner or a maintainer. \
The only exception are critical bugs that prevent Gitea from being compiled or started. \
Specifically, we require two approvals from maintainers for every PR. \
Once this criteria has been met, your PR receives the `lgtm/done` label. \
From this point on, your only responsibility is to fix merge conflicts or respond to/implement requests by maintainers. \
It is the responsibility of the maintainers from this point to get your PR merged.
If a PR has the `lgtm/done` label and there are no open discussions or merge conflicts anymore, any maintainer can add the `reviewed/wait-merge` label. \
This label means that the PR is part of the merge queue and will be merged as soon as possible. \
The merge queue will be cleared in the order of the list below:
<https://github.com/go-gitea/gitea/pulls?q=is%3Apr+label%3Areviewed%2Fwait-merge+sort%3Acreated-asc+is%3Aopen>
Gitea uses it's own tool, the <https://github.com/GiteaBot/gitea-backporter> to automate parts of the review process. \
This tool does the things listed below automatically:
- create a backport PR if needed once the initial PR was merged
- remove the PR from the merge queue after the PR merged
- keep the oldest branch in the merge queue up to date with merges
### Final call
If a PR has been ignored for more than 7 days with no comments or reviews, and the author or any maintainer believes it will not survive a long wait (such as a refactoring PR), they can send "final call" to the TOC by mentioning them in a comment.
After another 7 days, if there is still zero approval, this is considered a polite refusal, and the PR will be closed to avoid wasting further time. Therefore, the "final call" has a cost, and should be used cautiously.
However, if there are no objections from maintainers, the PR can be merged with only one approval from the TOC (not the author).
### Commit messages
Mergers are able and required to rewrite the PR title and summary (the first comment of a PR) so that it can produce an easily understandable commit message if necessary. \
The final commit message should no longer contain any uncertainty such as `hopefully, <x> won't happen anymore`. Replace uncertainty with certainty.
#### PR Co-authors
A person counts as a PR co-author the moment they (co-)authored a commit that is not simply a `Merge base branch into branch` commit. \
Mergers are required to remove such "false-positive" co-authors when writing the commit message. \
The true co-authors must remain in the commit message.
#### PRs targeting `main`
The commit message of PRs targeting `main` is always
```bash
$PR_TITLE ($PR_INDEX)
$REWRITTEN_PR_SUMMARY
```
#### Backport PRs
The commit message of backport PRs is always
```bash
$PR_TITLE ($INITIAL_PR_INDEX) ($BACKPORT_PR_INDEX)
$REWRITTEN_PR_SUMMARY
```
## Documentation
If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated in the same PR.
## API v1
The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [the GitHub API](https://docs.github.com/en/rest).
### GitHub API compatibility
Gitea's API should use the same endpoints and fields as the GitHub API as far as possible, unless there are good reasons to deviate. \
If Gitea provides functionality that GitHub does not, a new endpoint can be created. \
If information is provided by Gitea that is not provided by the GitHub API, a new field can be used that doesn't collide with any GitHub fields. \
Updating an existing API should not remove existing fields unless there is a really good reason to do so. \
The same applies to status responses. If you notice a problem, feel free to leave a comment in the code for future refactoring to API v2 (which is currently not planned).
### Adding/Maintaining API routes
All expected results (errors, success, fail messages) must be documented ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L319-L327)). \
All JSON input types must be defined as a struct in [modules/structs/](modules/structs/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L76-L91)) \
and referenced in [routers/api/v1/swagger/options.go](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/options.go). \
They can then be used like [this example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L318). \
All JSON responses must be defined as a struct in [modules/structs/](modules/structs/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L36-L68)) \
and referenced in its category in [routers/api/v1/swagger/](routers/api/v1/swagger/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/issue.go#L11-L16)) \
They can be used like [this example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L277-L279).
### When to use what HTTP method
In general, HTTP methods are chosen as follows:
- **GET** endpoints return the requested object(s) and status **OK (200)**
- **DELETE** endpoints return the status **No Content (204)** and no content either
- **POST** endpoints are used to **create** new objects (e.g. a User) and return the status **Created (201)** and the created object
- **PUT** endpoints are used to **add/assign** existing Objects (e.g. a user to a team) and return the status **No Content (204)** and no content either
- **PATCH** endpoints are used to **edit/change** an existing object and return the changed object and the status **OK (200)**
### Requirements for API routes
All parameters of endpoints changing/editing an object must be optional (except the ones to identify the object, which are required).
Endpoints returning lists must
- support pagination (`page` & `limit` options in query)
- set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444))
## Backports and Frontports
### What is backported?
We backport PRs given the following circumstances:
1. Feature freeze is active, but `<version>-rc0` has not been released yet. Here, we backport as much as possible. <!-- TODO: Is that our definition with the new backport bot? -->
2. `rc0` has been released. Here, we only backport bug- and security-fixes, and small enhancements. Large PRs such as refactors are not backported anymore. <!-- TODO: Is that our definition with the new backport bot? -->
3. We never backport new features.
4. We never backport breaking changes except when
1. The breaking change has no effect on the vast majority of users
2. The component triggering the breaking change is marked as experimental
### How to backport?
In the past, it was necessary to manually backport your PRs. \
Now, that's not a requirement anymore as our [backport bot](https://github.com/GiteaBot) tries to create backports automatically once the PR is merged when the PR
- does not have the label `backport/manual`
- has the label `backport/<version>`
The `backport/manual` label signifies either that you want to backport the change yourself, or that there were conflicts when backporting, thus you **must** do it yourself.
### Format of backport PRs
The title of backport PRs should be
```
<original PR title> (#<original pr number>)
```
The first two lines of the summary of the backporting PR should be
```
Backport #<original pr number>
```
with the rest of the summary and labels matching the original PR.
### Frontports
Frontports behave exactly as described above for backports.
## Developer Certificate of Origin (DCO)
We consider the act of contributing to the code by submitting a Pull Request as the "Sign off" or agreement to the certifications and terms of the [DCO](DCO) and [MIT license](LICENSE). \
No further action is required. \
You can also decide to sign off your commits by adding the following line at the end of your commit messages:
```
Signed-off-by: Joe Smith <joe.smith@email.com>
```
If you set the `user.name` and `user.email` Git config options, you can add the line to the end of your commits automatically with `git commit -s`.
We assume in good faith that the information you provide is legally binding.
## Release Cycle
We adopted a release schedule to streamline the process of working on, finishing, and issuing releases. \
The overall goal is to make a major release every three or four months, which breaks down into two or three months of general development followed by one month of testing and polishing known as the release freeze. \
All the feature pull requests should be
merged before feature freeze. And, during the frozen period, a corresponding
release branch is open for fixes backported from main branch. Release candidates
are made during this period for user testing to
obtain a final version that is maintained in this branch.
During a development cycle, we may also publish any necessary minor releases
for the previous version. For example, if the latest, published release is
v1.2, then minor changes for the previous release—e.g., v1.1.0 -> v1.1.1—are
still possible.
## Maintainers
To make sure every PR is checked, we have [maintainers](MAINTAINERS). \
Every PR **must** be reviewed by at least two maintainers (or owners) before it can get merged. \
For refactoring PRs after a week and documentation only PRs, the approval of only one maintainer is enough. \
A maintainer should be a contributor of Gitea and contributed at least
4 accepted PRs. A contributor should apply as a maintainer in the
[Discord](https://discord.gg/Gitea) `#develop` channel. The team maintainers may invite the contributor. A maintainer
should spend some time on code reviews. If a maintainer has no
time to do that, they should apply to leave the maintainers team
and we will give them the honor of being a member of the [advisors
team](https://github.com/orgs/go-gitea/teams/advisors). Of course, if
an advisor has time to code review, we will gladly welcome them back
to the maintainers team. If a maintainer is inactive for more than 3
months and forgets to leave the maintainers team, the owners may move
him or her from the maintainers team to the advisors team.
For security reasons, Maintainers should use 2FA for their accounts and
if possible provide GPG signed commits.
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
https://help.github.com/articles/signing-commits-with-gpg/
## Technical Oversight Committee (TOC)
At the start of 2023, the `Owners` team was dissolved. Instead, the governance charter proposed a technical oversight committee (TOC) which expands the ownership team of the Gitea project from three elected positions to six positions. Three positions would be elected as it has been over the past years, and the other three would consist of appointed members from the Gitea company.
https://blog.gitea.com/quarterly-23q1/
When the new community members have been elected, the old members will give up ownership to the newly elected members. For security reasons, TOC members or any account with write access (like a bot) must use 2FA.
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
### Current TOC members
- 2023-01-01 ~ 2023-12-31 - https://blog.gitea.com/quarterly-23q1/
- Company
- [Jason Song](https://gitea.com/wolfogre) <i@wolfogre.com>
- [Lunny Xiao](https://gitea.com/lunny) <xiaolunwen@gmail.com>
- [Matti Ranta](https://gitea.com/techknowlogick) <techknowlogick@gitea.io>
- Community
- [6543](https://gitea.com/6543) <6543@obermui.de>
- [Andrew Thornton](https://gitea.com/zeripath) <art27@cantab.net>
- [John Olheiser](https://gitea.com/jolheiser) <john.olheiser@gmail.com>
### Previous TOC/owners members
Here's the history of the owners and the time they served:
- [Lunny Xiao](https://gitea.com/lunny) - 2016, 2017, [2018](https://github.com/go-gitea/gitea/issues/3255), [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872)
- [Kim Carlbäcker](https://github.com/bkcsoft) - 2016, 2017
- [Thomas Boerger](https://gitea.com/tboerger) - 2016, 2017
- [Lauris Bukšis-Haberkorns](https://gitea.com/lafriks) - [2018](https://github.com/go-gitea/gitea/issues/3255), [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801)
- [Matti Ranta](https://gitea.com/techknowlogick) - [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872)
- [Andrew Thornton](https://gitea.com/zeripath) - [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872)
## Governance Compensation
Each member of the community elected TOC will be granted $500 each month as compensation for their work.
Furthermore, any community release manager for a specific release or LTS will be compensated $500 for the delivery of said release.
These funds will come from community sources like the OpenCollective rather than directly from the company.
Only non-company members are eligible for this compensation, and if a member of the community TOC takes the responsibility of release manager, they would only be compensated for their TOC duties.
Gitea Ltd employees are not eligible to receive any funds from the OpenCollective unless it is reimbursement for a purchase made for the Gitea project itself.
## TOC & Working groups
With Gitea covering many projects outside of the main repository, several groups will be created to help focus on specific areas instead of requiring maintainers to be a jack-of-all-trades. Maintainers are of course more than welcome to be part of multiple groups should they wish to contribute in multiple places.
The currently proposed groups are:
- **Core Group**: maintain the primary Gitea repository
- **Integration Group**: maintain the Gitea ecosystem's related tools, including go-sdk/tea/changelog/bots etc.
- **Documentation Group**: maintain related documents and repositories
- **Translation Group**: coordinate with translators and maintain translations
- **Security Group**: managed by TOC directly, members are decided by TOC, maintains security patches/responsible for security items
## Roadmap
Each year a roadmap will be discussed with the entire Gitea maintainers team, and feedback will be solicited from various stakeholders.
TOC members need to review the roadmap every year and work together on the direction of the project.
When a vote is required for a proposal or other change, the vote of community elected TOC members count slightly more than the vote of company elected TOC members. With this approach, we both avoid ties and ensure that changes align with the mission statement and community opinion.
You can visit our roadmap on the wiki.
## Versions
Gitea has the `main` branch as a tip branch and has version branches
such as `release/v1.19`. `release/v1.19` is a release branch and we will
tag `v1.19.0` for binary download. If `v1.19.0` has bugs, we will accept
pull requests on the `release/v1.19` branch and publish a `v1.19.1` tag,
after bringing the bug fix also to the main branch.
Since the `main` branch is a tip version, if you wish to use Gitea
in production, please download the latest release tag version. All the
branches will be protected via GitHub, all the PRs to every branch must
be reviewed by two maintainers and must pass the automatic tests.
## Releasing Gitea
- Let $vmaj, $vmin and $vpat be Major, Minor and Patch version numbers, $vpat should be rc1, rc2, 0, 1, ...... $vmaj.$vmin will be kept the same as milestones on github or gitea in future.
- Before releasing, confirm all the version's milestone issues or PRs has been resolved. Then discuss the release on Discord channel #maintainers and get agreed with almost all the owners and mergers. Or you can declare the version and if nobody against in about serval hours.
- If this is a big version first you have to create PR for changelog on branch `main` with PRs with label `changelog` and after it has been merged do following steps:
- Create `-dev` tag as `git tag -s -F release.notes v$vmaj.$vmin.0-dev` and push the tag as `git push origin v$vmaj.$vmin.0-dev`.
- When CI has finished building tag then you have to create a new branch named `release/v$vmaj.$vmin`
- If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged.
- Add a tag as `git tag -s -F release.notes v$vmaj.$vmin.$`, release.notes file could be a temporary file to only include the changelog this version which you added to `CHANGELOG.md`.
- And then push the tag as `git push origin v$vmaj.$vmin.$`. Drone CI will automatically create a release and upload all the compiled binary. (But currently it doesn't add the release notes automatically. Maybe we should fix that.)
- If needed send a frontport PR for the changelog to branch `main` and update the version in `docs/config.yaml` to refer to the new version.
- Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release.
- Verify all release assets were correctly published through CI on dl.gitea.com and GitHub releases. Once ACKed:
- bump the version of https://dl.gitea.com/gitea/version.json
- merge the blog post PR
- announce the release in discord `#announcements`
- [Release management](https://forgejo.org/docs/latest/developer/release/)
- [Secrets](https://forgejo.org/docs/latest/developer/secrets/)

View file

@ -1,5 +1,6 @@
# Build stage
FROM docker.io/library/golang:1.21-alpine3.18 AS build-env
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21-alpine3.18 as build-env
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
@ -9,24 +10,33 @@ ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata timetzdata $TAGS"
ARG CGO_EXTRA_CFLAGS
# Build deps
RUN apk --no-cache add \
build-base \
git \
nodejs \
npm \
&& rm -rf /var/cache/apk/*
#
# Transparently cross compile for the target platform
#
COPY --from=xx / /
ARG TARGETPLATFORM
RUN apk --no-cache add clang lld
RUN xx-apk --no-cache add gcc musl-dev
ENV CGO_ENABLED=1
RUN xx-go --wrap
#
# for go generate and binfmt to find
# without it the generate phase will fail with
# #19 25.04 modules/public/public_bindata.go:8: running "go": exit status 1
# #19 25.39 aarch64-binfmt-P: Could not open '/lib/ld-musl-aarch64.so.1': No such file or directory
# why exactly is it needed? where is binfmt involved?
#
RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true
RUN apk --no-cache add build-base git nodejs npm
# Setup repo
COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
# Checkout version if set
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
&& make clean-all build
# Begin env-to-ini build
RUN go build contrib/environment-to-ini/environment-to-ini.go
RUN make clean-all
RUN make frontend
RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini
RUN make go-check generate-backend static-executable && xx-verify gitea
# Copy local files
COPY docker/root /tmp/local
@ -42,7 +52,7 @@ RUN chmod 755 /tmp/local/usr/bin/entrypoint \
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
FROM docker.io/library/alpine:3.18
LABEL maintainer="maintainers@gitea.io"
LABEL maintainer="contact@forgejo.org"
EXPOSE 22 3000
@ -69,10 +79,10 @@ RUN addgroup \
-s /bin/bash \
-u 1000 \
-G git \
git && \
echo "git:*" | chpasswd -e
_gitea && \
echo "_gitea:*" | chpasswd -e
ENV USER git
ENV USER _gitea
ENV GITEA_CUSTOM /data/gitea
VOLUME ["/data"]
@ -81,6 +91,7 @@ ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
COPY --from=build-env /tmp/local /
RUN cd /usr/local/bin ; ln -s gitea forgejo
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh

View file

@ -1,5 +1,6 @@
# Build stage
FROM docker.io/library/golang:1.21-alpine3.18 AS build-env
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21-alpine3.18 as build-env
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
@ -9,24 +10,33 @@ ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata timetzdata $TAGS"
ARG CGO_EXTRA_CFLAGS
#Build deps
RUN apk --no-cache add \
build-base \
git \
nodejs \
npm \
&& rm -rf /var/cache/apk/*
#
# Transparently cross compile for the target platform
#
COPY --from=xx / /
ARG TARGETPLATFORM
RUN apk --no-cache add clang lld
RUN xx-apk --no-cache add gcc musl-dev
ENV CGO_ENABLED=1
RUN xx-go --wrap
#
# for go generate and binfmt to find
# without it the generate phase will fail with
# #19 25.04 modules/public/public_bindata.go:8: running "go": exit status 1
# #19 25.39 aarch64-binfmt-P: Could not open '/lib/ld-musl-aarch64.so.1': No such file or directory
# why exactly is it needed? where is binfmt involved?
#
RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true
RUN apk --no-cache add build-base git nodejs npm
# Setup repo
COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
# Checkout version if set
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
&& make clean-all build
# Begin env-to-ini build
RUN go build contrib/environment-to-ini/environment-to-ini.go
RUN make clean-all
RUN make frontend
RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini
RUN make go-check generate-backend static-executable && xx-verify gitea
# Copy local files
COPY docker/rootless /tmp/local
@ -40,7 +50,7 @@ RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
FROM docker.io/library/alpine:3.18
LABEL maintainer="maintainers@gitea.io"
LABEL maintainer="contact@forgejo.org"
EXPOSE 2222 3000
@ -69,18 +79,19 @@ RUN mkdir -p /var/lib/gitea /etc/gitea
RUN chown git:git /var/lib/gitea /etc/gitea
COPY --from=build-env /tmp/local /
RUN cd /usr/local/bin ; ln -s gitea forgejo
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
# git:git
#git:git
USER 1000:1000
ENV GITEA_WORK_DIR /var/lib/gitea
ENV GITEA_CUSTOM /var/lib/gitea/custom
ENV GITEA_TEMP /tmp/gitea
ENV TMPDIR /tmp/gitea
# TODO add to docs the ability to define the ini to load (useful to test and revert a config)
#TODO add to docs the ability to define the ini to load (useful to test and revert a config)
ENV GITEA_APP_INI /etc/gitea/app.ini
ENV HOME "/var/lib/gitea/git"
VOLUME ["/var/lib/gitea", "/etc/gitea"]
@ -88,3 +99,4 @@ WORKDIR /var/lib/gitea
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"]
CMD []

View file

@ -1,3 +1,4 @@
Copyright (c) 2022 The Forgejo Authors
Copyright (c) 2016 The Gitea Authors
Copyright (c) 2015 The Gogs Authors

100
Makefile
View file

@ -79,33 +79,19 @@ endif
STORED_VERSION_FILE := VERSION
HUGO_VERSION ?= 0.111.3
GITHUB_REF_TYPE ?= branch
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
ifneq ($(GITHUB_REF_TYPE),branch)
VERSION ?= $(subst v,,$(GITHUB_REF_NAME))
GITEA_VERSION ?= $(VERSION)
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
ifneq ($(STORED_VERSION),)
GITEA_VERSION ?= $(STORED_VERSION)
else
ifneq ($(GITHUB_REF_NAME),)
VERSION ?= $(subst release/v,,$(GITHUB_REF_NAME))
else
VERSION ?= main
endif
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
ifneq ($(STORED_VERSION),)
GITEA_VERSION ?= $(STORED_VERSION)
else
GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
endif
GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
endif
VERSION = ${GITEA_VERSION}
# if version = "main" then update version to "nightly"
ifeq ($(VERSION),main)
VERSION := main-nightly
endif
# SemVer
FORGEJO_VERSION := 6.0.8+0-gitea-1.21.8
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)" -X "code.gitea.io/gitea/routers/api/forgejo/v1.ForgejoVersion=$(FORGEJO_VERSION)" -X "main.ForgejoVersion=$(FORGEJO_VERSION)"
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
@ -157,11 +143,14 @@ ifdef DEPS_PLAYWRIGHT
PLAYWRIGHT_FLAGS += --with-deps
endif
FORGEJO_API_SPEC := public/assets/forgejo/api.v1.yml
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|g
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|"basePath": "/api/v1"|g
SWAGGER_EXCLUDE := code.gitea.io/sdk
SWAGGER_NEWLINE_COMMAND := -e '$$a\'
SWAGGER_SPEC_BRANDING := s|Gitea API|Forgejo API|g
TEST_MYSQL_HOST ?= mysql:3306
TEST_MYSQL_DBNAME ?= testgitea
@ -237,6 +226,8 @@ help:
@echo " - generate-license update license files"
@echo " - generate-gitignore update gitignore files"
@echo " - generate-manpage generate manpage"
@echo " - generate-forgejo-api generate the forgejo API from spec"
@echo " - forgejo-api-validate check if the forgejo API matches the specs"
@echo " - generate-swagger generate the swagger spec from code comments"
@echo " - swagger-validate check if the swagger spec is valid"
@echo " - go-licenses regenerate go licenses"
@ -322,6 +313,27 @@ ifneq "$(TAGS)" "$(shell cat $(TAGS_EVIDENCE) 2>/dev/null)"
TAGS_PREREQ := $(TAGS_EVIDENCE)
endif
OAPI_CODEGEN_PACKAGE ?= github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.12.4
KIN_OPENAPI_CODEGEN_PACKAGE ?= github.com/getkin/kin-openapi/cmd/validate@v0.114.0
FORGEJO_API_SERVER = routers/api/forgejo/v1/generated.go
.PHONY: generate-forgejo-api
generate-forgejo-api: $(FORGEJO_API_SPEC)
$(GO) run $(OAPI_CODEGEN_PACKAGE) -package v1 -generate chi-server,types $< > $(FORGEJO_API_SERVER)
.PHONY: forgejo-api-check
forgejo-api-check: generate-forgejo-api
@diff=$$(git diff $(FORGEJO_API_SERVER) ; \
if [ -n "$$diff" ]; then \
echo "Please run 'make generate-forgejo-api' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi
.PHONY: forgejo-api-validate
forgejo-api-validate:
$(GO) run $(KIN_OPENAPI_CODEGEN_PACKAGE) $(FORGEJO_API_SPEC)
.PHONY: generate-swagger
generate-swagger: $(SWAGGER_SPEC)
@ -329,6 +341,7 @@ $(SWAGGER_SPEC): $(GO_SOURCES_NO_BINDATA)
$(GO) run $(SWAGGER_PACKAGE) generate spec -x "$(SWAGGER_EXCLUDE)" -o './$(SWAGGER_SPEC)'
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
$(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)'
$(SED_INPLACE) '$(SWAGGER_SPEC_BRANDING)' './$(SWAGGER_SPEC)'
.PHONY: swagger-check
swagger-check: generate-swagger
@ -352,7 +365,7 @@ checks: checks-frontend checks-backend
checks-frontend: lockfile-check svg-check
.PHONY: checks-backend
checks-backend: tidy-check swagger-check fmt-check misspell-check swagger-validate security-check
checks-backend: tidy-check swagger-check fmt-check misspell-check forgejo-api-validate swagger-validate security-check
.PHONY: lint
lint: lint-frontend lint-backend
@ -398,11 +411,11 @@ lint-md: node_modules
.PHONY: lint-go
lint-go:
$(GO) run $(GOLANGCI_LINT_PACKAGE) run
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS)
.PHONY: lint-go-fix
lint-go-fix:
$(GO) run $(GOLANGCI_LINT_PACKAGE) run --fix
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS) --fix
# workaround step for the lint-go-windows CI task because 'go run' can not
# have distinct GOOS/GOARCH for its build and run steps
@ -414,8 +427,7 @@ lint-go-windows:
.PHONY: lint-go-vet
lint-go-vet:
@echo "Running go vet..."
@GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet
@$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)
@$(GO) vet $(GO_PACKAGES)
.PHONY: lint-editorconfig
lint-editorconfig:
@ -824,10 +836,14 @@ generate: generate-backend
generate-backend: $(TAGS_PREREQ) generate-go
.PHONY: generate-go
generate-go: $(TAGS_PREREQ)
generate-go: $(TAGS_PREREQ) merge-locales
@echo "Running go generate..."
@CC= GOOS= GOARCH= $(GO) generate -tags '$(TAGS)' $(GO_PACKAGES)
.PHONY: merge-locales
merge-locales:
@CC= GOOS= GOARCH= $(GO) run build/merge-forgejo-locales.go
.PHONY: security-check
security-check:
go run $(GOVULNCHECK_PACKAGE) ./...
@ -835,8 +851,17 @@ security-check:
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
forgejo: $(EXECUTABLE)
ln -f $(EXECUTABLE) forgejo
static-executable: $(GO_SOURCES) $(TAGS_PREREQ)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE)
.PHONY: release
release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-docs release-check
release: frontend generate release-linux release-copy release-compress vendor release-sources release-check
# just the sources, with all assets builtin and frontend resources generated
sources-tarbal: frontend generate vendor release-sources release-check
$(DIST_DIRS):
mkdir -p $(DIST_DIRS)
@ -850,7 +875,10 @@ endif
.PHONY: release-linux
release-linux: | $(DIST_DIRS)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out gitea-$(VERSION) .
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out forgejo-$(VERSION) .
ifeq ($(CI),true)
cp /build/* $(DIST)/binaries
endif
.PHONY: release-darwin
release-darwin: | $(DIST_DIRS)
@ -878,8 +906,8 @@ release-sources: | $(DIST_DIRS)
# bsdtar needs a ^ to prevent matching subdirectories
$(eval EXCL := --exclude=$(shell tar --help | grep -q bsdtar && echo "^")./)
# use transform to a add a release-folder prefix; in bsdtar the transform parameter equivalent is -s
$(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./gitea-src-$(VERSION)/'" || echo "--transform 's|^./|gitea-src-$(VERSION)/|'"))
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
$(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./forgejo-src-$(VERSION)/'" || echo "--transform 's|^./|forgejo-src-$(VERSION)/|'"))
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/forgejo-src-$(VERSION).tar.gz .
rm -f $(STORED_VERSION_FILE)
.PHONY: release-docs
@ -991,13 +1019,7 @@ lockfile-check:
.PHONY: update-translations
update-translations:
mkdir -p ./translations
cd ./translations && curl -L https://crowdin.com/download/project/gitea.zip > gitea.zip && unzip gitea.zip
rm ./translations/gitea.zip
$(SED_INPLACE) -e 's/="/=/g' -e 's/"$$//g' ./translations/*.ini
$(SED_INPLACE) -e 's/\\"/"/g' ./translations/*.ini
mv ./translations/*.ini ./options/locale/
rmdir ./translations
# noop to detect merge conflicts (potentially needs updating the scripts) and avoid breaking with Gitea
.PHONY: generate-license
generate-license:

201
README.md
View file

@ -1,177 +1,46 @@
<p align="center">
<a href="https://gitea.io/">
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/assets/img/gitea.svg" width="220"/>
</a>
</p>
<h1 align="center">Gitea - Git with a cup of tea</h1>
<div align="center">
<img src="./assets/logo.svg" alt="" width="192" align="center" />
<h1 align="center">Welcome to Forgejo</h1>
</div>
<p align="center">
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/main">
</a>
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
<img src="https://img.shields.io/discord/322538954119184384.svg">
</a>
<a href="https://app.codecov.io/gh/go-gitea/gitea" title="Codecov">
<img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
</a>
<a href="https://goreportcard.com/report/code.gitea.io/gitea" title="Go Report Card">
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
</a>
<a href="https://pkg.go.dev/code.gitea.io/gitea" title="GoDoc">
<img src="https://pkg.go.dev/badge/code.gitea.io/gitea?status.svg">
</a>
<a href="https://github.com/go-gitea/gitea/releases/latest" title="GitHub release">
<img src="https://img.shields.io/github/release/go-gitea/gitea.svg">
</a>
<a href="https://www.codetriage.com/go-gitea/gitea" title="Help Contribute to Open Source">
<img src="https://www.codetriage.com/go-gitea/gitea/badges/users.svg">
</a>
<a href="https://opencollective.com/gitea" title="Become a backer/sponsor of gitea">
<img src="https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen">
</a>
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
</a>
<a href="https://gitpod.io/#https://github.com/go-gitea/gitea">
<img
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
alt="Contribute with Gitpod"
/>
</a>
<a href="https://crowdin.com/project/gitea" title="Crowdin">
<img src="https://badges.crowdin.net/gitea/localized.svg">
</a>
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
</a>
<a href="https://app.bountysource.com/teams/gitea" title="Bountysource">
<img src="https://img.shields.io/bountysource/team/gitea/activity">
</a>
</p>
Hi there! Tired of big platforms playing monopoly?
Providing Git hosting for your project, friends, company or community?
**Forgejo** (/for'd&#865;ʒe.jo/ inspired by forĝejo the Esperanto word for *forge*) has you covered with its intuitive interface,
light and easy hosting and a lot of builtin functionality.
<p align="center">
<a href="README_ZH.md">View this document in Chinese</a>
</p>
Forgejo was [created in 2022](https://forgejo.org/2022-12-15-hello-forgejo/)
because we think that the project should be owned by an independent community.
If you second that, then Forgejo is for you!
Our promise: **Independent Free/Libre Software forever!**
## Purpose
## What does Forgejo offer?
The goal of this project is to make the easiest, fastest, and most
painless way of setting up a self-hosted Git service.
<!-- If you want to know what Forgejo is like,
you can check out public instances,
e.g. [Codeberg.org](https://codeberg.org).
-->
As Gitea is written in Go, it works across **all** the platforms and
architectures that are supported by Go, including Linux, macOS, and
Windows on x86, amd64, ARM and PowerPC architectures.
You can try it out using [the online demo](https://try.gitea.io/).
This project has been
[forked](https://blog.gitea.com/welcome-to-gitea/) from
[Gogs](https://gogs.io) since November of 2016, but a lot has changed.
If you like any of the following, Forgejo is literally meant for you:
## Building
- Lightweight: Forgejo can easily be hosted on nearly **every machine**.
Running on a Raspberry? Small cloud instance? No problem!
- Project management: Besides Git hosting, Forgejo offers issues,
pull requests, wikis, kanban boards and much more to **coordinate with your team**.
- Publishing: Have something to share? Use **releases** to host your software for download,
or use the **package registry** to publish it for docker, npm and many other package managers.
- Customizable: Want to change your look? Change some settings?
There are many **config switches** to make Forgejo work exactly like you want.
- Powerful: Organizations & team permissions, CI integration, Code Search, LDAP, OAuth and much more.
If you have **advanced needs**, Forgejo has you covered.
- Privacy: From update checker to default settings: Forgejo is built to be **privacy first** for you and your crew.
- Federation: (WIP) We are actively working to connect software forges with each other through **ActivityPub**,
and create a collaborative network of personal instances.
From the root of the source tree, run:
## Learn more
TAGS="bindata" make build
Dive into the [documentation](https://forgejo.org/docs/latest/), subscribe to releases and blog post on [our website](https://forgejo.org), <a href="https://floss.social/@forgejo" rel="me">find us on the Fediverse</a> or hop into [our Matrix room](https://matrix.to/#/#forgejo-chat:matrix.org) if you have any questions or want to get involved.
or if SQLite support is required:
TAGS="bindata sqlite sqlite_unlock_notify" make build
## Get involved
The `build` target is split into two sub-targets:
- `make backend` which requires [Go Stable](https://go.dev/dl/), the required version is defined in [go.mod](/go.mod).
- `make frontend` which requires [Node.js LTS](https://nodejs.org/en/download/) or greater.
Internet connectivity is required to download the go and npm modules. When building from the official source tarballs which include pre-built frontend files, the `frontend` target will not be triggered, making it possible to build without Node.js.
Parallelism (`make -j <num>`) is not supported.
More info: https://docs.gitea.com/installation/install-from-source
## Using
./gitea web
NOTE: If you're interested in using our APIs, we have experimental
support with [documentation](https://try.gitea.io/api/swagger).
## Contributing
Expected workflow is: Fork -> Patch -> Push -> Pull Request
NOTES:
1. **YOU MUST READ THE [CONTRIBUTORS GUIDE](CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST.**
2. If you have found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks!
## Translating
Translations are done through Crowdin. If you want to translate to a new language ask one of the managers in the Crowdin project to add a new language there.
You can also just create an issue for adding a language or ask on discord on the #translation channel. If you need context or find some translation issues, you can leave a comment on the string or ask on Discord. For general translation questions there is a section in the docs. Currently a bit empty but we hope to fill it as questions pop up.
https://docs.gitea.com/contributing/localization
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
## Further information
For more information and instructions about how to install Gitea, please look at our [documentation](https://docs.gitea.com/).
If you have questions that are not covered by the documentation, you can get in contact with us on our [Discord server](https://discord.gg/Gitea) or create a post in the [discourse forum](https://discourse.gitea.io/).
We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea).
The official Gitea CLI is developed at [gitea/tea](https://gitea.com/gitea/tea).
## Authors
- [Maintainers](https://github.com/orgs/go-gitea/people)
- [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
- [Translators](options/locale/TRANSLATORS)
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/gitea#backer)]
<a href="https://opencollective.com/gitea#backers" target="_blank"><img src="https://opencollective.com/gitea/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/gitea#sponsor)]
<a href="https://opencollective.com/gitea/sponsor/0/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/1/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/2/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/3/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/4/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/5/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/6/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/7/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/9/avatar.svg"></a>
## FAQ
**How do you pronounce Gitea?**
Gitea is pronounced [/ɡɪti:/](https://youtu.be/EM71-2uDAoY) as in "gi-tea" with a hard g.
**Why is this not hosted on a Gitea instance?**
We're [working on it](https://github.com/go-gitea/gitea/issues/1029).
## License
This project is licensed under the MIT License.
See the [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) file
for the full license text.
## Screenshots
Looking for an overview of the interface? Check it out!
|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)|
|:---:|:---:|:---:|
|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)|
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|
If you are interested in making Forgejo better, either by reporting a bug or by changing the governance, please [take a look at the contribution guide](CONTRIBUTING.md).

View file

@ -1,98 +0,0 @@
<p align="center">
<a href="https://gitea.io/">
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/assets/img/gitea.svg" width="220"/>
</a>
</p>
<h1 align="center">Gitea - Git with a cup of tea</h1>
<p align="center">
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/main">
</a>
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
<img src="https://img.shields.io/discord/322538954119184384.svg">
</a>
<a href="https://app.codecov.io/gh/go-gitea/gitea" title="Codecov">
<img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
</a>
<a href="https://goreportcard.com/report/code.gitea.io/gitea" title="Go Report Card">
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
</a>
<a href="https://pkg.go.dev/code.gitea.io/gitea" title="GoDoc">
<img src="https://pkg.go.dev/badge/code.gitea.io/gitea?status.svg">
</a>
<a href="https://github.com/go-gitea/gitea/releases/latest" title="GitHub release">
<img src="https://img.shields.io/github/release/go-gitea/gitea.svg">
</a>
<a href="https://www.codetriage.com/go-gitea/gitea" title="Help Contribute to Open Source">
<img src="https://www.codetriage.com/go-gitea/gitea/badges/users.svg">
</a>
<a href="https://opencollective.com/gitea" title="Become a backer/sponsor of gitea">
<img src="https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen">
</a>
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
</a>
<a href="https://gitpod.io/#https://github.com/go-gitea/gitea">
<img
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
alt="Contribute with Gitpod"
/>
</a>
<a href="https://crowdin.com/project/gitea" title="Crowdin">
<img src="https://badges.crowdin.net/gitea/localized.svg">
</a>
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
</a>
<a href="https://app.bountysource.com/teams/gitea" title="Bountysource">
<img src="https://img.shields.io/bountysource/team/gitea/activity">
</a>
</p>
<p align="center">
<a href="README.md">View this document in English</a>
</p>
## 目标
Gitea 的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用 Go 作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了 x86amd64还包括 ARM 和 PowerPC。
如果您想试用一下,请访问 [在线Demo](https://try.gitea.io/)
## 提示
1. **开始贡献代码之前请确保你已经看过了 [贡献者向导(英文)](CONTRIBUTING.md)**.
2. 所有的安全问题,请私下发送邮件给 **security@gitea.io**。谢谢!
3. 如果你要使用API请参见 [API 文档](https://godoc.org/code.gitea.io/sdk/gitea).
## 文档
关于如何安装请访问我们的 [文档站](https://docs.gitea.com/zh-cn/category/installation),如果没有找到对应的文档,你也可以通过 [Discord - 英文](https://discord.gg/gitea) 和 QQ群 328432459 来和我们交流。
## 贡献流程
Fork -> Patch -> Push -> Pull Request
## 翻译
多语言翻译是基于Crowdin进行的.
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
## 作者
* [Maintainers](https://github.com/orgs/go-gitea/people)
* [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
* [Translators](options/locale/TRANSLATORS)
## 授权许可
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) 文件中。
## 截图
|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)|
|:---:|:---:|:---:|
|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)|
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|

1248
RELEASE-NOTES.md Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,85 +0,0 @@
# Reporting security issues
The Gitea maintainers take security seriously.
If you discover a security issue, please bring it to their attention right away!
Previous vulnerabilities are listed at https://about.gitea.com/security.
## Reporting a Vulnerability
Please **DO NOT** file a public issue, instead send your report privately to `security@gitea.io`.
## Protecting Security Information
Due to the sensitive nature of security information, you can use below GPG public key encrypt your mail body.
The PGP key is valid until June 24, 2024.
```
Key ID: 6FCD2D5B
Key Type: RSA
Expires: 6/24/2024
Key Size: 4096/4096
Fingerprint: 3DE0 3D1E 144A 7F06 9359 99DC AAFD 2381 6FCD 2D5B
```
UserID: Gitea Security <security@gitea.io>
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGK1Z/4BEADFMqXA9DeeChmSxUjF0Be5sq99ZUhgrZjcN/wOzz0wuCJZC0l8
4uC+d6mfv7JpJYlzYzOK97/x5UguKHkYNZ6mm1G9KHaXmoIBDLKDzfPdJopVNv2r
OajijaE0uMCnMjadlg5pbhMLRQG8a9J32yyaz7ZEAw72Ab31fvvcA53NkuqO4j2w
k7dtFQzhbNOYV0VffQT90WDZdalYHB1JHyEQ+70U9OjVD5ggNYSzX98Eu3Hjn7V7
kqFrcAxr5TE1elf0IXJcuBJtFzQSTUGlQldKOHtGTGgGjj9r/FFAE5ioBgVD05bV
rEEgIMM/GqYaG/nbNpWE6P3mEc2Mnn3pZaRJL0LuF26TLjnqEcMMDp5iIhLdFzXR
3tMdtKgQFu+Mtzs3ipwWARYgHyU09RJsI2HeBx7RmZO/Xqrec763Z7zdJ7SpCn0Z
q+pHZl24JYR0Kf3T/ZiOC0cGd2QJqpJtg5J6S/OqfX9NH6MsCczO8pUC1N/aHH2X
CTme2nF56izORqDWKoiICteL3GpYsCV9nyCidcCmoQsS+DKvE86YhIhVIVWGRY2F
lzpAjnN9/KLtQroutrm+Ft0mdjDiJUeFVl1cOHDhoyfCsQh62HumoyZoZvqzQd6e
AbN11nq6aViMe2Q3je1AbiBnRnQSHxt1Tc8X4IshO3MQK1Sk7oPI6LA5oQARAQAB
tCJHaXRlYSBTZWN1cml0eSA8c2VjdXJpdHlAZ2l0ZWEuaW8+iQJXBBMBCABBFiEE
PeA9HhRKfwaTWZncqv0jgW/NLVsFAmK1Z/4CGwMFCQPCZwAFCwkIBwICIgIGFQoJ
CAsCBBYCAwECHgcCF4AACgkQqv0jgW/NLVvnyxAAhxyNnWzw/rQO2qhzqicmZM94
njSbOg+U2qMBvCdaqCQQeC+uaMmMzkDPanUUmLcyCkWqfCjPNjeSXAkE9npepVJI
4HtmgxZQ94OU/h3CLbft+9GVRzUkVI29TSYGdvNtV2/BkNGoFFnKWQr119um0o6A
bgha2Uy5uY8o3ZIoiKkiHRaEoWIjjeBxJxYAojsZY4YElUmsQ3ik2joG6rhFesTa
ofVt/bL8G2xzpOG26WGIxBbqf2qjV6OtZ0hu/vtTPHeIWMLq0Mz0V3PEDQWfkGPE
i2RYxxYDs2xzJhSQWqTNVLSq0m5xTJnbHhQPfdCX4C2jvFKgLdfmytQq49S7jiJb
Z03HVOZ/PsyBlQfH9xJi06R5yQCMEA8h8Z5r3/NXW09kQ6OFRe6xshoTcxZGRPTo
srhwr3uPbmCRh+YEl7qBLU6+BC5k8IRTZXqhrj/aPJu3MxgbgwV8u3vLoFSXM2lb
a61FgeCQ0O7lkgVswwF0RppCaH9Ul3ZDapet/vCRg4NVwm9zOI/8q/Vj0FKA1GDR
JhRu8+Ce8zlFL65D34t+PprAzSeTlbv9um3x/ZIjCco7EEKSBylt+AZj/VyA6+e5
kjOQwRRc6dFJWBcorsSI2dG+H+QMF7ZabzmeCcz1v9HjLOPzYHoZAHhCmSppWTvX
AJy6+lhfW2OUTqQeYSi5Ag0EYrVn/gEQALrFLQjCR3GjuHSindz0rd3Fnx/t7Sen
T+p07yCSSoSlmnJHCQmwh4vfg1blyz0zZ4vkIhtpHsEgc+ZAG+WQXSsJ2iRz+eSN
GwoOQl4XC3n+QWkc1ws+btr48+6UqXIQU+F8TPQyx/PIgi2nZXJB7f5+mjCqsk46
XvH4nTr4kJjuqMSR/++wvre2qNQRa/q/dTsK0OaN/mJsdX6Oi+aGNaQJUhIG7F+E
ZDMkn/O6xnwWNzy/+bpg43qH/Gk0eakOmz5NmQLRkV58SZLiJvuCUtkttf6CyhnX
03OcWaajv5W8qA39dBYQgDrrPbBWUnwfO3yMveqhwV4JjDoe8sPAyn1NwzakNYqP
RzsWyLrLS7R7J9s3FkZXhQw/QQcsaSMcGNQO047dm1P83N8JY5aEpiRo9zSWjoiw
qoExANj5lUTZPe8M50lI182FrcjAN7dClO3QI6pg7wy0erMxfFly3j8UQ91ysS9T
s+GsP9I3cmWWQcKYxWHtE8xTXnNCVPFZQj2nwhJzae8ypfOtulBRA3dUKWGKuDH/
axFENhUsT397aOU3qkP/od4a64JyNIEo4CTTSPVeWd7njsGqli2U3A4xL2CcyYvt
D/MWcMBGEoLSNTswwKdom4FaJpn5KThnK/T0bQcmJblJhoCtppXisbexZnCpuS0x
Zdlm2T14KJ3LABEBAAGJAjwEGAEIACYWIQQ94D0eFEp/BpNZmdyq/SOBb80tWwUC
YrVn/gIbDAUJA8JnAAAKCRCq/SOBb80tWyTBD/9AGpW6QoDF7zYjHAozH9S5RGCA
Y7E82dG/0xmFUwPprAG0BKmmgU6TiipyVGmKIXGYYYU92pMnbvXkYQMoa+WJNncN
D3fY52UeXeffTf4cFpStlzi9xgYtOLhFamzYu/4xhkjOX+xhOSXscCiFRyT8cF3B
O6c5BHU+Zj0/rGPgOyPUbx7l7B9MubB/41nNX35k08e+8T3wtWDb4XF+15HnRfva
6fblO8wgU25Orv2Rm1jnKGa9DxJ8nE40IMrqDapENtDuL+zKJsvR0+ptWvEyL56U
GtJJG5un6mXiLKuRQT0DEv4MdZRHDgDstDnqcbEiazVEbUuvhZZob6lRY2A19m1+
7zfnDxkhqCA1RCnv4fdvcPdCMMFHwLpdhjgW0aI/uwgwrvsEz5+JRlnLvdQHlPAg
q7l2fGcBSpz9U0ayyfRPjPntsNCtZl1UDxGLeciPkZhyG84zEWQbk/j52ZpRN+Ik
ALpRLa8RBFmFSmXDUmwQrmm1EmARyQXwweKU31hf8ZGbCp2lPuRYm1LuGiirXSVP
GysjRAJgW+VRpBKOzFQoUAUbReVWSaCwT8s17THzf71DdDb6CTj31jMLLYWwBpA/
i73DgobDZMIGEZZC1EKqza8eh11xfyHFzGec03tbh+lIen+5IiRtWiEWkDS9ll0G
zgS/ZdziCvdAutqnGA==
=gZWO
-----END PGP PUBLIC KEY BLOCK-----
```
Security reports are greatly appreciated and we will publicly thank you for it, although we keep your name confidential if you request it.

View file

@ -1,31 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve">
<g>
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8
c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4
c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
<g>
<g>
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2
c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5
c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5
c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3
c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1
C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4
c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7
S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55
c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8
l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4
c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1
c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9
c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3
c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3
c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29
c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8
C343.2,346.5,335,363.3,326.8,380.1z"/>
</g>
</g>
</g>
<svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
circle {
fill: none;
stroke: #000;
stroke-width: 15;
}
path {
fill: none;
stroke: #000;
stroke-width: 25;
}
.orange {
stroke:#ff6600;
}
.red {
stroke:#d40000;
}
</style>
<g transform="translate(6,6)">
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" class="orange" />
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" class="red" />
<circle cx="142" cy="20" r="18" class="orange" />
<circle cx="142" cy="88" r="18" class="red" />
<circle cx="58" cy="180" r="18" class="red" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 677 B

File diff suppressed because one or more lines are too long

View file

@ -1,31 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve">
<g>
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8
c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4
c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
<g>
<g>
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2
c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5
c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5
c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3
c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1
C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4
c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7
S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55
c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8
l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4
c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1
c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9
c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3
c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3
c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29
c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8
C343.2,346.5,335,363.3,326.8,380.1z"/>
</g>
</g>
</g>
<svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
circle {
fill: none;
stroke: #000;
stroke-width: 15;
}
path {
fill: none;
stroke: #000;
stroke-width: 25;
}
.orange {
stroke:#ff6600;
}
.red {
stroke:#d40000;
}
</style>
<g transform="translate(6,6)">
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" class="orange" />
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" class="red" />
<circle cx="142" cy="20" r="18" class="orange" />
<circle cx="142" cy="88" r="18" class="red" />
<circle cx="58" cy="180" r="18" class="red" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 677 B

View file

@ -0,0 +1,117 @@
// Copyright 2022 The Forgejo Authors c/o Codeberg e.V.. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
//go:build ignore
package main
import (
"bufio"
"log"
"os"
"regexp"
"strings"
"gopkg.in/ini.v1"
)
const (
trimPrefix = "gitea_"
sourceFolder = "options/locales/"
)
// returns list of locales, still containing the file extension!
func generate_locale_list() []string {
localeFiles, _ := os.ReadDir(sourceFolder)
locales := []string{}
for _, localeFile := range localeFiles {
if !localeFile.IsDir() && strings.HasPrefix(localeFile.Name(), trimPrefix) {
locales = append(locales, strings.TrimPrefix(localeFile.Name(), trimPrefix))
}
}
return locales
}
// replace all occurrences of Gitea with Forgejo
func renameGiteaForgejo(filename string) []byte {
file, err := os.Open(filename)
if err != nil {
panic(err)
}
replacements := []string{
"Gitea", "Forgejo",
"https://docs.gitea.com/installation/install-from-binary", "https://forgejo.org/download/#installation-from-binary",
"https://github.com/go-gitea/gitea/tree/master/docker", "https://forgejo.org/download/#container-image",
"https://docs.gitea.com/installation/install-from-package", "https://forgejo.org/download",
"https://code.gitea.io/gitea", "https://forgejo.org/download",
"code.gitea.io/gitea", "Forgejo",
`<a href="https://github.com/go-gitea/gitea/issues" target="_blank">GitHub</a>`, `<a href="https://codeberg.org/forgejo/forgejo/issues" target="_blank">Codeberg</a>`,
"https://github.com/go-gitea/gitea", "https://codeberg.org/forgejo/forgejo",
"https://blog.gitea.io", "https://forgejo.org/news",
"https://docs.gitea.com/usage/protected-tags", "https://forgejo.org/docs/latest/user/protection/#protected-tags",
"https://docs.gitea.com/usage/webhooks", "https://forgejo.org/docs/latest/user/webhooks/",
}
replacer := strings.NewReplacer(replacements...)
replaced := make(map[string]bool, len(replacements)/2)
count_replaced := func(original string) {
for i := 0; i < len(replacements); i += 2 {
if strings.Contains(original, replacements[i]) {
replaced[replacements[i]] = true
}
}
}
out := make([]byte, 0, 1024)
scanner := bufio.NewScanner(file)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
line := scanner.Text()
if strings.HasPrefix(line, "license_desc=") {
line = strings.Replace(line, "GitHub", "Forgejo", 1)
}
if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") {
out = append(out, []byte("\n"+line+"\n")...)
} else if strings.HasPrefix(line, "settings.web_hook_name_gitea") {
out = append(out, []byte("\n"+line+"\n")...)
out = append(out, []byte("settings.web_hook_name_forgejo = Forgejo\n")...)
} else if strings.HasPrefix(line, "migrate.gitea.description") {
re := regexp.MustCompile(`(.*Gitea)`)
out = append(out, []byte(re.ReplaceAllString(line, "${1}/Forgejo")+"\n")...)
} else {
count_replaced(line)
out = append(out, []byte(replacer.Replace(line)+"\n")...)
}
}
file.Close()
if strings.HasSuffix(filename, "gitea_en-US.ini") {
for i := 0; i < len(replacements); i += 2 {
if replaced[replacements[i]] == false {
log.Fatalf("%s was never used to replace something in %s, it is obsolete and must be updated", replacements[i], filename)
}
}
}
return out
}
func main() {
locales := generate_locale_list()
var err error
var localeFile *ini.File
for _, locale := range locales {
giteaLocale := sourceFolder + "gitea_" + locale
localeFile, err = ini.LoadSources(ini.LoadOptions{
IgnoreInlineComment: true,
}, giteaLocale, renameGiteaForgejo(giteaLocale))
if err != nil {
panic(err)
}
err = localeFile.SaveTo("options/locale/locale_" + locale)
if err != nil {
panic(err)
}
}
}

View file

@ -17,7 +17,7 @@ var (
CmdActions = &cli.Command{
Name: "actions",
Usage: "",
Description: "Commands for managing Gitea Actions",
Description: "Commands for managing Forgejo Actions",
Subcommands: []*cli.Command{
subcmdActionsGenRunnerToken,
},

View file

@ -428,6 +428,12 @@ func runRegenerateHooks(_ *cli.Context) error {
if err := initDB(ctx); err != nil {
return err
}
// Detection of ProcReceive support relies on Git module being initialized.
if err := git.InitFull(ctx); err != nil {
return err
}
return repo_service.SyncRepositoryHooks(graceful.GetManager().ShutdownContext())
}

View file

@ -136,7 +136,7 @@ func runCert(c *cli.Context) error {
SerialNumber: serialNumber,
Subject: pkix.Name{
Organization: []string{"Acme Co"},
CommonName: "Gitea",
CommonName: "Forgejo",
},
NotBefore: notBefore,
NotAfter: notAfter,

View file

@ -15,7 +15,7 @@ import (
var CmdDocs = &cli.Command{
Name: "docs",
Usage: "Output CLI documentation",
Description: "A command to output Gitea's CLI documentation, optionally to a file.",
Description: "A command to output Forgejo's CLI documentation, optionally to a file.",
Action: runDocs,
Flags: []cli.Flag{
&cli.BoolFlag{

View file

@ -25,7 +25,7 @@ import (
var cmdDoctorCheck = &cli.Command{
Name: "check",
Usage: "Diagnose and optionally fix problems",
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
Description: "A command to diagnose problems with the current Forgejo instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
Action: runDoctorCheck,
Flags: []cli.Flag{
&cli.BoolFlag{
@ -64,7 +64,7 @@ var cmdDoctorCheck = &cli.Command{
var CmdDoctor = &cli.Command{
Name: "doctor",
Usage: "Diagnose and optionally fix problems",
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
Description: "A command to diagnose problems with the current Forgejo instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
Subcommands: []*cli.Command{
cmdDoctorCheck,
@ -83,7 +83,7 @@ var cmdRecreateTable = &cli.Command{
Usage: "Print SQL commands sent",
},
},
Description: `The database definitions Gitea uses change across versions, sometimes changing default values and leaving old unused columns.
Description: `The database definitions Forgejo uses change across versions, sometimes changing default values and leaving old unused columns.
This command will cause Xorm to recreate tables, copying over the data and deleting the old table.

View file

@ -98,15 +98,15 @@ var outputTypeEnum = &outputType{
// CmdDump represents the available dump sub-command.
var CmdDump = &cli.Command{
Name: "dump",
Usage: "Dump Gitea files and database",
Usage: "Dump Forgejo files and database",
Description: `Dump compresses all related files and database into zip file.
It can be used for backup and capture Gitea server image to send to maintainer`,
It can be used for backup and capture Forgejo server image to send to maintainer`,
Action: runDump,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "file",
Aliases: []string{"f"},
Value: fmt.Sprintf("gitea-dump-%d.zip", time.Now().Unix()),
Value: fmt.Sprintf("forgejo-dump-%d.zip", time.Now().Unix()),
Usage: "Name of the dump file which will be created. Supply '-' for stdout. See type for available types.",
},
&cli.BoolFlag{
@ -209,7 +209,7 @@ func runDump(ctx *cli.Context) error {
if !setting.InstallLock {
log.Error("Is '%s' really the right config path?\n", setting.CustomConf)
return fmt.Errorf("gitea is not initialized")
return fmt.Errorf("forgejo is not initialized")
}
setting.LoadSettings() // cannot access session settings otherwise
@ -288,7 +288,7 @@ func runDump(ctx *cli.Context) error {
fatal("Path does not exist: %s", tmpDir)
}
dbDump, err := os.CreateTemp(tmpDir, "gitea-db.sql")
dbDump, err := os.CreateTemp(tmpDir, "forgejo-db.sql")
if err != nil {
fatal("Failed to create tmp file: %v", err)
}
@ -310,8 +310,8 @@ func runDump(ctx *cli.Context) error {
fatal("Failed to dump database: %v", err)
}
if err := addFile(w, "gitea-db.sql", dbDump.Name(), verbose); err != nil {
fatal("Failed to include gitea-db.sql: %v", err)
if err := addFile(w, "forgejo-db.sql", dbDump.Name(), verbose); err != nil {
fatal("Failed to include forgejo-db.sql: %v", err)
}
if len(setting.CustomConf) > 0 {
@ -452,7 +452,7 @@ func addRecursiveExclude(w archiver.Writer, insidePath, absPath string, excludeA
return err
}
for _, file := range files {
currentAbsPath := path.Join(absPath, file.Name())
currentAbsPath := filepath.Join(absPath, file.Name())
currentInsidePath := path.Join(insidePath, file.Name())
if file.IsDir() {
if !util.SliceContainsString(excludeAbsPath, currentAbsPath) {

243
cmd/forgejo/actions.go Normal file
View file

@ -0,0 +1,243 @@
// Copyright The Forgejo Authors.
// SPDX-License-Identifier: MIT
package forgejo
import (
"context"
"encoding/hex"
"fmt"
"io"
"os"
"strings"
actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
private_routers "code.gitea.io/gitea/routers/private"
"github.com/urfave/cli/v2"
)
func CmdActions(ctx context.Context) *cli.Command {
return &cli.Command{
Name: "actions",
Usage: "Commands for managing Forgejo Actions",
Subcommands: []*cli.Command{
SubcmdActionsGenerateRunnerToken(ctx),
SubcmdActionsGenerateRunnerSecret(ctx),
SubcmdActionsRegister(ctx),
},
}
}
func SubcmdActionsGenerateRunnerToken(ctx context.Context) *cli.Command {
return &cli.Command{
Name: "generate-runner-token",
Usage: "Generate a new token for a runner to use to register with the server",
Action: prepareWorkPathAndCustomConf(ctx, func(cliCtx *cli.Context) error { return RunGenerateActionsRunnerToken(ctx, cliCtx) }),
Flags: []cli.Flag{
&cli.StringFlag{
Name: "scope",
Aliases: []string{"s"},
Value: "",
Usage: "{owner}[/{repo}] - leave empty for a global runner",
},
},
}
}
func SubcmdActionsGenerateRunnerSecret(ctx context.Context) *cli.Command {
return &cli.Command{
Name: "generate-secret",
Usage: "Generate a secret suitable for input to the register subcommand",
Action: func(cliCtx *cli.Context) error { return RunGenerateSecret(ctx, cliCtx) },
}
}
func SubcmdActionsRegister(ctx context.Context) *cli.Command {
return &cli.Command{
Name: "register",
Usage: "Idempotent registration of a runner using a shared secret",
Action: prepareWorkPathAndCustomConf(ctx, func(cliCtx *cli.Context) error { return RunRegister(ctx, cliCtx) }),
Flags: []cli.Flag{
&cli.StringFlag{
Name: "secret",
Usage: "the secret the runner will use to connect as a 40 character hexadecimal string",
},
&cli.StringFlag{
Name: "secret-stdin",
Usage: "the secret the runner will use to connect as a 40 character hexadecimal string, read from stdin",
},
&cli.StringFlag{
Name: "secret-file",
Usage: "path to the file containing the secret the runner will use to connect as a 40 character hexadecimal string",
},
&cli.StringFlag{
Name: "scope",
Aliases: []string{"s"},
Value: "",
Usage: "{owner}[/{repo}] - leave empty for a global runner",
},
&cli.StringFlag{
Name: "labels",
Value: "",
Usage: "comma separated list of labels supported by the runner (e.g. docker,ubuntu-latest,self-hosted) (not required since v1.21)",
},
&cli.StringFlag{
Name: "name",
Value: "runner",
Usage: "name of the runner (default runner)",
},
&cli.StringFlag{
Name: "version",
Value: "",
Usage: "version of the runner (not required since v1.21)",
},
},
}
}
func readSecret(ctx context.Context, cliCtx *cli.Context) (string, error) {
if cliCtx.IsSet("secret") {
return cliCtx.String("secret"), nil
}
if cliCtx.IsSet("secret-stdin") {
buf, err := io.ReadAll(ContextGetStdin(ctx))
if err != nil {
return "", err
}
return string(buf), nil
}
if cliCtx.IsSet("secret-file") {
path := cliCtx.String("secret-file")
buf, err := os.ReadFile(path)
if err != nil {
return "", err
}
return string(buf), nil
}
return "", fmt.Errorf("at least one of the --secret, --secret-stdin, --secret-file options is required")
}
func validateSecret(secret string) error {
secretLen := len(secret)
if secretLen != 40 {
return fmt.Errorf("the secret must be exactly 40 characters long, not %d: generate-secret can provide a secret matching the requirements", secretLen)
}
if _, err := hex.DecodeString(secret); err != nil {
return fmt.Errorf("the secret must be an hexadecimal string: %w", err)
}
return nil
}
func RunRegister(ctx context.Context, cliCtx *cli.Context) error {
if !ContextGetNoInit(ctx) {
var cancel context.CancelFunc
ctx, cancel = installSignals(ctx)
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
}
setting.MustInstalled()
secret, err := readSecret(ctx, cliCtx)
if err != nil {
return err
}
if err := validateSecret(secret); err != nil {
return err
}
scope := cliCtx.String("scope")
labels := cliCtx.String("labels")
name := cliCtx.String("name")
version := cliCtx.String("version")
//
// There are two kinds of tokens
//
// - "registration token" only used when a runner interacts to
// register
//
// - "token" obtained after a successful registration and stored by
// the runner to authenticate
//
// The register subcommand does not need a "registration token", it
// needs a "token". Using the same name is confusing and secret is
// preferred for this reason in the cli.
//
// The ActionsRunnerRegister argument is token to be consistent with
// the internal naming. It is still confusing to the developer but
// not to the user.
//
owner, repo, err := private_routers.ParseScope(ctx, scope)
if err != nil {
return err
}
runner, err := actions_model.RegisterRunner(ctx, owner, repo, secret, strings.Split(labels, ","), name, version)
if err != nil {
return fmt.Errorf("error while registering runner: %v", err)
}
if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", runner.UUID); err != nil {
panic(err)
}
return nil
}
func RunGenerateSecret(ctx context.Context, cliCtx *cli.Context) error {
runner := actions_model.ActionRunner{}
if err := runner.GenerateToken(); err != nil {
return err
}
if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", runner.Token); err != nil {
panic(err)
}
return nil
}
func RunGenerateActionsRunnerToken(ctx context.Context, cliCtx *cli.Context) error {
if !ContextGetNoInit(ctx) {
var cancel context.CancelFunc
ctx, cancel = installSignals(ctx)
defer cancel()
}
setting.MustInstalled()
scope := cliCtx.String("scope")
respText, extra := private.GenerateActionsRunnerToken(ctx, scope)
if extra.HasError() {
return handleCliResponseExtra(ctx, extra)
}
if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", respText); err != nil {
panic(err)
}
return nil
}
func prepareWorkPathAndCustomConf(ctx context.Context, action cli.ActionFunc) func(cliCtx *cli.Context) error {
return func(cliCtx *cli.Context) error {
if !ContextGetNoInit(ctx) {
var args setting.ArgWorkPathAndCustomConf
// from children to parent, check the global flags
for _, curCtx := range cliCtx.Lineage() {
if curCtx.IsSet("work-path") && args.WorkPath == "" {
args.WorkPath = curCtx.String("work-path")
}
if curCtx.IsSet("custom-path") && args.CustomPath == "" {
args.CustomPath = curCtx.String("custom-path")
}
if curCtx.IsSet("config") && args.CustomConf == "" {
args.CustomConf = curCtx.String("config")
}
}
setting.InitWorkPathAndCommonConfig(os.Getenv, args)
}
return action(cliCtx)
}
}

147
cmd/forgejo/forgejo.go Normal file
View file

@ -0,0 +1,147 @@
// Copyright The Forgejo Authors.
// SPDX-License-Identifier: MIT
package forgejo
import (
"context"
"fmt"
"io"
"os"
"os/signal"
"syscall"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2"
)
type key int
const (
noInitKey key = iota + 1
noExitKey
stdoutKey
stderrKey
stdinKey
)
func CmdForgejo(ctx context.Context) *cli.Command {
return &cli.Command{
Name: "forgejo-cli",
Usage: "Forgejo CLI",
Flags: []cli.Flag{},
Subcommands: []*cli.Command{
CmdActions(ctx),
},
}
}
func ContextSetNoInit(ctx context.Context, value bool) context.Context {
return context.WithValue(ctx, noInitKey, value)
}
func ContextGetNoInit(ctx context.Context) bool {
value, ok := ctx.Value(noInitKey).(bool)
return ok && value
}
func ContextSetNoExit(ctx context.Context, value bool) context.Context {
return context.WithValue(ctx, noExitKey, value)
}
func ContextGetNoExit(ctx context.Context) bool {
value, ok := ctx.Value(noExitKey).(bool)
return ok && value
}
func ContextSetStderr(ctx context.Context, value io.Writer) context.Context {
return context.WithValue(ctx, stderrKey, value)
}
func ContextGetStderr(ctx context.Context) io.Writer {
value, ok := ctx.Value(stderrKey).(io.Writer)
if !ok {
return os.Stderr
}
return value
}
func ContextSetStdout(ctx context.Context, value io.Writer) context.Context {
return context.WithValue(ctx, stdoutKey, value)
}
func ContextGetStdout(ctx context.Context) io.Writer {
value, ok := ctx.Value(stderrKey).(io.Writer)
if !ok {
return os.Stdout
}
return value
}
func ContextSetStdin(ctx context.Context, value io.Reader) context.Context {
return context.WithValue(ctx, stdinKey, value)
}
func ContextGetStdin(ctx context.Context) io.Reader {
value, ok := ctx.Value(stdinKey).(io.Reader)
if !ok {
return os.Stdin
}
return value
}
// copied from ../cmd.go
func initDB(ctx context.Context) error {
setting.MustInstalled()
setting.LoadDBSetting()
setting.InitSQLLoggersForCli(log.INFO)
if setting.Database.Type == "" {
log.Fatal(`Database settings are missing from the configuration file: %q.
Ensure you are running in the correct environment or set the correct configuration file with -c.
If this is the intended configuration file complete the [database] section.`, setting.CustomConf)
}
if err := db.InitEngine(ctx); err != nil {
return fmt.Errorf("unable to initialize the database using the configuration in %q. Error: %w", setting.CustomConf, err)
}
return nil
}
// copied from ../cmd.go
func installSignals(ctx context.Context) (context.Context, context.CancelFunc) {
ctx, cancel := context.WithCancel(ctx)
go func() {
// install notify
signalChannel := make(chan os.Signal, 1)
signal.Notify(
signalChannel,
syscall.SIGINT,
syscall.SIGTERM,
)
select {
case <-signalChannel:
case <-ctx.Done():
}
cancel()
signal.Reset()
}()
return ctx, cancel
}
func handleCliResponseExtra(ctx context.Context, extra private.ResponseExtra) error {
if false && extra.UserMsg != "" {
if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", extra.UserMsg); err != nil {
panic(err)
}
}
if ContextGetNoExit(ctx) {
return extra.Error
}
return cli.Exit(extra.Error, 1)
}

View file

@ -172,9 +172,9 @@ func runHookPreReceive(c *cli.Context) error {
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
return fail(ctx, `Rejecting changes as Gitea environment not set.
return fail(ctx, `Rejecting changes as Forgejo environment not set.
If you are pushing over SSH you must push with a key managed by
Gitea or set your environment appropriately.`, "")
Forgejo or set your environment appropriately.`, "")
}
return nil
}
@ -316,9 +316,9 @@ func runHookPostReceive(c *cli.Context) error {
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
return fail(ctx, `Rejecting changes as Gitea environment not set.
return fail(ctx, `Rejecting changes as Forgejo environment not set.
If you are pushing over SSH you must push with a key managed by
Gitea or set your environment appropriately.`, "")
Forgejo or set your environment appropriately.`, "")
}
return nil
}
@ -485,9 +485,9 @@ func runHookProcReceive(c *cli.Context) error {
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
return fail(ctx, `Rejecting changes as Gitea environment not set.
return fail(ctx, `Rejecting changes as Forgejo environment not set.
If you are pushing over SSH you must push with a key managed by
Gitea or set your environment appropriately.`, "")
Forgejo or set your environment appropriately.`, "")
}
return nil
}

View file

@ -17,7 +17,7 @@ import (
// CmdKeys represents the available keys sub-command
var CmdKeys = &cli.Command{
Name: "keys",
Usage: "This command queries the Gitea database to get the authorized command for a given ssh key fingerprint",
Usage: "This command queries the Forgejo database to get the authorized command for a given ssh key fingerprint",
Before: PrepareConsoleLoggerLevel(log.FATAL),
Action: runKeys,
Flags: []cli.Flag{

View file

@ -4,10 +4,13 @@
package cmd
import (
"context"
"fmt"
"os"
"path/filepath"
"strings"
"code.gitea.io/gitea/cmd/forgejo"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
@ -75,7 +78,7 @@ func appGlobalFlags() []cli.Flag {
&cli.StringFlag{
Name: "work-path",
Aliases: []string{"w"},
Usage: "Set Gitea's working path (defaults to the Gitea's binary directory)",
Usage: "Set Forgejo's working path (defaults to the directory of the Forgejo binary)",
},
}
}
@ -119,10 +122,40 @@ func prepareWorkPathAndCustomConf(action cli.ActionFunc) func(ctx *cli.Context)
}
func NewMainApp(version, versionExtra string) *cli.App {
path, err := os.Executable()
if err != nil {
panic(err)
}
executable := filepath.Base(path)
var subCmdsStandalone []*cli.Command = make([]*cli.Command, 0, 10)
var subCmdWithConfig []*cli.Command = make([]*cli.Command, 0, 10)
//
// If the executable is forgejo-cli, provide a Forgejo specific CLI
// that is NOT compatible with Gitea.
//
if executable == "forgejo-cli" {
subCmdsStandalone = append(subCmdsStandalone, forgejo.CmdActions(context.Background()))
} else {
//
// Otherwise provide a Gitea compatible CLI which includes Forgejo
// specific additions under the forgejo-cli subcommand. It allows
// admins to migration from Gitea to Forgejo by replacing the gitea
// binary and rename it to forgejo if they want.
//
subCmdsStandalone = append(subCmdsStandalone, forgejo.CmdForgejo(context.Background()))
subCmdWithConfig = append(subCmdWithConfig, CmdActions)
}
return innerNewMainApp(version, versionExtra, subCmdsStandalone, subCmdWithConfig)
}
func innerNewMainApp(version, versionExtra string, subCmdsStandaloneArgs, subCmdWithConfigArgs []*cli.Command) *cli.App {
app := cli.NewApp()
app.Name = "Gitea"
app.Usage = "A painless self-hosted Git service"
app.Description = `By default, Gitea will start serving using the web-server with no argument, which can alternatively be run by running the subcommand "web".`
app.Name = "Forgejo"
app.Usage = "Beyond coding. We forge."
app.Description = `By default, forgejo will start serving using the web-server with no argument, which can alternatively be run by running the subcommand "web".`
app.Version = version + versionExtra
app.EnableBashCompletion = true
@ -141,13 +174,13 @@ func NewMainApp(version, versionExtra string) *cli.App {
CmdMigrateStorage,
CmdDumpRepository,
CmdRestoreRepository,
CmdActions,
cmdHelp(), // the "help" sub-command was used to show the more information for "work path" and "custom config"
}
cmdConvert := util.ToPointer(*cmdDoctorConvert)
cmdConvert.Hidden = true // still support the legacy "./gitea doctor" by the hidden sub-command, remove it in next release
subCmdWithConfig = append(subCmdWithConfig, cmdConvert)
subCmdWithConfig = append(subCmdWithConfig, subCmdWithConfigArgs...)
// these sub-commands do not need the config file, and they do not depend on any path or environment variable.
subCmdStandalone := []*cli.Command{
@ -155,6 +188,7 @@ func NewMainApp(version, versionExtra string) *cli.App {
CmdGenerate,
CmdDocs,
}
subCmdStandalone = append(subCmdStandalone, subCmdsStandaloneArgs...)
app.DefaultCommand = CmdWeb.Name

View file

@ -16,8 +16,8 @@ var (
// CmdManager represents the manager command
CmdManager = &cli.Command{
Name: "manager",
Usage: "Manage the running gitea process",
Description: "This is a command for managing the running gitea process",
Usage: "Manage the running forgejo process",
Description: "This is a command for managing the running forgejo process",
Subcommands: []*cli.Command{
subcmdShutdown,
subcmdRestart,

View file

@ -62,7 +62,7 @@ var (
Subcommands: []*cli.Command{
{
Name: "pause",
Usage: "Pause logging (Gitea will buffer logs up to a certain point and will drop them after that point)",
Usage: "Pause logging (Forgejo will buffer logs up to a certain point and will drop them after that point)",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "debug",
@ -80,7 +80,7 @@ var (
Action: runResumeLogging,
}, {
Name: "release-and-reopen",
Usage: "Cause Gitea to release and re-open files used for logging",
Usage: "Cause Forgejo to release and re-open files used for logging",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "debug",

View file

@ -110,6 +110,9 @@ func migrateLFS(ctx context.Context, dstStorage storage.ObjectStorage) error {
func migrateAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error {
return db.Iterate(ctx, nil, func(ctx context.Context, user *user_model.User) error {
if user.CustomAvatarRelativePath() == "" {
return nil
}
_, err := storage.Copy(dstStorage, user.CustomAvatarRelativePath(), storage.Avatars, user.CustomAvatarRelativePath())
return err
})
@ -117,6 +120,9 @@ func migrateAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error
func migrateRepoAvatars(ctx context.Context, dstStorage storage.ObjectStorage) error {
return db.Iterate(ctx, nil, func(ctx context.Context, repo *repo_model.Repository) error {
if repo.CustomAvatarRelativePath() == "" {
return nil
}
_, err := storage.Copy(dstStorage, repo.CustomAvatarRelativePath(), storage.RepoAvatars, repo.CustomAvatarRelativePath())
return err
})

View file

@ -103,12 +103,12 @@ func fail(ctx context.Context, userMessage, logMsgFmt string, args ...any) error
// There appears to be a chance to cause a zombie process and failure to read the Exit status
// if nothing is outputted on stdout.
_, _ = fmt.Fprintln(os.Stdout, "")
_, _ = fmt.Fprintln(os.Stderr, "Gitea:", userMessage)
_, _ = fmt.Fprintln(os.Stderr, "Forgejo:", userMessage)
if logMsgFmt != "" {
logMsg := fmt.Sprintf(logMsgFmt, args...)
if !setting.IsProd {
_, _ = fmt.Fprintln(os.Stderr, "Gitea:", logMsg)
_, _ = fmt.Fprintln(os.Stderr, "Forgejo:", logMsg)
}
if userMessage != "" {
if unicode.IsPunct(rune(userMessage[len(userMessage)-1])) {
@ -143,7 +143,7 @@ func runServ(c *cli.Context) error {
setup(ctx, c.Bool("debug"))
if setting.SSH.Disabled {
println("Gitea: SSH has been disabled")
println("Forgejo: SSH has been disabled")
return nil
}
@ -171,13 +171,13 @@ func runServ(c *cli.Context) error {
}
switch key.Type {
case asymkey_model.KeyTypeDeploy:
println("Hi there! You've successfully authenticated with the deploy key named " + key.Name + ", but Gitea does not provide shell access.")
println("Hi there! You've successfully authenticated with the deploy key named " + key.Name + ", but Forgejo does not provide shell access.")
case asymkey_model.KeyTypePrincipal:
println("Hi there! You've successfully authenticated with the principal " + key.Content + ", but Gitea does not provide shell access.")
println("Hi there! You've successfully authenticated with the principal " + key.Content + ", but Forgejo does not provide shell access.")
default:
println("Hi there, " + user.Name + "! You've successfully authenticated with the key named " + key.Name + ", but Gitea does not provide shell access.")
println("Hi there, " + user.Name + "! You've successfully authenticated with the key named " + key.Name + ", but Forgejo does not provide shell access.")
}
println("If this is unexpected, please log in with password and setup Gitea under another user.")
println("If this is unexpected, please log in with password and setup Forgejo under another user.")
return nil
} else if c.Bool("debug") {
log.Debug("SSH_ORIGINAL_COMMAND: %s", os.Getenv("SSH_ORIGINAL_COMMAND"))
@ -216,16 +216,18 @@ func runServ(c *cli.Context) error {
}
}
// LowerCase and trim the repoPath as that's how they are stored.
repoPath = strings.ToLower(strings.TrimSpace(repoPath))
rr := strings.SplitN(repoPath, "/", 2)
if len(rr) != 2 {
return fail(ctx, "Invalid repository path", "Invalid repository path: %v", repoPath)
}
username := strings.ToLower(rr[0])
reponame := strings.ToLower(strings.TrimSuffix(rr[1], ".git"))
username := rr[0]
reponame := strings.TrimSuffix(rr[1], ".git")
// LowerCase and trim the repoPath as that's how they are stored.
// This should be done after splitting the repoPath into username and reponame
// so that username and reponame are not affected.
repoPath = strings.ToLower(strings.TrimSpace(repoPath))
if alphaDashDotPattern.MatchString(reponame) {
return fail(ctx, "Invalid repo name", "Invalid repo name: %s", reponame)

View file

@ -34,8 +34,8 @@ var PIDFile = "/run/gitea.pid"
// CmdWeb represents the available web sub-command.
var CmdWeb = &cli.Command{
Name: "web",
Usage: "Start Gitea web server",
Description: `Gitea web server is the only thing you need to run,
Usage: "Start the Forgejo web server",
Description: `The Forgejo web server is the only thing you need to run,
and it takes care of all the other things for you`,
Before: PrepareConsoleLoggerLevel(log.INFO),
Action: runWeb,
@ -108,7 +108,7 @@ func createPIDFile(pidPath string) {
}
func showWebStartupMessage(msg string) {
log.Info("Gitea version: %s%s", setting.AppVer, setting.AppBuiltWith)
log.Info("Forgejo version: %s%s", setting.AppVer, setting.AppBuiltWith)
log.Info("* RunMode: %s", setting.RunMode)
log.Info("* AppPath: %s", setting.AppPath)
log.Info("* WorkPath: %s", setting.AppWorkPath)
@ -136,13 +136,13 @@ func serveInstall(ctx *cli.Context) error {
c := install.Routes()
err := listen(c, false)
if err != nil {
log.Critical("Unable to open listener for installer. Is Gitea already running?")
log.Critical("Unable to open listener for installer. Is Forgejo already running?")
graceful.GetManager().DoGracefulShutdown()
}
select {
case <-graceful.GetManager().IsShutdown():
<-graceful.GetManager().Done()
log.Info("PID: %d Gitea Web Finished", os.Getpid())
log.Info("PID: %d Forgejo Web Finished", os.Getpid())
log.GetManager().Close()
return err
default:
@ -211,7 +211,7 @@ func serveInstalled(ctx *cli.Context) error {
webRoutes := routers.NormalRoutes()
err := listen(webRoutes, true)
<-graceful.GetManager().Done()
log.Info("PID: %d Gitea Web Finished", os.Getpid())
log.Info("PID: %d Forgejo Web Finished", os.Getpid())
log.GetManager().Close()
return err
}
@ -237,9 +237,9 @@ func runWeb(ctx *cli.Context) error {
defer cancel()
if os.Getppid() > 1 && len(os.Getenv("LISTEN_FDS")) > 0 {
log.Info("Restarting Gitea on PID: %d from parent PID: %d", os.Getpid(), os.Getppid())
log.Info("Restarting Forgejo on PID: %d from parent PID: %d", os.Getpid(), os.Getppid())
} else {
log.Info("Starting Gitea on PID: %d", os.Getpid())
log.Info("Starting Forgejo on PID: %d", os.Getpid())
}
// Set pid file setting
@ -299,7 +299,7 @@ func listen(m http.Handler, handleRedirector bool) error {
if setting.Protocol != setting.HTTPUnix && setting.Protocol != setting.FCGIUnix {
listenAddr = net.JoinHostPort(listenAddr, setting.HTTPPort)
}
_, _, finished := process.GetManager().AddTypedContext(graceful.GetManager().HammerContext(), "Web: Gitea Server", process.SystemProcessType, true)
_, _, finished := process.GetManager().AddTypedContext(graceful.GetManager().HammerContext(), "Web: Forgejo Server", process.SystemProcessType, true)
defer finished()
log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubURL)
// This can be useful for users, many users do wrong to their config and get strange behaviors behind a reverse-proxy.

View file

@ -16,15 +16,15 @@ func main() {
app := cli.NewApp()
app.Name = "environment-to-ini"
app.Usage = "Use provided environment to update configuration ini"
app.Description = `As a helper to allow docker users to update the gitea configuration
app.Description = `As a helper to allow docker users to update the forgejo configuration
through the environment, this command allows environment variables to
be mapped to values in the ini.
Environment variables of the form "GITEA__SECTION_NAME__KEY_NAME"
Environment variables of the form "FORGEJO__SECTION_NAME__KEY_NAME"
will be mapped to the ini section "[section_name]" and the key
"KEY_NAME" with the value as provided.
Environment variables of the form "GITEA__SECTION_NAME__KEY_NAME__FILE"
Environment variables of the form "FORGEJO__SECTION_NAME__KEY_NAME__FILE"
will be mapped to the ini section "[section_name]" and the key
"KEY_NAME" with the value loaded from the specified file.
@ -42,8 +42,8 @@ func main() {
...
"""
You would set the environment variables: "GITEA__LOG_0x2E_CONSOLE__COLORIZE=false"
and "GITEA__LOG_0x2E_CONSOLE__STDERR=false". Other examples can be found
You would set the environment variables: "FORGEJO__LOG_0x2E_CONSOLE__COLORIZE=false"
and "FORGEJO__LOG_0x2E_CONSOLE__STDERR=false". Other examples can be found
on the configuration cheat sheet.`
app.Flags = []cli.Flag{
&cli.StringFlag{
@ -62,7 +62,7 @@ func main() {
Name: "work-path",
Aliases: []string{"w"},
Value: setting.AppWorkPath,
Usage: "Set the gitea working path",
Usage: "Set the forgejo working path",
},
&cli.StringFlag{
Name: "out",

View file

@ -1,5 +1,5 @@
[Unit]
Description=Gitea (Git with a cup of tea)
Description=Forgejo (Beyond coding. We forge.)
After=syslog.target
After=network.target
###
@ -25,21 +25,21 @@ After=network.target
# If using socket activation for main http/s
###
#
#After=gitea.main.socket
#Requires=gitea.main.socket
#After=forgejo.main.socket
#Requires=forgejo.main.socket
#
###
# (You can also provide gitea an http fallback and/or ssh socket too)
# (You can also provide forgejo an http fallback and/or ssh socket too)
#
# An example of /etc/systemd/system/gitea.main.socket
# An example of /etc/systemd/system/forgejo.main.socket
###
##
## [Unit]
## Description=Gitea Web Socket
## PartOf=gitea.service
## Description=Forgejo Web Socket
## PartOf=forgejo.service
##
## [Socket]
## Service=gitea.service
## Service=forgejo.service
## ListenStream=<some_port>
## NoDelay=true
##
@ -52,32 +52,31 @@ After=network.target
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
# LimitNOFILE=524288:524288
RestartSec=2s
Type=notify
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
# If using Unix socket: tells systemd to create the /run/gitea folder, which will contain the gitea.sock file
# (manually creating /run/gitea doesn't work, because it would not persist across reboots)
#RuntimeDirectory=gitea
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
WorkingDirectory=/var/lib/forgejo/
# If using Unix socket: tells systemd to create the /run/forgejo folder, which will contain the forgejo.sock file
# (manually creating /run/forgejo doesn't work, because it would not persist across reboots)
#RuntimeDirectory=forgejo
ExecStart=/usr/local/bin/forgejo web --config /etc/forgejo/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
WatchdogSec=30s
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/forgejo
# If you install Git to directory prefix other than default PATH (which happens
# for example if you install other versions of Git side-to-side with
# distribution version), uncomment below line and add that prefix to PATH
# Don't forget to place git-lfs binary on the PATH below if you want to enable
# Git LFS support
#Environment=PATH=/path/to/git/bin:/bin:/sbin:/usr/bin:/usr/sbin
# If you want to bind Gitea to a port below 1024, uncomment
# the two values below, or use socket activation to pass Gitea its ports as above
# If you want to bind Forgejo to a port below 1024, uncomment
# the two values below, or use socket activation to pass Forgejo its ports as above
###
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE
###
# In some cases, when using CapabilityBoundingSet and AmbientCapabilities option, you may want to
# set the following value to false to allow capabilities to be applied on gitea process. The following
# value if set to true sandboxes gitea service and prevent any processes from running with privileges
# set the following value to false to allow capabilities to be applied on Forgejo process. The following
# value if set to true sandboxes Forgejo service and prevent any processes from running with privileges
# in the host user namespace.
###
#PrivateUsers=false

View file

@ -1,42 +1,42 @@
#!/usr/bin/env bash
# This is an update script for gitea installed via the binary distribution
# from dl.gitea.com on linux as systemd service. It performs a backup and updates
# Gitea in place.
# NOTE: This adds the GPG Signing Key of the Gitea maintainers to the keyring.
# This is an update script for forgejo installed via the binary distribution
# from codeberg.org/forgejo/forgejo on linux as systemd service. It
# performs a backup and updates Forgejo in place.
# NOTE: This adds the GPG Signing Key of the Forgejo maintainers to the keyring.
# Depends on: bash, curl, xz, sha256sum. optionally jq, gpg
# See section below for available environment vars.
# When no version is specified, updates to the latest release.
# Examples:
# upgrade.sh 1.15.10
# giteahome=/opt/gitea giteaconf=$giteahome/app.ini upgrade.sh
# forgejohome=/opt/forgejo forgejoconf=$forgejohome/app.ini upgrade.sh
# Check if gitea service is running
if ! pidof gitea &> /dev/null; then
echo "Error: gitea is not running."
# Check if forgejo service is running
if ! pidof forgejo &> /dev/null; then
echo "Error: forgejo is not running."
exit 1
fi
# Continue with rest of the script if gitea is running
echo "Gitea is running. Continuing with rest of script..."
# Continue with rest of the script if forgejo is running
echo "Forgejo is running. Continuing with rest of script..."
# apply variables from environment
: "${giteabin:="/usr/local/bin/gitea"}"
: "${giteahome:="/var/lib/gitea"}"
: "${giteaconf:="/etc/gitea/app.ini"}"
: "${giteauser:="git"}"
: "${forgejobin:="/usr/local/bin/forgejo"}"
: "${forgejohome:="/var/lib/forgejo"}"
: "${forgejoconf:="/etc/forgejo/app.ini"}"
: "${forgejouser:="git"}"
: "${sudocmd:="sudo"}"
: "${arch:="linux-amd64"}"
: "${service_start:="$sudocmd systemctl start gitea"}"
: "${service_stop:="$sudocmd systemctl stop gitea"}"
: "${service_status:="$sudocmd systemctl status gitea"}"
: "${backupopts:=""}" # see `gitea dump --help` for available options
: "${service_start:="$sudocmd systemctl start forgejo"}"
: "${service_stop:="$sudocmd systemctl stop forgejo"}"
: "${service_status:="$sudocmd systemctl status forgejo"}"
: "${backupopts:=""}" # see `forgejo dump --help` for available options
function giteacmd {
function forgejocmd {
if [[ $sudocmd = "su" ]]; then
# `-c` only accept one string as argument.
"$sudocmd" - "$giteauser" -c "$(printf "%q " "$giteabin" "--config" "$giteaconf" "--work-path" "$giteahome" "$@")"
"$sudocmd" - "$forgejouser" -c "$(printf "%q " "$forgejobin" "--config" "$forgejoconf" "--work-path" "$forgejohome" "$@")"
else
"$sudocmd" --user "$giteauser" "$giteabin" --config "$giteaconf" --work-path "$giteahome" "$@"
"$sudocmd" --user "$forgejouser" "$forgejobin" --config "$forgejoconf" --work-path "$forgejohome" "$@"
fi
}
@ -49,7 +49,7 @@ function require {
# parse command line arguments
while true; do
case "$1" in
-v | --version ) giteaversion="$2"; shift 2 ;;
-v | --version ) forgejoversion="$2"; shift 2 ;;
-y | --yes ) no_confirm="yes"; shift ;;
--ignore-gpg) ignore_gpg="yes"; shift ;;
"" | -- ) shift; break ;;
@ -65,9 +65,9 @@ if [[ -f /etc/os-release ]]; then
if [[ "$os_release" =~ "OpenWrt" ]]; then
sudocmd="su"
service_start="/etc/init.d/gitea start"
service_stop="/etc/init.d/gitea stop"
service_status="/etc/init.d/gitea status"
service_start="/etc/init.d/forgejo start"
service_stop="/etc/init.d/forgejo stop"
service_status="/etc/init.d/forgejo status"
else
require systemctl
fi
@ -76,31 +76,31 @@ fi
require curl xz sha256sum "$sudocmd"
# select version to install
if [[ -z "${giteaversion:-}" ]]; then
if [[ -z "${forgejoversion:-}" ]]; then
require jq
giteaversion=$(curl --connect-timeout 10 -sL https://dl.gitea.com/gitea/version.json | jq -r .latest.version)
echo "Latest available version is $giteaversion"
forgejoversion=$(curl --connect-timeout 10 -sL 'https://codeberg.org/api/v1/repos/forgejo/forgejo/releases?draft=false&pre-release=false&limit=1' -H 'accept: application/json' | jq -r '.[0].tag_name | sub("v"; "")')
echo "Latest available version is $forgejoversion"
fi
# confirm update
echo "Checking currently installed version..."
current=$(giteacmd --version | cut -d ' ' -f 3)
[[ "$current" == "$giteaversion" ]] && echo "$current is already installed, stopping." && exit 1
current=$(forgejocmd --version | cut -d ' ' -f 3)
[[ "$current" == "$forgejoversion" ]] && echo "$current is already installed, stopping." && exit 1
if [[ -z "${no_confirm:-}" ]]; then
echo "Make sure to read the changelog first: https://github.com/go-gitea/gitea/blob/main/CHANGELOG.md"
echo "Are you ready to update Gitea from ${current} to ${giteaversion}? (y/N)"
echo "Make sure to read the changelog first: https://codeberg.org/forgejo/forgejo/src/branch/forgejo/CHANGELOG.md"
echo "Are you ready to update forgejo from ${current} to ${forgejoversion}? (y/N)"
read -r confirm
[[ "$confirm" == "y" ]] || [[ "$confirm" == "Y" ]] || exit 1
fi
echo "Upgrading gitea from $current to $giteaversion ..."
echo "Upgrading forgejo from $current to $forgejoversion ..."
pushd "$(pwd)" &>/dev/null
cd "$giteahome" # needed for gitea dump later
cd "$forgejohome" # needed for forgejo dump later
# download new binary
binname="gitea-${giteaversion}-${arch}"
binurl="https://dl.gitea.com/gitea/${giteaversion}/${binname}.xz"
binname="forgejo-${forgejoversion}-${arch}"
binurl="https://codeberg.org/forgejo/forgejo/releases/download/v${forgejoversion}/${binname}.xz"
echo "Downloading $binurl..."
curl --connect-timeout 10 --silent --show-error --fail --location -O "$binurl{,.sha256,.asc}"
@ -108,28 +108,28 @@ curl --connect-timeout 10 --silent --show-error --fail --location -O "$binurl{,.
sha256sum -c "${binname}.xz.sha256"
if [[ -z "${ignore_gpg:-}" ]]; then
require gpg
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver keys.openpgp.org --recv EB114F5E6C0DC2BCDD183550A4B61A2DC5923710
gpg --verify "${binname}.xz.asc" "${binname}.xz" || { echo 'Signature does not match'; exit 1; }
fi
rm "${binname}".xz.{sha256,asc}
# unpack binary + make executable
xz --decompress --force "${binname}.xz"
chown "$giteauser" "$binname"
chown "$forgejouser" "$binname"
chmod +x "$binname"
# stop gitea, create backup, replace binary, restart gitea
echo "Flushing gitea queues at $(date)"
giteacmd manager flush-queues
echo "Stopping gitea at $(date)"
# stop forgejo, create backup, replace binary, restart forgejo
echo "Flushing forgejo queues at $(date)"
forgejocmd manager flush-queues
echo "Stopping forgejo at $(date)"
$service_stop
echo "Creating backup in $giteahome"
giteacmd dump $backupopts
echo "Updating binary at $giteabin"
cp -f "$giteabin" "$giteabin.bak" && mv -f "$binname" "$giteabin"
echo "Creating backup in $forgejohome"
forgejocmd dump $backupopts
echo "Updating binary at $forgejobin"
cp -f "$forgejobin" "$forgejobin.bak" && mv -f "$binname" "$forgejobin"
$service_start
$service_status
echo "Upgrade to $giteaversion successful!"
echo "Upgrade to $forgejoversion successful!"
popd

View file

@ -368,7 +368,7 @@ USER = root
;; SQLite Configuration
;;
;DB_TYPE = sqlite3
;PATH= ; defaults to data/gitea.db
;PATH= ; defaults to data/forgejo.db
;SQLITE_TIMEOUT = ; Query timeout defaults to: 500
;SQLITE_JOURNAL_MODE = ; defaults to sqlite database default (often DELETE), can be used to enable WAL mode. https://www.sqlite.org/pragma.html#pragma_journal_mode
;;
@ -409,6 +409,10 @@ USER = root
;;
;; Whether execute database models migrations automatically
;AUTO_MIGRATION = true
;;
;; Threshold value (in seconds) beyond which query execution time is logged as a warning in the xorm logger
;;
;SLOW_QUERY_TRESHOLD = 5s
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -479,8 +483,8 @@ INTERNAL_TOKEN=
;;Classes include "lower,upper,digit,spec"
;PASSWORD_COMPLEXITY = off
;;
;; Password Hash algorithm, either "argon2", "pbkdf2", "scrypt" or "bcrypt"
;PASSWORD_HASH_ALGO = pbkdf2
;; Password Hash algorithm, either "argon2", "pbkdf2"/"pbkdf2_v2", "pbkdf2_hi", "scrypt" or "bcrypt"
;PASSWORD_HASH_ALGO = pbkdf2_hi
;;
;; Set false to allow JavaScript to read CSRF cookie
;CSRF_COOKIE_HTTP_ONLY = true
@ -808,6 +812,11 @@ LEVEL = Info
;; Every new user will have restricted permissions depending on this setting
;DEFAULT_USER_IS_RESTRICTED = false
;;
;; Users will be able to use dots when choosing their username. Disabling this is
;; helpful if your usersare having issues with e.g. RSS feeds or advanced third-party
;; extensions that use strange regex patterns.
; ALLOW_DOTS_IN_USERNAMES = true
;;
;; Either "public", "limited" or "private", default is "public"
;; Limited is for users visible only to signed users
;; Private is for users visible only to members of their organizations
@ -836,12 +845,12 @@ LEVEL = Info
;;
;; Default map service. No external API support has been included. A service has to allow
;; searching using URL parameters, the location will be appended to the URL as escaped query parameter.
;; Disabled by default, some example values are:
;; Some example values are:
;; - OpenStreetMap: https://www.openstreetmap.org/search?query=
;; - Google Maps: https://www.google.com/maps/place/
;; - MapQuest: https://www.mapquest.com/search/
;; - Bing Maps: https://www.bing.com/maps?where1=
; USER_LOCATION_MAP_URL =
; USER_LOCATION_MAP_URL = https://www.openstreetmap.org/search?query=
;;
;; Enable heatmap on users profiles.
;ENABLE_USER_HEATMAP = true
@ -1014,8 +1023,8 @@ LEVEL = Info
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
;ALLOWED_TYPES =
;;
;; Max size of each file in megabytes. Defaults to 3MB
;FILE_MAX_SIZE = 3
;; Max size of each file in megabytes. Defaults to 50MB
;FILE_MAX_SIZE = 50
;;
;; Max number of files per upload. Defaults to 5
;MAX_FILES = 5
@ -1151,15 +1160,9 @@ LEVEL = Info
;; enable cors headers (disabled by default)
;ENABLED = false
;;
;; scheme of allowed requests
;SCHEME = http
;;
;; list of requesting domains that are allowed
;; list of requesting origins that are allowed, eg: "https://*.example.com"
;ALLOW_DOMAIN = *
;;
;; allow subdomains of headers listed above to request
;ALLOW_SUBDOMAIN = false
;;
;; list of methods allowed to request
;METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS
;;
@ -1205,6 +1208,9 @@ LEVEL = Info
;; Max size of files to be displayed (default is 8MiB)
;MAX_DISPLAY_FILE_SIZE = 8388608
;;
;; Detect ambiguous unicode characters in file contents and show warnings on the UI
;AMBIGUOUS_UNICODE_DETECTION = true
;;
;; Whether the email of the user should be shown in the Explore Users page
;SHOW_USER_EMAIL = true
;;
@ -1453,6 +1459,8 @@ LEVEL = Info
;;
;; Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
;DEFAULT_EMAIL_NOTIFICATIONS = enabled
;; Send an email to all admins when a new user signs up to inform the admins about this act. Options: true, false
;SEND_NOTIFICATION_EMAIL_ON_NEW_USER = false
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -1767,9 +1775,6 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;AVATAR_UPLOAD_PATH = data/avatars
;REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars
;;
;; How Gitea deals with missing repository avatars
;; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used
;REPOSITORY_AVATAR_FALLBACK = none
@ -1815,8 +1820,8 @@ LEVEL = Info
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
;ALLOWED_TYPES = .csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip
;;
;; Max size of each file. Defaults to 4MB
;MAX_SIZE = 4
;; Max size of each file. Defaults to 2048MB
;MAX_SIZE = 2048
;;
;; Max number of files per upload. Defaults to 5
;MAX_FILES = 5
@ -2186,6 +2191,7 @@ LEVEL = Info
;ENABLE_SUCCESS_NOTICE = false
;SCHEDULE = @every 168h
;HTTP_ENDPOINT = https://dl.gitea.com/gitea/version.json
;DOMAIN_ENDPOINT = release.forgejo.org
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -2566,9 +2572,8 @@ LEVEL = Info
; [actions]
;; Enable/Disable actions capabilities
;ENABLED = true
;;
;; Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance.
;DEFAULT_ACTIONS_URL = github
;; Default address to get action plugins, e.g. the default value means downloading from "https://code.forgejo.org/actions/checkout" for "uses: actions/checkout@v3"
;DEFAULT_ACTIONS_URL = https://code.forgejo.org
;; Default artifact retention time in days, default is 90 days
;ARTIFACT_RETENTION_DAYS = 90
;; Timeout to stop the task which have running status, but haven't been updated for a long time

View file

@ -1,7 +1,7 @@
# Gitea - Docker
# Forgejo - Docker
Dockerfile is found in root of repository.
The Dockerfile can be found in the root of repository. [Dockerfile](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/Dockerfile) & [Dockerfile.rootless](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/Dockerfile.rootless).
Docker image can be found on [docker hub](https://hub.docker.com/r/gitea/gitea)
The Docker image can be found on [Coddeberg](https://codeberg.org/forgejo/-/packages/container/forgejo/).
Documentation on using docker image can be found on [Gitea Docs site](https://docs.gitea.com/installation/install-with-docker-rootless)
Documentation on how you can use the docker image can be found on the [Forgejo documentation website](https://forgejo.org/docs/latest/admin/installation/#installation-with-docker).

View file

@ -32,7 +32,7 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
fi
# Substitute the environment variables in the template
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
APP_NAME=${APP_NAME:-"Forgejo: Beyond coding. We forge."} \
RUN_MODE=${RUN_MODE:-"prod"} \
DOMAIN=${DOMAIN:-"localhost"} \
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \

View file

@ -26,7 +26,7 @@ if [ ! -f ${GITEA_APP_INI} ]; then
fi
# Substitute the environment variables in the template
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
APP_NAME=${APP_NAME:-"Forgejo: Beyond coding. We forge."} \
RUN_MODE=${RUN_MODE:-"prod"} \
RUN_USER=${USER:-"git"} \
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \

View file

@ -19,10 +19,10 @@ Some jurisdictions (such as EU), requires certain legal pages (e.g. Privacy Poli
## Getting Pages
Gitea source code ships with sample pages, available in `contrib/legal` directory. Copy them to `custom/public/`. For example, to add Privacy Policy:
Gitea source code ships with sample pages, available in `contrib/legal` directory. Copy them to `custom/public/assets/`. For example, to add Privacy Policy:
```
wget -O /path/to/custom/public/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample
wget -O /path/to/custom/public/assets/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample
```
Now you need to edit the page to meet your requirements. In particular you must change the email addresses, web addresses and references to "Your Gitea Instance" to match your situation.

View file

@ -19,10 +19,10 @@ menu:
## 获取页面
Gitea 源代码附带了示例页面,位于 `contrib/legal` 目录中。将它们复制到 `custom/public/` 目录下。例如,如果要添加隐私政策:
Gitea 源代码附带了示例页面,位于 `contrib/legal` 目录中。将它们复制到 `custom/public/assets/` 目录下。例如,如果要添加隐私政策:
```
wget -O /path/to/custom/public/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample
wget -O /path/to/custom/public/assets/privacy.html https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/legal/privacy.html.sample
```
现在,你需要编辑该页面以满足你的需求。特别是,你必须更改电子邮件地址、网址以及与 "Your Gitea Instance" 相关的引用,以匹配你的情况。

View file

@ -146,7 +146,7 @@ In addition, there is _`StaticRootPath`_ which can be set as a built-in at build
- `ENABLED`: **true**: Whether repository file uploads are enabled
- `TEMP_PATH`: **data/tmp/uploads**: Path for uploads (content gets deleted on Gitea restart)
- `ALLOWED_TYPES`: **_empty_**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
- `FILE_MAX_SIZE`: **3**: Max size of each file in megabytes.
- `FILE_MAX_SIZE`: **50**: Max size of each file in megabytes.
- `MAX_FILES`: **5**: Max number of files per upload
### Repository - Release (`repository.release`)
@ -196,9 +196,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
## CORS (`cors`)
- `ENABLED`: **false**: enable cors headers (disabled by default)
- `SCHEME`: **http**: scheme of allowed requests
- `ALLOW_DOMAIN`: **\***: list of requesting domains that are allowed
- `ALLOW_SUBDOMAIN`: **false**: allow subdomains of headers listed above to request
- `ALLOW_DOMAIN`: **\***: list of requesting origins that are allowed, eg: "https://*.example.com"
- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: list of methods allowed to request
- `MAX_AGE`: **10m**: max time to cache response
- `ALLOW_CREDENTIALS`: **false**: allow request with credentials
@ -220,6 +218,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
- `THEMES`: **auto,gitea,arc-green**: All available themes. Allow users select personalized themes.
regardless of the value of `DEFAULT_THEME`.
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB)
- `AMBIGUOUS_UNICODE_DETECTION`: **true**: Detect ambiguous unicode characters in file contents and show warnings on the UI
- `REACTIONS`: All available reactions users can choose on issues/prs and comments
Values can be emoji alias (:smile:) or a unicode emoji.
For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
@ -341,7 +340,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
- `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** or **username, email**: \[off, username, email, anything\]: Specify the principals values that users are allowed to use as principal. When set to `anything` no checks are done on the principal string. When set to `off` authorized principal are not allowed to be set.
- `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**: Gitea will create a authorized_principals file by default when it is not using the internal ssh server and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
- `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**: Enable SSH Authorized Principals Backup when rewriting all keys, default is true if `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}**: Set the template for the command to passed on authorized keys. Possible keys are: AppPath, AppWorkPath, CustomConf, CustomPath, Key - where Key is a `models/asymkey.PublicKey` and the others are strings which are shellquoted.
- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **`{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}`**: Set the template for the command to passed on authorized keys. Possible keys are: AppPath, AppWorkPath, CustomConf, CustomPath, Key - where Key is a `models/asymkey.PublicKey` and the others are strings which are shellquoted.
- `SSH_SERVER_CIPHERS`: **chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
- `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect
@ -454,6 +453,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
- `MAX_IDLE_CONNS` **2**: Max idle database connections on connection pool, default is 2 - this will be capped to `MAX_OPEN_CONNS`.
- `CONN_MAX_LIFETIME` **0 or 3s**: Sets the maximum amount of time a DB connection may be reused - default is 0, meaning there is no limit (except on MySQL where it is 3s - see #6804 & #7071).
- `AUTO_MIGRATION` **true**: Whether execute database models migrations automatically.
- `SLOW_QUERY_TRESHOLD` **5s**: Threshold value in seconds beyond which query execution time is logged as a warning in the xorm logger.
[^1]: It may be necessary to specify a hostport even when listening on a unix socket, as the port is part of the socket name. see [#24552](https://github.com/go-gitea/gitea/issues/24552#issuecomment-1681649367) for additional details.
@ -513,6 +513,7 @@ And the following unique queues:
- `DEFAULT_EMAIL_NOTIFICATIONS`: **enabled**: Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
- `DISABLE_REGULAR_ORG_CREATION`: **false**: Disallow regular (non-admin) users from creating organizations.
- `SEND_NOTIFICATION_EMAIL_ON_NEW_USER`: **false**: Send an email to all admins when a new user signs up to inform the admins about this act.
## Security (`security`)
@ -571,6 +572,7 @@ And the following unique queues:
- off - do not check password complexity
- `PASSWORD_CHECK_PWN`: **false**: Check [HaveIBeenPwned](https://haveibeenpwned.com/Passwords) to see if a password has been exposed.
- `SUCCESSFUL_TOKENS_CACHE_SIZE`: **20**: Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations. This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security.
- `DISABLE_QUERY_AUTH_TOKEN`: **false**: Reject API tokens sent in URL query string (Accept Header-based API tokens only). This setting will default to `true` in Gitea 1.23 and be deprecated in Gitea 1.24.
## Camo (`camo`)
@ -822,7 +824,7 @@ Default templates for project boards:
- `ENABLED`: **true**: Whether issue and pull request attachments are enabled.
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
- `MAX_SIZE`: **4**: Maximum size (MB).
- `MAX_SIZE`: **2048**: Maximum size (MB).
- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
- `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
- `SERVE_DIRECT`: **false**: Allows the storage driver to redirect to authenticated URLs to serve files directly. Currently, only Minio/S3 is supported via signed URLs, local does nothing.
@ -1391,7 +1393,7 @@ PROXY_HOSTS = *.github.com
- `DEFAULT_ACTIONS_URL`: **github**: Default platform to get action plugins, `github` for `https://github.com`, `self` for the current Gitea instance.
- `STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
- `MINIO_BASE_PATH`: **actions_log/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio`
- `ARTIFACT_RETENTION_DAYS`: **90**: Number of days to keep artifacts. Set to 0 to disable artifact retention. Default is 90 days if not set.
- `ARTIFACT_RETENTION_DAYS`: **90**: Default number of days to keep artifacts. This can be overridden in `actions/upload_artifact`. Set to 0 to disable artifact retention. Default is 90 days if not set. Each artifact can have it's own number of retention days.
- `ZOMBIE_TASK_TIMEOUT`: **10m**: Timeout to stop the task which have running status, but haven't been updated for a long time
- `ENDLESS_TASK_TIMEOUT`: **3h**: Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time
- `ABANDONED_JOB_TIMEOUT`: **24h**: Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time
@ -1404,7 +1406,7 @@ Please note that using `self` is not recommended for most cases, as it could mak
Additionally, it requires you to mirror all the actions you need to your Gitea instance, which may not be worth it.
Therefore, please use `self` only if you understand what you are doing.
In earlier versions (<= 1.19), `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`.
In earlier versions (`<= 1.19`), `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like `https://gitea.com` or `http://your-git-server,https://gitea.com`, and the default value was `https://gitea.com`.
However, later updates removed those options, and now the only options are `github` and `self`, with the default value being `github`.
However, if you want to use actions from other git server, you can use a complete URL in `uses` field, it's supported by Gitea (but not GitHub).
Like `uses: https://gitea.com/actions/checkout@v3` or `uses: http://your-git-server/actions/checkout@v3`.

View file

@ -145,7 +145,7 @@ menu:
- `ENABLED`: **true**: 是否启用仓库文件上传。
- `TEMP_PATH`: **data/tmp/uploads**: 文件上传的临时保存路径(在Gitea重启的时候该目录会被清空)。
- `ALLOWED_TYPES`: **_empty_**: 以逗号分割的列表,代表支持上传的文件类型。(`.zip`), mime类型 (`text/plain`) or 通配符类型 (`image/*`, `audio/*`, `video/*`). 为空或者 `*/*`代表允许所有类型文件。
- `FILE_MAX_SIZE`: **3**: 每个文件的最大大小(MB)。
- `FILE_MAX_SIZE`: **50**: 每个文件的最大大小(MB)。
- `MAX_FILES`: **5**: 每次上传的最大文件数。
### 仓库 - 版本发布 (`repository.release`)
@ -195,9 +195,7 @@ menu:
## 跨域 (`cors`)
- `ENABLED`: **false**: 启用 CORS 头部(默认禁用)
- `SCHEME`: **http**: 允许请求的协议
- `ALLOW_DOMAIN`: **\***: 允许请求的域名列表
- `ALLOW_SUBDOMAIN`: **false**: 允许上述列出的头部的子域名发出请求。
- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: 允许发起的请求方式列表
- `MAX_AGE`: **10m**: 缓存响应的最大时间
- `ALLOW_CREDENTIALS`: **false**: 允许带有凭据的请求
@ -335,7 +333,7 @@ menu:
- `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off****username, email**\[off, username, email, anything\]:指定允许用户用作 principal 的值。当设置为 `anything` 时,对 principal 字符串不执行任何检查。当设置为 `off` 时,不允许设置授权的 principal。
- `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**:当 Gitea 不使用内置 SSH 服务器且 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 不为 `off` 时,默认情况下 Gitea 会创建一个 authorized_principals 文件。
- `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**:在重写所有密钥时启用 SSH 授权 principal 备份,默认值为 true如果 `SSH_AUTHORIZED_PRINCIPALS_ALLOW` 不为 `off`)。
- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}**设置用于传递授权密钥的命令模板。可能的密钥是AppPath、AppWorkPath、CustomConf、CustomPath、Key其中 Key 是 `models/asymkey.PublicKey`,其他是 shellquoted 字符串。
- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **`{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}`**设置用于传递授权密钥的命令模板。可能的密钥是AppPath、AppWorkPath、CustomConf、CustomPath、Key其中 Key 是 `models/asymkey.PublicKey`,其他是 shellquoted 字符串。
- `SSH_SERVER_CIPHERS`: **chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com**:对于内置的 SSH 服务器,选择支持的 SSH 连接的加密方法,对于系统 SSH此设置无效。
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**:对于内置 SSH 服务器,选择支持的 SSH 连接的密钥交换算法,对于系统 SSH此设置无效。
- `SSH_SERVER_MACS`: **hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1**:对于内置 SSH 服务器,选择支持的 SSH 连接的 MAC 算法,对于系统 SSH此设置无效。
@ -784,7 +782,7 @@ Gitea 创建以下非唯一队列:
- `ENABLED`: **true**: 是否允许用户上传附件。
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: 允许的文件扩展名(`.zip`、mime 类型(`text/plain`)或通配符类型(`image/*`、`audio/*`、`video/*`)的逗号分隔列表。空值或 `*/*` 允许所有类型。
- `MAX_SIZE`: **4**: 附件的最大限制MB
- `MAX_SIZE`: **2048**: 附件的最大限制MB
- `MAX_FILES`: **5**: 一次最多上传的附件数量。
- `STORAGE_TYPE`: **local**: 附件的存储类型,`local` 表示本地磁盘,`minio` 表示兼容 S3 的对象存储服务,如果未设置将使用默认值 `local` 或其他在 `[storage.xxx]` 中定义的名称。
- `SERVE_DIRECT`: **false**: 允许存储驱动器重定向到经过身份验证的 URL 以直接提供文件。目前,只支持 Minio/S3 通过签名 URL 提供支持local 不会执行任何操作。
@ -1040,10 +1038,11 @@ Gitea 创建以下非唯一队列:
## API (`api`)
- `ENABLE_SWAGGER`: **true**: 是否启用swagger路由 (`/api/swagger`, `/api/v1/swagger`, …)。
- `MAX_RESPONSE_ITEMS`: **50**: 单个页面的最大 Feed.
- `ENABLE_OPENID_SIGNIN`: **false**: 允许使用OpenID登录当设置为`true`时可以通过 `/user/login` 页面进行OpenID登录。
- `DISABLE_REGISTRATION`: **false**: 关闭用户注册。
- `ENABLE_SWAGGER`: **true**: 启用API文档接口 (`/api/swagger`, `/api/v1/swagger`, …). True or false。
- `MAX_RESPONSE_ITEMS`: **50**: API分页的最大单页项目数。
- `DEFAULT_PAGING_NUM`: **30**: API分页的默认分页数。
- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: Git trees API的默认单页项目数。
- `DEFAULT_MAX_BLOB_SIZE`: **10485760** (10MiB): blobs API的默认最大文件大小。
## OAuth2 (`oauth2`)
@ -1344,7 +1343,7 @@ PROXY_HOSTS = *.github.com
此外,它要求您将所有所需的操作镜像到您的 Gitea 实例,这可能不值得。
因此,请仅在您了解自己在做什么的情况下使用 `self`
在早期版本(<= 1.19)中,`DEFAULT_ACTIONS_URL` 可以设置为任何自定义 URL例如 `https://gitea.com``http://your-git-server,https://gitea.com`,默认值为 `https://gitea.com`
在早期版本(`<= 1.19`)中,`DEFAULT_ACTIONS_URL` 可以设置为任何自定义 URL例如 `https://gitea.com``http://your-git-server,https://gitea.com`,默认值为 `https://gitea.com`
然而,后来的更新删除了这些选项,现在唯一的选项是 `github``self`,默认值为 `github`
但是,如果您想要使用其他 Git 服务器中的操作,您可以在 `uses` 字段中使用完整的 URLGitea 支持此功能GitHub 不支持)。
例如 `uses: https://gitea.com/actions/checkout@v3``uses: http://your-git-server/actions/checkout@v3`

View file

@ -42,11 +42,11 @@ Gitea 引用 `custom` 目录中的自定义配置文件来覆盖配置、模板
将自定义的公共文件(比如页面和图片)作为 webroot 放在 `custom/public/` 中来让 Gitea 提供这些自定义内容(符号链接将被追踪)。
举例说明:`image.png` 存放在 `custom/public/`中,那么它可以通过链接 http://gitea.domain.tld/assets/image.png 访问。
举例说明:`image.png` 存放在 `custom/public/assets/`中,那么它可以通过链接 http://gitea.domain.tld/assets/image.png 访问。
## 修改默认头像
替换以下目录中的 png 图片: `custom/public/img/avatar\_default.png`
替换以下目录中的 png 图片: `custom/public/assets/img/avatar\_default.png`
## 自定义 Gitea 页面

View file

@ -61,7 +61,7 @@ Please note: authentication is only supported when the SMTP server communication
- STARTTLS (also known as Opportunistic TLS) via port 587. Initial connection is done over cleartext, but then be upgraded over TLS if the server supports it.
- SMTPS connection (SMTP over TLS) via the default port 465. Connection to the server use TLS from the beginning.
- Forced SMTPS connection with `IS_TLS_ENABLED=true`. (These are both known as Implicit TLS.)
- Forced SMTPS connection with `PROTOCOL=smtps`. (These are both known as Implicit TLS.)
This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.
Note that Implicit TLS is recommended by [RFC8314](https://tools.ietf.org/html/rfc8314#section-3) since 2018.

View file

@ -55,13 +55,13 @@ PASSWD = `password`
要发送测试邮件以验证设置,请转到 Gitea > 站点管理 > 配置 > SMTP 邮件配置。
有关所有选项的完整列表,请查看[配置速查表](doc/administration/config-cheat-sheet.zh-cn.md)。
有关所有选项的完整列表,请查看[配置速查表](administration/config-cheat-sheet.md)。
请注意:只有在使用 TLS 或 `HOST=localhost` 加密 SMTP 服务器通信时才支持身份验证。TLS 加密可以通过以下方式进行:
- 通过端口 587 的 STARTTLS也称为 Opportunistic TLS。初始连接是明文的但如果服务器支持则可以升级为 TLS。
- 通过默认端口 465 的 SMTPS 连接。连接到服务器从一开始就使用 TLS。
- 使用 `IS_TLS_ENABLED=true` 进行强制的 SMTPS 连接。(这两种方式都被称为 Implicit TLS
- 使用 `PROTOCOL=smtps` 进行强制的 SMTPS 连接。(这两种方式都被称为 Implicit TLS
这是由于 Go 内部库对 STRIPTLS 攻击的保护机制。
请注意自2018年起[RFC8314](https://tools.ietf.org/html/rfc8314#section-3) 推荐使用 Implicit TLS。

View file

@ -194,7 +194,7 @@ ALLOW_DATA_URI_IMAGES = true
}
```
将您的样式表添加到自定义目录中,例如 `custom/public/css/my-style-XXXXX.css`,并使用自定义的头文件 `custom/templates/custom/header.tmpl` 进行导入:
将您的样式表添加到自定义目录中,例如 `custom/public/assets/css/my-style-XXXXX.css`,并使用自定义的头文件 `custom/templates/custom/header.tmpl` 进行导入:
```html
<link rel="stylesheet" href="{{AppSubUrl}}/assets/css/my-style-XXXXX.css" />

View file

@ -33,7 +33,7 @@ CERT_FILE = cert.pem
KEY_FILE = key.pem
```
请注意,如果您的证书由第三方证书颁发机构签名(即不是自签名的),则 cert.pem 应包含证书链。服务器证书必须是 cert.pem 中的第一个条目,后跟中介(如果有)。不必包含根证书,因为连接客户端必须已经拥有根证书才能建立信任关系。要了解有关配置值的更多信息,请查看 [配置备忘单](../config-cheat-sheet#server-server)。
请注意,如果您的证书由第三方证书颁发机构签名(即不是自签名的),则 cert.pem 应包含证书链。服务器证书必须是 cert.pem 中的第一个条目,后跟中介(如果有)。不必包含根证书,因为连接客户端必须已经拥有根证书才能建立信任关系。要了解有关配置值的更多信息,请查看 [配置备忘单](administration/config-cheat-sheet#server-server)。
对于“CERT_FILE”或“KEY_FILE”字段当文件路径是相对路径时文件路径相对于“GITEA_CUSTOM”环境变量。它也可以是绝对路径。

View file

@ -48,11 +48,12 @@ We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/h
10. Avoid mixing different events in one event listener, prefer to use individual event listeners for every event.
11. Custom event names are recommended to use `ce-` prefix.
12. Gitea's tailwind-style CSS classes use `gt-` prefix (`gt-relative`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`).
13. Avoid inline scripts & styles as much as possible, it's recommended to put JS code into JS files and use CSS classes. If inline scripts & styles are unavoidable, explain the reason why it can't be avoided.
### Accessibility / ARIA
In history, Gitea heavily uses Fomantic UI which is not an accessibility-friendly framework.
Gitea uses some patches to make Fomantic UI more accessible (see the `aria.js` and `aria.md`),
Gitea uses some patches to make Fomantic UI more accessible (see `aria.md` and related JS files),
but there are still many problems which need a lot of work and time to fix.
### Framework Usage

View file

@ -19,10 +19,7 @@ menu:
## Enabling/configuring API access
By default, `ENABLE_SWAGGER` is true, and
`MAX_RESPONSE_ITEMS` is set to 50. See [Config Cheat
Sheet](administration/config-cheat-sheet.md) for more
information.
By default, `ENABLE_SWAGGER` is true, and `MAX_RESPONSE_ITEMS` is set to 50. See [Config Cheat Sheet](administration/config-cheat-sheet.md) for more information.
## Authentication

View file

@ -19,8 +19,7 @@ menu:
## 开启/配置 API 访问
通常情况下, `ENABLE_SWAGGER` 默认开启并且参数 `MAX_RESPONSE_ITEMS` 默认为 50。您可以从 [Config Cheat
Sheet](administration/config-cheat-sheet.md) 中获取更多配置相关信息。
通常情况下, `ENABLE_SWAGGER` 默认开启并且参数 `MAX_RESPONSE_ITEMS` 默认为 50。您可以从 [Config Cheat Sheet](administration/config-cheat-sheet.md) 中获取更多配置相关信息。
## 通过 API 认证

View file

@ -138,9 +138,9 @@ All Gitea instances have the built-in API and there is no way to disable it comp
You can, however, disable showing its documentation by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`.
For more information, refer to Gitea's [API docs](development/api-usage.md).
You can see the latest API (for example) on <https://try.gitea.io/api/swagger>.
You can see the latest API (for example) on https://try.gitea.io/api/swagger
You can also see an example of the `swagger.json` file at <https://try.gitea.io/swagger.v1.json>.
You can also see an example of the `swagger.json` file at https://try.gitea.io/swagger.v1.json
## Adjusting your server for public/private use

Some files were not shown because too many files have changed in this diff Show more