Compare commits

..

515 commits

Author SHA1 Message Date
Cat /dev/Nulo 7c22dab8a3 nulo: woodpecker CI
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-11-25 18:37:24 -03:00
Cat /dev/Nulo d3a962d068 Dockerfile: rename user to _gitea instead of git 2023-11-25 18:37:11 -03:00
Earl Warren 3380217da1
[TESTS] tests.AddFixtures helper loads additional per-test fixtures
(cherry picked from commit 93a844dd13904c0ba1b7fd4a0a233002194a504b)
(cherry picked from commit 6d6d1a121ce3fc5cf7cd92ad1a38be3bdcbf7088)
(cherry picked from commit 8b101f2860dfbdfd99de71d30740c9e72e1cd9d5)
(cherry picked from commit 3e56212d6d1bca0aecdc1f224c7d78287ef9d35d)
(cherry picked from commit 4f619bc58583892c197ee2588ead929342336217)
2023-11-25 08:08:37 +01:00
Loïc Dachary e9aa373db5
fix POST /{username}/{reponame}/{type:issues|pulls}/move_pin
(cherry picked from commit 7eda733ed6a22c08a85fdc90deec0c440427cef7)
2023-11-25 08:08:37 +01:00
Loïc Dachary 1e5940b020
test POST /{username}/{reponame}/{type:issues|pulls}/move_pin
(cherry picked from commit 52f50792606a22cbf1e144e1bd480984abf6f53f)
2023-11-25 08:08:37 +01:00
Loïc Dachary 5322136af8
fix GET /api/v1/repos/{owner}/{repo}/keys/{id}
(cherry picked from commit 768238d9f9982e99ad4cbf3942d2d2db5126a150)

Conflicts:
	routers/api/v1/repo/key.go
	trivial context conflict
2023-11-25 08:08:37 +01:00
Loïc Dachary d095e4fdc5
test GET /api/v1/repos/{owner}/{repo}/keys/{id}
(cherry picked from commit f5ad29dbc77df834a3b5b9a63b19bca680a9f5ed)
2023-11-25 08:08:37 +01:00
Loïc Dachary a2b1082dda
fix POST /{username}/{reponame}/{tags,release}/delete
(cherry picked from commit a6d2ad6310f754952998fd73118da9f91c563145)
2023-11-25 08:08:37 +01:00
Loïc Dachary d7b11f5378
test POST /{username}/{reponame}/{tags,release}/delete
(cherry picked from commit 78dcbb62fe87abe044034d880c9e8c22b44c2c98)
2023-11-25 08:08:37 +01:00
Loïc Dachary 5ef4992fd7
fix GET /{username}/{reponame}/{type:issues|pulls}/{index}/content-history/detail
(cherry picked from commit 0853dec293dd632a03948f66af69e75dd582a92d)
2023-11-25 08:08:36 +01:00
Loïc Dachary 75730a6ded
fix POST /{username}/{reponame}/{type:issues|pulls}/{index}/content-history/soft-delete
(cherry picked from commit a11d82a42729eba02032310f7778a9197f4f8ead)
2023-11-25 08:08:36 +01:00
Loïc Dachary 48bcb1937e
fix GET /{owner}/{repo}/comments/{id}/attachments
(cherry picked from commit aed193ef9f5d59aed12cfd7518765d5598c7999f)
2023-11-25 07:23:34 +01:00
Loïc Dachary 4903135a93
test GET /{owner}/{repo}/comments/{id}/attachments
(cherry picked from commit 888dda12cf9bc95f9ef85ba5a518cf40152e07ea)
2023-11-25 07:23:34 +01:00
Loïc Dachary 6f87e71f0c
fix POST /{owner}/{repo}/comments/{id}/reactions/{action}
(cherry picked from commit 21d4556cbeb9d0f825398114ba3a4816f331315b)
2023-11-25 07:23:34 +01:00
Loïc Dachary 5cc6361e31
fix POST /{owner}/{repo}/comments/{id}
(cherry picked from commit 385a1f337462bec34ccc389d4efe21e3b2be8465)
2023-11-25 07:23:34 +01:00
Loïc Dachary 0d7893ca8a
test POST /{owner}/{repo}/comments/{id}
(cherry picked from commit 61db02681a024220d6d2fe61c1479fd03cb341ea)
2023-11-25 07:23:34 +01:00
Loïc Dachary 44f2592028
fix POST /{owner}/{repo}/comments/{id}/delete
(cherry picked from commit 1b57d8493882d9d659164acd3b4a5a99c769d8ed)
2023-11-25 07:23:34 +01:00
Loïc Dachary d2c16d9c2d
test POST /{owner}/{repo}/comments/{id}/delete
(cherry picked from commit 02da8922f1d9ea8e0985b10a3003315f57b14b46)
2023-11-25 07:23:34 +01:00
Loïc Dachary 0b0b506b74
fix DELETE /api/v1/repos/{owner}/{repo}/issues/comments/{id}
(cherry picked from commit 521eed2312f45bef7de28c9c03c04257862a453c)
2023-11-25 07:23:34 +01:00
Loïc Dachary 939a66e25c
test DELETE /api/v1/repos/{owner}/{repo}/issues/comments/{id}
(cherry picked from commit 11dcaa7ec84bcb2931bfe001d4c6a02c5af4ec5b)
2023-11-25 07:23:33 +01:00
Loïc Dachary 585f74c2ca
fix GET /repos/{owner}/{repo}/issues/comments/{id}/reactions
(cherry picked from commit a146e3d0f9ff8ac1aee4be8a3632c76b35fc3482)
2023-11-25 07:23:33 +01:00
Loïc Dachary 2af5a75d71
test GET /repos/{owner}/{repo}/issues/comments/{id}/reactions
(cherry picked from commit 58d923ccbaad1ec12120800b28dbfe6c8c225556)
2023-11-25 07:23:33 +01:00
Loïc Dachary 685ebdba63
fix {DELETE,POST} /repos/{owner}/{repo}/issues/comments/{id}/reactions
(cherry picked from commit f499075c53752f983c6e4f8af17c449926ba94d9)
2023-11-25 07:23:33 +01:00
Loïc Dachary f59a6cc0e4
test {DELETE,POST} /repos/{owner}/{repo}/issues/comments/{id}/reactions
(cherry picked from commit ffcd2e79ac3ef63cd33d3ca9a18dae5f16431e54)
2023-11-25 07:23:33 +01:00
Loïc Dachary e02448bbf5
test GET /api/v1/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}
via getIssueCommentSafe

(cherry picked from commit 9a11049715f1194cad777d5dde0ee514fa15d1f1)
2023-11-25 07:23:33 +01:00
Loïc Dachary e291ea5e33
fix PATCH /api/v1/repos/{owner}/{repo}/issues/comments/{id}
(cherry picked from commit 51c280e877765efe721e607aa95bcbb5aef364e0)
2023-11-25 07:23:33 +01:00
Loïc Dachary 8726ce2635
test PATCH /api/v1/repos/{owner}/{repo}/issues/comments/{id}
(cherry picked from commit 362f340ed9ee28627140ca06dd7487a8989ef62b)
2023-11-25 07:23:33 +01:00
Loïc Dachary 3ddfca10ac
fix API usage of a PR index in place of issue index and vice versa
(cherry picked from commit 7b95266de083c8de0ff224530a9b69e82c52c344)
2023-11-25 07:23:32 +01:00
Loïc Dachary 6b4cb070cc
enforce reqRepoReader(unit.TypeIssues) POST /repos/{owner}/{repo}/issues
(cherry picked from commit d3db2fa8bc85e9d67f30854bba0a4c1e8b57b015)
2023-11-25 07:23:32 +01:00
Loïc Dachary c70eb32280
enforce reqRepoReader(unit.TypeIssues) GET /repos/{owner}/{repo}/issues/pinned
(cherry picked from commit 00fad97fc1b27db40a002c9ab3f709d04dc2cdd1)
2023-11-25 07:23:32 +01:00
Giteabot c0ccd4c2d7
Fix no ActionTaskOutput table waring (#28149) (#28151)
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 41b2d0be931dcac7d372efb0f8207fcb8379fce1)
2023-11-22 17:23:43 +01:00
Giteabot f302373eb4
Restricted users only see repos in orgs which their team was assigned to (#28025) (#28050)
Backport #28025 by @6543

---
*Sponsored by Kithara Software GmbH*

Co-authored-by: 6543 <m.huber@kithara.com>
(cherry picked from commit 439e071acf8d7a38b78888915422490a2a462f8a)
2023-11-22 17:23:33 +01:00
Loïc Dachary 5d18f4b19f
[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-14 13:17:12 +01:00
Giteabot d7408d8b0b
Dont leak private users via extensions (#28023) (#28028)
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 69ea554e2362e5c4943c2463c2ec547bf631f18b)
2023-11-14 13:17:12 +01:00
Nanguan Lin 6dfe993913
Fix wrong xorm Delete usage(backport for 1.20) (#28003)
manually backport for https://github.com/go-gitea/gitea/pull/27995
The conflict is `ctx` and `db.Defaultctx`.

(cherry picked from commit c077a084d7bac8acc1bd247b2bd3d60835a17ded)
2023-11-14 13:17:12 +01:00
Giteabot 1bbc1adcdc
Render email addresses as such if followed by punctuation (#27987) (#27991)
Backport #27987 by @yardenshoham

Added the following characters to the regular expression for the email:

- ,
- ;
- ?
- !

Also added a test case.

- Fixes #27616

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/c57eac26-f281-43ef-a51d-9c9a81b63efa)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/fc7d5c08-4350-4af0-a7f0-d1444d2d75af)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit dfd960f22a7dafaa65b9f96e61ec8bef9ea5ea69)
2023-11-14 13:17:12 +01:00
Nanguan Lin d610ea3fbb
Remove duplicated button in Install web page (#27941)
Fix #27934
Regression #25648

(cherry picked from commit 2978b435bb5b272e4c2ed7252f26a3348f2453fb)
2023-11-14 13:17:12 +01:00
KN4CK3R 44df78edd4
Unify two factor check (#27915) (#27939)
Backport of #27915

Fixes #27819

We have support for two factor logins with the normal web login and with
basic auth. For basic auth the two factor check was implemented at three
different places and you need to know that this check is necessary. This
PR moves the check into the basic auth itself.

(cherry picked from commit 00705da102be929dfa41519b030be3bdd8c68472)
2023-11-14 13:17:12 +01:00
Giteabot 1fd3cc3217
Fix DownloadFunc when migrating releases (#27887) (#27889)
Backport #27887 by @Zettat123

We should not use `asset.ID` in DownloadFunc because DownloadFunc is a
closure.

1bf5527eac/services/migrations/gitea_downloader.go (L284-L295)

A similar bug when migrating from GitHub has been fixed in #14703. This
PR fixes the bug when migrating from Gitea and GitLab.

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 4a48370d91354c2857ade10a177c8827b5866e4c)
2023-11-14 13:17:12 +01:00
Lunny Xiao f2c3491b61
Fix http protocol auth (#27875) (#27878)
backport #27875

(cherry picked from commit 1dedf9bba0bf909f9e275565604ec8f2adb5a86e)
2023-11-14 13:17:12 +01:00
Giteabot 713652e3d8
Fix package webhook (#27839) (#27854)
Backport #27839 by @lunny

Fix #23742

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 2147bfde0573a2f2492ca0c78c2e042cf327903a)
2023-11-14 13:17:12 +01:00
Lunny Xiao b4fb797b32
Revert "fix orphan check for deleted branch (#27310) (#27320)" (#27763)
Because branch table is created until 1.21
Fix #27508

(cherry picked from commit a1c232cae3d8827691297d02d6f4ba980a805cd2)
2023-11-14 13:17:12 +01:00
Giteabot 2a5d5da930
Fix label render containing invalid HTML (#27752) (#27761)
Backport #27752 by @earl-warren

- The label HTML contained a quote that wasn't being closed.

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

(cherry picked from commit e2bc2c9a1fff482c49dbeb3a51e4e1c698bf506c)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit 63512cd15d14254beadc0fe105d4239708fb758d)
2023-11-14 13:17:12 +01:00
Giteabot 64373004b5
Fix org team endpoint (#27721) (#27729)
Backport #27721 by @lng2020

Fix #27711

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
(cherry picked from commit 71803d33e395829e4b7cee2bd4ae078527106a48)
2023-11-14 13:17:11 +01:00
Giteabot 2a321fcfda
Adapt .changelog.yml to new labeling system (#27701) (#27708)
Backport #27701 by @delvh

Otherwise, it is not possible anymore to generate changelogs.

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit a954cc3fb9d396af61e5d7af7a88d6ebe3abb80b)
2023-11-14 13:17:11 +01:00
Giteabot d6798ae015
Support allowed hosts for webhook to work with proxy (#27655) (#27674)
Backport #27655 by @wolfogre

When `webhook.PROXY_URL` has been set, the old code will check if the
proxy host is in `ALLOWED_HOST_LIST` or reject requests through the
proxy. It requires users to add the proxy host to `ALLOWED_HOST_LIST`.
However, it actually allows all requests to any port on the host, when
the proxy host is probably an internal address.

But things may be even worse. `ALLOWED_HOST_LIST` doesn't really work
when requests are sent to the allowed proxy, and the proxy could forward
them to any hosts.

This PR fixes it by:

- If the proxy has been set, always allow connectioins to the host and
port.
- Check `ALLOWED_HOST_LIST` before forwarding.

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit ca4418eff12d92a4da29bba4331451bf6cd0b620)
2023-11-14 13:17:11 +01:00
Giteabot cf1174acbf
Fix poster is not loaded in get default merge message (#27657) (#27665)
Backport #27657 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 80c0c8815203128703eae741e712289393458687)
2023-11-14 13:17:11 +01:00
Giteabot 62c33f92a9
Fix 404 when deleting Docker package with an internal version (#27615) (#27629)
Backport #27615 by @lng2020

close #27601
The Docker registry has an internal version, which leads to 404

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
(cherry picked from commit 171950a0d45745743d519aeb547b2a93cfb6410d)
2023-11-14 13:17:11 +01:00
Giteabot f142ae18c0
Fix attachment download bug (#27486) (#27570)
Backport #27486 by @lunny

Fix #27204

This PR allows `/<username>/<reponame>/attachments/<uuid>` access with
personal access token and also changed attachments API download url to
it so it can be download correctly.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 7b96f71bc713b937363ab71abd383fbb79d89216)
2023-11-14 13:17:11 +01:00
yp05327 2e50870688
Avoid run change title process when the title is same (#27467) (#27557)
Backport #27467 manually.

(cherry picked from commit e6d1afaee33bac32c905c15c15909ee22f63c9a6)
2023-11-14 13:17:11 +01:00
silverwind 2716e2f626
Fix mermaid flowchart margin issue (#27503) (#27517)
Backport https://github.com/go-gitea/gitea/pull/27503 to 1.20

Fixes: https://github.com/go-gitea/gitea/issues/27435
Related: https://github.com/mermaid-js/mermaid/issues/4907

<img width="924" alt="image"

src="https://github.com/go-gitea/gitea/assets/115237/494a1d2e-4c56-48d0-9843-82a5e5aa977e">

(cherry picked from commit 1d4c193df588c0141fad456f1c17b8dfaf733265)
2023-11-14 13:17:11 +01:00
Giteabot e0fe8a8ab4
Fix panic in storageHandler (#27446) (#27478)
Backport #27446 by @sryze

storageHandler() is written as a middleware but is used as an endpoint
handler, and thus `next` is actually `nil`, which causes a null pointer
dereference when a request URL does not match the pattern (where it
calls `next.ServerHTTP()`).

Example CURL command to trigger the panic:

```
curl -I "http://yourhost/gitea//avatars/a"
```

Fixes #27409

---

Note: the diff looks big but it's actually a small change - all I did
was to remove the outer closure (and one level of indentation) ~and
removed the HTTP method and pattern checks as they seem redundant
because go-chi already does those checks~. You might want to check "Hide
whitespace" when reviewing it.

Alternative solution (a bit simpler): append `, misc.DummyOK` to the
route declarations that utilize `storageHandler()` - this makes it
return an empty response when the URL is invalid. I've tested this one
and it works too. Or maybe it would be better to return a 400 error in
that case (?)

Co-authored-by: Sergey Zolotarev <sryze@outlook.com>
(cherry picked from commit 4ffa683820188175570ea3a0faf9d93046042b91)
2023-11-14 13:17:11 +01:00
Giteabot c50af699ea
When comparing with an non-exist repository, return 404 but 500 (#27437) (#27441)
Backport #27437 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 973b7f62989d16960fa918f5758ff2998317c352)
2023-11-14 13:17:11 +01:00
Lunny Xiao 915c60f8c1
Add 1.20.5 changelog (#27404)
(cherry picked from commit 4126aad4aa12f3dbd4a21063d266d096ee6bb52f)
2023-11-14 13:17:11 +01:00
Earl Warren a1e6944bd7
Revert "[BRANDING] X-Forgejo-OTP can be used instead of X-Gitea-OTP"
This reverts commit 9413fd0274.
2023-11-14 13:17:11 +01:00
Earl Warren d7e67cf616
[SEMVER] 5.0.6+0-gitea-1.20.5 2023-11-14 13:17:11 +01:00
Earl Warren ee48c0d5ea
[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
	* No MINIO testing
	* go 1.20 instead of go 1.21
2023-10-20 17:30:34 +02:00
Loïc Dachary e58e7bf088
[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)
2023-10-05 12:35:59 +02:00
Gusted 51988ef52b
[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-pick from eff097448b1ebd2a280fcdd55d10b1f6081e9ccd)

Conflicts:

	modules/context/context_cookie.go
	trivial context conflicts

	routers/web/web.go
	ctx.GetSiteCookie(setting.CookieRememberName) moved from services/auth/middleware.go
2023-10-05 08:50:54 +02:00
Earl Warren 3759c1a7c1
[SEMVER] 5.0.5+0-gitea-1.20.5 2023-10-03 14:49:26 +02:00
Lunny Xiao 4b23f11864
Fix bug of review request number (#27406)
Manually backport #27104 without tests because too many conflicted files
to backport it completely.

(cherry picked from commit 5c96a2be872cd610915461fe40675e400d94bf68)
2023-10-03 14:48:40 +02:00
Giteabot 4c21b82e18
Fix git 2.11 error when checking IsEmpty (#27393) (#27396)
Backport #27393 by @wxiaoguang

Fix #27389

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit acedf0f702d7037c89b87384bc399141d5d0af98)
2023-10-03 14:48:40 +02:00
Giteabot 3e8c3b7c09
Allow get release download files and lfs files with oauth2 token format (#26430) (#27378)
Backport #26430 by @lunny

Fix #26165
Fix #25257

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 23139aa27bbed804ca68b04b39f965a0ca69d277)
2023-10-03 14:48:40 +02:00
Giteabot 5e2d16de0e
Add logs for data broken of comment review (#27326) (#27344)
Backport #27326 by @lunny

Fix #27306

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit b6b71c78c453c631fe3ea42183a147ff68972fad)
2023-10-03 14:48:40 +02:00
Giteabot 101cfc1f82
fix orphan check for deleted branch (#27310) (#27320)
Backport #27310 by @earl-warren

- Modify the deleted branch orphan check to check for the new table
instead.
- Regression from 6e19484f4d
- Resolves https://codeberg.org/forgejo/forgejo/issues/1522

(cherry picked from commit c1d888686fe445e4edecb9d835c5b3893b574b75)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit 2138661dae2fbb88eba1a04d48faf27a2cebb934)
2023-10-03 14:48:40 +02:00
Giteabot fa5c61cab7
Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27249)
Backport #27203 by @Nabapadma-sarker

Fixes #27202

Co-authored-by: Nabapadma-sarker <nabapadmacse1991@gmail.com>
(cherry picked from commit 4b37eb2c23f8488f36247f25f9cfd4949eb17e23)
2023-10-03 14:48:40 +02:00
Giteabot ab9b1b850b
Fix z-index on markdown completion (#27237) (#27238)
Backport #27237 by @silverwind

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

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit dd44c2164e48fb8c777c2def313c7549e0820188)
2023-10-03 14:48:18 +02:00
Giteabot c590235171
Update database-preparation and add note re: MariaDB (#27232) (#27235)
Backport #27232 by @techknowlogick

update DB docs per feedback.
https://gitea.com/gitea/gitea-docusaurus/issues/69

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
(cherry picked from commit 2604571993c0d32d122d7d1525bc9bf0a1e84757)
2023-10-03 14:48:18 +02:00
KN4CK3R 13423d6eda
Quote table release in sql queries (#27205) (#27219)
Backport of #27205

Fixes #27174

`release` is a reserved keyword in MySql. I can't reproduce the issue on
my setup and we have a test for that code but it seems there can be
setups where it fails.

(cherry picked from commit eae6985b63e332e0f6e63b3922d1eae2f4ec1108)
2023-10-03 14:48:18 +02:00
Giteabot 1b1f878204
Fix release URL in webhooks (#27182) (#27184)
Backport #27182 by @jolheiser

Resolves #27180

`URL` points to the API URL, `HTMLURL` points to the web page.

Notably, however, for PRs they are the same URL. I switched them to use
HTMLURL to match the rest of the codebase terminology.

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
(cherry picked from commit d8583edfe7583437e8b6b334bf666cf1beff613e)
2023-10-03 14:48:18 +02:00
Giteabot f8bf284794
Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27162)
Backport #27150 by @memphis88

Similarly to the fix in https://github.com/go-gitea/gitea/pull/24694,
this addresses the team creation not returning the organization
information in the response.

This fix is connected to the
[issue](https://gitea.com/gitea/terraform-provider-gitea/issues/27)
discovered in the terraform provider.
Moreover, the
[documentation](https://docs.gitea.com/api/1.20/#tag/organization/operation/orgCreateTeam)
suggests that the response body should include the `organization` field
(currently being `null`).

Co-authored-by: Dionysios Kakouris <1369451+memphis88@users.noreply.github.com>
(cherry picked from commit fbe1f3511220f282bb47e5ceb2f5dd98a7623cea)
2023-10-03 14:48:08 +02:00
Giteabot dc6020645b
Fix successful return value for SyncAndGetUserSpecificDiff (#27152) (#27156)
Backport #27152 by @delvh

A function should not return an error when it is successful.
Otherwise, things like
https://discord.com/channels/322538954119184384/322538954119184384/1153705341620600833
happen…

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 25233a9bdcfd8d74c803be7712bdaed72eb41455)
2023-10-03 14:48:08 +02:00
Earl Warren 99a93025d2
[SEMVER] 5.0.4+0-gitea-1.20.4 2023-09-20 12:51:52 +02:00
Giteabot 0d86ea0c43
Improve actions docs related to pull_request event (#27126) (#27145)
Backport #27126 by @Zettat123

Related to #27039

The `ref` property in Gitea Actions is different from GitHub Actions.
This PR improves the documentation to explain the difference.

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 7a99c7b83c0c1b6002ab6ff43000cd928b791643)
2023-09-20 12:50:46 +02:00
Giteabot c041114a20
fix pagination for followers and following (#27127) (#27138)
Backport #27127 by @earl-warren

- Use the correct total amount for pagination. Thereby correctly show
the pagination bare when there's more than one page of
followers/followings.

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

(cherry picked from commit c1a136318be3bf72511bed108f2d67f2cf34e1b8)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit 1d6e5c8e5862e634081c943f346003c36e47415f)
2023-09-20 12:50:46 +02:00
Giteabot f54189092f
services/wiki: Close() after error handling (#27129) (#27137)
Backport #27129 by @earl-warren

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

Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
(cherry picked from commit 589e7d346f51de4a0e2c461b220c8cad34133b2f)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
(cherry picked from commit 882e465c3a4c60a47b9f8a2f58e3cc88c19ed641)
2023-09-20 12:50:46 +02:00
Giteabot 64a418dfc7
Fix issue templates when blank isses are disabled (#27061) (#27082)
Backport #27061 by @JakobDev

Fixes #27060

Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit b139234fa8d7b9d52f134117bbac7dce53e4914b)
2023-09-20 12:50:46 +02:00
sebastian-sauer 3ea5384241
Load reviewer before sending notification (#27063) (#27064)
Fixes #27035

(cherry picked from commit d8b39324d71112f0d8c2e38b2aa92fdccec536ef)
2023-09-20 12:50:46 +02:00
Lunny Xiao 745b45406d
Fix context cache bug & enable context cache for dashabord commits' authors(#26991) (#27017)
backport #26991

Unfortunately, when a system setting hasn't been stored in the database,
it cannot be cached.
Meanwhile, this PR also uses context cache for push email avatar display
which should avoid to read user table via email address again and again.

According to my local test, this should reduce dashboard elapsed time
from 150ms -> 80ms .

(cherry picked from commit 9df573bddcc01bc8c3ab495629678ad577071831)
2023-09-20 12:50:46 +02:00
wxiaoguang 8f6d442a04
Use secure cookie for HTTPS sites (#26999) (#27013)
Backport #26999

If the AppURL(ROOT_URL) is an HTTPS URL, then the COOKIE_SECURE's
default value should be true.

And, if a user visits an "http" site with "https" AppURL, they won't be
able to login, and they should have been warned. The only problem is
that the "language" can't be set either in such case, while I think it
is not a serious problem, and it could be fixed easily if needed.

(cherry picked from commit b0a405c5fad2055976747a1c8b2c48dfe2750c9f)
2023-09-20 12:50:46 +02:00
Infinoid 2e9fa11bb3
Correct the database.LOG_SQL default value in config cheat sheet (#26997) (#27002)
This is a manual backport of #26997 to v1.20.

(cherry picked from commit 3c53740244e175a253411c8fedcc1d3fff19ea7a)
2023-09-20 12:50:46 +02:00
Giteabot 957a64d91a
Fix INI parsing for value with trailing slash (#26995) (#27001)
Backport #26995 by @wxiaoguang

Fix #26977 (a temp fix)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit da7d7e60d800a9b13ed1341ef99bf3db062ed942)
2023-09-20 12:50:46 +02:00
Lunny Xiao 56a17f3565
Fix changelog typo (#26973)
(cherry picked from commit e502be46f3ac5f1075abd96bd9b326a4c1f7e96f)
2023-09-20 12:50:46 +02:00
Gusted 4b9a473e12
[GITEA] Use restricted sanitizer for repository description
- Backport of https://codeberg.org/forgejo/forgejo/pulls/1433
  - 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)
2023-09-13 17:17:37 +02:00
Earl Warren 5aad8a6918
[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)
2023-09-12 11:02:07 +02:00
Earl Warren b63df8b5c4
[SEMVER] 5.0.3+0-gitea-1.20.4 2023-09-08 09:36:09 +02:00
techknowlogick 11af4c9aad
1.20.4 changelog (#26966)
(cherry picked from commit 4a886de71ee21093ec63e39d8a228b7632526eae)
2023-09-08 08:10:08 +02:00
techknowlogick 052c83393f
Improve LDAP group config documentation (#21227) (#26921)
backport #21227

author @svenseeberg

Co-authored-by: Sven Seeberg <mail@sven-seeberg.de>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit b6fd1e48c0bf8a19853be8e88d9d4cd7acc99683)
2023-09-08 08:10:08 +02:00
Giteabot e25033ef8a
Update documents to fix some links (#26885) (#26888)
Backport #26885 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 9f14b2173abfe9269d8464679e878bc4f00b7a18)
2023-09-08 08:09:18 +02:00
CaiCandong f34f2c3141
Update docs about attachment path (#26883) (#26884)
Backport #26883
This change was caused by #26271, for configuration as below:
```
[attachment]
ENABLE = true
PATH = data/attachments
MAX_SIZE = 100
MAX_FILES = 5
```
Before #26271, the resolved path is ${AppWorkPath}/${attachments.PATH}
(such as `/var/lib/gitea/data/attachments`)
After #26271, the resolved path is ${AppDataPath}/${attachments.PATH}
(such as `/var/lib/gitea/data/data/attachments`)

Fix https://github.com/go-gitea/gitea/issues/26864 Follow
https://github.com/go-gitea/gitea/pull/26271

(cherry picked from commit e15794f62f4d2f6d0c35117f4240941a31caf3c1)
2023-09-08 08:09:18 +02:00
Giteabot 4df75c254f
Fix wrong review requested number (#26784) (#26880)
Backport #26784 by @lng2020

Fix the wrong review requested number mentioned by #18808 .
Fix #18808
Before:

![ksnip_20230829-140750](https://github.com/go-gitea/gitea/assets/70063547/0af2055b-6f16-4699-a944-c7186831d7f9)
After:

![ksnip_20230829-141817](https://github.com/go-gitea/gitea/assets/70063547/16633264-20ba-45e3-bfbb-a495ed76a45b)

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
(cherry picked from commit 2a184796b564309531f709e37430a21d8a3cc2ea)
2023-09-08 08:09:18 +02:00
Giteabot 1689b3da55
Redirect from {repo}/issues/new to {repo}/issues/new/choose when blank issues are disabled (#26813) (#26847)
Backport #26813 by @JakobDev

You can currently visit `{repo}/issues/new` and create a blank issue,
even if it's disabled. This PR fixes this,

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

Co-authored-by: JakobDev <jakobdev@gmx.de>
(cherry picked from commit 2cfabb68ffb4fe188cdbb323be46b300c85f0134)
2023-09-08 08:09:18 +02:00
wxiaoguang 9c0380fe84
Avoid double-unescaping of form value (#26853) (#26863)
Backport #26853

The old `prepareQueryArg` did double-unescaping of form value.

(cherry picked from commit e8da63c24ef9b950999364a86c3a01de6f460e4c)
2023-09-08 08:09:18 +02:00
Giteabot 193e04c43b
Fix verifyCommits error when push a new branch (#26664) (#26810)
Backport #26664 by @CaiCandong

> ### Description
> If a new branch is pushed, and the repository has a rule that would
require signed commits for the new branch, the commit is rejected with a
500 error regardless of whether it's signed.
>
> When pushing a new branch, the "old" commit is the empty ID
(0000000000000000000000000000000000000000). verifyCommits has no
provision for this and passes an invalid commit range to git rev-list.
Prior to 1.19 this wasn't an issue because only pre-existing individual
branches could be protected.
>
> I was able to reproduce with
[try.gitea.io/CraigTest/test](https://try.gitea.io/CraigTest/test),
which is set up with a blanket rule to require commits on all branches.

Fix #25565
Very thanks to @Craig-Holmquist-NTI for reporting the bug and suggesting
an valid solution!

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 93c36f395cf217b44e1f5a529c795a6202df8989)
2023-09-08 08:09:18 +02:00
Giteabot 6b5ef0fad7
Sync tags when adopting repos (#26816) (#26834)
Backport #26816 by @Zettat123

Fixes #26138

Sync the tags into database when adopting repos

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 302c03c4a9e288bdbda2cd6cde29003d0d13207d)
2023-09-08 08:09:18 +02:00
Giteabot d5845521a8
check blocklist for emails when adding them to account (#26812) (#26831)
Backport #26812 by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 41bae29f84c95f9af3fd7f24fe3d5b62d36573c5)
2023-09-08 08:09:18 +02:00
yp05327 a6c2201dd4
Fix context filter has no effect in dashboard (#26695) (#26811)
Backport #26695

(cherry picked from commit c72f6067b361f55a1e075e158c5897416cf90d57)
2023-09-08 08:09:18 +02:00
js6pak 833cf722ab
Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (#26759) (#26806)
Backport #26759

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit 54cc459ea811568ba1d049e6dce22159ac48ffa8)
2023-09-08 08:09:18 +02:00
Giteabot 0b1175f21b
Add fix incorrect can_create_org_repo for org owner team (#26683) (#26791)
Backport #26683 by @yp05327

Related to: #8312 #26491

In migration v109, we only added a new column `CanCreateOrgRepo` in Team
table, but not initial the value of it.
This may cause bug like #26491.

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit c3d323fd859539678ac10988945cbf7af057f766)
2023-09-08 08:09:18 +02:00
Giteabot 4d2b4008d3
Fix some slice append usages (#26778) (#26798)
Backport #26778 by @harryzcy

Co-authored-by: Chongyi Zheng <git@zcy.dev>
Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 4013f3f6006076fa3ca8be191750d1eec5da754d)
2023-09-08 08:09:18 +02:00
Giteabot 1d228e6ee9
Fix being unable to use a repo that prohibits accepting PRs as a PR source. (#26785) (#26790)
Backport #26785 by @CaiCandong

## Description
Sometimes, we need to use an upstream mirror repository to update the
current development repository, but mirror repositories are prohibited
from PR. It should not appear in `merge to,` but it can appear in `pull
from.`
Fix #24585 #26193 #26781
Related #24183

Many thanks to @apnote  for assisting me in reproducing this bug!

## ScreenShot
---
### Before

<img
src="https://github.com/go-gitea/gitea/assets/50507092/3d76c376-1f54-45b9-80c9-6ba8319d6a9a"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/fbfd9f7f-421f-4a2e-9a3e-f2958bbf3312"
width="400px">

### After

<img
src="https://github.com/go-gitea/gitea/assets/50507092/e6984524-4f61-4310-b795-4d8598bd8963"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/04065b44-78d7-4721-bf31-0f1674150727"
width="400px">

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
(cherry picked from commit 3bab20491e60a5bbcc64bef42394dcf427d74308)
2023-09-08 08:09:18 +02:00
xpume 53e4f672a3
Fix Page Not Found error (#26768)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit c8b189eb016e86e91e6700470eb2b89345d0e1eb)
2023-09-08 08:07:19 +02:00
Lunny Xiao bb84b7565f
Fix bug for ctx usage (#26763)
Fix #26684
Backport #26762

(cherry picked from commit a1cec4141e9b82fbee4e3cbf3d92af749df235ab)
2023-09-08 08:07:19 +02:00
wxiaoguang 66016b3fe3
Fix incorrect "tabindex" attributes (#26733) (#26734)
Backport #26733 manually

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 307ee2c044abe62c7e61787a6283e670fb3031ab)
2023-09-08 08:07:19 +02:00
Giteabot d7aa9fc964
Fix link in mirror docs (#26719) (#26732)
Backport #26719 by @silverwind

Fix hash fragment in this link

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 2f6c0e65966fd75ea066c266a0f7d3724634ad63)
2023-09-08 08:07:19 +02:00
Giteabot c407810217
Add matrix to support (#26382) (#26722)
Backport #26382 by @jolheiser

This PR adds our matrix space to the support options and alphabetizes
the list.

I also considered adding our Mastodon, however that isn't as suitable as
the other options because it's just whoever has access to the account vs
a community chat/forum.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
(cherry picked from commit e6173acac948dd46b3552cc08b40fd298bfc668f)
2023-09-08 08:07:19 +02:00
Giteabot 560ff3ea36
Make issue template field template access correct template data (#26698) (#26709)
Backport #26698 by @wxiaoguang

Regression of #23092, the `{{$field := .}}` was missing during that
refactoring.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 4af872178ebd53ac391939908afa7d95ac311b65)
2023-09-08 08:07:19 +02:00
wxiaoguang 4da20765e8
Backport line height fix (#26708)
Backport the `line-height: normal`, because #26520 was backported

(cherry picked from commit 508c624e996d33ad735327bc4583b990adf94d16)
2023-09-08 08:07:19 +02:00
Giteabot 03b397a408
Prefer variables over subprocesses (#26690) (#26693)
Backport #26690 by @thomas-mc-work

… because it doesn't require a separate shell, spawning a process which
cost unnecessary resources and takes time.

Co-authored-by: Thomas McWork <thomas.mc.work@posteo.de>
(cherry picked from commit ecfed9e298bc8bc29e5a0cde13f15e670d8ab0f7)
2023-09-08 08:07:19 +02:00
Giteabot c1efe5b104
add mfa doc (#26654) (#26674)
Backport #26654 by @lunny

copy and modified from #14572

> Whilst debating enforcing MFA within our team, I realised there isn't
a lot of context to the side effects of enabling it. Most of us use Git
over HTTP and would need to add a token.

I plan to add another PR that adds a sentence to the UI about needing to
generate a token when enabling MFA if HTTP is to be used.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 2f4de240c1c53fe38f4fc167931362deff0f3833)
2023-09-08 08:07:19 +02:00
Giteabot a98cb4d806
update config docs url (#26640) (#26642)
Backport #26640 by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit e1fa3d1d696db9f9b48f38254ea61d230f5eefe5)
2023-09-08 08:07:19 +02:00
Giteabot ef46b01168
Fix unable to display individual-level project (#26198) (#26636)
Backport #26198 by @CaiCandong

As title

Before:

![image](https://github.com/go-gitea/gitea/assets/50507092/94afc3bf-5597-4151-a59b-5632840ffa21)

After:

![image](https://github.com/go-gitea/gitea/assets/50507092/df81aa0b-98a6-477d-a270-2e45b3dca0fc)

fix #26189

Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com>
(cherry picked from commit 352a495c02e079e3b9ee0018dea937e7ccc5692e)
2023-09-08 08:07:19 +02:00
Giteabot 06c45d3b6e
Use correct minio error (#26634) (#26639)
Backport #26634 by @delvh

Previously, `err` was defined above, checked for `err == nil` and used
nowhere else.
Hence, the result of `convertMinioErr` would always be `nil`.
This leads to a NPE further down the line.
That is not intentional, it should convert the error of the most recent
operation, not one of its predecessors.

Found through
https://discord.com/channels/322538954119184384/322538954119184384/1143185780206993550.

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit a4b14638b50593a94121d2dfbca1d848fbec79b9)
2023-09-08 08:07:19 +02:00
a1012112796 5abca17b64
fix reopen logic for agit flow pull request (#26399) (#26613)
Backport #26399

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit f43df2f8201c33260b65b582556a3b0f4c75b637)
2023-09-08 08:07:19 +02:00
Giteabot 19a49e763a
Add branch_filter to hooks API endpoints (#26599) (#26632)
Backport #26599 by @yardenshoham

We now include the branch filler in the response.

- Closes #26591

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit fe78aabc673daf36655f0cca7e83cf2b057b8361)
2023-09-08 08:07:19 +02:00
Giteabot 2f6d011503
Ignore the trailing slashes when comparing oauth2 redirect_uri (#26597) (#26618)
Backport #26597 by @wxiaoguang

Fix #26526

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 4aed0e6b074b538ba71ba0560a416f282b3cc30b)
2023-09-08 08:07:19 +02:00
Gusted ec4b6d7d04 Merge pull request '[BRANDING] gitea logo for gitea webhooks' (#1369) from earl-warren/forgejo:wip-v1.20-webhook into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1369
2023-09-01 19:26:36 +00:00
Earl Warren 7f7e1ccab8
[BRANDING] gitea logo for gitea webhooks
Refs: https://codeberg.org/forgejo/forgejo/issues/1367
(cherry picked from commit 2d8c1b93734acec918729e27c5613a8f9fb41ceb)
2023-09-01 11:56:05 +02:00
Earl Warren 18b4554009 Merge pull request '[TESTS] [v1.20] verify facts for the admin storage documentation' (#1364) from earl-warren/forgejo:wip-v1.20-development-storage-doc-tests into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1364
2023-08-31 15:03:31 +00:00
Earl Warren d3b8870700
[TESTS] verify facts for the admin storage documentation (squash)
(cherry picked from commit d83d8ce57b8b39b4da849f5403198ecf706117ba)
2023-08-31 15:32:22 +02:00
oliverpool ebf80c3d90 [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>
2023-08-22 09:02:58 +02:00
Gusted fa25b9eec6
[GITEA] Add slow SQL query warning
- Backport of https://codeberg.org/forgejo/forgejo/pulls/1284
  - 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.
2023-08-21 21:18:43 +02:00
John Olheiser 07531cf953
Set errwriter for urfave/cli v1 (#26616)
Resolves #26615

(cherry picked from commit 11711c51cb497477176ea68309d2d061820996da)
2023-08-21 07:27:20 +02:00
Giteabot 4f8ae2881c
Update 1.20.3 changelog (#26609) (#26610)
Backport #26609 by @delvh

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit bcb0f3a90fae49047f73b37fcb50b075ed641dfa)
2023-08-21 07:27:20 +02:00
Giteabot b31c44894e
Use "input" event instead of "keyup" event for migration form (#26602) (#26605)
Backport #26602 by @wxiaoguang

Otherwise, "pasted" content won't update the UI.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit c99374b1510249e3f8a535cdecd6cf1d5637e0ef)
2023-08-21 07:27:20 +02:00
Giteabot 98820fe4f2
Do not use deprecated log config options by default (#26592) (#26600)
Backport #26592 by @wxiaoguang

Simplify the log config

* Remove unnecessary `ROUTER` config, it defaults to the `MODE`.
* `XORM` config was deprecated

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit b643b2ca9c2e4402c1bc2362d095c53d34c07db6)
2023-08-21 07:27:20 +02:00
CaiCandong 28acd6e262
Fix project filter bugs (#26490) (#26558)
Backport  #26490

related: #26012

1. missing project filter on the issue page.

1e76a824bc/modules/indexer/issues/dboptions.go (L11-L15)
2. incorrect SQL condition: some issue does not belong to a project but
exists on the project_issue table.

f5dbac9d36/models/issues/issue_search.go (L233)

![before](https://github.com/go-gitea/gitea/assets/50507092/1dcde39e-3e2f-4151-b2c6-4d67bf493c2f)

![after](https://github.com/go-gitea/gitea/assets/50507092/badfb81f-056d-4a2f-9838-1cba9c15768d)

(cherry picked from commit 94f86964b4e62a8c825e3debae9afb0c0301331d)
2023-08-21 07:27:20 +02:00
Giteabot c8f437b316
Add minimum polyfill to support "relative-time-element" in PaleMoon (#26575) (#26578)
Backport #26575 by @wxiaoguang

Close #26525

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 1f29cfa68313c982497d09ef1b3b0fc5e5c9acba)
2023-08-21 07:27:20 +02:00
Giteabot 563fc65e35
Fix "issueReposQueryPattern does not match query" (#26556) (#26564)
Backport #26556 by @wolfogre

Fix
`https://github.com/go-gitea/gitea/pull/26545#discussion_r1295734340`

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 1cedf36d301913cb36dbc38ffd987ada9efb4a77)
2023-08-21 07:27:20 +02:00
Giteabot 4ac522c8aa
Sync repo's IsEmpty status correctly (#26517) (#26560)
Backport #26517 by @wxiaoguang

Close #26509

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 7da85fa0c3d7ddf4907ca74ef81ee532d768df87)
2023-08-21 07:27:20 +02:00
Giteabot 44658b7d2c
Fix typo of RunerOwnerID (#26508) (#26528)
Backport #26508 by @yp05327

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 0ac8b774e95cecd1050d7a759f3830b3198b63fd)
2023-08-21 07:27:20 +02:00
KN4CK3R 471138829b
Fix NuGet search endpoints (#25613) (#26499)
Backport of #25613

Fixes #25564
Fixes #23191

- Api v2 search endpoint should return only the latest version matching
the query
- Api v3 search endpoint should return `take` packages not package
versions

(cherry picked from commit 762d4245fb22a927861d30c6314d81e27eb1a06a)
2023-08-21 07:27:20 +02:00
Giteabot a7ecb5a8bf
Fix dark theme highlight for "NameNamespace" (#26519) (#26527)
Backport #26519 by @wxiaoguang

The color is taken from "Name"

Before:

![image](https://github.com/go-gitea/gitea/assets/2114189/b94d7521-770c-4e14-a63b-f30c44fe883f)

After:

![image](https://github.com/go-gitea/gitea/assets/2114189/d99c1f13-a0c0-4dc8-82ab-bfdd451e46ec)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 3571cbba343b7a249c408cc7e6fc4d4f7efffa2a)
2023-08-21 07:27:20 +02:00
Giteabot 682f613810
Use hidden over clip for text truncation (#26520) (#26522)
Backport #26520 by @silverwind

Avoid browser bugs:

- Firefox not cutting off -
https://github.com/go-gitea/gitea/pull/26354#issuecomment-1678456052
- Safari not showing ellipsis -
https://github.com/go-gitea/gitea/pull/26354#issuecomment-1678812801

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 6d60d4e554702815c1da484bc1fa2048b166e56d)
2023-08-21 07:27:20 +02:00
Giteabot 5289619383
Set "type=button" for editor's toolbar buttons (#26510) (#26518)
Backport #26510 by @wxiaoguang

The editor usually is in a form, so the buttons should have
"type=button", avoid conflicting with the form's submit.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 31208fe9a138ae29a114a28155e73b3e9b259ce3)
2023-08-21 07:27:20 +02:00
Giteabot 622ec5c79f
Detect ogg mime-type as audio or video (#26494) (#26505)
Backport #26494 by @wxiaoguang

"ogg" is just a "container" format for audio and video.

Golang's `DetectContentType` only reports "application/ogg" for
potential ogg files.

Actually it could do more "guess" to see whether it is a audio file or a
video file.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 4bdb8dd9cc028a071819afd8f79cf29b30ab4d30)
2023-08-21 07:26:43 +02:00
Giteabot 2f34f1ec21
Use object-fit: contain for oauth2 custom icons (#26493) (#26498)
Backport #26493 by @wxiaoguang

It works for various sizes.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 24d6aacc7ee4745799bd2f778c0e2e882099cfa3)
2023-08-21 07:26:36 +02:00
Giteabot 601df4d472
Move dropzone progress bar to bottom to show filename when uploading (#26492) (#26497)
Backport #26492 by @wxiaoguang

1. Make the "filename" visible
2. Avoiding UI flicker when the uploading is completing

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit d1a55aabc944a7428880943319d67a227e266f22)
2023-08-21 07:26:31 +02:00
Giteabot b683b93d16
Fix storage path logic especially for relative paths (#26441) (#26481)
Backport #26441 by @lunny

This PR rewrites the function `getStorage` and make it more clear.

Include tests from #26435, thanks @earl-warren

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Earl Warren <contact@earl-warren.org>
(cherry picked from commit f1c5d33d3e8ec3dc5988c130b6899cffe6b0e651)
2023-08-21 07:22:19 +02:00
Giteabot d297a87f75
Add ThreadID parameter for Telegram webhooks (#25996) (#26480)
Backport #25996

Telegram has recently implemented threads (channels) for group chats.

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: neveraskedtoexist <matikot415@gmail.com>
(cherry picked from commit acc0fd22d87d6b0549ba624e4f1a760169b0624b)
2023-08-21 07:22:19 +02:00
Giteabot f74522a352
Close stdout correctly for "git blame" (#26470) (#26473)
Backport #26470 by @wxiaoguang

Close stdout correctly for "git blame", otherwise the failed "git blame"
would cause the request hanging forever.

And "os.Stderr" should never (seldom) be used as git command's stderr
(there seems some similar problems in code, they could be fixed later).

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit fe1b11b639792b601ac5ba78c0378058032ec8a8)
2023-08-21 07:22:19 +02:00
Giteabot 0c8a96896f
Remove last newline from config file (#26468) (#26471)
Backport #26468 by @wxiaoguang

When users put the secrets into a file (GITEA__sec__KEY__FILE), the
newline sometimes is different to avoid (eg: echo/vim/...)

So the last newline could be removed when reading, it makes the users
easier to maintain the secret files.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 80d7288ea45ea69060eb41709f188c09b33ca266)
2023-08-21 07:22:19 +02:00
Giteabot 82e5247a43
Check first if minio bucket exists before trying to create it (#26420) (#26465)
Backport #26420 by @lunny

For some reason, the permission of the client_id and secret may cannot
create bucket, so now we will check whether bucket does exist first and
then try to create a bucket if it doesn't exist.

Try to fix #25984

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 2d1202b32c1a975fe6cf7b139d1ab4ed292bcca1)
2023-08-21 07:22:19 +02:00
wxiaoguang a12ea7a7cd
Avoiding accessing undefined tributeValues #26461 (#26462)
Backport #26461

(cherry picked from commit 9112ce22a400d66c82b429fae72e8637a34727c7)
2023-08-21 07:22:19 +02:00
Earl Warren 3e48942b1e
[TESTS] upgrade tests for storage
(cherry picked from commit 884ca63738cc2e2c7cde31c649e9fa77cd590044)
2023-08-21 07:22:19 +02:00
Earl Warren 6ab5735e90
[UPGRADE] add sanity checks for [storage*]
Refs: https://forgejo.org/2023-08-release-v1-20-3-0/
(cherry picked from commit a266dd0ce3fca1296c6713ff1266f0065f0cd72b)
2023-08-21 07:22:19 +02:00
Earl Warren fe55c78fb1
[UPGRADE] run sanity checks before the database is upgraded
(cherry picked from commit 69741e4e66932a9ac092089e7ba27399c55dcd1a)
2023-08-21 07:22:19 +02:00
Earl Warren 1b568e284f
[GITEA] add GetFile to config provider
(cherry picked from commit 88d1b53eeaa0d5ad0ed54c191236db928aadedf0)
2023-08-21 07:22:19 +02:00
Earl Warren 03f33a0320
[SEMVER] store SemVer in ForgejoSemVer after a database upgrade
(cherry picked from commit b7fe7cf401f4bddd6455efc651f7ac054f3fe1cf)
2023-08-21 07:22:18 +02:00
Earl Warren 2605e121d4
[DB] forgejo migration v2: create the forgejo_sem_ver table
(cherry picked from commit 86b26436af85e0eedb732e115e8be024e1d54ca6)

Conflicts:
	models/forgejo_migrations/migrate.go
	trivial context conflict
2023-08-21 07:22:18 +02:00
Earl Warren 1ffddf75d6
[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)
2023-08-21 07:22:18 +02:00
Giteabot 49d2a9e43c
Fix incorrect color of selected assignees when create issue (#26324) (#26372)
Backport #26324 by @yp05327

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/75d610b2-3823-4366-be85-c77c9106feff)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/15afc6ac-f5ad-4e24-8983-fea8ace5921f)

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 2bdc38e5921c28994437830561072257c3dca45e)
2023-08-21 07:22:18 +02:00
Giteabot 4e6b43e4bc
Update upgrade documentation to add a check for deprecated configurations (#26451) (#26452)
Backport #26451 by @lunny

fix
https://github.com/go-gitea/gitea/issues/25995#issuecomment-1674096710

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 0f5e07f5389ca36608eb840e35edc164d437aa40)
2023-08-21 07:22:18 +02:00
Giteabot 5cf57d940f
Call git.InitSimple for runRepoSyncReleases (#26396) (#26450)
Backport #26396 by @wxiaoguang

Fix #26394

Otherwise, the git module is not initialized and it doesn't respect the
"timeout" config in app.ini

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit d6cf261be860e8022ccbad5585fc3508e840d409)
2023-08-21 07:22:18 +02:00
Giteabot bbe06fcf17
Add changelog for 1.20.3 (#26373) (#26375)
Backport #26373 by @delvh

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 7c555b2231cd199954b5e841b51f972552782f74)
2023-08-21 07:22:18 +02:00
Giteabot 3d69647e06
minio: add missing region on client initialization (#26412) (#26438)
Backport #26412 by @nekrondev

The MinIO client isn't redirecting to the correct AWS endpoint if a
non-default data center is used.

In my use case I created an AWS bucket at `eu-central-1` region. Because
of the missing region initialization of the client the default
`us-east-1` API endpoint is used returning a `301 Moved Permanently`
response that's not handled properly by MinIO client. This in return
aborts using S3 storage on AWS as the `BucketExists()` call will fail
with the http moved error.

MinIO client trace shows the issue:

```text
---------START-HTTP---------
HEAD / HTTP/1.1
Host: xxxxxxxxxxx-prod-gitea-data.s3.dualstack.us-east-1.amazonaws.com
User-Agent: MinIO (windows; amd64) minio-go/v7.0.61
Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20230809/accesspoint.eu-central-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20230809T141143Z

HTTP/1.1 301 Moved Permanently
Connection: close
Content-Type: application/xml
Date: Wed, 09 Aug 2023 14:11:43 GMT
Server: AmazonS3
X-Amz-Bucket-Region: eu-central-1
X-Amz-Id-2: UK7wfeYi0HcTcytNvQ3wTAZ5ZP1mOSMnvRZ9Fz4xXzeNsS47NB/KfFx2unFxo3L7XckHpMNPPVo=
X-Amz-Request-Id: S1V2MJV8SZ11GEVN
---------END-HTTP---------
```

Co-authored-by: nekrondev <heiko@noordsee.de>
Co-authored-by: Heiko Besemann <heiko.besemann@qbeyond.de>
(cherry picked from commit 981ab48503997bf3b2cefcfe623fba49c4317450)
2023-08-21 07:22:18 +02:00
Giteabot c029b1a3bc
Fix wrong middleware sequence (#26428) (#26436)
Backport #26428 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit ec37ea5945244f46026f4ec6a2e5f85b7dfbfcd6)
2023-08-21 07:22:18 +02:00
wxiaoguang e64aa0d9c2
Fix admin queue page title and fix CI failures (#26409) (#26421)
Backport #26409

* Fix #26408
* Bypass the data race issue in "ssh" package

(cherry picked from commit 8ad331c9d209f50ed41c92b289ea2dcf575b1bdb)
2023-08-21 07:22:18 +02:00
Giteabot 0414e95cfb
Add pull request review request webhook event (#26401) (#26407)
Backport #26401 by @yardenshoham

Add webhook events for pull request review requests

- Fixes #26371
- Added support for the "Pull request review requested" and "Pull
request review request removed" webhook events.
- Updated the `getPullRequestPayloadInfo` function in `general.go` to
handle these new webhook events.

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/bd942971-fb1d-40f3-8961-46638e3588fa)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/216e9c7d-0a4d-49f9-8492-2d14c88bbf4e)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit dbabdf6d711ce0d72f98b2f099397c2ae7b7444b)
2023-08-21 07:22:18 +02:00
Giteabot 8265bece8e
Introduce ctx.PathParamRaw to avoid incorrect unescaping (#26392) (#26405)
Backport #26392 by @wxiaoguang

Fix #26389

And complete an old TODO: `ctx.Params does un-escaping,..., which is
incorrect.`

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 2d1a7e1cd42b31a62ca627423d088339809238c8)
2023-08-21 07:22:18 +02:00
Giteabot 119afd3761
Fix incorrect sort link with .profile repository (#26374) (#26379)
Backport #26374 by @CaiCandong

fix #26360
Before:

![before](https://github.com/go-gitea/gitea/assets/50507092/5606afe1-9aa2-455e-8d6f-123ff1ac7011)

After:

![After](https://github.com/go-gitea/gitea/assets/50507092/14ff544a-e614-4d41-8615-5244b4ba56eb)

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
(cherry picked from commit df5558135b3520ad046588e781a3845b7b4aa24b)
2023-08-21 07:22:18 +02:00
Giteabot 802701acad
Fix text truncate (#26354) (#26384)
Backport #26354 by @Maks1mS

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

Before:

![image](https://github.com/go-gitea/gitea/assets/36362599/c8c27bcb-469f-4def-8521-d9e054c16ecb)

After:

![image](https://github.com/go-gitea/gitea/assets/36362599/2405b6e8-fc5c-4b13-b66b-007bc11edbc4)

Co-authored-by: Maxim Slipenko <no-reply@maxim.slipenko.com>
(cherry picked from commit f329982b6ea1d2f0256a58d77415852b9cfc631c)
2023-08-21 07:22:17 +02:00
Giteabot 46ba658cc2
Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279) (#26368)
Backport #26279 by @wxiaoguang

Close #26277
Fix #26285

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit cb1a4da5c271d9639a8305b8f7d03dd54e835f4e)
2023-08-21 07:22:17 +02:00
Earl Warren d83135c204
Revert "[GITEA] Use join for the deleting issue actions query"
This reverts commit 9b71369be9.
2023-08-21 07:22:17 +02:00
Earl Warren 695fda3dd0
[SEMVER] 5.0.2+0-gitea-1.20.3 2023-08-21 07:22:17 +02:00
delvh 64e2c8f6ff
Display human-readable text instead of cryptic filemodes (#26352) (#26358)
Backport #26352

Now, you don't need to be a git expert anymore to know what these numbers mean.

## Before

![grafik](https://github.com/go-gitea/gitea/assets/51889757/9a964bf6-10fd-40a6-aeb2-ac8f437f8c32)

## After

![grafik](https://github.com/go-gitea/gitea/assets/51889757/84573cb9-55b6-4dde-9866-95f71b657554)

or when the mode actually changed:

![grafik](https://github.com/go-gitea/gitea/assets/51889757/0f327538-ebdc-40e7-8c99-f9e21b67f638)

(cherry picked from commit 39cbca0f952ecdd1b985f20b9dd9fef4d621f99e)
2023-08-21 07:22:17 +02:00
Giteabot 678c611c3d
[docs] Add missing backtick in quickstart.zh-cn.md (#26349) (#26357)
(cherry picked from commit 9aadc25bc14d822099a0ea2b81c0abe126fae5f2)
2023-08-21 07:22:17 +02:00
Brian Lachniet 9db27d2602
[docs] Fix Gmail configuration (#26356)
(cherry picked from commit b94370504ff2c904707f25774da1d168ee4f37fd)
2023-08-21 07:22:17 +02:00
Giteabot f597c789e1
Hide last indexed SHA when a repo could not be indexed yet (#26340) (#26345)
Backport #26340 by @CaiCandong

Now, for a new repo without any commit, the Last indexed SHA field looks
like this:
Before:

![image](https://github.com/go-gitea/gitea/assets/50507092/cecc6e24-3366-4093-ae07-c361ea34b373)
After:

![image](https://github.com/go-gitea/gitea/assets/50507092/9b6ba703-b0d5-4648-ad6b-9a2341dd60f9)

fix #26336

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
(cherry picked from commit 59354d7135c4d380e11cb35ae0ac59a0ec7bf041)
2023-08-21 07:22:17 +02:00
Giteabot 92589b9b8d
Remove backslashed newlines on markdown (#26344) (#26348)
Backport #26344 by @lunny

Fix https://gitea.com/gitea/gitea-docusaurus/issues/56

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 0b97463cef7d86c930b808ec4f08f9ee700bff86)
2023-08-21 07:22:17 +02:00
Loïc Dachary 916ec9acab
[TESTS] MockVariable temporarily replaces a global value
defer test.MockVariable(&variable, 1234)()

(cherry picked from commit 9c78752444c2411f20e72b96b7b4fdf5359099d5)
(cherry picked from commit 8ab559df0d57a17a0ea73bd3676f40a523a15ab6)
(cherry picked from commit 2e7fe1ec9566e4840992e4049d8349873b7334ee)
(cherry picked from commit f9618b8896)

Conflicts:
	modules/test/utils.go
	https://codeberg.org/forgejo/forgejo/issues/1219
2023-08-21 07:22:17 +02:00
wxiaoguang 2e539d5190
Fix incorrect CLI exit code and duplicate error message (#26346) (#26347)
Backport #26346

Follow the CLI refactoring, and add tests.

(cherry picked from commit fa431b377d7055c6c1362787eebda5b8b67e8d58)
2023-08-21 07:22:17 +02:00
Earl Warren 149cd865ea
Revert "[TESTS] MockVariable temporarily replaces a global value"
This reverts commit f9618b8896.
2023-08-21 07:22:17 +02:00
Giteabot 2f6b7ce91a
Fix log typo in task.go (#26337) (#26343)
Backport #26337 by @cassiozareck

Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
(cherry picked from commit 8a97cdd91bff61129505d63311a0686c61abca71)
2023-08-21 07:22:17 +02:00
Giteabot 75417ed070
Prevent newline errors with Debian packages (#26332) (#26342)
Backport #26332 by @KN4CK3R

Fixes #26313

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 3e9475b3b25e1f7052842ef964be5da343ebe957)
2023-08-21 07:22:16 +02:00
Giteabot 33c52556a3
Fix bug with sqlite load read (#26305) (#26339)
Backport #26305 by @lunny

Possible fix #26280

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 9be9042479ccbe73b4d78fd2acc467972b48ecb3)
2023-08-21 07:22:16 +02:00
Giteabot e5c26e38f5
Make git batch operations use parent context timeout instead of default timeout (#26325) (#26330)
Backport #26325 by @wxiaoguang

Fix #26064

Some git commands should use parent context, otherwise it would exit too
early (by the default timeout, 10m), and the "cmd.Wait" waits till the
pipes are closed.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 9451781ebea0d9945127c142136e5b6ef373141c)
2023-08-21 07:22:16 +02:00
Giteabot 5aa6a8288d
Fix the wrong derive path (#26271) (#26318)
Backport #26271 by @lunny

This PR will fix #26264, caused by #23911.

The package configuration derive is totally wrong when storage type is
local in that PR.

This PR fixed the inherit logic when storage type is local with some
unit tests.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 88f6f7579cdaa557333bc86b3e45bf6458d889b6)
2023-08-21 07:22:16 +02:00
Giteabot 9e4be39acb
Fix the topic validation rule and suport dots (#26286) (#26303)
Backport #26286 by @wxiaoguang

1. Allow leading and trailing spaces by user input, these spaces have
already been trimmed at backend
2. Allow using dots in the topic

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit fcd055c34a21095123d6fc18449e855b6c626bec)
2023-08-21 07:22:16 +02:00
Giteabot db326835e6
Support getting changed files when commit ID is EmptySHA (#26290) (#26316)
Backport #26290 by @Zettat123

Fixes #26270.

Co-Author: @wxiaoguang

Thanks @lunny for providing this solution

As
https://github.com/go-gitea/gitea/issues/26270#issuecomment-1661695151
said, at present we cannot get the names of changed files correctly when
the `OldCommitID` is `EmptySHA`. In this PR, the `GetCommitFilesChanged`
method is added and will be used to get the changed files by commit ID.

References:
- https://stackoverflow.com/a/424142

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a57568bad7dac3c818d01a5b75fe66ce83bf140f)
2023-08-21 07:22:16 +02:00
Giteabot b97dbf7a9e
Clarify the logger's MODE config option (#26267) (#26281)
Backport #26267 by @wxiaoguang

1. Fix the wrong document (add the missing `MODE=`)
2. Add a more friendly log message to tell users to add `MODE=` in their
config

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a7583370462ecd409485606c3d0379adb320cd05)
2023-08-21 07:22:16 +02:00
Giteabot bd416d0ba9
Fix due date rendering the wrong date in issue (#26268) (#26274)
Backport #26268 by @yardenshoham

Closes #26263

We have to pass the date without the time.

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/6b6cb43d-2b1c-4679-951d-20f48c94bfdd)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/50441baf-2c52-452b-bb0d-6034a407abde)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 2cf1515f5c5e048b5f1280e60c54ad3247988ad0)
2023-08-21 07:22:16 +02:00
Giteabot 6a15395f19
Update Arch linux URL from community to extra (#26273) (#26276)
Co-authored-by: minijaws <minijaws@gmail.com>
(cherry picked from commit a075285f2488dcbfe82c95fa9e6eb86c7e4d34fd)
2023-08-21 07:22:16 +02:00
Earl Warren 20557c6bdb
[BRANDING] define the forgejo webhook type
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)

Conflicts:
	routers/web/web.go
	https://codeberg.org/forgejo/forgejo/issues/1219
2023-08-21 07:22:16 +02:00
Giteabot c1544754f8
Use shared template for webhook icons (#26242) (#26246)
Backport #26242 by @silverwind

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

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 2517da90aacc735ce5a9d5401fe23990597139d4)
2023-08-21 07:22:16 +02:00
Earl Warren c862cc15c8
Revert "[BRANDING] define the forgejo webhook type"
This reverts commit 02ba08ca84.
2023-08-21 07:22:16 +02:00
Giteabot c2f2fed57a
Fix pull request check list is limited (#26179) (#26245)
Backport #26179 by @CaiCandong

In the original implementation, we can only get the first 30 records of
the commit status (the default paging size), if the commit status is
more than 30, it will lead to the bug #25990. I made the following two
changes.
- On the page, use the ` db.ListOptions{ListAll: true}` parameter
instead of `db.ListOptions{}`
- The `GetLatestCommitStatus` function makes a determination as to
whether or not a pager is being used.

fixed #25990

Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com>
(cherry picked from commit 060026995a95a61a35535215105db015bab8a697)
2023-08-21 07:22:15 +02:00
Giteabot cc8c7005a6
Don't autosize textarea in diff view (#26233) (#26244)
Backport #26233 by @silverwind

Resizing the comment editor can be a very expensive operation because it
triggers page reflows, which on large PRs can take upwards of seconds to
complete. Disable this mechanism on the diff page only where we know
that the page can get large.

Fixes https://github.com/go-gitea/gitea/issues/26201 for the textarea
editor.

I don't think this can be fixed for EasyMDE because as far as I can
tell, it exposes no option to disable this resizing.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 0f265a2489bcdac6cf350a89eecb19ed78e133c1)
2023-08-21 07:22:15 +02:00
silverwind b073f7fd6a
Fix attachment clipboard copy on insecure origin (#26224) (#26231)
Backport https://github.com/go-gitea/gitea/pull/26224.

(cherry picked from commit 0d04f70d6ae9a1cfd20117f57a901017021ea1f3)
2023-08-21 07:22:15 +02:00
Giteabot 1d900bc6a9
Avoid writing config file if not installed (#26107) (#26113)
Backport #26107 by @wxiaoguang

Just like others (oauth2 secret, internal token, etc), do not generate
if no install lock

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit e2596b0a999b2d2b6ce699ac8b6a3981a89d5bd5)
(cherry picked from commit 78722734fe)
2023-08-21 07:22:15 +02:00
Gusted 8126dadc8d Merge pull request '[GITEA] Add anchor to review types' (#1295) from Gusted/forgejo:forgejo-bp-1293 into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1295
2023-08-19 23:47:55 +00:00
Gusted 88e179d5ef
[GITEA] Add anchor to review types
- Backport of https://codeberg.org/forgejo/forgejo/pulls/1293
  - 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
2023-08-19 20:46:46 +02:00
Gusted 08f1fe5812 Merge pull request '[GITEA] Use vertical tabs on issue filters' (#1294) from Gusted/forgejo:forgejo-bp-1287 into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1294
2023-08-19 18:43:09 +00:00
Gusted 7e18a86a3a
[GITEA] Use vertical tabs on issue filters
- Backport of https://codeberg.org/forgejo/forgejo/pulls/1287
  - 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)
2023-08-19 13:17:00 +02:00
Gusted 070904b531 Merge pull request 'Don't stack PR tab menu on small screens (#25789)' (#1288) from Gusted/forgejo:forgejo-gt-backport-25789 into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1288
2023-08-19 09:15:03 +00:00
sebastian-sauer 90053ce279
Don't stack PR tab menu on small screens (#25789)
the stacking takes up screen space - display the tabs as the navigation
bar. github uses the same layout.

Screenshots (left before, right after):

![image](https://github.com/go-gitea/gitea/assets/1135157/d7e2aaec-c67b-403d-8d56-d4c824b04eed)
![image](https://github.com/go-gitea/gitea/assets/1135157/9e150881-c265-4074-afd7-407bb52e1934)

Large screen:

![image](https://github.com/go-gitea/gitea/assets/1135157/d5cbdaa3-2962-4c4f-9595-5938981ff99e)

(cherry picked from commit b81c013057)
2023-08-18 15:40:21 +02:00
Gusted 30b11209d1 Merge pull request '[GITEA] Wrap branch information in PR list' (#1255) from Gusted/forgejo:forgejo-120-wrap-branches into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1255
2023-08-13 12:22:55 +00:00
Gusted b45b87988b [GITEA] Wrap branch information in PR list
- On mobile there's not a lot of horizontal space, so sometimes
information such as icons has to be removed or information gets wrapped
in order to not result in overflowing or weird UI behavior.
- On mobile visiting the pull requests list of an repository, it shows
which head branch is merging into which base branch. This wasn't
properly made responsive and with sufficient long branch names (such as
those used in the Forgejo repository) it resulted in weird UI behavior.
- This patch fixes that by allowing it to wrap, such as the behavior in
1.21
- This already has been fixed in 1.21 with
b9baed2c74.
2023-08-12 17:14:21 +00:00
Gusted 291b1b6a26 Merge pull request '[GITEA] Fix media description render for orgmode' (#1256) from Gusted/forgejo:forgejo-backport-1224 into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1256
2023-08-12 17:13:56 +00:00
Gusted 82cb19649d
[GITEA] Fix media description render for orgmode
- Backport of #1224
- In org mode you can specify an description for media via the following
syntax `[[description][media link]]`. The description is then used as
title or alt.
- This patch fixes the rendering of the description by seperating the
description and non-description cases and using `org.String()`.
- Added unit tests.
- Inspired by 6eb20dbda9/org/html_writer.go (L406-L427)
- Resolves https://codeberg.org/Codeberg/Community/issues/848
2023-08-12 16:04:33 +02:00
Gusted a8f5ad1437 Merge pull request 'Improve profile readme rendering (#25988)' (#1240) from earl-warren/forgejo:forgejo-v1.20-readme into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1240
2023-08-11 08:54:23 +00:00
Earl Warren 84c3b60a4c
Improve profile readme rendering (#25988)
- Tell the renderer to use the `document` mode, so it's consistent with
other renderers.
- Use the same padding as `.file-view.markup`, so it's consistent with
other containers that contain markup rendering.
- Resolves https://codeberg.org/forgejo/forgejo/issues/833

Co-authored-by: Gusted <postmaster@gusted.xyz>
Conflicts:
	routers/web/user/profile.go
	inserted Metas:   map[string]string{"mode": "document"}, where
	it was missing
2023-08-11 08:56:04 +02:00
Earl Warren 5d3cfbd2ba
[CI] pin go v1.20 for testing
Refs: https://codeberg.org/forgejo/forgejo/issues/1228
2023-08-09 17:56:06 +02:00
Gusted b1b90dbb4b Merge pull request 'Fix API leaking Usermail if not logged in' (#1197) from Gusted/forgejo:gitea-backport-25097 into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1197
2023-08-05 19:46:59 +00:00
JakobDev d89003cc1b Fix API leaking Usermail if not logged in (#25097)
The API should only return the real Mail of a User, if the caller is
logged in. The check do to this don't work. This PR fixes this. This not
really a security issue, but can lead to Spam.

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit ea385f5d39)
2023-08-05 11:43:54 +00:00
Loïc Dachary c9cd5fc65a
[GITEA] golang.org/x/net v0.13.0
Vulnerability #1: GO-2023-1988
    Improper rendering of text nodes in golang.org/x/net/html
  More info: https://pkg.go.dev/vuln/GO-2023-1988
  Module: golang.org/x/net
    Found in: golang.org/x/net@v0.12.0
    Fixed in: golang.org/x/net@v0.13.0
    Example traces found:
      #1: modules/markup/html.go:371:24: markup.postProcess calls html.Render
2023-08-04 23:27:27 +02:00
Gusted d21b0026c7 Merge pull request '[GITEA] Show manual cron run's last time' (#1167) from Gusted/forgejo:backport-1087 into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1167
2023-07-31 20:29:47 +00:00
Gusted 5f769ef20d [GITEA] Show manual cron run's last time
- Currently in the cron tasks, the 'Previous Time' only displays the
previous time of when the cron library executes the function, but not
any of the manual executions of the task.
- Store the last run's time in memory in the Task struct and use that,
when that time is later than time that the cron library has executed this
task.
- This ensures that if an instance admin manually starts a task, there's
feedback that this task is/has been run, because the task might be run
that quick, that the status icon already has been changed to an
checkmark,
- Tasks that are executed at startup now reflect this as well, as the
time of the execution of that task on startup is now being shown as
'Previous Time'.
- Added integration tests for the API part, which is easier to test
because querying the HTML table of cron tasks is non-trivial.
- Resolves https://codeberg.org/forgejo/forgejo/issues/949
- Backport #1087
2023-07-31 18:34:14 +00:00
Gusted eaa9b35cf6 Merge pull request '[GITEA] Use join for the deleting issue actions query' (#1165) from Gusted/forgejo:backport-1154 into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1165
2023-07-31 18:33:47 +00:00
Gusted 9b71369be9 [GITEA] Use join for the deleting issue actions query
- The action tables can become very large as it's a dumpster for every
action that an user does on an repository.
- The following query: `DELETE FROM action WHERE comment_id IN (SELECT id FROM comment WHERE
issue_id=?)` is not using indexes for `comment_id` and is instead using
an full table scan by MariaDB.
- Rewriting the query to use an JOIN will allow MariaDB to use the
index.
- More information: https://codeberg.org/Codeberg-Infrastructure/techstack-support/issues/9
- Backport https://codeberg.org/forgejo/forgejo/pulls/1154
2023-07-31 10:14:30 +00:00
Gusted e7d0475e15
[GOLDMARK] html <img /> code cannot be parse in markdown file
- Update goldmark to v1.5.5, which includes
254b9f8f77
- Resolves https://codeberg.org/Codeberg/Community/issues/936
- Backport https://codeberg.org/forgejo/forgejo/pulls/1155
2023-07-30 20:12:49 +02:00
Earl Warren a1986507b7
Revert "Avoid writing config file if not installed (#26107) (#26113)"
This reverts commit 78722734fe.

It does not create `LFS_JWT_SECRET` if `INSTALL_LOCK` is true and the
value of `LFS_JWT_SECRET` found in `app.ini` is incorrect. As a result
LFS_JWT_SECRET will not be set at all and the Forgejo admin will not
be notified that the value in the `app.ini` was ignored.
2023-07-30 09:30:36 +02:00
Earl Warren fb8de41e05
[SEMVER] 5.0.1+0-gitea-1.20.2 2023-07-30 07:48:18 +02:00
Giteabot a81c6561e3
Fixed incorrect locale references (#26218) (#26222)
Backport #26218 by @kerwin612

Fixed two incorrect headers for setting the page navigation bar:
* User settings page, should not use the title "`org.settings`"
* Repo settings page, should not use the title "`org.settings`"

Co-authored-by: Kerwin Bryant <kerwin612@qq.com>
(cherry picked from commit 212274309307bbc0aa19d117016dc52ae1cc6793)
2023-07-30 07:46:19 +02:00
Giteabot 5afb0294f4
Fix access check for org-level project (#26182) (#26223)
Backport #26182 by @Zettat123

Fix #25934

Add `ignoreGlobal` parameter to `reqUnitAccess` and only check global
disabled units when `ignoreGlobal` is true. So the org-level projects
and user-level projects won't be affected by global disabled
`repo.projects` unit.

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 3a29712e0adc9d58ba0fd6336916112a4886ac7e)
2023-07-30 07:46:19 +02:00
Giteabot 7ee4804b9c
Fix commit compare style (#26209) (#26226)
Backport #26209 by @puni9869

as title

Fixes : #25825
Before
<img width="1334" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c54a41b0-39bd-4094-a956-081a8f4128f2">

After change
<img width="1340" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c112d235-6bbe-4bcb-9529-78da3ab0fa14">

Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
(cherry picked from commit 81d3dc1da5a2af02d000f13c3d9b5b2aa56ad216)
2023-07-30 07:46:19 +02:00
Giteabot 4c3dcdf815
Warn instead of reporting an error when a webhook cannot be found (#26039) (#26211)
Backport #26039 by @puni9869

Attemp fix: #25744
Fixing the log level when we delete any repo then we get error hook not
found by id. That should be warn level to reduce the noise in the logs.

Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
(cherry picked from commit c5fe09db726e2b97b646446976c0968cb0ddd1d5)
2023-07-30 07:46:19 +02:00
Giteabot dfa114bfcb
Add changelog for 1.20.2 (#26208) (#26217)
Backport #26208 by @delvh

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 09814117e3a7505fca75dd747c6d0d886bc1467e)
2023-07-30 07:46:19 +02:00
Giteabot 268569b462
Fix allowed user types setting problem (#26200) (#26206)
Backport #26200 by @lunny

Fix #25951

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 499c5594c37dab7b1af26b07294424dbfbc81737)
2023-07-30 07:46:19 +02:00
Giteabot 751028549d
Prevent primary key update on migration (#26192) (#26199)
Backport #26192 by @KN4CK3R

Fixes #25918

The migration fails on MSSQL because xorm tries to update the primary
key column. xorm prevents this if the column is marked as auto
increment:

c622cdaf89/internal/statements/update.go (L38-L40)

I think it would be better if xorm would check for primary key columns
here because updating such columns is bad practice. It looks like if
that auto increment check should do the same.

fyi @lunny

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit ecfbcced46d7a4489fcb94cca138110434423b82)
2023-07-30 07:46:18 +02:00
Giteabot 5a4b19435d
Calculate MAX_WORKERS default value by CPU number (#26177) (#26183)
(cherry picked from commit 892e24aaf1b7b623fde20babdff5826158e0e385)
2023-07-30 07:46:18 +02:00
Lunny Xiao 4640c53386
Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158)
Fix #25858
Backport #25882

The option `dissmiss stale approvals` was listed on protected branch but
never implemented. This PR fixes that.

<img width="1006" alt="图片"

src="https://github.com/go-gitea/gitea/assets/81045/60bfa968-4db7-4c24-b8be-2e5978f91bb9">

<img width="1021" alt="图片"

src="https://github.com/go-gitea/gitea/assets/81045/8dabc14d-2dfe-40c2-94ed-24fcbf6e0e8f">

(cherry picked from commit 666038a06df6356a06d309966a925bf00253e3fa)
2023-07-30 07:46:18 +02:00
Giteabot 7bb8526736
Fix handling of plenty Nuget package versions (#26075) (#26173)
Backport #26075 by @KN4CK3R

Fixes #25953

- Do not load full version information (v3)
- Add pagination support (v2)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 54614767a256923912c65bbdc35471f83c00cf66)
2023-07-30 07:46:18 +02:00
Giteabot 31f2ce3998
Update email-setup.en-us.md (#26068) (#26166)
Backport #26068 by @felixvictor

The setting `MAILER_TYPE` is deprecated.
According to the config cheat sheet, it should be `PROTOCOL`.

Co-authored-by: Felix Victor <felix.victor.na@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 72b55c8094f2bd31c385015e204224ac21c7c288)
2023-07-30 07:43:05 +02:00
Giteabot 9654d71bb2
Fix bugs in LFS meta garbage collection (#26122) (#26157)
Backport #26122 by @Zettat123

This PR

- Fix #26093. Replace `time.Time` with `timeutil.TimeStamp`
- Fix #26135. Add missing `xorm:"extends"` to `CountLFSMetaObject` for
LFS meta object query
- Add a unit test for LFS meta object garbage collection

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit a12d036a6856846f8ab52dd8acf3ed21f5a77036)
2023-07-30 07:43:05 +02:00
Giteabot f3c26de1f4
Fix UI regression of asciinema player (#26159) (#26162)
Backport #26159 by @wolfogre

It was caused by updating `asciinema-player`, the upstream changed the
CSS class prefix:
`40505e479e`

<details>
<summary>Before:</summary>

<img width="1320" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/b91a2cf5-c1da-43d6-bac2-bc278728b11e">

</details>

<details>
<summary>After:</summary>

<img width="1311" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/c9872d25-e0bb-43d4-8b1e-d87c6b03c0a2">

</details>

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit 65d6bdf0be70545fd151f326160124e5e5575353)
2023-07-30 07:43:05 +02:00
Lunny Xiao 28f4029e40
Display deprecated warning in admin panel pages as well as in the log file (#26094) (#26154)
backport #26094
Temporily resolve #25915
Related #25994

This PR includes #26007 's changes but have a UI to prompt administrator
about the deprecated settings as well as the log or console warning.
Then users will have enough time to notice the problem and don't have
surprise like before.

<img width="1293" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/c33355f0-1ea7-4fb3-ad43-cd23cd15391d">

(cherry picked from commit c598741f01f9ccf32d0c4bdd905f4dc58f7af806)
2023-07-30 07:42:53 +02:00
Earl Warren f4fcdaba8c
Revert "[GITEA] do not use deprecatedSettingFatal for cosmetic reasons"
This reverts commit 2de8602855.
2023-07-30 07:42:38 +02:00
Giteabot df5200e814
Remove "misc" scope check from public API endpoints (#26134) (#26149)
Backport #26134 by @wxiaoguang

Fix #26035

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a8445e93204ab91065c45223bf5d4f7e06578549)
2023-07-26 13:51:46 +02:00
Earl Warren bbc3426c53
Revert "[GITEA] do not enforce misc scope tokens for public API endpoints"
This reverts commit 666f43fb64.
2023-07-26 13:51:06 +02:00
Lunny Xiao 7099ef15b6
Update xorm version (#26128) (#26150)
backport #26128 to fix some serious bug.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit bc73e6a85c04d4f63b77dea9f1deac5b21d3678c)
2023-07-26 13:50:10 +02:00
Giteabot f20cfc291c
Fix LFS object list style (#26133) (#26147)
Backport #26133 by @wxiaoguang

Close #26104 . Only a quick fix, the UI is not perfect.

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/7b10d42d-8317-4d99-80f9-b6c5fe05c17e)

![image](https://github.com/go-gitea/gitea/assets/2114189/b43f1242-61a0-45e3-98b7-aa74b29f3813)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/a8d27f70-781d-4702-866f-a56df6dd6c0a)

![image](https://github.com/go-gitea/gitea/assets/2114189/379274e7-c67b-4c11-9cee-28a298b4ff5a)

</details>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 0f73be0ae3247deb1881f1ded9f8b2e55e46e233)
2023-07-26 13:49:16 +02:00
John Olheiser b217ce3e9f
Docusaurus-ify 1.20 (#26052)
See https://github.com/go-gitea/gitea/pull/26051

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: JonRB <4564448+eeyrjmr@users.noreply.github.com>
(cherry picked from commit 4033d95dbf1eb525130a0701bfc58c0844220f7c)
2023-07-26 13:49:16 +02:00
Giteabot b699e1d340
Fix CLI allowing creation of access tokens with existing name (#26071) (#26144)
Backport #26071 by @yardenshoham

We are now:
- Making sure there is no existing access token with the same name
- Making sure the given scopes are valid (we already did this before but
now we have a message)

The logic is mostly taken from
a12a5f3652/routers/api/v1/user/app.go (L101-L123)

Closes #26044

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 43213b816d4cc4de9dd46a7b667925516e305443)
2023-07-26 13:49:16 +02:00
Giteabot 016162f2a3
Increase table cell horizontal padding (#26140) (#26142)
Backport #26140 by @silverwind

Extract from https://github.com/go-gitea/gitea/pull/26043, just the
padding increase.

Before and After (hard to notice, but it's there):
<img width="427" alt="Screenshot 2023-07-25 at 19 37 12"
src="https://github.com/go-gitea/gitea/assets/115237/9543dcda-eccb-4739-b7dd-06b076108ab4">
<img width="420" alt="Screenshot 2023-07-25 at 19 37 26"
src="https://github.com/go-gitea/gitea/assets/115237/0a9c3724-81a1-4c67-a13b-4b728a51fc3a">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit a55924aaf48de3ae9c32e1910c62c2b7f6e4f0ad)
2023-07-26 13:49:16 +02:00
Giteabot f4a8f10f64
Fix incorrect router logger (#26137) (#26143)
Backport #26137 by @wxiaoguang

A low-level mistake:

* `log.Info` is global `Info` function, which calls "default" logger
* `logger.Info` is the for router's logger

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 782b137682cc96ac7c1af1d67a7bfbf6b24f208f)
2023-07-26 13:49:15 +02:00
Giteabot d9d38b6244
added ssh mirror workaround description (#26096) (#26136)
Backport #26096 by @thigg

related #1635 #18159

This will probably be obsolete at some point, but it should not break
anything and it may help some users

Co-authored-by: thigg <thigg@users.noreply.github.com>
(cherry picked from commit 5992365fc1e6cecb0c76c8eb2b5897a291355f61)
2023-07-26 13:49:15 +02:00
Giteabot 5969ec33a1
Improve commit graph alignment and truncating (#26112) (#26127)
Backport #26112 by @wxiaoguang

Fix #26101

![image](https://github.com/go-gitea/gitea/assets/2114189/7507d201-822e-4534-8b20-e659d56b1268)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 3b518a3af5541c90582deba7bee8fba13d39e1ed)
2023-07-26 13:49:15 +02:00
Giteabot e2101ae572
Fix wrong workflow status when rerun a job in an already finished workflow (#26119) (#26124)
Backport #26119 by @yp05327

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/fb687592-b117-4cd5-b076-2ca5ca847ea4)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/c9b0683e-e81d-410b-8c35-fbe54327fab4)

After workflow finished, if you rerun a single job, the workflow status
will become to `Running` which is not correct as no jobs are running in
this workflow.

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 08cdc0da3d6a649892a3687635640d02e3cd9fcf)
2023-07-26 13:49:15 +02:00
Giteabot 9fae415030
Fix escape problems in the branch selector (#25875) (#26103)
Backport #25875 by @yp05327

Fix #25865

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 3e07c54be3988d0d422108711104200bf487c16a)
2023-07-26 13:49:15 +02:00
Giteabot 78722734fe
Avoid writing config file if not installed (#26107) (#26113)
Backport #26107 by @wxiaoguang

Just like others (oauth2 secret, internal token, etc), do not generate
if no install lock

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit e2596b0a999b2d2b6ce699ac8b6a3981a89d5bd5)
2023-07-26 13:49:15 +02:00
Giteabot 4be3270e87
Fix handling of Debian files with trailing slash (#26087) (#26098)
Backport #26087 by @KN4CK3R

Fixes #26022

- Fix handling of files with trailing slash
- Fix handling of duplicate package file errors
- Added test for both

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit a424f6d4f8224ca7d5db1a27e1db46a5dc47f30b)
2023-07-26 13:49:15 +02:00
Giteabot 1cd4d4b00e
fix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089)
Backport #26086 by @CaiCandong

close #26079

Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com>
(cherry picked from commit 59713541b60d52e38244a83c0bbc7d220439d55a)
2023-07-26 13:49:15 +02:00
Giteabot 942d02f8e9
Use stderr as fallback if the log file can't be opened (#26074) (#26083)
Backport #26074 by @wxiaoguang

If the log file can't be opened, what should it do? panic/exit? ignore
logs? fallback to stderr?

It seems that "fallback to stderr" is slightly better than others ....

(cherry picked from commit 8d9193680de72dbe32dbad8abce837870d7806e9)
2023-07-26 13:49:15 +02:00
Earl Warren e14d239005
[CI] Forgejo Actions based release process: add assets sources-tarbal
Refs: https://codeberg.org/forgejo/forgejo/issues/1115

(cherry-pick 032c9b3225023c4e9f457dd42c50083a5ae41f82)
2023-07-25 17:30:23 +02:00
Earl Warren dcab256781
[API] Forgejo API /api/forgejo/v1 (squash) 5.0.0+0-gitea-1.20.1
(cherry picked from commit 4107d99f25a9eee1eab2b52cdd579c69523366da)
2023-07-24 09:09:56 +02:00
Giteabot 99a4aba898
Fix duplicated url prefix on issue context menu (#26066) (#26067)
Backport #26066 by @lunny

Fix #26060

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit ab4fd9aa1f0fb6363b3da0b42cfce0ea7123db30)
2023-07-24 07:59:10 +02:00
Giteabot 37d327ab5d
Add changelog for 1.20.1 (#26015) (#26056)
Backport #26015 by @delvh

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 221b90d2891025b08cd083bb821d91a7f5722341)
2023-07-24 07:59:10 +02:00
Giteabot 2a4dcad472
Fix version in rpm repodata/primary.xml.gz (#26009) (#26048)
Co-authored-by: Peter Verraedt <peter.verraedt@gmail.com>
(cherry picked from commit 81f5a87eb42be05c52bbaaf1fb97c3e54e946a1d)
2023-07-24 07:59:10 +02:00
Giteabot 8e4f521381
Adding remaining enum for migration repo model type. (#26021) (#26034)
Backport #26021 by @puni9869

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

Adding remaining enum for migration repo model type.

Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
(cherry picked from commit 8b002b429d1b3c6762e321b5f0acadf66e3d5233)
2023-07-24 07:59:10 +02:00
Giteabot 7cc4d211b1
RPM Registry: Show zypper commands for SUSE based distros as well (#25981) (#26020)
Backport #25981 by @asdil12

After RPM is supported with https://github.com/go-gitea/gitea/pull/23380
let's show the user
how to add the repo and install the RPM via all common package managers.

Co-authored-by: Dominik Heidler <dominik@heidler.eu>
(cherry picked from commit dfd371a363228c9477e1666e8a425423b1e37190)
2023-07-24 07:59:10 +02:00
Giteabot 884f2c125c
Fix the route for pull-request's authors (#26016) (#26018)
Backport #26016 by @wxiaoguang

Close #25906

![image](https://github.com/go-gitea/gitea/assets/2114189/e689f3e1-9a90-46c0-89f4-2d61394d34d3)

Succeeded logs:

```
[I] router: completed GET /root/test/issues/posters?&q=%20&_=1689853025011 for [::1]:59271, 200 OK in 127.7ms @ repo/issue.go:3505(repo.IssuePosters)

[I] router: completed GET /root/test/pulls/posters?&q=%20&_=1689853968204 for [::1]:59269, 200 OK in 94.3ms @ repo/issue.go:3509(repo.PullPosters)
```

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 54a516e9daf84e9a2b8b86e36fbed5592b31a758)
2023-07-24 07:59:10 +02:00
Giteabot 9a3778b230
Correctly refer to dev tags as nightly in the docker docs (#26004) (#26019)
Backport #26004 by @jolheiser

As title, `dev` tags are no longer used since we switched to `nightly`

Signed-off-by: jolheiser <john.olheiser@gmail.com>
(cherry picked from commit ac129d4b4cf40f88f4e348ca9bb1357f7e3d8a84)
2023-07-24 07:59:10 +02:00
Giteabot d4fa6a846a
Fix env config parsing for "GITEA____APP_NAME" (#26001) (#26013)
Backport #26001 by @wxiaoguang

Regression of #24832

Fix the bug and add a test for it

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 4d5e3b937214965e7824f2b5a4fc59a1674ab11c)
2023-07-24 07:59:10 +02:00
Giteabot de7f99d339
Fix commit status color on dashboard repolist (#25993) (#25998)
Backport #25993 by @silverwind

Followup to https://github.com/go-gitea/gitea/pull/25935 which has
missed to change the icon on the repolist because the logic is not
shared with templates.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 1ba0baa0300cd60bdf686648ccf74de854215acf)
2023-07-24 07:59:10 +02:00
Giteabot 321909de7e
avoid hard-coding height in language dropdown menu (#25986) (#25997)
Backport #25986 by @earl-warren

This commit removes the hard-coded height of 500px, using that as a
max-height instead. The height of items in the dropdown menu, assuming a
default font size of 16px, is 36px, so the old CSS would cause overly
large dropdown menus in instances where less than 14 languages are
offered.

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

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: rome-user <rome-user@noreply.codeberg.org>
(cherry picked from commit 28e8c691a6e021e755e33c066c26edf36bf08125)
2023-07-24 07:59:10 +02:00
Giteabot f890856cf4
Update path related documents (#25417) (#25982)
Backport #25417 by @wxiaoguang

Update WorkPath/WORK_PATH related documents, remove out-dated
information.

Remove "StaticRootPath" on the admin config display page, because few
end user really need it, it only causes misconfiguration.

![image](https://github.com/go-gitea/gitea/assets/2114189/8095afa4-da76-436b-9e89-2a92c229c01d)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit ee47face12917555245fd84efc303702f45ebba9)
2023-07-24 07:58:56 +02:00
Giteabot 3d033a3aa7
Make pending commit status yellow again (#25935) (#25968)
Backport #25935 by @silverwind

With the introduction of Actions, the pending commit icon has changed
from yellow to grey for Drone integrations which never set the "running"
status, so it stays in "pending" until completion.

I find it better to have this icon colored like on 1.19. Now both the
"pending" and "running" icons look the same, but I guess we could add an
animation to the "running" state similar to GitHub has to it later.

Before:
<img width="339" alt="Screenshot 2023-07-17 at 19 14 19"
src="https://github.com/go-gitea/gitea/assets/115237/2f4886e4-74fd-42ea-b59e-9af8f141bf1f">

After:
<img width="335" alt="Screenshot 2023-07-17 at 19 14 30"
src="https://github.com/go-gitea/gitea/assets/115237/53189642-e72d-47f6-9cbe-f14eda28f730">

Also, it matches GH's icon:

<img width="466" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/5804ff90-d223-4a3c-8093-7a9abbaacf87">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 864bdd0ac8a597eaed5c59b31979a160b776ee2b)
2023-07-24 07:58:56 +02:00
Giteabot a50dfca667
Show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (#25947) (#25972)
Backport #25947 by @wolfogre

Since OAuth2 will callback the root URL, if the user starts signing in
from a wrong host, Gitea will return 500 because it cannot find the
session.

<details>
<summary>How to reproduce</summary>

<img width="901" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/2c2e255c-e13e-4a11-9be7-b226bee54920">

<img width="1014" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/b31cfcf6-a320-483d-9ce5-ba8562f065e1">

</details>

So show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is
enabled.

<img width="1015" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/99e80b17-c790-49a3-bbf2-2bd9396a7daa">

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit 037a3f0d8c1a8142d8cd36b6b9d50bf13df9197d)
2023-07-24 07:58:56 +02:00
Giteabot 0593018dba
Fix SSPI auth panic (#25955) (#25969)
Backport #25955 by @wxiaoguang

Try to fix #25952

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 227c3b67e0b635a1adad3437d8d911da79d40681)
2023-07-24 07:58:56 +02:00
wxiaoguang 8630d63f57
Avoid creating directories when loading config (#25944) (#25957)
Backport #25944

The "creating dir/file during load config" is a longstanding and complex
problem.

This PR only does a quick patch, it still needs more refactorings in the
future.

Fix #25938

(cherry picked from commit 5c3662b9021a090162629987b0ecf0b34f7f14e7)
2023-07-24 07:58:56 +02:00
KN4CK3R 7ad63bc41e
Disallow dangerous URL schemes (#25960) (#25964)
Regression: https://github.com/go-gitea/gitea/pull/24805
Closes: #25945

- Disallow `javascript`, `vbscript` and `data` (data uri images still
work) url schemes even if all other schemes are allowed
- Fixed older `cbthunderlink` tests

---------

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit ab54310731411c09ff41b8eb75eb6a3691768d06)
2023-07-24 07:58:56 +02:00
Giteabot 16102d3787
Ignore runs-on with expressions when warning no matched runners (#25917) (#25933)
Backport #25917 by @wolfogre

Fix #25905

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit b7d054e4b5ccabbc1bf10824b6e3483a53c437f9)
2023-07-24 07:58:56 +02:00
Giteabot d5c4f3430e
Make environment-to-ini work with INSTALL_LOCK=true (#25926) (#25937)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
fix #25924

(cherry picked from commit d0325006875b97e494779575f17b7634f6837bbe)
2023-07-24 07:58:56 +02:00
Giteabot 27a40aeb6b
Avoid opening/closing PRs which are already merged (#25883) (#25903)
Backport #25883 by @yp05327

We can select PRs to open/close them by one click, but we forgot to
check whether it is merged.
You can get an opening merged PR:

![image](https://github.com/go-gitea/gitea/assets/18380374/22c2e747-4bb9-4742-a9aa-ef39d5308bc5)

You can confirm this in:
https://try.gitea.io/yp05327/testrepo/pulls/5

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 9159964ada44951ba5ee2a41e7bf2fe6f7f7993f)
2023-07-24 07:58:56 +02:00
Giteabot d1ed7ea9e3
Skip unuseful error message in dev mode when watching local filesystem (#25919) (#25927)
Backport #25919 by @wxiaoguang

Before, in dev mode, there might be some error logs like:

```
2023/07/17 13:54:51 ...s/assetfs/layered.go:221:WatchLocalChanges() [E] Unable to watch directory .: lstat /data/work/gitea/custom/templates: no such file or directory

```

Because there is no "custom/templates" directory.

After: ignore such error, no such error message anymore.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 9369b38315c11f9315d51be5b35b16970bc65f5f)
2023-07-24 07:58:56 +02:00
Giteabot 61c6814c15
Fix incorrect milestone count when provide a keyword (#25880) (#25904)
Backport #25880 by @yp05327

You can confirm this issue in:
https://try.gitea.io/yp05327/testrepo/milestones?state=open&q=a
There's no milestone, but the count is 1.

![image](https://github.com/go-gitea/gitea/assets/18380374/25e58cee-aeeb-43c1-8ec8-6e2ec6bf1284)

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 36b9a86bd803646dd97832fb24b4fcf7a0cdf410)
2023-07-24 07:58:50 +02:00
Earl Warren 2de8602855
[GITEA] do not use deprecatedSettingFatal for cosmetic reasons
It breaks existing instances that would otherwise work perfectly
fine. Failing to start an instance should only happen when there is a
compelling reason to do so, for instance if the `app.ini` could not be
modified in a way that is backward compatible. If the only motivation
is to remove the setting for cosmetic reason, it must not be fatal.

(cherry picked from commit c09ef82e9a4a1f450adce46fe7adcf733d8cc9da)
(cherry picked from commit e80aaa11d9)
2023-07-24 07:58:17 +02:00
Giteabot 6c0932f8a4
Add shutting down notice (#25920) (#25922)
Backport #25920 by @KN4CK3R

Got the same problem as #25915 when updating an instance. The
`log.Fatal` should have been marked as breaking in #23911.

This PR adds a notice that the system is shutting down because of the
deprecated setting.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 6e82d0bb7c1feb04ac004dd587ce83c2ee609917)
2023-07-24 07:56:33 +02:00
Earl Warren f405880230
Revert "[GITEA] do not use deprecatedSettingFatal for cosmetic reasons"
This reverts commit e80aaa11d9.
2023-07-24 07:55:43 +02:00
Loïc Dachary 1ceadbbfda Merge pull request '[GITEA] do not enforce misc scope tokens for public API endpoints' (#1100) from dachary/forgejo:wip-v1.20-api-public into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1100
2023-07-23 21:19:22 +00:00
Loïc Dachary 666f43fb64
[GITEA] do not enforce misc scope tokens for public API endpoints
(cherry picked from commit e353d1c4b7c11e84131c7c777d25c0d7b96564b2)
2023-07-23 22:35:11 +02:00
Loïc Dachary 4ad5e21f1f Merge pull request '[GITEA] do not use deprecatedSettingFatal for cosmetic reasons' (#1096) from earl-warren/forgejo:wip-v1.20-deprecated into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1096
2023-07-23 20:05:03 +00:00
Earl Warren e80aaa11d9
[GITEA] do not use deprecatedSettingFatal for cosmetic reasons
It breaks existing instances that would otherwise work perfectly
fine. Failing to start an instance should only happen when there is a
compelling reason to do so, for instance if the `app.ini` could not be
modified in a way that is backward compatible. If the only motivation
is to remove the setting for cosmetic reason, it must not be fatal.

(cherry picked from commit c09ef82e9a4a1f450adce46fe7adcf733d8cc9da)
2023-07-23 12:33:14 +02:00
Gusted f255e50903 Merge pull request '[GITEA]: Render status of list items for Org mode' (#1078) from Gusted/forgejo:backport-1071 into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1078
2023-07-19 21:24:23 +00:00
Gusted e1829f0728
[GITEA]: Render status of list items for Org mode
- The library that's being used for org-mode, [doesn't render the status
of list items](https://github.com/niklasfasching/go-org/issues/63).
- Add a modified version of the proposed CSS snippet to still display
the status for the list items. The alternative was parsing HTML and
transforming it, which is too complicated for this small task.
- Resolves https://codeberg.org/Codeberg/Community/issues/1099
2023-07-19 23:00:56 +02:00
Loïc Dachary 5b24dae483 Merge pull request '[CI] DEFAULT_ACTIONS_URL support for self & github (squash)' (#1072) from dachary/forgejo:wip-v1.20-default-actions into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1072
2023-07-19 13:16:12 +00:00
Loïc Dachary 2eb558be4a
[CI] DEFAULT_ACTIONS_URL support for self & github (squash)
Refs: https://codeberg.org/forgejo/forgejo/issues/1062
(cherry picked from commit 74cc25376ecd1dbab57abffe286ae1f918057cfd)
2023-07-19 14:34:38 +02:00
Earl Warren b65d458c3a
Merge remote-tracking branch 'forgejo/v1.20/forgejo-dependency' into v1.20/forgejo 2023-07-17 08:01:29 +02:00
Earl Warren 1371196064
Merge remote-tracking branch 'forgejo/v1.20/forgejo-moderation' into v1.20/forgejo 2023-07-17 08:01:23 +02:00
Earl Warren c37099723e
Merge remote-tracking branch 'forgejo/v1.20/forgejo-branding' into v1.20/forgejo 2023-07-17 08:01:16 +02:00
Earl Warren 2dc0ce6b77
Merge remote-tracking branch 'forgejo/v1.20/forgejo-i18n' into v1.20/forgejo 2023-07-17 08:01:06 +02:00
Earl Warren 50158ca8e1
[GITEA] environment-to-ini fails if run as root
(cherry picked from commit 494f11afe81442f0b1b4d59f182e28c40b1842ac)
(cherry picked from commit 883d3f3f0f2f6036033c1cfce4ee0e451d340ad6)
(cherry picked from commit ec2b69b0ecf8a179de70c7e38bb6531eca52dcfc)
2023-07-17 00:27:19 +02:00
Earl Warren 8924d15dec
[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 14480339f091ffbd5f8e9391e7472a60f52a2620)
(cherry picked from commit fb930bd719a12cf51fa8f4d685b306caeb201e8a)
(cherry picked from commit 97d1166ababd41491edee2da89f42d8f9df52e17)
(cherry picked from commit 97b2abc767c4bc32794bbf51676ccfbab9e7e2e0)
(cherry picked from commit 3854c9112fa29448802e97678fa919590f65ccf0)
2023-07-17 00:27:19 +02:00
Gusted 73776d6195
[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 d0fc8bc9d3b6bb189a2ab634a5329253af9b4629)
(cherry picked from commit 9a53b0d1a07455596622cb02716b476b6aaa95e4)
(cherry picked from commit 44a2a4fd48678058777d6db46c13a2c7298497d4)
(cherry picked from commit 182025db9cc76073bdb0221dfd1fb3b2b66f7fd4)
(cherry picked from commit 558a35963eddd672f1911393a649ab08a9283e5b)
2023-07-17 00:26:42 +02:00
Gusted cdf6318f51
[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 217475385a815298dcbd8029e0cc8cb2c5877bae)
(cherry picked from commit f2c38ce5c2f6cf4008aa1929539063715b50562c)
(cherry picked from commit 1edfb68137d8c322a7a9a7c7196fc8f01ff1a889)
(cherry picked from commit 2cbc12dc740e6fefc196b7fea6ac8a0ffbbfbeef)
(cherry picked from commit 79ff020f182327986dcfd874bc49d4fe32efc29a)
2023-07-17 00:26:42 +02:00
Gusted dc9499bdf9
[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 00f411819f62c02016d46602ab4daf49effe0550)
(cherry picked from commit e0c039b0e899e787a8df1efdd6b47388d93e08fa)
(cherry picked from commit b5a058ef0039e95be23893e6fefdcb62a7de071a)
(cherry picked from commit 5ff5460d28a482526da7e77bffb18d08de14aaaa)
(cherry picked from commit 97bc6e619d2970839b8692b7b025ff0ec1c96d12)
2023-07-17 00:26:42 +02:00
Loïc Dachary 234e6d3648
[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 1482cfabe56ea37b1e4dbf60d62a0008d38ba0a4)
2023-07-17 00:25:56 +02:00
Earl Warren 266948e08a
[BRANDING] parse FORGEJO__* in the container environment
(cherry picked from commit b0759917479ee17ccb11773176dbc8a75323c5cb)
(cherry picked from commit ac8503150a9a338ccaadf5b690adcdc600a2bf38)
2023-07-17 00:25:56 +02:00
Caesar Schinas 6730fd099d
[BRANDING] fix code highlight color in Forgejo themes
(cherry picked from commit ffc49a4e992162a480d5056e1211fc7496e4aa06)
(cherry picked from commit c703523736aee06fdfe17c98c46248367b3ed532)
(cherry picked from commit fc766896705c554a092c00ec8a223dab6512f85b)
2023-07-17 00:25:56 +02:00
Earl Warren 7565c91698
[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 6fa0d493a169597a8409adf5fe6b6d35aee2fe07)
(cherry picked from commit 4ccf8b62e487f96e9062df863d4f1ebd9718b4e5)
(cherry picked from commit 9f932d4cbca1a8ae8f0bba1842f09b86d40434d6)
2023-07-17 00:25:56 +02:00
Gusted f2ecd46d96
[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 8b7cf605f2a9eda78383fe2baf407bfe9364a783)
(cherry picked from commit c59e1a4e61c551e50a86ea28d31f91507ba7c3c1)
(cherry picked from commit e3877892e13c889e4b46a5478d60e0781ac3db6b)
(cherry picked from commit d7249a4b847d7b87811624f9c2a3366f1fe92495)
2023-07-17 00:25:56 +02:00
Gusted 1ce2f72355
[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)
(cherry picked from commit 7e8eb1b2a111fd1ddf7bd3bc1e7b4d77af13339c)
(cherry picked from commit 2e7b0209d7cfd7606abc5fab504841bce6b742cc)
(cherry picked from commit ee2cfd1cd013731fc7b4a92029c582c6204e70e3)
(cherry picked from commit c731139bf3bcd517b8848565f818ad67c511b1f8)
2023-07-17 00:25:56 +02:00
Caesar Schinas e2c4609b8a
[BRANDING] fix invisible label in branch protection settings
(cherry picked from commit 23e5d457219a68f49938395b5532231ce4ac0022)
(cherry picked from commit f02e4582e51a6a2eba93ddd599b7ea3679388e55)
(cherry picked from commit 51e0cb0fbc41f02f572b510b3a03c484482749dc)
(cherry picked from commit 02a26570729bc1791c0c2e81164d9c615225acbd)
(cherry picked from commit 5a42fa9dd403fb48d1a712aa14d23208b66fa547)
(cherry picked from commit 2f031c3bb2d23dcf93688f015c90fb83e8c85727)
2023-07-17 00:25:56 +02:00
Earl Warren 36eae26e00
[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 bc93414ba992b06a9c66567d626ae8106b9a80f0)
(cherry picked from commit 20a54b8c5ca73db15bbcafc436dbd0a6aeca7f45)
(cherry picked from commit c50ae6ce9323d400f77f20aab20e89009800c9c8)
(cherry picked from commit 29df22ac106b1ea11437541f7f908e0efb4a9b7e)
(cherry picked from commit 6667da6550f2a3ff299d4d601d0eb8e20d4d6e68)
2023-07-17 00:25:56 +02:00
Earl Warren 0ed0f83c2c
[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 3af3a4000926993b8d1b8fe0c9058644c4578f92)
(cherry picked from commit a0004e95d854756b93479f5f4f26d54302be0b42)
(cherry picked from commit 8a156cd22bd899a98bf09cb549610f1126478c8f)
(cherry picked from commit 49dfaff0575f4395f1dc7f0029dbac67b14fab50)
(cherry picked from commit 0fb94b96b80ee031f79d279ebefdaf8e8d620d18)
2023-07-17 00:25:56 +02:00
Earl Warren 7a73391f50
[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 ace05fd6a7bfd99a59464e021f6868af2d9137cc)
(cherry picked from commit 2536140d72013ce33ca3daefb4b46d615fe8c858)
(cherry picked from commit ce79f05e76a01bbe93361682c3c0337b1950c059)
(cherry picked from commit 987df8acf45416853a4c70a31ff914c3ca346b02)
(cherry picked from commit 3039e6c753abc705e34774a40117275ab1630d68)
2023-07-17 00:25:56 +02:00
Shiny Nematoda 6dab139c12
[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 57508d45ad33c997e666e82c90150e0ad5726a60)
(cherry picked from commit ae5c79922a7fde86184b08d242b843d8c6e70e1b)
(cherry picked from commit 8ef1f0ae5c26dc0bdab8ba4cc84a8a5c03d71849)
(cherry picked from commit ea274ed0624ff9153299f4f664fc174278c4e4d0)
(cherry picked from commit 94e51ee93a69cf8f740ccf36ef6226a5f8ee1adc)
2023-07-17 00:25:56 +02:00
lauralani 9989eb4515
[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 6f73637aab3caf0051df2712427491b1a129a277)
(cherry picked from commit d35390e97e5c12e8cd31565b03e625953b034e07)
(cherry picked from commit c98fa595d3f7f03ae3cc881bf94745d3b073231b)
(cherry picked from commit 5d5b221c4aaa6e7f5d23a36c96a2c1556d8f4db5)
(cherry picked from commit 5bec2a475fa5876ec88e80eb227f73cb2295d180)
2023-07-17 00:25:56 +02:00
Rychart Redwerkz 6839174c4c
[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 159ec9af478fe0462fb7bcbd82eda9488b4f1c8e)
(cherry picked from commit 8d4c08fbb2db3d95667736d20d431b661a310cd5)
(cherry picked from commit ea5189116825c8a97734cc08d42001d0c8444292)
(cherry picked from commit 09ee73fe1484628495da59a497fff2c139081020)
(cherry picked from commit 4fbea90b34ef8736f564ff2da765b78dda105776)
2023-07-17 00:25:56 +02:00
Loïc Dachary 9413fd0274
[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 b1141cb3a1a0c602020ddff2021448a056cb3232)
(cherry picked from commit 63f4f8a1cefe10ddc4a9a589e9ae2087b78ec3c6)
(cherry picked from commit 67245f5b440c20bbd7fc039747f6b386cee3fbed)
(cherry picked from commit 19f1633fa3dcf14275fd7fcb3bb549e20ef8f688)
(cherry picked from commit 51c9663b4a4150d8ea3bdf1ef1eb157ead30046c)
2023-07-17 00:25:56 +02:00
Earl Warren 22c619ccdb
[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 767a54b5262295cb16ca3553876d71b715150dc5)
(cherry picked from commit 139f9f66ab10ad1197cf09000958c5b9ac80681c)
(cherry picked from commit 68586df2590b54c5156c6fb9996775ea6ddbea0f)
(cherry picked from commit e6ff67419d34eb98daef9ed2fac9fb51d9b9cb52)
(cherry picked from commit 4e7d8823b439b3e789b14fab8ce092a32c7dfaa0)
2023-07-17 00:25:56 +02:00
Loïc Dachary 2ad4ef1daa
[BRANDING] symlink gitea to forgejo in docker containers
(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 90e9b72f5777487cbd20a2cadc22d75566716103)
(cherry picked from commit be88af66fb1724924daf694b0bdafb53fce2f233)
(cherry picked from commit fcaac33e9f5f09789c0e29a909113d421869c25a)
(cherry picked from commit ed73eec9fa70e6924213af774bac41abfacce774)
(cherry picked from commit a5b61058ed701c257f1812b4bef19052e3880677)
2023-07-17 00:25:56 +02:00
Earl Warren 4466f7dc09
[BRANDING] 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 5ee6437aec9e8ccffa831b77a4169e215d20f613)
(cherry picked from commit 52ba5e09007b36dab751837f4160dc2511e88fab)
(cherry picked from commit e237fd39ca3be20d30c849e13be37194663133a9)
(cherry picked from commit 4c9a726e6b115e8aa1960326e335722c37e779b9)
(cherry picked from commit 7fa4c3e00f6456270c312100933c1a23126e392c)
2023-07-17 00:25:56 +02:00
Loïc Dachary 133b7dcd7f
[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 c9a905f5888f3ef6332ec93f91f11917ab254d39)
(cherry picked from commit c9930563b24f8cbad8d1754b33f433aa11db2198)
(cherry picked from commit 8e8fbf4950f77d7f112095fdc6d81577093eedd3)
(cherry picked from commit d3b8e54778b88c44ddbcee6f40aa6ae579daa96c)
(cherry picked from commit ee63800789cb33e943a97b9375cc20cc3aa16314)
2023-07-17 00:25:56 +02:00
Gusted 2c3d5b2a77
[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 b3c12e6bccb4ea65f7fa1ab38abaa313013aac9d)
(cherry picked from commit 1315177082a6b32cb04719124d76105ed656d09f)
(cherry picked from commit 3f1007795ce769ce16f2c74454ad4459723378cf)
(cherry picked from commit 352bda0147a02c81f1a59412a0ab9f34993cb127)
(cherry picked from commit 3d8c153ded7547f2343d0da6051b296c9265f286)
2023-07-17 00:25:56 +02:00
Earl Warren 02ba08ca84
[BRANDING] define the forgejo webhook type
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 d30c90c0abf0cea6437719da34824ae176385fdd)
(cherry picked from commit 3c83b325c45b2baba5b941df8b5938838e68a52c)
(cherry picked from commit 470bffae63433e867edb1eb5b37744ad9d984124)
(cherry picked from commit 1d659217197d4aa74daf569d8b2752f841fc6c22)
(cherry picked from commit c101c2e0b921f4d93b217ff4e91ee6e28deec60c)
2023-07-17 00:25:56 +02:00
Earl Warren 7635da25dc
[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 3e9799148f16b5ef75d532bd050eef65a1be039d)
(cherry picked from commit 85ede01671f90f5ccecc2c9b838b9258bb600c71)
(cherry picked from commit 9c288b5b30a0577f8cf5cef75923be3db84ec3fe)
(cherry picked from commit dcee31e20b38b4f8f8a4328cf8ec234ec31417a5)
(cherry picked from commit 11b984d74a1ec42b0388b8041e75ced9e48ea9d4)
2023-07-17 00:25:55 +02:00
Gusted 71df62cd6b
[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 0a91a055aeb856908eb82865059c8209af5ccf0c)
(cherry picked from commit 56b404baa02bb9c53c80218ecc1380054834618a)
(cherry picked from commit c1d19c1836ba48013a64d5f95d02fd3b29b86e12)
(cherry picked from commit f9913b74294caa31d34515ea7ff1388a0d36e793)
(cherry picked from commit f0222804c9f08e96fea0c4ccbecb0b63e1d13ee7)
2023-07-17 00:25:55 +02:00
TomZ 1da29af84e
[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 49d260f0f9e1af0e12ed5a23604715f91205299d)
(cherry picked from commit 142c4bd5a4ceadf773e7022cdb70ebbc6a283462)
(cherry picked from commit 9ba76ec1f2880ba85a1e1c8d9783d73782a7ddd1)
(cherry picked from commit 8754db1683efd02ec155ba990b3d059ac64d0542)
(cherry picked from commit 9e9e9f1cff6213d59611bc18a58454c0d917caa1)
2023-07-17 00:25:55 +02:00
Caesar Schinas 30d27261d3
[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 16ed04f9f45dfed0d3583a4f1aa1cbc5c1d97a24)
(cherry picked from commit b6f50bf932c89182d9908d2d33bbf2ead69c0c41)
(cherry picked from commit bcf255844d6871b7b707338d8babd99df3cb465e)
(cherry picked from commit 9eb9f86542a62d5ae28ace41ef53403d97b3b3ad)
(cherry picked from commit 9f98d6757b68f4875a9d977b8049261f9cc4f0f4)
2023-07-17 00:25:55 +02:00
Caesar Schinas c114933045
[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 7709d6a67b51c19e154cd229e64e07ac2a2cb3c4)
(cherry picked from commit 76aec99cdd35ea2bb07d08b80f6c7447a35cfc5b)
(cherry picked from commit 76089f3482181b5878815019ce9ac0538bbf58f7)
(cherry picked from commit bac925c76bcd3ce5a9c23991f942667c50840c62)
(cherry picked from commit 8fcf1c608ed028a6dc02feb8b2292d9c80fd0463)
2023-07-17 00:25:55 +02:00
Loïc Dachary 908bd558c3
[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 89924d07a5a19b76581eededd7dd0345db06c341)
(cherry picked from commit f46d4c36169e9eb37a5e4d287a3b7b7def259b77)
(cherry picked from commit e764ad3a037a9f78c01d39f02a9b7c8a2e301662)
(cherry picked from commit e48b72fa3807fae61679f6995ce91c692f3828d1)
(cherry picked from commit 89bfab17dbb3c63980b139e9e2a10c4e925873e9)
2023-07-17 00:25:55 +02:00
Caesar Schinas bbfe115a62
[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 6e1a1d188df4a1bb0ea2b0b5582d38ae085bfa71)
(cherry picked from commit 20ae240edbeb38943632f9b624c473e0e642b0ee)
(cherry picked from commit 164693cf14bc95a2dbabc069cd5385d362215709)
(cherry picked from commit 7c04fa156174b0a6a391570e580554df27437df5)
(cherry picked from commit 7990fab6a9f03eb75cbf052c3c3ec8e1f9d93fee)
2023-07-17 00:25:55 +02:00
Caesar Schinas ee52d43903
[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 d6e878a73973183341b3066595e8835bf2ebf1bf)
(cherry picked from commit b3c612f2ab93193e176d19ec2ed804bc1c035724)
(cherry picked from commit ab09b75301efa6847dbd120feb8a1e5481f1e6c4)
(cherry picked from commit 4bd4279a96e332e0b820df534386d91b4152dd7d)
(cherry picked from commit 1882439f8dedae0d80ddb116d07541643cc79eaf)
2023-07-17 00:25:55 +02:00
Caesar Schinas 71b2849d80
[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 359c1976237ab37fea84c41cbc2724adbea7c5e4)
(cherry picked from commit 1b45cee537a6080867c3f258ba3600af4a3873a6)
(cherry picked from commit 8f85921df55f6c4da12ae80b9764c13f0701169b)
(cherry picked from commit a4ff35cbbad65c9b3f88963c4f137e2ba3b0092c)
(cherry picked from commit 4700ee961e0b54450f99a2d2e92c68f747f3febe)
2023-07-17 00:25:55 +02:00
Caesar Schinas 1374d66f26
[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 46971b9b32b324da675e01a31ff3847cf996e4a2)
(cherry picked from commit caadbcc6f3cd597749956b6f503ac9f13758d4cf)
(cherry picked from commit f5b4642c1c285428a3401e813cbba2c7fb0e926a)
(cherry picked from commit bb85d1f71cf05bad4372f699ecf0821ac2c8bf63)
(cherry picked from commit c737b5f4d9b416b33adef8e87cd4bcada2570739)
2023-07-17 00:25:55 +02:00
Gusted fe8d44562e
[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 3a7cdcf7e81355785353f76595165d1f53f1f50f)
(cherry picked from commit 0debafe5e084eaab3576c0d240a5e195e4fe13ba)
(cherry picked from commit 87936b62040490f7b74831f5c3e1c9e7fbc58144)
(cherry picked from commit a9e15aefbef6a1543c7c750c55eb8886728a72b4)
(cherry picked from commit 29f34fccd89d7ad4ba703d19efadd5789484dad3)
2023-07-17 00:25:55 +02:00
Caesar Schinas eca74632b5
[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 e65bb279e147331cd90c7e34526199e8a586f70c)
(cherry picked from commit 8f2312635562056cda0996cce8a73173ce6b681d)
(cherry picked from commit 174bb3b0edefdc77a9727bc81c78cc0cebc5df5b)
(cherry picked from commit c1347a4e41a3d13e786ca42efbdfe2b001a274f8)
(cherry picked from commit a5616c5a8cb66d2e48cd20ffbc72cbc531957fa7)
2023-07-17 00:25:55 +02:00
fnetx 4ad492cb0c
[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 40fc74f88779366ee3c3656137d8049b918cc35c)
(cherry picked from commit 8fb25bb8026b168283314da712c1b915e1d84614)
(cherry picked from commit 1a63b2db812d37c540e8ea0516d2be691a9ad127)
(cherry picked from commit 90f9c8f518cce74846715e219cea142a44cbe080)
(cherry picked from commit b962476df95dd5d527a05069c2b28b9901a08719)
2023-07-17 00:25:24 +02:00
fnetx 7e4fe00b59
[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 757bcefa610a2b102b32c32ee6749a9fb2479d8f)
(cherry picked from commit b4902ce28bdd8a871f6123cb3ac68fef282a6285)
(cherry picked from commit 5fd0fe1f14b57206b860cf0eb1bf05252285c627)
(cherry picked from commit bcd099acfab008f514d30bd5657a6a7390339233)
(cherry picked from commit c82d4963c299cdc3f3fd478e8946c1d7adae1ef2)
2023-07-17 00:25:24 +02:00
fnetx 7277b3095d
[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 81d325dfd31f3e4d8a499934d9a4ea4c8c781310)
(cherry picked from commit edd6cdc50eb686e92feff9fb50ac009624491d5e)
(cherry picked from commit f92199a1d7e3c58ee8bf93e98d8d0b39004f4247)
(cherry picked from commit f2beae60c341a180a9a86a985c1dcdc22f7cd9e2)
(cherry picked from commit 708ebe98f3c68c4534ae41f75b0e529cc90d3f9b)
2023-07-17 00:25:24 +02:00
fnetx d9e3b1d7fc
[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 c108b03fca4a3baeb2f372b1a74d0290c909ed82)
(cherry picked from commit 27de4593fd08f50b53f222963a160d2a77d85538)
(cherry picked from commit 45777f90d0cb016b93b7ec49d425aa5aa439b2bc)
(cherry picked from commit 70207a140050316fbdb4b8a98d43299c5f7fc30e)
(cherry picked from commit 855dfc96d79b486fa3385af1d16489b014147d5f)
2023-07-17 00:25:24 +02:00
Gusted 8a34eafa47
[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 8fdb43615cc6239c784d788842f9fb7b416cffb3)

Conflicts: https://codeberg.org/forgejo/forgejo/pulls/1016
	options/locale/locale_en-US.ini
(cherry picked from commit 8c12b08718dd07e8e500c117253cfcd0d785ad7b)
2023-07-17 00:24:24 +02:00
Gusted ffb9ffdc0e
[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 2f65c02905b529bd1bed617c7d0fc3510a9b2a95)
(cherry picked from commit 74b5133374eb3e16b995c88d63d1e01280a8cfb4)
(cherry picked from commit e31c34e89349668a8312aa6cafd3f7ed69f51aca)
2023-07-17 00:24:23 +02:00
Gusted edc1891471
[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 9e0333e42ccaed2bb68a9b6902e105c04ef1fa71)
(cherry picked from commit a86fba10ac4a40e961e7112124dc164d1f73dcb0)
(cherry picked from commit 2e1c7e6641b958183776eae7cfb15ac022ac7281)
2023-07-17 00:24:23 +02:00
Earl Warren cfe5e17f27
[DOCS] RELEASE-NOTES: 1.20.0-0-rc0
(cherry picked from commit 3fbcdd235b67c2292162949b1fd24e4fe1a55753)
(cherry picked from commit e7a621acae5ce34c91db41848a4a2bc3e1fae6f6)
(cherry picked from commit 414d9fbed4025b311f980b260afcf0aae069574c)
(cherry picked from commit d010dc511e8902e5f48d266e2f87700fa469998d)
(cherry picked from commit 69de0595d95065ad38a781346f82b2bc928e6cd5)
(cherry picked from commit 77e14aea3b8fca5a529316aa20d99fe4ac90460a)
(cherry picked from commit 89490dbb7b689d4876bc469d4e6537326201af54)
2023-07-16 23:44:22 +02:00
Gusted 82e4ff7e88
[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 8bd051e6df9e35dd98e8234828dc6101ef9b2ce1)
(cherry picked from commit 2c55a40c7911e60330bc027f7de6d8bbc4d46a46)
(cherry picked from commit 260d938e927b33eef58a8858d233d699e04fff7d)
(cherry picked from commit cf7c08031f2e24519899be1ae9abc2563542b7ab)
(cherry picked from commit 59c1547517c8b66f3cbf5ec4cfcbaca9a9d7defd)
2023-07-16 23:44:22 +02:00
Loïc Dachary 66c45002a0
[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 e1038faee899ad29686d1870e166cea2470d861a)
(cherry picked from commit 5804aae16a35870f778772e1c017158cfee89da9)
(cherry picked from commit c1d666591925f79e9b5cb5d19597f51674c61367)
(cherry picked from commit e41c2241ba4f534750b6f1af0646542448d22f9f)
(cherry picked from commit b2ac8a37c7f9953e9dd8681df63df5b2d411c035)
2023-07-16 23:44:22 +02:00
Earl Warren fb52adb57b
[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 3dd6f2862e10250e5caefbf46a6c8092ab68eabc)
(cherry picked from commit e8192737ef5773b520f85c6ea405219ad6fce1a5)
(cherry picked from commit 7b1245cc706c95e70c01601c54e0dfabb162ba31)
(cherry picked from commit 4d7cd59703dffbd2ab5bb417afe8ace3d0af7141)
(cherry picked from commit 7a7a293dbd8f5e2acd313d3d96c54a337f717f1f)
2023-07-16 23:44:22 +02:00
Percy Ma f389a6f7f5
[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 f185b3978fabda08195adbef9c503fe0ea640141)
(cherry picked from commit 4cd03c0253f244cda7176150844d40800c50d100)
(cherry picked from commit 3bbf718e0e8b50c35ac1eea83d3df54805ff7d0c)
(cherry picked from commit f33bc0d6e5ab17e201996a8e2d03ae26be1d83b0)
(cherry picked from commit 0152782a17669ce4a1e8dff117d3c226c57c9e19)
2023-07-16 23:44:22 +02:00
Loïc Dachary 60dcc0a0b5
[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 8daac1bcef2747629a0585b1b8c2cb877762a952)
(cherry picked from commit 53a3da5ca0d5e5f06c636c90ef9fc4e434099997)
(cherry picked from commit caabdc74bf726162041b8f60bb8661152aed793b)
(cherry picked from commit 47b093561bc8875559b63f7f5c6f525ea9a74b91)
(cherry picked from commit 416edf747708f6ff64a97574ea3b8a68a64c369e)
2023-07-16 23:44:22 +02:00
Loïc Dachary ac34e2ae09
[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 9724140ad624514b61abf8ffa6164e8d45d449ce)
(cherry picked from commit 972220d15a4c4f5730e96fa6351136a69b1080c8)
(cherry picked from commit 47fe7f93c8018f8924467567e53e180da837a756)
(cherry picked from commit 8d35ef6337bed43ef076c49e138b1ce4d9eeabcb)
(cherry picked from commit 0fc1a7b216eb6ee808b00fd6b5f14db4075dbaec)
2023-07-16 23:44:22 +02:00
Loïc Dachary 0c3d1d2db2
[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 16202bb4c01359a1ce693567916d9ea393c680c0)
(cherry picked from commit 3bb1afa8321d093a6b16458f084f942157bc5ce9)
(cherry picked from commit 402b1db5d108c43806bd7350681dfd623554709a)
(cherry picked from commit 5c5869c2b1ab5e63b9182cd0f5a4be4ecd3a6c48)
(cherry picked from commit 64d84c256402a29a34648bd4d00acb9d13ad81f9)
2023-07-16 23:44:22 +02:00
Loïc Dachary 856e61c6d1
[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 24caf07034bc591a580d149ab5d558d918557a45)
(cherry picked from commit 6cc68e9b0815c47ffd8f86ac3b75f26d1b82499a)
(cherry picked from commit 995d871d8e9b61481643a8274808cafeff1e020a)
(cherry picked from commit 57568b055cc41737b94e508a287e120e64a0a0ee)
(cherry picked from commit 25c528d4285d2481038a6181b093ab5edc418539)
2023-07-16 23:44:22 +02:00
Loïc Dachary f42ef1d5eb
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 89b2175747e6013a3d22c5fd8a8c24cfa5286b3c)
(cherry picked from commit ceffd479ade2ab11ed13025920e33d3c213b1c01)
(cherry picked from commit 2ed5d03a9587fa2672fab9917ef4bd1c559e1208)
(cherry picked from commit f4a5de68fc01370902eec08efe0b6608cc66a748)
(cherry picked from commit ccc42ccded3bce0eeabba5d672dcd9b7a163117a)
2023-07-16 23:44:22 +02:00
Earl Warren 8a6e6e70ae
[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)
(cherry picked from commit ffe4059b38a4113d4246476e387fe6506f15db13)
2023-07-16 23:21:45 +02:00
Earl Warren e7304c0d8e
[CLI] implement forgejo-cli actions generate-secret (squash) NoInit
(cherry picked from commit 962c944eb20268a394030495c3caab3e3d4bd8b7)
(cherry picked from commit 902ebcdf3d8413b3dd93d3cb82d950e6829a7b02)
2023-07-16 23:21:45 +02:00
Earl Warren fe410f108a
[CLI] implement forgejo-cli (squash) support initDB
(cherry picked from commit 5c31ae602a45f1d9a90b86bece5393bc9faddf25)
(cherry picked from commit 1da62f29303543f177e903a70a71858926608ef5)
2023-07-16 23:21:45 +02:00
Earl Warren e868b286c9
[CI] pin test_env:1.20
(cherry picked from commit c121269c317013385612d50801d734fa34aac26b)
2023-07-16 23:21:45 +02:00
Earl Warren d6efefbb63
[CLI] implement forgejo-cli actions register
(cherry picked from commit 2f95143000e4ccc94ef14332777b58fe778edbd6)
(cherry picked from commit cf77f1e6d96f4456a25d7375012a7181fb1bcce4)
(cherry picked from commit 0983b62ca007a6c270aff366c338a21ce6e105ce)
2023-07-16 23:21:45 +02:00
Earl Warren ef51e4b751
[CLI] implement forgejo-cli actions generate-secret
(cherry picked from commit 6f7905c8ecf17d5f74ac9a71a453d6768c212b6d)
(cherry picked from commit 2a958031a9dc0b489a8fde85278a1d02ffb3169c)
(cherry picked from commit 946d209f4688691e2e030229b1a428338733c086)
2023-07-16 23:21:45 +02:00
Earl Warren 52a65b48ea
[CLI] implement forgejo-cli actions generate-runner-token
(cherry picked from commit 08be2b226e46d9f41e08f66e936b317bcfb4a257)
(cherry picked from commit 9a0f6315da038493dda98875b3a395e21d267693)
(cherry picked from commit 2f264eeeec3ec5a0724d4faf7553d0daad47817b)
2023-07-16 23:21:45 +02:00
Earl Warren 935fb85e8b
[CLI] implement forgejo-cli
(cherry picked from commit 2555e315f7561302484b15576d34c5da0d4cdb12)
(cherry picked from commit 987df92935ecc03e36f1754b7cbe7a81df8f000f)
(cherry picked from commit 78e7eee59ae43b0e38ff5ab4cdf7fbca33cb6789)
2023-07-16 23:21:44 +02:00
Loïc Dachary f9618b8896
[TESTS] MockVariable temporarily replaces a global value
defer test.MockVariable(&variable, 1234)()

(cherry picked from commit 9c78752444c2411f20e72b96b7b4fdf5359099d5)
(cherry picked from commit 8ab559df0d57a17a0ea73bd3676f40a523a15ab6)
(cherry picked from commit 2e7fe1ec9566e4840992e4049d8349873b7334ee)
2023-07-16 23:21:44 +02:00
Earl Warren 5f08b81ccc
[GITEA] parseScope with owner/repo always sets owner to zero
(cherry picked from commit 5ad65cdd195b7c92a9cd2d4bcf30ba114486bc38)
(cherry picked from commit 1cc0aeb1ebbbd56fd5462278d0c2f93bdfb18af5)
(cherry picked from commit 88634c268930aaf16acf40ebb8139ef60c0e5afe)
2023-07-16 23:21:44 +02:00
Earl Warren 49f68518c2
[CI] Forgejo Actions based release process (squash) MySQL optimization
Refs: https://codeberg.org/forgejo/forgejo/issues/976
(cherry picked from commit b4b8c489e6e9fe36349eced5d4249467b25df2a7)

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

(cherry picked from commit 7f2b08d0ad3835b59e325818e3bcc4a49f70ba9e)
(cherry picked from commit bf025db3409249a4c4231431372a243119530829)
2023-07-16 23:21:44 +02:00
Earl Warren 574e6e205b
[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 d6784841599f2f52b7f551b9d91293dfa008a4b0)
(cherry picked from commit 1c7698055adfd08b7690ea98b31fd97a384255d9)
2023-07-16 23:21:44 +02:00
Earl Warren 4085181bd9
Revert "Restrict [actions].DEFAULT_ACTIONS_URL to only github or self (#25581) (#25604)"
This reverts commit 24cf06592e.

(cherry picked from commit bf8853299d124e702ed4aa4908cc284c1c4887e8)
(cherry picked from commit cd1b258e3e5f3fae66afaa1cb8d577dc37462b9b)
2023-07-16 23:21:44 +02:00
Earl Warren 8ec046fb08
[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 d1fe68c43adb2d4bef17d430d52abb1307e5762f)
(cherry picked from commit 9257dad0784901bc120dbba77b7482037d3c10ea)
(cherry picked from commit 2922af5f34ae60652434cf1c9006115db42bd85b)
2023-07-16 23:21:44 +02:00
Earl Warren 6827c2c57a
[CI] read STORED_VERSION_FILE if available
This is a regression and there should be a test verifying the
version is right when running from a source tarbal which relies on
that file.

(cherry picked from commit ed39857c170a8b72d6c5e78ec447f4344f816cf6)
(cherry picked from commit 772fd8e716f52b5735d7e78a19e6e81af15478a5)
(cherry picked from commit 109dcb3740d3c1044cf374413a03ae48a2c1d8c1)
2023-07-16 23:21:44 +02:00
Earl Warren ba453920aa
[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)
(cherry picked from commit e75cfdcfb418d567b0b02db11f9c701b51d6b1d0)
(cherry picked from commit adc6436330c977fbfa1da8a41f4c94dda0b9c743)
(cherry picked from commit cd6221dfea3401b9cde3e987dd75fa61e85c4ce4)
2023-07-16 23:21:44 +02:00
Earl Warren a8db988ecd
[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 4b5d14ab8dce389e88ddf457d81544c8a40b821e)
(cherry picked from commit 98dfb019a4a4f4cae4e51535a96e7512ee47b4db)
(cherry picked from commit f0d3f5327526dd2bd1dd1d4fc8abcdd30926bc2c)
2023-07-16 23:21:44 +02:00
Loïc Dachary b8d446e23e
[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 c297e049fa71172b7f8fd0f014ed46f037cd8f06)
(cherry picked from commit 4a867f524a6718676b39347adfce7116914d6297)
(cherry picked from commit 007b9420972ffe6d5783a354e031c636711f85fe)
2023-07-16 23:21:44 +02:00
Earl Warren 75cb7286ae
[CI] disable minio test, no minio server yet in CI
(cherry picked from commit 0dd74d09d363433b1b8730bd26a6d7865e1e5ca0)
(cherry picked from commit 28d2d9b212e168fcc56a280c5750716e70a75f8d)
(cherry picked from commit 3c3db1ff0f5f7d2490895a64498446f41ac6c30c)
(cherry picked from commit 79bbbe2dd2692b5fc1db40fae7cc598f1cb76a1b)
(cherry picked from commit a4050eb6b1769c60de80090d58c852b5cf05109b)
(cherry picked from commit d8fac17bbe3bbe69745d1c6abaa3678d3378df73)
(cherry picked from commit 1220a8e0158a06e6652f09c23c17c1e3e4834e7d)
(cherry picked from commit 61562598d55dcf788e7b496c696d5cd5d0b1ed99)
(cherry picked from commit c42ffe52136d59849eec26d25f7040064582d76e)
(cherry picked from commit 3f0d1622b6c059c9c189b9cad6f29ea9ff0aefe9)
2023-07-16 23:21:44 +02:00
Earl Warren c915133cae
[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 d5f9e87c26cf65f1018bda9368ba58d340e5fc4f)
(cherry picked from commit 083db1ce35bcbb692588a1e826f0659b61fc4600)
(cherry picked from commit 15c853bf7a18064f0a364e39c4c4367e8b337bb6)
2023-07-16 23:21:44 +02:00
Loïc Dachary 28499d6f7f
[CI] tests/pgsql.ini.tmpl: do not use minio
f92e0a4018 added minio to the tests/pgsql.ini.tmpl and Forgejo CI does
not run a minio server. It will if there are external storage related
changes at some point but it is not the case now so it is not worth
the burden.

(cherry picked from commit 4cfbf4718d1a7efc68c09e71d7a08553c9ccfe88)
(cherry picked from commit 9bd644d6011bc8fed025a64278ff7321721a6357)
(cherry picked from commit 604636c7c466c0ed7526c4c450d7a7c184f0262f)
(cherry picked from commit 341cdb8540b162601f15014cf08aa43248d8398c)
(cherry picked from commit 57bdc91de5543efd70af1d594d23de9848261a0e)
(cherry picked from commit c6ec6517b4c7f27ffbd181e61868aa012f180ba4)
(cherry picked from commit 2f03fc1b29c51ec2a46704957d1a89ebe58e4369)
(cherry picked from commit aaecd109664928eded31738acae2b9fa1202a06a)
(cherry picked from commit 7025ff7b0683ed0cbea4fb6b4ec639c15f9567d5)
(cherry picked from commit 15e6485ae1068e9261781e35ac4823eada1941e5)
(cherry picked from commit 5f7b23c65988c21a4487499416ed3221ee853bf9)
(cherry picked from commit a74d7ce6c562115e1606c3cc22cb20db6b5248b5)
(cherry picked from commit f552e2fc56b5ea223d051d4102a5526389e88b5e)
(cherry picked from commit 9fa4a90baacd59ff0b16b35c30887a9bd1191ec4)
(cherry picked from commit a8be33da605a3e4dc18f01068e9767e45f1be339)
(cherry picked from commit 8b75a801a38a908f9398eb2c93bc90425591d99e)
(cherry picked from commit a69850b7aa76936f490a8d960767226d10629d0f)
(cherry picked from commit 94880f07e1aa2d8a082864448eace8693a57880d)
2023-07-16 23:21:44 +02:00
Loïc Dachary 0f545ccf6c
[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 4741ea07033ca458c30b8ba9fe4b00a2e79f971a)
(cherry picked from commit 3c48dc408a7097abe309ca8c443efefca6085a6c)
(cherry picked from commit a5e5dd6567c27655cf7576109f48906e47ecf62f)
2023-07-16 23:21:44 +02:00
Loïc Dachary 1e8829ce0f
[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 8b3e3f0cdecb70ca3d40d47e4baac3bb8677eeee)
(cherry picked from commit c9d8b4bb27dc78e802ff82f4ce55f35bf8eccc68)
(cherry picked from commit 32d86e74b3b6104e806285da26a4cca16e90ed5b)
2023-07-16 23:21:44 +02:00
Loïc Dachary de0dbb8579
[CI] Woodpecker based releases process
(cherry picked from commit c2a7aaeee82293793b2740251dc5fd27dfb32ddb)
(cherry picked from commit 6b6007fbced1cecb15aeb09e709b23855c43177e)
(cherry picked from commit 63608a221e551a0e1822901be62f37a557622edd)
(cherry picked from commit 5cfe60baa7a3d250458a8b562976f605357c806b)
(cherry picked from commit 2af4c73d12a13ac5e0cd9bb02ff4195e3d88c47c)
(cherry picked from commit 1985959bfea6df1cb965dc0a963d8fb49eddc2f3)
(cherry picked from commit 880424c77ee46f7cfabccbf8eb546a66e05c0e1c)
(cherry picked from commit c78a861d1bccc92df94ef01157ee3828b960063e)
(cherry picked from commit 25c122701130c3cfce1e11e88ba0d0de8bc32dad)
(cherry picked from commit 7195e894ee0dd348b02b034a0821c52f055c0eb9)
(cherry picked from commit cf15153873f6007d233811faf171d0828461152b)
(cherry picked from commit 9bee773c95298a65ad0df2e17eb11270b61191b6)
(cherry picked from commit 581c3060da3561569c9b03c6931064b55438944c)
(cherry picked from commit bf550f9b2c6fb09fba02c5884cf1206024780149)
(cherry picked from commit b570eca0b950e94dc78a91b57391ed031dccefd4)

[CI] implementation: Woodpecker based CI (squash)

Upgrade xgo to Go v1.20 for building binaries

(cherry picked from commit 6308c776b6e8fb8a904d08b178f61a7dab1ef971)

[CI] v1.20: switch PR check from Woodpecker CI to Forgejo Actions

The PR checks for v1.19 still rely on Woodpecker CI. Keeping
.woodpecker in v1.20 while both Woodpecker CI & Forgejo Actions are
enabled would dupicate the checks.

The release process in releases remains Woodpecker CI.

(cherry picked from commit 93e42f3f53da1084db21b354994449a32e4abca4)
(cherry picked from commit 599c5162ad069fa5cb239a91486152cd47c77bf7)
(cherry picked from commit 6f8b723a55277c1e15827dcdfaa9a0ffe3ea42b4)
(cherry picked from commit e238d7d72fd5aa9741e9c5e76f37f5aff8db2892)
(cherry picked from commit 93e3ebff86a19f16619946a1aacff1642f0593c6)
(cherry picked from commit 26bc89ed7b3c241f9718ebb6a907ac4f8060ae0b)
(cherry picked from commit 8a9ff9b0a473ebd345876b8c6ce603fbf2e324af)
2023-07-16 23:21:44 +02:00
Loïc Dachary a06b0723a9
[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 62fe6e377af685b212506e9577d6c0e368b1fb25)
(cherry picked from commit af882f5b0f445082c157cbebc99a5600a74b8eca)
(cherry picked from commit 4f03abf8988e620a98f3005cbb5b63d5ca65e64e)
2023-07-16 23:21:44 +02:00
delvh e627f161c2
Add 1.20.0 changelog (#25901) (#25910)
Backport of #25901
2023-07-16 21:08:53 +02:00
Giteabot de8127e78b
fix incorrect repo url when changed the case of ownername (#25733) (#25881)
Backport #25733 by @hiifong

When only the casing of the username changes, update the owner name of the repo,
and keep the original logic consistent with other conditions.

example: assume your username is `gitea`, lowercase username is `gitea` too,
repo URL is `.../gitea/{repo}`.
You change your username to `Gitea`, `GiTea` or something like that,
as long as the lowercase username is still `gitea`, the repo URL remained `.../gitea/{repo}`.

this pr keeps the new username consistent with the repo URL.

Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/84177296-f0ff-4176-84f1-1f9ec3f5b86f)
![image](https://github.com/go-gitea/gitea/assets/89133723/8f8f4a12-ecdd-4dec-af89-85c009b0ccfe)

After: 

![image](https://github.com/go-gitea/gitea/assets/89133723/0564edb6-9467-405a-8cd4-d6f70e6f614b)
![image](https://github.com/go-gitea/gitea/assets/89133723/554ecd6e-e5a1-43bc-a46d-99e988c2ff58)

Co-authored-by: hiifong <i@hiif.ong>
2023-07-15 19:47:24 +02:00
Denys Konovalov f7e271ff85
Backport locales to v1.20 (#25899) 2023-07-15 11:26:40 -04:00
Giteabot 186f07bbf7
Make add line comment buttons focusable (#25894) (#25896)
Backport #25894 by @sebastian-sauer

Use a real button and add an aria-label.
Additionally, show the button whenever it is focused.
See https://codeberg.org/forgejo/forgejo/issues/998 for explanation.

Our handling of this button is now equal to that of GitHub.
Nothing has changed visually.

Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
2023-07-15 12:18:49 +02:00
Giteabot 45b1f4dd3b
Add support for different Maven POM encoding (#25873) (#25890)
Backport #25873 by @KN4CK3R

Fixes #25853

- Maven POM files aren't always UTF-8 encoded.
- Reject the upload of unparsable POM files

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-07-14 10:27:15 +00:00
Giteabot 026e745b9e
Fix incorrect release count (#25879) (#25887)
Backport #25879 by @yp05327

Release count is not correct:
https://try.gitea.io/yp05327/testrepo/tags

![image](https://github.com/go-gitea/gitea/assets/18380374/07f97c62-d450-4ccb-b3f2-3e0af9d9fc52)

https://try.gitea.io/yp05327/testrepo/releases

![image](https://github.com/go-gitea/gitea/assets/18380374/6f1d55a4-bb68-445d-84b9-90552a40f403)

https://try.gitea.io/yp05327/testrepo/releases/tag/testtag

![image](https://github.com/go-gitea/gitea/assets/18380374/09ab5d51-52b6-4621-a571-3100198eb260)

We already have correct release count, no need to calculate it again.

c5e187c389/modules/context/repo.go (L547)

Co-authored-by: yp05327 <576951401@qq.com>
2023-07-14 09:32:43 +00:00
Giteabot c334be8284
Fix empty project displayed in issue sidebar (#25802) (#25854)
Backport #25802 by @yp05327

You can confirm this issue in
https://try.gitea.io/yp05327/testrepo/issues/2

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/1ab476dc-2f9b-4c85-9e87-105fc73af1ee)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/786f984d-5c27-4eff-b3d9-159f68034ce4)

This issue comes from the change in #25468.
`LoadProject` will always return at least one record, so we use
`ProjectID` to check whether an issue is linked to a project in the old
code.
As other `issue.LoadXXX` functions, we need to check the return value
from `xorm.Session.Get`.

In recent unit tests, we only test `issueList.LoadAttributes()` but
don't test `issue.LoadAttributes()`. So I added a new test for
`issue.LoadAttributes()` in this PR.

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Denys Konovalov <privat@denyskon.de>
2023-07-12 19:07:03 +02:00
Giteabot 353dcc5ad4
Fix the error message when the token is incorrect (#25701) (#25836)
Backport #25701 by @CaiCandong

we refactored `userIDFromToken` for the token parsing part into a new
function `parseToken`. `parseToken` returns the string `token` from
request, and a boolean `ok` representing whether the token exists or
not. So we can distinguish between token non-existence and token
inconsistency in the `verfity` function, thus solving the problem of no
proper error message when the token is inconsistent.
close #24439  
related #22119

Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com>
Co-authored-by: Jason Song <i@wolfogre.com>
2023-07-12 10:18:27 +00:00
wxiaoguang 7811027ca1
Backport locale to 1.20 (#25840)
With manual fixes

Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-12 11:43:57 +02:00
Giteabot abe9c641ce
Show correct SSL Mode on "install page" (#25818) (#25838)
Backport #25818 by @wxiaoguang

Fix #25817


![image](https://github.com/go-gitea/gitea/assets/2114189/49f7b85d-c229-41b5-86fd-58cd812eaca6)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-12 02:01:38 -04:00
Giteabot 052e65e63f
Fix incorrect oldest sort in project list (#25806) (#25835)
Backport #25806 by @yp05327

sort type `oldest` should be `Asc`.
Added a test for this.

I see we have `SearchOrderBy` in db model, but we are using many
different ways to define the sort type.
~Maybe we can improve this later.~
↑ Improved in this PR

Co-authored-by: yp05327 <576951401@qq.com>
2023-07-12 13:22:17 +08:00
Zettat123 c1a10be07e
Fix activity type match in matchPullRequestEvent (#25746) (#25796)
Backport #25746

Fix #25736
Caused by #24048

Right now we only check the activity type for `pull_request` event when
`types` is specified or there are no `types` and filter. If a workflow
only specifies filters but no `types` like this:
```
on:
  pull_request:
    branches: [main]
```
the workflow will be triggered even if the activity type is not one of
`[opened, reopened, sync]`. We need to check the activity type in this
case.
2023-07-11 06:42:07 +00:00
Giteabot 2b79d3fd52
For API attachments, use API URL (#25639) (#25814)
Backport #25639 by @lunny

Fix #25257

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-07-10 12:56:16 +00:00
wxiaoguang b4460cf541
Make "install page" respect environment config (#25648) (#25799)
Backport #25648

Replace #25580

Fix #19453

The problem was: when users set "GITEA__XXX__YYY" , the "install page"
doesn't respect it.

So, to make the result consistent and avoid surprising end users, now
the "install page" also writes the environment variables to the config
file.

And, to make things clear, there are enough messages on the UI to tell
users what will happen.

There are some necessary/related changes to `environment-to-ini.go`:

* The "--clear" flag is removed and it was incorrectly written there.
The "clear" operation should be done if INSTALL_LOCK=true
* The "--prefix" flag is removed because it's never used, never
documented and it only causes inconsistent behavior.

The only conflict during backport is "ui divider" in
templates/install.tmpl
2023-07-10 11:51:05 +00:00
Giteabot a1bc2aa05e
Avoid amending the Rebase and Fast-forward merge if there is no message template (#25779) (#25809)
Backport #25779 by @wxiaoguang

Related #22669. Close #25177

After the fix:


![image](https://github.com/go-gitea/gitea/assets/2114189/0e900927-ea72-4f8f-bde6-5ed927cb02f4)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-10 10:23:54 +00:00
Giteabot d713cf6150
Fix WORK_DIR for docker (root) image (#25738) (#25811)
Backport #25738 by @wxiaoguang

Fix #25726 

#17846 chose an incorrect WORK_DIR path for docker root image.

Gitea's work-path was already used as the base path for various paths
(like AppDataPath), so, the work-path should be mounted to a volume in a
docker image.

Now, for docker root image, it's unavoidable to mix the
WorkPath/CustomPath/AppDataPath in the same directory ("/data/gitea"),
because some of them have already been mixed.

Some directories in the screenshot are for "CustomPath" , while others
are for "AppDataPath", due to the technical debts in old code:

```
CUSTOM_PATH="/data/gitea"
APP_DATA_PATH = /data/gitea
```

<details>


![image](https://github.com/go-gitea/gitea/assets/2114189/9f0648ac-f731-4a08-9f26-1af01a1824b1)

</details>


This PR is breaking but this is the only way at the moment to avoid
users losing their data accidently

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-10 10:54:16 +02:00
wxiaoguang 012b804a9a
Clarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764)
Backport  #25763

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-10 00:19:24 +02:00
Giteabot 372b622c2b
Revert package access change from #23879 (#25707) (#25785)
Backport #25707 by @KN4CK3R

Fixes (?) #25538
Fixes https://codeberg.org/forgejo/forgejo/issues/972

Regression #23879

#23879 introduced a change which prevents read access to packages if a
user is not a member of an organization.

That PR also contained a change which disallows package access if the
team unit is configured with "no access" for packages. I don't think
this change makes sense (at the moment). It may be relevant for private
orgs. But for public or limited orgs that's useless because an
unauthorized user would have more access rights than the team member.
This PR restores the old behaviour "If a user has read access for an
owner, they can read packages".

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-07-09 21:00:42 +00:00
Giteabot 06bcdfe77a
Remove unused code (#25734) (#25788)
Backport #25734 by @KN4CK3R

The method is only used in the test. Found it because I changed the
fixtures and had a hard time fixing this test. My revenge is deleting
it.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-07-09 19:47:58 +00:00
Giteabot a5a3c81412
Fix notification list bugs (#25781) (#25787)
Backport #25781 by @wxiaoguang

Fix #25627

1. `ctx.Data["Link"]` should use relative URL but not AppURL
2. The `data-params` is incorrect because it doesn't contain "page". JS
can simply use "window.location.search" to construct the AJAX URL
3. The `data-xxx` and `id` in notification_subscriptions.tmpl were
copied&pasted, they don't have affect.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-09 19:15:00 +00:00
Giteabot ea2c9de3c4
Test if container blob is accessible before mounting (#22759) (#25784)
Backport #22759 by @KN4CK3R

related #16865

This PR adds an accessibility check before mounting container blobs.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
2023-07-09 12:00:04 +00:00
silverwind 348a6bf70d
Always pass 6-digit hex color to monaco (#25780) (#25782)
Backport https://github.com/go-gitea/gitea/pull/25780, clean
cherry-pick.

Monaco can not deal with color formats other than 6-digit hex, so we
convert the colors for it via new
[`tinycolor2`](https://github.com/bgrins/TinyColor) dependency (5kB
minzipped).

Also, with the addition of the module, we can replace the existing
`hexToRGBColor` usage, I verified it is compatible with the current
tests before removing the function.

Fixes: https://github.com/go-gitea/gitea/issues/25770
2023-07-09 13:06:13 +02:00
Giteabot 68a3961bf1
docs: rootless docker ssh's default port is 2222 (#25771) (#25772)
Backport #25771 by @leavesster

---

according `docker/rootless/usr/local/bin/docker-setup.sh` , in rootless
docker setup, ssh port is 2222.
and mysql database case should port same as PostgreSQL port

Co-authored-by: leavesster <11785335+leavesster@users.noreply.github.com>
2023-07-09 15:45:42 +08:00
Giteabot 91dadedddf
Translate untranslated string in issues list (#25759) (#25761)
Backport #25759 by @Maks1mS

Co-authored-by: Maxim Slipenko <no-reply@maxim.slipenko.com>
2023-07-07 23:04:08 +00:00
Giteabot 32eaba1b40
Hide add file button for pull mirrors (#25748) (#25751)
Backport #25748 by @hiifong

I think hiding the add file button for mirror repositories that can keep
the ui clean.

Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/84ecf1a5-1a92-4bb1-b472-b4988a4441a9)

After:

![image](https://github.com/go-gitea/gitea/assets/89133723/95382e73-286b-4114-9997-456ed77e07ca)

Co-authored-by: hiifong <i@hiif.ong>
2023-07-07 14:12:59 +00:00
wxiaoguang 582dcaa12e
Remove broken translations (#25737)
Some translations were just copied&pasted and they duplicated a lot.

Now, they are broken .....

To avoid blocking 1.20 release, as a quick fix, remove all of them, only
keep the en-US texts.
2023-07-07 09:10:21 +02:00
Denys Konovalov 917ca5ded9
Several fixes for mobile UI (#25634) (#25689)
Backport #25634 

Resolves https://github.com/go-gitea/gitea/issues/25622

<details>
<summary>Screenshots</summary>

![Bildschirmfoto vom 2023-07-02

20-47-34](https://github.com/go-gitea/gitea/assets/47871822/a8a0bff6-9ae3-48f3-b008-00c196a3f8fd)
![Bildschirmfoto vom 2023-07-02

20-47-45](https://github.com/go-gitea/gitea/assets/47871822/172a0021-af74-4690-aa67-0e66688ce733)
![Bildschirmfoto vom 2023-07-02

20-48-37](https://github.com/go-gitea/gitea/assets/47871822/14572ebd-0106-4c8a-ba27-b6b631375ee6)
![Bildschirmfoto vom 2023-07-02

20-49-08](https://github.com/go-gitea/gitea/assets/47871822/7c0ba3aa-1712-482c-aae9-13394dbdaf8a)
![Bildschirmfoto vom 2023-07-02

20-50-28](https://github.com/go-gitea/gitea/assets/47871822/8bd68e26-099a-4abd-8817-16d52af13167)
![Bildschirmfoto vom 2023-07-02

20-51-46](https://github.com/go-gitea/gitea/assets/47871822/3beab8c6-3747-4829-be50-bafaed11000c)
![Bildschirmfoto vom 2023-07-02

20-54-12](https://github.com/go-gitea/gitea/assets/47871822/51f82ef3-a32c-4c27-9056-e8711ed469cc)

</details>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-07 00:34:00 +02:00
Giteabot e595dfeec7
Allow/fix review (approve/reject) of empty PRs (#25690) (#25732)
Backport #25690 by @sebastian-sauer

gitea allows to create empty PRs.

Currently when you need approvals for a merge, you have to manually add
/files to the url to get to the files tab to approve / reject the PR.

This PR allows to open the files tab via the normal tab / link and then
fixes the layout of the files tab.

**Screenshots:**

Before:

![image](https://github.com/go-gitea/gitea/assets/1135157/b5082e5e-8c32-4412-993e-b854905e96d3)

After:

![image](https://github.com/go-gitea/gitea/assets/1135157/1f5e056e-396f-4dfb-8d14-e17a2f6495d9)

Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-07-06 19:34:41 +00:00
Giteabot 03cacf971e
Check ctx.Written() for GetActionIssue (#25698) (#25711)
Backport #25698 by @wolfogre

Fix #25697.

Just avoid panic, maybe there's another bug to trigger this case.

Co-authored-by: Jason Song <i@wolfogre.com>
2023-07-06 21:04:26 +02:00
Giteabot 68e0c802f7
Show correct naming for 1 comment (#25704) (#25712)
Backport #25704 by @earl-warren

- Resolves https://codeberg.org/forgejo/forgejo/issues/948

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-07-06 16:04:13 +00:00
Giteabot 09668b2e2e
Correct permissions for .ssh and authorized_keys (#25721) (#25730)
Backport #25721 by @wolfogre

Set the correct permissions on the .ssh directory and authorized_keys
file, or sshd will refuse to use them and lead to clone/push/pull
failures.

It could happen when users have copied their data to a new volume and
changed the file permission by accident, and it would be very hard to
troubleshoot unless users know how to check the logs of sshd which is
started by s6.

Co-authored-by: Jason Song <i@wolfogre.com>
2023-07-06 11:02:56 -04:00
Giteabot 04eea29ecb
Fix tags header and pretty format numbers (#25624) (#25694)
Backport #25624 by @lunny

This casused by #23465

Before

release disabled
<img width="1320" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/190a1c81-daa5-41bc-91ac-c9a0bf629b5f">

release enabled
<img width="1320" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/a0372c31-727c-4ee0-a6b9-30e502498d90">

After

release disabled
<img width="1304" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/a747ea80-a3d9-4792-8f6d-e8955da78b9e">

release enabled
<img width="1290" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/7c0bc43a-9149-4148-859d-35839aeb60ca">

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-07-05 07:08:16 +00:00
Giteabot 511be9fe6e
Fix position of org follow button (#25688) (#25692)
Backport #25688 by @silverwind

This has recently regressed it seems. Put it back into same position as
https://github.com/go-gitea/gitea/pull/24345.

Before:
<img width="1246" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/bb410c29-5539-4dad-8351-8da8470f7091">

After:
<img width="1236" alt="Screenshot 2023-07-04 at 21 19 13"
src="https://github.com/go-gitea/gitea/assets/115237/072e0e83-defd-484d-8861-33d73fa0e446">

Co-authored-by: silverwind <me@silverwind.io>
2023-07-05 08:31:12 +02:00
silverwind 24e64fe372
Replace interface{} with any (#25686) (#25687)
Same perl replacement as https://github.com/go-gitea/gitea/pull/25686
but for 1.20 to ease future backporting.
2023-07-04 23:41:32 -04:00
Giteabot 4e310133f9
Prevent duplicate image loading (#25675) (#25684)
Backport #25675 by @delvh

Regression of #25672.

Co-authored-by: delvh <dev.lh@web.de>
2023-07-04 14:49:39 +00:00
silverwind 491f36d32a
Actions list enhancements (#25601) (#25678)
Backport https://github.com/go-gitea/gitea/pull/25601 to 1.20.

Various small enhancements to the actions list. Before and after:

<img width="1264" alt="Screenshot 2023-06-30 at 00 11 40"
src="https://github.com/go-gitea/gitea/assets/115237/bb4162ee-cdcf-4a73-b05e-f9521562edbb">
<img width="1264" alt="Screenshot 2023-06-30 at 00 09 51"
src="https://github.com/go-gitea/gitea/assets/115237/52a70ea9-4bb3-406e-904b-0fdaafde9582">

Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-04 13:00:34 +00:00
wxiaoguang 9111d2d037
Manual backport of locale for 1.20 (2nd) (#25668)
The backport needs manually checking because some 1.21 strings might not
be right for 1.20

This backport also includes most fixes from
https://github.com/go-gitea/gitea/pull/25291#issuecomment-1617678658
(thanks to lunny's manual fix on Crowdin side)

Close #25638
2023-07-04 11:40:26 +00:00
Giteabot 5510ed34f1
Fix the nil pointer when assigning issues to projects (#25665) (#25677)
Backport #25665 by @Zettat123

Fixes #25649
Caused by #25468

Co-authored-by: Zettat123 <zettat123@gmail.com>
2023-07-04 10:59:01 +00:00
silverwind 39fce5750d
Prevent SVG shrinking (#25652) (#25669)
Backport https://github.com/go-gitea/gitea/pull/25652

This will prevent the most common cases of SVG shrinking because lack of
space. I evaluated multiple options and this seems to be the one with
the least impact in size and processing cost, so I went with it.

Unfortunately, CSS can not dynamically convert `16` obtained from
`attr()` to `16px`, or else a generic solution for all sizes would have
been possible. But a solution is [in

sight](https://developer.mozilla.org/en-US/docs/Web/CSS/attr#type-or-unit)
with `attr(width px)` but no browser supports it currently.
2023-07-04 10:03:03 +00:00
Giteabot 1f90376041
Fix show more for image on diff page (#25672) (#25673)
Backport #25672 by @HesterG

Right now when clicking on loadmore on files change page, if the loaded
content is image, it will be always in load status:


https://github.com/go-gitea/gitea/assets/17645053/39e449b6-067a-474c-9443-9dd98d5bbfe2

This PR fixes this by adding `initImageDiff ` to `onShowMoreFiles `

After:


https://github.com/go-gitea/gitea/assets/17645053/87bbb13e-0064-4a6e-a7ad-0f0060eb8bff

Co-authored-by: HesterG <hestergong@gmail.com>
2023-07-04 04:44:45 -04:00
Giteabot 0af6542a34
Add unit test for repository collaboration (#25640) (#25658)
Backport #25640 by @earl-warren

- Add a few extra test cases and test functions for the collaboration
model to get everything covered by tests (except for error handling, as
we cannot suddenly mock errors from the database).

```
-> % go tool cover -func=coverage.out | grep "code.gitea.io/gitea/models/repo/collaboration.go"
```

Before:
```
code.gitea.io/gitea/models/repo/collaboration.go:28:                            init                                            100.0%
code.gitea.io/gitea/models/repo/collaboration.go:39:                            GetCollaborators                                61.5%
code.gitea.io/gitea/models/repo/collaboration.go:65:                            CountCollaborators                              0.0%
code.gitea.io/gitea/models/repo/collaboration.go:70:                            GetCollaboration                                0.0%
code.gitea.io/gitea/models/repo/collaboration.go:83:                            IsCollaborator                                  100.0%
code.gitea.io/gitea/models/repo/collaboration.go:87:                            getCollaborations                               42.9%
code.gitea.io/gitea/models/repo/collaboration.go:102:                           ChangeCollaborationAccessMode                   77.8%
code.gitea.io/gitea/models/repo/collaboration.go:141:                           IsOwnerMemberCollaborator                       0.0%
```

After:
```
code.gitea.io/gitea/models/repo/collaboration.go:28:                            init                                            100.0%
code.gitea.io/gitea/models/repo/collaboration.go:39:                            GetCollaborators                                61.5%
code.gitea.io/gitea/models/repo/collaboration.go:65:                            CountCollaborators                              100.0%
code.gitea.io/gitea/models/repo/collaboration.go:70:                            GetCollaboration                                100.0%
code.gitea.io/gitea/models/repo/collaboration.go:83:                            IsCollaborator                                  100.0%
code.gitea.io/gitea/models/repo/collaboration.go:87:                            getCollaborations                               100.0%
code.gitea.io/gitea/models/repo/collaboration.go:102:                           ChangeCollaborationAccessMode                   83.3%
code.gitea.io/gitea/models/repo/collaboration.go:141:                           IsOwnerMemberCollaborator                       87.5%
```

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/825

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: silverwind <me@silverwind.io>
2023-07-04 06:29:43 +00:00
Giteabot 69bdcf41f3
Log the real reason when authentication fails (but don't show the user) (#25414) (#25660)
Backport #25414 by @lunny

Fix #24498

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-07-03 19:26:36 -04:00
Giteabot e610b0389a
Fix UI misalignment on user setting page (#25629) (#25656)
Backport #25629 by @wxiaoguang

Fix #25628

Diff with ignoring space:
https://github.com/go-gitea/gitea/pull/25629/files?diff=unified&w=1

The "modal" shouldn't appear between "ui attached segment", otherwise
these segments lose margin-top.

After the fix:

<details>


![image](https://github.com/go-gitea/gitea/assets/2114189/ac15e73d-4ca8-416a-950d-ffc912c6ab61)


![image](https://github.com/go-gitea/gitea/assets/2114189/eb431336-4d21-4e44-8beb-8919595a83c8)


![image](https://github.com/go-gitea/gitea/assets/2114189/dffaed88-5ba2-419d-a241-24cb200f757c)


![image](https://github.com/go-gitea/gitea/assets/2114189/e8c5a03e-e16a-4c94-a1a5-7845d4e1a824)

</details>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-03 21:16:58 +00:00
Lunny Xiao 13ffa287b1
Fix bug of branches API with tests(#25578) (#25579)
Backport #25578 

This PR added a repository's check when creating/deleting branches via
API. Mirror repository and archive repository cannot do that.
2023-07-03 16:17:30 +02:00
wxiaoguang e5b684e567
Manuall backport of locale for 1.20 (#25635) 2023-07-03 16:14:25 +02:00
Giteabot 64ed262e18
Fix bug when change user name (#25637) (#25646)
Backport #25637 by @lunny

Fix #25621

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-07-03 14:23:35 +03:00
wxiaoguang f51c8e0008
Make "cancel" buttons have proper type in modal forms (#25618) (#25641)
Replace #25446, fix #25438

All "cancel" buttons which do not have "type" should not submit the
form, should not be triggered by "Enter".

This is a complete fix for all modal dialogs.

The major change is "modules/aria/modal.js", "devtest" related code is
for demo/test purpose.
2023-07-03 17:09:38 +08:00
Giteabot d8a59d5f12
use css on labels (#25626) (#25636)
Backport #25626 by @derelm

Changes html to use CSS label class similar to
`templates/shared/actions/runner_list.tmpl`

Before:

![grafik](https://github.com/go-gitea/gitea/assets/465155/6729d580-3ea6-4a90-972e-6e5117459da7)

After:

![grafik](https://github.com/go-gitea/gitea/assets/465155/d4fc280c-c40b-4db4-b1ba-877270f875c8)


List view (for reference - unchanged):

![grafik](https://github.com/go-gitea/gitea/assets/465155/5ad2d8d1-2fb5-414d-823b-48a368a74724)

Co-authored-by: derelm <465155+derelm@users.noreply.github.com>
2023-07-03 12:25:16 +08:00
Giteabot 1ddfe03131
Use AfterCommitId to get commit for Viewed functionality (#25529) (#25612)
Backport #25529 by @sebastian-sauer

the PullHeadCommitID is not always available when the PR is merged.

Not sure if this is the best solution but in my simple tests it looks
like this fixes the problem - happy to get any feedback.

hopefully fixes https://github.com/go-gitea/gitea/issues/24813

Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
2023-07-01 07:56:56 +08:00
Giteabot 24cf06592e
Restrict [actions].DEFAULT_ACTIONS_URL to only github or self (#25581) (#25604)
Backport #25581 by @wolfogre

Resolve #24789

## ⚠️ BREAKING ⚠️

Before this, `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`.

But now, `DEFAULT_ACTIONS_URL` supports only
`github`(`https://github.com`) or `self`(the root url of current Gitea
instance), and the default value is `github`.

If it has configured with a URL, an error log will be displayed and it
will fallback to `github`.

Actually, what we really want to do is always make it
`https://github.com`, however, this may not be acceptable for some
instances of internal use, so there's extra support for `self`, but no
more, even `https://gitea.com`.

Please note that `uses: https://xxx/yyy/zzz` always works and it does
exactly what it is supposed to do.

Although it's breaking, I belive it should be backported to `v1.20` due
to some security issues.

Follow-up on the runner side:

- https://gitea.com/gitea/act_runner/pulls/262
- https://gitea.com/gitea/act/pulls/70

Co-authored-by: Jason Song <i@wolfogre.com>
2023-06-30 07:53:00 +00:00
Giteabot 0b6f7fb607
read-only checkboxes don't appear and don't entirely act the way one might expect (#25573) (#25602)
Backport #25573 by @saegl5

This pull request fades read-only checkboxes and checkmark, and it makes
the checkboxes act more read-only/disabled by not changing the
border-color when clicked.

Examples using light mode:
 
| Before | After |
| - | - |
| ![Kapture 2023-06-28 at 00 20
45](https://github.com/go-gitea/gitea/assets/63764270/0899fd5c-18a9-4290-9ba9-d3cf71033cf8)
| ![Kapture 2023-06-28 at 00 23
12](https://github.com/go-gitea/gitea/assets/63764270/0db9be14-e16c-42ed-8fb1-999928fd1d25)
|
| ![Kapture 2023-06-28 at 00 25
22](https://github.com/go-gitea/gitea/assets/63764270/65c6c380-b928-4e6c-b403-3655d3565896)
| ![Kapture 2023-06-28 at 00 27
28](https://github.com/go-gitea/gitea/assets/63764270/d8c2a019-e07c-43a1-a7fa-93c0d4e01900)
|
| | read-only checkboxes and checkmark are faded<br>and the checkboxes
act more read-only/disabled |

Fixes/Closes/Resolves #25076

Co-authored-by: Ed Silkworth <ed.silkworth@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-29 22:53:43 +00:00
KN4CK3R c27a3af728
Redirect to package after version deletion (#25594) (#25599)
Related #25559

Current behaviour:
1. Deletion of a package version
2. Redirect to the owners package list

New behaviour:
1. Deletion of a package version
2.1. If there are more versions available, redirect to the package again
2.2. If there are no versions available, redirect to the owners package
list
2023-06-30 00:14:57 +02:00
Giteabot 12aca3ef20
Add documentation about supported workflow trigger events (#25582) (#25589)
Backport #25582 by @Zettat123

Right now Gitea doesn't support all [Events that trigger
workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows).
This PR lists the supported events to help users write workflow files.

Co-authored-by: Zettat123 <zettat123@gmail.com>
2023-06-29 14:51:46 +02:00
Giteabot 2390a46d0f
Reduce table padding globally (#25568) (#25577)
Backport #25568 by @silverwind

Fomantic's tables have too much padding. Reduce it so we have more
information density in them. Especially the admin tables need this
because they are bursting already because of column count.

## Admin repolist before and after

<img width="909" alt="Screenshot 2023-06-28 at 20 27 55"
src="https://github.com/go-gitea/gitea/assets/115237/954c925c-8db5-47ce-ae51-a2168b857014">
<img width="897" alt="Screenshot 2023-06-28 at 20 36 03"
src="https://github.com/go-gitea/gitea/assets/115237/0bddc09a-9117-48b3-a17e-3d34c58d8d3d">

## Other tables

<img width="1230" alt="Screenshot 2023-06-28 at 20 36 22"
src="https://github.com/go-gitea/gitea/assets/115237/38f555b6-a7ce-416a-9f1f-706eaf18863b">
<img width="1236" alt="Screenshot 2023-06-28 at 20 26 37"
src="https://github.com/go-gitea/gitea/assets/115237/82b2878e-358c-4dc2-a6b4-c66e43cd2dfb">
<img width="1231" alt="Screenshot 2023-06-28 at 20 59 30"
src="https://github.com/go-gitea/gitea/assets/115237/c6a92e55-a3a3-4c80-9a0d-50aebb49886c">

Files table is unaffected because it has custom padding already.

Co-authored-by: silverwind <me@silverwind.io>
2023-06-29 09:24:02 +00:00
Giteabot 51b6a78791
Fix milestones deletion (#25583) (#25584)
Backport #25583 by @HesterG

Close #25557 
Fix regression from #25315

`data-id` is still needed for deleting milestone.

Co-authored-by: HesterG <hestergong@gmail.com>
2023-06-29 08:52:05 +00:00
wxiaoguang e6f62eea70
Do not prepare oauth2 config if it is not enabled, do not write config in some sub-commands (#25567) (#25576)
Backport #25567

Ref:

* https://github.com/go-gitea/gitea/issues/25377#issuecomment-1609757289

And some sub-commands like "generate" / "docs", they do not need to use
the ini config
2023-06-29 06:30:40 +02:00
Giteabot 8981f6d0fc
Fix content holes in Actions task logs file (#25560) (#25566)
Backport #25560 by @wolfogre

Fix #25451.

Bugfixes:
- When stopping the zombie or endless tasks, set `LogInStorage` to true
after transferring the file to storage. It was missing, it could write
to a nonexistent file in DBFS because `LogInStorage` was false.
- Always update `ActionTask.Updated` when there's a new state reported
by the runner, even if there's no change. This is to avoid the task
being judged as a zombie task.

Enhancement:
- Support `Stat()` for DBFS file.
- `WriteLogs` refuses to write if it could result in content holes.

Co-authored-by: Jason Song <i@wolfogre.com>
2023-06-28 23:39:23 +00:00
Giteabot b2b5c80cb2
Use correct response code in push mirror creation response in v1_json.tmpl (#25476) (#25571)
Backport #25476 by @GeorgDangl

In the process of doing a bit of automation via the API, we've
discovered a _small_ issue in the Swagger definition. We tried to create
a push mirror for a repository, but our generated client raised an
exception due to an unexpected status code.

When looking at this function:

3c7f5ed7b5/routers/api/v1/repo/mirror.go (L236-L240)

We see it defines `201 - Created` as response:

3c7f5ed7b5/routers/api/v1/repo/mirror.go (L260-L262)

But it actually returns `200 - OK`:

3c7f5ed7b5/routers/api/v1/repo/mirror.go (L373)

So I've just updated the Swagger definitions to match the code😀

Co-authored-by: Georg Dangl <10274404+GeorgDangl@users.noreply.github.com>
2023-06-28 19:00:56 -04:00
Giteabot 77db40e084
Fix bugs related to notification endpoints (#25548) (#25562)
Backport #25548 by @Zettat123

This PR
- fixes #25545
- fixes two incorrect `reqToken()` in `/notifications` endpoints (caused
by #24767)

Co-authored-by: Zettat123 <zettat123@gmail.com>
2023-06-28 16:24:48 +00:00
Giteabot 7222bac4e3
Align language menu icon and fit the footer area (#25556) (#25563)
Backport #25556 by @wxiaoguang

Close #25551

## Before


![image](https://github.com/go-gitea/gitea/assets/2114189/f35aebeb-9c86-4632-8c1f-1c90aa757640)

## After



![image](https://github.com/go-gitea/gitea/assets/2114189/4a623687-6c6d-442a-a4f9-07dadeb9fc6d)


----


![image](https://github.com/go-gitea/gitea/assets/2114189/6a4e5ecf-b88b-4c22-98c3-21898bd41bc5)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-28 11:51:24 -04:00
wxiaoguang 0eb4ab4246
Fix sub-command log level (#25537) (#25553)
Backport #25537

More fix for #24981

* #24981

Close #22361, #25552

* #22361
* #25552

There were many patches for Gitea's sub-commands to satisfy the facts:

* Some sub-commands shouldn't output any log, otherwise the git protocol
would be broken
* Sometimes the users want to see "verbose" or "quiet" outputs

That's a longstanding problem, and very fragile. This PR is only a quick
patch for the problem.

In the future, the sub-command system should be refactored to a clear
solution.

----

Other changes:

* Use `ReplaceAllWriters` to replace
`RemoveAllWriters().AddWriters(writer)`, then it's an atomic operation.
* Remove unnecessary `syncLevelInternal` calls, because
`AddWriters/addWritersInternal` already calls it.
2023-06-28 17:35:20 +08:00
Giteabot 102dcfa3a0
Change Regenerate Secret button display (#25534) (#25541)
Backport #25534 by @KN4CK3R

Fixes #25527

Preview:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/a84ad1ba-43e6-42e5-a0e2-585fb226875d)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-06-27 20:14:58 +00:00
Giteabot 614d6df2d8
Fix admin-dl-horizontal (#25512) (#25535)
Backport #25512 by @wxiaoguang


![image](https://github.com/go-gitea/gitea/assets/2114189/fb731e07-da30-4470-8200-73b5ca8b78f1)


![image](https://github.com/go-gitea/gitea/assets/2114189/85930b6f-5df7-437f-863f-423f3b81dd26)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: HesterG <hestergong@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-06-27 17:06:36 +00:00
Giteabot 345a25d016
Fix rerun icon on action view component (#25531) (#25536)
Backport #25531 by @HesterG

Right now rerun icon on action view component will not be seen when
duration text length is long, because the wrapper `job-brief-info` has a
fixed width, and the svg is squeezed. The way to fix this in this PR is
to change width to `fit-content` and exchange position of duration text
and rerun svg.

Before (rerun svg not shown on hover):

<img width="1401" alt="Screen Shot 2023-06-27 at 12 53 41"
src="https://github.com/go-gitea/gitea/assets/17645053/bb3f62ec-8c56-4dbc-96f1-718b50426d91">

After:

<img width="1409" alt="Screen Shot 2023-06-27 at 12 50 59"
src="https://github.com/go-gitea/gitea/assets/17645053/620aa02c-2326-408d-a763-453f48f42c40">

Co-authored-by: HesterG <hestergong@gmail.com>
2023-06-27 12:28:14 -04:00
Giteabot e8a7cd4a1d
Fix input line-height cutting off g (#25334) (#25533)
Backport #25334 by @hiifong

Fix the incomplete display of input text
Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/6bd8ca29-a096-46a8-bd23-fb833f45186f)

![image](https://github.com/go-gitea/gitea/assets/89133723/27e51e62-7150-45cd-8606-09317d462d70)
After:

![image](https://github.com/go-gitea/gitea/assets/89133723/8d0db5d3-d768-42b4-9a75-0b8816f0a299)

![image](https://github.com/go-gitea/gitea/assets/89133723/4193adc9-b635-4ed6-8e11-715ec5150563)

Co-authored-by: hiifong <i@hiif.ong>
Co-authored-by: silverwind <me@silverwind.io>
2023-06-27 11:31:18 +02:00
6543 6c43b9f6f6
Changelog for v1.20.0-rc2 (#25474)
as title

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
2023-06-27 12:08:37 +08:00
HesterG 40744f8976
Allow change line of admin-dl-horizontal dt (#25508) (#25516)
As https://github.com/go-gitea/gitea/pull/25515#issuecomment-1606626886
says, still need this backport

Close #25389

After:

<img width="915" alt="Screen Shot 2023-06-26 at 11 00 12"
src="https://github.com/go-gitea/gitea/assets/17645053/45026447-cf50-4603-ade3-7b80a9023c20">


admin/dashboard:

<img width="957" alt="Screen Shot 2023-06-26 at 10 59 51"
src="https://github.com/go-gitea/gitea/assets/17645053/f4f95bbe-f747-46f1-8fbd-5778a19ebef7">

Co-authored-by: Giteabot <teabot@gitea.io>
2023-06-26 22:20:22 +02:00
Giteabot 9d69a4758e
Add Adopt repository event and handler (#25497) (#25518)
Backport #25497 by @lunny

Fix #14304

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-06-26 20:09:07 +00:00
Giteabot 53747a58a0
Clarify the reason why the user can't add a new email if there is a pending activation (#25509) (#25514)
Backport #25509 by @wxiaoguang


![image](https://github.com/go-gitea/gitea/assets/2114189/cff20df0-ad0c-4140-b8e2-5782cad8a53a)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-26 17:28:48 +08:00
Giteabot 00ba826360
Fix CLI sub-command handling (#25501) (#25517)
Backport #25501 by @wxiaoguang

A regression of #25330 : The nil "Action" should be treated as "help"

In old releases: `./gitea admin` show helps

After #25330: `./gitea admin` panics (although the code returned `nil`
if action is nil, but Golang's quirk is: nil in interface is not nil)

With this PR: `./gitea admin` shows helps as the old releases.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-26 16:41:52 +08:00
Giteabot 9bbb4d8d6d
Improve loadprojects for issue list (#25468) (#25493) 2023-06-26 02:06:58 +00:00
lonix1 5703a0d3e3
Document creating an API key from the CLI (#25504)
Related to https://github.com/go-gitea/gitea/issues/25503

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-06-25 21:33:34 -04:00
Giteabot 85bad22ff8
Fine tune "dropdown button" icon (#25442) (#25499)
Backport #25442 by @wxiaoguang

![image](https://github.com/go-gitea/gitea/assets/2114189/143e043d-85c9-43a4-85ae-ca55f507f738)

----

![image](https://github.com/go-gitea/gitea/assets/2114189/bcba03a5-732e-4139-bc35-96a7f8bfcb88)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-25 14:35:26 +08:00
Giteabot 71d2a6a41a
Use InitWorkPathAndCfgProvider for environment-to-ini to avoid unnecessary checks (#25480) (#25488)
Backport #25480 by @wxiaoguang

Fix #25481

The `InitWorkPathAndCommonConfig` calls `LoadCommonSettings` which does
many checks like "current user is root or not".

Some commands like "environment-to-ini" shouldn't do such check, because
it might be run with "root" user at the moment (eg: the docker's setup
script)

ps: in the future, the docker's setup script should be improved to avoid
Gitea's command running with "root"

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-24 14:04:50 +00:00
wxiaoguang d1f1f1142e
Revert "Make buttons in a modal form have proper type. (#25446) (#25478)" (#25484)
There is a side effect because some modal doesn't have a proper "ok"
button.

This reverts commit 050c38ca19.
2023-06-24 13:28:55 +00:00
Giteabot 2cd9d6b3f9
Fix wrong warn messages in migration steps (#25475) (#25487) 2023-06-24 17:51:26 +08:00
Denys Konovalov 050c38ca19
Make buttons in a modal form have proper type. (#25446) (#25478)
Backport #25446 by @wxiaoguang 

Fix  #25438

All non-"ok" buttons which do not have "type" should not submit the
form, should not be triggered by "Enter".

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-24 11:56:06 +08:00
Giteabot 51789ba12d
Improve wiki sidebar and TOC (#25460) (#25477)
Backport #25460 by @wxiaoguang

Close #20976
Close #20975

1. Fix the bug: the TOC in footer was incorrectly rendered as main
content's TOC
2. Fix the layout: on mobile, the TOC is put above the main content,
while the sidebar is put below the main content
3. Auto collapse the TOC on mobile

ps: many styles of "wiki.css" are moved from old css files, so leave
nits to following PRs.

### for desktop


![image](https://github.com/go-gitea/gitea/assets/2114189/6c84201c-0648-465a-99e6-c53cdaee53c0)

### for mobile


![image](https://github.com/go-gitea/gitea/assets/2114189/9cb4fdfe-b6ab-4e6f-ae82-219ddb8fa27e)

### other changed pages

<details>


![image](https://github.com/go-gitea/gitea/assets/2114189/ef077736-2c3e-4e3d-82fe-d9bf1ebcca98)


![image](https://github.com/go-gitea/gitea/assets/2114189/bb528429-ad5f-4258-a5c4-05f997c624ea)

</details>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-24 10:16:15 +08:00
Giteabot b0de3d08b8
Fix repo search broken because of profile page added (#25455) (#25467)
Backport #25455 by @lunny

Fix #25433 
Caused by #23260

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-06-23 15:48:35 +02:00
Giteabot 2e64449de7
Make "dismiss" content shown correctly (#25461) (#25465)
Backport #25461 by @wxiaoguang

Close #25127


![image](https://github.com/go-gitea/gitea/assets/2114189/7d6be811-8e4a-4982-a5e4-857d171758d4)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-23 11:04:15 +00:00
John Olheiser ec539b7a77
Gitea version in Makefile (#25456) (#25457)
Backport-ish of #25456

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-06-23 09:52:03 +02:00
techknowlogick 6fbdacb524
Support Drone building binaries too 2023-06-22 21:13:54 -04:00
Denys Konovalov 948f6ca029
Remove test string (#25447) (#25448)
Backport #25447 

Remove test string on delete project button, I overlooked it in a
previous PR
2023-06-22 17:30:51 +00:00
wxiaoguang 061b68e995
Refactor path & config system (#25330) (#25416)
Backport #25330

# The problem

There were many "path tricks":

* By default, Gitea uses its program directory as its work path
* Gitea tries to use the "work path" to guess its "custom path" and
"custom conf (app.ini)"
* Users might want to use other directories as work path
* The non-default work path should be passed to Gitea by GITEA_WORK_DIR
or "--work-path"
* But some Gitea processes are started without these values
    * The "serv" process started by OpenSSH server
    * The CLI sub-commands started by site admin
* The paths are guessed by SetCustomPathAndConf again and again
* The default values of "work path / custom path / custom conf" can be
changed when compiling

# The solution

* Use `InitWorkPathAndCommonConfig` to handle these path tricks, and use
test code to cover its behaviors.
* When Gitea's web server runs, write the WORK_PATH to "app.ini", this
value must be the most correct one, because if this value is not right,
users would find that the web UI doesn't work and then they should be
able to fix it.
* Then all other sub-commands can use the WORK_PATH in app.ini to
initialize their paths.
* By the way, when Gitea starts for git protocol, it shouldn't output
any log, otherwise the git protocol gets broken and client blocks
forever.

The "work path" priority is: WORK_PATH in app.ini > cmd arg --work-path
> env var GITEA_WORK_DIR > builtin default

The "app.ini" searching order is: cmd arg --config > cmd arg "work path
/ custom path" > env var "work path / custom path" > builtin default


## ⚠️ BREAKING

If your instance's "work path / custom path / custom conf" doesn't meet
the requirements (eg: work path must be absolute), Gitea will report a
fatal error and exit. You need to set these values according to the
error log.
2023-06-22 16:27:18 +00:00
John Olheiser 734fd93f59
Move some regexp out of functions (#25430) (#25445)
Partial backport of #25430

Not a bug, but worth backporting for efficiency.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-06-22 16:01:54 +00:00
Giteabot 203fe2841d
Fix Permission in API returned repository struct (#25388) (#25441)
Backport #25388 by @wolfogre

The old code generates `structs.Repository.Permissions` with only
`access.Permission.AccessMode`, however, it should check the units too,
or the value could be incorrect. For example,
`structs.Repository.Permissions.Push` could be false even the doer has
write access to code unit.

Should fix
https://github.com/renovatebot/renovate/issues/14059#issuecomment-1047961128
(Not reported by it, I just found it when I was looking into this bug)

---

Review tips:

The major changes are
- `modules/structs/repo.go`
https://github.com/go-gitea/gitea/pull/25388/files#diff-870406f6857117f8b03611c43fca0ab9ed6d6e76a2d0069a7c1f17e8fa9092f7
- `services/convert/repository.go`
https://github.com/go-gitea/gitea/pull/25388/files#diff-7736f6d2ae894c9edb7729a80ab89aa183b888a26a811a0c1fdebd18726a7101

And other changes are passive.

Co-authored-by: Jason Song <i@wolfogre.com>
2023-06-22 17:01:42 +02:00
Giteabot 056829749e
Diff page enhancements (#25398) (#25437)
Backport #25398 by @silverwind

Two small tweaks:

1. Vertically center arrow here when editing a PR:

<img width="405" alt="Screenshot 2023-06-20 at 19 48 49"
src="https://github.com/go-gitea/gitea/assets/115237/1d63764d-9fd9-467e-8a8e-9258c06475eb">

2. Use 2-row layout on diff viewed status and show it again on mobile:

<img width="142" alt="Screenshot 2023-06-20 at 19 51 21"
src="https://github.com/go-gitea/gitea/assets/115237/3046e782-163c-4f87-910c-a22066de8f1b">

Mobile view:

<img width="370" alt="Screenshot 2023-06-20 at 19 44 40"
src="https://github.com/go-gitea/gitea/assets/115237/9cf56347-7323-4d05-99a5-17ad215ee44d">

Co-authored-by: silverwind <me@silverwind.io>
2023-06-22 14:33:13 +02:00
Giteabot f18b8e7d8a
Change default email domain for LDAP users (#25425) (#25434)
Backport #25425 by @Zettat123

Fixes #21169

Change `localhost` to `localhost.local`

Co-authored-by: Zettat123 <zettat123@gmail.com>
2023-06-22 10:53:15 +00:00
Giteabot ea00ed320d
Various UI fixes (#25264) (#25431)
Backport #25264 by @silverwind

Numerous small UI fixes:

- Fix double border in collaborator list
- Fix system notice table background
- Mute links in repo and org lists
- Downsize projects edit buttons
- Improve milestones and project list rendering
- Condense milestone list entry to a single line of "metas"
- Mute ".." button in repo files list

<img width="899" alt="Screenshot 2023-06-14 at 21 19 23"
src="https://github.com/go-gitea/gitea/assets/115237/40d70006-5f76-49ad-b43c-4343ec3311e1">

<img width="905" alt="Screenshot 2023-06-14 at 21 18 29"
src="https://github.com/go-gitea/gitea/assets/115237/46ef39ea-ab26-452d-89b0-a55d0cfacfdb">

<img width="270" alt="Screenshot 2023-06-14 at 21 14 09"
src="https://github.com/go-gitea/gitea/assets/115237/aa16e833-a03b-4231-bc7c-159a6a6bee19">

<img width="409" alt="Screenshot 2023-06-14 at 21 12 13"
src="https://github.com/go-gitea/gitea/assets/115237/b5242d41-f87a-4837-b0cf-9cc4c1f43daf">

<img width="286" alt="Screenshot 2023-06-14 at 21 10 03"
src="https://github.com/go-gitea/gitea/assets/115237/d0c36e47-651b-4d34-ad95-3d59474a7c3e">

<img width="928" alt="Screenshot 2023-06-14 at 21 05 24"
src="https://github.com/go-gitea/gitea/assets/115237/fc3b713e-d252-40f5-b6ba-6e5a741ab500">

<img width="217" alt="Screenshot 2023-06-14 at 21 02 01"
src="https://github.com/go-gitea/gitea/assets/115237/c4c33376-18d6-4820-aff5-f508f6d351a0">
<img width="79" alt="Screenshot 2023-06-14 at 20 42 43"
src="https://github.com/go-gitea/gitea/assets/115237/034b5950-c0bf-473b-a2f7-0c27a0259f29">
<img width="607" alt="Screenshot 2023-06-14 at 21 00 42"
src="https://github.com/go-gitea/gitea/assets/115237/fba2d3fd-bd3e-4daf-8b2f-530a1c99c8bc">

Co-authored-by: silverwind <me@silverwind.io>
2023-06-22 10:19:38 +00:00
sebastian-sauer 30a783879f
Show outdated comments in files changed tab (#24936) (#25428)
Backport #24936

If enabled show a clickable label in the comment. A click on the label
opens the Conversation tab with the comment focussed - there you're able
to view the old diff (or original diff the comment was created on).

**Screenshots**


![image](https://github.com/go-gitea/gitea/assets/1135157/63ab9571-a9ee-4900-9f02-94ab0095f9e7)


![image](https://github.com/go-gitea/gitea/assets/1135157/78f7c225-8d76-46f5-acfd-9b8aab988a6c)

When resolved and outdated:


![image](https://github.com/go-gitea/gitea/assets/1135157/6ece9ebd-c792-4aa5-9c35-628694e9d093)

Option to enable/disable this (stored in user settings - default is
disabled):


![image](https://github.com/go-gitea/gitea/assets/1135157/ed99dfe4-76dc-4c12-bd96-e7e62da50ab5)


![image](https://github.com/go-gitea/gitea/assets/1135157/e837a052-e92e-4a28-906d-9db5bacf93a6)

fixes #24913

Co-authored-by: silverwind <me@silverwind.io>
2023-06-22 08:34:42 +00:00
wxiaoguang cb3173a1e9
Use "utf8mb4" for MySQL by default (#25432)
TBH, I don't see much difference from `Remove "CHARSET" config option
for MySQL, always use "utf8mb4"` #25413

Close #25413
2023-06-22 07:38:23 +02:00
Giteabot ffe089432f
Fix missing commit message body when the message has leading newlines (#25418) (#25422)
Backport #25418 by @wolfogre

Commit with `echo "\nmessage after a blank line\nsecond line of the
message" | git commit --cleanup=verbatim -F -` and push.

<img width="1139" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/f9a2c28c-e307-4c78-9e31-3d3ace7b9274">

Co-authored-by: Jason Song <i@wolfogre.com>
2023-06-21 13:55:08 +02:00
Giteabot 8302b95d6b
Avoid polluting config file when "save" (#25395) (#25406)
Backport #25395 by @wxiaoguang

That's a longstanding INI package problem: the "MustXxx" calls change
the option values, and the following "Save" will save a lot of garbage
options into the user's config file.

Ideally we should refactor the INI package to a clear solution, but it's
a huge work.

A clear workaround is what this PR does: when "Save", load a clear INI
instance and save it.

Partially fix #25377, the "install" page needs more fine tunes.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-21 04:51:26 +00:00
Giteabot 6f1c95ec5b
Use the new download domain replace the old (#25405) (#25409)
Backport #25405 by @lunny

As title.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-06-21 03:59:51 +00:00
Giteabot cda69a0363
Fix dropdown icon layout on diff page (#25397) (#25403)
Backport #25397 by @wxiaoguang

Address
https://github.com/go-gitea/gitea/pull/25163#issuecomment-1599207916

Remove the unused  "icon-button".

And fix the layout:

Without the dropdown icon:

```
	{{svg "gitea-whitespace"}}
```


![image](https://github.com/go-gitea/gitea/assets/2114189/58a524ba-f289-4982-aea2-6f9f9f9cbdcf)


With the dropdown icon:

```
	{{svg "gitea-whitespace" 16 "gt-mr-3"}}
	{{svg "octicon-triangle-down" 14 "dropdown icon"}}
```


![image](https://github.com/go-gitea/gitea/assets/2114189/eb99168b-5d49-40a7-8665-5296cbb4e486)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-21 10:55:11 +08:00
Giteabot 4908cc9adf
Fix blank dir message when uploading files from web editor (#25391) (#25400)
Backport #25391 by @lunny

Fix #7883

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-06-20 20:28:52 +00:00
Giteabot 28ed763f55
Use Actions git context instead of dynamically created buildkit one (#25381) (#25383)
Backport #25381 by @techknowlogick

The [docker/build-push-action@v2
action](https://github.com/docker/build-push-action) by default ignores
the checkout created using the actions/checkout@v2 action. When you pass
a git build context to docker build, it wouldn't include the .git
directory.

By passing `context: .` to the build step then it'll use the Actions git
context which includes the git fetch from the earlier step.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-06-20 08:52:38 +02:00
silverwind 8e89eb8f43
Update JS dependencies, remove space after emoji completion (#25266) (#25352)
Manual backport of #25266 because of lockfile conflicts.

- Update all JS dependencies
- Enable stylint
[`media-feature-name-value-no-unknown`](https://stylelint.io/user-guide/rules/media-feature-name-value-no-unknown)
- Make use of new features in webpack and text-expander-element
- Tested Swagger and Mermaid

To explain the `text-expander-element` change: Before this version, the
element added a unavoidable space after emoji completion. Now that
https://github.com/github/text-expander-element/pull/36 is in, we gain
control over this space and I opted to remove it for emoji completion
and retain it for `@` mentions.

Co-authored-by: Giteabot <teabot@gitea.io>
2023-06-20 05:38:52 +00:00
Giteabot dfefe86045
Fix LDAP sync when Username Attribute is empty (#25278) (#25379)
Backport #25278 by @Zettat123

Fix #21072


![image](https://github.com/go-gitea/gitea/assets/15528715/96b30beb-7f88-4a60-baae-2e5ad8049555)

Username Attribute is not a required item when creating an
authentication source. If Username Attribute is empty, the username
value of LDAP user cannot be read, so all users from LDAP will be marked
as inactive by mistake when synchronizing external users.

This PR improves the sync logic, if username is empty, the email address
will be used to find user.

Co-authored-by: Zettat123 <zettat123@gmail.com>
2023-06-20 13:11:22 +08:00
Giteabot 10fcb55507
Fetch all git data for embedding correct version in docker image (#25361) (#25373)
Backport #25361 by @techknowlogick

Fix #25350

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-06-20 03:07:51 +00:00
Giteabot e9105ac281
Fix label list divider (#25312) (#25372)
Backport #25312 by @wxiaoguang

We only needs 2 lines to hide the dividers.

```
  $dropdownLabelFilter.dropdown('setting', {'hideDividers': 'empty'});
  $dropdownLabelFilter.dropdown('refreshItems');
```

Other code blocks are refactored by the way.


![image](https://github.com/go-gitea/gitea/assets/2114189/74989996-fcea-4df4-b534-b06f7957939a)


![image](https://github.com/go-gitea/gitea/assets/2114189/ee3b3761-b96e-4fb5-b646-e9d3117e5f40)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-19 18:14:31 +00:00
Giteabot e6e1cfd8e4
fix issue filters on mobile view (#25368) (#25371)
Backport #25368 by @denyskon

Fix #24846 applying the solution proposed by @silverwind 

<details>
<summary>Screenshots</summary>


![Bildschirmfoto vom 2023-06-19
12-20-54](https://github.com/go-gitea/gitea/assets/47871822/3f4e4536-38c4-451b-bfc0-a7c39acd37f0)
![Bildschirmfoto vom 2023-06-19
12-21-02](https://github.com/go-gitea/gitea/assets/47871822/3403ecc2-4d7f-4acd-b0c0-1b7a10228ff7)
![Bildschirmfoto vom 2023-06-19
12-21-16](https://github.com/go-gitea/gitea/assets/47871822/ef28a2bf-b7cc-4aec-b54b-99d2cc46a1f6)
![Bildschirmfoto vom 2023-06-19
12-21-21](https://github.com/go-gitea/gitea/assets/47871822/f8cd72a5-379e-410b-b0ef-d58895719370)
![Bildschirmfoto vom 2023-06-19
12-21-28](https://github.com/go-gitea/gitea/assets/47871822/34c78301-820c-4106-a086-ae81dc97eb91)
![Bildschirmfoto vom 2023-06-19
12-21-48](https://github.com/go-gitea/gitea/assets/47871822/b677adf1-3a48-42c8-befe-fa9d2679f0a3)
</details>



Replaces #25335

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
2023-06-19 17:43:22 +00:00
Giteabot 072997692c
Fix incorrect actions ref_name (#25358) (#25367)
Backport #25358 by @nephatrine

Fix #25357 .

Just a simple fix the result of `${{ gitea.ref_name }}` to show the
shortened name rather than the full ref.

Co-authored-by: Daniel Wolf <1461334+nephatrine@users.noreply.github.com>
2023-06-19 18:37:52 +02:00
Giteabot e9fab3ea3e
Avoid polluting the config (#25345) (#25354)
Backport #25345 by @wxiaoguang

Caught by #25330

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-18 20:56:50 +00:00
wxiaoguang e0bd6ebabd
Fix incorrect config argument position for builtin SSH server (#25341)
The "--config" option is a global option, it shouldn't appear at the
end.

Otherwise it might not be respected in some cases.

Caught by #25330 and use a separate PR to fix it for 1.20
2023-06-18 16:56:21 +00:00
Giteabot cc73f6e821
Add Exoscale to installation on cloud provider docs (#25342) (#25346)
Backport #25342 by @pmig

We created a Gitea application for the [Exoscale
Marketplace](https://www.exoscale.com/marketplace/listing/glasskube-gitea/)
for easier installation on the European cloud provider.

The installation is managed via the [Glasskube Kubernetes
Operator](https://github.com/glasskube/operator).

Signed-off-by: Philip Miglinci <pmig@glasskube.eu>
Co-authored-by: Philip Miglinci <p.miglinci@gmail.com>
2023-06-18 15:48:06 +00:00
Giteabot ff18c3ba65
Write absolute AppDataPath to app.ini when installing (#25331) (#25347)
Backport #25331 by @wxiaoguang

If the APP_DATA_PATH isn't written into the config when installing, then
its value is uncertain because some Gitea command doesn't run with
correct WorkPath.

This is a quick fix for #25330  and can be backported.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-18 15:07:46 +00:00
Giteabot b673edbeaf
Fix UI on mobile view (#25315) (#25340)
Backport #25315 by @denyskon

Various fixes to pages or elements which were looking ugly on mobile.
<details>
<summary>Screenshots</summary>

![Bildschirmfoto vom 2023-06-17
20-38-41](https://github.com/go-gitea/gitea/assets/47871822/30b5d3ce-df3b-43eb-a4c2-c3790667fb9d)
![Bildschirmfoto vom 2023-06-17
20-39-27](https://github.com/go-gitea/gitea/assets/47871822/27c07b25-3602-4fb2-b34d-d5e875e054e9)

![Bildschirmfoto vom 2023-06-17
20-41-27](https://github.com/go-gitea/gitea/assets/47871822/dacdbb4e-e3dd-4b94-abf0-c68e3d64bd3b)
![Bildschirmfoto vom 2023-06-17
20-41-48](https://github.com/go-gitea/gitea/assets/47871822/72432c35-7c4a-4c7f-a767-3562f26a5c14)
![Bildschirmfoto vom 2023-06-17
20-42-37](https://github.com/go-gitea/gitea/assets/47871822/737c26ed-1910-4467-98ef-e8769bbbe6f0)
![Bildschirmfoto vom 2023-06-17
20-42-52](https://github.com/go-gitea/gitea/assets/47871822/1813b4bc-43c0-4912-8acb-5d799c090bf3)
![Bildschirmfoto vom 2023-06-17
20-43-06](https://github.com/go-gitea/gitea/assets/47871822/136466e8-34e5-419d-97ec-5202ff819fd2)
![Bildschirmfoto vom 2023-06-17
20-43-42](https://github.com/go-gitea/gitea/assets/47871822/59270bb2-d661-4a84-8504-3e50f771f767)
![Bildschirmfoto vom 2023-06-17
20-44-44](https://github.com/go-gitea/gitea/assets/47871822/494e274d-3771-4141-9419-0a4bbd8b7f64)

</details>

Co-authored by: @silverwind

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: silverwind <me@silverwind.io>
2023-06-18 13:02:41 +00:00
derelm 05431593ef
Fix action runner last online state on edit page (#25337)
Backport fix for action runner last online state not showing in
`release/v1.20` - fixes #25336
2023-06-18 12:04:35 +00:00
Giteabot aa4c9c3215
build nightly docker images (#25317) (#25333)
Backport #25317 by @techknowlogick

followup of https://github.com/go-gitea/gitea/pull/25308 this time to
build & push nightly docker images

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-06-18 11:09:30 +00:00
Giteabot 4e79c76ed0
When viewing a file, hide the add button (#25320) (#25339)
Backport #25320 by @hiifong

Fix #25281
When viewing a file, hide the add button

![image](https://github.com/go-gitea/gitea/assets/89133723/839babaf-6b67-46e1-a103-677306fb8503)

![image](https://github.com/go-gitea/gitea/assets/89133723/32a8aeca-31f4-4ce1-a0fa-7656e16b66d3)

Co-authored-by: hiifong <i@hiif.ong>
2023-06-18 10:24:54 +00:00
Giteabot 3bd311c3f4
Remove EasyMDE focus outline on text (#25328) (#25332)
Backport #25328 by @silverwind

EasyMDE in Firefox currently shows a ugly outline in the fake textarea
the CodeMirror uses. Hide it.

Before:

<img width="845" alt="Screenshot 2023-06-18 at 02 54 09"
src="https://github.com/go-gitea/gitea/assets/115237/dc406166-9ad5-4a9b-9581-002b5cdcc6df">

After:

<img width="870" alt="Screenshot 2023-06-18 at 02 54 24"
src="https://github.com/go-gitea/gitea/assets/115237/ddd78759-2cf2-4385-b863-7576fec25c34">

Co-authored-by: silverwind <me@silverwind.io>
2023-06-18 09:35:40 +02:00
techknowlogick 7e06e6a042
use Actions environment variables in Makefile (#25319) (#25318) 2023-06-17 23:27:04 -04:00
Giteabot e5629d9701
Remove more unused Fomantic variants (#25292) (#25323)
Backport #25292 by @silverwind

Save another 50KB of CSS by removing unused and useless Fomantic
variants.

Removed the last instance of a `tertiary` button and fixed a TODO:

<img width="509" alt="Screenshot 2023-06-15 at 22 34 36"
src="https://github.com/go-gitea/gitea/assets/115237/8a16ae7b-2b17-439b-a096-60a52724e3d6">

Co-authored-by: silverwind <me@silverwind.io>
2023-06-17 17:14:25 +02:00
Giteabot 4ea38bba73
Build nightly binaries with Actions (#25308) (#25314)
Backport #25308 by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
2023-06-16 19:59:20 +02:00
Giteabot 25cb1fb994
Fix displayed RPM repo url (#25310) (#25313)
Backport #25310 by @KN4CK3R

Fixes #25302

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-06-16 16:39:41 +00:00
Giteabot e5422db5c7
Show if File is Executable (#25287) (#25300)
Backport #25287 by @JakobDev

This simply shows if a File has the executable Permission


![grafik](https://github.com/go-gitea/gitea/assets/15185051/1d50c105-6d55-4ecc-808a-c9cd5559d238)

Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-authored-by: silverwind <me@silverwind.io>
2023-06-16 09:29:26 +00:00
Giteabot 3a29f6aaff
Add link to support page for commercial support (#25293) (#25297)
Backport #25293 by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-06-16 14:26:32 +08:00
Giteabot 99d71b2b65
Docs about how to generate config for act runner with docker and setup it with docker-compose (#25256) (#25296)
Backport #25256 by @thezzisu

In this pull request, the following changes are addressed:

- State user should create `config.yaml` before start container to avoid
errors.
- Provided instructions to deploy runners using docker compose.

Co-authored-by: Zisu Zhang <thezzisu@gmail.com>
2023-06-16 12:09:03 +08:00
Giteabot 783f7ccb2c
Fix some UI alignments (#25277) (#25290)
Backport #25277 by @wxiaoguang

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

Fix the problems:

1. The `repo-button-row` had various patches before, this PR makes it
consistent
2. The "Add File" has wrong CSS class "icon", remove it
3. The "Add File" padding was overridden by "!important", fix it by
`.repo-button-row .button.dropdown` with comment
4. The selector `.ui.segments ~ .ui.top.attached.header` is incorrect,
it should use `+`

The `repo-button-row` is only used on 3 pages:


![image](https://github.com/go-gitea/gitea/assets/2114189/16057ff0-7d30-41ca-ac13-70d074364566)


![image](https://github.com/go-gitea/gitea/assets/2114189/cbe2acb1-07b6-48f3-9f28-407a75f8c4ed)


![image](https://github.com/go-gitea/gitea/assets/2114189/341416b3-f6a8-466f-a140-361ee80e53a7)


![image](https://github.com/go-gitea/gitea/assets/2114189/3d4b7857-ef99-4a3f-a667-9890714a096d)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-16 00:32:59 +00:00
Giteabot 3f75fbf8fe
Remove fomantic inverted variations (#25286) (#25289)
Backport #25286 by @silverwind

Remove all Fomantic `inverted` variations, we are no using any of them.
This reduces the index CSS bundle by 98kB.

Co-authored-by: silverwind <me@silverwind.io>
2023-06-15 12:13:03 -04:00
Giteabot 4124f8ef70
Fix issue and commit status popup padding (#25254) (#25288)
Backport #25254 by @wxiaoguang

Close #25249

Use "dialog" for the role



![image](https://github.com/go-gitea/gitea/assets/2114189/2b5b7552-48bc-4ecf-947b-34917232cff9)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-06-15 16:52:23 +02:00
Giteabot b45ea0280b
Show OAuth2 errors to end users (#25261) (#25271)
Backport #25261 by @wxiaoguang

Partially fix #23936


![image](https://github.com/go-gitea/gitea/assets/2114189/8aa7f3ad-a5f0-42ce-a478-289a03bd08a3)


![image](https://github.com/go-gitea/gitea/assets/2114189/bb901e7d-485a-47a5-b68d-9ebe7013a6b2)


![image](https://github.com/go-gitea/gitea/assets/2114189/9a1ce0f3-f011-4baf-8e2f-cc6304bc9703)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-15 02:48:36 +00:00
Giteabot 031ddfcb7b
Fix index generation parallelly failure (#25235) (#25269)
Backport #25235 by @lunny

Fix #22109

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-06-15 02:14:00 +00:00
yp05327 d686aa0d31
Fix profile render when the README.md size is larger than 1024 bytes (#25270)
Backport #25131
2023-06-15 01:39:34 +00:00
Giteabot 037366f93f
Fix edit OAuth application width (#25262) (#25263)
Backport #25262 by @denyskon

The `<div class="ui container">` broke the width of this section - fix
by removing it.

Before:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/df655636-0dc3-4c8a-9778-a14c80fc807b)

After:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/e74c74be-097e-43fb-a698-92337aa128e9)

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
2023-06-14 20:39:51 -04:00
Giteabot 5191ab6445
Use flex to align SVG and text (#25163) (#25260)
Backport #25163 by @wxiaoguang

The code can be as simple as:

```html
<div class="flex-text-block">{{svg "octicon-alert"}} {{svg "octicon-x"}} text (block)</div>
<div><div class="flex-text-inline">{{svg "octicon-alert"}} {{svg "octicon-x"}} text</div> (inline)</div>
<div><button class="ui red button">{{svg "octicon-alert" 24}} {{svg "octicon-x" 24}} text</button></div>
```


![image](https://github.com/go-gitea/gitea/assets/2114189/1d3c10f1-0bc7-4c26-b236-bad537d5c465)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-14 13:21:48 -04:00
Giteabot bfd3eb9dbc
GitHub Actions enhancements for frontend (#25150) (#25259)
Backport #25150 by @silverwind

- Don't run DB tests for frontend-only changes
- Build frontend as part of frontend step
- Build everything when actions change

Co-authored-by: silverwind <me@silverwind.io>
2023-06-14 15:59:46 +00:00
Giteabot 8fa9d9dcc9
Fix panic when migrating a repo from GitHub with issues (#25246) (#25247)
Backport #25246 by @wolfogre

Fix #25245. Regression of #23946.

Co-authored-by: Jason Song <i@wolfogre.com>
2023-06-14 07:08:08 +00:00
Giteabot 21cd5c2f3d
Fix all possible setting error related storages and added some tests (#23911) (#25244)
Backport #23911 by @lunny

Follow up #22405

Fix #20703 

This PR rewrites storage configuration read sequences with some breaks
and tests. It becomes more strict than before and also fixed some
inherit problems.

- Move storage's MinioConfig struct into setting, so after the
configuration loading, the values will be stored into the struct but not
still on some section.
- All storages configurations should be stored on one section,
configuration items cannot be overrided by multiple sections. The
prioioty of configuration is `[attachment]` > `[storage.attachments]` |
`[storage.customized]` > `[storage]` > `default`
- For extra override configuration items, currently are `SERVE_DIRECT`,
`MINIO_BASE_PATH`, `MINIO_BUCKET`, which could be configured in another
section. The prioioty of the override configuration is `[attachment]` >
`[storage.attachments]` > `default`.
- Add more tests for storages configurations.
- Update the storage documentations.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-14 08:36:52 +02:00
Giteabot 22948048b2
Revert overflow: overlay (revert #21850) (#25231) (#25239)
Backport #25231 by @wxiaoguang

It causes not only one issue like #25221 (the footer width was also
affected by that change and was fixed some time ago)

The problem of "overflow: overlay" (#21850) is:

* It's not widely supported and is non-standard
https://caniuse.com/css-overflow-overlay
* It's not widely tested in Gitea (some standard layout like `ui
container + ui grid` may break it).
* The benefit seems smaller than the problems it brings.

So, I think it is good to revert it.

----

Let's leave enough time for testing and reviewing.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-06-13 19:45:45 +00:00
Giteabot fa28d0e706
Do not overwrite the log mode when installing (#25203) (#25209)
Backport #25203 by @wxiaoguang

Fix #24861

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-13 20:35:37 +02:00
Giteabot 3ea544d89c
Change access token UI to select dropdowns (#25109) (#25230)
Backport #25109 by @jtran

The current UI to create API access tokens uses checkboxes that have a
complicated relationship where some need to be checked and/or disabled
in certain states. It also requires that a user interact with it to
understand what their options really are.

This branch changes to use `<select>`s. It better fits the available
options, and it's closer to [GitHub's
UI](https://github.com/settings/personal-access-tokens/new), which is
good, in my opinion. It's more mobile friendly since the tap-areas are
larger. If we ever add more permissions, like Maintainer, there's a
natural place that doesn't take up more screen real-estate.

This branch also fixes a few minor issues:

- Hide the error about selecting at least one permission after second
submission
- Fix help description to call it "authorization" since that's what
permissions are about (not authentication)

Related: #24767.

<img width="883" alt="Screenshot 2023-06-07 at 5 07 34 PM"
src="https://github.com/go-gitea/gitea/assets/10803/6b63d807-c9be-4a4b-8e53-ecab6cbb8f76">

---

When it's open:

<img width="881" alt="Screenshot 2023-06-07 at 5 07 59 PM"
src="https://github.com/go-gitea/gitea/assets/10803/2432c6d0-39c2-4ca4-820e-c878ffdbfb69">

Co-authored-by: Jonathan Tran <jon@allspice.io>
2023-06-13 12:42:25 +00:00
Giteabot 9cef7a4600
Use inline SVG for built-in OAuth providers (#25171) (#25234)
Backport #25171 by @silverwind

The plan is that all built-in auth providers use inline SVG for more
flexibility in styling and to get the GitHub icon to follow
`currentcolor`. This only removes the `public/img/auth` directory and
adds the missing svgs to our svg build.

It should map the built-in providers to these SVGs and render them. If
the user has set a Icon URL, it should render that as an `img` tag
instead.

```
gitea-azure-ad
gitea-bitbucket
gitea-discord
gitea-dropbox
gitea-facebook
gitea-gitea
gitea-gitlab
gitea-google
gitea-mastodon
gitea-microsoftonline
gitea-nextcloud
gitea-twitter
gitea-yandex
octicon-mark-github
```

GitHub logo is now white again on dark theme:

<img width="431" alt="Screenshot 2023-06-12 at 21 45 34"
src="https://github.com/go-gitea/gitea/assets/115237/27a43504-d60a-4132-a502-336b25883e4d">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-13 12:04:40 +00:00
Giteabot c207b94e0c
Fix task list checkbox toggle to work with YAML front matter (#25184) (#25227)
Backport #25184 by @jtran

Fixes #25160.

`data-source-position` of checkboxes in a task list was incorrect
whenever there was YAML front matter. This would result in issue content
or PR descriptions getting corrupted with random `x` or space characters
when a user checked or unchecked a task.

Co-authored-by: Jonathan Tran <jon@allspice.io>
2023-06-13 08:23:21 +00:00
Giteabot 506c70884a
Fix compatible for webhook ref type (#25195) (#25223)
Backport #25195 by @lunny

Fix #25185 
Caused by #24634

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-06-13 06:51:50 +00:00
Giteabot f64f5495af
Hide limited users if viewed by anonymous ghost (#25214) (#25220)
Backport #25214 by @KN4CK3R

The ghost user leads to inclusion of limited users/orgs in
`BuildCanSeeUserCondition`.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-06-13 13:53:26 +08:00
Giteabot 3e9fc36729
Remove hacky patch for "safari emoji glitch fix" (#25208) (#25211)
Backport #25208 by @wxiaoguang

According to my test, the UI (emoji) is fine in Safari

And actually the code is just dead code, because the "resize" event is
never fired on page loading. So for most cases users just view the pages
without this hacky patch, nobody ever complains.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-12 18:16:04 +02:00
Giteabot 8e798ebbdf
Fix fullscreen for action (#25200) (#25207)
Backport #25200 by @HesterG

An error occurs when clicking on `show full screen` on action page.

<img width="1440" alt="Screen Shot 2023-06-12 at 13 06 52"
src="https://github.com/go-gitea/gitea/assets/17645053/1d4ded3c-fb77-4dd8-9201-24d0696f96eb">


class name has changed in #25134, so the selector is not working. 
Enhance the selectors to fix this.

Co-authored-by: HesterG <hestergong@gmail.com>
2023-06-12 15:41:13 +00:00
Giteabot 0ad5ae0dbf
Improve some documents: release version, logging, NFS lock (#25202) (#25204)
Backport #25202 by @wxiaoguang

Close #23654

Close #24684


@techknowlogick I still think we need to rename
https://dl.gitea.com/gitea/1.20/ to
https://dl.gitea.com/gitea/1.20-nightly/

`/gitea/1.20/` is quite confusing, it needs these words to explain why.
If we call it `1.20-nightly`, the FAQ can be simplified a lot.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-12 23:17:43 +08:00
Giteabot 0cf467e9e0
Minor arc-green color tweaks (#25175) (#25205)
Backport #25175 by @silverwind

Some minor color tweaks

<img width="1271" alt="Screenshot 2023-06-09 at 13 29 25"
src="https://github.com/go-gitea/gitea/assets/115237/b7b34995-5d34-461f-8d19-4f5755a98109">
<img width="1272" alt="Screenshot 2023-06-09 at 13 31 20"
src="https://github.com/go-gitea/gitea/assets/115237/63c866b4-797e-46ed-ba28-b1162ccd3e15">
<img width="1276" alt="Screenshot 2023-06-09 at 13 32 21"
src="https://github.com/go-gitea/gitea/assets/115237/de7ee02e-d0c7-4979-a8aa-0fd03e8db491">

Co-authored-by: silverwind <me@silverwind.io>
2023-06-12 13:56:59 +02:00
Giteabot 5ff0f7d0ca
Add WithPullRequest for actionsNotifier (#25144) (#25197)
Backport #25144 by @Zettat123

Fix #25093

If
[`WithPullRequest`](679b1f7949/services/actions/notifier_helper.go (L90-L96))
is not called, the `Ref` in
[`notifyInput`](679b1f7949/services/actions/notifier_helper.go (L55-L65))
will be empty, so the workflows in the head branch will not be found and
triggered.
2023-06-12 17:08:09 +08:00
silverwind 224ee0d4e5
Fix strange UI behavior of cancelling dismiss review modal (#25172)
Backport clean cherry-picks of
https://github.com/go-gitea/gitea/pull/25133 and
https://github.com/go-gitea/gitea/pull/25162 to 1.20.
2023-06-11 02:54:30 +00:00
silverwind ee26d1c578
Button and color enhancements (#24989) (#25176)
Backport #24989. Clean cherry-pick aside from one small conflict with
divider.

- Various corrections to button styles, especially secondary
- Remove focus highlight, it's annoying when it stays on button after
press
- Clearly define ghost and link buttons with demos in devtest
- Remove black, grey and tertiary buttons, they should not be used
- Make `arc-green` slightly darker

<img width="1226" alt="image"

src="https://github.com/go-gitea/gitea/assets/115237/8d89786a-01ab-40f8-ae5a-e17f40e35084">
<img width="1249" alt="image"

src="https://github.com/go-gitea/gitea/assets/115237/83651e6d-3c27-46ff-b8bd-ff344d70e949">
2023-06-11 02:13:08 +00:00
Giteabot 18093d4c9a
Fix mobile navbar and misc cleanups (#25134) (#25169)
Backport #25134 by @silverwind

- Fix and improve mobile navbar layout
- Apply all cleanups suggested in
https://github.com/go-gitea/gitea/pull/25111
- Make media query breakpoints match Fomantic's exactly
- Clean up whitespace in class on navbar items

Mobile navbar before and after:
<img width="745" alt="Screenshot 2023-06-08 at 08 40 56"
src="https://github.com/go-gitea/gitea/assets/115237/ca84b239-b10f-41db-8c06-dcf2b6dd9d28">
<img width="739" alt="Screenshot 2023-06-08 at 08 41 23"
src="https://github.com/go-gitea/gitea/assets/115237/09133c54-eb7e-4110-858c-ead23c3b7521">
2023-06-11 09:50:39 +08:00
Giteabot de1d14590d
Fix bug for code search if code is disabled (#25173) (#25181)
Backport #25173 by @lunny

Fix https://github.com/go-gitea/gitea/pull/24189/files#r1224144768

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-06-09 19:32:55 +00:00
Giteabot 0058453fd9
Modify OAuth login ui and fix display name, iconurl related logic (#25030) (#25161)
Backport #25030 by @HesterG

Close #24808 

Co-Authour @wxiaoguang @silverwind 

1. Most svgs are found from https://worldvectorlogo.com/ , and some are
from conversion of png to svg. (facebook and nextcloud). And also
changed `templates/user/settings/security/accountlinks.tmpl`.

2. Fixed display name and iconurl related logic

# After

<img width="1436" alt="Screen Shot 2023-06-05 at 14 09 05"
src="https://github.com/go-gitea/gitea/assets/17645053/a5db39d8-1ab0-4676-82a4-fba60a1d1f84">

On mobile

<img width="378" alt="Screen Shot 2023-06-05 at 14 09 46"
src="https://github.com/go-gitea/gitea/assets/17645053/71d0f51b-baac-4f48-8ca2-ae0e013bd62e">


user/settings/security/accountlinks (The dropdown might be improved
later)

<img width="973" alt="Screen Shot 2023-06-01 at 10 01 44"
src="https://github.com/go-gitea/gitea/assets/17645053/27010e7e-2785-4fc5-8c49-b06621898f37">

Co-authored-by: HesterG <hestergong@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-09 10:59:18 +00:00
Giteabot 7679f4d51a
Fix open redirect check for more cases (#25143) (#25154)
Backport #25143 by @lafriks

If redirect_to parameter has set value starting with `\\example.com`
redirect will be created with header `Location: /\\example.com` that
will redirect to example.com domain.

Co-authored-by: Lauris BH <lauris@nix.lv>
2023-06-08 18:03:42 +02:00
Giteabot 82a8c26bbf
Update js dependencies (#25137) (#25151)
Backport #25137 by @silverwind

- Update all JS dependencies
- Tweak eslint for more generic globs
- Tested mermaid, pdf, monaco

Co-authored-by: silverwind <me@silverwind.io>
2023-06-08 12:05:13 +00:00
Giteabot cb113991a3
Remove incorrect element ID on "post-install" page (#25104) (#25129)
Backport #25104 by @wxiaoguang

That ID is a "copy&paste" error, it conflicts with the
`initRepoMigrationStatusChecker` logic, which is the right function for
a real `#repo_migrating` element. That wrong ID causes incorrect page
navigation after installation.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-08 11:22:32 +00:00
Giteabot 0bf07a7f61
Improve notification icon and navbar (#25111) (#25124)
Backport #25111 by @silverwind

Improvements to the notification icon and `<nav>`:

- Add a opaque color for header hover and use it, allowing the border to
be the right color on hover (sadly, not otherwise possible with CSS, not
even `color-mix`).
- Increase font size by 1px
- Use flexbox for slightly better text centering
- Reduce padding of user and add repo button, add margin on right side
of user menu
- Remove the `following bar` wrapper on navbar

<img width="176" alt="Screenshot 2023-06-07 at 00 07 08"
src="https://github.com/go-gitea/gitea/assets/115237/23cdc3d6-7f63-49df-bec3-f2e75e32a304">
<img width="63" alt="Screenshot 2023-06-07 at 00 07 14"
src="https://github.com/go-gitea/gitea/assets/115237/fae602c2-4467-4d50-b1ec-56317843f9a2">
<img width="84" alt="Screenshot 2023-06-07 at 00 07 36"
src="https://github.com/go-gitea/gitea/assets/115237/c48141b8-0b3c-48cc-846a-3a272524dbdb">
<img width="329" alt="Screenshot 2023-06-07 at 00 25 10"
src="https://github.com/go-gitea/gitea/assets/115237/cda612f1-426e-466b-a351-fc992bfd18fd">
<img width="186" alt="Screenshot 2023-06-07 at 00 35 45"
src="https://github.com/go-gitea/gitea/assets/115237/04484a2e-9bbf-493c-aa26-8e936da008fa">
<img width="797" alt="Screenshot 2023-06-07 at 16 57 40"
src="https://github.com/go-gitea/gitea/assets/115237/e7ccb672-5807-4cb6-b306-b18ae0c7e321">

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-06-08 10:19:13 +00:00
Giteabot adb5b9c061
Fix incorrect git ignore rule and add missing license files (#25135) (#25138)
Backport #25135 by @yp05327

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-06-08 09:41:08 +00:00
HesterG f0c967560a
Change branch name from master to main in some documents' links (#25126) (#25140)
Backport #25126 to 1.20

As title. And needs to backport to 1.19
2023-06-08 09:40:05 +00:00
Giteabot 1cc63ade82
Fix MilestoneIDs when querying issues (#25125) (#25141)
Backport #25125 by @Zettat123

Fix #25114

Co-authored-by: Zettat123 <zettat123@gmail.com>
2023-06-08 11:03:53 +02:00
2649 changed files with 45049 additions and 64932 deletions

View file

@ -1,38 +0,0 @@
{
"name": "Gitea DevContainer",
"image": "mcr.microsoft.com/devcontainers/go:1.21-bullseye",
"features": {
// installs nodejs into container
"ghcr.io/devcontainers/features/node:1": {
"version":"20"
},
"ghcr.io/devcontainers/features/git-lfs:1.1.0": {},
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
"ghcr.io/devcontainers/features/python:1": {}
},
"customizations": {
"vscode": {
"settings": {},
// same extensions as Gitpod, should match /.gitpod.yml
"extensions": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"golang.go",
"stylelint.vscode-stylelint",
"DavidAnson.vscode-markdownlint",
"Vue.volar",
"ms-azuretools.vscode-docker",
"zixuanchen.vitest-explorer",
"qwtel.sqlite-viewer",
"GitHub.vscode-pull-request-github"
]
}
},
"portsAttributes": {
"3000": {
"label": "Gitea Web",
"onAutoForward": "notify"
}
},
"postCreateCommand": "make deps"
}

View file

@ -75,10 +75,10 @@ cpu.out
/yarn.lock
/yarn-error.log
/npm-debug.log*
/public/assets/js
/public/assets/css
/public/assets/fonts
/public/assets/img/webpack
/public/js
/public/css
/public/fonts
/public/img/webpack
/vendor
/web_src/fomantic/node_modules
/web_src/fomantic/build/*

426
.drone.yml Normal file
View file

@ -0,0 +1,426 @@
---
kind: pipeline
name: release-version
platform:
os: linux
arch: amd64
workspace:
base: /source
path: /
trigger:
event:
- tag
volumes:
- name: deps
temp: {}
steps:
- name: fetch-tags
image: docker:git
pull: always
commands:
- git fetch --tags --force
- name: deps-frontend
image: node:20
pull: always
commands:
- make deps-frontend
- name: deps-backend
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- make deps-backend
volumes:
- name: deps
path: /go
- name: static
image: techknowlogick/xgo:go-1.20.x
pull: always
commands:
# Upgrade to node 20 once https://github.com/techknowlogick/xgo/issues/163 is resolved
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
- export PATH=$PATH:$GOPATH/bin
- make release
environment:
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
TAGS: bindata sqlite sqlite_unlock_notify
DEBIAN_FRONTEND: noninteractive
depends_on: [fetch-tags]
volumes:
- name: deps
path: /go
- name: gpg-sign
image: plugins/gpgsign:1
pull: always
settings:
detach_sign: true
excludes:
- "dist/release/*.sha256"
files:
- "dist/release/*"
environment:
GPGSIGN_KEY:
from_secret: gpgsign_key
GPGSIGN_PASSPHRASE:
from_secret: gpgsign_passphrase
depends_on: [static]
- name: release-tag
image: woodpeckerci/plugin-s3:latest
pull: always
settings:
acl:
from_secret: aws_s3_acl
region:
from_secret: aws_s3_region
bucket:
from_secret: aws_s3_bucket
endpoint:
from_secret: aws_s3_endpoint
path_style:
from_secret: aws_s3_path_style
source: "dist/release/*"
strip_prefix: dist/release/
target: "/gitea/${DRONE_TAG##v}"
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
depends_on: [gpg-sign]
- name: github
image: plugins/github-release:latest
pull: always
settings:
files:
- "dist/release/*"
file_exists: overwrite
environment:
GITHUB_TOKEN:
from_secret: github_token
depends_on: [gpg-sign]
---
kind: pipeline
type: docker
name: docker-linux-amd64-release-version
platform:
os: linux
arch: amd64
trigger:
ref:
include:
- "refs/tags/**"
exclude:
- "refs/tags/**-rc*"
paths:
exclude:
- "docs/**"
steps:
- name: fetch-tags
image: docker:git
pull: always
commands:
- git fetch --tags --force
- name: publish
image: plugins/docker:latest
pull: always
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
- name: publish-rootless
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
auto_tag: true
auto_tag_suffix: linux-amd64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: docker-linux-amd64-release-candidate-version
platform:
os: linux
arch: amd64
trigger:
ref:
- "refs/tags/**-rc*"
paths:
exclude:
- "docs/**"
steps:
- name: fetch-tags
image: docker:git
pull: always
commands:
- git fetch --tags --force
- name: publish
image: plugins/docker:latest
pull: always
settings:
tags: ${DRONE_TAG##v}-linux-amd64
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
- name: publish-rootless
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
tags: ${DRONE_TAG##v}-linux-amd64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: docker-linux-arm64-release-version
platform:
os: linux
arch: arm64
trigger:
ref:
include:
- "refs/tags/**"
exclude:
- "refs/tags/**-rc*"
paths:
exclude:
- "docs/**"
steps:
- name: fetch-tags
image: docker:git
pull: always
commands:
- git fetch --tags --force
- name: publish
image: plugins/docker:latest
pull: always
settings:
auto_tag: true
auto_tag_suffix: linux-arm64
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
- name: publish-rootless
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
auto_tag: true
auto_tag_suffix: linux-arm64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: docker-linux-arm64-release-candidate-version
platform:
os: linux
arch: arm64
trigger:
ref:
- "refs/tags/**-rc*"
paths:
exclude:
- "docs/**"
steps:
- name: fetch-tags
image: docker:git
pull: always
commands:
- git fetch --tags --force
- name: publish
image: plugins/docker:latest
pull: always
settings:
tags: ${DRONE_TAG##v}-linux-arm64
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
- name: publish-rootless
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
tags: ${DRONE_TAG##v}-linux-arm64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: docker-manifest-version
platform:
os: linux
arch: amd64
steps:
- name: manifest-rootless
image: plugins/manifest
pull: always
settings:
auto_tag: true
ignore_missing: true
spec: docker/manifest.rootless.tmpl
password:
from_secret: docker_password
username:
from_secret: docker_username
- name: manifest
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
spec: docker/manifest.tmpl
password:
from_secret: docker_password
username:
from_secret: docker_username
trigger:
ref:
- "refs/tags/**"
paths:
exclude:
- "docs/**"
depends_on:
- docker-linux-amd64-release-version
- docker-linux-amd64-release-candidate-version
- docker-linux-arm64-release-version
- docker-linux-arm64-release-candidate-version

View file

@ -11,6 +11,7 @@ parserOptions:
plugins:
- "@eslint-community/eslint-plugin-eslint-comments"
- eslint-plugin-array-func
- eslint-plugin-custom-elements
- eslint-plugin-import
- eslint-plugin-jquery
- eslint-plugin-no-jquery
@ -18,18 +19,16 @@ plugins:
- eslint-plugin-regexp
- eslint-plugin-sonarjs
- eslint-plugin-unicorn
- eslint-plugin-vitest-globals
- eslint-plugin-wc
env:
es2024: true
es2022: true
node: true
globals:
__webpack_public_path__: true
overrides:
- files: ["web_src/**/*"]
globals:
__webpack_public_path__: true
process: false # https://github.com/webpack/webpack/issues/15833
- files: ["web_src/**/*", "docs/**/*"]
env:
browser: true
@ -46,12 +45,6 @@ overrides:
- files: ["*.config.*"]
rules:
import/no-unused-modules: [0]
- files: ["**/*.test.*", "web_src/js/test/setup.js"]
env:
vitest-globals/env: true
- files: ["web_src/js/modules/fetch.js", "web_src/js/standalone/**/*"]
rules:
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
rules:
"@eslint-community/eslint-comments/disable-enable-pair": [2]
@ -91,6 +84,19 @@ rules:
consistent-this: [0]
constructor-super: [2]
curly: [0]
custom-elements/expose-class-on-global: [0]
custom-elements/extends-correct-class: [2]
custom-elements/file-name-matches-element: [2]
custom-elements/no-constructor: [2]
custom-elements/no-customized-built-in-elements: [2]
custom-elements/no-dom-traversal-in-attributechangedcallback: [2]
custom-elements/no-dom-traversal-in-connectedcallback: [2]
custom-elements/no-exports-with-element: [2]
custom-elements/no-method-prefixed-with-on: [2]
custom-elements/no-unchecked-define: [0]
custom-elements/one-element-per-file: [0]
custom-elements/tag-name-matches-class: [2]
custom-elements/valid-tag-name: [2]
default-case-last: [2]
default-case: [0]
default-param-last: [0]
@ -149,7 +155,7 @@ rules:
import/no-restricted-paths: [0]
import/no-self-import: [2]
import/no-unassigned-import: [0]
import/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$", ^vitest/]}]
import/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$"]}]
import/no-unused-modules: [2, {unusedExports: true}]
import/no-useless-path-segments: [2, {commonjs: true}]
import/no-webpack-loader-syntax: [2]
@ -413,8 +419,9 @@ rules:
no-restricted-exports: [0]
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top, __dirname, __filename]
no-restricted-imports: [0]
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.js instead"}]
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement]
no-return-assign: [0]
no-return-await: [0]
no-script-url: [2]
no-self-assign: [2, {props: true}]
no-self-compare: [2]
@ -476,7 +483,7 @@ rules:
prefer-exponentiation-operator: [2]
prefer-named-capture-group: [0]
prefer-numeric-literals: [2]
prefer-object-has-own: [2]
prefer-object-has-own: [0]
prefer-object-spread: [2]
prefer-promise-reject-errors: [2, {allowEmptyReject: false}]
prefer-regex-literals: [2]
@ -658,6 +665,7 @@ rules:
unicorn/no-unnecessary-await: [2]
unicorn/no-unreadable-array-destructuring: [0]
unicorn/no-unreadable-iife: [2]
unicorn/no-unsafe-regex: [0]
unicorn/no-unused-properties: [2]
unicorn/no-useless-fallback-in-spread: [2]
unicorn/no-useless-length-check: [2]
@ -684,7 +692,7 @@ rules:
unicorn/prefer-dom-node-remove: [2]
unicorn/prefer-dom-node-text-content: [2]
unicorn/prefer-event-target: [2]
unicorn/prefer-export-from: [0]
unicorn/prefer-export-from: [2, {ignoreUsedVariables: true}]
unicorn/prefer-includes: [2]
unicorn/prefer-json-parse-buffer: [0]
unicorn/prefer-keyboard-event-key: [2]
@ -730,27 +738,14 @@ rules:
valid-typeof: [2, {requireStringLiterals: true}]
vars-on-top: [0]
wc/attach-shadow-constructor: [2]
wc/define-tag-after-class-definition: [0]
wc/expose-class-on-global: [0]
wc/file-name-matches-element: [2]
wc/guard-define-call: [0]
wc/guard-super-call: [2]
wc/max-elements-per-file: [0]
wc/no-child-traversal-in-attributechangedcallback: [2]
wc/no-child-traversal-in-connectedcallback: [2]
wc/no-closed-shadow-root: [2]
wc/no-constructor-attributes: [2]
wc/no-constructor-params: [2]
wc/no-constructor: [2]
wc/no-customized-built-in-elements: [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]
wc/no-invalid-element-name: [0] # covered by custom-elements/valid-tag-name
wc/no-self-class: [2]
wc/no-typos: [2]
wc/require-listener-teardown: [2]
wc/tag-name-matches-class: [2]
wrap-iife: [2, inside]
wrap-regex: [0]
yield-star-spacing: [2, after]

View file

@ -130,7 +130,7 @@ runs:
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
# the displayed version is converted with - sometime changed into +, 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"

View file

@ -49,17 +49,6 @@ runs:
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
@ -82,7 +71,7 @@ runs:
repo: ${{ inputs.to-owner }}/${{ inputs.repo }}
direction: upload
release-dir: release
release-notes: ${{ steps.release-notes.outputs.value }}
release-notes: "See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#${{ steps.tag-version.outputs.value }}"
token: ${{ inputs.token }}
gpg-private-key: ${{ inputs.gpg-private-key }}
gpg-passphrase: ${{ inputs.gpg-passphrase }}

View file

@ -13,7 +13,7 @@ PATH = ${WORK_PATH}/forgejo.db
[log]
MODE = file
LEVEL = trace
LEVEL = debug
ROUTER = file
[log.file]
@ -22,9 +22,5 @@ FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[actions]
ENABLED = true

View file

@ -1,187 +0,0 @@
#!/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

@ -1,32 +0,0 @@
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

@ -21,10 +21,6 @@ FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[actions]
ENABLED = true

View file

@ -21,10 +21,6 @@ FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[actions]
ENABLED = true

View file

@ -1,89 +0,0 @@
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

@ -1,44 +0,0 @@
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

@ -21,10 +21,6 @@ FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[repository]
ENABLE_PUSH_CREATE_USER = true
DEFAULT_PUSH_CREATE_PRIVATE = false
[actions]
ENABLED = true

View file

@ -1,39 +0,0 @@
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

@ -1,44 +0,0 @@
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

View file

@ -1,64 +1,24 @@
#!/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
#
set -ex
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
PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: '
function maybe_sudo() {
if test $(id -u) != 0 ; then
SUDO=sudo
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
if ! which curl daemon > /dev/null ; then
maybe_sudo
$SUDO apt-get install -y -qq curl daemon
fi
}
@ -67,32 +27,33 @@ function build() {
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
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.20.3-0 5.0.2+0-gitea-1.20.3
build 1.21.0-0 6.0.0+0-gitea-1.21.0
}
function retry() {
rm -f $DIR/wait-for.out
function wait_for() {
rm -f $DIR/setup-forgejo.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
if "$@" >> $DIR/setup-forgejo.out 2>&1 ; then
success=true
break
fi
cat $DIR/setup-forgejo.out
echo waiting $delay
sleep $delay
done
if test $success = false ; then
cat $DIR/wait-for.out
return 1
cat $DIR/setup-forgejo.out
return 1
fi
}
@ -100,13 +61,9 @@ 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
mkdir -p $DIR
wget -O $DIR/forgejo-$version --quiet https://codeberg.org/forgejo/forgejo/releases/download/v$version/forgejo-$version-linux-amd64
chmod +x $DIR/forgejo-$version
fi
}
@ -117,92 +74,19 @@ function cleanup_logs() {
rm -f $work_path/log/*.log
}
function clobber() {
rm -fr /tmp/forgejo-upgrades
}
function start_forgejo() {
function start() {
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
if ! wait_for 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
$work_path/forgejo-api http://${HOST_PORT}/api/v1/version
}
function create_user() {
@ -211,69 +95,39 @@ function create_user() {
local work_path=$DIR/forgejo-work-path
if test -f $work_path/forgejo-token; then
return
return
fi
local user=root
local password=admin1234
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"
$cli admin user create --admin --username "$user" --password "$password" --email "$user@example.com"
local scopes="--scopes all"
if echo $version | grep --quiet 1.18. ; then
scopes=""
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
$cli admin user generate-access-token -u $user --raw $scopes > $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
( echo "#!/bin/sh" ; echo 'curl -sS -H "Content-Type: application/json" -H @'$work_path/forgejo-header' "$@"' ) > $work_path/forgejo-api && chmod +x $work_path/forgejo-api
}
function stop() {
stop_daemon forgejo
stop_daemon minio
stop_daemon garage
if test -f $DIR/forgejo-pid ; then
local pid=$(cat $DIR/forgejo-pid)
kill -TERM $pid
pidwait $pid || true
for delay in 1 1 2 2 5 5 ; do
if ! test -f $DIR/forgejo-pid ; then
break
fi
sleep $delay
done
! test -f $DIR/forgejo-pid
fi
cleanup_logs
}
function reset_forgejo() {
function reset() {
local config=$1
local work_path=$DIR/forgejo-work-path
rm -fr $work_path
@ -281,26 +135,11 @@ function reset_forgejo() {
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
test -d $work_path/data/$path
done
}
@ -308,16 +147,17 @@ function cleanup_storage() {
local work_path=$DIR/forgejo-work-path
for path in ${STORAGE_PATHS} ; do
rm -fr $work_path/data/$path
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"
echo "================ See also https://codeberg.org/forgejo/forgejo/pulls/1225"
log_info "downgrading from 1.20.3-0 to 1.20.2-0 fails"
echo "================ downgrading from 1.20.3-0 to 1.20.2-0 fails"
stop
reset default
start 1.20.3-0
@ -325,305 +165,110 @@ function test_downgrade_1.20.2_fails() {
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
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"
echo "================ See also https://codeberg.org/forgejo/forgejo/pulls/1225"
log_info "using < 1.20.3-0 and [storage].PATH merge all storage"
echo "================ 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
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"
echo "================ 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
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"
echo "================ See also https://codeberg.org/forgejo/forgejo/pulls/1225"
log_info "using < 1.20 and conflicting sections misplace storage"
echo "================ 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
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.*]"
echo "================ 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
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"
echo "================ 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
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
echo "================ 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
for version in 1.18.5-0 1.19.4-0 1.20.2-0 1.20.3-0 1.21.0-0 ; do
echo "================ 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
stop
dependencies
build_all
test_successful_upgrades
test_bug_storage_misplace
test_bug_storage_merged
test_downgrade_1.20.2_fails
}
"$@"

View file

@ -55,13 +55,13 @@ jobs:
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)
forgejo-test-helper.sh push $dir $url root forgejo |& tee $dir/pushed
eval $(grep '^sha=' < $dir/pushed)
#
# 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
forgejo-test-helper.sh api POST $url repos/root/forgejo/tags ${{ steps.forgejo.outputs.token }} --data-raw '{"tag_name": "v'$version'", "target": "'$sha'"}'
LOOPS=180 forgejo-test-helper.sh wait_success "$url" root/forgejo $sha
#

View file

@ -43,10 +43,6 @@ jobs:
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"
@ -104,9 +100,9 @@ jobs:
#
# Verify `make frontend` files are available
#
test -d public/assets/css
test -d public/assets/fonts
test -d public/assets/js
test -d public/css
test -d public/fonts
test -d public/js
#
# Verify `make generate` files are available
#

View file

@ -13,7 +13,7 @@
# DOER: forgejo-experimental-ci
# TOKEN: <generated from codeberg.org/forgejo-experimental-ci>
#
# http://private.forgejo.org/forgejo/forgejo
# https://forgejo.octopuce.forgejo.org/forgejo/forgejo
#
# Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo
#
@ -37,6 +37,13 @@ jobs:
runs-on: self-hosted
if: secrets.DOER != '' && secrets.FORGEJO != '' && secrets.TO_OWNER != '' && secrets.FROM_OWNER != '' && secrets.TOKEN != ''
steps:
- name: install the certificate authority
if: secrets.ROLE == 'forgejo-release'
run: |
apt-get install -qq -y wget
wget --no-check-certificate -O /usr/local/share/ca-certificates/enough.crt https://forgejo.octopuce.forgejo.org/forgejo/enough/raw/branch/main/certs/2023-05-13/ca.crt
update-ca-certificates --fresh
- uses: actions/checkout@v3
- name: copy & sign binaries and container images from one owner to another
@ -57,7 +64,7 @@ jobs:
uses: https://code.forgejo.org/actions/setup-go@v4
if: secrets.ROLE == 'forgejo-experimental'
with:
go-version: "1.21"
go-version: ">=1.21"
check-latest: true
- name: update the _release.experimental DNS record
if: secrets.ROLE == 'forgejo-experimental'

View file

@ -16,7 +16,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
go-version: "1.20"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-backend
@ -30,7 +30,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
go-version: "1.20"
check-latest: true
- run: make deps-backend deps-tools
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
@ -39,17 +39,11 @@ jobs:
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"
go-version: "1.20"
- run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
@ -77,6 +71,8 @@ jobs:
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: testgitea
ports:
- "3306:3306"
#
# See also https://codeberg.org/forgejo/forgejo/issues/976
#
@ -85,7 +81,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
go-version: "1.20"
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
@ -114,21 +110,18 @@ jobs:
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
ports:
- "5432:5432"
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
go-version: "1.20"
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
@ -162,7 +155,7 @@ jobs:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.21"
go-version: "1.20"
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
@ -187,3 +180,33 @@ jobs:
RACE_ENABLED: true
TEST_TAGS: gogit sqlite sqlite_unlock_notify
USE_REPO_TEST_DIR: 1
upgrade:
needs: [test-sqlite]
runs-on: docker
container:
image: codeberg.org/forgejo/test_env:main
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.20"
- run: |
git config --add safe.directory '*'
chown -R gitea:gitea . /go
- run: |
su gitea -c 'make deps-backend'
- run: |
su gitea -c 'make backend'
env:
TAGS: bindata sqlite sqlite_unlock_notify
- run: |
su gitea -c 'make gitea'
cp -a gitea /tmp/forgejo-development
timeout-minutes: 50
env:
TAGS: bindata sqlite sqlite_unlock_notify
- run: |
script=$(pwd)/.forgejo/upgrades/test-upgrade.sh
$script dependencies
su gitea -c "$script test_upgrades"

4
.gitattributes vendored
View file

@ -1,7 +1,7 @@
* text=auto eol=lf
*.tmpl linguist-language=go-html-template
*.tmpl linguist-language=Handlebars
/assets/*.json linguist-generated
/public/assets/img/svg/*.svg linguist-generated
/public/img/svg/*.svg linguist-generated
/templates/swagger/v1_json.tmpl linguist-generated
/vendor/** -text -eol linguist-vendored
/web_src/fomantic/build/** linguist-generated

View file

@ -0,0 +1,57 @@
---
name: "Bug Report"
about: "Found something you weren't expecting? Report it here!"
title: "[BUG] "
---
<!--
NOTE: If your issue is a security concern, please email security@forgejo.org (GPG: A4676E79) instead of opening a public issue.
1. Please speak English, as this is the language all maintainers can
speak and write.
2. Please ask questions or troubleshoot configuration/deploy problems
in our Matrix space (https://matrix.to/#/#forgejo:matrix.org).
3. 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.
4. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
5. If you are using a proxy or a CDN (e.g. CloudFlare) in front of
Forgejo, please disable the proxy/CDN fully and connect to Forgejo
directly to confirm the issue still persists without those services.
-->
- Can you reproduce the problem on [Forgejo Next](https://next.forgejo.org/)?
- Forgejo version (or commit ref):
- Git version:
- Operating system:
- Database (use `[x]`):
- [ ] PostgreSQL
- [ ] MySQL
- [ ] MSSQL
- [ ] SQLite
- How are you running Forgejo?
<!--
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.
-->
## Description
<!-- Please describe the issue you are having as clearly and succinctly as possible. -->
## Reproducing
<!-- Please explain how to cause the problem to occur on demand if possible. -->
## Logs
<!--
It is really important to provide pertinent logs. We need DEBUG level logs.
Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems
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.
-->
## Screenshots
<!-- If this issue involves the Web Interface, please provide one or more screenshots -->

View file

@ -0,0 +1,24 @@
---
name: "Feature Request"
about: "Got an idea for a feature that Forgejo doesn't have yet? Submit it here!"
title: "[FEAT] "
---
<!--
1. Please speak English, as this is the language all maintainers can
speak and write.
2. Please ask questions or troubleshoot configuration/deploy problems
in our Matrix space (https://matrix.to/#/#forgejo:matrix.org).
3. 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.
-->
## Needs and benefits
<!-- Please describe the needs this feature intends to address and the benefits it brings. -->
## Feature Description
<!-- Please describe the feature you would like to see added as clearly and succinctly as possible. -->
## Screenshots
<!-- If you can, provide screenshots of an implementation on another site, e.g. GitHub. -->

View file

@ -1,63 +0,0 @@
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

@ -1,90 +0,0 @@
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

@ -1,17 +0,0 @@
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

@ -1,31 +0,0 @@
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

@ -1,5 +0,0 @@
self-hosted-runner:
labels:
- actuated-4cpu-8gb
- actuated-4cpu-16gb
- nscloud

36
.github/labeler.yml vendored
View file

@ -1,36 +0,0 @@
modifies/docs:
- "**/*.md"
- "docs/**"
modifies/frontend:
- "web_src/**/*"
modifies/templates:
- all: ["templates/**", "!templates/swagger/v1_json.tmpl"]
modifies/api:
- "routers/api/**"
- "templates/swagger/v1_json.tmpl"
modifies/cli:
- "cmd/**"
modifies/translation:
- "options/locale/*.ini"
modifies/migrations:
- "models/migrations/**/*"
modifies/internal:
- "Makefile"
- "Dockerfile"
- "Dockerfile.rootless"
- "docker/**"
- "webpack.config.js"
- ".eslintrc.yaml"
- ".golangci.yml"
- ".markdownlint.yaml"
- ".spectral.yaml"
- ".stylelintrc.yaml"
- ".yamllint.yaml"
- ".github/**"

View file

@ -1,36 +0,0 @@
name: disk-clean
on:
workflow_call:
jobs:
triage:
runs-on: ubuntu-latest
steps:
# FIXME: https://github.com/jlumbroso/free-disk-space/issues/17
- name: same as 'large-packages' but without 'google-cloud-sdk'
shell: bash
run: |
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^mongodb-.*'
sudo apt-get remove -y '^mysql-.*'
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
sudo apt-get autoremove -y
sudo apt-get clean
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: true

View file

@ -4,94 +4,50 @@ on:
workflow_call:
outputs:
backend:
description: "whether backend files changed"
value: ${{ jobs.detect.outputs.backend }}
frontend:
description: "whether frontend files changed"
value: ${{ jobs.detect.outputs.frontend }}
docs:
description: "whether docs files changed"
value: ${{ jobs.detect.outputs.docs }}
actions:
description: "whether actions files changed"
value: ${{ jobs.detect.outputs.actions }}
templates:
value: ${{ jobs.detect.outputs.templates }}
docker:
value: ${{ jobs.detect.outputs.docker }}
swagger:
value: ${{ jobs.detect.outputs.swagger }}
yaml:
value: ${{ jobs.detect.outputs.yaml }}
jobs:
detect:
name: detect which files changed
runs-on: ubuntu-latest
timeout-minutes: 3
# Map a step output to a job output
outputs:
backend: ${{ steps.changes.outputs.backend }}
frontend: ${{ steps.changes.outputs.frontend }}
docs: ${{ steps.changes.outputs.docs }}
actions: ${{ steps.changes.outputs.actions }}
templates: ${{ steps.changes.outputs.templates }}
docker: ${{ steps.changes.outputs.docker }}
swagger: ${{ steps.changes.outputs.swagger }}
yaml: ${{ steps.changes.outputs.yaml }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
backend:
- "**/*.go"
- "templates/**/*.tmpl"
- "assets/emoji.json"
- "**/*.tmpl"
- "go.mod"
- "go.sum"
- "Makefile"
- ".golangci.yml"
- ".editorconfig"
frontend:
- "**/*.js"
- "web_src/**"
- "assets/emoji.json"
- "package.json"
- "package-lock.json"
- "Makefile"
- ".eslintrc.yaml"
- ".stylelintrc.yaml"
- ".npmrc"
docs:
- "**/*.md"
- "docs/**"
- ".markdownlint.yaml"
- "package.json"
- "package-lock.json"
actions:
- ".github/workflows/*"
- "Makefile"
templates:
- "templates/**/*.tmpl"
- "pyproject.toml"
- "poetry.lock"
docker:
- "Dockerfile"
- "Dockerfile.rootless"
- "docker/**"
- "Makefile"
swagger:
- "templates/swagger/v1_json.tmpl"
- "Makefile"
- "package.json"
- "package-lock.json"
- ".spectral.yaml"
yaml:
- "**/*.yml"
- "**/*.yaml"
- ".yamllint.yaml"
- "pyproject.toml"
- "poetry.lock"

View file

@ -1,21 +0,0 @@
name: labeler
on:
pull_request_target:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v4
with:
dot: true
sync-labels: true

View file

@ -1,24 +1,20 @@
name: release-nightly
name: release-nightly-assets
on:
push:
branches: [ main, release/v* ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nightly-binary:
runs-on: nscloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
go-version: ">=1.20"
check-latest: true
- uses: actions/setup-node@v3
with:
@ -46,26 +42,22 @@ jobs:
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
echo "Cleaned name is ${REF_NAME}"
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
- name: configure aws
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: upload binaries to s3
run: |
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
nightly-docker-rootful:
uses: jakejarvis/s3-sync-action@master
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SOURCE_DIR: dist/release
DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }}
nightly-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Get cleaned branch name
@ -83,8 +75,6 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: fetch go modules
run: make vendor
- name: build rootful docker image
uses: docker/build-push-action@v4
with:
@ -92,36 +82,6 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
nightly-docker-rootless:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Get cleaned branch name
id: clean_name
run: |
# if main then say nightly otherwise cleanup name
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "branch=nightly" >> "$GITHUB_OUTPUT"
exit 0
fi
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: fetch go modules
run: make vendor
- name: build rootless docker image
uses: docker/build-push-action@v4
with:

View file

@ -1,132 +0,0 @@
name: release-tag-rc
on:
push:
tags:
- 'v1*-rc*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
binary:
runs-on: nscloud
steps:
- uses: actions/checkout@v4
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- 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 deps-backend
# xgo build
- run: make release
env:
TAGS: bindata sqlite sqlite_unlock_notify
- name: import gpg key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
- name: sign binaries
run: |
for f in dist/release/*; do
echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f"
done
# clean branch name to get the folder name in S3
- name: Get cleaned branch name
id: clean_name
run: |
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
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- 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/*
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
docker-rootful:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/metadata-action@v5
id: meta
with:
images: gitea/gitea
flavor: |
latest=false
# 1.2.3-rc0
tags: |
type=semver,pattern={{version}}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build rootful docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
docker-rootless:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/metadata-action@v5
id: meta
with:
images: gitea/gitea
# each tag below will have the suffix of -rootless
flavor: |
latest=false
suffix=-rootless
# 1.2.3-rc0
tags: |
type=semver,pattern={{version}}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build rootless docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
file: Dockerfile.rootless
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View file

@ -1,143 +0,0 @@
name: release-tag-version
on:
push:
tags:
- 'v1.*'
- '!v1*-rc*'
- '!v1*-dev'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
binary:
runs-on: nscloud
steps:
- uses: actions/checkout@v4
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- 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 deps-backend
# xgo build
- run: make release
env:
TAGS: bindata sqlite sqlite_unlock_notify
- name: import gpg key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
- name: sign binaries
run: |
for f in dist/release/*; do
echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f"
done
# clean branch name to get the folder name in S3
- name: Get cleaned branch name
id: clean_name
run: |
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
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- 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 }} --notes-from-tag dist/release/*
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
docker-rootful:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/metadata-action@v5
id: meta
with:
images: gitea/gitea
# this will generate tags in the following format:
# latest
# 1
# 1.2
# 1.2.3
tags: |
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build rootful docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
docker-rootless:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/metadata-action@v5
id: meta
with:
images: gitea/gitea
# each tag below will have the suffix of -rootless
flavor: |
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=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build rootless docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
file: Dockerfile.rootless
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

11
.gitignore vendored
View file

@ -71,15 +71,13 @@ cpu.out
/tests/*.ini
/tests/**/*.git/**/*.sample
/node_modules
/.venv
/yarn.lock
/yarn-error.log
/npm-debug.log*
/public/assets/js
/public/assets/css
/public/assets/fonts
/public/assets/licenses.txt
/public/assets/img/webpack
/public/js
/public/css
/public/fonts
/public/img/webpack
/vendor
/web_src/fomantic/node_modules
/web_src/fomantic/build/*
@ -98,7 +96,6 @@ cpu.out
/.go-licenses
# Snapcraft
/gitea_a*.txt
snap/.snapcraft/
parts/
stage/

View file

@ -34,8 +34,7 @@ vscode:
- Vue.volar
- ms-azuretools.vscode-docker
- zixuanchen.vitest-explorer
- qwtel.sqlite-viewer
- GitHub.vscode-pull-request-github
- alexcvzz.vscode-sqlite
ports:
- name: Gitea

View file

@ -29,7 +29,7 @@ linters:
fast: false
run:
go: "1.21"
go: "1.20"
timeout: 10m
skip-dirs:
- node_modules
@ -75,23 +75,18 @@ linters-settings:
- name: modifies-value-receiver
gofumpt:
extra-rules: true
lang-version: "1.21"
lang-version: "1.20"
depguard:
rules:
main:
deny:
- pkg: encoding/json
desc: use gitea's modules/json instead of encoding/json
- pkg: github.com/unknwon/com
desc: use gitea's util and replacements
- pkg: io/ioutil
desc: use os or io instead
- pkg: golang.org/x/exp
desc: it's experimental and unreliable
- pkg: code.gitea.io/gitea/modules/git/internal
desc: do not use the internal package, use AddXxx function instead
- pkg: gopkg.in/ini.v1
desc: do not use the ini package, use gitea's config system instead
list-type: denylist
# Check the list against standard lib.
include-go-root: true
packages-with-error-message:
- encoding/json: "use gitea's modules/json instead of encoding/json"
- github.com/unknwon/com: "use gitea's util and replacements"
- io/ioutil: "use os or io instead"
- golang.org/x/exp: "it's experimental and unreliable."
- code.gitea.io/gitea/modules/git/internal: "do not use the internal package, use AddXxx function instead"
- gopkg.in/ini.v1: "do not use the ini package, use gitea's config system instead"
issues:
max-issues-per-linter: 0

View file

@ -5,5 +5,4 @@
/modules/public/bindata.go
/modules/templates/bindata.go
/vendor
/public/assets
node_modules

View file

@ -6,6 +6,7 @@ line-length: {code_blocks: false, tables: false, stern: true, line_length: -1}
no-alt-text: false
no-bare-urls: false
no-blanks-blockquote: false
no-duplicate-header: {allow_different_nesting: true}
no-emphasis-as-header: false
no-empty-links: false
no-hard-tabs: {code_blocks: false}

View file

@ -1,7 +1,5 @@
plugins:
- stylelint-declaration-strict-value
- stylelint-declaration-block-no-ignored-properties
- stylelint-stylistic
ignoreFiles:
- "**/*.go"
@ -50,7 +48,7 @@ rules:
declaration-no-important: null
declaration-property-max-values: null
declaration-property-unit-allowed-list: null
declaration-property-unit-disallowed-list: {line-height: [em]}
declaration-property-unit-disallowed-list: null
declaration-property-value-allowed-list: null
declaration-property-value-disallowed-list: null
declaration-property-value-no-unknown: true
@ -84,7 +82,6 @@ rules:
media-feature-name-value-allowed-list: null
media-feature-name-value-no-unknown: true
media-feature-range-notation: null
media-query-no-invalid: true
named-grid-areas-no-invalid: true
no-descending-specificity: null
no-duplicate-at-import-rules: true
@ -96,7 +93,6 @@ rules:
no-unknown-animations: null
no-unknown-custom-properties: null
number-max-precision: null
plugin/declaration-block-no-ignored-properties: true
property-allowed-list: null
property-disallowed-list: null
property-no-unknown: true
@ -137,82 +133,6 @@ rules:
selector-type-no-unknown: [true, {ignore: [custom-elements]}]
shorthand-property-no-redundant-values: true
string-no-newline: true
stylistic/at-rule-name-case: null
stylistic/at-rule-name-newline-after: null
stylistic/at-rule-name-space-after: null
stylistic/at-rule-semicolon-newline-after: null
stylistic/at-rule-semicolon-space-before: null
stylistic/block-closing-brace-empty-line-before: null
stylistic/block-closing-brace-newline-after: null
stylistic/block-closing-brace-newline-before: null
stylistic/block-closing-brace-space-after: null
stylistic/block-closing-brace-space-before: null
stylistic/block-opening-brace-newline-after: null
stylistic/block-opening-brace-newline-before: null
stylistic/block-opening-brace-space-after: null
stylistic/block-opening-brace-space-before: null
stylistic/color-hex-case: lower
stylistic/declaration-bang-space-after: never
stylistic/declaration-bang-space-before: null
stylistic/declaration-block-semicolon-newline-after: null
stylistic/declaration-block-semicolon-newline-before: null
stylistic/declaration-block-semicolon-space-after: null
stylistic/declaration-block-semicolon-space-before: never
stylistic/declaration-block-trailing-semicolon: null
stylistic/declaration-colon-newline-after: null
stylistic/declaration-colon-space-after: null
stylistic/declaration-colon-space-before: never
stylistic/function-comma-newline-after: null
stylistic/function-comma-newline-before: null
stylistic/function-comma-space-after: null
stylistic/function-comma-space-before: null
stylistic/function-max-empty-lines: 0
stylistic/function-parentheses-newline-inside: never-multi-line
stylistic/function-parentheses-space-inside: null
stylistic/function-whitespace-after: null
stylistic/indentation: 2
stylistic/linebreaks: null
stylistic/max-empty-lines: 1
stylistic/max-line-length: null
stylistic/media-feature-colon-space-after: null
stylistic/media-feature-colon-space-before: never
stylistic/media-feature-name-case: null
stylistic/media-feature-parentheses-space-inside: null
stylistic/media-feature-range-operator-space-after: always
stylistic/media-feature-range-operator-space-before: always
stylistic/media-query-list-comma-newline-after: null
stylistic/media-query-list-comma-newline-before: null
stylistic/media-query-list-comma-space-after: null
stylistic/media-query-list-comma-space-before: null
stylistic/no-empty-first-line: null
stylistic/no-eol-whitespace: true
stylistic/no-extra-semicolons: true
stylistic/no-missing-end-of-source-newline: null
stylistic/number-leading-zero: null
stylistic/number-no-trailing-zeros: null
stylistic/property-case: lower
stylistic/selector-attribute-brackets-space-inside: null
stylistic/selector-attribute-operator-space-after: null
stylistic/selector-attribute-operator-space-before: null
stylistic/selector-combinator-space-after: null
stylistic/selector-combinator-space-before: null
stylistic/selector-descendant-combinator-no-non-space: null
stylistic/selector-list-comma-newline-after: null
stylistic/selector-list-comma-newline-before: null
stylistic/selector-list-comma-space-after: always-single-line
stylistic/selector-list-comma-space-before: never-single-line
stylistic/selector-max-empty-lines: 0
stylistic/selector-pseudo-class-case: lower
stylistic/selector-pseudo-class-parentheses-space-inside: never
stylistic/selector-pseudo-element-case: lower
stylistic/string-quotes: double
stylistic/unicode-bom: null
stylistic/unit-case: lower
stylistic/value-list-comma-newline-after: null
stylistic/value-list-comma-newline-before: null
stylistic/value-list-comma-space-after: null
stylistic/value-list-comma-space-before: null
stylistic/value-list-max-empty-lines: 0
time-min-milliseconds: null
unit-allowed-list: null
unit-disallowed-list: null

15
.woodpecker.yml Normal file
View file

@ -0,0 +1,15 @@
pipeline:
nulo-container:
image: docker.io/woodpeckerci/plugin-docker-buildx
settings:
repo: gitea.nulo.in/nulo/forgejo
tag: v1.20.5-1
registry: https://gitea.nulo.in
username: Nulo
password:
from_secret: registry_secret
secrets: [REGISTRY_SECRET]
when:
branch: "nulo/release/v1.20"
event: "push"

View file

@ -1,44 +0,0 @@
extends: default
rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: 0
max-spaces-inside-empty: 0
brackets:
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: 0
max-spaces-inside-empty: 0
comments:
require-starting-space: true
ignore-shebangs: true
min-spaces-from-content: 1
comments-indentation:
level: error
document-start:
level: error
present: false
document-end:
present: false
empty-lines:
max: 1
indentation:
spaces: 2
line-length: disable
truthy:
allowed-values: ["true", "false", "on", "off"]
ignore: |
.venv
node_modules

View file

@ -42,13 +42,13 @@ GARGS = "--no-print-directory"
# The GNU convention is to use the lowercased `prefix` variable/macro to
# specify the installation directory. Humor them.
GPREFIX =
GPREFIX = ""
.if defined(PREFIX) && ! defined(prefix)
GPREFIX = 'prefix = "$(PREFIX)"'
.endif
.BEGIN: .SILENT
which $(GMAKE) || (printf "Error: GNU Make is required!\n\n" 1>&2 && false)
which $(GMAKE) || printf "Error: GNU Make is required!\n\n" 1>&2 && false
.PHONY: FRC
$(.TARGETS): FRC

File diff suppressed because it is too large Load diff

View file

@ -1,32 +0,0 @@
# 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

96
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,96 @@
# 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

@ -7,18 +7,17 @@ Sensitive security-related issues should be reported to [security@forgejo.org](m
## For everyone involved
- [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)
- [Code of Conduct](https://forgejo.org/docs/next/developer/COC/)
- [Bugs, features, security and others discussions](https://forgejo.org/docs/next/developer/DISCUSSIONS/)
- [Governance](https://forgejo.org/docs/next/developer/GOVERNANCE/)
- [Sustainability and funding](https://codeberg.org/forgejo/sustainability/src/branch/master/README.md)
## For contributors
- [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/)
- [Developer Certificate of Origin (DCO)](https://forgejo.org/docs/next/developer/DCO/)
- [Development workflow](https://forgejo.org/docs/next/developer/WORKFLOW/)
## For maintainers
- [Release management](https://forgejo.org/docs/latest/developer/release/)
- [Secrets](https://forgejo.org/docs/latest/developer/secrets/)
- [Release management](https://forgejo.org/docs/next/developer/RELEASE/)
- [Secrets](https://forgejo.org/docs/next/developer/SECRETS/)

View file

@ -1,6 +1,6 @@
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21-alpine3.18 as build-env
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.20-alpine3.18 as build-env
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
@ -38,19 +38,6 @@ 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
# Set permissions
RUN chmod 755 /tmp/local/usr/bin/entrypoint \
/tmp/local/usr/local/bin/gitea \
/tmp/local/etc/s6/gitea/* \
/tmp/local/etc/s6/openssh/* \
/tmp/local/etc/s6/.s6-svscan/* \
/go/src/code.gitea.io/gitea/gitea \
/go/src/code.gitea.io/gitea/environment-to-ini
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
FROM docker.io/library/alpine:3.18
LABEL maintainer="contact@forgejo.org"
@ -67,8 +54,7 @@ RUN apk --no-cache add \
s6 \
sqlite \
su-exec \
gnupg \
&& rm -rf /var/cache/apk/*
gnupg
RUN addgroup \
-S -g 1000 \
@ -90,8 +76,11 @@ VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
COPY --from=build-env /tmp/local /
COPY docker/root /
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
RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
RUN chmod 644 /etc/profile.d/gitea_bash_autocomplete.sh

View file

@ -1,6 +1,6 @@
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21-alpine3.18 as build-env
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.20-alpine3.18 as build-env
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
@ -38,17 +38,6 @@ 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
# Set permissions
RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
/tmp/local/usr/local/bin/docker-setup.sh \
/tmp/local/usr/local/bin/gitea \
/go/src/code.gitea.io/gitea/gitea \
/go/src/code.gitea.io/gitea/environment-to-ini
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
FROM docker.io/library/alpine:3.18
LABEL maintainer="contact@forgejo.org"
@ -61,8 +50,7 @@ RUN apk --no-cache add \
gettext \
git \
curl \
gnupg \
&& rm -rf /var/cache/apk/*
gnupg
RUN addgroup \
-S -g 1000 \
@ -78,11 +66,13 @@ RUN addgroup \
RUN mkdir -p /var/lib/gitea /etc/gitea
RUN chown git:git /var/lib/gitea /etc/gitea
COPY --from=build-env /tmp/local /
COPY docker/rootless /
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
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-setup.sh /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
RUN chmod 644 /etc/profile.d/gitea_bash_autocomplete.sh
#git:git
USER 1000:1000

View file

@ -52,8 +52,3 @@ Xinyi Gong <hestergong@gmail.com> (@HesterG)
wxiaoguang <wxiaoguang@gmail.com> (@wxiaoguang)
Gary Moon <gary@garymoon.net> (@garymoon)
Philip Peterson <philip.c.peterson@gmail.com> (@philip-peterson)
Denys Konovalov <kontakt@denyskon.de> (@denyskon)
Punit Inani <punitinani1@gmail.com> (@puni9869)
CaiCandong <1290147055@qq.com> (@caicandong)
Rui Chen <rui@chenrui.dev> (@chenrui333)
Nanguan Lin <nanguanlin6@gmail.com> (@lng2020)

View file

@ -23,19 +23,19 @@ SHASUM ?= shasum -a 256
HAS_GO := $(shell hash $(GO) > /dev/null 2>&1 && echo yes)
COMMA := ,
XGO_VERSION := go-1.21.x
XGO_VERSION := go-1.20.x
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.44.0
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.43.0
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.7.0
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.5.0
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.1
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.4
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1.0.1
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1.6.25
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@latest
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@latest
DOCKER_IMAGE ?= gitea/gitea
DOCKER_TAG ?= latest
@ -68,7 +68,7 @@ endif
EXTRA_GOFLAGS ?=
MAKE_VERSION := $(shell "$(MAKE)" -v | cat | head -n 1)
MAKE_VERSION := $(shell "$(MAKE)" -v | head -n 1)
MAKE_EVIDENCE_DIR := .make_evidence
ifeq ($(RACE_ENABLED),true)
@ -89,7 +89,7 @@ endif
VERSION = ${GITEA_VERSION}
# SemVer
FORGEJO_VERSION := 6.0.11+0-gitea-1.21.11
FORGEJO_VERSION := 5.0.6+0-gitea-1.20.5
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)"
@ -102,15 +102,15 @@ FOMANTIC_WORK_DIR := web_src/fomantic
WEBPACK_SOURCES := $(shell find web_src/js web_src/css -type f)
WEBPACK_CONFIGS := webpack.config.js
WEBPACK_DEST := public/assets/js/index.js public/assets/css/index.css
WEBPACK_DEST_ENTRIES := public/assets/js public/assets/css public/assets/fonts public/assets/img/webpack
WEBPACK_DEST := public/js/index.js public/css/index.css
WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack
BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go
BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST))
GENERATED_GO_DEST := modules/charset/invisible_gen.go modules/charset/ambiguous_gen.go
SVG_DEST_DIR := public/assets/img/svg
SVG_DEST_DIR := public/img/svg
AIR_TMP_DIR := .air
@ -143,7 +143,7 @@ ifdef DEPS_PLAYWRIGHT
PLAYWRIGHT_FLAGS += --with-deps
endif
FORGEJO_API_SPEC := public/assets/forgejo/api.v1.yml
FORGEJO_API_SPEC := public/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
@ -189,7 +189,6 @@ help:
@echo " - deps-frontend install frontend dependencies"
@echo " - deps-backend install backend dependencies"
@echo " - deps-tools install tool dependencies"
@echo " - deps-py install python dependencies"
@echo " - lint lint everything"
@echo " - lint-fix lint everything and fix issues"
@echo " - lint-actions lint action workflow files"
@ -206,8 +205,6 @@ help:
@echo " - lint-css-fix lint css files and fix issues"
@echo " - lint-md lint markdown files"
@echo " - lint-swagger lint swagger files"
@echo " - lint-templates lint template files"
@echo " - lint-yaml lint yaml files"
@echo " - checks run various consistency checks"
@echo " - checks-frontend check frontend files"
@echo " - checks-backend check backend files"
@ -215,9 +212,6 @@ help:
@echo " - test-frontend test frontend files"
@echo " - test-backend test backend files"
@echo " - test-e2e[\#TestSpecificName] test end to end using playwright"
@echo " - update update js and py dependencies"
@echo " - update-js update js dependencies"
@echo " - update-py update py dependencies"
@echo " - webpack build webpack files"
@echo " - svg build svg files"
@echo " - fomantic build fomantic files"
@ -374,10 +368,10 @@ lint: lint-frontend lint-backend
lint-fix: lint-frontend-fix lint-backend-fix
.PHONY: lint-frontend
lint-frontend: lint-js lint-css
lint-frontend: lint-js lint-css lint-md lint-swagger
.PHONY: lint-frontend-fix
lint-frontend-fix: lint-js-fix lint-css-fix
lint-frontend-fix: lint-js-fix lint-css-fix lint-md lint-swagger
.PHONY: lint-backend
lint-backend: lint-go lint-go-vet lint-editorconfig
@ -411,11 +405,11 @@ lint-md: node_modules
.PHONY: lint-go
lint-go:
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS)
$(GO) run $(GOLANGCI_LINT_PACKAGE) run
.PHONY: lint-go-fix
lint-go-fix:
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS) --fix
$(GO) run $(GOLANGCI_LINT_PACKAGE) run --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
@ -437,14 +431,6 @@ lint-editorconfig:
lint-actions:
$(GO) run $(ACTIONLINT_PACKAGE)
.PHONY: lint-templates
lint-templates: .venv
@poetry run djlint $(shell find templates -type f -iname '*.tmpl')
.PHONY: lint-yaml
lint-yaml: .venv
@poetry run yamllint .
.PHONY: watch
watch:
@bash build/watch.sh
@ -851,9 +837,6 @@ 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)
@ -872,6 +855,9 @@ release-windows: | $(DIST_DIRS)
ifeq (,$(findstring gogit,$(TAGS)))
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'osusergo gogit $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION)-gogit .
endif
ifneq ($(DRONE_TAG),)
cp /build/* $(DIST)/binaries
endif
.PHONY: release-linux
release-linux: | $(DIST_DIRS)
@ -883,10 +869,16 @@ endif
.PHONY: release-darwin
release-darwin: | $(DIST_DIRS)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin-10.12/amd64,darwin-10.12/arm64' -out gitea-$(VERSION) .
ifneq ($(DRONE_TAG),)
cp /build/* $(DIST)/binaries
endif
.PHONY: release-freebsd
release-freebsd: | $(DIST_DIRS)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'freebsd/amd64' -out gitea-$(VERSION) .
ifneq ($(DRONE_TAG),)
cp /build/* $(DIST)/binaries
endif
.PHONY: release-copy
release-copy: | $(DIST_DIRS)
@ -898,7 +890,7 @@ release-check: | $(DIST_DIRS)
.PHONY: release-compress
release-compress: | $(DIST_DIRS)
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && $(GO) run $(GXZ_PACKAGE) -k -9 $${file}; done;
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && $(GO) run $(GXZ_PAGAGE) -k -9 $${file}; done;
.PHONY: release-sources
release-sources: | $(DIST_DIRS)
@ -919,10 +911,7 @@ docs:
cd docs; bash scripts/trans-copy.sh;
.PHONY: deps
deps: deps-frontend deps-backend deps-tools deps-py
.PHONY: deps-py
deps-py: .venv
deps: deps-frontend deps-backend deps-tools
.PHONY: deps-frontend
deps-frontend: node_modules
@ -937,7 +926,7 @@ deps-tools:
$(GO) install $(EDITORCONFIG_CHECKER_PACKAGE)
$(GO) install $(GOFUMPT_PACKAGE)
$(GO) install $(GOLANGCI_LINT_PACKAGE)
$(GO) install $(GXZ_PACKAGE)
$(GO) install $(GXZ_PAGAGE)
$(GO) install $(MISSPELL_PACKAGE)
$(GO) install $(SWAGGER_PACKAGE)
$(GO) install $(XGO_PACKAGE)
@ -949,27 +938,13 @@ node_modules: package-lock.json
npm install --no-save
@touch node_modules
.venv: poetry.lock
poetry install --no-root
@touch .venv
.PHONY: update
update: update-js update-py
.PHONY: update-js
update-js: node-check | node_modules
npx updates -u -f package.json
.PHONY: npm-update
npm-update: node-check | node_modules
npx updates -cu
rm -rf node_modules package-lock.json
npm install --package-lock
@touch node_modules
.PHONY: update-py
update-py: node-check | node_modules
npx updates -u -f pyproject.toml
rm -rf .venv poetry.lock
poetry install
@touch .venv
.PHONY: fomantic
fomantic:
rm -rf $(FOMANTIC_WORK_DIR)/build

View file

@ -1,448 +1,250 @@
# Release Notes
A Forgejo release is published shortly after a Gitea release is published and they have [matching release numbers](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/CONTRIBUTING/RELEASE.md#release-numbering). Additional Forgejo releases may be published to address urgent security issues or bug fixes.
A Forgejo release is published shortly after a Gitea release is published and they have [matching release numbers](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/CONTRIBUTING/RELEASE.md#release-numbering). Additional Forgejo releases may be published to address urgent security issues or bug fixes. Forgejo release notes include all Gitea release notes.
The Forgejo admin should carefully read the required manual actions before upgrading. A point release (e.g. v1.21.1-0 or v1.21.2-0) does not require manual actions but others might (e.g. v1.20, v1.21).
The Forgejo admin should carefully read the required manual actions before upgrading. A point release (e.g. v1.19.1 or v1.19.2) does not require manual actions but others might (e.g. v1.18.0, v1.19.0).
## 1.21.0-0 (DRAFT)
## DRAFT 1.20.0-0
The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.21/forgejo) included in the `Forgejo v1.21.0-0` release can be reviewed from the command line with:
```shell
$ git clone https://codeberg.org/forgejo/forgejo/
$ git -C forgejo log --oneline --no-merges origin/v1.20/forgejo..origin/v1.21/forgejo
```
- **[Forgejo Semantic Version](https://forgejo.org/docs/v1.21/user/semver/):**
The semantic version was updated to `6.0.0+0-gitea-1.21.0` because it contains breaking changes.
- **Breaking:**
Note that the modifications related to CSS, templates or assets (images, fonts, etc.) are not documented here.
Although they can be extracted and modified, Forgejo does not provide any guarantee that such changes
will be portable from one version to another (even a patch version).
- [Restrict certificate type for builtin SSH server](https://codeberg.org/forgejo/forgejo/pulls/1172). This is a breaking change for setups where the builtin SSH server is being used and for some reason host certificates were being used for authentication.
- [Some Forgejo CLI options have changed](https://codeberg.org/forgejo/forgejo/commit/d0dbe52e76f3038777c3b50066e3636105387ca3) and scripts may need to be updated. For instance `--verbose` is no longer a global option and is implemented on a per sub-command basis. Check `forgejo --help` or `forgejo docs` for more information.
- [Remove "CHARSET" config option for MySQL and always use "utf8mb4"](https://codeberg.org/forgejo/forgejo/commit/ce46834b938eb687152a680669ada95a26304178). It has been a requirement for years and specifying anything else is likely to cause issues.
- [Set SSH_AUTHORIZED_KEYS_BACKUP to false by default](https://codeberg.org/forgejo/forgejo/commit/469d89b95a1ce18dd34808a95c7230375e828e24). There is no automatic cleanup of these backups and can end up using a significant amount of disk space over time.
(More items to be added here)
## 1.20.5-0
The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.5-0` release can be reviewed from the command line with:
```shell
$ git clone https://codeberg.org/forgejo/forgejo/
$ git -C forgejo log --oneline --no-merges v1.20.4-1..v1.20.5-0
```
This stable release contains an **important security fix**, as explained in the [v1.20.5-0 companion blog post](https://forgejo.org/2023-10-release-v1-20-5-0/).
* Recommended Action
We **strongly recommend** that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.20/admin/upgrade/) to the latest version as soon as possible.
* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/)
The semantic version was updated to `5.0.5+0-gitea-1.20.5`
* Security fix
* When a user logs into Forgejo, they can click the **Remember This Device** checkbox and their browser will store a **Long-term authentication** token provided by the server, in a cookie that will allow them to stay logged in for an extended period of time. The implementation was inherently insecure and was [reworked](https://codeberg.org/forgejo/forgejo/commit/51988ef52bc93b63184d28395d10bf3b76914ad0). Read more about this issue in the [v1.20.5-0 blog post](https://forgejo.org/2023-10-release-v1-20-5-0/).
* Bug fixes
The most prominent bug fixes are described below. Others can be found in the list of commits included in the release as described above.
* [Fix the display of pull requests waiting for review](https://codeberg.org/forgejo/forgejo/commit/4b23f11864) on the `/pulls` page. It incorrectly included all reviews.
* [Fix a v1.20 regression preventing access to files with OAuth2 tokens](https://codeberg.org/forgejo/forgejo/commit/3e8c3b7c09) in private repositories.
* [Fix](https://codeberg.org/forgejo/forgejo/commit/101cfc1f82) a bug by which the `doctor` command [complains the `deleted_branch` table is missing](https://codeberg.org/forgejo/forgejo/issues/1522) although it should not.
* [Fix the release URL in webhooks](https://codeberg.org/forgejo/forgejo/commit/1b1f878204) so that `URL` points to the API URL and `HTMLURL` points to the web page.
* [Fix organization field being null in POST /orgs/{orgid}/teams](https://codeberg.org/forgejo/forgejo/commit/f8bf284794).
## 1.20.4-1
The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.4-1` release can be reviewed from the command line with:
```shell
$ git clone https://codeberg.org/forgejo/forgejo/
$ git -C forgejo log --oneline --no-merges v1.20.4-0..v1.20.4-1
```
This stable release includes bug fixes.
* Recommended Action
We recommend that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.20/admin/upgrade/) to the latest version.
* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/)
The semantic version was updated to `5.0.4+0-gitea-1.20.4`
* Bug fixes
The most prominent ones are described here, others can be found in the list of commits included in the release as described above.
* [Fix the followers and following list that only showed the first page](https://codeberg.org/forgejo/forgejo/commit/c041114a20fcaaf0931da81dcb542a930e8f9c5f)
* [Fix issue templates preventing the creation of any new issues when blank issues are not authorized](https://codeberg.org/forgejo/forgejo/commit/64a418dfc778665f56cb20d678f3c10dbb62ddca) (regression introduced in v1.20.4-0)
## 1.20.4-0
The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.4-0` release can be reviewed from the command line with:
```shell
$ git clone https://codeberg.org/forgejo/forgejo/
$ git -C forgejo log --oneline --no-merges v1.20.3-0..v1.20.4-0
```
This stable release includes bug fixes and two features.
* Recommended Action
We recommend that all Forgejo installations are [upgraded](https://forgejo.org/docs/v1.20/admin/upgrade/) to the latest version.
* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/)
The semantic version was updated to `5.0.3+0-gitea-1.20.4`
* Features
* [Log slow SQL queries](https://codeberg.org/forgejo/forgejo/commit/fa25b9eec63c073e16f4595459880e4ee8797913) to help identify bottlenecks on large Forgejo instances
* [Add `branch_filter` to hooks API endpoints](https://codeberg.org/forgejo/forgejo/commit/19a49e763a013dec4c3fcf3e9e2be89c7009bb3b)
* Bug fixes
The most prominent ones are described here, others can be found in the list of commits included in the release as described above.
* [Ignore the trailing slashes when comparing oauth2 redirect_uri](https://codeberg.org/forgejo/forgejo/commit/2f6d011503a35a1eede96f5a13b2a9868c06b3ae)
* [Fix the reopen logic for agit flow pull request](https://codeberg.org/forgejo/forgejo/commit/5abca17b644ded3c3ab8869db1d34f9bd678f18e)
* [Fix the missing display of user projects](https://codeberg.org/forgejo/forgejo/commit/ef46b01168e251fad92ed46102b5faad75a5bcb1)
* [Fix](https://codeberg.org/forgejo/forgejo/commit/08762875d7362ee207bbd320123cbb0ad4cf70d2) issue templates [that failed to save checkboxes](https://codeberg.org/forgejo/forgejo/pulls/1317)
* [Fix accessibility issues preventing focus and selection](https://codeberg.org/forgejo/forgejo/commit/66016b3fe3a9646e5d9c8b4c2d88b1da7a908ccf)
* [Fix being unable to use a repo that prohibits accepting PRs as a PR source](https://codeberg.org/forgejo/forgejo/commit/1d228e6ee93525bd630c4a915febd98d159f1824)
* [Forgejo doctor database fix](https://codeberg.org/forgejo/forgejo/commit/0b1175f21b403ff59c0c3f7a759de8d0fe13bee8) to repair a condition preventing the owner of an organization from creating a repository
* [Fix dashboard filters having no effect](https://codeberg.org/forgejo/forgejo/commit/a6c2201dd41706a000ca96bdcd3e89df96e342fd)
* [Also check the email blocklists when adding new emails to existing accounts](https://codeberg.org/forgejo/forgejo/commit/d5845521a842418ae8f6dfcad8368ba2a6035f54)
* [Sync tags when adopting repos](https://codeberg.org/forgejo/forgejo/commit/6b5ef0fad754a863eb7d91eefa8301dd9a5a84b5)
* [Fix an error when pushing a new branch and there is a requirement that all commits are signed](https://codeberg.org/forgejo/forgejo/commit/193e04c43b556e0a25c260149429945ba2164efa)
## 1.20.3-0
The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.3-0` release can be reviewed from the command line with:
```shell
$ git clone https://codeberg.org/forgejo/forgejo/
$ git -C forgejo log --oneline --no-merges v1.20.2-0..v1.20.3-0
```
This stable release includes bug fixes and a safeguard against a
regression that may lead to data loss. The `[storage*]` sections in the
`app.ini` file may cause the files for some subsystems - Attachments,
LFS, Avatars, Repository avatars, Repository archives, Packages - to
be merged together or misplaced. The safeguard detects this situation
and Forgejo will not start to prevent data loss. If your instance is in
this situation, [follow the instructions in the companion blog post](https://forgejo.org/2023-08-release-v1-20-3-0/).
* Recommended Action
We recommend that all Forgejo installations are upgraded to the latest version.
* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/)
The semantic version was updated to `5.0.2+0-gitea-1.20.3`
* Breaking changes
* [Fix some bugs in how the storage sections are interpreted](https://codeberg.org/forgejo/forgejo/commit/815682c88) in the `app.ini` file. Read more about this issue in the [v1.20.3-0 blog post](https://forgejo.org/2023-08-release-v1-20-3-0/)
* [Add sanity checks](https://codeberg.org/forgejo/forgejo/commit/ee0e4848e) to detect an `app.ini` configuration that [needs manual fixing to preserve storage](https://forgejo.org/2023-08-release-v1-20-3-0/)
* Bug fixes
The most prominent ones are described here, others can be found in the list of commits included in the release as described above.
* [Fix links to pull request reviews sent via mail](https://codeberg.org/forgejo/forgejo/commit/88e179d5ef8ee41f71d068195685ff098b38ca31). The pull request link was correct but it did not go the the review and stayed at the beginning of the page
* [Recognize OGG as an audio format](https://codeberg.org/forgejo/forgejo/commit/622ec5c79f299c32ac2667a1aa7b4bf5d7c2d6cf)
* [Consistently show the last time a cron job was run in the admin panel](https://codeberg.org/forgejo/forgejo/commit/5f769ef20)
* [Fix NuGet registry v2 & v3 API search endpoints](https://codeberg.org/forgejo/forgejo/commit/471138829b0c24fe8c621dbb866ae8bb45ebc674)
* [Allow html <img /> code to be parsed in markdown files](https://codeberg.org/forgejo/forgejo/commit/e7d0475e1)
* [Fix incorrect color of the selected assignees when creating an issue](https://codeberg.org/forgejo/forgejo/commit/c7d7490b2)
* [Add missing MinIO region on client initialization](https://codeberg.org/forgejo/forgejo/commit/927cbe62b)
* [Add pull request review request webhook event](https://codeberg.org/forgejo/forgejo/commit/99c8dab9d)
* [Fix bad url in the wiki due to incorrect unescaping](https://codeberg.org/forgejo/forgejo/commit/e0f6956a4)
* [Fix the sort menu that was broken when displaying a custom profile from the `.profile` repository](https://codeberg.org/forgejo/forgejo/commit/fa92a6a4c)
* [Workaround](https://codeberg.org/forgejo/forgejo/commit/3d211dea2) MariaDB [performance issue on large Forgejo instances](https://codeberg.org/forgejo/forgejo/issues/1161)
* [Display human-readable text](https://codeberg.org/forgejo/forgejo/commit/2729bb3c6) instead of [numerical file modes](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation)
* [The CLI exit code now is different from zero when an error occurs](https://codeberg.org/forgejo/forgejo/commit/089af9ab1)
* [Fix error when a Debian package has a double newline character at the end of the control block](https://codeberg.org/forgejo/forgejo/commit/dd7180846)
* [Fix a condition that would cause git related tasks to hang for longer than necessary in the queues and use too many resources as a result](https://codeberg.org/forgejo/forgejo/commit/36f8fbe1b)
* [Fix the topic validation rule and suport dots](https://codeberg.org/forgejo/forgejo/commit/a578b75d7)
* [Fix pull request check list when there are more than 30](https://codeberg.org/forgejo/forgejo/commit/e226b9646)
* [Fix attachment clipboard copy on insecure origin](https://codeberg.org/forgejo/forgejo/commit/12ac84c26)
* [Fix the profile README rendering](https://codeberg.org/forgejo/forgejo/commit/84c3b60a4) that [was inconsistent with other markdown files renderings](https://codeberg.org/forgejo/forgejo/issues/833)
* [Fix API leaking the user email when the caller is not authentified](https://codeberg.org/forgejo/forgejo/commit/d89003cc1)
## 1.20.2-0
The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.2-0` release can be reviewed from the command line with:
```shell
$ git clone https://codeberg.org/forgejo/forgejo/
$ git -C forgejo log --oneline --no-merges v1.20.1-0..v1.20.2-0
```
This stable release includes bug fixes and displays [warnings in the administration panel](https://codeberg.org/forgejo/forgejo/commit/28f4029e40) when deprecated entries are found in `app.ini`.
* Recommended Action
We recommend that all Forgejo installations are upgraded to the latest version.
* [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/)
The semantic version was updated to `5.0.1+0-gitea-1.20.2`
* Bug fixes
The most prominent ones are described here, others can be found in the list of commits included in the release as described above.
* [Add missing assets to the Forgejo sources tarbal](https://codeberg.org/forgejo/forgejo/commit/e14d239005)
* [Fix user type selection error when creating a user](https://codeberg.org/forgejo/forgejo/commit/268569b462) and selecting `public` or `private`.
* [Fix access check for org-level project](https://codeberg.org/forgejo/forgejo/commit/5afb0294f4)
* [Warn instead of reporting an error when a webhook cannot be found](https://codeberg.org/forgejo/forgejo/commit/4c3dcdf815)
* [Set MAX_WORKERS](https://codeberg.org/forgejo/forgejo/commit/5a4b19435d) to a value lower than 10 if the number of available CPUs is low to avoid overloading the host.
* [Fix bug when pushing to a pull request which enabled dismiss approval automatically](https://codeberg.org/forgejo/forgejo/commit/4640c53386)
* [Fix handling of plenty Nuget package versions](https://codeberg.org/forgejo/forgejo/commit/7bb8526736)
* [Update email-setup.en-us.md](https://codeberg.org/forgejo/forgejo/commit/31f2ce3998)
* [Fix bugs](https://codeberg.org/forgejo/forgejo/commit/9654d71bb2) in [LFS meta garbage collection](https://codeberg.org/forgejo/forgejo/issues/1113)
* [Fix UI regression of asciinema player](https://codeberg.org/forgejo/forgejo/commit/f3c26de1f4)
* [Fix LFS object list style](https://codeberg.org/forgejo/forgejo/commit/f20cfc291c)
* [Fix CLI allowing creation of multiple user access tokens with the same name](https://codeberg.org/forgejo/forgejo/commit/b699e1d340)
* [Fix](https://codeberg.org/forgejo/forgejo/commit/f4a8f10f64) router logger [preventing separating the logs in different files](https://codeberg.org/forgejo/forgejo/issues/1123).
* [added ssh mirror workaround description](https://codeberg.org/forgejo/forgejo/commit/d9d38b6244)
* [Fix wrong workflow status when rerun a job in an already finished workflow](https://codeberg.org/forgejo/forgejo/commit/e2101ae572)
* [Fix escape problems in the branch selector](https://codeberg.org/forgejo/forgejo/commit/9fae415030)
* [Fix handling of Debian files with trailing slash](https://codeberg.org/forgejo/forgejo/commit/4be3270e87)
* [fix Missing 404 swagger response docs for /admin/users/{username}](https://codeberg.org/forgejo/forgejo/commit/1cd4d4b00e)
* [Use stderr as fallback if the log file can't be opened](https://codeberg.org/forgejo/forgejo/commit/942d02f8e9)
## 1.20.1-0
The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.1-0` release can be reviewed from the command line with:
The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.20/forgejo) included in the `Forgejo v1.20.0-?` release can be reviewed from the command line with:
```shell
$ git clone https://codeberg.org/forgejo/forgejo/
$ git -C forgejo log --oneline --no-merges origin/v1.19/forgejo..origin/v1.20/forgejo
```
- **[Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/):**
The semantic version was updated to `5.0.0+0-gitea-1.20.1` because it contains breaking changes.
- **Breaking:**
- [Scoped access tokens](https://codeberg.org/forgejo/forgejo/commit/18de83b2a3fc120922096b7348d6375094ae1532) or (Personal Access Tokens), were refactored and although existing tokens are still valid, they may have a different scope than before. To ensure that no tokens have a larger scope than expected they must be removed and recreated.
- If your `app.ini` has one of the the following `[indexer].ISSUE_INDEXER_QUEUE_TYPE`, `[indexer].ISSUE_INDEXER_QUEUE_BATCH_NUMBER`, `[indexer].`, `[indexer].ISSUE_INDEXER_QUEUE_DIR`, `[indexer].ISSUE_INDEXER_QUEUE_CONN_STR`, `[indexer].UPDATE_BUFFER_LEN`, `[mailer].SEND_BUFFER_LEN`, `[repository].PULL_REQUEST_QUEUE_LENGTH` or `[repository].MIRROR_QUEUE_LENGTH`, Forgejo will abort immediately. Unless you know exactly what you're doing, you must comment them out so the default values are used.
- The `-p` option of `environment-to-ini` is [no longer supported](https://codeberg.org/forgejo/forgejo/commit/fa0b5b14c2faa6a5f76bb2e7bc9241a5e4354189)
- The ".png" suffix for [user and organizations is now reserved](https://codeberg.org/forgejo/forgejo/commit/2b91841cd3e1213ff3e4ed4209d6a4be89c2fa79)
- The section `[git.reflog]` is [now obsolete and its keys have been moved](https://codeberg.org/forgejo/forgejo/commit/2f149c5c9db97f20fbbc65e32d1f3133048b11a2) to the following replacements:
* `[git.reflog].ENABLED``[git.config].core.logAllRefUpdates`
* `[git.reflog].EXPIRATION``[git.config].gc.reflogExpire`
- The [logger](https://codeberg.org/forgejo/forgejo/commit/4647660776436f0a83129b4ceb8426b1fb0599bb) used to display Forgejo's was refactored and has new settings, different from the previous one found at `log.<mode>.<logger>` in `app.ini`. Check the [documentation](https://forgejo.org/docs/v1.20/admin/config-cheat-sheet/#log-log) and `app.example.ini` for more information. The SMTP logger was removed.
- Forgejo will refuse to start if [the refactored path & config system](https://codeberg.org/forgejo/forgejo/commit/061b68e99) does not pass sanity checks (e.g. WORK_PATH must be absolute).
- Manually set [WORK_PATH](https://forgejo.org/docs/v1.20/admin/config-cheat-sheet/#overall-default) in `app.ini`.
If the `app.ini` file is writable by the user under which the Forgejo server runs and `WORK_PATH` is not set,
the server will add it. Otherwise it will log an error starting with `Unable to update WORK_PATH`.
One of the consequences of not setting `WORK_PATH` in `app.ini` is that pushing to a repository via ssh is
[likely to fail as explained in the corresponding bug report](https://codeberg.org/forgejo/forgejo/issues/1118).
Read the technical details in the [commit that implements the WORK_PATH change](https://codeberg.org/forgejo/forgejo/commit/061b68e99).
- The user profile can be customized with [a Markdown file](https://codeberg.org/forgejo/forgejo/commit/c090f87a8db5b51e0aa9c7278b38ddc862c048ac).
The profile page of a user is rendered using the `README.md` file of the `.profile` repository, if it exists. It is a
breaking change because **it will display the .profile/README.md of a pre-existing repository, private or not**.
- The [API endpoint pagination](https://codeberg.org/forgejo/forgejo/commit/0a3c4d4a595cc7e12462dde393ed64186260f26b) for team members was fixed: it now starts at 1 instead of 0, just like all other paginated API endpoints.
- The `SSH_KEYGEN_PATH` variable in `app.ini` now defaults to using the [Go SSH key parsing instead of the `ssh-keygen` binary](https://codeberg.org/forgejo/forgejo/commit/7a8a4f54321f208ebbb0f708a5f0e49c4cd4cc04). When `START_SSH_SERVER` is true, the decision to use the Go SSH key parsing or an external binary will now depend on the value of `SSH_KEYGEN_PATH` instead of always using the Go SSH key parsing.
- The storage settings were [refactored](https://codeberg.org/forgejo/forgejo/commit/d6dd6d641b593c54fe1a1041c153111ce81dbc20). Read more about [storage settings](https://forgejo.org/docs/v1.20/admin/storage/).
- [The [repository.editor] PREVIEWABLE_FILE_MODES setting was removed](https://codeberg.org/forgejo/forgejo/commit/84daddc2fa74393cdc13371b0cc44f0444cfdae0). This setting served no practical purpose and was not working correctly. Instead a preview tab is always shown in the file editor when supported.
- In addition to the already deprecated options inside [queue], many options have been dropped as well. Those are WRAP_IF_NECESSARY, MAX_ATTEMPTS, TIMEOUT, WORKERS, BLOCK_TIMEOUT, BOOST_TIMEOUT, BOOST_WORKERS. You can remove them from your app.ini now. Additionally, some default values have changed in this section.
- The default CSS and templates included in Forgejo were heavily refactored and a large number of variables renamed. These changes are not documented and there is a very high chance that a tempate extracted and modified for a particular Forgejo instance will no longer work as it did. Browsing through the git history of the template in the sources is the best way to figure out how and why it was modified.
- **Moderation:**
Blocking another user is desirable if they are acting maliciously or are spamming your repository. When you block a user, Forgejo does not explicitly notify them, but they may learn through an interaction with you that is blocked. [Read more about blocking users](https://forgejo.org/docs/v1.20/user/blocking-user/).
- **Package:**
New registries are available for [SWIFT](https://forgejo.org/docs/v1.20/user/packages/swift), [debian](https://forgejo.org/docs/v1.20/user/packages/debian), [RPM](https://forgejo.org/docs/v1.20/user/packages/rpm), [alpine](https://forgejo.org/docs/v1.20/user/packages/alpine), [Go](https://forgejo.org/docs/v1.20/user/packages/go) and [CRAN](https://forgejo.org/docs/v1.20/user/packages/cran).
- **Accessibility:**
numerous improvements for [issue comments](https://codeberg.org/forgejo/forgejo/commit/6c354546547cd3a9595a7db119a6480d9cd506a7), [the menu on the navbar](https://codeberg.org/forgejo/forgejo/commit/a78e0b7dade16bc6509b943fe86e74962f1b95b6), [scoped labels](https://codeberg.org/forgejo/forgejo/commit/e8935606f5f1fff3c59222ebca6d4615ab06fb0b), [checkboxes and dropdowns](https://codeberg.org/forgejo/forgejo/commit/d4f35bd681af0632da988e15306f330e020422b2), [RTL rendering support to Markdown](https://codeberg.org/forgejo/forgejo/commit/32d9c47ec7706d8f06e09b42e09a28d7a0e3c526), [file (re-)views](https://codeberg.org/forgejo/forgejo/commit/e95b42e187cde9ac4bd541cd714bdb4f5c1fd8bc), [interactive tooltips](https://codeberg.org/forgejo/forgejo/commit/87f0f7e670c6c0e6aeab8c4458bfdb9d954eacec), [using a button element](https://codeberg.org/forgejo/forgejo/commit/81fe5d61851c0e586af7d32c29171ceff9a571bb), [repository list](https://codeberg.org/forgejo/forgejo/commit/e82f1b15c7120ad13fd3b67cf7e2c6cb9915c22d) and more.
- **Time:**
The display and localization of time was improved for [tooltips](https://codeberg.org/forgejo/forgejo/commit/b7b58348317cbe0145dc453d45c886b8e2764b4c), [milestones](https://codeberg.org/forgejo/forgejo/commit/97176754beb4de23fa0f68df715c4737919c93b0), [due date and translations that contain dates](https://codeberg.org/forgejo/forgejo/commit/70bb4984cdad9a15d676708bd345b590aa42d72a), [commit graphs](https://codeberg.org/forgejo/forgejo/commit/5bc9f7fcf9aece92c3fa2a0ea56e5585261a7f28), [runners](https://codeberg.org/forgejo/forgejo/commit/62ca5825f73ad5a25ffeb6c3ef66f0eaf5d30cdf), [webhooks](https://codeberg.org/forgejo/forgejo/commit/dbb37367854d108ebfffcac27837c0afac199a8e), [tests](https://codeberg.org/forgejo/forgejo/commit/3d266dd0f3dbae7e417c0e790e266aebc0078814) and more. Previously each rendered timestamp would be static, now the real time since an event happend is show. If a comment was added 2 minutes before the page rendered it would show as "2 minutes ago" on the initial render and if another 8 minutes have passed, without a page refresh you'd see "10 minutes ago".
- **[Wiki](https://forgejo.org/docs/v1.20/user/wiki/)**
- Improve the [display of the table of content](https://codeberg.org/forgejo/forgejo/commit/1ab16e48cccc086e7f97fb3ae8a293fe47a3a452)
- Fixed a bug [preventing team users who have wiki write permission from deleting a page](https://codeberg.org/forgejo/forgejo/commit/284b41f45244bbe46fc8feee15bbfdf66d150e79)
- [Shows the External Link icon and URL in the header](https://codeberg.org/forgejo/forgejo/commit/d347208114966166ffa9655adc5b202676546c31) to indicate that the user will be sent to an external side to help prevent fishing
- Allow dash in [titles](https://codeberg.org/forgejo/forgejo/commit/b39a5bbbd610ba30651218658caaec1c86d6bca1)
- **[Actions](https://forgejo.org/docs/v1.20/user/actions/)**
- The internal CI graduated from **experimental** to **[alpha](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha)**. It now has with a [user](https://forgejo.org/docs/v1.20/user/actions) documentation that includes examples and an extensive [administrator](https://forgejo.org/docs/v1.20/admin/actions) guide to set it up.
- [Forgejo Actions](https://forgejo.org/docs/v1.20/user/actions/) workflows are [now available](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/.forgejo/workflows) to run tests and publish releases for `Forgejo` itself.
- The Woodpecker CI configuration for PR verification and building releases for Forgejo v1.18 and v1.19 is no longer maintained as part of Forgejo itself and was moved to its [own repository](https://codeberg.org/forgejo-contrib/forgejo-ci-woodpecker).
- **[Templates](https://forgejo.org/docs/v1.20/user/issue-pull-request-templates/)**
- [Configuration for the issue templates](https://codeberg.org/forgejo/forgejo/commit/f384b13f1cd44be3a87df5553a0099390dacd010). [Read more about issue config](https://forgejo.org/docs/v1.20/user/issue-pull-request-templates/#syntax-for-issue-config) in the documentation.
- [Add validations.required check to the dropdown field](https://codeberg.org/forgejo/forgejo/commit/5c0745c0349f0709d0fc36fd8a97dcab86bce28a)
- [Issue template support markdown edition](https://codeberg.org/forgejo/forgejo/commit/c4303efc23ea19f16ee826809f43888ee4583ebb)
- [Use a general Eval function for expressions in templates](https://codeberg.org/forgejo/forgejo/commit/5b89670a318e52e271f65d96bfe1116d85d20988)
- [reload-templates CLI](https://codeberg.org/forgejo/forgejo/commit/3588edbb08f93aaa56defa82dffdbb202cd9aa4a)
- **User Interface and User eXperience**
- The web editor used when creating issues, adding comments, etc. [changed](https://codeberg.org/forgejo/forgejo/commit/5cc0801de90d16b4d528e62de11c9b525be5d122) from [EasyMDE](https://github.com/Ionaru/easy-markdown-editor) which was no longer actively maintained to [GitHub markdown](https://github.com/github/markdown-toolbar-element). To help with the transition it is still possible to switch back to using EasyMDE using the double arrow button in the menubar.
- [Improve wiki sidebar and TOC](https://codeberg.org/forgejo/forgejo/commit/51789ba12)
- [Show outdated comments in the files changed tab of a pull request review](https://codeberg.org/forgejo/forgejo/commit/30a783879)
- [Redirect to package after version deletion](https://codeberg.org/forgejo/forgejo/commit/c27a3af72)
- Use a [separate admin page to show stats](https://codeberg.org/forgejo/forgejo/commit/520eb57d7642a5fca3df319e5b5d1c7c9018087c)
- [Improve avatar compression and resizing](https://codeberg.org/forgejo/forgejo/commit/82224c54e0488738dbd3b7eccf56ab08b6790627)
- [Add button to compare force pushed commits in pull requests](https://codeberg.org/forgejo/forgejo/commit/545495dcb0a4cb9d820132dde4f1127f7fe91aa4)
- [When creating a new file in a repository via the web user interface allow for a path to be pasted](https://codeberg.org/forgejo/forgejo/commit/7f9d58fab8a3c4fd1a8f18d58e36fbfab7b30f33)
- [Allows "video" HTML tag to be used in MarkDown, with the src, autoplay, and controls attributes](https://codeberg.org/forgejo/forgejo/commit/de6c718b46ebd3b7f6362c766eed328044d95ec7)
- [Add "Reviewed by you" filter for pull requests](https://codeberg.org/forgejo/forgejo/commit/10cdcb9ea8077098921d72720f9f36fcfd950452)
- [Make Ctrl+Enter submit a pending comment (starting review) instead of submitting a single comment](https://codeberg.org/forgejo/forgejo/commit/188c8c12c290e131fb342e3203634828652b0af5)
- If an instance chooses to disable new pull or push mirrors or mirrors entirely, an appropriate message will [now be shown to the user in the Repository Settings](https://codeberg.org/forgejo/forgejo/commit/35ce7ca25b5756441949312d79aa6382f98ce8d6)
- [Change `Close` to either `Close issue` or `Close pull request`](https://codeberg.org/forgejo/forgejo/commit/39d3711f3036db42d7ddf73dbdb125be611bcbba)
- [Make Issue/PR/projects more compact](https://codeberg.org/forgejo/forgejo/commit/4a722c9a45659e7732258397bbb3dd1039ea1952)
- [Improve RSS user interface](https://codeberg.org/forgejo/forgejo/commit/59d060622d375c4123ea88e2fa6c4f34d4fea4d3)
- [Add details summary for vertical menus in settings to allow toggling](https://codeberg.org/forgejo/forgejo/commit/58536093b3112841bc69edb542189893b57e7a47)
- [Show visibility status of email in own profile](https://codeberg.org/forgejo/forgejo/commit/5e1bd8af5f16f9db88cfeb5b80bdf731435cacfb)
- [Improve the protected branch setting page](https://codeberg.org/forgejo/forgejo/commit/72e956b79a3b2e055bb5d4d5e20e88eaa2eeec96)
- [Improve the display of the pull request branch delete button](https://codeberg.org/forgejo/forgejo/commit/774d1a0fbdadd1136b6af895f8d449b0c8db54cb)
- [Fix the color for repository transfer related buttons when having no permission to act](https://codeberg.org/forgejo/forgejo/commit/7abe958f5b507efa676fb3b2e27d30517f6d1908)
- [Add a progressbar to Milestone Page](https://codeberg.org/forgejo/forgejo/commit/7d192cb674bc475b123c84b205aca821247c5dd1)
- [Nicer display when the list of notifications is empty](https://codeberg.org/forgejo/forgejo/commit/8251b317f7b7a2b5f626a02fa3bb540a1495e81d)
- [Rename board to column in projects](https://codeberg.org/forgejo/forgejo/commit/843f81113ebe71fd725210c5a382268333865cc7)
- [Improve header bar on issue, pull requests and milestone](https://codeberg.org/forgejo/forgejo/commit/8f4dafcd4e6b0b5d307c3e060ffe908c2a96f047)
- [Add organization visibility label when displayed on the dashboard](https://codeberg.org/forgejo/forgejo/commit/97b70a0cd40e8f73cdf6ba4397087b45061de3d8)
- [Unification of registration fields order](https://codeberg.org/forgejo/forgejo/commit/b9fad73e9fcf40e81cde3304198105af6c668421)
- [Append `(comment)` when a link points at a comment rather than the whole issue](https://codeberg.org/forgejo/forgejo/commit/ca905b82df7f1d2a823d8df4448d485e5902876d)
- [Add visibility (private, limited) in the dashboard navbar](https://codeberg.org/forgejo/forgejo/commit/d949d8e074407a96dbcfa98a71ccd80527b5ad78)
- [Show all activities in the dashboard, not just the most recent ones](https://codeberg.org/forgejo/forgejo/commit/f4920c9c7f5947d3b6476610f39bc3492ab4ef3b)
- [Do not display the stars in the repository list of the dashboard](https://codeberg.org/forgejo/forgejo/commit/06c067bb0f9eeb8873ddc298819b30fc5913943f)
- [Improve the display of tags to include the tag message](https://codeberg.org/forgejo/forgejo/commit/b78c955958301dde72d8caf189531f6e53c496b4)
- [Hide the target selector if a tag exists when creating a new release](https://codeberg.org/forgejo/forgejo/commit/3de9e63fd04d61e08fcbdec035c9f138347d9f37)
- [Show the calculated commit status state of the latest commit on the default branch for each repository in the dashboard repository list](https://codeberg.org/forgejo/forgejo/commit/4810fe55e3e73edb962052df46bef125eb1817b3)
- [Sort users and orgs on the explore page by recency](https://codeberg.org/forgejo/forgejo/commit/4daf40505a5f89747982ddd2f1df2a4001720846)
- [Show the number of repositories in the user or organization profile](https://codeberg.org/forgejo/forgejo/commit/52b17bfa07fea29441cd961da4edaf1ea97fe348)
- [Review management (requesting again and discard) now happens at the top of the pull request](https://codeberg.org/forgejo/forgejo/commit/a70d853d064a97f0be1d3702a9c3912494b546ec)
- [Add markdown preview when submitting a review](https://codeberg.org/forgejo/forgejo/commit/b5c26fa825e08122843ad6d27191d399a9af1c37)
- [Support no label/assignee filter and batch clearing labels/assignees](https://codeberg.org/forgejo/forgejo/commit/b807d2f6205bf1ba60d3a543e8e1a16f7be956df)
- [Display when a repo was archived](https://codeberg.org/forgejo/forgejo/commit/c41bc4f1279c9e1e6e11d7b5fcfe7ef089fc7577)
- [Improve squash merge commit author and co-author with private emails](https://codeberg.org/forgejo/forgejo/commit/d647e74502fdf734c89b3e6592a9ad88c3005971)
- [Allow adding new files to an empty repo](https://codeberg.org/forgejo/forgejo/commit/e422342eebc18034ef586ec58f1e2fff0340091d)
- [Move `Rename branch` from repo settings page to the page of branches list](https://codeberg.org/forgejo/forgejo/commit/e8173c2c33f1dd5b0a2c044255434d414cab62d2)
- [Add "Updated" column for admin repositories list](https://codeberg.org/forgejo/forgejo/commit/94d6b5b09d49b2622c2164a03cfae45dced96c74)
- [Hide the merge box of a pull request if it is merged and the branch was deleted](https://codeberg.org/forgejo/forgejo/commit/e9b39250b285f1b9cbf9739f33c06fc57401f314)
- [The repository migration can be canceled](https://codeberg.org/forgejo/forgejo/commit/f6e029e6c7849d4361abf7f1d749b5d528364ac4)
- [Add button on the diff header to copy the file name](https://codeberg.org/forgejo/forgejo/commit/c5ede35124c8d5280219c24049bb0ad7da9f02ed)
- [Add --quiet option to the dump CLI](https://codeberg.org/forgejo/forgejo/commit/cb1536471bcef4d78a3fe5cbd738b9f60fabbcc2)
- [Support searching for an issue with its number in the the list of issues](https://codeberg.org/forgejo/forgejo/commit/1144b1d129de530b2c07dfdfaf55de383cd82212)
- [Improve the list of notifications](https://codeberg.org/forgejo/forgejo/commit/f7ede92f82f7f3ec7bb31a1249f9524e5b728f34)
- [When editing a file in the web UI, allow for a preview whenever possible](https://codeberg.org/forgejo/forgejo/commit/ac64c8297444ade63a2a364c4afb7e6c1de5a75f)
- [Make release download URLs human readable](https://codeberg.org/forgejo/forgejo/commit/42919ccb7cd32ab67d0878baf2bac6cd007899a8)
- [Add a tooltip to `Publish Review` explaining why they are disabled](https://codeberg.org/forgejo/forgejo/commit/a8c30a45fa49a3a551b1dca882960008c254bb3d)
- [Show the file tree view by default when browsing the changes in a pull request](https://codeberg.org/forgejo/forgejo/commit/72eedfb91584720da774909d3f078b7d515c9fdd)
- [Allow both fullname search in the author dropdown search of the issue list when `DEFAULT_SHOW_FULL_NAME` is true](https://codeberg.org/forgejo/forgejo/commit/661e78bed5c0879c32c53eb60f3d6898b93e1f08)
- **Performance**
- [Improve performances when listing issues](https://codeberg.org/forgejo/forgejo/commit/9bbb4d8d6)
- [Speedup loading the list of authors in the dropdown of the list of issues](https://codeberg.org/forgejo/forgejo/commit/6eb678374b583079a0a08b7ed0c9ca220c0c0434)
- [Use minio/sha256-simd for accelerated SHA256](https://codeberg.org/forgejo/forgejo/commit/1319ba6742a8562453646763adad22379674bab5)
- [Speed up HasUserStopwatch & GetActiveStopwatch](https://codeberg.org/forgejo/forgejo/commit/ef4fc302468cc8a9fd8f65c4ebdc6f55138450d1)
- [Do not create commit graph for temporary repos](https://codeberg.org/forgejo/forgejo/commit/0268ee5c37b8ad733678f02bc15ec8642da62c10)
- [Faster git.GetDivergingCommits](https://codeberg.org/forgejo/forgejo/commit/75ea0d5dba5dbf2f84cef2d12460fdd566d43e62)
- [Order pull request conflict checking by recently updated, for each push](https://codeberg.org/forgejo/forgejo/commit/df48af22296ccce8e9bd18e5d35c9a3cdf5acb0f)
- [MySQL integration tests](https://codeberg.org/forgejo/forgejo/commit/49f68518c2a2bd36ca0106045bd84de01dec4b61) run twice faster low end machines and use an order of magnitude less disk I/O
- **Authentication**
- [Add ntlm authentication support for mail](https://codeberg.org/forgejo/forgejo/commit/8be6da3e2fd0b685aeb6b9e7fd9dee5a4571163a)
- [LDAP filters include both username and email address](https://codeberg.org/forgejo/forgejo/commit/b8c19e7a11525da4174b6f80f87ff3e844d03d8a)
- [Allow for PKCE flow without client secret](https://codeberg.org/forgejo/forgejo/commit/7d855efb1fe6b97c5d87492f67ed6aefd31b2474)
- [Add the ability to set multiple redirect URIs in the OAuth application UI](https://codeberg.org/forgejo/forgejo/commit/ca35dec18b3d3d7dd5cde4c69a10ae830961faf7)
- **Refactor:**
Many essential sub-systems were refactored: the [queue system](https://codeberg.org/forgejo/forgejo/commit/6f9c278559789066aa831c1df25b0d866103d02d) that handles background tasks such as checking pull requests, [pull mirror](https://codeberg.org/forgejo/forgejo/commit/99283415bcbaa8acfe4d249ce3040de2f3a8b006), [git internal API](https://codeberg.org/forgejo/forgejo/commit/f4538791f5fc82b173608fcf9c30e36ec01dc9d3), [routes](https://codeberg.org/forgejo/forgejo/commit/92fd3fc4fd369b6a8c0a022a32a80dec2340223a) and [web routes](https://codeberg.org/forgejo/forgejo/commit/b9a97ccd0ea1ee44db85b0fbb80b75255af7c742), [merge & update logic](https://codeberg.org/forgejo/forgejo/commit/8598356df1eb21b6e33ecb9f9268ba36c5488e7c) and [git command calls](https://codeberg.org/forgejo/forgejo/commit/542cec98f8c07e0f046a35f1d516807416536e74), [listing commits](https://codeberg.org/forgejo/forgejo/commit/ec261b63e14f84da3e2d9a6e27c8b831a7750677), [cookie](https://codeberg.org/forgejo/forgejo/commit/5b9557aef59b190c55de9ea218bf51152bc04786), [issue stats](https://codeberg.org/forgejo/forgejo/commit/38cf43d0606c13c38f459659f38e26cf31dceccb), [renaming users and organizations](https://codeberg.org/forgejo/forgejo/commit/c59a057297c782f44a81a3e630b5094a58099edb), [app.ini handling](https://codeberg.org/forgejo/forgejo/commit/de4a21fcb4476772c69c36d086549e89ed4dcf6c), [diffFileInfo / DiffTreeStore](https://codeberg.org/forgejo/forgejo/commit/ee99cf6313ba565523b3c43f61ffda4b71e2c39b).... In theory these changes are transparent to the Forgejo user and admin but the risk of subtle regressions is real: do not hesitate to [reach out](https://codeberg.org/forgejo/forgejo/issues) if you suspect anything.
- **RSS**
- [Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS](https://codeberg.org/forgejo/forgejo/commit/88033438aa8214569913899a17b19b57bd609d97)
- [Add RSS Feeds for branches and files](https://codeberg.org/forgejo/forgejo/commit/56d4893b2a996da6388801c9c8ff16b9b588ad55)
- **API**
- [Add admin API for email](https://codeberg.org/forgejo/forgejo/commit/d56bb7420184c0c2f451f4bcaa96c9b3b00c393d)
- [Add admin API to rename a user](https://codeberg.org/forgejo/forgejo/commit/03591f0f95823a0b1dcca969d2a3ed505c7e6d73)
- [Add login name and source id to admin user searching API](https://codeberg.org/forgejo/forgejo/commit/6f9cc617fcc42477dec5ccab83d06f0a96544403)
- [Add missing units to create and edit repo API](https://codeberg.org/forgejo/forgejo/commit/574d8fe6d6675c8aa05e2b75fdbc01c009efd8be)
- [Add API to manage issue dependencies](https://codeberg.org/forgejo/forgejo/commit/3cab9c6b0c050bfcb9f2f067e7dc1b0242875254)
- [Add API for activity feeds](https://codeberg.org/forgejo/forgejo/commit/6b0df6d8da76d77a9b5c42dcfa78dbfe197fd56d)
- [Add API for license templates](https://codeberg.org/forgejo/forgejo/commit/fb37eefa282543fd8ce63c361cd4cf0dfac9943c)
- [Add API for gitignore templates](https://codeberg.org/forgejo/forgejo/commit/36a5d4c2f3b5670e5e921034cd5d25817534a6d4)
- [Add API to upuload a file to an empty repository](https://codeberg.org/forgejo/forgejo/commit/cf465b472166ccf6d3e001e3043e4bf43e16e6b3)
- [Allow for --not when listing the commits of a repo](https://codeberg.org/forgejo/forgejo/commit/f766b002938b5c81e343c81fda3c0669fa09809f)
- [Add `files` and `verification` parameters to improve performances when listing the commits of a a repo](https://codeberg.org/forgejo/forgejo/commit/1dd83dbb917d55bd253001646d6743f247a4d98b)
- [Allow for listing a single commit in a repository](https://codeberg.org/forgejo/forgejo/commit/5930ab5fdf7a970fcca3cd50b44cf1cacb615a54)
- [Create a branch directly from commit on the create branch API](https://codeberg.org/forgejo/forgejo/commit/cd9a13ebb47d32f46b38439a524e3b2e0c619490)
- [Add API for Label templates](https://codeberg.org/forgejo/forgejo/commit/25dc1556cd70b567a4920beb002a0addfbfd6ef2)
- [Add API for changing/creating/deleting multiple files](https://codeberg.org/forgejo/forgejo/commit/275d4b7e3f4595206e5c4b1657d4f6d6969d9ce2)
- **Miscellaneous Features**
- [Any URL scheme may be used for links](https://codeberg.org/forgejo/forgejo/commit/f5ce2ed292a90041abd749a8db26671645648a43). Previously, non-standard URLs (like matrix:) were not rendered unless explicitly listed in `markdown.CUSTOM_URL_SCHEMES`. Now the default if `markdown.CUSTOM_URL_SCHEMES` is not set, all schemes are allowed and markdown links ([label](URL)) render as links.
- [Always use "utf8mb4" for MySQL](https://codeberg.org/forgejo/forgejo/commit/cb3173a1e)
- [Add Adopt repository event and handler](https://codeberg.org/forgejo/forgejo/commit/9d69a4758)
- Add [meilisearch](https://www.meilisearch.com/) support to [index the content of repositories](https://codeberg.org/forgejo/forgejo/commit/92c160d8e716cb3d05215a97cf521e843596f562).
- [Add support](https://codeberg.org/forgejo/forgejo/commit/985f76dc4b0692c4d6c6f37e82500ef859557c16) for [redis v7](https://raw.githubusercontent.com/redis/redis/7.0/00-RELEASENOTES)
- Allow [webp](https://en.wikipedia.org/wiki/WebP) images [as avatars](https://codeberg.org/forgejo/forgejo/commit/65fe0fb22cfb264f0b756065d0c3ce7a17d7e55b)
- [Add support](https://codeberg.org/forgejo/forgejo/commit/58caf422e67c78f87327bc9b00f89083a2432940) for rendering [.livemd](https://livebook.dev/)
- The `forgejo forgejo-cli actions` [subcommand is added](https://codeberg.org/forgejo/forgejo/commit/d6efefbb63d59ba0251c10b6031f6b630b184eaf) to implement [offline registration with `actions register`](https://forgejo.org/docs/v1.20/admin/actions/#offline-registration) for the [Forgejo runner](https://code.forgejo.org/forgejo/runner).
- When [called as `forgejo-cli`](https://codeberg.org/forgejo/forgejo/commit/935fb85e8b2a5f6a9c9c6c0b78a234abc14df4fe) (with `ln -f forgejo forgejo-cli`), Forgejo provides a new CLI that is not backward compatible with Gitea. It contains Forgejo specific additions such as [offline registration](https://forgejo.org/docs/v1.20/admin/actions/#offline-registration)
- [Render list items](https://codeberg.org/forgejo/forgejo/commit/e1829f0728509c4c1b7810fe9f6df1aebb71b4c0) when an [org-mode](https://orgmode.org/) file is displayed
- [A user can follow an organization](https://codeberg.org/forgejo/forgejo/commit/cc64a925602d54f3439dd19f16b5280bd0377a7a)
- [When playing a video in the web UI, the player control can be dragged to play on the specified position](https://codeberg.org/forgejo/forgejo/commit/023a048f52b5bf8c4b715285245a129f04e05a8c)
- The commit status required for a pull request to be merged can now be [specified as patterns](https://codeberg.org/forgejo/forgejo/commit/e7c2231dee356df5cbe5a47c07e31e3a8d090a6f) instead of being a hard coded list
- [Support wildcard in email domain allow and block lists](https://codeberg.org/forgejo/forgejo/commit/2cb66fff60c95efbd58b797f1197f2421f4687ce). [Read more about EMAIL_DOMAIN_ALLOWLIST and EMAIL_DOMAIN_BLOCKLIST](https://forgejo.org/docs/v1.20/admin/config-cheat-sheet/).
- When [installing with docker](https://forgejo.org/docs/v1.20/admin/installation/#installation-with-docker) the value of a configuration variable can now be fetched from a file by [adding the `__FILE` suffix](https://codeberg.org/forgejo/forgejo/commit/c21605951b581440bb08b65d5907b1cd4e0ab6c5). For instance `FORGEJO__security__INTERNAL_TOKEN__FILE=/etc/forgejo/token` can be used instead of `FORGEJO__security__INTERNAL_TOKEN=tokenvalue`.
- The [new `[git.config]` section of `app.ini`](https://codeberg.org/forgejo/forgejo/commit/8080ace6fcf73a5fbe4a0dd71881228abd0c68b9) is used to `git set config`. [Read more about the defaults it contains](https://forgejo.org/docs/v1.20/admin/config-cheat-sheet/#git---config-options-gitconfig).
- [Issues and pull requests can be pinned](https://codeberg.org/forgejo/forgejo/commit/aaa109466350c531b9238a61115b2877daca57d3). They will show on top of the list of issues (or pull requests) and can be re-arranged by dragging them.
- [Implement systemd-notify protocol](https://codeberg.org/forgejo/forgejo/commit/7565e5c3de051400a9e3703f707049cbb9054cf3) and allows for using `Type=notify` in service files.
- [Provide more control over the repositories that are indexed](https://codeberg.org/forgejo/forgejo/commit/033d92997fc16baee097d2b25f08e0984e628abd). [Read more about REPO_INDEXER_REPO_TYPES](https://forgejo.org/docs/v1.20/admin/config-cheat-sheet/).
- **Webhook**
- Similar to organization wide webhooks, it is now possible to have [user wide webhooks](https://codeberg.org/forgejo/forgejo/commit/2173f14708ff3b35d7821fc9b6dcb5fcd06b8494)
- [Add webhook trigger when a Pull Request review requests is created](https://codeberg.org/forgejo/forgejo/commit/309354c70ee994a1e8f261d7bc24e7473e601d02)
- [Forgejo Semantic Version](https://forgejo.org/docs/v1.20/user/semver/)
The semantic version was updated to `5.0.0+0-gitea-1.20.0` because it contains breaking changes.
- [CI]
- Workflows are now [available to run tests](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/.forgejo/workflows) on `Forgejo` itself. It is not enabled yet on Codeberg but will work if the repository is mirrored on an instance where [Forgejo Actions](https://forgejo.org/docs/v1.20/user/actions/) is enabled.
- [MODERATION]
- Blocking another user is desirable if they are acting maliciously or are spamming your repository. When you block a user, Forgejo does not explicitly notify them, but they may learn through an interaction with you that is blocked. [Read more about blocking users](https://forgejo.org/docs/v1.20/user/blocking-user/).
- [PACKAGES]
- [PACKAGES SWIFT] commit c709fa17a77eae391cafbe72d6b2594f74d86a60 Add Swift package registry [22404](https://github.com/go-gitea/gitea/pull/22404)
- [PACKAGE debian] commit bf999e406994ab34420fb62e0de7948c8c2116c1 Add Debian package registry [24426](https://github.com/go-gitea/gitea/pull/24426)
- [PACKAGES RPM] commit 05209f0d1d4b996b8beb6633880b8fe12c15932b Add RPM registry [23380](https://github.com/go-gitea/gitea/pull/23380)
- [PACKAGE alpine] commit 9173e079ae9ddf18685216fd846ca1727297393c Add Alpine package registry [23714](https://github.com/go-gitea/gitea/pull/23714)
- [PACKAGE go] commit 5968c63a11c94b0fdde0485af194bebb2ea1b8e7 Add Go package registry [24687](https://github.com/go-gitea/gitea/pull/24687)
- [PACKAGES CRAN] commit cdb088cec288a20e14240f86a689dd14f4cd603b Add CRAN package registry [22331](https://github.com/go-gitea/gitea/pull/22331)
- [PACKAGES cargo]] commit 723598b803919bfc074fee05f830421a99881c3b Implement Cargo HTTP index [24452](https://github.com/go-gitea/gitea/pull/24452)
- [A11Y]
- [A11Y] commit 6c354546547cd3a9595a7db119a6480d9cd506a7 Improve accessibility for issue comments [22612](https://github.com/go-gitea/gitea/pull/22612)
- [A11Y] commit a78e0b7dade16bc6509b943fe86e74962f1b95b6 Add accessibility to the menu on the navbar [23059](https://github.com/go-gitea/gitea/pull/23059)
- [A11Y] commit e8935606f5f1fff3c59222ebca6d4615ab06fb0b Scoped labels: set aria-disabled on muted Exclusive option for a11y [23306](https://github.com/go-gitea/gitea/pull/23306)
- [A11Y] commit d4f35bd681af0632da988e15306f330e020422b2 Use a general approch to improve a11y for all checkboxes and dropdowns. [23542](https://github.com/go-gitea/gitea/pull/23542)
- [A11Y RTL] commit 32d9c47ec7706d8f06e09b42e09a28d7a0e3c526 Add RTL rendering support to Markdown [24816](https://github.com/go-gitea/gitea/pull/24816)
- [A11Y] commit e95b42e187cde9ac4bd541cd714bdb4f5c1fd8bc Improve accessibility when (re-)viewing files [24817](https://github.com/go-gitea/gitea/pull/24817)
- [A11Y] commit 87f0f7e670c6c0e6aeab8c4458bfdb9d954eacec Add aria attributes to interactive time tooltips. [23661](https://github.com/go-gitea/gitea/pull/23661)
- [TIME]
- [TIME] commit b7b58348317cbe0145dc453d45c886b8e2764b4c Use auto-updating, natively hoverable, localized time elements [23988](https://github.com/go-gitea/gitea/pull/23988)
- [TIME] commit 25faee3c5f5be23c99b3b7e50418fc0dbad7a41b Fix date display bug [24047](https://github.com/go-gitea/gitea/pull/24047)
- [TIME] commit 97176754beb4de23fa0f68df715c4737919c93b0 Localize milestone related time strings [24051](https://github.com/go-gitea/gitea/pull/24051)
- [TIME] commit 70bb4984cdad9a15d676708bd345b590aa42d72a Allow using localized absolute date times within phrases with place holders and localize issue due date events [24275](https://github.com/go-gitea/gitea/pull/24275)
- [TIME] commit 5bc9f7fcf9aece92c3fa2a0ea56e5585261a7f28 Improve commit date in commit graph [24399](https://github.com/go-gitea/gitea/pull/24399)
- [TIME] commit 62ca5825f73ad5a25ffeb6c3ef66f0eaf5d30cdf Fix incorrect last online time in runner_edit.tmpl [24376](https://github.com/go-gitea/gitea/pull/24376)
- [TIME] commit dbb37367854d108ebfffcac27837c0afac199a8e Fix incorrect webhook time and use relative-time to display it [24477](https://github.com/go-gitea/gitea/pull/24477)
- [TIME] commit 3d266dd0f3dbae7e417c0e790e266aebc0078814 In TestViewRepo2, convert computed timezones to local time [24579](https://github.com/go-gitea/gitea/pull/24579)
- [WIKI]
- [WIKI] commit c0246677a692de804ffe1bb5f7d630fb002dd128 Fix markup background, improve wiki rendering [23750](https://github.com/go-gitea/gitea/pull/23750)
- [WIKI] commit 2f468381205f5f7e279791aa71e5288710a6476c Re-add initial wiki page text when editing the page [23984](https://github.com/go-gitea/gitea/pull/23984)
- [WIKI] commit 1ab16e48cccc086e7f97fb3ae8a293fe47a3a452 Improve Wiki TOC [24137](https://github.com/go-gitea/gitea/pull/24137)
- [WIKI] commit 284b41f45244bbe46fc8feee15bbfdf66d150e79 Fix bug when deleting wiki with no code write permission [24274](https://github.com/go-gitea/gitea/pull/24274)
- [WIKI] commit d347208114966166ffa9655adc5b202676546c31 Improve External Wiki in Repo Header [24304](https://github.com/go-gitea/gitea/pull/24304)
- [WIKI] commit db582d97ef6cd7d9f73a63c99639f6d00f40dc5a Improve wiki user title test [24559](https://github.com/go-gitea/gitea/pull/24559)
- [WIKI] commit 60e7963141681895dcc81da944192c4292c6a20a Fix inconsistent wiki path converting. [24277](https://github.com/go-gitea/gitea/pull/24277)
- [WIKI] commit b39a5bbbd610ba30651218658caaec1c86d6bca1 Make wiki title supports dashes and improve wiki name related features [24143](https://github.com/go-gitea/gitea/pull/24143)
- [UI / UX]
- [BREAKING UX preview render] commit 84daddc2fa74393cdc13371b0cc44f0444cfdae0 Editor preview support for external renderers [23333](https://github.com/go-gitea/gitea/pull/23333)
- [BREAKING branding] commit d44e1565dadd09b4cdbb924479bf6e59a4d3c403 Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270)
- [BREAKING theme tags] commit c7612d178c5b954d4846cd27a65a7fa15fd1ba65 Remove meta tags `theme-color` and `default-theme` [24960](https://github.com/go-gitea/gitea/pull/24960)
- [BREAKING UI] commit 520eb57d7642a5fca3df319e5b5d1c7c9018087c Use a separate admin page to show global stats, remove `actions` stat [25062](https://github.com/go-gitea/gitea/pull/25062)
- [UI] commit 6e90a1459b980f68a0f43c60c04fbb857e6a105b Add word-break to sidebar-item-link [23146](https://github.com/go-gitea/gitea/pull/23146)
- [UI] commit 303b72c2d12bba44dc3def5fb3dfc1e5418a83ab Fix Fomantic UI's `touchstart` fastclick, always use `click` for click events [23065](https://github.com/go-gitea/gitea/pull/23065)
- [UI] commit 10cdcb9ea8077098921d72720f9f36fcfd950452 Add "Reviewed by you" filter for pull requests [22927](https://github.com/go-gitea/gitea/pull/22927)
- [UI] commit 843f81113ebe71fd725210c5a382268333865cc7 Projects: rename Board to Column in interface and improve consistency [22767](https://github.com/go-gitea/gitea/pull/22767)
- [UI] commit f4920c9c7f5947d3b6476610f39bc3492ab4ef3b Add pagination for dashboard and user activity feeds [22937](https://github.com/go-gitea/gitea/pull/22937)
- [UI] commit d20b29d7cea0fcba5e423dcfb7bbb7d2c15959d6 Fix height for sticky head on large screen on PR page [23111](https://github.com/go-gitea/gitea/pull/23111)
- [ACTIONS] commit edf98a2dc30956c8e04b778bb7f1ce55c14ba963 Require approval to run actions for fork pull request [22803](https://github.com/go-gitea/gitea/pull/22803)
- [UI] commit 0bc8bb3cc4f003e70bfee75863b74c2243c6d23c Make issue meta dropdown support Enter, confirm before reloading [23014](https://github.com/go-gitea/gitea/pull/23014)
- [UI] commit 403f3e9208b2d2564d67bdf87be758c487083e28 Use the correct selector to hide the checkmark of selected labels on clear [23224](https://github.com/go-gitea/gitea/pull/23224)
- [UI] commit 7a5af25592003ddc3017fcd7b822a3e02fc40ef6 Fix incorrect checkbox behaviors in the dashboard repolist's filter [23147](https://github.com/go-gitea/gitea/pull/23147)
- [UI] commit 188c8c12c290e131fb342e3203634828652b0af5 Make Ctrl+Enter submit a pending comment (starting review) instead of submitting a single comment [23245](https://github.com/go-gitea/gitea/pull/23245)
- [UI BIG] commit 7f9d58fab8a3c4fd1a8f18d58e36fbfab7b30f33 Support paste treepath when creating a new file or updating the file name [23209](https://github.com/go-gitea/gitea/pull/23209)
- [UI] commit ea1d09718ce2e3bf043c60bae76dd6bd7e84e9fe Fix commit retrieval by tag [21804](https://github.com/go-gitea/gitea/pull/21804)
- [UI] commit 0945bf63d3e0784c06a9d85504d42458b091d6b8 Fix missed `.hide` class [23208](https://github.com/go-gitea/gitea/pull/23208)
- [UI BIG] commit de6c718b46ebd3b7f6362c766eed328044d95ec7 Allow `<video>` in MarkDown [22892](https://github.com/go-gitea/gitea/pull/22892)
- [UI BIG] commit 545495dcb0a4cb9d820132dde4f1127f7fe91aa4 Pull Requests: add button to compare force pushed commits [22857](https://github.com/go-gitea/gitea/pull/22857)
- [UI] commit ea7f0d6fcfe9567cac8151536b36450de8645e88 Change interactiveBorder to fix popup preview [23169](https://github.com/go-gitea/gitea/pull/23169)
- [UI] commit d949d8e074407a96dbcfa98a71ccd80527b5ad78 add user visibility in dashboard navbar [22747](https://github.com/go-gitea/gitea/pull/22747)
- [UX] commit dad057b6393548ad389ead07c2cce5b3ac2811e0 Handle OpenID discovery URL errors a little nicer when creating/editing sources [23397](https://github.com/go-gitea/gitea/pull/23397)
- [UX] commit d647e74502fdf734c89b3e6592a9ad88c3005971 Improve squash merge commit author and co-author with private emails [22977](https://github.com/go-gitea/gitea/pull/22977)
- [UI] commit 17c8a0523a9f1bf717046823d4c0f69d606fe90a Fix and move "Use this template" button [23398](https://github.com/go-gitea/gitea/pull/23398)
- [UI] commit a04eeb2a548d4fd2b63873fc2acff49c52e19723 Show edit/close/delete button on organization wide repositories [23388](https://github.com/go-gitea/gitea/pull/23388)
- [UI] commit e72290fd9aeb77a47311483d1d565e428ce40cd9 Sync the class change of Edit Column Button to JS code [23400](https://github.com/go-gitea/gitea/pull/23400)
- [UI] commit 75022f8b1a513ca2fd7ca66a2f05ecc49e2f1460 Refactor branch/tag selector dropdown (first step) [23394](https://github.com/go-gitea/gitea/pull/23394)
- [UX] commit 3de9e63fd04d61e08fcbdec035c9f138347d9f37 Hide target selector if tag exists when creating new release [23171](https://github.com/go-gitea/gitea/pull/23171)
- [UI] commit cf29ee6dd290525635a0e1b823506e81f845b978 Add missing tabs to org projects page [22705](https://github.com/go-gitea/gitea/pull/22705)
- [UI] commit bf730528cadc4727eab8844934b6a0716d327243 Fix 'View File' button in code search [23478](https://github.com/go-gitea/gitea/pull/23478)
- [UI] commit aac07d010f261c00fb3bd9644c71dc108c668c11 Add workflow error notification in ui [23404](https://github.com/go-gitea/gitea/pull/23404)
- [UI] commit 6ff5400af91aefb02cbc7dd59f6be23cc2bf7865 Make branches list page operations remember current page [23420](https://github.com/go-gitea/gitea/pull/23420)
- [UI] commit e82f1b15c7120ad13fd3b67cf7e2c6cb9915c22d Refactor dashboard repo list to Vue SFC [23405](https://github.com/go-gitea/gitea/pull/23405)
- [UI] commit 81fe5d61851c0e586af7d32c29171ceff9a571bb Convert `<div class="button">` to `<button class="button">` [23337](https://github.com/go-gitea/gitea/pull/23337)
- [UX] commit 5eea61dbc8f8e82e0dd05addf76751ee517459a0 Fix missing commit status in PR which from forked repo [23351](https://github.com/go-gitea/gitea/pull/23351)
- [UX UI search] commit 661e78bed5c0879c32c53eb60f3d6898b93e1f08 Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true [23463](https://github.com/go-gitea/gitea/pull/23463)
- [UI] commit 39d3711f3036db42d7ddf73dbdb125be611bcbba Change `Close` to either `Close issue` or `Close pull request` [23506](https://github.com/go-gitea/gitea/pull/23506)
- [UX review] commit a8c30a45fa49a3a551b1dca882960008c254bb3d `Publish Review` buttons should indicate why they are disabled [23598](https://github.com/go-gitea/gitea/pull/23598)
- [UI] commit 529bac1950adf4fb72433cb67f66b0eec49224fe Polyfill the window.customElements [23592](https://github.com/go-gitea/gitea/pull/23592)
- [UI GPG] commit 12ddc48c5c02123b1e6dab9d2d38b03f027d196e Use octicon-verified for gpg signatures [23529](https://github.com/go-gitea/gitea/pull/23529)
- [UI stars] commit 06c067bb0f9eeb8873ddc298819b30fc5913943f Remove stars in dashboard repo list [23530](https://github.com/go-gitea/gitea/pull/23530)
- [UI] commit 272cf6a2a976d4e22cccdaea720f48861d9b200e Make time tooltips interactive [23526](https://github.com/go-gitea/gitea/pull/23526)
- [UI] commit 389e83f7eb68c43f6f0313b20acde547aef12442 Improve `<SvgIcon>` to make it output `svg` node and optimize performance [23570](https://github.com/go-gitea/gitea/pull/23570)
- [UX issue config] commit f384b13f1cd44be3a87df5553a0099390dacd010 Implement Issue Config [20956](https://github.com/go-gitea/gitea/pull/20956)
- [UI] commit 2c585d62a4ebbb52175b8fd8697458ae1c3b2937 User/Org Feed render description as per web [23887](https://github.com/go-gitea/gitea/pull/23887)
- [UI TAGS] commit b78c955958301dde72d8caf189531f6e53c496b4 Fix tags view [23243](https://github.com/go-gitea/gitea/pull/23243)
- [UI] commit 9cefb7be737c6564668d95d8a43b4425e9a03d13 Fix new issue/pull request btn margin when it is next to sort [23647](https://github.com/go-gitea/gitea/pull/23647)
- [UX preview] commit ac64c8297444ade63a2a364c4afb7e6c1de5a75f Allow new file and edit file preview if it has editable extension [23624](https://github.com/go-gitea/gitea/pull/23624)
- [UI] commit ca905b82df7f1d2a823d8df4448d485e5902876d Append `(comment)` when a link points at a comment rather than the whole issue [23734](https://github.com/go-gitea/gitea/pull/23734)
- [UX diff] commit aa4d1d94f79e8edd9fa9ff2813fea12b085b2cae Diff improvements [23553](https://github.com/go-gitea/gitea/pull/23553)
- [UX ONLY_SHOW_RELEVANT_REPOS] commit e57e1144c5ae7a2995e6818c6ae32139e563add7 Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict [23766](https://github.com/go-gitea/gitea/pull/23766)
- commit ed5e7d03c6c44666c6fe97a15e8ce33d223c4466 Don't apply the group filter when listing LDAP group membership if it is empty [23745](https://github.com/go-gitea/gitea/pull/23745)
- [UX allow . in name] commit 88033438aa8214569913899a17b19b57bd609d97 Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS path ... [23874](https://github.com/go-gitea/gitea/pull/23874)
- [UI] commit ca5722a0fae6cc16dc99021176596970bbf29caf Ensure RSS icon is present on all repo tabs [23904](https://github.com/go-gitea/gitea/pull/23904)
- [UI] commit 6eb678374b583079a0a08b7ed0c9ca220c0c0434 Refactor authors dropdown (send get request from frontend to avoid long wait time) [23890](https://github.com/go-gitea/gitea/pull/23890)
- [UX RELEASE permalink] commit 42919ccb7cd32ab67d0878baf2bac6cd007899a8 Make Release Download URLs predictable [23891](https://github.com/go-gitea/gitea/pull/23891)
- [UX project] commit 6a4be2cb6a6193a3f41d5e08d05044e3c54efc38 Add cardtype to org/user level project on creation, edit and view [24043](https://github.com/go-gitea/gitea/pull/24043)
- [UX] commit 52b17bfa07fea29441cd961da4edaf1ea97fe348 Add repository counter badge to repository tab [24205](https://github.com/go-gitea/gitea/pull/24205)
- [UX dump] commit cb1536471bcef4d78a3fe5cbd738b9f60fabbcc2 Add --quiet option to gitea dump [22969](https://github.com/go-gitea/gitea/pull/22969)
- [UI] commit 774d1a0fbdadd1136b6af895f8d449b0c8db54cb Tweak pull request branch delete ui [23951](https://github.com/go-gitea/gitea/pull/23951)
- [UI] commit 9c33cbd3441fc866c3056d53b62c5420588a538a Fix no edit/close/delete button in org repo project view page [24301](https://github.com/go-gitea/gitea/pull/24301)
- [UX] commit c41bc4f1279c9e1e6e11d7b5fcfe7ef089fc7577 Display when a repo was archived [22664](https://github.com/go-gitea/gitea/pull/22664)
- [UI] commit 83022013c83feb5488952baea3ef0be818dfce21 Fix layouts of admin table / adapt repo / email test [24370](https://github.com/go-gitea/gitea/pull/24370)
- [UX] commit e9b39250b285f1b9cbf9739f33c06fc57401f314 Improve pull request merge box when pull request merged and branch deleted. [24397](https:// - [UI] commit 94d6b5b09d49b2622c2164a03cfae45dced96c74 Add "Updated" column for admin repositories list [24429](https://github.com/go-gitea/gitea/pull/24429)
github.com/go-gitea/gitea/pull/24397)
- [UI] commit 72e956b79a3b2e055bb5d4d5e20e88eaa2eeec96 Improve protected branch setting page [24379](https://github.com/go-gitea/gitea/pull/24379)
- [UX goto issue] commit 1144b1d129de530b2c07dfdfaf55de383cd82212 Add goto issue id function [24479](https://github.com/go-gitea/gitea/pull/24479)
- [UI] commit 97b70a0cd40e8f73cdf6ba4397087b45061de3d8 Add org visibility label to non-organization's dashboard [24558](https://github.com/go-gitea/gitea/pull/24558)
- [UX] commit 4daf40505a5f89747982ddd2f1df2a4001720846 Sort users and orgs on explore by recency by default [24279](https://github.com/go-gitea/gitea/pull/24279)
- [UX graceful restart] commit 7565e5c3de051400a9e3703f707049cbb9054cf3 Implement systemd-notify protocol [21151](https://github.com/go-gitea/gitea/pull/21151)
- [UX] commit 4810fe55e3e73edb962052df46bef125eb1817b3 Add status indicator on main home screen for each repo [24638](https://github.com/go-gitea/gitea/pull/24638)
- [UX] commit b5c26fa825e08122843ad6d27191d399a9af1c37 Add markdown preview to Submit Review Textarea [24672](https://github.com/go-gitea/gitea/pull/24672)
- [UX issue template] commit c4303efc23ea19f16ee826809f43888ee4583ebb Support markdown editor for issue template [24400](https://github.com/go-gitea/gitea/pull/24400)
- [UI] commit 4aec1f87a4affe606e96e27c2e8660092aac3afb Remove highlight in repo list [24675](https://github.com/go-gitea/gitea/pull/24675)
- [UI] commit 8251b317f7b7a2b5f626a02fa3bb540a1495e81d Improve empty notifications display [24668](https://github.com/go-gitea/gitea/pull/24668)
- [UX] commit f6e029e6c7849d4361abf7f1d749b5d528364ac4 Make repo migration cancelable and fix various bugs [24605](https://github.com/go-gitea/gitea/pull/24605)
- [UI] commit b3af7484bc821d71cb20f6289f767119494bc81e Fix missing badges in org settings page [24654](https://github.com/go-gitea/gitea/pull/24654)
- [UI RSS] commit 67db6b697636221e09536e89ac8600a47f79b5cb RSS icon fixes [24476](https://github.com/go-gitea/gitea/pull/24476)
- [UX notification list] commit f7ede92f82f7f3ec7bb31a1249f9524e5b728f34 Notification list enhancements, fix striped tables on dark theme [24639](https://github.com/go-gitea/gitea/pull/24639)
- [UI] commit ea7954f069bf8bcb87d520f8aab0a80b0768590d Modify luminance calculation and extract related functions into single files [24586](https://github.com/go-gitea/gitea/pull/24586)
- [UX review] commit ae0fa64ef6261bc99b9b7f6af2047c017399f509 Review fixes and enhancements [24526](https://github.com/go-gitea/gitea/pull/24526)
- [UI] commit df00ccacc9a4840fe86bed75a77841f8801d11d2 Fix invite display [24447](https://github.com/go-gitea/gitea/pull/24447)
- [UX] commit e8173c2c33f1dd5b0a2c044255434d414cab62d2 Move `Rename branch` from repo settings page to the page of branches list [24380](https://github.com/go-gitea/gitea/pull/24380)
- [UX] commit 3f0651d4d61d62a16e1bb672056014ab02db5746 Improve milestone filter on issues page [22423](https://github.com/go-gitea/gitea/pull/22423)
- [UI] commit 8f4dafcd4e6b0b5d307c3e060ffe908c2a96f047 Rework header bar on issue, pull requests and milestone [24420](https://github.com/go-gitea/gitea/pull/24420)
- [UI] commit 8bbbf7e6b8af072e8c924982019c1fc544403196 Remove fluid on compare diff page [24627](https://github.com/go-gitea/gitea/pull/24627)
- [UI avatar] commit 82224c54e0488738dbd3b7eccf56ab08b6790627 Improve avatar uploading / resizing / compressing, remove Fomantic card module [24653](https://github.com/go-gitea/gitea/pull/24653)
- [UI] commit b9fad73e9fcf40e81cde3304198105af6c668421 Unification of registration fields order [24737](https://github.com/go-gitea/gitea/pull/24737)
- [UI] commit 6a3a54cf484bf5137e2af5bc93294b783feb23a4 Remove background on user dashboard filter bar [24779](https://github.com/go-gitea/gitea/pull/24779)
- [UX] commit b807d2f6205bf1ba60d3a543e8e1a16f7be956df Support no label/assignee filter and batch clearing labels/assignees [24707](https://github.com/go-gitea/gitea/pull/24707)
- [UI] commit 5c0745c0349f0709d0fc36fd8a97dcab86bce28a Add validations.required check to dropdown field [24849](https://github.com/go-gitea/gitea/pull/24849)
- [UX notifications list] commit 27c221aa5db116e2cc90afbfa9b92f2a220af853 Rework notifications list [24812](https://github.com/go-gitea/gitea/pull/24812)
- [UI] commit 35ce7ca25b5756441949312d79aa6382f98ce8d6 Hide 'Mirror Settings' when unneeded, improve hints [24433](https://github.com/go-gitea/gitea/pull/24433)
- [UX] commit a70d853d064a97f0be1d3702a9c3912494b546ec Consolidate the two review boxes into one [24738](https://github.com/go-gitea/gitea/pull/24738)
- [UI] commit e3897148f9e612e363854d790a1e77807dac8d0d Minor UI improvements: logo alignment, auth map editor, auth name display [25043](https://github.com/go-gitea/gitea/pull/25043)
- [UX tree view] commit 72eedfb91584720da774909d3f078b7d515c9fdd Show file tree by default [25052](https://github.com/go-gitea/gitea/pull/25052)
- [UX diff copy] commit c5ede35124c8d5280219c24049bb0ad7da9f02ed Add button on diff header to copy file name, misc diff header tweaks [24986](https://github.com/go-gitea/gitea/pull/24986)
- [UI] commit 58536093b3112841bc69edb542189893b57e7a47 Add details summary for vertical menus in settings to allow toggling [25098](https://github.com/go-gitea/gitea/pull/25098)
- [UI] commit 7d192cb674bc475b123c84b205aca821247c5dd1 Add Progressbar to Milestone Page [25050](https://github.com/go-gitea/gitea/pull/25050)
- [UI] commit 7abe958f5b507efa676fb3b2e27d30517f6d1908 Fix color for transfer related buttons when having no permission to act [24510](https://github.com/go-gitea/gitea/pull/24510)
- [UI] commit 4a722c9a45659e7732258397bbb3dd1039ea1952 Make Issue/PR/projects more compact, misc CSS tweaks [24459](https://github.com/go-gitea/gitea/pull/24459)
- [PERF]
- [PERF] commit 1319ba6742a8562453646763adad22379674bab5 Use minio/sha256-simd for accelerated SHA256 [23052](https://github.com/go-gitea/gitea/pull/23052)
- [PERF] commit ef4fc302468cc8a9fd8f65c4ebdc6f55138450d1 Speed up HasUserStopwatch & GetActiveStopwatch [23051](https://github.com/go-gitea/gitea/pull/23051)
- [PERF] commit 0268ee5c37b8ad733678f02bc15ec8642da62c10 Do not create commit graph for temporary repos [23219](https://github.com/go-gitea/gitea/pull/23219)
- [PERF] commit 75ea0d5dba5dbf2f84cef2d12460fdd566d43e62 Faster git.GetDivergingCommits [24482](https://github.com/go-gitea/gitea/pull/24482)
- [PERF] commit df48af22296ccce8e9bd18e5d35c9a3cdf5acb0f Order pull request conflict checking by recently updated, for each push [23220](https://github.com/go-gitea/gitea/pull/23220)
- [AUTH]
- [MAIL smtp auth] commit 8be6da3e2fd0b685aeb6b9e7fd9dee5a4571163a Add ntlm authentication support for mail [23811](https://github.com/go-gitea/gitea/pull/23811)
- [AUTH LDAP] commit b8c19e7a11525da4174b6f80f87ff3e844d03d8a Update LDAP filters to include both username and email address [24547](https://github.com/go-gitea/gitea/pull/24547)
- [AUTH PKCE] commit 7d855efb1fe6b97c5d87492f67ed6aefd31b2474 Allow for PKCE flow without client secret + add docs [25033](https://github.com/go-gitea/gitea/pull/25033)
- [AUTH OAuth redirect] commit ca35dec18b3d3d7dd5cde4c69a10ae830961faf7 Add ability to set multiple redirect URIs in OAuth application UI [25072](https://github.com/go-gitea/gitea/pull/25072)
- [REFACTOR]
- [BREAKING REFACTOR logger] commit 4647660776436f0a83129b4ceb8426b1fb0599bb Rewrite logger system [24726](https://github.com/go-gitea/gitea/pull/24726)
- [BREAKING REFACTOR queue] commit 6f9c278559789066aa831c1df25b0d866103d02d Rewrite queue [24505](https://github.com/go-gitea/gitea/pull/24505)
- [REFACTOR pull mirror] commit 99283415bcbaa8acfe4d249ce3040de2f3a8b006 Refactor Pull Mirror and fix out-of-sync bugs [24732](https://github.com/go-gitea/gitea/pull/24732)
- [REFACTOR git] commit f4538791f5fc82b173608fcf9c30e36ec01dc9d3 Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" [23687](https://github.com/go-gitea/gitea/pull/23687)
- [REFACTOR route] commit 92fd3fc4fd369b6a8c0a022a32a80dec2340223a Refactor "route" related code, fix Safari cookie bug [24330](https://github.com/go-gitea/gitea/pull/24330)
- [REFACTOR] commit 8598356df1eb21b6e33ecb9f9268ba36c5488e7c Refactor and tidy-up the merge/update branch code [22568](https://github.com/go-gitea/gitea/pull/22568)
- [REFACTOR] commit 542cec98f8c07e0f046a35f1d516807416536e74 Refactor merge/update git command calls [23366](https://github.com/go-gitea/gitea/pull/23366)
- [REFACTOR] commit ec261b63e14f84da3e2d9a6e27c8b831a7750677 Refactor repo commit list [23690](https://github.com/go-gitea/gitea/pull/23690)
- [REFACTOR cookie] commit 5b9557aef59b190c55de9ea218bf51152bc04786 Refactor cookie [24107](https://github.com/go-gitea/gitea/pull/24107)
- [REFACTOR web route] commit b9a97ccd0ea1ee44db85b0fbb80b75255af7c742 Refactor web route [24080](https://github.com/go-gitea/gitea/pull/24080)
- [REFACTOR issue stats] commit 38cf43d0606c13c38f459659f38e26cf31dceccb Some refactors for issues stats [24793](https://github.com/go-gitea/gitea/pull/24793)
- [REFACTOR] commit c59a057297c782f44a81a3e630b5094a58099edb Refactor rename user and rename organization [24052](https://github.com/go-gitea/gitea/pull/24052)
- [REWORK logger] commit 0d54395fb544d52585046bf0424659cec0626e31 Improve logger Pause handling [24946](https://github.com/go-gitea/gitea/pull/24946)
- [REWORK queue / logger] commit 18f26cfbf7f9b36b838c0e8762bfba98c89b9797 Improve queue and logger context [24924](https://github.com/go-gitea/gitea/pull/24924)
- [REFACTOR scoped token] commit 18de83b2a3fc120922096b7348d6375094ae1532 Redesign Scoped Access Tokens [24767](https://github.com/go-gitea/gitea/pull/24767)
- [REFACTOR ini] commit de4a21fcb4476772c69c36d086549e89ed4dcf6c Refactor INI package (first step) [25024](https://github.com/go-gitea/gitea/pull/25024)
- [REFACTOR diffFileInfo] commit ee99cf6313ba565523b3c43f61ffda4b71e2c39b Refactor diffFileInfo / DiffTreeStore [24998](https://github.com/go-gitea/gitea/pull/24998)
- [TEMPLATES]
- [TEMPLATES expressions] commit 5b89670a318e52e271f65d96bfe1116d85d20988 Use a general Eval function for expressions in templates. [23927](https://github.com/go-gitea/gitea/pull/23927)
- [CMD reload templates] commit 3588edbb08f93aaa56defa82dffdbb202cd9aa4a Add gitea manager reload-templates command [24843](https://github.com/go-gitea/gitea/pull/24843)
- [RSS]
- [RSS feed] commit 59d060622d375c4123ea88e2fa6c4f34d4fea4d3 Improve RSS [24335](https://github.com/go-gitea/gitea/pull/24335)
- [RSS feed] commit 56d4893b2a996da6388801c9c8ff16b9b588ad55 Add RSS Feeds for branches and files [22719](https://github.com/go-gitea/gitea/pull/22719)
- [API]
- [API EMAIL] commit d56bb7420184c0c2f451f4bcaa96c9b3b00c393d add admin API email endpoints [22792](https://github.com/go-gitea/gitea/pull/22792)
- [API USER RENAME] commit 03591f0f95823a0b1dcca969d2a3ed505c7e6d73 add user rename endpoint to admin api [22789](https://github.com/go-gitea/gitea/pull/22789)
- [API admin search] commit 6f9cc617fcc42477dec5ccab83d06f0a96544403 Add login name and source id for admin user searching API [23376](https://github.com/go-gitea/gitea/pull/23376)
- [API] commit 574d8fe6d6675c8aa05e2b75fdbc01c009efd8be Add absent repounits to create/edit repo API [23500](https://github.com/go-gitea/gitea/pull/23500)
- [API issue dependencies] commit 3cab9c6b0c050bfcb9f2f067e7dc1b0242875254 Add API to manage issue dependencies [17935](https://github.com/go-gitea/gitea/pull/17935)
- [API activity feeds] commit 6b0df6d8da76d77a9b5c42dcfa78dbfe197fd56d Add activity feeds API [23494](https://github.com/go-gitea/gitea/pull/23494)
- [API license] commit fb37eefa282543fd8ce63c361cd4cf0dfac9943c Add API for License templates [23009](https://github.com/go-gitea/gitea/pull/23009)
- [API gitignore] commit 36a5d4c2f3b5670e5e921034cd5d25817534a6d4 Add API for gitignore templates [22783](https://github.com/go-gitea/gitea/pull/22783)
- [API upload empty repo] commit cf465b472166ccf6d3e001e3043e4bf43e16e6b3 Support uploading file to empty repo by API [24357](https://github.com/go-gitea/gitea/pull/24357)
- [API COMMIT --not] commit f766b002938b5c81e343c81fda3c0669fa09809f Add ability to specify '--not' from GetAllCommits [24409](https://github.com/go-gitea/gitea/pull/24409)
- [API GetAllCommits] commit 1dd83dbb917d55bd253001646d6743f247a4d98b Filters for GetAllCommits [24568](https://github.com/go-gitea/gitea/pull/24568)
- [API get single commit] commit 5930ab5fdf7a970fcca3cd50b44cf1cacb615a54 Filter get single commit [24613](https://github.com/go-gitea/gitea/pull/24613)
- [API create branch] commit cd9a13ebb47d32f46b38439a524e3b2e0c619490 Create a branch directly from commit on the create branch API [22956](https://github.com/go-gitea/gitea/pull/22956)
- [BREAKING API team] commit 0a3c4d4a595cc7e12462dde393ed64186260f26b Fix team members API endpoint pagination [24754](https://github.com/go-gitea/gitea/pull/24754)
- [API label templates] commit 25dc1556cd70b567a4920beb002a0addfbfd6ef2 Add API for Label templates [24602](https://github.com/go-gitea/gitea/pull/24602)
- [API changing/creating/deleting multiple files] commit 275d4b7e3f4595206e5c4b1657d4f6d6969d9ce2 API endpoint for changing/creating/deleting multiple files [24887](https://github.com/go-gitea/gitea/pull/24887)
- [FEATURES]
- [BREAKING] (maybe) commit f5987c24e2b561952ebf9a2485b863325c16ee48 Make `gitea serv` respect git binary home [23138](https://github.com/go-gitea/gitea/pull/23138)
- [README] commit 52e24167e5ebe0297f7630e9daecd6ffc9570a99 Test renderReadmeFile [23185](https://github.com/go-gitea/gitea/pull/23185)
- [REFLOGS] commit 757b4c17e900f1d11a81bc9467d90e6c245ee8f2 Support reflogs [22451](https://github.com/go-gitea/gitea/pull/22451)
- [DOCTOR] commit df411819ebe4d3e6852997ce41fadf837d5d4ea0 Check LFS/Packages settings in dump and doctor command [23631](https://github.com/go-gitea/gitea/pull/23631)
- [MINIO] commit 0e7bec1849d2d7a87713abe494b4d3ef416180d4 Add InsecureSkipVerify to Minio Client for Storage [23166](https://github.com/go-gitea/gitea/pull/23166)
- [MINIO MD5 checksum] commit 5727056ea109eb04ee535b981349cdfb44df9fae Make minio package support legacy MD5 checksum [23768](https://github.com/go-gitea/gitea/pull/23768)
- [PRIVACY email display] commit 6706ac2a0f5f2fe4f8e2555be7e2a8b4d5946398 Fix profile page email display, respect settings [23747](https://github.com/go-gitea/gitea/pull/23747)
- [INDEX meilisearch] commit 92c160d8e716cb3d05215a97cf521e843596f562 Add meilisearch support [23136](https://github.com/go-gitea/gitea/pull/23136)
- [PRIVACY email] commit 5e1bd8af5f16f9db88cfeb5b80bdf731435cacfb Show visibility status of email in own profile [23900](https://github.com/go-gitea/gitea/pull/23900)
- [BREAKING SSH key parsing] commit 7a8a4f54321f208ebbb0f708a5f0e49c4cd4cc04 Prefer native parser for SSH public key parsing [23798](https://github.com/go-gitea/gitea/pull/23798)
- [REDIS] commit 985f76dc4b0692c4d6c6f37e82500ef859557c16 Update redis library to support redis v7 [24114](https://github.com/go-gitea/gitea/pull/24114)
- [RESERVED users] commit 1819c4b59b81ba4db2a38d3b3dc81f29102fde51 Add new user types `reserved`, `bot`, and `remote` [24026](https://github.com/go-gitea/gitea/pull/24026)
- [NEW files to empty repo] commit e422342eebc18034ef586ec58f1e2fff0340091d Allow adding new files to an empty repo [24164](https://github.com/go-gitea/gitea/pull/24164)
- [WEBP avatars] commit 65fe0fb22cfb264f0b756065d0c3ce7a17d7e55b Allow `webp` images as avatars [24248](https://github.com/go-gitea/gitea/pull/24248)
- [MARKDOWN livemd] commit 58caf422e67c78f87327bc9b00f89083a2432940 Add .livemd as a markdown extension [22730](https://github.com/go-gitea/gitea/pull/22730)
- [FOLLOW org] commit cc64a925602d54f3439dd19f16b5280bd0377a7a Add follow organization and fix the logic of following page [24345](https://github.com/go-gitea/gitea/pull/24345)
- [PROFILE README] commit c090f87a8db5b51e0aa9c7278b38ddc862c048ac Add Gitea Profile Readmes [23260](https://github.com/go-gitea/gitea/pull/23260)
- [HTTP RANGE] commit 023a048f52b5bf8c4b715285245a129f04e05a8c Make repository response support HTTP range request [24592](https://github.com/go-gitea/gitea/pull/24592)
- [status check pattern] commit e7c2231dee356df5cbe5a47c07e31e3a8d090a6f Support for status check pattern [24633](https://github.com/go-gitea/gitea/pull/24633)
- [EMAIL allow/block] commit 2cb66fff60c95efbd58b797f1197f2421f4687ce Support wildcard in email domain allow/block list [24831](https://github.com/go-gitea/gitea/pull/24831)
- [INSTALL page] commit abcf5a7b5e2c3df951b8048317a99a89b040b489 Fix install page context, make the install page tests really test [24858](https://github.com/go-gitea/gitea/pull/24858)
- [environment-to-ini FILE] commit c21605951b581440bb08b65d5907b1cd4e0ab6c5 Make environment-to-ini support loading key value from file [24832](https://github.com/go-gitea/gitea/pull/24832)
- [APP ini git config] commit 8080ace6fcf73a5fbe4a0dd71881228abd0c68b9 Support changing git config through `app.ini`, use `diff.algorithm=histogram` by default [24860](https://github.com/go-gitea/gitea/pull/24860)
- [PIN issues] commit aaa109466350c531b9238a61115b2877daca57d3 Add the ability to pin Issues [24406](https://github.com/go-gitea/gitea/pull/24406)
- [BREAKING reflog / config] commit 2f149c5c9db97f20fbbc65e32d1f3133048b11a2 Use `[git.config]` for reflog cleaning up [24958](https://github.com/go-gitea/gitea/pull/24958)
- [SEARCH skip forks mirrors] commit 033d92997fc16baee097d2b25f08e0984e628abd Allow skipping forks and mirrors from being indexed [23187](https://github.com/go-gitea/gitea/pull/23187)
- [WEBHOOK]
- [WEBHOOKS] commit 2173f14708ff3b35d7821fc9b6dcb5fcd06b8494 Add user webhooks [21563](https://github.com/go-gitea/gitea/pull/21563)
- [WEBHOOK] commit 9e04627acaaa853e5269f98f53f2615077cfb028 Fix incorrect `HookEventType` of pull request review comments [23650](https://github.com/go-gitea/gitea/pull/23650)
- [WEBHOOK review request] commit 309354c70ee994a1e8f261d7bc24e7473e601d02 New webhook trigger for receiving Pull Request review requests [24481](https://github.com/go-gitea/gitea/pull/24481)
- [DISCARDED]
- [GITEA only BREAKING service worker] commit 50bd7d0b24016b0cf48dfbafe84b5953fe20c34f Remove the service worker [25010](https://github.com/go-gitea/gitea/pull/25010)
* Container images upgraded to Alpine 3.18
The Forgejo container images are now based on [Alpine 3.18](https://alpinelinux.org/posts/Alpine-3.18.0-released.html) instead of Alpine 3.17.
## 1.19.4-0
The [complete list of commits](https://codeberg.org/forgejo/forgejo/commits/branch/v1.19/forgejo) included in the `Forgejo v1.19.4-0` release can be reviewed from the command line with:
```shell
$ git clone https://codeberg.org/forgejo/forgejo/
$ git -C forgejo log --oneline --no-merges v1.19.3-0..v1.19.4-0
```
This stable release contains security fixes.
* Recommended Action
We recommend that all Forgejo installations are upgraded to the latest version.
* [Forgejo Semantic Version](https://forgejo.org/docs/v1.19/user/semver/)
The semantic version was updated from `4.2.1+0-gitea-1.19.3` to `4.2.2+0-gitea-1.19.4`.
* Security fixes
* [An additional verification](https://codeberg.org/forgejo/forgejo/commit/a259a928a) was implemented to prevent [open redirects](https://en.wikipedia.org/wiki/Open_redirect).
* Bug fixes
The most prominent ones are described here, others can be found in the list of commits included in the release as described above.
* [Fix an edge case](https://codeberg.org/forgejo/forgejo/commit/27796464c) where a user changing their `username` in their profile page could fail
* The secrets are only meaningful in the context of `Frogejo Actions`, do not display them if `Forgejo Actions` is disabled ([patch 1](https://codeberg.org/forgejo/forgejo/commit/5883db45c), [patch 2](https://codeberg.org/forgejo/forgejo/commit/5fdac0d46))
* Actions can now be triggered on mirrored repositories ([patch 1](https://codeberg.org/forgejo/forgejo/commit/58bdcae61), [patch 2](https://codeberg.org/forgejo/forgejo/commit/8d4d6f9b2))
* [Return `404` in the API if the requested webhooks were not found](https://codeberg.org/forgejo/forgejo/commit/16bcceeff) instead of `500`
* Ensure topics deleted via the API are [also deleted in the repository](https://codeberg.org/forgejo/forgejo/commit/5dc29fdeb)
* [Tentative fix](https://codeberg.org/forgejo/forgejo/commit/9bc4887cb) to suppress the JavaScript error **TypeError: undefined is not an object (evaluating '_i18n.textEdited')** on safari. It is unclear if that fix is effective because it could not be reproduced, please report if it still happens for you.
* [Respect original content when creating secrets](https://codeberg.org/forgejo/forgejo/commit/f6919e3e5)
* If a mirror failed and left the database in an inconsistent state, make it so the repository page [does not fail with an error `500`](https://codeberg.org/forgejo/forgejo/commit/f37fba567)
* If a user that triggered `Actions` is deleted, [allow for the page listing the tasks it launched to show](https://codeberg.org/forgejo/forgejo/commit/f9bf040a5) instead of failing with an error `500`
* [Allow the selection of milestones](https://codeberg.org/forgejo/forgejo/commit/55d062003) when acting on multiple issues in the issue list page
* [Fix the API error message when trying to create a fork that already exists](https://codeberg.org/forgejo/forgejo/commit/4dccac3db)
* [Don't display a `create page` button in a mirror wiki repository](https://codeberg.org/forgejo/forgejo/commit/7a74957c1). A mirrored repository will also mirror a wiki and changes will be overridden.
* [Do not allow for a repository to enable actions if it is not enabled in the configuration](https://codeberg.org/forgejo/forgejo/commit/257287954)
* Allow for closed PRs to be re-opened and [synchronize with the latest content of the head branch](https://codeberg.org/forgejo/forgejo/commit/306b7b5d1)
* [Fix the `close` button of projects within an organization](https://codeberg.org/forgejo/forgejo/commit/306b7b5d1). It was a noop and now effectively closes the project
The Forgejo container images are now based on [Alpine 3.18](https://alpinelinux.org/posts/Alpine-3.18.0-released.html) instead of Alpine 3.1.17 It includes an upgrade from git ...
## 1.19.3-0

2
assets/emoji.json generated

File diff suppressed because one or more lines are too long

110
assets/go-licenses.json generated

File diff suppressed because one or more lines are too long

View file

@ -12,7 +12,6 @@ import (
"path/filepath"
"strings"
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/setting"
)
@ -59,7 +58,7 @@ func main() {
// use old en-US as the base, and copy the new translations to the old locales
enUsOld := inisOld["options/locale/locale_en-US.ini"]
brokenWarned := make(container.Set[string])
brokenWarned := map[string]bool{}
for path, iniOld := range inisOld {
if iniOld == enUsOld {
continue
@ -78,7 +77,7 @@ func main() {
broken := oldStr != "" && strings.Count(oldStr, "%") != strings.Count(newStr, "%")
broken = broken || strings.Contains(oldStr, "\n") || strings.Contains(oldStr, "\n")
if broken {
brokenWarned.Add(secOld.Name() + "." + keyEnUs.Name())
brokenWarned[secOld.Name()+"."+keyEnUs.Name()] = true
fmt.Println("----")
fmt.Printf("WARNING: skip broken locale: %s , [%s] %s\n", path, secEnUS.Name(), keyEnUs.Name())
fmt.Printf("\told: %s\n", strings.ReplaceAll(oldStr, "\n", "\\n"))
@ -104,7 +103,7 @@ func main() {
broken = broken || strings.HasPrefix(str, "`\"")
broken = broken || strings.Count(str, `"`)%2 == 1
broken = broken || strings.Count(str, "`")%2 == 1
if broken && !brokenWarned.Contains(sec.Name()+"."+key.Name()) {
if broken && !brokenWarned[sec.Name()+"."+key.Name()] {
fmt.Printf("WARNING: found broken locale: %s , [%s] %s\n", path, sec.Name(), key.Name())
fmt.Printf("\tstr: %s\n", strings.ReplaceAll(str, "\n", "\\n"))
fmt.Println("----")

View file

@ -25,7 +25,7 @@ import (
const (
gemojiURL = "https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json"
maxUnicodeVersion = 15
maxUnicodeVersion = 14
)
var flagOut = flag.String("o", "modules/emoji/emoji_data.go", "out")

View file

@ -15,8 +15,6 @@ import (
"regexp"
"sort"
"strings"
"code.gitea.io/gitea/modules/container"
)
// regexp is based on go-license, excluding README and NOTICE
@ -57,14 +55,20 @@ func main() {
// yml
//
// It could be removed once we have a better regex.
excludedExt := container.SetOf(".gitignore", ".go", ".mod", ".sum", ".toml", ".yml")
excludedExt := map[string]bool{
".gitignore": true,
".go": true,
".mod": true,
".sum": true,
".toml": true,
".yml": true,
}
var paths []string
err := filepath.WalkDir(base, func(path string, entry fs.DirEntry, err error) error {
if err != nil {
return err
}
if entry.IsDir() || !licenseRe.MatchString(entry.Name()) || excludedExt.Contains(filepath.Ext(entry.Name())) {
if entry.IsDir() || !licenseRe.MatchString(entry.Name()) || excludedExt[filepath.Ext(entry.Name())] {
return nil
}
paths = append(paths, path)

View file

@ -69,13 +69,13 @@ async function main() {
const faviconSvg = await readFile(new URL('../assets/favicon.svg', import.meta.url), 'utf8');
await Promise.all([
generate(logoSvg, '../public/assets/img/logo.svg', {size: 32}),
generate(logoSvg, '../public/assets/img/logo.png', {size: 512}),
generate(faviconSvg, '../public/assets/img/favicon.svg', {size: 32}),
generate(faviconSvg, '../public/assets/img/favicon.png', {size: 180}),
generate(logoSvg, '../public/assets/img/avatar_default.png', {size: 200}),
generate(logoSvg, '../public/assets/img/apple-touch-icon.png', {size: 180, bg: true}),
gitea && generate(logoSvg, '../public/assets/img/gitea.svg', {size: 32}),
generate(logoSvg, '../public/img/logo.svg', {size: 32}),
generate(logoSvg, '../public/img/logo.png', {size: 512}),
generate(faviconSvg, '../public/img/favicon.svg', {size: 32}),
generate(faviconSvg, '../public/img/favicon.png', {size: 180}),
generate(logoSvg, '../public/img/avatar_default.png', {size: 200}),
generate(logoSvg, '../public/img/apple-touch-icon.png', {size: 180, bg: true}),
gitea && generate(logoSvg, '../public/img/gitea.svg', {size: 32}),
]);
}

View file

@ -44,7 +44,7 @@ async function processFile(file, {prefix, fullName} = {}) {
],
});
await writeFile(fileURLToPath(new URL(`../public/assets/img/svg/${name}.svg`, import.meta.url)), data);
await writeFile(fileURLToPath(new URL(`../public/img/svg/${name}.svg`, import.meta.url)), data);
}
function processFiles(pattern, opts) {
@ -53,13 +53,13 @@ function processFiles(pattern, opts) {
async function main() {
try {
await mkdir(fileURLToPath(new URL('../public/assets/img/svg', import.meta.url)), {recursive: true});
await mkdir(fileURLToPath(new URL('../public/img/svg', import.meta.url)), {recursive: true});
} catch {}
await Promise.all([
...processFiles('node_modules/@primer/octicons/build/svg/*-16.svg', {prefix: 'octicon'}),
...processFiles('web_src/svg/*.svg'),
...processFiles('public/assets/img/gitea.svg', {fullName: 'gitea-gitea'}),
...processFiles('public/img/gitea.svg', {fullName: 'gitea-gitea'}),
]);
}

View file

@ -8,7 +8,6 @@ package main
import (
"bufio"
"log"
"os"
"regexp"
"strings"
@ -40,28 +39,17 @@ func renameGiteaForgejo(filename string) []byte {
panic(err)
}
replacements := []string{
replacer := strings.NewReplacer(
"Gitea", "Forgejo",
"https://docs.gitea.com/installation/install-from-binary", "https://forgejo.org/download/#installation-from-binary",
"https://docs.gitea.io/en-us/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://docs.gitea.io/en-us/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)
@ -82,18 +70,10 @@ func renameGiteaForgejo(filename string) []byte {
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
}

View file

@ -9,31 +9,30 @@ import (
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var (
// CmdActions represents the available actions sub-commands.
CmdActions = &cli.Command{
CmdActions = cli.Command{
Name: "actions",
Usage: "",
Description: "Commands for managing Forgejo Actions",
Subcommands: []*cli.Command{
Description: "Commands for managing Gitea Actions",
Subcommands: []cli.Command{
subcmdActionsGenRunnerToken,
},
}
subcmdActionsGenRunnerToken = &cli.Command{
subcmdActionsGenRunnerToken = cli.Command{
Name: "generate-runner-token",
Usage: "Generate a new token for a runner to use to register with the server",
Action: runGenerateActionsRunnerToken,
Aliases: []string{"grt"},
Flags: []cli.Flag{
&cli.StringFlag{
Name: "scope",
Aliases: []string{"s"},
Value: "",
Usage: "{owner}[/{repo}] - leave empty for a global runner",
cli.StringFlag{
Name: "scope, s",
Value: "",
Usage: "{owner}[/{repo}] - leave empty for a global runner",
},
},
}

View file

@ -5,7 +5,6 @@
package cmd
import (
"context"
"errors"
"fmt"
"net/url"
@ -27,15 +26,15 @@ import (
"code.gitea.io/gitea/services/auth/source/smtp"
repo_service "code.gitea.io/gitea/services/repository"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var (
// CmdAdmin represents the available admin sub-command.
CmdAdmin = &cli.Command{
CmdAdmin = cli.Command{
Name: "admin",
Usage: "Command line interface to perform common administrative operations",
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
subcmdUser,
subcmdRepoSyncReleases,
subcmdRegenerate,
@ -44,37 +43,37 @@ var (
},
}
subcmdRepoSyncReleases = &cli.Command{
subcmdRepoSyncReleases = cli.Command{
Name: "repo-sync-releases",
Usage: "Synchronize repository releases with tags",
Action: runRepoSyncReleases,
}
subcmdRegenerate = &cli.Command{
subcmdRegenerate = cli.Command{
Name: "regenerate",
Usage: "Regenerate specific files",
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
microcmdRegenHooks,
microcmdRegenKeys,
},
}
microcmdRegenHooks = &cli.Command{
microcmdRegenHooks = cli.Command{
Name: "hooks",
Usage: "Regenerate git-hooks",
Action: runRegenerateHooks,
}
microcmdRegenKeys = &cli.Command{
microcmdRegenKeys = cli.Command{
Name: "keys",
Usage: "Regenerate authorized_keys file",
Action: runRegenerateKeys,
}
subcmdAuth = &cli.Command{
subcmdAuth = cli.Command{
Name: "auth",
Usage: "Modify external auth providers",
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
microcmdAuthAddOauth,
microcmdAuthUpdateOauth,
cmdAuthAddLdapBindDn,
@ -88,44 +87,44 @@ var (
},
}
microcmdAuthList = &cli.Command{
microcmdAuthList = cli.Command{
Name: "list",
Usage: "List auth sources",
Action: runListAuth,
Flags: []cli.Flag{
&cli.IntFlag{
cli.IntFlag{
Name: "min-width",
Usage: "Minimal cell width including any padding for the formatted table",
Value: 0,
},
&cli.IntFlag{
cli.IntFlag{
Name: "tab-width",
Usage: "width of tab characters in formatted table (equivalent number of spaces)",
Value: 8,
},
&cli.IntFlag{
cli.IntFlag{
Name: "padding",
Usage: "padding added to a cell before computing its width",
Value: 1,
},
&cli.StringFlag{
cli.StringFlag{
Name: "pad-char",
Usage: `ASCII char used for padding if padchar == '\\t', the Writer will assume that the width of a '\\t' in the formatted output is tabwidth, and cells are left-aligned independent of align_left (for correct-looking results, tabwidth must correspond to the tab width in the viewer displaying the result)`,
Value: "\t",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "vertical-bars",
Usage: "Set to true to print vertical bars between columns",
},
},
}
idFlag = &cli.Int64Flag{
idFlag = cli.Int64Flag{
Name: "id",
Usage: "ID of authentication source",
}
microcmdAuthDelete = &cli.Command{
microcmdAuthDelete = cli.Command{
Name: "delete",
Usage: "Delete specific auth source",
Flags: []cli.Flag{idFlag},
@ -133,213 +132,207 @@ var (
}
oauthCLIFlags = []cli.Flag{
&cli.StringFlag{
cli.StringFlag{
Name: "name",
Value: "",
Usage: "Application Name",
},
&cli.StringFlag{
cli.StringFlag{
Name: "provider",
Value: "",
Usage: "OAuth2 Provider",
},
&cli.StringFlag{
cli.StringFlag{
Name: "key",
Value: "",
Usage: "Client ID (Key)",
},
&cli.StringFlag{
cli.StringFlag{
Name: "secret",
Value: "",
Usage: "Client Secret",
},
&cli.StringFlag{
cli.StringFlag{
Name: "auto-discover-url",
Value: "",
Usage: "OpenID Connect Auto Discovery URL (only required when using OpenID Connect as provider)",
},
&cli.StringFlag{
cli.StringFlag{
Name: "use-custom-urls",
Value: "false",
Usage: "Use custom URLs for GitLab/GitHub OAuth endpoints",
},
&cli.StringFlag{
cli.StringFlag{
Name: "custom-tenant-id",
Value: "",
Usage: "Use custom Tenant ID for OAuth endpoints",
},
&cli.StringFlag{
cli.StringFlag{
Name: "custom-auth-url",
Value: "",
Usage: "Use a custom Authorization URL (option for GitLab/GitHub)",
},
&cli.StringFlag{
cli.StringFlag{
Name: "custom-token-url",
Value: "",
Usage: "Use a custom Token URL (option for GitLab/GitHub)",
},
&cli.StringFlag{
cli.StringFlag{
Name: "custom-profile-url",
Value: "",
Usage: "Use a custom Profile URL (option for GitLab/GitHub)",
},
&cli.StringFlag{
cli.StringFlag{
Name: "custom-email-url",
Value: "",
Usage: "Use a custom Email URL (option for GitHub)",
},
&cli.StringFlag{
cli.StringFlag{
Name: "icon-url",
Value: "",
Usage: "Custom icon URL for OAuth2 login source",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "skip-local-2fa",
Usage: "Set to true to skip local 2fa for users authenticated by this source",
},
&cli.StringSliceFlag{
cli.StringSliceFlag{
Name: "scopes",
Value: nil,
Usage: "Scopes to request when to authenticate against this OAuth2 source",
},
&cli.StringFlag{
cli.StringFlag{
Name: "required-claim-name",
Value: "",
Usage: "Claim name that has to be set to allow users to login with this source",
},
&cli.StringFlag{
cli.StringFlag{
Name: "required-claim-value",
Value: "",
Usage: "Claim value that has to be set to allow users to login with this source",
},
&cli.StringFlag{
cli.StringFlag{
Name: "group-claim-name",
Value: "",
Usage: "Claim name providing group names for this source",
},
&cli.StringFlag{
cli.StringFlag{
Name: "admin-group",
Value: "",
Usage: "Group Claim value for administrator users",
},
&cli.StringFlag{
cli.StringFlag{
Name: "restricted-group",
Value: "",
Usage: "Group Claim value for restricted users",
},
&cli.StringFlag{
cli.StringFlag{
Name: "group-team-map",
Value: "",
Usage: "JSON mapping between groups and org teams",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "group-team-map-removal",
Usage: "Activate automatic team membership removal depending on groups",
},
}
microcmdAuthUpdateOauth = &cli.Command{
microcmdAuthUpdateOauth = cli.Command{
Name: "update-oauth",
Usage: "Update existing Oauth authentication source",
Action: runUpdateOauth,
Flags: append(oauthCLIFlags[:1], append([]cli.Flag{idFlag}, oauthCLIFlags[1:]...)...),
}
microcmdAuthAddOauth = &cli.Command{
microcmdAuthAddOauth = cli.Command{
Name: "add-oauth",
Usage: "Add new Oauth authentication source",
Action: runAddOauth,
Flags: oauthCLIFlags,
}
subcmdSendMail = &cli.Command{
subcmdSendMail = cli.Command{
Name: "sendmail",
Usage: "Send a message to all users",
Action: runSendMail,
Flags: []cli.Flag{
&cli.StringFlag{
cli.StringFlag{
Name: "title",
Usage: `a title of a message`,
Value: "",
},
&cli.StringFlag{
cli.StringFlag{
Name: "content",
Usage: "a content of a message",
Value: "",
},
&cli.BoolFlag{
Name: "force",
Aliases: []string{"f"},
Usage: "A flag to bypass a confirmation step",
cli.BoolFlag{
Name: "force,f",
Usage: "A flag to bypass a confirmation step",
},
},
}
smtpCLIFlags = []cli.Flag{
&cli.StringFlag{
cli.StringFlag{
Name: "name",
Value: "",
Usage: "Application Name",
},
&cli.StringFlag{
cli.StringFlag{
Name: "auth-type",
Value: "PLAIN",
Usage: "SMTP Authentication Type (PLAIN/LOGIN/CRAM-MD5) default PLAIN",
},
&cli.StringFlag{
cli.StringFlag{
Name: "host",
Value: "",
Usage: "SMTP Host",
},
&cli.IntFlag{
cli.IntFlag{
Name: "port",
Usage: "SMTP Port",
},
&cli.BoolFlag{
cli.BoolTFlag{
Name: "force-smtps",
Usage: "SMTPS is always used on port 465. Set this to force SMTPS on other ports.",
Value: true,
},
&cli.BoolFlag{
cli.BoolTFlag{
Name: "skip-verify",
Usage: "Skip TLS verify.",
Value: true,
},
&cli.StringFlag{
cli.StringFlag{
Name: "helo-hostname",
Value: "",
Usage: "Hostname sent with HELO. Leave blank to send current hostname",
},
&cli.BoolFlag{
cli.BoolTFlag{
Name: "disable-helo",
Usage: "Disable SMTP helo.",
Value: true,
},
&cli.StringFlag{
cli.StringFlag{
Name: "allowed-domains",
Value: "",
Usage: "Leave empty to allow all domains. Separate multiple domains with a comma (',')",
},
&cli.BoolFlag{
cli.BoolTFlag{
Name: "skip-local-2fa",
Usage: "Skip 2FA to log on.",
Value: true,
},
&cli.BoolFlag{
cli.BoolTFlag{
Name: "active",
Usage: "This Authentication Source is Activated.",
Value: true,
},
}
microcmdAuthAddSMTP = &cli.Command{
microcmdAuthAddSMTP = cli.Command{
Name: "add-smtp",
Usage: "Add new SMTP authentication source",
Action: runAddSMTP,
Flags: smtpCLIFlags,
}
microcmdAuthUpdateSMTP = &cli.Command{
microcmdAuthUpdateSMTP = cli.Command{
Name: "update-smtp",
Usage: "Update existing SMTP authentication source",
Action: runUpdateSMTP,
@ -383,19 +376,19 @@ func runRepoSyncReleases(_ *cli.Context) error {
continue
}
oldnum, err := getReleaseCount(ctx, repo.ID)
oldnum, err := getReleaseCount(repo.ID)
if err != nil {
log.Warn(" GetReleaseCountByRepoID: %v", err)
}
log.Trace(" currentNumReleases is %d, running SyncReleasesWithTags", oldnum)
if err = repo_module.SyncReleasesWithTags(ctx, repo, gitRepo); err != nil {
if err = repo_module.SyncReleasesWithTags(repo, gitRepo); err != nil {
log.Warn(" SyncReleasesWithTags: %v", err)
gitRepo.Close()
continue
}
count, err = getReleaseCount(ctx, repo.ID)
count, err = getReleaseCount(repo.ID)
if err != nil {
log.Warn(" GetReleaseCountByRepoID: %v", err)
gitRepo.Close()
@ -411,9 +404,9 @@ func runRepoSyncReleases(_ *cli.Context) error {
return nil
}
func getReleaseCount(ctx context.Context, id int64) (int64, error) {
func getReleaseCount(id int64) (int64, error) {
return repo_model.GetReleaseCountByRepoID(
ctx,
db.DefaultContext,
id,
repo_model.FindReleasesOptions{
IncludeTags: true,
@ -428,12 +421,6 @@ 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())
}
@ -444,7 +431,7 @@ func runRegenerateKeys(_ *cli.Context) error {
if err := initDB(ctx); err != nil {
return err
}
return asymkey_model.RewriteAllPublicKeys(ctx)
return asymkey_model.RewriteAllPublicKeys()
}
func parseOAuth2Config(c *cli.Context) *oauth2.Source {
@ -628,19 +615,19 @@ func parseSMTPConfig(c *cli.Context, conf *smtp.Source) error {
conf.AllowedDomains = c.String("allowed-domains")
}
if c.IsSet("force-smtps") {
conf.ForceSMTPS = c.Bool("force-smtps")
conf.ForceSMTPS = c.BoolT("force-smtps")
}
if c.IsSet("skip-verify") {
conf.SkipVerify = c.Bool("skip-verify")
conf.SkipVerify = c.BoolT("skip-verify")
}
if c.IsSet("helo-hostname") {
conf.HeloHostname = c.String("helo-hostname")
}
if c.IsSet("disable-helo") {
conf.DisableHelo = c.Bool("disable-helo")
conf.DisableHelo = c.BoolT("disable-helo")
}
if c.IsSet("skip-local-2fa") {
conf.SkipLocalTwoFA = c.Bool("skip-local-2fa")
conf.SkipLocalTwoFA = c.BoolT("skip-local-2fa")
}
return nil
}
@ -664,7 +651,7 @@ func runAddSMTP(c *cli.Context) error {
}
active := true
if c.IsSet("active") {
active = c.Bool("active")
active = c.BoolT("active")
}
var smtpConfig smtp.Source
@ -713,7 +700,7 @@ func runUpdateSMTP(c *cli.Context) error {
}
if c.IsSet("active") {
source.IsActive = c.Bool("active")
source.IsActive = c.BoolT("active")
}
source.Cfg = smtpConfig

View file

@ -11,7 +11,7 @@ import (
"code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/services/auth/source/ldap"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
type (
@ -25,117 +25,117 @@ type (
var (
commonLdapCLIFlags = []cli.Flag{
&cli.StringFlag{
cli.StringFlag{
Name: "name",
Usage: "Authentication name.",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "not-active",
Usage: "Deactivate the authentication source.",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "active",
Usage: "Activate the authentication source.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "security-protocol",
Usage: "Security protocol name.",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "skip-tls-verify",
Usage: "Disable TLS verification.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "host",
Usage: "The address where the LDAP server can be reached.",
},
&cli.IntFlag{
cli.IntFlag{
Name: "port",
Usage: "The port to use when connecting to the LDAP server.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "user-search-base",
Usage: "The LDAP base at which user accounts will be searched for.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "user-filter",
Usage: "An LDAP filter declaring how to find the user record that is attempting to authenticate.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "admin-filter",
Usage: "An LDAP filter specifying if a user should be given administrator privileges.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "restricted-filter",
Usage: "An LDAP filter specifying if a user should be given restricted status.",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "allow-deactivate-all",
Usage: "Allow empty search results to deactivate all users.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "username-attribute",
Usage: "The attribute of the users LDAP record containing the user name.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "firstname-attribute",
Usage: "The attribute of the users LDAP record containing the users first name.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "surname-attribute",
Usage: "The attribute of the users LDAP record containing the users surname.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "email-attribute",
Usage: "The attribute of the users LDAP record containing the users email address.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "public-ssh-key-attribute",
Usage: "The attribute of the users LDAP record containing the users public ssh key.",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "skip-local-2fa",
Usage: "Set to true to skip local 2fa for users authenticated by this source",
},
&cli.StringFlag{
cli.StringFlag{
Name: "avatar-attribute",
Usage: "The attribute of the users LDAP record containing the users avatar.",
},
}
ldapBindDnCLIFlags = append(commonLdapCLIFlags,
&cli.StringFlag{
cli.StringFlag{
Name: "bind-dn",
Usage: "The DN to bind to the LDAP server with when searching for the user.",
},
&cli.StringFlag{
cli.StringFlag{
Name: "bind-password",
Usage: "The password for the Bind DN, if any.",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "attributes-in-bind",
Usage: "Fetch attributes in bind DN context.",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "synchronize-users",
Usage: "Enable user synchronization.",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "disable-synchronize-users",
Usage: "Disable user synchronization.",
},
&cli.UintFlag{
cli.UintFlag{
Name: "page-size",
Usage: "Search page size.",
})
ldapSimpleAuthCLIFlags = append(commonLdapCLIFlags,
&cli.StringFlag{
cli.StringFlag{
Name: "user-dn",
Usage: "The users DN.",
})
cmdAuthAddLdapBindDn = &cli.Command{
cmdAuthAddLdapBindDn = cli.Command{
Name: "add-ldap",
Usage: "Add new LDAP (via Bind DN) authentication source",
Action: func(c *cli.Context) error {
@ -144,7 +144,7 @@ var (
Flags: ldapBindDnCLIFlags,
}
cmdAuthUpdateLdapBindDn = &cli.Command{
cmdAuthUpdateLdapBindDn = cli.Command{
Name: "update-ldap",
Usage: "Update existing LDAP (via Bind DN) authentication source",
Action: func(c *cli.Context) error {
@ -153,7 +153,7 @@ var (
Flags: append([]cli.Flag{idFlag}, ldapBindDnCLIFlags...),
}
cmdAuthAddLdapSimpleAuth = &cli.Command{
cmdAuthAddLdapSimpleAuth = cli.Command{
Name: "add-ldap-simple",
Usage: "Add new LDAP (simple auth) authentication source",
Action: func(c *cli.Context) error {
@ -162,7 +162,7 @@ var (
Flags: ldapSimpleAuthCLIFlags,
}
cmdAuthUpdateLdapSimpleAuth = &cli.Command{
cmdAuthUpdateLdapSimpleAuth = cli.Command{
Name: "update-ldap-simple",
Usage: "Update existing LDAP (simple auth) authentication source",
Action: func(c *cli.Context) error {

View file

@ -11,7 +11,7 @@ import (
"code.gitea.io/gitea/services/auth/source/ldap"
"github.com/stretchr/testify/assert"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
func TestAddLdapBindDn(t *testing.T) {

View file

@ -4,13 +4,13 @@
package cmd
import (
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var subcmdUser = &cli.Command{
var subcmdUser = cli.Command{
Name: "user",
Usage: "Modify users",
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
microcmdUserCreate,
microcmdUserList,
microcmdUserChangePassword,

View file

@ -12,25 +12,23 @@ import (
pwd "code.gitea.io/gitea/modules/auth/password"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var microcmdUserChangePassword = &cli.Command{
var microcmdUserChangePassword = cli.Command{
Name: "change-password",
Usage: "Change a user's password",
Action: runChangePassword,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "username",
Aliases: []string{"u"},
Value: "",
Usage: "The user to change password for",
cli.StringFlag{
Name: "username,u",
Value: "",
Usage: "The user to change password for",
},
&cli.StringFlag{
Name: "password",
Aliases: []string{"p"},
Value: "",
Usage: "New password to set for user",
cli.StringFlag{
Name: "password,p",
Value: "",
Usage: "New password to set for user",
},
},
}

View file

@ -6,6 +6,7 @@ package cmd
import (
"errors"
"fmt"
"os"
auth_model "code.gitea.io/gitea/models/auth"
user_model "code.gitea.io/gitea/models/user"
@ -13,52 +14,52 @@ import (
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var microcmdUserCreate = &cli.Command{
var microcmdUserCreate = cli.Command{
Name: "create",
Usage: "Create a new user in database",
Action: runCreateUser,
Flags: []cli.Flag{
&cli.StringFlag{
cli.StringFlag{
Name: "name",
Usage: "Username. DEPRECATED: use username instead",
},
&cli.StringFlag{
cli.StringFlag{
Name: "username",
Usage: "Username",
},
&cli.StringFlag{
cli.StringFlag{
Name: "password",
Usage: "User password",
},
&cli.StringFlag{
cli.StringFlag{
Name: "email",
Usage: "User email address",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "admin",
Usage: "User is an admin",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "random-password",
Usage: "Generate a random password for the user",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "must-change-password",
Usage: "Set this option to false to prevent forcing the user to change their password after initial login, (Default: true)",
},
&cli.IntFlag{
cli.IntFlag{
Name: "random-password-length",
Usage: "Length of the random password to be generated",
Value: 12,
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "access-token",
Usage: "Generate access token for the user",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "restricted",
Usage: "Make a restricted user account",
},
@ -86,7 +87,7 @@ func runCreateUser(c *cli.Context) error {
username = c.String("username")
} else {
username = c.String("name")
_, _ = fmt.Fprintf(c.App.ErrWriter, "--name flag is deprecated. Use --username instead.\n")
fmt.Fprintf(os.Stderr, "--name flag is deprecated. Use --username instead.\n")
}
ctx, cancel := installSignals()
@ -115,7 +116,7 @@ func runCreateUser(c *cli.Context) error {
// If this is the first user being created.
// Take it as the admin and don't force a password update.
if n := user_model.CountUsers(ctx, nil); n == 0 {
if n := user_model.CountUsers(nil); n == 0 {
changePassword = false
}
@ -146,7 +147,7 @@ func runCreateUser(c *cli.Context) error {
IsRestricted: restricted,
}
if err := user_model.CreateUser(ctx, u, overwriteDefault); err != nil {
if err := user_model.CreateUser(u, overwriteDefault); err != nil {
return fmt.Errorf("CreateUser: %w", err)
}
@ -156,7 +157,7 @@ func runCreateUser(c *cli.Context) error {
UID: u.ID,
}
if err := auth_model.NewAccessToken(ctx, t); err != nil {
if err := auth_model.NewAccessToken(t); err != nil {
return err
}

View file

@ -11,28 +11,26 @@ import (
"code.gitea.io/gitea/modules/storage"
user_service "code.gitea.io/gitea/services/user"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var microcmdUserDelete = &cli.Command{
var microcmdUserDelete = cli.Command{
Name: "delete",
Usage: "Delete specific user by id, name or email",
Flags: []cli.Flag{
&cli.Int64Flag{
cli.Int64Flag{
Name: "id",
Usage: "ID of user of the user to delete",
},
&cli.StringFlag{
Name: "username",
Aliases: []string{"u"},
Usage: "Username of the user to delete",
cli.StringFlag{
Name: "username,u",
Usage: "Username of the user to delete",
},
&cli.StringFlag{
Name: "email",
Aliases: []string{"e"},
Usage: "Email of the user to delete",
cli.StringFlag{
Name: "email,e",
Usage: "Email of the user to delete",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "purge",
Usage: "Purge user, all their repositories, organizations and comments",
},

View file

@ -9,29 +9,27 @@ import (
auth_model "code.gitea.io/gitea/models/auth"
user_model "code.gitea.io/gitea/models/user"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var microcmdUserGenerateAccessToken = &cli.Command{
var microcmdUserGenerateAccessToken = cli.Command{
Name: "generate-access-token",
Usage: "Generate an access token for a specific user",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "username",
Aliases: []string{"u"},
Usage: "Username",
cli.StringFlag{
Name: "username,u",
Usage: "Username",
},
&cli.StringFlag{
Name: "token-name",
Aliases: []string{"t"},
Usage: "Token name",
Value: "gitea-admin",
cli.StringFlag{
Name: "token-name,t",
Usage: "Token name",
Value: "gitea-admin",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "raw",
Usage: "Display only the token value",
},
&cli.StringFlag{
cli.StringFlag{
Name: "scopes",
Value: "",
Usage: "Comma separated list of scopes to apply to access token",
@ -63,7 +61,7 @@ func runGenerateAccessToken(c *cli.Context) error {
UID: user.ID,
}
exist, err := auth_model.AccessTokenByNameExists(ctx, t)
exist, err := auth_model.AccessTokenByNameExists(t)
if err != nil {
return err
}
@ -79,7 +77,7 @@ func runGenerateAccessToken(c *cli.Context) error {
t.Scope = accessTokenScope
// create the token
if err := auth_model.NewAccessToken(ctx, t); err != nil {
if err := auth_model.NewAccessToken(t); err != nil {
return err
}

View file

@ -10,15 +10,15 @@ import (
user_model "code.gitea.io/gitea/models/user"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var microcmdUserList = &cli.Command{
var microcmdUserList = cli.Command{
Name: "list",
Usage: "List users",
Action: runListUsers,
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "admin",
Usage: "List only admin users",
},
@ -33,7 +33,7 @@ func runListUsers(c *cli.Context) error {
return err
}
users, err := user_model.GetAllUsers(ctx)
users, err := user_model.GetAllUsers()
if err != nil {
return err
}
@ -48,7 +48,7 @@ func runListUsers(c *cli.Context) error {
}
}
} else {
twofa := user_model.UserList(users).GetTwoFaStatus(ctx)
twofa := user_model.UserList(users).GetTwoFaStatus()
fmt.Fprintf(w, "ID\tUsername\tEmail\tIsActive\tIsAdmin\t2FA\n")
for _, u := range users {
fmt.Fprintf(w, "%d\t%s\t%s\t%t\t%t\t%t\n", u.ID, u.Name, u.Email, u.IsActive, u.IsAdmin, twofa[u.ID])

View file

@ -9,25 +9,23 @@ import (
user_model "code.gitea.io/gitea/models/user"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var microcmdUserMustChangePassword = &cli.Command{
var microcmdUserMustChangePassword = cli.Command{
Name: "must-change-password",
Usage: "Set the must change password flag for the provided users or all users",
Action: runMustChangePassword,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "all",
Aliases: []string{"A"},
Usage: "All users must change password, except those explicitly excluded with --exclude",
cli.BoolFlag{
Name: "all,A",
Usage: "All users must change password, except those explicitly excluded with --exclude",
},
&cli.StringSliceFlag{
Name: "exclude",
Aliases: []string{"e"},
Usage: "Do not change the must-change-password flag for these users",
cli.StringSliceFlag{
Name: "exclude,e",
Usage: "Do not change the must-change-password flag for these users",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "unset",
Usage: "Instead of setting the must-change-password flag, unset it",
},
@ -50,7 +48,7 @@ func runMustChangePassword(c *cli.Context) error {
return err
}
n, err := user_model.SetMustChangePassword(ctx, all, mustChangePassword, c.Args().Slice(), exclude)
n, err := user_model.SetMustChangePassword(ctx, all, mustChangePassword, c.Args(), exclude)
if err != nil {
return err
}

View file

@ -20,43 +20,43 @@ import (
"strings"
"time"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// CmdCert represents the available cert sub-command.
var CmdCert = &cli.Command{
var CmdCert = cli.Command{
Name: "cert",
Usage: "Generate self-signed certificate",
Description: `Generate a self-signed X.509 certificate for a TLS server.
Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.`,
Action: runCert,
Flags: []cli.Flag{
&cli.StringFlag{
cli.StringFlag{
Name: "host",
Value: "",
Usage: "Comma-separated hostnames and IPs to generate a certificate for",
},
&cli.StringFlag{
cli.StringFlag{
Name: "ecdsa-curve",
Value: "",
Usage: "ECDSA curve to use to generate a key. Valid values are P224, P256, P384, P521",
},
&cli.IntFlag{
cli.IntFlag{
Name: "rsa-bits",
Value: 3072,
Value: 2048,
Usage: "Size of RSA key to generate. Ignored if --ecdsa-curve is set",
},
&cli.StringFlag{
cli.StringFlag{
Name: "start-date",
Value: "",
Usage: "Creation date formatted as Jan 1 15:04:05 2011",
},
&cli.DurationFlag{
cli.DurationFlag{
Name: "duration",
Value: 365 * 24 * time.Hour,
Usage: "Duration that certificate is valid for",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "ca",
Usage: "whether this cert should be its own Certificate Authority",
},
@ -136,7 +136,7 @@ func runCert(c *cli.Context) error {
SerialNumber: serialNumber,
Subject: pkix.Name{
Organization: []string{"Acme Co"},
CommonName: "Forgejo",
CommonName: "Gitea",
},
NotBefore: notBefore,
NotAfter: notAfter,

View file

@ -20,7 +20,7 @@ import (
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// argsSet checks that all the required arguments are set. args is a list of
@ -109,24 +109,15 @@ func setupConsoleLogger(level log.Level, colorize bool, out io.Writer) {
log.GetManager().GetLogger(log.DEFAULT).ReplaceAllWriters(writer)
}
func globalBool(c *cli.Context, name string) bool {
for _, ctx := range c.Lineage() {
if ctx.Bool(name) {
return true
}
}
return false
}
// PrepareConsoleLoggerLevel by default, use INFO level for console logger, but some sub-commands (for git/ssh protocol) shouldn't output any log to stdout.
// Any log appears in git stdout pipe will break the git protocol, eg: client can't push and hangs forever.
func PrepareConsoleLoggerLevel(defaultLevel log.Level) func(*cli.Context) error {
return func(c *cli.Context) error {
level := defaultLevel
if globalBool(c, "quiet") {
if c.Bool("quiet") || c.GlobalBoolT("quiet") {
level = log.FATAL
}
if globalBool(c, "debug") || globalBool(c, "verbose") {
if c.Bool("debug") || c.GlobalBool("debug") || c.Bool("verbose") || c.GlobalBool("verbose") {
level = log.TRACE
}
log.SetConsoleLogger(log.DEFAULT, "console-default", level)

View file

@ -10,18 +10,18 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// cmdDoctorConvert represents the available convert sub-command.
var cmdDoctorConvert = &cli.Command{
// CmdConvert represents the available convert sub-command.
var CmdConvert = cli.Command{
Name: "convert",
Usage: "Convert the database",
Description: "A command to convert an existing MySQL database from utf8 to utf8mb4 or MSSQL database from varchar to nvarchar",
Action: runDoctorConvert,
Action: runConvert,
}
func runDoctorConvert(ctx *cli.Context) error {
func runConvert(ctx *cli.Context) error {
stdCtx, cancel := installSignals()
defer cancel()

View file

@ -8,14 +8,14 @@ import (
"os"
"strings"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// CmdDocs represents the available docs sub-command.
var CmdDocs = &cli.Command{
var CmdDocs = cli.Command{
Name: "docs",
Usage: "Output CLI documentation",
Description: "A command to output Forgejo's CLI documentation, optionally to a file.",
Description: "A command to output Gitea's CLI documentation, optionally to a file.",
Action: runDocs,
Flags: []cli.Flag{
&cli.BoolFlag{
@ -23,9 +23,8 @@ var CmdDocs = &cli.Command{
Usage: "Output man pages instead",
},
&cli.StringFlag{
Name: "output",
Aliases: []string{"o"},
Usage: "Path to output to instead of stdout (will overwrite if exists)",
Name: "output, o",
Usage: "Path to output to instead of stdout (will overwrite if exists)",
},
},
}

View file

@ -18,72 +18,62 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
"xorm.io/xorm"
)
var cmdDoctorCheck = &cli.Command{
Name: "check",
// CmdDoctor represents the available doctor sub-command.
var CmdDoctor = cli.Command{
Name: "doctor",
Usage: "Diagnose and optionally fix problems",
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,
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.",
Action: runDoctor,
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "list",
Usage: "List the available checks",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "default",
Usage: "Run the default checks (if neither --run or --all is set, this is the default behaviour)",
},
&cli.StringSliceFlag{
cli.StringSliceFlag{
Name: "run",
Usage: "Run the provided checks - (if --default is set, the default checks will also run)",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "all",
Usage: "Run all the available checks",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "fix",
Usage: "Automatically fix what we can",
},
&cli.StringFlag{
cli.StringFlag{
Name: "log-file",
Usage: `Name of the log file (no verbose log output by default). Set to "-" to output to stdout`,
Usage: `Name of the log file (default: "doctor.log"). Set to "-" to output to stdout, set to "" to disable`,
},
&cli.BoolFlag{
Name: "color",
Aliases: []string{"H"},
Usage: "Use color for outputted information",
cli.BoolFlag{
Name: "color, H",
Usage: "Use color for outputted information",
},
},
}
// CmdDoctor represents the available doctor sub-command.
var CmdDoctor = &cli.Command{
Name: "doctor",
Usage: "Diagnose and optionally fix problems",
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,
Subcommands: []cli.Command{
cmdRecreateTable,
cmdDoctorConvert,
},
}
var cmdRecreateTable = &cli.Command{
var cmdRecreateTable = cli.Command{
Name: "recreate-table",
Usage: "Recreate tables from XORM definitions and copy the data.",
ArgsUsage: "[TABLE]... : (TABLEs to recreate - leave blank for all)",
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
Usage: "Print SQL commands sent",
},
},
Description: `The database definitions Forgejo uses change across versions, sometimes changing default values and leaving old unused columns.
Description: `The database definitions Gitea 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.
@ -142,9 +132,16 @@ func setupDoctorDefaultLogger(ctx *cli.Context, colorize bool) {
setupConsoleLogger(log.FATAL, log.CanColorStderr, os.Stderr)
logFile := ctx.String("log-file")
if logFile == "" {
return // if no doctor log-file is set, do not show any log from default logger
} else if logFile == "-" {
if !ctx.IsSet("log-file") {
logFile = "doctor.log"
}
if len(logFile) == 0 {
// if no doctor log-file is set, do not show any log from default logger
return
}
if logFile == "-" {
setupConsoleLogger(log.TRACE, colorize, os.Stdout)
} else {
logFile, _ = filepath.Abs(logFile)
@ -158,7 +155,7 @@ func setupDoctorDefaultLogger(ctx *cli.Context, colorize bool) {
}
}
func runDoctorCheck(ctx *cli.Context) error {
func runDoctor(ctx *cli.Context) error {
stdCtx, cancel := installSignals()
defer cancel()

View file

@ -22,7 +22,7 @@ import (
"gitea.com/go-chi/session"
"github.com/mholt/archiver/v3"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
func addReader(w archiver.Writer, r io.ReadCloser, info os.FileInfo, customName string, verbose bool) error {
@ -96,71 +96,64 @@ var outputTypeEnum = &outputType{
}
// CmdDump represents the available dump sub-command.
var CmdDump = &cli.Command{
var CmdDump = cli.Command{
Name: "dump",
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 Forgejo server image to send to maintainer`,
Action: runDump,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "file",
Aliases: []string{"f"},
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.StringFlag{
Name: "file, f",
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{
Name: "verbose",
Aliases: []string{"V"},
Usage: "Show process details",
cli.BoolFlag{
Name: "verbose, V",
Usage: "Show process details",
},
&cli.BoolFlag{
Name: "quiet",
Aliases: []string{"q"},
Usage: "Only display warnings and errors",
cli.BoolFlag{
Name: "quiet, q",
Usage: "Only display warnings and errors",
},
&cli.StringFlag{
Name: "tempdir",
Aliases: []string{"t"},
Value: os.TempDir(),
Usage: "Temporary dir path",
cli.StringFlag{
Name: "tempdir, t",
Value: os.TempDir(),
Usage: "Temporary dir path",
},
&cli.StringFlag{
Name: "database",
Aliases: []string{"d"},
Usage: "Specify the database SQL syntax: sqlite3, mysql, mssql, postgres",
cli.StringFlag{
Name: "database, d",
Usage: "Specify the database SQL syntax",
},
&cli.BoolFlag{
Name: "skip-repository",
Aliases: []string{"R"},
Usage: "Skip the repository dumping",
cli.BoolFlag{
Name: "skip-repository, R",
Usage: "Skip the repository dumping",
},
&cli.BoolFlag{
Name: "skip-log",
Aliases: []string{"L"},
Usage: "Skip the log dumping",
cli.BoolFlag{
Name: "skip-log, L",
Usage: "Skip the log dumping",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "skip-custom-dir",
Usage: "Skip custom directory",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "skip-lfs-data",
Usage: "Skip LFS data",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "skip-attachment-data",
Usage: "Skip attachment data",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "skip-package-data",
Usage: "Skip package data",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "skip-index",
Usage: "Skip bleve index data",
},
&cli.GenericFlag{
cli.GenericFlag{
Name: "type",
Value: outputTypeEnum,
Usage: fmt.Sprintf("Dump output format: %s", outputTypeEnum.Join()),
@ -452,7 +445,7 @@ func addRecursiveExclude(w archiver.Writer, insidePath, absPath string, excludeA
return err
}
for _, file := range files {
currentAbsPath := filepath.Join(absPath, file.Name())
currentAbsPath := path.Join(absPath, file.Name())
currentInsidePath := path.Join(insidePath, file.Name())
if file.IsDir() {
if !util.SliceContainsString(excludeAbsPath, currentAbsPath) {

View file

@ -19,58 +19,57 @@ import (
"code.gitea.io/gitea/services/convert"
"code.gitea.io/gitea/services/migrations"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// CmdDumpRepository represents the available dump repository sub-command.
var CmdDumpRepository = &cli.Command{
var CmdDumpRepository = cli.Command{
Name: "dump-repo",
Usage: "Dump the repository from git/github/gitea/gitlab",
Description: "This is a command for dumping the repository data.",
Action: runDumpRepository,
Flags: []cli.Flag{
&cli.StringFlag{
cli.StringFlag{
Name: "git_service",
Value: "",
Usage: "Git service, git, github, gitea, gitlab. If clone_addr could be recognized, this could be ignored.",
},
&cli.StringFlag{
Name: "repo_dir",
Aliases: []string{"r"},
Value: "./data",
Usage: "Repository dir path to store the data",
cli.StringFlag{
Name: "repo_dir, r",
Value: "./data",
Usage: "Repository dir path to store the data",
},
&cli.StringFlag{
cli.StringFlag{
Name: "clone_addr",
Value: "",
Usage: "The URL will be clone, currently could be a git/github/gitea/gitlab http/https URL",
},
&cli.StringFlag{
cli.StringFlag{
Name: "auth_username",
Value: "",
Usage: "The username to visit the clone_addr",
},
&cli.StringFlag{
cli.StringFlag{
Name: "auth_password",
Value: "",
Usage: "The password to visit the clone_addr",
},
&cli.StringFlag{
cli.StringFlag{
Name: "auth_token",
Value: "",
Usage: "The personal token to visit the clone_addr",
},
&cli.StringFlag{
cli.StringFlag{
Name: "owner_name",
Value: "",
Usage: "The data will be stored on a directory with owner name if not empty",
},
&cli.StringFlag{
cli.StringFlag{
Name: "repo_name",
Value: "",
Usage: "The data will be stored on a directory with repository name if not empty",
},
&cli.StringFlag{
cli.StringFlag{
Name: "units",
Value: "",
Usage: `Which items will be migrated, one or more units should be separated as comma.

View file

@ -19,74 +19,70 @@ import (
"code.gitea.io/gitea/modules/util"
"github.com/gobwas/glob"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// CmdEmbedded represents the available extract sub-command.
var (
CmdEmbedded = &cli.Command{
CmdEmbedded = cli.Command{
Name: "embedded",
Usage: "Extract embedded resources",
Description: "A command for extracting embedded resources, like templates and images",
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
subcmdList,
subcmdView,
subcmdExtract,
},
}
subcmdList = &cli.Command{
subcmdList = cli.Command{
Name: "list",
Usage: "List files matching the given pattern",
Action: runList,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "include-vendored",
Aliases: []string{"vendor"},
Usage: "Include files under public/vendor as well",
cli.BoolFlag{
Name: "include-vendored,vendor",
Usage: "Include files under public/vendor as well",
},
},
}
subcmdView = &cli.Command{
subcmdView = cli.Command{
Name: "view",
Usage: "View a file matching the given pattern",
Action: runView,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "include-vendored",
Aliases: []string{"vendor"},
Usage: "Include files under public/vendor as well",
cli.BoolFlag{
Name: "include-vendored,vendor",
Usage: "Include files under public/vendor as well",
},
},
}
subcmdExtract = &cli.Command{
subcmdExtract = cli.Command{
Name: "extract",
Usage: "Extract resources",
Action: runExtract,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "include-vendored",
Aliases: []string{"vendor"},
Usage: "Include files under public/vendor as well",
cli.BoolFlag{
Name: "include-vendored,vendor",
Usage: "Include files under public/vendor as well",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "overwrite",
Usage: "Overwrite files if they already exist",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "rename",
Usage: "Rename files as {name}.bak if they already exist (overwrites previous .bak)",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "custom",
Usage: "Extract to the 'custom' directory as per app.ini",
},
&cli.StringFlag{
Name: "destination",
Aliases: []string{"dest-dir"},
Usage: "Extract to the specified directory",
cli.StringFlag{
Name: "destination,dest-dir",
Usage: "Extract to the specified directory",
},
},
}
@ -103,7 +99,7 @@ type assetFile struct {
func initEmbeddedExtractor(c *cli.Context) error {
setupConsoleLogger(log.ERROR, log.CanColorStderr, os.Stderr)
patterns, err := compileCollectPatterns(c.Args().Slice())
patterns, err := compileCollectPatterns(c.Args())
if err != nil {
return err
}
@ -179,7 +175,7 @@ func runExtractDo(c *cli.Context) error {
return err
}
if c.NArg() == 0 {
if len(c.Args()) == 0 {
return fmt.Errorf("a list of pattern of files to extract is mandatory (e.g. '**' for all)")
}

View file

@ -16,14 +16,14 @@ import (
"code.gitea.io/gitea/modules/setting"
private_routers "code.gitea.io/gitea/routers/private"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
func CmdActions(ctx context.Context) *cli.Command {
return &cli.Command{
func CmdActions(ctx context.Context) cli.Command {
return cli.Command{
Name: "actions",
Usage: "Commands for managing Forgejo Actions",
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
SubcmdActionsGenerateRunnerToken(ctx),
SubcmdActionsGenerateRunnerSecret(ctx),
SubcmdActionsRegister(ctx),
@ -31,65 +31,63 @@ func CmdActions(ctx context.Context) *cli.Command {
}
}
func SubcmdActionsGenerateRunnerToken(ctx context.Context) *cli.Command {
return &cli.Command{
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) }),
Action: 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",
cli.StringFlag{
Name: "scope, s",
Value: "",
Usage: "{owner}[/{repo}] - leave empty for a global runner",
},
},
}
}
func SubcmdActionsGenerateRunnerSecret(ctx context.Context) *cli.Command {
return &cli.Command{
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{
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) }),
Action: func(cliCtx *cli.Context) error { return RunRegister(ctx, cliCtx) },
Flags: []cli.Flag{
&cli.StringFlag{
cli.StringFlag{
Name: "secret",
Usage: "the secret the runner will use to connect as a 40 character hexadecimal string",
},
&cli.StringFlag{
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{
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: "scope, s",
Value: "",
Usage: "{owner}[/{repo}] - leave empty for a global runner",
},
&cli.StringFlag{
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{
cli.StringFlag{
Name: "name",
Value: "runner",
Usage: "name of the runner (default runner)",
},
&cli.StringFlag{
cli.StringFlag{
Name: "version",
Value: "",
Usage: "version of the runner (not required since v1.21)",
@ -189,6 +187,8 @@ func RunRegister(ctx context.Context, cliCtx *cli.Context) error {
}
func RunGenerateSecret(ctx context.Context, cliCtx *cli.Context) error {
setting.MustInstalled()
runner := actions_model.ActionRunner{}
if err := runner.GenerateToken(); err != nil {
return err
@ -219,25 +219,3 @@ func RunGenerateActionsRunnerToken(ctx context.Context, cliCtx *cli.Context) 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)
}
}

View file

@ -16,7 +16,7 @@ import (
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
type key int
@ -29,12 +29,12 @@ const (
stdinKey
)
func CmdForgejo(ctx context.Context) *cli.Command {
return &cli.Command{
func CmdForgejo(ctx context.Context) cli.Command {
return cli.Command{
Name: "forgejo-cli",
Usage: "Forgejo CLI",
Flags: []cli.Flag{},
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
CmdActions(ctx),
},
}
@ -143,5 +143,5 @@ func handleCliResponseExtra(ctx context.Context, extra private.ResponseExtra) er
if ContextGetNoExit(ctx) {
return extra.Error
}
return cli.Exit(extra.Error, 1)
return cli.NewExitError(extra.Error, 1)
}

View file

@ -11,43 +11,43 @@ import (
"code.gitea.io/gitea/modules/generate"
"github.com/mattn/go-isatty"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var (
// CmdGenerate represents the available generate sub-command.
CmdGenerate = &cli.Command{
CmdGenerate = cli.Command{
Name: "generate",
Usage: "Command line interface for running generators",
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
subcmdSecret,
},
}
subcmdSecret = &cli.Command{
subcmdSecret = cli.Command{
Name: "secret",
Usage: "Generate a secret token",
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
microcmdGenerateInternalToken,
microcmdGenerateLfsJwtSecret,
microcmdGenerateSecretKey,
},
}
microcmdGenerateInternalToken = &cli.Command{
microcmdGenerateInternalToken = cli.Command{
Name: "INTERNAL_TOKEN",
Usage: "Generate a new INTERNAL_TOKEN",
Action: runGenerateInternalToken,
}
microcmdGenerateLfsJwtSecret = &cli.Command{
microcmdGenerateLfsJwtSecret = cli.Command{
Name: "JWT_SECRET",
Aliases: []string{"LFS_JWT_SECRET"},
Usage: "Generate a new JWT_SECRET",
Action: runGenerateLfsJwtSecret,
}
microcmdGenerateSecretKey = &cli.Command{
microcmdGenerateSecretKey = cli.Command{
Name: "SECRET_KEY",
Usage: "Generate a new SECRET_KEY",
Action: runGenerateSecretKey,
@ -70,12 +70,12 @@ func runGenerateInternalToken(c *cli.Context) error {
}
func runGenerateLfsJwtSecret(c *cli.Context) error {
_, jwtSecretBase64, err := generate.NewJwtSecretBase64()
JWTSecretBase64, err := generate.NewJwtSecretBase64()
if err != nil {
return err
}
fmt.Printf("%s", jwtSecretBase64)
fmt.Printf("%s", JWTSecretBase64)
if isatty.IsTerminal(os.Stdout.Fd()) {
fmt.Printf("\n")

View file

@ -20,7 +20,7 @@ import (
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
const (
@ -29,12 +29,12 @@ const (
var (
// CmdHook represents the available hooks sub-command.
CmdHook = &cli.Command{
CmdHook = cli.Command{
Name: "hook",
Usage: "Delegate commands to corresponding Git hooks",
Description: "This should only be called by Git",
Before: PrepareConsoleLoggerLevel(log.FATAL),
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
subcmdHookPreReceive,
subcmdHookUpdate,
subcmdHookPostReceive,
@ -42,47 +42,47 @@ var (
},
}
subcmdHookPreReceive = &cli.Command{
subcmdHookPreReceive = cli.Command{
Name: "pre-receive",
Usage: "Delegate pre-receive Git hook",
Description: "This command should only be called by Git",
Action: runHookPreReceive,
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
}
subcmdHookUpdate = &cli.Command{
subcmdHookUpdate = cli.Command{
Name: "update",
Usage: "Delegate update Git hook",
Description: "This command should only be called by Git",
Action: runHookUpdate,
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
}
subcmdHookPostReceive = &cli.Command{
subcmdHookPostReceive = cli.Command{
Name: "post-receive",
Usage: "Delegate post-receive Git hook",
Description: "This command should only be called by Git",
Action: runHookPostReceive,
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
}
// Note: new hook since git 2.29
subcmdHookProcReceive = &cli.Command{
subcmdHookProcReceive = cli.Command{
Name: "proc-receive",
Usage: "Delegate proc-receive Git hook",
Description: "This command should only be called by Git",
Action: runHookProcReceive,
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
@ -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 Forgejo environment not set.
return fail(ctx, `Rejecting changes as Gitea environment not set.
If you are pushing over SSH you must push with a key managed by
Forgejo or set your environment appropriately.`, "")
Gitea 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 Forgejo environment not set.
return fail(ctx, `Rejecting changes as Gitea environment not set.
If you are pushing over SSH you must push with a key managed by
Forgejo or set your environment appropriately.`, "")
Gitea 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 Forgejo environment not set.
return fail(ctx, `Rejecting changes as Gitea environment not set.
If you are pushing over SSH you must push with a key managed by
Forgejo or set your environment appropriately.`, "")
Gitea or set your environment appropriately.`, "")
}
return nil
}

View file

@ -11,39 +11,35 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// CmdKeys represents the available keys sub-command
var CmdKeys = &cli.Command{
var CmdKeys = cli.Command{
Name: "keys",
Usage: "This command queries the Forgejo database to get the authorized command for a given ssh key fingerprint",
Usage: "This command queries the Gitea database to get the authorized command for a given ssh key fingerprint",
Before: PrepareConsoleLoggerLevel(log.FATAL),
Action: runKeys,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "expected",
Aliases: []string{"e"},
Value: "git",
Usage: "Expected user for whom provide key commands",
cli.StringFlag{
Name: "expected, e",
Value: "git",
Usage: "Expected user for whom provide key commands",
},
&cli.StringFlag{
Name: "username",
Aliases: []string{"u"},
Value: "",
Usage: "Username trying to log in by SSH",
cli.StringFlag{
Name: "username, u",
Value: "",
Usage: "Username trying to log in by SSH",
},
&cli.StringFlag{
Name: "type",
Aliases: []string{"t"},
Value: "",
Usage: "Type of the SSH key provided to the SSH Server (requires content to be provided too)",
cli.StringFlag{
Name: "type, t",
Value: "",
Usage: "Type of the SSH key provided to the SSH Server (requires content to be provided too)",
},
&cli.StringFlag{
Name: "content",
Aliases: []string{"k"},
Value: "",
Usage: "Base64 encoded content of the SSH key provided to the SSH Server (requires type to be provided too)",
cli.StringFlag{
Name: "content, k",
Value: "",
Usage: "Base64 encoded content of the SSH key provided to the SSH Server (requires type to be provided too)",
},
},
}
@ -77,6 +73,6 @@ func runKeys(c *cli.Context) error {
if extra.Error != nil {
return extra.Error
}
_, _ = fmt.Fprintln(c.App.Writer, strings.TrimSpace(authorizedString))
fmt.Println(strings.TrimSpace(authorizedString))
return nil
}

View file

@ -9,7 +9,7 @@ import (
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
func runSendMail(c *cli.Context) error {

View file

@ -4,208 +4,12 @@
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"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// cmdHelp is our own help subcommand with more information
func cmdHelp() *cli.Command {
c := &cli.Command{
Name: "help",
Aliases: []string{"h"},
Usage: "Shows a list of commands or help for one command",
ArgsUsage: "[command]",
Action: func(c *cli.Context) (err error) {
lineage := c.Lineage() // The order is from child to parent: help, doctor, Gitea, {Command:nil}
targetCmdIdx := 0
if c.Command.Name == "help" {
targetCmdIdx = 1
}
if lineage[targetCmdIdx+1].Command != nil {
err = cli.ShowCommandHelp(lineage[targetCmdIdx+1], lineage[targetCmdIdx].Command.Name)
} else {
err = cli.ShowAppHelp(c)
}
_, _ = fmt.Fprintf(c.App.Writer, `
DEFAULT CONFIGURATION:
AppPath: %s
WorkPath: %s
CustomPath: %s
ConfigFile: %s
`, setting.AppPath, setting.AppWorkPath, setting.CustomPath, setting.CustomConf)
return err
},
}
return c
}
var helpFlag = cli.HelpFlag
func init() {
// cli.HelpFlag = nil TODO: after https://github.com/urfave/cli/issues/1794 we can use this
}
func appGlobalFlags() []cli.Flag {
return []cli.Flag{
// make the builtin flags at the top
helpFlag,
// shared configuration flags, they are for global and for each sub-command at the same time
// eg: such command is valid: "./gitea --config /tmp/app.ini web --config /tmp/app.ini", while it's discouraged indeed
// keep in mind that the short flags like "-C", "-c" and "-w" are globally polluted, they can't be used for sub-commands anymore.
&cli.StringFlag{
Name: "custom-path",
Aliases: []string{"C"},
Usage: "Set custom path (defaults to '{WorkPath}/custom')",
},
&cli.StringFlag{
Name: "config",
Aliases: []string{"c"},
Value: setting.CustomConf,
Usage: "Set custom config file (defaults to '{WorkPath}/custom/conf/app.ini')",
},
&cli.StringFlag{
Name: "work-path",
Aliases: []string{"w"},
Usage: "Set Forgejo's working path (defaults to the directory of the Forgejo binary)",
},
}
}
func prepareSubcommandWithConfig(command *cli.Command, globalFlags []cli.Flag) {
command.Flags = append(append([]cli.Flag{}, globalFlags...), command.Flags...)
command.Action = prepareWorkPathAndCustomConf(command.Action)
command.HideHelp = true
if command.Name != "help" {
command.Subcommands = append(command.Subcommands, cmdHelp())
}
for i := range command.Subcommands {
prepareSubcommandWithConfig(command.Subcommands[i], globalFlags)
}
}
// prepareWorkPathAndCustomConf wraps the Action to prepare the work path and custom config
// It can't use "Before", because each level's sub-command's Before will be called one by one, so the "init" would be done multiple times
func prepareWorkPathAndCustomConf(action cli.ActionFunc) func(ctx *cli.Context) error {
return func(ctx *cli.Context) error {
var args setting.ArgWorkPathAndCustomConf
// from children to parent, check the global flags
for _, curCtx := range ctx.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)
if ctx.Bool("help") || action == nil {
// the default behavior of "urfave/cli": "nil action" means "show help"
return cmdHelp().Action(ctx)
}
return action(ctx)
}
}
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 = "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
// these sub-commands need to use config file
subCmdWithConfig := []*cli.Command{
CmdWeb,
CmdServ,
CmdHook,
CmdDump,
CmdAdmin,
CmdMigrate,
CmdKeys,
CmdDoctor,
CmdManager,
CmdEmbedded,
CmdMigrateStorage,
CmdDumpRepository,
CmdRestoreRepository,
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{
CmdCert,
CmdGenerate,
CmdDocs,
}
subCmdStandalone = append(subCmdStandalone, subCmdsStandaloneArgs...)
app.DefaultCommand = CmdWeb.Name
globalFlags := appGlobalFlags()
app.Flags = append(app.Flags, cli.VersionFlag)
app.Flags = append(app.Flags, globalFlags...)
app.HideHelp = true // use our own help action to show helps (with more information like default config)
app.Before = PrepareConsoleLoggerLevel(log.INFO)
for i := range subCmdWithConfig {
prepareSubcommandWithConfig(subCmdWithConfig[i], globalFlags)
}
app.Commands = append(app.Commands, subCmdWithConfig...)
app.Commands = append(app.Commands, subCmdStandalone...)
return app
}
func RunMainApp(app *cli.App, args ...string) error {
err := app.Run(args)
if err == nil {

View file

@ -6,17 +6,14 @@ package cmd
import (
"fmt"
"io"
"os"
"path/filepath"
"strings"
"testing"
"code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/test"
"github.com/stretchr/testify/assert"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
func TestMain(m *testing.M) {
@ -25,16 +22,11 @@ func TestMain(m *testing.M) {
})
}
func makePathOutput(workPath, customPath, customConf string) string {
return fmt.Sprintf("WorkPath=%s\nCustomPath=%s\nCustomConf=%s", workPath, customPath, customConf)
}
func newTestApp(testCmdAction func(ctx *cli.Context) error) *cli.App {
app := NewMainApp("version", "version-extra")
testCmd := &cli.Command{Name: "test-cmd", Action: testCmdAction}
prepareSubcommandWithConfig(testCmd, appGlobalFlags())
app := cli.NewApp()
app.HelpName = "gitea"
testCmd := cli.Command{Name: "test-cmd", Action: testCmdAction}
app.Commands = append(app.Commands, testCmd)
app.DefaultCommand = testCmd.Name
return app
}
@ -61,94 +53,6 @@ func runTestApp(app *cli.App, args ...string) (runResult, error) {
return runResult{outBuf.String(), errBuf.String(), exitCode}, err
}
func TestCliCmd(t *testing.T) {
defaultWorkPath := filepath.Dir(setting.AppPath)
defaultCustomPath := filepath.Join(defaultWorkPath, "custom")
defaultCustomConf := filepath.Join(defaultCustomPath, "conf/app.ini")
cli.CommandHelpTemplate = "(command help template)"
cli.AppHelpTemplate = "(app help template)"
cli.SubcommandHelpTemplate = "(subcommand help template)"
cases := []struct {
env map[string]string
cmd string
exp string
}{
// main command help
{
cmd: "./gitea help",
exp: "DEFAULT CONFIGURATION:",
},
// parse paths
{
cmd: "./gitea test-cmd",
exp: makePathOutput(defaultWorkPath, defaultCustomPath, defaultCustomConf),
},
{
cmd: "./gitea -c /tmp/app.ini test-cmd",
exp: makePathOutput(defaultWorkPath, defaultCustomPath, "/tmp/app.ini"),
},
{
cmd: "./gitea test-cmd -c /tmp/app.ini",
exp: makePathOutput(defaultWorkPath, defaultCustomPath, "/tmp/app.ini"),
},
{
env: map[string]string{"GITEA_WORK_DIR": "/tmp"},
cmd: "./gitea test-cmd",
exp: makePathOutput("/tmp", "/tmp/custom", "/tmp/custom/conf/app.ini"),
},
{
env: map[string]string{"GITEA_WORK_DIR": "/tmp"},
cmd: "./gitea test-cmd --work-path /tmp/other",
exp: makePathOutput("/tmp/other", "/tmp/other/custom", "/tmp/other/custom/conf/app.ini"),
},
{
env: map[string]string{"GITEA_WORK_DIR": "/tmp"},
cmd: "./gitea test-cmd --config /tmp/app-other.ini",
exp: makePathOutput("/tmp", "/tmp/custom", "/tmp/app-other.ini"),
},
}
app := newTestApp(func(ctx *cli.Context) error {
_, _ = fmt.Fprint(ctx.App.Writer, makePathOutput(setting.AppWorkPath, setting.CustomPath, setting.CustomConf))
return nil
})
var envBackup []string
for _, s := range os.Environ() {
if strings.HasPrefix(s, "GITEA_") && strings.Contains(s, "=") {
envBackup = append(envBackup, s)
}
}
clearGiteaEnv := func() {
for _, s := range os.Environ() {
if strings.HasPrefix(s, "GITEA_") {
_ = os.Unsetenv(s)
}
}
}
defer func() {
clearGiteaEnv()
for _, s := range envBackup {
k, v, _ := strings.Cut(s, "=")
_ = os.Setenv(k, v)
}
}()
for _, c := range cases {
clearGiteaEnv()
for k, v := range c.env {
_ = os.Setenv(k, v)
}
args := strings.Split(c.cmd, " ") // for test only, "split" is good enough
r, err := runTestApp(app, args...)
assert.NoError(t, err, c.cmd)
assert.NotEmpty(t, c.exp, c.cmd)
assert.Contains(t, r.Stdout, c.exp, c.cmd)
}
}
func TestCliCmdError(t *testing.T) {
app := newTestApp(func(ctx *cli.Context) error { return fmt.Errorf("normal error") })
r, err := runTestApp(app, "./gitea", "test-cmd")
@ -157,7 +61,7 @@ func TestCliCmdError(t *testing.T) {
assert.Equal(t, "", r.Stdout)
assert.Equal(t, "Command error: normal error\n", r.Stderr)
app = newTestApp(func(ctx *cli.Context) error { return cli.Exit("exit error", 2) })
app = newTestApp(func(ctx *cli.Context) error { return cli.NewExitError("exit error", 2) })
r, err = runTestApp(app, "./gitea", "test-cmd")
assert.Error(t, err)
assert.Equal(t, 2, r.ExitCode)
@ -168,7 +72,7 @@ func TestCliCmdError(t *testing.T) {
r, err = runTestApp(app, "./gitea", "test-cmd", "--no-such")
assert.Error(t, err)
assert.Equal(t, 1, r.ExitCode)
assert.Equal(t, "Incorrect Usage: flag provided but not defined: -no-such\n\n", r.Stdout)
assert.EqualValues(t, "Incorrect Usage: flag provided but not defined: -no-such\n\nNAME:\n gitea test-cmd - \n\nUSAGE:\n gitea test-cmd [arguments...]\n", r.Stdout)
assert.Equal(t, "", r.Stderr) // the cli package's strange behavior, the error message is not in stderr ....
app = newTestApp(func(ctx *cli.Context) error { return nil })

View file

@ -9,16 +9,16 @@ import (
"code.gitea.io/gitea/modules/private"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var (
// CmdManager represents the manager command
CmdManager = &cli.Command{
CmdManager = cli.Command{
Name: "manager",
Usage: "Manage the running forgejo process",
Description: "This is a command for managing the running forgejo process",
Subcommands: []*cli.Command{
Usage: "Manage the running gitea process",
Description: "This is a command for managing the running gitea process",
Subcommands: []cli.Command{
subcmdShutdown,
subcmdRestart,
subcmdReloadTemplates,
@ -27,80 +27,80 @@ var (
subCmdProcesses,
},
}
subcmdShutdown = &cli.Command{
subcmdShutdown = cli.Command{
Name: "shutdown",
Usage: "Gracefully shutdown the running process",
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
Action: runShutdown,
}
subcmdRestart = &cli.Command{
subcmdRestart = cli.Command{
Name: "restart",
Usage: "Gracefully restart the running process - (not implemented for windows servers)",
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
Action: runRestart,
}
subcmdReloadTemplates = &cli.Command{
subcmdReloadTemplates = cli.Command{
Name: "reload-templates",
Usage: "Reload template files in the running process",
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
Action: runReloadTemplates,
}
subcmdFlushQueues = &cli.Command{
subcmdFlushQueues = cli.Command{
Name: "flush-queues",
Usage: "Flush queues in the running process",
Action: runFlushQueues,
Flags: []cli.Flag{
&cli.DurationFlag{
cli.DurationFlag{
Name: "timeout",
Value: 60 * time.Second,
Usage: "Timeout for the flushing process",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "non-blocking",
Usage: "Set to true to not wait for flush to complete before returning",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
}
subCmdProcesses = &cli.Command{
subCmdProcesses = cli.Command{
Name: "processes",
Usage: "Display running processes within the current process",
Action: runProcesses,
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "flat",
Usage: "Show processes as flat table rather than as tree",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "no-system",
Usage: "Do not show system processes",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "stacktraces",
Usage: "Show stacktraces",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "json",
Usage: "Output as json",
},
&cli.StringFlag{
cli.StringFlag{
Name: "cancel",
Usage: "Process PID to cancel. (Only available for non-system processes.)",
},

View file

@ -10,61 +10,49 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
var (
defaultLoggingFlags = []cli.Flag{
&cli.StringFlag{
cli.StringFlag{
Name: "logger",
Usage: `Logger name - will default to "default"`,
},
&cli.StringFlag{
}, cli.StringFlag{
Name: "writer",
Usage: "Name of the log writer - will default to mode",
},
&cli.StringFlag{
}, cli.StringFlag{
Name: "level",
Usage: "Logging level for the new logger",
},
&cli.StringFlag{
Name: "stacktrace-level",
Aliases: []string{"L"},
Usage: "Stacktrace logging level",
},
&cli.StringFlag{
Name: "flags",
Aliases: []string{"F"},
Usage: "Flags for the logger",
},
&cli.StringFlag{
Name: "expression",
Aliases: []string{"e"},
Usage: "Matching expression for the logger",
},
&cli.StringFlag{
Name: "prefix",
Aliases: []string{"p"},
Usage: "Prefix for the logger",
},
&cli.BoolFlag{
}, cli.StringFlag{
Name: "stacktrace-level, L",
Usage: "Stacktrace logging level",
}, cli.StringFlag{
Name: "flags, F",
Usage: "Flags for the logger",
}, cli.StringFlag{
Name: "expression, e",
Usage: "Matching expression for the logger",
}, cli.StringFlag{
Name: "prefix, p",
Usage: "Prefix for the logger",
}, cli.BoolFlag{
Name: "color",
Usage: "Use color in the logs",
},
&cli.BoolFlag{
}, cli.BoolFlag{
Name: "debug",
},
}
subcmdLogging = &cli.Command{
subcmdLogging = cli.Command{
Name: "logging",
Usage: "Adjust logging commands",
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
{
Name: "pause",
Usage: "Pause logging (Forgejo will buffer logs up to a certain point and will drop them after that point)",
Usage: "Pause logging (Gitea will buffer logs up to a certain point and will drop them after that point)",
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
@ -73,16 +61,16 @@ var (
Name: "resume",
Usage: "Resume logging",
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
Action: runResumeLogging,
}, {
Name: "release-and-reopen",
Usage: "Cause Forgejo to release and re-open files used for logging",
Usage: "Cause Gitea to release and re-open files used for logging",
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
@ -92,9 +80,9 @@ var (
Usage: "Remove a logger",
ArgsUsage: "[name] Name of logger to remove",
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
}, &cli.StringFlag{
}, cli.StringFlag{
Name: "logger",
Usage: `Logger name - will default to "default"`,
},
@ -103,48 +91,32 @@ var (
}, {
Name: "add",
Usage: "Add a logger",
Subcommands: []*cli.Command{
Subcommands: []cli.Command{
{
Name: "file",
Usage: "Add a file logger",
Flags: append(defaultLoggingFlags, []cli.Flag{
&cli.StringFlag{
Name: "filename",
Aliases: []string{"f"},
Usage: "Filename for the logger - this must be set.",
},
&cli.BoolFlag{
Name: "rotate",
Aliases: []string{"r"},
Usage: "Rotate logs",
Value: true,
},
&cli.Int64Flag{
Name: "max-size",
Aliases: []string{"s"},
Usage: "Maximum size in bytes before rotation",
},
&cli.BoolFlag{
Name: "daily",
Aliases: []string{"d"},
Usage: "Rotate logs daily",
Value: true,
},
&cli.IntFlag{
Name: "max-days",
Aliases: []string{"D"},
Usage: "Maximum number of daily logs to keep",
},
&cli.BoolFlag{
Name: "compress",
Aliases: []string{"z"},
Usage: "Compress rotated logs",
Value: true,
},
&cli.IntFlag{
Name: "compression-level",
Aliases: []string{"Z"},
Usage: "Compression level to use",
cli.StringFlag{
Name: "filename, f",
Usage: "Filename for the logger - this must be set.",
}, cli.BoolTFlag{
Name: "rotate, r",
Usage: "Rotate logs",
}, cli.Int64Flag{
Name: "max-size, s",
Usage: "Maximum size in bytes before rotation",
}, cli.BoolTFlag{
Name: "daily, d",
Usage: "Rotate logs daily",
}, cli.IntFlag{
Name: "max-days, D",
Usage: "Maximum number of daily logs to keep",
}, cli.BoolTFlag{
Name: "compress, z",
Usage: "Compress rotated logs",
}, cli.IntFlag{
Name: "compression-level, Z",
Usage: "Compression level to use",
},
}...),
Action: runAddFileLogger,
@ -152,25 +124,18 @@ var (
Name: "conn",
Usage: "Add a net conn logger",
Flags: append(defaultLoggingFlags, []cli.Flag{
&cli.BoolFlag{
Name: "reconnect-on-message",
Aliases: []string{"R"},
Usage: "Reconnect to host for every message",
},
&cli.BoolFlag{
Name: "reconnect",
Aliases: []string{"r"},
Usage: "Reconnect to host when connection is dropped",
},
&cli.StringFlag{
Name: "protocol",
Aliases: []string{"P"},
Usage: "Set protocol to use: tcp, unix, or udp (defaults to tcp)",
},
&cli.StringFlag{
Name: "address",
Aliases: []string{"a"},
Usage: "Host address and port to connect to (defaults to :7020)",
cli.BoolFlag{
Name: "reconnect-on-message, R",
Usage: "Reconnect to host for every message",
}, cli.BoolFlag{
Name: "reconnect, r",
Usage: "Reconnect to host when connection is dropped",
}, cli.StringFlag{
Name: "protocol, P",
Usage: "Set protocol to use: tcp, unix, or udp (defaults to tcp)",
}, cli.StringFlag{
Name: "address, a",
Usage: "Host address and port to connect to (defaults to :7020)",
},
}...),
Action: runAddConnLogger,
@ -180,10 +145,9 @@ var (
Name: "log-sql",
Usage: "Set LogSQL",
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
&cli.BoolFlag{
}, cli.BoolFlag{
Name: "off",
Usage: "Switch off SQL logging",
},

View file

@ -11,11 +11,11 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// CmdMigrate represents the available migrate sub-command.
var CmdMigrate = &cli.Command{
var CmdMigrate = cli.Command{
Name: "migrate",
Usage: "Migrate the database",
Description: "This is a command for migrating the database, so that you can run gitea admin create-user before starting the server.",

View file

@ -20,73 +20,70 @@ import (
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// CmdMigrateStorage represents the available migrate storage sub-command.
var CmdMigrateStorage = &cli.Command{
var CmdMigrateStorage = cli.Command{
Name: "migrate-storage",
Usage: "Migrate the storage",
Description: "Copies stored files from storage configured in app.ini to parameter-configured storage",
Action: runMigrateStorage,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "type",
Aliases: []string{"t"},
Value: "",
Usage: "Type of stored files to copy. Allowed types: 'attachments', 'lfs', 'avatars', 'repo-avatars', 'repo-archivers', 'packages', 'actions-log'",
cli.StringFlag{
Name: "type, t",
Value: "",
Usage: "Type of stored files to copy. Allowed types: 'attachments', 'lfs', 'avatars', 'repo-avatars', 'repo-archivers', 'packages', 'actions-log'",
},
&cli.StringFlag{
Name: "storage",
Aliases: []string{"s"},
Value: "",
Usage: "New storage type: local (default) or minio",
cli.StringFlag{
Name: "storage, s",
Value: "",
Usage: "New storage type: local (default) or minio",
},
&cli.StringFlag{
Name: "path",
Aliases: []string{"p"},
Value: "",
Usage: "New storage placement if store is local (leave blank for default)",
cli.StringFlag{
Name: "path, p",
Value: "",
Usage: "New storage placement if store is local (leave blank for default)",
},
&cli.StringFlag{
cli.StringFlag{
Name: "minio-endpoint",
Value: "",
Usage: "Minio storage endpoint",
},
&cli.StringFlag{
cli.StringFlag{
Name: "minio-access-key-id",
Value: "",
Usage: "Minio storage accessKeyID",
},
&cli.StringFlag{
cli.StringFlag{
Name: "minio-secret-access-key",
Value: "",
Usage: "Minio storage secretAccessKey",
},
&cli.StringFlag{
cli.StringFlag{
Name: "minio-bucket",
Value: "",
Usage: "Minio storage bucket",
},
&cli.StringFlag{
cli.StringFlag{
Name: "minio-location",
Value: "",
Usage: "Minio storage location to create bucket",
},
&cli.StringFlag{
cli.StringFlag{
Name: "minio-base-path",
Value: "",
Usage: "Minio storage base path on the bucket",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "minio-use-ssl",
Usage: "Enable SSL for minio",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "minio-insecure-skip-verify",
Usage: "Skip SSL verification",
},
&cli.StringFlag{
cli.StringFlag{
Name: "minio-checksum-algorithm",
Value: "",
Usage: "Minio checksum algorithm (default/md5)",
@ -110,9 +107,6 @@ 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
})
@ -120,9 +114,6 @@ 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
})
@ -191,7 +182,7 @@ func runMigrateStorage(ctx *cli.Context) error {
case string(setting.LocalStorageType):
p := ctx.String("path")
if p == "" {
log.Fatal("Path must be given when storage is local")
log.Fatal("Path must be given when storage is loal")
return nil
}
dstStorage, err = storage.NewLocalStorage(

View file

@ -9,7 +9,6 @@ import (
"strings"
"testing"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/packages"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
@ -31,7 +30,7 @@ func TestMigratePackages(t *testing.T) {
assert.NoError(t, err)
defer buf.Close()
v, f, err := packages_service.CreatePackageAndAddFile(db.DefaultContext, &packages_service.PackageCreationInfo{
v, f, err := packages_service.CreatePackageAndAddFile(&packages_service.PackageCreationInfo{
PackageInfo: packages_service.PackageInfo{
Owner: creator,
PackageType: packages.TypeGeneric,

View file

@ -9,39 +9,38 @@ import (
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// CmdRestoreRepository represents the available restore a repository sub-command.
var CmdRestoreRepository = &cli.Command{
var CmdRestoreRepository = cli.Command{
Name: "restore-repo",
Usage: "Restore the repository from disk",
Description: "This is a command for restoring the repository data.",
Action: runRestoreRepository,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo_dir",
Aliases: []string{"r"},
Value: "./data",
Usage: "Repository dir path to restore from",
cli.StringFlag{
Name: "repo_dir, r",
Value: "./data",
Usage: "Repository dir path to restore from",
},
&cli.StringFlag{
cli.StringFlag{
Name: "owner_name",
Value: "",
Usage: "Restore destination owner name",
},
&cli.StringFlag{
cli.StringFlag{
Name: "repo_name",
Value: "",
Usage: "Restore destination repository name",
},
&cli.StringFlag{
cli.StringFlag{
Name: "units",
Value: "",
Usage: `Which items will be restored, one or more units should be separated as comma.
wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments are allowed. Empty means all units.`,
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "validation",
Usage: "Sanity check the content of the files before trying to load them",
},

View file

@ -30,9 +30,9 @@ import (
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/services/lfs"
"github.com/golang-jwt/jwt/v5"
"github.com/golang-jwt/jwt/v4"
"github.com/kballard/go-shellquote"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
const (
@ -40,17 +40,17 @@ const (
)
// CmdServ represents the available serv sub-command.
var CmdServ = &cli.Command{
var CmdServ = cli.Command{
Name: "serv",
Usage: "This command should only be called by SSH shell",
Description: "Serv provides access auth for repositories",
Before: PrepareConsoleLoggerLevel(log.FATAL),
Action: runServ,
Flags: []cli.Flag{
&cli.BoolFlag{
cli.BoolFlag{
Name: "enable-pprof",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "debug",
},
},
@ -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, "Forgejo:", userMessage)
_, _ = fmt.Fprintln(os.Stderr, "Gitea:", userMessage)
if logMsgFmt != "" {
logMsg := fmt.Sprintf(logMsgFmt, args...)
if !setting.IsProd {
_, _ = fmt.Fprintln(os.Stderr, "Forgejo:", logMsg)
_, _ = fmt.Fprintln(os.Stderr, "Gitea:", logMsg)
}
if userMessage != "" {
if unicode.IsPunct(rune(userMessage[len(userMessage)-1])) {
@ -119,7 +119,7 @@ func fail(ctx context.Context, userMessage, logMsgFmt string, args ...any) error
}
_ = private.SSHLog(ctx, true, logMsg)
}
return cli.Exit("", 1)
return cli.NewExitError("", 1)
}
// handleCliResponseExtra handles the extra response from the cli sub-commands
@ -130,7 +130,7 @@ func handleCliResponseExtra(extra private.ResponseExtra) error {
_, _ = fmt.Fprintln(os.Stdout, extra.UserMsg)
}
if extra.HasError() {
return cli.Exit(extra.Error, 1)
return cli.NewExitError(extra.Error, 1)
}
return nil
}
@ -143,24 +143,24 @@ func runServ(c *cli.Context) error {
setup(ctx, c.Bool("debug"))
if setting.SSH.Disabled {
println("Forgejo: SSH has been disabled")
println("Gitea: SSH has been disabled")
return nil
}
if c.NArg() < 1 {
if len(c.Args()) < 1 {
if err := cli.ShowSubcommandHelp(c); err != nil {
fmt.Printf("error showing subcommand help: %v\n", err)
}
return nil
}
keys := strings.Split(c.Args().First(), "-")
keys := strings.Split(c.Args()[0], "-")
if len(keys) != 2 || keys[0] != "key" {
return fail(ctx, "Key ID format error", "Invalid key argument: %s", c.Args().First())
return fail(ctx, "Key ID format error", "Invalid key argument: %s", c.Args()[0])
}
keyID, err := strconv.ParseInt(keys[1], 10, 64)
if err != nil {
return fail(ctx, "Key ID parsing error", "Invalid key argument: %s", c.Args().Get(1))
return fail(ctx, "Key ID parsing error", "Invalid key argument: %s", c.Args()[1])
}
cmd := os.Getenv("SSH_ORIGINAL_COMMAND")
@ -216,18 +216,16 @@ 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 := 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))
username := strings.ToLower(rr[0])
reponame := strings.ToLower(strings.TrimSuffix(rr[1], ".git"))
if alphaDashDotPattern.MatchString(reponame) {
return fail(ctx, "Invalid repo name", "Invalid repo name: %s", reponame)

View file

@ -15,54 +15,49 @@ import (
_ "net/http/pprof" // Used for debugging if enabled and a web server is running
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/public"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/routers"
"code.gitea.io/gitea/routers/install"
"github.com/felixge/fgprof"
"github.com/urfave/cli/v2"
"github.com/urfave/cli"
)
// PIDFile could be set from build tag
var PIDFile = "/run/gitea.pid"
// CmdWeb represents the available web sub-command.
var CmdWeb = &cli.Command{
var CmdWeb = cli.Command{
Name: "web",
Usage: "Start the Forgejo web server",
Description: `The Forgejo web server is the only thing you need to run,
Usage: "Start Gitea web server",
Description: `Gitea 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,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "port",
Aliases: []string{"p"},
Value: "3000",
Usage: "Temporary port number to prevent conflict",
cli.StringFlag{
Name: "port, p",
Value: "3000",
Usage: "Temporary port number to prevent conflict",
},
&cli.StringFlag{
cli.StringFlag{
Name: "install-port",
Value: "3000",
Usage: "Temporary port number to run the install page on to prevent conflict",
},
&cli.StringFlag{
Name: "pid",
Aliases: []string{"P"},
Value: PIDFile,
Usage: "Custom pid file path",
cli.StringFlag{
Name: "pid, P",
Value: PIDFile,
Usage: "Custom pid file path",
},
&cli.BoolFlag{
Name: "quiet",
Aliases: []string{"q"},
Usage: "Only display Fatal logging errors until logging is set-up",
cli.BoolFlag{
Name: "quiet, q",
Usage: "Only display Fatal logging errors until logging is set-up",
},
&cli.BoolFlag{
cli.BoolFlag{
Name: "verbose",
Usage: "Set initial logging to TRACE level until logging is properly set-up",
},
@ -107,18 +102,13 @@ func createPIDFile(pidPath string) {
}
}
func showWebStartupMessage(msg string) {
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)
log.Info("* CustomPath: %s", setting.CustomPath)
log.Info("* ConfigFile: %s", setting.CustomConf)
log.Info("%s", msg)
}
func serveInstall(ctx *cli.Context) error {
showWebStartupMessage("Prepare to run install page")
log.Info("Gitea version: %s%s", setting.AppVer, setting.AppBuiltWith)
log.Info("App path: %s", setting.AppPath)
log.Info("Work path: %s", setting.AppWorkPath)
log.Info("Custom path: %s", setting.CustomPath)
log.Info("Config file: %s", setting.CustomConf)
log.Info("Prepare to run install page")
routers.InitWebInstallPage(graceful.GetManager().HammerContext())
@ -136,13 +126,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 Forgejo already running?")
log.Critical("Unable to open listener for installer. Is Gitea already running?")
graceful.GetManager().DoGracefulShutdown()
}
select {
case <-graceful.GetManager().IsShutdown():
<-graceful.GetManager().Done()
log.Info("PID: %d Forgejo Web Finished", os.Getpid())
log.Info("PID: %d Gitea Web Finished", os.Getpid())
log.GetManager().Close()
return err
default:
@ -155,42 +145,33 @@ func serveInstalled(ctx *cli.Context) error {
setting.LoadCommonSettings()
setting.MustInstalled()
showWebStartupMessage("Prepare to run web server")
log.Info("Gitea version: %s%s", setting.AppVer, setting.AppBuiltWith)
log.Info("App path: %s", setting.AppPath)
log.Info("Work path: %s", setting.AppWorkPath)
log.Info("Custom path: %s", setting.CustomPath)
log.Info("Config file: %s", setting.CustomConf)
log.Info("Run mode: %s", setting.RunMode)
log.Info("Prepare to run web server")
if setting.AppWorkPathMismatch {
log.Error("WORK_PATH from config %q doesn't match other paths from environment variables or command arguments. "+
"Only WORK_PATH in config should be set and used. Please make sure the path in config file is correct, "+
"remove the other outdated work paths from environment variables and command arguments", setting.CustomConf)
"Only WORK_PATH in config should be set and used. Please remove the other outdated work paths from environment variables and command arguments", setting.CustomConf)
}
rootCfg := setting.CfgProvider
if rootCfg.Section("").Key("WORK_PATH").String() == "" {
saveCfg, err := rootCfg.PrepareSaving()
if err != nil {
log.Error("Unable to prepare saving WORK_PATH=%s to config %q: %v\nYou should set it manually, otherwise there might be bugs when accessing the git repositories.", setting.AppWorkPath, setting.CustomConf, err)
log.Error("Unable to prepare saving WORK_PATH=%s to config %q: %v\nYou must set it manually, otherwise there might be bugs when accessing the git repositories.", setting.AppWorkPath, setting.CustomConf, err)
} else {
rootCfg.Section("").Key("WORK_PATH").SetValue(setting.AppWorkPath)
saveCfg.Section("").Key("WORK_PATH").SetValue(setting.AppWorkPath)
if err = saveCfg.Save(); err != nil {
log.Error("Unable to update WORK_PATH=%s to config %q: %v\nYou should set it manually, otherwise there might be bugs when accessing the git repositories.", setting.AppWorkPath, setting.CustomConf, err)
log.Error("Unable to update WORK_PATH=%s to config %q: %v\nYou must set it manually, otherwise there might be bugs when accessing the git repositories.", setting.AppWorkPath, setting.CustomConf, err)
}
}
}
// in old versions, user's custom web files are placed in "custom/public", and they were served as "http://domain.com/assets/xxx"
// now, Gitea only serves pre-defined files in the "custom/public" folder basing on the web root, the user should move their custom files to "custom/public/assets"
publicFiles, _ := public.AssetFS().ListFiles(".")
publicFilesSet := container.SetOf(publicFiles...)
publicFilesSet.Remove(".well-known")
publicFilesSet.Remove("assets")
publicFilesSet.Remove("robots.txt")
for _, fn := range publicFilesSet.Values() {
log.Error("Found legacy public asset %q in CustomPath. Please move it to %s/public/assets/%s", fn, setting.CustomPath, fn)
}
if _, err := os.Stat(filepath.Join(setting.CustomPath, "robots.txt")); err == nil {
log.Error(`Found legacy public asset "robots.txt" in CustomPath. Please move it to %s/public/robots.txt`, setting.CustomPath)
}
routers.InitWebInstalled(graceful.GetManager().HammerContext())
// We check that AppDataPath exists here (it should have been created during installation)
@ -208,10 +189,10 @@ func serveInstalled(ctx *cli.Context) error {
}
// Set up Chi routes
webRoutes := routers.NormalRoutes()
err := listen(webRoutes, true)
c := routers.NormalRoutes(graceful.GetManager().HammerContext())
err := listen(c, true)
<-graceful.GetManager().Done()
log.Info("PID: %d Forgejo Web Finished", os.Getpid())
log.Info("PID: %d Gitea Web Finished", os.Getpid())
log.GetManager().Close()
return err
}
@ -237,9 +218,9 @@ func runWeb(ctx *cli.Context) error {
defer cancel()
if os.Getppid() > 1 && len(os.Getenv("LISTEN_FDS")) > 0 {
log.Info("Restarting Forgejo on PID: %d from parent PID: %d", os.Getpid(), os.Getppid())
log.Info("Restarting Gitea on PID: %d from parent PID: %d", os.Getpid(), os.Getppid())
} else {
log.Info("Starting Forgejo on PID: %d", os.Getpid())
log.Info("Starting Gitea on PID: %d", os.Getpid())
}
// Set pid file setting
@ -299,7 +280,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: Forgejo Server", process.SystemProcessType, true)
_, _, finished := process.GetManager().AddTypedContext(graceful.GetManager().HammerContext(), "Web: Gitea 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.

Some files were not shown because too many files have changed in this diff Show more