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
1398 changed files with 35000 additions and 23733 deletions

View file

@ -13,46 +13,42 @@ groups:
-
name: BREAKING
labels:
- kind/breaking
- pr/breaking
-
name: SECURITY
labels:
- kind/security
- topic/security
-
name: FEATURES
labels:
- kind/feature
- type/feature
-
name: API
labels:
- kind/api
- modifies/api
-
name: ENHANCEMENTS
labels:
- kind/enhancement
- kind/refactor
- kind/ui
- type/enhancement
- type/refactoring
- topic/ui
-
name: BUGFIXES
labels:
- kind/bug
- type/bug
-
name: TESTING
labels:
- kind/testing
-
name: TRANSLATION
labels:
- kind/translation
- type/testing
-
name: BUILD
labels:
- kind/build
- kind/lint
- topic/build
- topic/code-linting
-
name: DOCS
labels:
- kind/docs
- type/docs
-
name: MISC
default: true

View file

@ -1,138 +1,3 @@
---
kind: pipeline
type: docker
name: release-latest
platform:
os: linux
arch: amd64
workspace:
base: /source
path: /
trigger:
branch:
- main
- "release/*"
event:
- push
paths:
exclude:
- "docs/**"
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
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
- name: release-branch
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_BRANCH##release/v}"
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
when:
branch:
- "release/*"
event:
- push
- name: release-main
image: woodpeckerci/plugin-s3:latest
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/main
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
when:
branch:
- main
event:
- push
---
kind: pipeline
name: release-version
@ -379,133 +244,6 @@ steps:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: docker-linux-amd64-release
platform:
os: linux
arch: amd64
trigger:
ref:
- refs/heads/main
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: false
tags: nightly-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: false
tags: nightly-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
name: docker-linux-amd64-release-branch
platform:
os: linux
arch: amd64
trigger:
ref:
- "refs/heads/release/v*"
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: false
tags: ${DRONE_BRANCH##release/v}-nightly-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: false
tags: ${DRONE_BRANCH##release/v}-nightly-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
@ -641,136 +379,6 @@ steps:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: docker-linux-arm64-release
platform:
os: linux
arch: arm64
trigger:
ref:
- refs/heads/main
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: false
tags: nightly-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: false
tags: nightly-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
name: docker-linux-arm64-release-branch
platform:
os: linux
arch: arm64
trigger:
ref:
- "refs/heads/release/v*"
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: false
tags: ${DRONE_BRANCH##release/v}-nightly-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: false
tags: ${DRONE_BRANCH##release/v}-nightly-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
@ -816,50 +424,3 @@ depends_on:
- docker-linux-amd64-release-candidate-version
- docker-linux-arm64-release-version
- docker-linux-arm64-release-candidate-version
---
kind: pipeline
type: docker
name: docker-manifest
platform:
os: linux
arch: amd64
steps:
- name: manifest-rootless
image: plugins/manifest
pull: always
settings:
auto_tag: false
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: false
ignore_missing: true
spec: docker/manifest.tmpl
password:
from_secret: docker_password
username:
from_secret: docker_username
trigger:
ref:
- refs/heads/main
- "refs/heads/release/v*"
paths:
exclude:
- "docs/**"
depends_on:
- docker-linux-amd64-release
- docker-linux-arm64-release
- docker-linux-amd64-release-branch
- docker-linux-arm64-release-branch

View file

@ -29,11 +29,11 @@ globals:
__webpack_public_path__: true
overrides:
- files: ["web_src/**/*.js", "docs/**/*.js"]
- files: ["web_src/**/*", "docs/**/*"]
env:
browser: true
node: false
- files: ["web_src/**/*worker.js"]
- files: ["web_src/**/*worker.*"]
env:
worker: true
rules:
@ -42,7 +42,7 @@ overrides:
rules:
import/no-unresolved: [0]
import/no-extraneous-dependencies: [0]
- files: ["*.config.js"]
- files: ["*.config.*"]
rules:
import/no-unused-modules: [0]

View file

@ -0,0 +1,154 @@
name: 'Build release'
author: 'Forgejo authors'
description: |
Build release
inputs:
forgejo:
description: 'URL of the Forgejo instance where the release is uploaded'
required: true
owner:
description: 'User or organization where the release is uploaded, relative to the Forgejo instance'
required: true
repository:
description: 'Repository where the release is uploaded, relative to the owner'
required: true
doer:
description: 'Name of the user authoring the release'
required: true
tag-version:
description: 'Version of the release derived from the tag withint the leading v'
required: true
suffix:
description: 'Suffix to add to the image tag'
token:
description: 'token'
required: true
dockerfile:
description: 'path to the dockerfile'
default: 'Dockerfile'
platforms:
description: 'Coma separated list of platforms'
default: 'linux/amd64,linux/arm64'
release-notes:
description: 'Full text of the release notes'
default: 'Release notes placeholder'
binary-name:
description: 'Name of the binary'
binary-path:
description: 'Path of the binary within the container to extract into binary-name'
verbose:
description: 'Increase the verbosity level'
default: 'false'
runs:
using: "composite"
steps:
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- name: Install dependencies
run: |
apt-get install -y -qq xz-utils
- name: set -x if verbose is required
id: verbose
run: |
if ${{ inputs.verbose }} ; then
echo "shell=set -x" >> "$GITHUB_OUTPUT"
fi
- name: Create the insecure and buildx-config variables for the container registry
id: registry
run: |
${{ steps.verbose.outputs.shell }}
url="${{ inputs.forgejo }}"
hostport=${url##http*://}
hostport=${hostport%%/}
echo "host-port=${hostport}" >> "$GITHUB_OUTPUT"
if ! [[ $url =~ ^http:// ]] ; then
exit 0
fi
cat >> "$GITHUB_OUTPUT" <<EOF
insecure=true
buildx-config<<ENDVAR
[registry."${hostport}"]
http = true
ENDVAR
EOF
- name: Allow docker pull/push to forgejo
if: ${{ steps.registry.outputs.insecure }}
run: |-
mkdir -p /etc/docker
cat > /etc/docker/daemon.json <<EOF
{
"insecure-registries" : ["${{ steps.registry.outputs.host-port }}"],
"bip": "172.26.0.1/16"
}
EOF
- name: Install docker
run: |
echo deb http://deb.debian.org/debian bullseye-backports main | tee /etc/apt/sources.list.d/backports.list && apt-get -qq update
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -qq -y -t bullseye-backports docker.io
- uses: https://github.com/docker/setup-buildx-action@v2
with:
config-inline: |
${{ steps.registry.outputs.buildx-config }}
- name: Login to the container registry
run: |
BASE64_AUTH=`echo -n "${{ inputs.doer }}:${{ inputs.token }}" | base64 -w0`
mkdir -p ~/.docker
echo "{\"auths\": {\"$CI_REGISTRY\": {\"auth\": \"$BASE64_AUTH\"}}}" > ~/.docker/config.json
env:
CI_REGISTRY: "${{ steps.registry.outputs.host-port }}"
- name: Build the container image for each architecture
uses: https://github.com/docker/build-push-action@v4
# workaround until https://github.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba is in @v4 or @v5 is released
env:
ACTIONS_RUNTIME_TOKEN: ''
with:
context: .
push: true
file: ${{ inputs.dockerfile }}
platforms: ${{ inputs.platforms }}
tags: ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ inputs.tag-version }}${{ inputs.suffix }}
- name: Extract the binary from the container images into the release directory
if: inputs.binary-name != ''
run: |
${{ steps.verbose.outputs.shell }}
mkdir -p release
cd release
for platform in $(echo ${{ inputs.platforms }} | tr ',' ' '); do
arch=$(echo $platform | sed -e 's|linux/||g' -e 's|arm/v6|arm-6|g')
docker create --platform $platform --name forgejo-$arch ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ inputs.tag-version }}${{ inputs.suffix }}
binary="${{ inputs.binary-name }}-${{ inputs.tag-version }}-linux"
docker cp forgejo-$arch:${{ inputs.binary-path }} $binary-$arch
chmod +x $binary-$arch
# the displayed version 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"
./$binary-$arch --version
exit 1
fi
xz --keep -9 $binary-$arch
shasum -a 256 $binary-$arch > $binary-$arch.sha256
shasum -a 256 $binary-$arch.xz > $binary-$arch.xz.sha256
docker rm forgejo-$arch
done
- name: publish release
if: inputs.binary-name != ''
uses: https://code.forgejo.org/actions/forgejo-release@v1
with:
direction: upload
release-dir: release
release-notes: "${{ inputs.release-notes }}"
token: ${{ inputs.token }}
verbose: ${{ steps.verbose.outputs.value }}

View file

@ -0,0 +1,99 @@
name: 'Publish release'
author: 'Forgejo authors'
description: |
Publish release
inputs:
forgejo:
description: 'URL of the Forgejo instance where the release is uploaded (e.g. https://codeberg.org)'
required: true
from-owner:
description: 'the owner from which a release is to be copied (e.g forgejo-integration)'
required: true
to-owner:
description: 'the owner to which a release is to be copied (e.g. forgejo-experimental). It has be an organization in which doer has the required permissions. Or be the same as the doer'
required: true
repo:
description: 'the repository from which a release is to be copied relative to from-owner and to-owner'
default: 'forgejo'
ref-name:
description: 'ref_name of the tag of the release to be copied (e.g. github.ref_name)'
required: true
doer:
description: 'Name of the user authoring the release (e.g. release-team). The user must be authorized to create packages in to-owner and releases in to-owner/repo'
required: true
token:
description: 'application token created on forgejo by the doer, with a scope allowing it to create packages in to-owner and releases in to-owner/repo'
required: true
gpg-private-key:
description: 'GPG Private Key to sign the release artifacts'
gpg-passphrase:
description: 'Passphrase of the GPG Private Key'
verbose:
description: 'Increase the verbosity level'
default: 'false'
runs:
using: "composite"
steps:
- id: hostport
run: |
url="${{ inputs.forgejo }}"
hostport=${url##http*://}
hostport=${hostport%%/}
echo "value=$hostport" >> "$GITHUB_OUTPUT"
- id: tag-version
run: |
version="${{ inputs.ref-name }}"
version=${version##*v}
echo "value=$version" >> "$GITHUB_OUTPUT"
- name: apt-get install docker.io
run: |
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -qq -y docker.io
- name: download release
uses: https://code.forgejo.org/actions/forgejo-release@v1
with:
url: ${{ inputs.forgejo }}
repo: ${{ inputs.from-owner }}/${{ inputs.repo }}
direction: download
release-dir: release
download-retry: 60
token: ${{ inputs.token }}
verbose: ${{ inputs.verbose }}
- name: upload release
uses: https://code.forgejo.org/actions/forgejo-release@v1
with:
url: ${{ inputs.forgejo }}
repo: ${{ inputs.to-owner }}/${{ inputs.repo }}
direction: upload
release-dir: release
release-notes: "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 }}
verbose: ${{ inputs.verbose }}
- name: login to the registry
uses: https://github.com/docker/login-action@v2
with:
registry: ${{ steps.hostport.outputs.value }}
username: ${{ inputs.doer }}
password: ${{ inputs.token }}
- uses: https://code.forgejo.org/forgejo/forgejo-container-image@v1
env:
VERIFY: 'false'
with:
url: https://${{ steps.hostport.outputs.value }}
destination-owner: ${{ inputs.to-owner }}
owner: ${{ inputs.from-owner }}
suffixes: '-rootless'
project: ${{ inputs.repo }}
tag: ${{ steps.tag-version.outputs.value }}
doer: ${{ inputs.doer }}
token: ${{ inputs.token }}
verbose: ${{ inputs.verbose }}

View file

@ -0,0 +1,3 @@
FROM public.ecr.aws/docker/library/alpine:3.18
RUN mkdir -p /app/gitea
RUN ( echo '#!/bin/sh' ; echo "echo forgejo v1.2.3" ) > /app/gitea/gitea ; chmod +x /app/gitea/gitea

View file

@ -0,0 +1,5 @@
VERSION ?= $(shell cat VERSION 2>/dev/null)
sources-tarbal:
mkdir -p dist/release
echo $(VERSION) > VERSION
sources=forgejo-src-$(VERSION).tar.gz ; tar --transform 's|^./|forgejo-src-$(VERSION)/|' -czf dist/release/forgejo-src-$(VERSION).tar.gz . ; cd dist/release ; shasum -a 256 $$sources > $$sources.sha256

View file

@ -0,0 +1,26 @@
RUN_MODE = prod
WORK_PATH = ${WORK_PATH}
[server]
APP_DATA_PATH = ${WORK_PATH}/data
HTTP_PORT = 3000
SSH_LISTEN_PORT = 2222
LFS_START_SERVER = true
[database]
DB_TYPE = sqlite3
PATH = ${WORK_PATH}/forgejo.db
[log]
MODE = file
LEVEL = debug
ROUTER = file
[log.file]
FILE_NAME = forgejo.log
[security]
INSTALL_LOCK = true
[actions]
ENABLED = true

View file

@ -0,0 +1,28 @@
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
[actions]
ENABLED = true
[storage]
PATH = ${WORK_PATH}/merged

View file

@ -0,0 +1,55 @@
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
[actions]
ENABLED = true
[attachment]
[storage.attachments]
PATH = ${WORK_PATH}/data/attachments
[lfs]
[storage.lfs]
PATH = ${WORK_PATH}/data/lfs
[avatar]
[storage.avatars]
PATH = ${WORK_PATH}/data/avatars
[repo-avatar]
[storage.repo-avatars]
PATH = ${WORK_PATH}/data/repo-avatars
[repo-archive]
[storage.repo-archive]
PATH = ${WORK_PATH}/data/repo-archive
[packages]
[storage.packages]
PATH = ${WORK_PATH}/data/packages

View file

@ -0,0 +1,43 @@
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
[actions]
ENABLED = true
[attachment]
PATH = ${WORK_PATH}/data/attachments
[lfs]
PATH = ${WORK_PATH}/data/lfs
[avatar]
PATH = ${WORK_PATH}/data/avatars
[repo-avatar]
PATH = ${WORK_PATH}/data/repo-avatars
[repo-archive]
PATH = ${WORK_PATH}/data/repo-archive
[packages]
PATH = ${WORK_PATH}/data/packages

274
.forgejo/upgrades/test-upgrade.sh Executable file
View file

@ -0,0 +1,274 @@
#!/bin/bash
# SPDX-License-Identifier: MIT
set -ex
HOST_PORT=0.0.0.0:3000
STORAGE_PATHS="attachments avatars lfs packages repo-archive repo-avatars"
DIR=/tmp/forgejo-upgrades
SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: '
function maybe_sudo() {
if test $(id -u) != 0 ; then
SUDO=sudo
fi
}
function dependencies() {
if ! which curl daemon > /dev/null ; then
maybe_sudo
$SUDO apt-get install -y -qq curl daemon
fi
}
function build() {
local version=$1
local semver=$2
if ! test -f $DIR/forgejo-$version ; then
mkdir -p $DIR
make VERSION=v$version GITEA_VERSION=v$version FORGEJO_VERSION=$semver TAGS='bindata sqlite sqlite_unlock_notify' generate gitea
mv gitea $DIR/forgejo-$version
fi
}
function build_all() {
test -f Makefile
build 1.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 wait_for() {
rm -f $DIR/setup-forgejo.out
success=false
for delay in 1 1 5 5 15 ; do
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/setup-forgejo.out
return 1
fi
}
function download() {
local version=$1
if ! test -f $DIR/forgejo-$version ; then
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
}
function cleanup_logs() {
local work_path=$DIR/forgejo-work-path
rm -f $DIR/*.log
rm -f $work_path/log/*.log
}
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 ! 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
$work_path/forgejo-api http://${HOST_PORT}/api/v1/version
}
function create_user() {
local version=$1
local work_path=$DIR/forgejo-work-path
if test -f $work_path/forgejo-token; then
return
fi
local 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 "$user" --password "$password" --email "$user@example.com"
local scopes="--scopes all"
if echo $version | grep --quiet 1.18. ; then
scopes=""
fi
$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 -sS -H "Content-Type: application/json" -H @'$work_path/forgejo-header' "$@"' ) > $work_path/forgejo-api && chmod +x $work_path/forgejo-api
}
function stop() {
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() {
local config=$1
local work_path=$DIR/forgejo-work-path
rm -fr $work_path
mkdir -p $work_path
WORK_PATH=$work_path envsubst < $SELF_DIR/$config-app.ini > $work_path/app.ini
}
function verify_storage() {
local work_path=$DIR/forgejo-work-path
for path in ${STORAGE_PATHS} ; do
test -d $work_path/data/$path
done
}
function cleanup_storage() {
local work_path=$DIR/forgejo-work-path
for path in ${STORAGE_PATHS} ; do
rm -fr $work_path/data/$path
done
}
function test_downgrade_1.20.2_fails() {
local work_path=$DIR/forgejo-work-path
echo "================ See also https://codeberg.org/forgejo/forgejo/pulls/1225"
echo "================ downgrading from 1.20.3-0 to 1.20.2-0 fails"
stop
reset default
start 1.20.3-0
stop
download 1.20.2-0
timeout 60 $DIR/forgejo-1.20.2-0 --config $work_path/app.ini --work-path $work_path || true
if ! grep --fixed-strings --quiet 'use the newer database' $work_path/log/forgejo.log ; then
cat $work_path/log/forgejo.log
return 1
fi
}
function test_bug_storage_merged() {
local work_path=$DIR/forgejo-work-path
echo "================ See also https://codeberg.org/forgejo/forgejo/pulls/1225"
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
done
stop
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
fi
}
function test_bug_storage_misplace() {
local work_path=$DIR/forgejo-work-path
echo "================ See also https://codeberg.org/forgejo/forgejo/pulls/1225"
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
done
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
done
stop
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
done
}
function test_successful_upgrades() {
for config in default specific ; do
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
echo "================ run $version"
cleanup_storage
start $version
verify_storage
stop
done
done
}
function test_upgrades() {
stop
dependencies
build_all
test_successful_upgrades
test_bug_storage_misplace
test_bug_storage_merged
test_downgrade_1.20.2_fails
}
"$@"

View file

@ -0,0 +1,99 @@
name: Integration tests for the release process
on:
push:
paths:
- Makefile
- Dockerfile
- Dockerfile.rootless
- docker/**
- .forgejo/actions/build-release/action.yml
- .forgejo/workflows/build-release.yml
- .forgejo/workflows/build-release-integration.yml
jobs:
release-simulation:
runs-on: self-hosted
if: secrets.ROLE != 'forgejo-integration' && secrets.ROLE != 'forgejo-experimental' && secrets.ROLE != 'forgejo-release'
steps:
- uses: actions/checkout@v3
- id: forgejo
uses: https://code.forgejo.org/actions/setup-forgejo@v1
with:
user: root
password: admin1234
image-version: 1.19
lxc-ip-prefix: 10.0.9
- name: publish the forgejo release
run: |
set -x
version=1.2.3
cat > /etc/docker/daemon.json <<EOF
{
"insecure-registries" : ["${{ steps.forgejo.outputs.host-port }}"]
}
EOF
systemctl restart docker
apt-get install -qq -y xz-utils
dir=$(mktemp -d)
trap "rm -fr $dir" EXIT
url=http://root:admin1234@${{ steps.forgejo.outputs.host-port }}
export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"
#
# Create a new project with a fake forgejo and the release workflow only
#
cp -a .forgejo/testdata/build-release/* $dir
mkdir -p $dir/.forgejo/workflows
cp .forgejo/workflows/build-release.yml $dir/.forgejo/workflows
cp -a .forgejo/actions $dir/.forgejo/actions
cp $dir/Dockerfile $dir/Dockerfile.rootless
forgejo-test-helper.sh push $dir $url root forgejo |& tee $dir/pushed
eval $(grep '^sha=' < $dir/pushed)
#
# Push a tag to trigger the release workflow and wait for it to complete
#
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
#
# uncomment to see the logs even when everything is reported to be working ok
#
#cat $FORGEJO_RUNNER_LOGS
#
# Minimal sanity checks. e2e test is for the setup-forgejo
# action and the infrastructure playbook. Since the binary
# is a script shell it does not test the sanity of the cross
# build, only the sanity of the naming of the binaries.
#
for arch in amd64 arm64 arm-6 ; do
binary=forgejo-$version-linux-$arch
for suffix in '' '.xz' ; do
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix > $binary$suffix
if test "$suffix" = .xz ; then
unxz --keep $binary$suffix
fi
chmod +x $binary
./$binary --version | grep $version
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix.sha256 > $binary$suffix.sha256
shasum -a 256 --check $binary$suffix.sha256
rm $binary$suffix
done
done
sources=forgejo-src-$version.tar.gz
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources > $sources
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources.sha256 > $sources.sha256
shasum -a 256 --check $sources.sha256
docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version
docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version-rootless

View file

@ -0,0 +1,186 @@
name: Build release
on:
push:
tags: 'v*'
jobs:
release:
runs-on: self-hosted
# root is used for testing, allow it
if: secrets.ROLE == 'forgejo-integration' || github.repository_owner == 'root'
steps:
- uses: actions/checkout@v3
- name: Increase the verbosity when there are no secrets
id: verbose
run: |
if test -z "${{ secrets.TOKEN }}"; then
value=true
else
value=false
fi
echo "value=$value" >> "$GITHUB_OUTPUT"
- name: Sanitize the name of the repository
id: repository
run: |
set -x # comment out
repository="${{ github.repository }}"
echo "value=${repository##*/}" >> "$GITHUB_OUTPUT"
- name: When in a test environment, create a token
id: token
if: ${{ secrets.TOKEN == '' }}
run: |
apt-get -qq install -y jq
url="${{ env.GITHUB_SERVER_URL }}"
hostport=${url##http*://}
hostport=${hostport%%/}
doer=root
api=http://$doer:admin1234@$hostport/api/v1/users/$doer/tokens
curl -sS -X DELETE $api/release
token=$(curl -sS -X POST -H 'Content-Type: application/json' --data-raw '{"name": "release", "scopes": ["all"]}' $api | jq --raw-output .sha1)
echo "value=${token}" >> "$GITHUB_OUTPUT"
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: ">=1.20"
check-latest: true
- name: Create the version from ref_name
id: tag-version
run: |
version="${{ github.ref_name }}"
version=${version##*v}
echo "value=$version" >> "$GITHUB_OUTPUT"
- name: Create the release notes
id: release-notes
run: |
cat >> "$GITHUB_OUTPUT" <<EOF
value<<ENDVAR
See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#${{ steps.tag-version.outputs.value }}
ENDVAR
EOF
- name: Build sources
run: |
set -x
apt-get -qq install -y make
version=${{ steps.tag-version.outputs.value }}
#
# Make sure all files are owned by the current user.
# When run as root `npx webpack` will assume the identity
# of the owner of the current working directory and may
# fail to create files if some sub-directories are not owned
# by the same user.
#
# Binaries:
# Node: 18.17.0 - /usr/local/node-v18.17.0-linux-x64/bin/node
# npm: 9.6.7 - /usr/local/node-v18.17.0-linux-x64/bin/npm
# Packages:
# add-asset-webpack-plugin: 2.0.1 => 2.0.1
# css-loader: 6.8.1 => 6.8.1
# esbuild-loader: 3.0.1 => 3.0.1
# license-checker-webpack-plugin: 0.2.1 => 0.2.1
# monaco-editor-webpack-plugin: 7.0.1 => 7.0.1
# vue-loader: 17.2.2 => 17.2.2
# webpack: 5.87.0 => 5.87.0
# webpack-cli: 5.1.4 => 5.1.4
#
chown -R $(id -u) .
make VERSION=$version TAGS=bindata sources-tarbal
mv dist/release release
(
tmp=$(mktemp -d)
tar --directory $tmp -zxvf release/*$version*.tar.gz
cd $tmp/*
#
# Verify `make frontend` files are available
#
test -d public/css
test -d public/fonts
test -d public/js
#
# Verify `make generate` files are available
#
test -f modules/public/bindata.go
#
# Sanity check to verify that the source tarbal knows the
# version and is able to rebuild itself from it.
#
# When in sources the version is determined with git.
# When in the tarbal the version is determined from a VERSION file.
#
make sources-tarbal
tarbal=$(echo dist/release/*$version*.tar.gz)
if ! test -f $tarbal ; then
echo $tarbal does not exist
find dist release
exit 1
fi
)
- name: build container & release (when TOKEN secret is not set)
if: ${{ secrets.TOKEN == '' }}
uses: ./.forgejo/actions/build-release
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: root
tag-version: "${{ steps.tag-version.outputs.value }}"
token: ${{ steps.token.outputs.value }}
platforms: linux/amd64,linux/arm64,linux/arm/v6
release-notes: "${{ steps.release-notes.outputs.value }}"
binary-name: forgejo
binary-path: /app/gitea/gitea
verbose: ${{ steps.verbose.outputs.value }}
- name: build rootless container (when TOKEN secret is not set)
if: ${{ secrets.TOKEN == '' }}
uses: ./.forgejo/actions/build-release
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: root
tag-version: "${{ steps.tag-version.outputs.value }}"
token: ${{ steps.token.outputs.value }}
platforms: linux/amd64,linux/arm64,linux/arm/v6
suffix: -rootless
dockerfile: Dockerfile.rootless
verbose: ${{ steps.verbose.outputs.value }}
- name: build container & release (when TOKEN secret is set)
if: ${{ secrets.TOKEN != '' }}
uses: ./.forgejo/actions/build-release
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: "${{ secrets.DOER }}"
tag-version: "${{ steps.tag-version.outputs.value }}"
token: "${{ secrets.TOKEN }}"
platforms: linux/amd64,linux/arm64,linux/arm/v6
release-notes: "${{ steps.release-notes.outputs.value }}"
binary-name: forgejo
binary-path: /app/gitea/gitea
verbose: ${{ steps.verbose.outputs.value }}
- name: build rootless container (when TOKEN secret is set)
if: ${{ secrets.TOKEN != '' }}
uses: ./.forgejo/actions/build-release
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: "${{ secrets.DOER }}"
tag-version: "${{ steps.tag-version.outputs.value }}"
token: "${{ secrets.TOKEN }}"
platforms: linux/amd64,linux/arm64,linux/arm/v6
suffix: -rootless
dockerfile: Dockerfile.rootless
verbose: ${{ steps.verbose.outputs.value }}

View file

@ -0,0 +1,79 @@
# SPDX-License-Identifier: MIT
#
# See also https://forgejo.org/docs/next/developer/RELEASE/#release-process
#
# https://codeberg.org/forgejo-experimental/forgejo
#
# Copies a release from codeberg.org/forgejo-integration to codeberg.org/forgejo-experimental
#
# ROLE: forgejo-experimental
# FORGEJO: https://codeberg.org
# FROM_OWNER: forgejo-integration
# TO_OWNER: forgejo-experimental
# DOER: forgejo-experimental-ci
# TOKEN: <generated from codeberg.org/forgejo-experimental-ci>
#
# https://forgejo.octopuce.forgejo.org/forgejo/forgejo
#
# Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo
#
# ROLE: forgejo-release
# FORGEJO: https://codeberg.org
# FROM_OWNER: forgejo-integration
# TO_OWNER: forgejo
# DOER: release-team
# TOKEN: <generated from codeberg.org/release-team>
# GPG_PRIVATE_KEY: <XYZ>
# GPG_PASSPHRASE: <ABC>
#
name: Pubish release
on:
push:
tags: 'v*'
jobs:
publish:
runs-on: self-hosted
if: secrets.DOER != '' && secrets.FORGEJO != '' && secrets.TO_OWNER != '' && secrets.FROM_OWNER != '' && secrets.TOKEN != ''
steps:
- 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
uses: ./.forgejo/actions/publish-release
with:
forgejo: ${{ secrets.FORGEJO }}
from-owner: ${{ secrets.FROM_OWNER }}
to-owner: ${{ secrets.TO_OWNER }}
ref-name: ${{ github.ref_name }}
doer: ${{ secrets.DOER }}
token: ${{ secrets.TOKEN }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
verbose: ${{ secrets.VERBOSE }}
- name: set up go for the DNS update below
uses: https://code.forgejo.org/actions/setup-go@v4
if: secrets.ROLE == 'forgejo-experimental'
with:
go-version: ">=1.21"
check-latest: true
- name: update the _release.experimental DNS record
if: secrets.ROLE == 'forgejo-experimental'
uses: https://code.forgejo.org/actions/ovh-dns-update@v1
with:
subdomain: _release.experimental
domain: forgejo.com # there is a CNAME from .org to .com (for security reasons)
record-id: 5283602601
value: v=${{ github.ref_name }}
ovh-app-key: ${{ secrets.OVH_APP_KEY }}
ovh-app-secret: ${{ secrets.OVH_APP_SECRET }}
ovh-consumer-key: ${{ secrets.OVH_CON_KEY }}

View file

@ -0,0 +1,212 @@
name: testing
on:
pull_request:
push:
branches:
- 'forgejo*'
- 'v*/forgejo*'
jobs:
lint-backend:
runs-on: docker
container:
image: 'docker.io/node:20-bookworm'
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.20"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-backend
env:
TAGS: bindata sqlite sqlite_unlock_notify
checks-backend:
runs-on: docker
container:
image: 'docker.io/node:20-bookworm'
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.20"
check-latest: true
- run: make deps-backend deps-tools
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
test-unit:
runs-on: docker
needs: [lint-backend, checks-backend]
container:
image: 'docker.io/node:20-bookworm'
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 '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata
- run: |
su forgejo -c 'make unit-test-coverage test-check'
timeout-minutes: 50
env:
RACE_ENABLED: 'true'
TAGS: bindata
test-mysql:
runs-on: docker
needs: [lint-backend, checks-backend]
container:
image: 'docker.io/node:20-bookworm'
services:
mysql8:
image: mysql:8-debian
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: testgitea
ports:
- "3306:3306"
#
# See also https://codeberg.org/forgejo/forgejo/issues/976
#
cmd: ['mysqld', '--innodb-adaptive-flushing=OFF', '--innodb-buffer-pool-size=4G', '--innodb-log-buffer-size=128M', '--innodb-flush-log-at-trx-commit=0', '--innodb-flush-log-at-timeout=30', '--innodb-flush-method=nosync', '--innodb-fsync-threshold=1000000000']
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.20"
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install --no-install-recommends -qq -y git-lfs
- name: setup user and permissions
run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata
- run: |
su forgejo -c 'make test-mysql8-migration test-mysql8'
timeout-minutes: 50
env:
TAGS: bindata
USE_REPO_TEST_DIR: 1
test-pgsql:
runs-on: docker
needs: [lint-backend, checks-backend]
container:
image: 'docker.io/node:20-bookworm'
services:
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.20"
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install --no-install-recommends -qq -y git-lfs
- name: setup user and permissions
run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata
- run: |
su forgejo -c 'make test-pgsql-migration test-pgsql'
timeout-minutes: 50
env:
TAGS: bindata gogit
RACE_ENABLED: true
TEST_TAGS: gogit
USE_REPO_TEST_DIR: 1
test-sqlite:
runs-on: docker
needs: [lint-backend, checks-backend]
container:
image: 'docker.io/node:20-bookworm'
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.20"
- name: install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install --no-install-recommends -qq -y git-lfs
- name: setup user and permissions
run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
- run: |
su forgejo -c 'make test-sqlite-migration test-sqlite'
timeout-minutes: 50
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
RACE_ENABLED: true
TEST_TAGS: gogit sqlite sqlite_unlock_notify
USE_REPO_TEST_DIR: 1
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"

1
.gitattributes vendored
View file

@ -5,5 +5,6 @@
/templates/swagger/v1_json.tmpl linguist-generated
/vendor/** -text -eol linguist-vendored
/web_src/fomantic/build/** linguist-generated
/web_src/fomantic/_site/globals/site.variables linguist-language=Less
/web_src/js/vendor/** -text -eol linguist-vendored
Dockerfile.* linguist-language=Dockerfile

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,42 +0,0 @@
<!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue -->
<!--
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your issue doesn't already exist.
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq)
5. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
-->
- Gitea version (or commit ref):
- Git version:
- Operating system:
<!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package -->
<!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. --->
<!-- If you are using a package or systemd tell us what distribution you are using -->
- Database (use `[x]`):
- [ ] PostgreSQL
- [ ] MySQL
- [ ] MSSQL
- [ ] SQLite
- Can you reproduce the bug at https://try.gitea.io:
- [ ] Yes (provide example URL)
- [ ] No
- Log gist:
<!-- It really is important to provide pertinent logs -->
<!-- Please read https://docs.gitea.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 -->
## Description
<!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please
disable the proxy/CDN fully and connect to gitea directly to confirm
the issue still persists without those services. -->
...
## Screenshots
<!-- **If this issue involves the Web Interface, please include a screenshot** -->

View file

@ -0,0 +1,4 @@
<!--
Before submitting a PR, please read the contributing guidelines:
https://codeberg.org/forgejo/forgejo/src/branch/main/CONTRIBUTING.md
-->

2
.github/FUNDING.yml vendored
View file

@ -1,2 +0,0 @@
open_collective: gitea
custom: https://www.bountysource.com/teams/gitea

View file

@ -1,94 +0,0 @@
name: Bug Report
description: Found something you weren't expecting? Report it here!
labels: kind/bug
body:
- type: markdown
attributes:
value: |
NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue.
- type: markdown
attributes:
value: |
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Make sure you are using the latest release and
take a moment to check that your issue hasn't been reported before.
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq)
5. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
6. In particular it's really important to provide pertinent logs. You must give us 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
- type: textarea
id: description
attributes:
label: Description
description: |
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below)
If you are using a proxy or a CDN (e.g. Cloudflare) in front of Gitea, please disable the proxy/CDN fully and access Gitea directly to confirm the issue still persists without those services.
- type: input
id: gitea-ver
attributes:
label: Gitea Version
description: Gitea version (or commit reference) of your instance
validations:
required: true
- type: dropdown
id: can-reproduce
attributes:
label: Can you reproduce the bug on the Gitea demo site?
description: |
If so, please provide a URL in the Description field
URL of Gitea demo: https://try.gitea.io
options:
- "Yes"
- "No"
validations:
required: true
- type: markdown
attributes:
value: |
It's really important to provide pertinent logs
Please read https://docs.gitea.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
- type: input
id: logs
attributes:
label: Log Gist
description: Please provide a gist URL of your logs, with any sensitive information (e.g. API keys) removed/hidden
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If this issue involves the Web Interface, please provide one or more screenshots
- type: input
id: git-ver
attributes:
label: Git Version
description: The version of git running on the server
- type: input
id: os-ver
attributes:
label: Operating System
description: The operating system you are using to run Gitea
- type: textarea
id: run-info
attributes:
label: How are you running Gitea?
description: |
Please include information on whether you built Gitea yourself, used one of our downloads, are using https://try.gitea.io or are using some other package
Please also tell us how you are running Gitea, e.g. if it is being run from docker, a command-line, systemd etc.
If you are using a package or systemd tell us what distribution you are using
validations:
required: true
- type: dropdown
id: database
attributes:
label: Database
description: What database system are you running?
options:
- PostgreSQL
- MySQL
- MSSQL
- SQLite

View file

@ -1,17 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Security Concern
url: https://tinyurl.com/security-gitea
about: For security concerns, please send a mail to security@gitea.io instead of opening a public issue.
- name: Discord Server
url: https://discord.gg/Gitea
about: Please ask questions and discuss configuration or deployment problems here.
- name: Discourse Forum
url: https://discourse.gitea.io
about: Questions and configuration or deployment problems can also be discussed on our forum.
- name: Frequently Asked Questions
url: https://docs.gitea.io/en-us/faq
about: Please check if your question isn't mentioned here.
- name: Crowdin Translations
url: https://crowdin.com/project/gitea
about: Translations are managed here.

View file

@ -1,24 +0,0 @@
name: Feature Request
description: Got an idea for a feature that Gitea doesn't have currently? Submit your idea here!
labels: ["kind/feature", "kind/proposal"]
body:
- type: markdown
attributes:
value: |
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your feature hasn't already been suggested.
- type: textarea
id: description
attributes:
label: Feature Description
placeholder: |
I think it would be great if Gitea had...
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If you can, provide screenshots of an implementation on another site e.g. GitHub

View file

@ -1,66 +0,0 @@
name: Web Interface Bug Report
description: Something doesn't look quite as it should? Report it here!
labels: ["kind/bug", "kind/ui"]
body:
- type: markdown
attributes:
value: |
NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue.
- type: markdown
attributes:
value: |
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your issue doesn't already exist.
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq)
5. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
6. In particular it's really important to provide pertinent logs. If you are certain that this is a javascript
error, show us the javascript console. If the error appears to relate to Gitea the server you must also give us
DEBUG level logs. (See https://docs.gitea.io/en-us/logging-configuration/#debugging-problems)
- type: textarea
id: description
attributes:
label: Description
description: |
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below)
If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services.
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: Please provide at least 1 screenshot showing the issue.
validations:
required: true
- type: input
id: gitea-ver
attributes:
label: Gitea Version
description: Gitea version (or commit reference) your instance is running
validations:
required: true
- type: dropdown
id: can-reproduce
attributes:
label: Can you reproduce the bug on the Gitea demo site?
description: |
If so, please provide a URL in the Description field
URL of Gitea demo: https://try.gitea.io
options:
- "Yes"
- "No"
validations:
required: true
- type: input
id: os-ver
attributes:
label: Operating System
description: The operating system you are using to access Gitea
- type: input
id: browser-ver
attributes:
label: Browser Version
description: The browser and version that you are using to access Gitea
validations:
required: true

View file

@ -1,9 +0,0 @@
<!-- start tips -->
Please check the following:
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for backports.
2. Make sure you have read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md .
3. Describe what your pull request does and which issue you're targeting (if any).
4. It is recommended to enable "Allow edits by maintainers", so maintainers can help more easily.
5. Your input here will be included in the commit message when this PR has been merged. If you don't want some content to be included, please separate them with a line like `---`.
6. Delete all these tips before posting.
<!-- end tips -->

54
.github/stale.yml vendored
View file

@ -1,54 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 14
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- status/blocked
- kind/security
- lgtm/done
- reviewed/confirmed
- priority/critical
- kind/proposal
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had recent activity.
I am here to help clear issues left open even if solved or waiting for more insight.
This issue will be closed if no further activity occurs during the next 2 weeks.
If the issue is still valid just add a comment to keep it alive.
Thank you for your contributions.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue has been automatically closed because of inactivity.
You can re-open it if needed.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
pulls:
daysUntilStale: 60
daysUntilClose: 60
markComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you
for your contributions.
closeComment: >
This pull request has been automatically closed because of inactivity.
You can re-open it if needed.

View file

@ -1,27 +0,0 @@
name: cron-licenses
on:
schedule:
- cron: "7 0 * * 1" # every Monday at 00:07 UTC
jobs:
cron-licenses:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ">=1.20.1"
- run: make generate-license generate-gitignore
timeout-minutes: 40
- name: push translations to repo
uses: appleboy/git-push-action@v0.0.2
with:
author_email: "teabot@gitea.io"
author_name: GiteaBot
branch: main
commit: true
commit_message: "[skip ci] Updated licenses and gitignores"
remote: "git@github.com:go-gitea/gitea.git"
ssh_key: ${{ secrets.DEPLOY_KEY }}

View file

@ -1,22 +0,0 @@
name: cron-lock
on:
schedule:
- cron: "0 0 * * *" # every day at 00:00 UTC
workflow_dispatch:
permissions:
issues: write
pull-requests: write
concurrency:
group: lock
jobs:
action:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: dessant/lock-threads@v4
with:
issue-inactive-days: 45

View file

@ -1,48 +0,0 @@
name: cron-translations
on:
schedule:
- cron: "7 0 * * *" # every day at 00:07 UTC
jobs:
crowdin-pull:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v3
- name: download from crowdin
uses: docker://jonasfranz/crowdin
env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
PLUGIN_DOWNLOAD: true
PLUGIN_EXPORT_DIR: options/locale/
PLUGIN_IGNORE_BRANCH: true
PLUGIN_PROJECT_IDENTIFIER: gitea
- name: update locales
run: ./build/update-locales.sh
- name: push translations to repo
uses: appleboy/git-push-action@v0.0.2
with:
author_email: "teabot@gitea.io"
author_name: GiteaBot
branch: main
commit: true
commit_message: "[skip ci] Updated translations via Crowdin"
remote: "git@github.com:go-gitea/gitea.git"
ssh_key: ${{ secrets.DEPLOY_KEY }}
crowdin-push:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v3
- name: push translations to crowdin
uses: docker://jonasfranz/crowdin
env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
PLUGIN_UPLOAD: true
PLUGIN_EXPORT_DIR: options/locale/
PLUGIN_IGNORE_BRANCH: true
PLUGIN_PROJECT_IDENTIFIER: gitea
PLUGIN_FILES: |
locale_en-US.ini: options/locale/locale_en-US.ini
PLUGIN_BRANCH: main

View file

@ -1,142 +0,0 @@
name: compliance
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
lint-backend:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-backend
env:
TAGS: bindata sqlite sqlite_unlock_notify
lint-go-windows:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-go-windows lint-go-vet
env:
TAGS: bindata sqlite sqlite_unlock_notify
GOOS: windows
GOARCH: amd64
lint-go-gogit:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-go
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
checks-backend:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
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
frontend:
if: needs.files-changed.outputs.frontend == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend
- run: make lint-frontend
- run: make checks-frontend
backend:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20"
check-latest: true
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-backend deps-tools
- run: make deps-frontend
- run: make frontend
- run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
- name: build-backend-arm64
run: make backend # test cross compile
env:
GOOS: linux
GOARCH: arm64
TAGS: bindata gogit
- name: build-backend-windows
run: go build -o gitea_windows
env:
GOOS: windows
GOARCH: amd64
TAGS: bindata gogit
- name: build-backend-386
run: go build -o gitea_linux_386 # test if compatible with 32 bit
env:
GOOS: linux
GOARCH: 386
docs:
if: needs.files-changed.outputs.docs == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend
- run: make lint-md
- run: make docs # test if build could succeed
actions:
if: needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- run: make lint-actions

View file

@ -1,247 +0,0 @@
name: db-tests
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
test-pgsql:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
pgsql:
image: postgres:15
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
ldap:
image: gitea/test-openldap:latest
ports:
- "389:389"
- "636:636"
minio:
# as github actions doesn't support "entrypoint", we need to use a non-official image
# that has a custom entrypoint set to "minio server /data"
image: bitnami/minio:2021.3.17
env:
MINIO_ACCESS_KEY: 123456
MINIO_SECRET_KEY: 12345678
ports:
- "9000:9000"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20.0"
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- run: make test-pgsql-migration test-pgsql
timeout-minutes: 50
env:
TAGS: bindata gogit
RACE_ENABLED: true
TEST_TAGS: gogit
TEST_LDAP: 1
USE_REPO_TEST_DIR: 1
test-sqlite:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20.0"
- run: make deps-backend
- run: make backend
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
- run: make test-sqlite-migration test-sqlite
timeout-minutes: 50
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
RACE_ENABLED: true
TEST_TAGS: gogit sqlite sqlite_unlock_notify
USE_REPO_TEST_DIR: 1
test-unit:
if: needs.files-changed.outputs.backend == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: test
ports:
- "3306:3306"
elasticsearch:
image: elasticsearch:7.5.0
env:
discovery.type: single-node
ports:
- "9200:9200"
smtpimap:
image: tabascoterrier/docker-imap-devel:latest
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
redis:
image: redis
options: >- # wait until redis has started
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 10
ports:
- 6379:6379
minio:
image: bitnami/minio:2021.3.17
env:
MINIO_ACCESS_KEY: 123456
MINIO_SECRET_KEY: 12345678
ports:
- "9000:9000"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20.0"
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- name: unit-tests
run: make unit-test-coverage test-check
env:
TAGS: bindata
RACE_ENABLED: true
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
- name: unit-tests-gogit
run: make unit-test-coverage test-check
env:
TAGS: bindata gogit
RACE_ENABLED: true
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
test-mysql5:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: test
ports:
- "3306:3306"
elasticsearch:
image: elasticsearch:7.5.0
env:
discovery.type: single-node
ports:
- "9200:9200"
smtpimap:
image: tabascoterrier/docker-imap-devel:latest
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20.0"
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- name: run tests
run: make test-mysql-migration integration-test-coverage
env:
TAGS: bindata
RACE_ENABLED: true
USE_REPO_TEST_DIR: 1
TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
test-mysql8:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mysql8:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: testgitea
ports:
- "3306:3306"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20.0"
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- run: make test-mysql8-migration test-mysql8
timeout-minutes: 50
env:
TAGS: bindata
USE_REPO_TEST_DIR: 1
test-mssql:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/mssql/server:latest
env:
ACCEPT_EULA: Y
MSSQL_PID: Standard
SA_PASSWORD: MwantsaSecurePassword1
ports:
- "1433:1433"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20.0"
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- run: make test-mssql-migration test-mssql
timeout-minutes: 50
env:
TAGS: bindata
USE_REPO_TEST_DIR: 1

View file

@ -1,23 +0,0 @@
name: docker-dryrun
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
docker-dryrun:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
push: false
tags: gitea/gitea:linux-amd64

View file

@ -1,32 +0,0 @@
name: e2e-tests
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
test-e2e:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20"
check-latest: true
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend frontend deps-backend
- run: npx playwright install --with-deps
- run: make test-e2e-sqlite
timeout-minutes: 40
env:
USE_REPO_TEST_DIR: 1

92
.github/workflows/release-nightly.yml vendored Normal file
View file

@ -0,0 +1,92 @@
name: release-nightly-assets
on:
push:
branches: [ main, release/v* ]
jobs:
nightly-binary:
runs-on: ubuntu-latest
steps:
- 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.20"
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\///' -e 's/release\/v//')
echo "Cleaned name is ${REF_NAME}"
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
- name: upload binaries to s3
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@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: 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: build rootful docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
- name: build rootless docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
file: Dockerfile.rootless
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}-rootless

12
.gitignore vendored
View file

@ -1,3 +1,6 @@
# Emacs
*~
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
@ -16,10 +19,6 @@ _test
.vscode
__debug_bin
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
@ -57,8 +56,6 @@ cpu.out
/bin
/dist
/custom/*
!/custom/conf
/custom/conf/*
!/custom/conf/app.example.ini
/data
/indexers
@ -113,3 +110,6 @@ prime/
# Manpage
/man
# Generated merged Forgejo+Gitea language files
/options/locale/locale_*

View file

@ -80,6 +80,7 @@ rules:
media-feature-name-no-vendor-prefix: true
media-feature-name-unit-allowed-list: null
media-feature-name-value-allowed-list: null
media-feature-name-value-no-unknown: true
media-feature-range-notation: null
named-grid-areas-no-invalid: true
no-descending-specificity: 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"

File diff suppressed because it is too large Load diff

View file

@ -1,563 +1,23 @@
# Contribution Guidelines
# Forgejo Contributor Guide
<details><summary>Table of Contents</summary>
The Forgejo project is run by a community of people who are expected to follow this guide when cooperating on a simple bug fix as well as when changing the governance. For more information about the project, take a look at [the documentation explaining what Forgejo provides](README.md).
- [Contribution Guidelines](#contribution-guidelines)
- [Introduction](#introduction)
- [Issues](#issues)
- [How to report issues](#how-to-report-issues)
- [Types of issues](#types-of-issues)
- [Discuss your design before the implementation](#discuss-your-design-before-the-implementation)
- [Building Gitea](#building-gitea)
- [Dependencies](#dependencies)
- [Backend](#backend)
- [Frontend](#frontend)
- [Design guideline](#design-guideline)
- [Styleguide](#styleguide)
- [Copyright](#copyright)
- [Testing](#testing)
- [Translation](#translation)
- [Code review](#code-review)
- [Pull request format](#pull-request-format)
- [PR title and summary](#pr-title-and-summary)
- [Milestone](#milestone)
- [Labels](#labels)
- [Breaking PRs](#breaking-prs)
- [What is a breaking PR?](#what-is-a-breaking-pr)
- [How to handle breaking PRs?](#how-to-handle-breaking-prs)
- [Maintaining open PRs](#maintaining-open-prs)
- [Getting PRs merged](#getting-prs-merged)
- [Final call](#final-call)
- [Commit messages](#commit-messages)
- [PR Co-authors](#pr-co-authors)
- [PRs targeting `main`](#prs-targeting-main)
- [Backport PRs](#backport-prs)
- [Documentation](#documentation)
- [API v1](#api-v1)
- [GitHub API compatability](#github-api-compatability)
- [Adding/Maintaining API routes](#addingmaintaining-api-routes)
- [When to use what HTTP method](#when-to-use-what-http-method)
- [Requirements for API routes](#requirements-for-api-routes)
- [Backports and Frontports](#backports-and-frontports)
- [What is backported?](#what-is-backported)
- [How to backport?](#how-to-backport)
- [Format of backport PRs](#format-of-backport-prs)
- [Frontports](#frontports)
- [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco)
- [Release Cycle](#release-cycle)
- [Maintainers](#maintainers)
- [Technical Oversight Committee (TOC)](#technical-oversight-committee-toc)
- [Current TOC members](#current-toc-members)
- [Previous TOC/owners members](#previous-tocowners-members)
- [Governance Compensation](#governance-compensation)
- [TOC \& Working groups](#toc--working-groups)
- [Roadmap](#roadmap)
- [Versions](#versions)
- [Releasing Gitea](#releasing-gitea)
Sensitive security-related issues should be reported to [security@forgejo.org](mailto:security@forgejo.org) using [encryption](https://keyoxide.org/security@forgejo.org).
</details>
## For everyone involved
## Introduction
- [Documentation](https://forgejo.org/docs/next/)
- [Code of Conduct](https://forgejo.org/docs/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)
This document explains how to contribute changes to the Gitea project. \
It assumes you have followed the [installation instructions](https://docs.gitea.io/en-us/). \
Sensitive security-related issues should be reported to [security@gitea.io](mailto:security@gitea.io).
## For contributors
For configuring IDEs for Gitea development, see the [contributed IDE configurations](contrib/ide/).
- [Developer Certificate of Origin (DCO)](https://forgejo.org/docs/next/developer/DCO/)
- [Development workflow](https://forgejo.org/docs/next/developer/WORKFLOW/)
## Issues
## For maintainers
### How to report issues
Please search the issues on the issue tracker with a variety of related keywords to ensure that your issue has not already been reported.
If your issue has not been reported yet, [open an issue](https://github.com/go-gitea/gitea/issues/new)
and answer the questions so we can understand and reproduce the problematic behavior. \
Please write clear and concise instructions so that we can reproduce the behavior — even if it seems obvious. \
The more detailed and specific you are, the faster we can fix the issue. \
It is really helpful if you can reproduce your problem on a site running on the latest commits, i.e. <https://try.gitea.io>, as perhaps your problem has already been fixed on a current version. \
Please follow the guidelines described in [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html) for your report.
Please be kind, remember that Gitea comes at no cost to you, and you're getting free help.
### Types of issues
Typically, issues fall in one of the following categories:
- `bug`: Something in the frontend or backend behaves unexpectedly
- `security issue`: bug that has serious implications such as leaking another users data. Please do not file such issues on the public tracker and send a mail to security@gitea.io instead
- `feature`: Completely new functionality. You should describe this feature in enough detail that anyone who reads the issue can understand how it is supposed to be implemented
- `enhancement`: An existing feature should get an upgrade
- `refactoring`: Parts of the code base don't conform with other parts and should be changed to improve Gitea's maintainability
### Discuss your design before the implementation
We welcome submissions. \
If you want to change or add something, please let everyone know what you're working on — [file an issue](https://github.com/go-gitea/gitea/issues/new) or comment on an existing one before starting your work!
Significant changes such as new features must go through the change proposal process before they can be accepted. \
This is mainly to save yourself the trouble of implementing it, only to find out that your proposed implementation has some potential problems. \
Furthermore, this process gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits inside
the goals for the project and tools.
Pull requests should not be the place for architecture discussions.
## Building Gitea
See the [development setup instructions](https://docs.gitea.com/development/hacking-on-gitea).
## Dependencies
### Backend
Go dependencies are managed using [Go Modules](https://golang.org/cmd/go/#hdr-Module_maintenance). \
You can find more details in the [go mod documentation](https://go.dev/ref/mod) and the [Go Modules Wiki](https://github.com/golang/go/wiki/Modules).
Pull requests should only modify `go.mod` and `go.sum` where it is related to your change, be it a bugfix or a new feature. \
Apart from that, these files should only be modified by Pull Requests whose only purpose is to update dependencies.
The `go.mod`, `go.sum` update needs to be justified as part of the PR description,
and must be verified by the reviewers and/or merger to always reference
an existing upstream commit.
### Frontend
For the frontend, we use [npm](https://www.npmjs.com/).
The same restrictions apply for frontend dependencies as for backend dependencies, with the exceptions that the files for it are `package.json` and `package-lock.json`, and that new versions must always reference an existing version.
## Design guideline
Depending on your change, please read the
- [backend development guideline](https://docs.gitea.com/contributing/guidelines-backend)
- [frontend development guideline](https://docs.gitea.com/contributing/guidelines-frontend)
- [refactoring guideline](https://docs.gitea.com/contributing/guidelines-refactoring)
## Styleguide
You should always run `make fmt` before committing to conform to Gitea's styleguide.
## Copyright
New code files that you contribute should use the standard copyright header:
```
// Copyright <current year> The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
```
Afterwards, copyright should only be modified when the copyright author changes.
## Testing
Before submitting a pull request, run all tests to make sure your changes don't cause a regression elsewhere.
Here's how to run the test suite:
- code lint
| | |
| :-------------------- | :---------------------------------------------------------------- |
|``make lint`` | lint everything (not needed if you only change the front- **or** backend) |
|``make lint-frontend`` | lint frontend files |
|``make lint-backend`` | lint backend files |
- run tests (we suggest running them on Linux)
| Command | Action | |
| :------------------------------------- | :----------------------------------------------- | ------------ |
|``make test[\#SpecificTestName]`` | run unit test(s) |
|``make test-sqlite[\#SpecificTestName]``| run [integration](tests/integration) test(s) for SQLite |[More details](tests/integration/README.md) |
|``make test-e2e-sqlite[\#SpecificTestName]``| run [end-to-end](tests/e2e) test(s) for SQLite |[More details](tests/e2e/README.md) |
## Translation
All translation work happens on [Crowdin](https://crowdin.com/project/gitea).
The only translation that is maintained in this repository is [the English translation](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini).
It is synced regularly with Crowdin. \
Other locales on main branch **should not** be updated manually as they will be overwritten with each sync. \
Once a language has reached a **satisfactory percentage** of translated keys (~25%), it will be synced back into this repo and included in the next released version.
The tool `go run build/backport-locale.go` can be used to backport locales from the main branch to release branches that were missed.
## Code review
### Pull request format
Please try to make your pull request easy to review for us. \
For that, please read the [*Best Practices for Faster Reviews*](https://github.com/kubernetes/community/blob/261cb0fd089b64002c91e8eddceebf032462ccd6/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) guide. \
It has lots of useful tips for any project you may want to contribute to. \
Some of the key points:
- Make small pull requests. \
The smaller, the faster to review and the more likely it will be merged soon.
- Don't make changes unrelated to your PR. \
Maybe there are typos on some comments, maybe refactoring would be welcome on a function... \
but if that is not related to your PR, please make *another* PR for that.
- Split big pull requests into multiple small ones. \
An incremental change will be faster to review than a huge PR.
- Allow edits by maintainers. This way, the maintainers will take care of merging the PR later on instead of you.
### PR title and summary
In the PR title, describe the problem you are fixing, not how you are fixing it. \
Use the first comment as a summary of your PR. \
In the PR summary, you can describe exactly how you are fixing this problem. \
Keep this summary up-to-date as the PR evolves. \
If your PR changes the UI, you must add **after** screenshots in the PR summary. \
If you are not implementing a new feature, you should also post **before** screenshots for comparison. \
If your PR closes some issues, you must note that in a way that both GitHub and Gitea understand, i.e. by appending a paragraph like
```text
Fixes/Closes/Resolves #<ISSUE_NR_X>.
Fixes/Closes/Resolves #<ISSUE_NR_Y>.
```
to your summary. \
Each issue that will be closed must stand on a separate line.
### Milestone
A PR should only be assigned to a milestone if it will likely be merged into the given version. \
As a rule of thumb, assume that a PR will stay open for an additional month for every 100 added lines. \
PRs without a milestone may not be merged.
### Labels
Every PR should be labeled correctly with every label that applies. \
This includes especially the distinction between `bug` (fixing existing functionality), `feature` (new functionality), `enhancement` (upgrades for existing functionality), and `refactoring` (improving the internal code structure without changing the output (much)). \
Furthermore,
- the amount of pending required approvals
- whether this PR is `blocked`, a `backport` or `breaking`
- if it targets the `ui` or `api`
- if it increases the application `speed`
- reduces `memory usage`
are oftentimes notable labels.
### Breaking PRs
#### What is a breaking PR?
A PR is breaking if it meets one of the following criteria:
- It changes API output in an incompatible way for existing users
- It removes a setting that an admin could previously set (i.e. via `app.ini`)
- An admin must do something manually to restore the old behavior
In particular, this means that adding new settings is not breaking.\
Changing the default value of a setting or replacing the setting with another one is breaking, however.
#### How to handle breaking PRs?
If your PR has a breaking change, you must add a `BREAKING` section to your PR summary, e.g.
```
## :warning: BREAKING :warning:
```
To explain how this will affect users and how to mitigate these changes.
### Maintaining open PRs
The moment you create a non-draft PR or the moment you convert a draft PR to a non-draft PR is the moment code review starts for it. \
Once that happens, do not rebase or squash your branch anymore as it makes it difficult to review the new changes. \
Merge the base branch into your branch only when you really need to, i.e. because of conflicting changes in the mean time. \
This reduces unnecessary CI runs. \
Don't worry about merge commits messing up your commit history as every PR will be squash merged. \
This means that all changes are joined into a single new commit whose message is as described below.
### Getting PRs merged
Changes to Gitea must be reviewed before they are accepted — no matter who
makes the change, even if they are an owner or a maintainer. \
The only exception are critical bugs that prevent Gitea from being compiled or started. \
Specifically, we require two approvals from maintainers for every PR. \
Once this criteria has been met, your PR receives the `lgtm/done` label. \
From this point on, your only responsibility is to fix merge conflicts or respond to/implement requests by maintainers. \
It is the responsibility of the maintainers from this point to get your PR merged.
If a PR has the `lgtm/done` label and there are no open discussions or merge conflicts anymore, any maintainer can add the `reviewed/wait-merge` label. \
This label means that the PR is part of the merge queue and will be merged as soon as possible. \
The merge queue will be cleared in the order of the list below:
<https://github.com/go-gitea/gitea/pulls?q=is%3Apr+label%3Areviewed%2Fwait-merge+sort%3Acreated-asc+is%3Aopen>
Gitea uses it's own tool, the <https://github.com/GiteaBot/gitea-backporter> to automate parts of the review process. \
This tool does the things listed below automatically:
- create a backport PR if needed once the initial PR was merged
- remove the PR from the merge queue after the PR merged
- keep the oldest branch in the merge queue up to date with merges
### Final call
If a PR has been ignored for more than 7 days with no comments or reviews, and the author or any maintainer believes it will not survive a long wait (such as a refactoring PR), they can send "final call" to the TOC by mentioning them in a comment.
After another 7 days, if there is still zero approval, this is considered a polite refusal, and the PR will be closed to avoid wasting further time. Therefore, the "final call" has a cost, and should be used cautiously.
However, if there are no objections from maintainers, the PR can be merged with only one approval from the TOC (not the author).
### Commit messages
Mergers are able and required to rewrite the PR title and summary (the first comment of a PR) so that it can produce an easily understandable commit message if necessary. \
The final commit message should no longer contain any uncertainty such as `hopefully, <x> won't happen anymore`. Replace uncertainty with certainty.
#### PR Co-authors
A person counts as a PR co-author the moment they (co-)authored a commit that is not simply a `Merge base branch into branch` commit. \
Mergers are required to remove such "false-positive" co-authors when writing the commit message. \
The true co-authors must remain in the commit message.
#### PRs targeting `main`
The commit message of PRs targeting `main` is always
```bash
$PR_TITLE ($PR_INDEX)
$REWRITTEN_PR_SUMMARY
```
#### Backport PRs
The commit message of backport PRs is always
```bash
$PR_TITLE ($INITIAL_PR_INDEX) ($BACKPORT_PR_INDEX)
$REWRITTEN_PR_SUMMARY
```
## Documentation
If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated in the same PR.
## API v1
The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [the GitHub API](https://docs.github.com/en/rest).
### GitHub API compatability
Gitea's API should use the same endpoints and fields as the GitHub API as far as possible, unless there are good reasons to deviate. \
If Gitea provides functionality that GitHub does not, a new endpoint can be created. \
If information is provided by Gitea that is not provided by the GitHub API, a new field can be used that doesn't collide with any GitHub fields. \
Updating an existing API should not remove existing fields unless there is a really good reason to do so. \
The same applies to status responses. If you notice a problem, feel free to leave a comment in the code for future refactoring to API v2 (which is currently not planned).
### Adding/Maintaining API routes
All expected results (errors, success, fail messages) must be documented ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L319-L327)). \
All JSON input types must be defined as a struct in [modules/structs/](modules/structs/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L76-L91)) \
and referenced in [routers/api/v1/swagger/options.go](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/options.go). \
They can then be used like [this example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L318). \
All JSON responses must be defined as a struct in [modules/structs/](modules/structs/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L36-L68)) \
and referenced in its category in [routers/api/v1/swagger/](routers/api/v1/swagger/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/issue.go#L11-L16)) \
They can be used like [this example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L277-L279).
### When to use what HTTP method
In general, HTTP methods are chosen as follows:
- **GET** endpoints return the requested object(s) and status **OK (200)**
- **DELETE** endpoints return the status **No Content (204)** and no content either
- **POST** endpoints are used to **create** new objects (e.g. a User) and return the status **Created (201)** and the created object
- **PUT** endpoints are used to **add/assign** existing Objects (e.g. a user to a team) and return the status **No Content (204)** and no content either
- **PATCH** endpoints are used to **edit/change** an existing object and return the changed object and the status **OK (200)**
### Requirements for API routes
All parameters of endpoints changing/editing an object must be optional (except the ones to identify the object, which are required).
Endpoints returning lists must
- support pagination (`page` & `limit` options in query)
- set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444))
## Backports and Frontports
### What is backported?
We backport PRs given the following circumstances:
1. Feature freeze is active, but `<version>-rc0` has not been released yet. Here, we backport as much as possible. <!-- TODO: Is that our definition with the new backport bot? -->
2. `rc0` has been released. Here, we only backport bug- and security-fixes, and small enhancements. Large PRs such as refactors are not backported anymore. <!-- TODO: Is that our definition with the new backport bot? -->
3. We never backport new features.
4. We never backport breaking changes except when
1. The breaking change has no effect on the vast majority of users
2. The component triggering the breaking change is marked as experimental
### How to backport?
In the past, it was necessary to manually backport your PRs. \
Now, that's not a requirement anymore as our [backport bot](https://github.com/GiteaBot) tries to create backports automatically once the PR is merged when the PR
- does not have the label `backport/manual`
- has the label `backport/<version>`
The `backport/manual` label signifies either that you want to backport the change yourself, or that there were conflicts when backporting, thus you **must** do it yourself.
### Format of backport PRs
The title of backport PRs should be
```
<original PR title> (#<original pr number>)
```
The first two lines of the summary of the backporting PR should be
```
Backport #<original pr number>
```
with the rest of the summary and labels matching the original PR.
### Frontports
Frontports behave exactly as described above for backports.
## Developer Certificate of Origin (DCO)
We consider the act of contributing to the code by submitting a Pull Request as the "Sign off" or agreement to the certifications and terms of the [DCO](DCO) and [MIT license](LICENSE). \
No further action is required. \
You can also decide to sign off your commits by adding the following line at the end of your commit messages:
```
Signed-off-by: Joe Smith <joe.smith@email.com>
```
If you set the `user.name` and `user.email` Git config options, you can add the line to the end of your commits automatically with `git commit -s`.
We assume in good faith that the information you provide is legally binding.
## Release Cycle
We adopted a release schedule to streamline the process of working on, finishing, and issuing releases. \
The overall goal is to make a major release every three or four months, which breaks down into two or three months of general development followed by one month of testing and polishing known as the release freeze. \
All the feature pull requests should be
merged before feature freeze. And, during the frozen period, a corresponding
release branch is open for fixes backported from main branch. Release candidates
are made during this period for user testing to
obtain a final version that is maintained in this branch.
During a development cycle, we may also publish any necessary minor releases
for the previous version. For example, if the latest, published release is
v1.2, then minor changes for the previous release—e.g., v1.1.0 -> v1.1.1—are
still possible.
## Maintainers
To make sure every PR is checked, we have [maintainers](MAINTAINERS). \
Every PR **must** be reviewed by at least two maintainers (or owners) before it can get merged. \
For refactoring PRs after a week and documentation only PRs, the approval of only one maintainer is enough. \
A maintainer should be a contributor of Gitea and contributed at least
4 accepted PRs. A contributor should apply as a maintainer in the
[Discord](https://discord.gg/Gitea) `#develop` channel. The team maintainers may invite the contributor. A maintainer
should spend some time on code reviews. If a maintainer has no
time to do that, they should apply to leave the maintainers team
and we will give them the honor of being a member of the [advisors
team](https://github.com/orgs/go-gitea/teams/advisors). Of course, if
an advisor has time to code review, we will gladly welcome them back
to the maintainers team. If a maintainer is inactive for more than 3
months and forgets to leave the maintainers team, the owners may move
him or her from the maintainers team to the advisors team.
For security reasons, Maintainers should use 2FA for their accounts and
if possible provide GPG signed commits.
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
https://help.github.com/articles/signing-commits-with-gpg/
## Technical Oversight Committee (TOC)
At the start of 2023, the `Owners` team was dissolved. Instead, the governance charter proposed a technical oversight committee (TOC) which expands the ownership team of the Gitea project from three elected positions to six positions. Three positions would be elected as it has been over the past years, and the other three would consist of appointed members from the Gitea company.
https://blog.gitea.io/2023/02/gitea-quarterly-report-23q1/
When the new community members have been elected, the old members will give up ownership to the newly elected members. For security reasons, TOC members or any account with write access (like a bot) must use 2FA.
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
### Current TOC members
- 2023-01-01 ~ 2023-12-31 - https://blog.gitea.io/2023/02/gitea-quarterly-report-23q1/
- Company
- [Jason Song](https://gitea.com/wolfogre) <i@wolfogre.com>
- [Lunny Xiao](https://gitea.com/lunny) <xiaolunwen@gmail.com>
- [Matti Ranta](https://gitea.com/techknowlogick) <techknowlogick@gitea.io>
- Community
- [6543](https://gitea.com/6543) <6543@obermui.de>
- [Andrew Thornton](https://gitea.com/zeripath) <art27@cantab.net>
- [John Olheiser](https://gitea.com/jolheiser) <john.olheiser@gmail.com>
### Previous TOC/owners members
Here's the history of the owners and the time they served:
- [Lunny Xiao](https://gitea.com/lunny) - 2016, 2017, [2018](https://github.com/go-gitea/gitea/issues/3255), [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872)
- [Kim Carlbäcker](https://github.com/bkcsoft) - 2016, 2017
- [Thomas Boerger](https://gitea.com/tboerger) - 2016, 2017
- [Lauris Bukšis-Haberkorns](https://gitea.com/lafriks) - [2018](https://github.com/go-gitea/gitea/issues/3255), [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801)
- [Matti Ranta](https://gitea.com/techknowlogick) - [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872)
- [Andrew Thornton](https://gitea.com/zeripath) - [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872)
## Governance Compensation
Each member of the community elected TOC will be granted $500 each month as compensation for their work.
Furthermore, any community release manager for a specific release or LTS will be compensated $500 for the delivery of said release.
These funds will come from community sources like the OpenCollective rather than directly from the company.
Only non-company members are eligible for this compensation, and if a member of the community TOC takes the responsibility of release manager, they would only be compensated for their TOC duties.
Gitea Ltd employees are not eligible to receive any funds from the OpenCollective unless it is reimbursement for a purchase made for the Gitea project itself.
## TOC & Working groups
With Gitea covering many projects outside of the main repository, several groups will be created to help focus on specific areas instead of requiring maintainers to be a jack-of-all-trades. Maintainers are of course more than welcome to be part of multiple groups should they wish to contribute in multiple places.
The currently proposed groups are:
- **Core Group**: maintain the primary Gitea repository
- **Integration Group**: maintain the Gitea ecosystem's related tools, including go-sdk/tea/changelog/bots etc.
- **Documentation Group**: maintain related documents and repositories
- **Translation Group**: coordinate with translators and maintain translations
- **Security Group**: managed by TOC directly, members are decided by TOC, maintains security patches/responsible for security items
## Roadmap
Each year a roadmap will be discussed with the entire Gitea maintainers team, and feedback will be solicited from various stakeholders.
TOC members need to review the roadmap every year and work together on the direction of the project.
When a vote is required for a proposal or other change, the vote of community elected TOC members count slightly more than the vote of company elected TOC members. With this approach, we both avoid ties and ensure that changes align with the mission statement and community opinion.
You can visit our roadmap on the wiki.
## Versions
Gitea has the `main` branch as a tip branch and has version branches
such as `release/v1.19`. `release/v1.19` is a release branch and we will
tag `v1.19.0` for binary download. If `v1.19.0` has bugs, we will accept
pull requests on the `release/v1.19` branch and publish a `v1.19.1` tag,
after bringing the bug fix also to the main branch.
Since the `main` branch is a tip version, if you wish to use Gitea
in production, please download the latest release tag version. All the
branches will be protected via GitHub, all the PRs to every branch must
be reviewed by two maintainers and must pass the automatic tests.
## Releasing Gitea
- Let $vmaj, $vmin and $vpat be Major, Minor and Patch version numbers, $vpat should be rc1, rc2, 0, 1, ...... $vmaj.$vmin will be kept the same as milestones on github or gitea in future.
- Before releasing, confirm all the version's milestone issues or PRs has been resolved. Then discuss the release on Discord channel #maintainers and get agreed with almost all the owners and mergers. Or you can declare the version and if nobody against in about serval hours.
- If this is a big version first you have to create PR for changelog on branch `main` with PRs with label `changelog` and after it has been merged do following steps:
- Create `-dev` tag as `git tag -s -F release.notes v$vmaj.$vmin.0-dev` and push the tag as `git push origin v$vmaj.$vmin.0-dev`.
- When CI has finished building tag then you have to create a new branch named `release/v$vmaj.$vmin`
- If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged.
- Add a tag as `git tag -s -F release.notes v$vmaj.$vmin.$`, release.notes file could be a temporary file to only include the changelog this version which you added to `CHANGELOG.md`.
- And then push the tag as `git push origin v$vmaj.$vmin.$`. Drone CI will automatically create a release and upload all the compiled binary. (But currently it doesn't add the release notes automatically. Maybe we should fix that.)
- If needed send a frontport PR for the changelog to branch `main` and update the version in `docs/config.yaml` to refer to the new version.
- Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release.
- Verify all release assets were correctly published through CI on dl.gitea.io and GitHub releases. Once ACKed:
- bump the version of https://dl.gitea.io/gitea/version.json
- merge the blog post PR
- announce the release in discord `#announcements`
- [Release management](https://forgejo.org/docs/next/developer/RELEASE/)
- [Secrets](https://forgejo.org/docs/next/developer/SECRETS/)

View file

@ -1,5 +1,6 @@
#Build stage
FROM docker.io/library/golang:1.20-alpine3.18 AS build-env
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.20-alpine3.18 as build-env
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
@ -9,22 +10,36 @@ ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata timetzdata $TAGS"
ARG CGO_EXTRA_CFLAGS
#Build deps
#
# Transparently cross compile for the target platform
#
COPY --from=xx / /
ARG TARGETPLATFORM
RUN apk --no-cache add clang lld
RUN xx-apk --no-cache add gcc musl-dev
ENV CGO_ENABLED=1
RUN xx-go --wrap
#
# for go generate and binfmt to find
# without it the generate phase will fail with
# #19 25.04 modules/public/public_bindata.go:8: running "go": exit status 1
# #19 25.39 aarch64-binfmt-P: Could not open '/lib/ld-musl-aarch64.so.1': No such file or directory
# why exactly is it needed? where is binfmt involved?
#
RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true
RUN apk --no-cache add build-base git nodejs npm
#Setup repo
COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
#Checkout version if set
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
&& make clean-all build
# Begin env-to-ini build
RUN go build contrib/environment-to-ini/environment-to-ini.go
RUN make clean-all
RUN make frontend
RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini
RUN make go-check generate-backend static-executable && xx-verify gitea
FROM docker.io/library/alpine:3.18
LABEL maintainer="maintainers@gitea.io"
LABEL maintainer="contact@forgejo.org"
EXPOSE 22 3000
@ -50,10 +65,10 @@ RUN addgroup \
-s /bin/bash \
-u 1000 \
-G git \
git && \
echo "git:*" | chpasswd -e
_gitea && \
echo "_gitea:*" | chpasswd -e
ENV USER git
ENV USER _gitea
ENV GITEA_CUSTOM /data/gitea
VOLUME ["/data"]
@ -62,6 +77,7 @@ ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
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

View file

@ -1,5 +1,6 @@
#Build stage
FROM docker.io/library/golang:1.20-alpine3.18 AS build-env
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.20-alpine3.18 as build-env
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
@ -9,22 +10,36 @@ ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata timetzdata $TAGS"
ARG CGO_EXTRA_CFLAGS
#Build deps
#
# Transparently cross compile for the target platform
#
COPY --from=xx / /
ARG TARGETPLATFORM
RUN apk --no-cache add clang lld
RUN xx-apk --no-cache add gcc musl-dev
ENV CGO_ENABLED=1
RUN xx-go --wrap
#
# for go generate and binfmt to find
# without it the generate phase will fail with
# #19 25.04 modules/public/public_bindata.go:8: running "go": exit status 1
# #19 25.39 aarch64-binfmt-P: Could not open '/lib/ld-musl-aarch64.so.1': No such file or directory
# why exactly is it needed? where is binfmt involved?
#
RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true
RUN apk --no-cache add build-base git nodejs npm
#Setup repo
COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
#Checkout version if set
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
&& make clean-all build
# Begin env-to-ini build
RUN go build contrib/environment-to-ini/environment-to-ini.go
RUN make clean-all
RUN make frontend
RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini
RUN make go-check generate-backend static-executable && xx-verify gitea
FROM docker.io/library/alpine:3.18
LABEL maintainer="maintainers@gitea.io"
LABEL maintainer="contact@forgejo.org"
EXPOSE 2222 3000
@ -52,6 +67,7 @@ RUN mkdir -p /var/lib/gitea /etc/gitea
RUN chown git:git /var/lib/gitea /etc/gitea
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

View file

@ -1,3 +1,4 @@
Copyright (c) 2022 The Forgejo Authors
Copyright (c) 2016 The Gitea Authors
Copyright (c) 2015 The Gogs Authors

118
Makefile
View file

@ -79,30 +79,19 @@ endif
STORED_VERSION_FILE := VERSION
HUGO_VERSION ?= 0.111.3
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
GITEA_VERSION ?= $(VERSION)
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
ifneq ($(STORED_VERSION),)
GITEA_VERSION ?= $(STORED_VERSION)
else
ifneq ($(DRONE_BRANCH),)
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
else
VERSION ?= main
endif
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
ifneq ($(STORED_VERSION),)
GITEA_VERSION ?= $(STORED_VERSION)
else
GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
endif
GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
endif
VERSION = ${GITEA_VERSION}
# if version = "main" then update version to "nightly"
ifeq ($(VERSION),main)
VERSION := main-nightly
endif
# SemVer
FORGEJO_VERSION := 5.0.6+0-gitea-1.20.5
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)" -X "code.gitea.io/gitea/routers/api/forgejo/v1.ForgejoVersion=$(FORGEJO_VERSION)" -X "main.ForgejoVersion=$(FORGEJO_VERSION)"
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
@ -154,11 +143,14 @@ ifdef DEPS_PLAYWRIGHT
PLAYWRIGHT_FLAGS += --with-deps
endif
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
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|"basePath": "/api/v1"|g
SWAGGER_EXCLUDE := code.gitea.io/sdk
SWAGGER_NEWLINE_COMMAND := -e '$$a\'
SWAGGER_SPEC_BRANDING := s|Gitea API|Forgejo API|g
TEST_MYSQL_HOST ?= mysql:3306
TEST_MYSQL_DBNAME ?= testgitea
@ -194,7 +186,6 @@ help:
@echo " - clean delete backend and integration files"
@echo " - clean-all delete backend, frontend and integration files"
@echo " - deps install dependencies"
@echo " - deps-docs install docs dependencies"
@echo " - deps-frontend install frontend dependencies"
@echo " - deps-backend install backend dependencies"
@echo " - deps-tools install tool dependencies"
@ -229,6 +220,8 @@ help:
@echo " - generate-license update license files"
@echo " - generate-gitignore update gitignore files"
@echo " - generate-manpage generate manpage"
@echo " - generate-forgejo-api generate the forgejo API from spec"
@echo " - forgejo-api-validate check if the forgejo API matches the specs"
@echo " - generate-swagger generate the swagger spec from code comments"
@echo " - swagger-validate check if the swagger spec is valid"
@echo " - go-licenses regenerate go licenses"
@ -314,6 +307,27 @@ ifneq "$(TAGS)" "$(shell cat $(TAGS_EVIDENCE) 2>/dev/null)"
TAGS_PREREQ := $(TAGS_EVIDENCE)
endif
OAPI_CODEGEN_PACKAGE ?= github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.12.4
KIN_OPENAPI_CODEGEN_PACKAGE ?= github.com/getkin/kin-openapi/cmd/validate@v0.114.0
FORGEJO_API_SERVER = routers/api/forgejo/v1/generated.go
.PHONY: generate-forgejo-api
generate-forgejo-api: $(FORGEJO_API_SPEC)
$(GO) run $(OAPI_CODEGEN_PACKAGE) -package v1 -generate chi-server,types $< > $(FORGEJO_API_SERVER)
.PHONY: forgejo-api-check
forgejo-api-check: generate-forgejo-api
@diff=$$(git diff $(FORGEJO_API_SERVER) ; \
if [ -n "$$diff" ]; then \
echo "Please run 'make generate-forgejo-api' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi
.PHONY: forgejo-api-validate
forgejo-api-validate:
$(GO) run $(KIN_OPENAPI_CODEGEN_PACKAGE) $(FORGEJO_API_SPEC)
.PHONY: generate-swagger
generate-swagger: $(SWAGGER_SPEC)
@ -321,6 +335,7 @@ $(SWAGGER_SPEC): $(GO_SOURCES_NO_BINDATA)
$(GO) run $(SWAGGER_PACKAGE) generate spec -x "$(SWAGGER_EXCLUDE)" -o './$(SWAGGER_SPEC)'
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
$(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)'
$(SED_INPLACE) '$(SWAGGER_SPEC_BRANDING)' './$(SWAGGER_SPEC)'
.PHONY: swagger-check
swagger-check: generate-swagger
@ -344,7 +359,7 @@ checks: checks-frontend checks-backend
checks-frontend: lockfile-check svg-check
.PHONY: checks-backend
checks-backend: tidy-check swagger-check fmt-check misspell-check swagger-validate security-check
checks-backend: tidy-check swagger-check fmt-check misspell-check forgejo-api-validate swagger-validate security-check
.PHONY: lint
lint: lint-frontend lint-backend
@ -366,11 +381,11 @@ lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig
.PHONY: lint-js
lint-js: node_modules
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js tests/e2e
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js tests/e2e
.PHONY: lint-js-fix
lint-js-fix: node_modules
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js tests/e2e --fix
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js tests/e2e --fix
.PHONY: lint-css
lint-css: node_modules
@ -406,8 +421,7 @@ lint-go-windows:
.PHONY: lint-go-vet
lint-go-vet:
@echo "Running go vet..."
@GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet
@$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)
@$(GO) vet $(GO_PACKAGES)
.PHONY: lint-editorconfig
lint-editorconfig:
@ -808,10 +822,14 @@ generate: generate-backend
generate-backend: $(TAGS_PREREQ) generate-go
.PHONY: generate-go
generate-go: $(TAGS_PREREQ)
generate-go: $(TAGS_PREREQ) merge-locales
@echo "Running go generate..."
@CC= GOOS= GOARCH= $(GO) generate -tags '$(TAGS)' $(GO_PACKAGES)
.PHONY: merge-locales
merge-locales:
@CC= GOOS= GOARCH= $(GO) run build/merge-forgejo-locales.go
.PHONY: security-check
security-check:
go run $(GOVULNCHECK_PACKAGE) ./...
@ -819,8 +837,14 @@ security-check:
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
static-executable: $(GO_SOURCES) $(TAGS_PREREQ)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE)
.PHONY: release
release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-docs release-check
release: frontend generate release-linux release-copy release-compress vendor release-sources release-check
# just the sources, with all assets builtin and frontend resources generated
sources-tarbal: frontend generate vendor release-sources release-check
$(DIST_DIRS):
mkdir -p $(DIST_DIRS)
@ -831,13 +855,13 @@ 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
ifeq ($(CI),true)
ifneq ($(DRONE_TAG),)
cp /build/* $(DIST)/binaries
endif
.PHONY: release-linux
release-linux: | $(DIST_DIRS)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out gitea-$(VERSION) .
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out forgejo-$(VERSION) .
ifeq ($(CI),true)
cp /build/* $(DIST)/binaries
endif
@ -845,14 +869,14 @@ 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) .
ifeq ($(CI),true)
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) .
ifeq ($(CI),true)
ifneq ($(DRONE_TAG),)
cp /build/* $(DIST)/binaries
endif
@ -874,26 +898,20 @@ release-sources: | $(DIST_DIRS)
# bsdtar needs a ^ to prevent matching subdirectories
$(eval EXCL := --exclude=$(shell tar --help | grep -q bsdtar && echo "^")./)
# use transform to a add a release-folder prefix; in bsdtar the transform parameter equivalent is -s
$(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./gitea-src-$(VERSION)/'" || echo "--transform 's|^./|gitea-src-$(VERSION)/|'"))
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
$(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./forgejo-src-$(VERSION)/'" || echo "--transform 's|^./|forgejo-src-$(VERSION)/|'"))
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/forgejo-src-$(VERSION).tar.gz .
rm -f $(STORED_VERSION_FILE)
.PHONY: release-docs
release-docs: | $(DIST_DIRS) docs
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs/public .
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs .
.PHONY: docs
docs: deps-docs
cd docs; make trans-copy clean build-offline;
.PHONY: deps-docs
deps-docs:
@hash hugo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
curl -sL https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_$(HUGO_VERSION)_Linux-64bit.tar.gz | tar zxf - -C /tmp && mkdir -p ~/go/bin && mv /tmp/hugo ~/go/bin/hugo && chmod +x ~/go/bin/hugo; \
fi
docs:
cd docs; bash scripts/trans-copy.sh;
.PHONY: deps
deps: deps-frontend deps-backend deps-tools deps-docs
deps: deps-frontend deps-backend deps-tools
.PHONY: deps-frontend
deps-frontend: node_modules
@ -976,13 +994,7 @@ lockfile-check:
.PHONY: update-translations
update-translations:
mkdir -p ./translations
cd ./translations && curl -L https://crowdin.com/download/project/gitea.zip > gitea.zip && unzip gitea.zip
rm ./translations/gitea.zip
$(SED_INPLACE) -e 's/="/=/g' -e 's/"$$//g' ./translations/*.ini
$(SED_INPLACE) -e 's/\\"/"/g' ./translations/*.ini
mv ./translations/*.ini ./options/locale/
rmdir ./translations
# noop to detect merge conflicts (potentially needs updating the scripts) and avoid breaking with Gitea
.PHONY: generate-license
generate-license:
@ -1010,9 +1022,5 @@ docker:
docker build --disable-content-trust=false -t $(DOCKER_REF) .
# support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite sqlite_unlock_notify" .
.PHONY: docker-build
docker-build:
docker run -ti --rm -v "$(CURDIR):/srv/app/src/code.gitea.io/gitea" -w /srv/app/src/code.gitea.io/gitea -e TAGS="bindata $(TAGS)" LDFLAGS="$(LDFLAGS)" CGO_EXTRA_CFLAGS="$(CGO_EXTRA_CFLAGS)" webhippie/golang:edge make clean build
# This endif closes the if at the top of the file
endif

204
README.md
View file

@ -1,180 +1,46 @@
<p align="center">
<a href="https://gitea.io/">
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/img/gitea.svg" width="220"/>
</a>
</p>
<h1 align="center">Gitea - Git with a cup of tea</h1>
<div align="center">
<img src="./assets/logo.svg" alt="" width="192" align="center" />
<h1 align="center">Welcome to Forgejo</h1>
</div>
<p align="center">
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/main">
</a>
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
<img src="https://img.shields.io/discord/322538954119184384.svg">
</a>
<a href="https://app.codecov.io/gh/go-gitea/gitea" title="Codecov">
<img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
</a>
<a href="https://goreportcard.com/report/code.gitea.io/gitea" title="Go Report Card">
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
</a>
<a href="https://pkg.go.dev/code.gitea.io/gitea" title="GoDoc">
<img src="https://pkg.go.dev/badge/code.gitea.io/gitea?status.svg">
</a>
<a href="https://github.com/go-gitea/gitea/releases/latest" title="GitHub release">
<img src="https://img.shields.io/github/release/go-gitea/gitea.svg">
</a>
<a href="https://www.codetriage.com/go-gitea/gitea" title="Help Contribute to Open Source">
<img src="https://www.codetriage.com/go-gitea/gitea/badges/users.svg">
</a>
<a href="https://opencollective.com/gitea" title="Become a backer/sponsor of gitea">
<img src="https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen">
</a>
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
</a>
<a href="https://gitpod.io/#https://github.com/go-gitea/gitea">
<img
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
alt="Contribute with Gitpod"
/>
</a>
<a href="https://crowdin.com/project/gitea" title="Crowdin">
<img src="https://badges.crowdin.net/gitea/localized.svg">
</a>
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
</a>
<a href="https://app.bountysource.com/teams/gitea" title="Bountysource">
<img src="https://img.shields.io/bountysource/team/gitea/activity">
</a>
</p>
Hi there! Tired of big platforms playing monopoly?
Providing Git hosting for your project, friends, company or community?
**Forgejo** (/for'd&#865;ʒe.jo/ inspired by forĝejo the Esperanto word for *forge*) has you covered with its intuitive interface,
light and easy hosting and a lot of builtin functionality.
<p align="center">
<a href="README_ZH.md">View this document in Chinese</a>
</p>
Forgejo was [created in 2022](https://forgejo.org/2022-12-15-hello-forgejo/)
because we think that the project should be owned by an independent community.
If you second that, then Forgejo is for you!
Our promise: **Independent Free/Libre Software forever!**
## Purpose
## What does Forgejo offer?
The goal of this project is to make the easiest, fastest, and most
painless way of setting up a self-hosted Git service.
<!-- If you want to know what Forgejo is like,
you can check out public instances,
e.g. [Codeberg.org](https://codeberg.org).
-->
As Gitea is written in Go, it works across **all** the platforms and
architectures that are supported by Go, including Linux, macOS, and
Windows on x86, amd64, ARM and PowerPC architectures.
You can try it out using [the online demo](https://try.gitea.io/).
This project has been
[forked](https://blog.gitea.io/2016/12/welcome-to-gitea/) from
[Gogs](https://gogs.io) since November of 2016, but a lot has changed.
If you like any of the following, Forgejo is literally meant for you:
## Building
- Lightweight: Forgejo can easily be hosted on nearly **every machine**.
Running on a Raspberry? Small cloud instance? No problem!
- Project management: Besides Git hosting, Forgejo offers issues,
pull requests, wikis, kanban boards and much more to **coordinate with your team**.
- Publishing: Have something to share? Use **releases** to host your software for download,
or use the **package registry** to publish it for docker, npm and many other package managers.
- Customizable: Want to change your look? Change some settings?
There are many **config switches** to make Forgejo work exactly like you want.
- Powerful: Organizations & team permissions, CI integration, Code Search, LDAP, OAuth and much more.
If you have **advanced needs**, Forgejo has you covered.
- Privacy: From update checker to default settings: Forgejo is built to be **privacy first** for you and your crew.
- Federation: (WIP) We are actively working to connect software forges with each other through **ActivityPub**,
and create a collaborative network of personal instances.
From the root of the source tree, run:
## Learn more
TAGS="bindata" make build
Dive into the [documentation](https://forgejo.org/docs/latest/), subscribe to releases and blog post on [our website](https://forgejo.org), <a href="https://floss.social/@forgejo" rel="me">find us on the Fediverse</a> or hop into [our Matrix room](https://matrix.to/#/#forgejo-chat:matrix.org) if you have any questions or want to get involved.
or if SQLite support is required:
TAGS="bindata sqlite sqlite_unlock_notify" make build
## Get involved
The `build` target is split into two sub-targets:
- `make backend` which requires [Go Stable](https://go.dev/dl/), required version is defined in [go.mod](/go.mod).
- `make frontend` which requires [Node.js LTS](https://nodejs.org/en/download/) or greater and Internet connectivity to download npm dependencies.
When building from the official source tarballs which include pre-built frontend files, the `frontend` target will not be triggered, making it possible to build without Node.js and Internet connectivity.
Parallelism (`make -j <num>`) is not supported.
More info: https://docs.gitea.io/en-us/install-from-source/
## Using
./gitea web
NOTE: If you're interested in using our APIs, we have experimental
support with [documentation](https://try.gitea.io/api/swagger).
## Contributing
Expected workflow is: Fork -> Patch -> Push -> Pull Request
NOTES:
1. **YOU MUST READ THE [CONTRIBUTORS GUIDE](CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST.**
2. If you have found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks!
## Translating
Translations are done through Crowdin. If you want to translate to a new language ask one of the managers in the Crowdin project to add a new language there.
You can also just create an issue for adding a language or ask on discord on the #translation channel. If you need context or find some translation issues, you can leave a comment on the string or ask on Discord. For general translation questions there is a section in the docs. Currently a bit empty but we hope to fill it as questions pop up.
https://docs.gitea.io/en-us/contributing/translation-guidelines/
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
## Further information
For more information and instructions about how to install Gitea, please look at our [documentation](https://docs.gitea.io/en-us/).
If you have questions that are not covered by the documentation, you can get in contact with us on our [Discord server](https://discord.gg/Gitea) or create a post in the [discourse forum](https://discourse.gitea.io/).
We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea).
The Hugo-based documentation theme is hosted at [gitea/theme](https://gitea.com/gitea/theme).
The official Gitea CLI is developed at [gitea/tea](https://gitea.com/gitea/tea).
## Authors
- [Maintainers](https://github.com/orgs/go-gitea/people)
- [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
- [Translators](options/locale/TRANSLATORS)
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/gitea#backer)]
<a href="https://opencollective.com/gitea#backers" target="_blank"><img src="https://opencollective.com/gitea/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/gitea#sponsor)]
<a href="https://opencollective.com/gitea/sponsor/0/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/1/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/2/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/3/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/4/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/5/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/6/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/7/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/9/avatar.svg"></a>
<a href="https://cynkra.com/" target="_blank"><img src="https://images.opencollective.com/cynkra/logo/square/64/192.png"></a>
## FAQ
**How do you pronounce Gitea?**
Gitea is pronounced [/ɡɪti:/](https://youtu.be/EM71-2uDAoY) as in "gi-tea" with a hard g.
**Why is this not hosted on a Gitea instance?**
We're [working on it](https://github.com/go-gitea/gitea/issues/1029).
## License
This project is licensed under the MIT License.
See the [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) file
for the full license text.
## Screenshots
Looking for an overview of the interface? Check it out!
|![Dashboard](https://dl.gitea.io/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.io/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.io/screenshots/global_issues.png)|
|:---:|:---:|:---:|
|![Branches](https://dl.gitea.io/screenshots/branches.png)|![Web Editor](https://dl.gitea.io/screenshots/web_editor.png)|![Activity](https://dl.gitea.io/screenshots/activity.png)|
|![New Migration](https://dl.gitea.io/screenshots/migration.png)|![Migrating](https://dl.gitea.io/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
![Pull Request Dark](https://dl.gitea.io/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.io/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.io/screenshots/diff_dark.png)|
If you are interested in making Forgejo better, either by reporting a bug or by changing the governance, please [take a look at the contribution guide](CONTRIBUTING.md).

View file

@ -1,98 +0,0 @@
<p align="center">
<a href="https://gitea.io/">
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/img/gitea.svg" width="220"/>
</a>
</p>
<h1 align="center">Gitea - Git with a cup of tea</h1>
<p align="center">
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/main">
</a>
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
<img src="https://img.shields.io/discord/322538954119184384.svg">
</a>
<a href="https://app.codecov.io/gh/go-gitea/gitea" title="Codecov">
<img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
</a>
<a href="https://goreportcard.com/report/code.gitea.io/gitea" title="Go Report Card">
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
</a>
<a href="https://pkg.go.dev/code.gitea.io/gitea" title="GoDoc">
<img src="https://pkg.go.dev/badge/code.gitea.io/gitea?status.svg">
</a>
<a href="https://github.com/go-gitea/gitea/releases/latest" title="GitHub release">
<img src="https://img.shields.io/github/release/go-gitea/gitea.svg">
</a>
<a href="https://www.codetriage.com/go-gitea/gitea" title="Help Contribute to Open Source">
<img src="https://www.codetriage.com/go-gitea/gitea/badges/users.svg">
</a>
<a href="https://opencollective.com/gitea" title="Become a backer/sponsor of gitea">
<img src="https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen">
</a>
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
</a>
<a href="https://gitpod.io/#https://github.com/go-gitea/gitea">
<img
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
alt="Contribute with Gitpod"
/>
</a>
<a href="https://crowdin.com/project/gitea" title="Crowdin">
<img src="https://badges.crowdin.net/gitea/localized.svg">
</a>
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
</a>
<a href="https://app.bountysource.com/teams/gitea" title="Bountysource">
<img src="https://img.shields.io/bountysource/team/gitea/activity">
</a>
</p>
<p align="center">
<a href="README.md">View this document in English</a>
</p>
## 目标
Gitea 的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用 Go 作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了 x86amd64还包括 ARM 和 PowerPC。
如果您想试用一下,请访问 [在线Demo](https://try.gitea.io/)
## 提示
1. **开始贡献代码之前请确保你已经看过了 [贡献者向导(英文)](CONTRIBUTING.md)**.
2. 所有的安全问题,请私下发送邮件给 **security@gitea.io**。谢谢!
3. 如果你要使用API请参见 [API 文档](https://godoc.org/code.gitea.io/sdk/gitea).
## 文档
关于如何安装请访问我们的 [文档站](https://docs.gitea.io/zh-cn/),如果没有找到对应的文档,你也可以通过 [Discord - 英文](https://discord.gg/gitea) 和 QQ群 328432459 来和我们交流。
## 贡献流程
Fork -> Patch -> Push -> Pull Request
## 翻译
多语言翻译是基于Crowdin进行的.
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
## 作者
* [Maintainers](https://github.com/orgs/go-gitea/people)
* [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
* [Translators](options/locale/TRANSLATORS)
## 授权许可
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) 文件中。
## 截图
|![Dashboard](https://dl.gitea.io/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.io/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.io/screenshots/global_issues.png)|
|:---:|:---:|:---:|
|![Branches](https://dl.gitea.io/screenshots/branches.png)|![Web Editor](https://dl.gitea.io/screenshots/web_editor.png)|![Activity](https://dl.gitea.io/screenshots/activity.png)|
|![New Migration](https://dl.gitea.io/screenshots/migration.png)|![Migrating](https://dl.gitea.io/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
![Pull Request Dark](https://dl.gitea.io/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.io/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.io/screenshots/diff_dark.png)|

1050
RELEASE-NOTES.md Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,83 +0,0 @@
# Reporting security issues
The Gitea maintainers take security seriously.
If you discover a security issue, please bring it to their attention right away!
## Reporting a Vulnerability
Please **DO NOT** file a public issue, instead send your report privately to `security@gitea.io`.
## Protecting Security Information
Due to the sensitive nature of security information, you can use below GPG public key encrypt your mail body.
The PGP key is valid until June 24, 2024.
```
Key ID: 6FCD2D5B
Key Type: RSA
Expires: 6/24/2024
Key Size: 4096/4096
Fingerprint: 3DE0 3D1E 144A 7F06 9359 99DC AAFD 2381 6FCD 2D5B
```
UserID: Gitea Security <security@gitea.io>
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGK1Z/4BEADFMqXA9DeeChmSxUjF0Be5sq99ZUhgrZjcN/wOzz0wuCJZC0l8
4uC+d6mfv7JpJYlzYzOK97/x5UguKHkYNZ6mm1G9KHaXmoIBDLKDzfPdJopVNv2r
OajijaE0uMCnMjadlg5pbhMLRQG8a9J32yyaz7ZEAw72Ab31fvvcA53NkuqO4j2w
k7dtFQzhbNOYV0VffQT90WDZdalYHB1JHyEQ+70U9OjVD5ggNYSzX98Eu3Hjn7V7
kqFrcAxr5TE1elf0IXJcuBJtFzQSTUGlQldKOHtGTGgGjj9r/FFAE5ioBgVD05bV
rEEgIMM/GqYaG/nbNpWE6P3mEc2Mnn3pZaRJL0LuF26TLjnqEcMMDp5iIhLdFzXR
3tMdtKgQFu+Mtzs3ipwWARYgHyU09RJsI2HeBx7RmZO/Xqrec763Z7zdJ7SpCn0Z
q+pHZl24JYR0Kf3T/ZiOC0cGd2QJqpJtg5J6S/OqfX9NH6MsCczO8pUC1N/aHH2X
CTme2nF56izORqDWKoiICteL3GpYsCV9nyCidcCmoQsS+DKvE86YhIhVIVWGRY2F
lzpAjnN9/KLtQroutrm+Ft0mdjDiJUeFVl1cOHDhoyfCsQh62HumoyZoZvqzQd6e
AbN11nq6aViMe2Q3je1AbiBnRnQSHxt1Tc8X4IshO3MQK1Sk7oPI6LA5oQARAQAB
tCJHaXRlYSBTZWN1cml0eSA8c2VjdXJpdHlAZ2l0ZWEuaW8+iQJXBBMBCABBFiEE
PeA9HhRKfwaTWZncqv0jgW/NLVsFAmK1Z/4CGwMFCQPCZwAFCwkIBwICIgIGFQoJ
CAsCBBYCAwECHgcCF4AACgkQqv0jgW/NLVvnyxAAhxyNnWzw/rQO2qhzqicmZM94
njSbOg+U2qMBvCdaqCQQeC+uaMmMzkDPanUUmLcyCkWqfCjPNjeSXAkE9npepVJI
4HtmgxZQ94OU/h3CLbft+9GVRzUkVI29TSYGdvNtV2/BkNGoFFnKWQr119um0o6A
bgha2Uy5uY8o3ZIoiKkiHRaEoWIjjeBxJxYAojsZY4YElUmsQ3ik2joG6rhFesTa
ofVt/bL8G2xzpOG26WGIxBbqf2qjV6OtZ0hu/vtTPHeIWMLq0Mz0V3PEDQWfkGPE
i2RYxxYDs2xzJhSQWqTNVLSq0m5xTJnbHhQPfdCX4C2jvFKgLdfmytQq49S7jiJb
Z03HVOZ/PsyBlQfH9xJi06R5yQCMEA8h8Z5r3/NXW09kQ6OFRe6xshoTcxZGRPTo
srhwr3uPbmCRh+YEl7qBLU6+BC5k8IRTZXqhrj/aPJu3MxgbgwV8u3vLoFSXM2lb
a61FgeCQ0O7lkgVswwF0RppCaH9Ul3ZDapet/vCRg4NVwm9zOI/8q/Vj0FKA1GDR
JhRu8+Ce8zlFL65D34t+PprAzSeTlbv9um3x/ZIjCco7EEKSBylt+AZj/VyA6+e5
kjOQwRRc6dFJWBcorsSI2dG+H+QMF7ZabzmeCcz1v9HjLOPzYHoZAHhCmSppWTvX
AJy6+lhfW2OUTqQeYSi5Ag0EYrVn/gEQALrFLQjCR3GjuHSindz0rd3Fnx/t7Sen
T+p07yCSSoSlmnJHCQmwh4vfg1blyz0zZ4vkIhtpHsEgc+ZAG+WQXSsJ2iRz+eSN
GwoOQl4XC3n+QWkc1ws+btr48+6UqXIQU+F8TPQyx/PIgi2nZXJB7f5+mjCqsk46
XvH4nTr4kJjuqMSR/++wvre2qNQRa/q/dTsK0OaN/mJsdX6Oi+aGNaQJUhIG7F+E
ZDMkn/O6xnwWNzy/+bpg43qH/Gk0eakOmz5NmQLRkV58SZLiJvuCUtkttf6CyhnX
03OcWaajv5W8qA39dBYQgDrrPbBWUnwfO3yMveqhwV4JjDoe8sPAyn1NwzakNYqP
RzsWyLrLS7R7J9s3FkZXhQw/QQcsaSMcGNQO047dm1P83N8JY5aEpiRo9zSWjoiw
qoExANj5lUTZPe8M50lI182FrcjAN7dClO3QI6pg7wy0erMxfFly3j8UQ91ysS9T
s+GsP9I3cmWWQcKYxWHtE8xTXnNCVPFZQj2nwhJzae8ypfOtulBRA3dUKWGKuDH/
axFENhUsT397aOU3qkP/od4a64JyNIEo4CTTSPVeWd7njsGqli2U3A4xL2CcyYvt
D/MWcMBGEoLSNTswwKdom4FaJpn5KThnK/T0bQcmJblJhoCtppXisbexZnCpuS0x
Zdlm2T14KJ3LABEBAAGJAjwEGAEIACYWIQQ94D0eFEp/BpNZmdyq/SOBb80tWwUC
YrVn/gIbDAUJA8JnAAAKCRCq/SOBb80tWyTBD/9AGpW6QoDF7zYjHAozH9S5RGCA
Y7E82dG/0xmFUwPprAG0BKmmgU6TiipyVGmKIXGYYYU92pMnbvXkYQMoa+WJNncN
D3fY52UeXeffTf4cFpStlzi9xgYtOLhFamzYu/4xhkjOX+xhOSXscCiFRyT8cF3B
O6c5BHU+Zj0/rGPgOyPUbx7l7B9MubB/41nNX35k08e+8T3wtWDb4XF+15HnRfva
6fblO8wgU25Orv2Rm1jnKGa9DxJ8nE40IMrqDapENtDuL+zKJsvR0+ptWvEyL56U
GtJJG5un6mXiLKuRQT0DEv4MdZRHDgDstDnqcbEiazVEbUuvhZZob6lRY2A19m1+
7zfnDxkhqCA1RCnv4fdvcPdCMMFHwLpdhjgW0aI/uwgwrvsEz5+JRlnLvdQHlPAg
q7l2fGcBSpz9U0ayyfRPjPntsNCtZl1UDxGLeciPkZhyG84zEWQbk/j52ZpRN+Ik
ALpRLa8RBFmFSmXDUmwQrmm1EmARyQXwweKU31hf8ZGbCp2lPuRYm1LuGiirXSVP
GysjRAJgW+VRpBKOzFQoUAUbReVWSaCwT8s17THzf71DdDb6CTj31jMLLYWwBpA/
i73DgobDZMIGEZZC1EKqza8eh11xfyHFzGec03tbh+lIen+5IiRtWiEWkDS9ll0G
zgS/ZdziCvdAutqnGA==
=gZWO
-----END PGP PUBLIC KEY BLOCK-----
```
Security reports are greatly appreciated and we will publicly thank you for it, although we keep your name confidential if you request it.

View file

@ -1,31 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve">
<g>
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8
c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4
c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
<g>
<g>
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2
c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5
c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5
c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3
c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1
C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4
c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7
S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55
c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8
l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4
c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1
c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9
c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3
c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3
c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29
c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8
C343.2,346.5,335,363.3,326.8,380.1z"/>
</g>
</g>
</g>
<svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
circle {
fill: none;
stroke: #000;
stroke-width: 15;
}
path {
fill: none;
stroke: #000;
stroke-width: 25;
}
.orange {
stroke:#ff6600;
}
.red {
stroke:#d40000;
}
</style>
<g transform="translate(6,6)">
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" class="orange" />
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" class="red" />
<circle cx="142" cy="20" r="18" class="orange" />
<circle cx="142" cy="88" r="18" class="red" />
<circle cx="58" cy="180" r="18" class="red" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 677 B

View file

@ -1,31 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve">
<g>
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8
c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4
c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
<g>
<g>
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2
c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5
c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5
c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3
c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1
C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4
c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7
S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55
c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8
l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4
c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1
c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9
c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3
c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3
c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29
c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8
C343.2,346.5,335,363.3,326.8,380.1z"/>
</g>
</g>
</g>
<svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
circle {
fill: none;
stroke: #000;
stroke-width: 15;
}
path {
fill: none;
stroke: #000;
stroke-width: 25;
}
.orange {
stroke:#ff6600;
}
.red {
stroke:#d40000;
}
</style>
<g transform="translate(6,6)">
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" class="orange" />
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" class="red" />
<circle cx="142" cy="20" r="18" class="orange" />
<circle cx="142" cy="88" r="18" class="red" />
<circle cx="58" cy="180" r="18" class="red" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 677 B

View file

@ -25,7 +25,7 @@ import (
var optionLogVerbose bool
func logVerbose(msg string, args ...interface{}) {
func logVerbose(msg string, args ...any) {
if optionLogVerbose {
log.Printf(msg, args...)
}

View file

@ -0,0 +1,97 @@
// Copyright 2022 The Forgejo Authors c/o Codeberg e.V.. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
//go:build ignore
package main
import (
"bufio"
"os"
"regexp"
"strings"
"gopkg.in/ini.v1"
)
const (
trimPrefix = "gitea_"
sourceFolder = "options/locales/"
)
// returns list of locales, still containing the file extension!
func generate_locale_list() []string {
localeFiles, _ := os.ReadDir(sourceFolder)
locales := []string{}
for _, localeFile := range localeFiles {
if !localeFile.IsDir() && strings.HasPrefix(localeFile.Name(), trimPrefix) {
locales = append(locales, strings.TrimPrefix(localeFile.Name(), trimPrefix))
}
}
return locales
}
// replace all occurrences of Gitea with Forgejo
func renameGiteaForgejo(filename string) []byte {
file, err := os.Open(filename)
if err != nil {
panic(err)
}
replacer := strings.NewReplacer(
"Gitea", "Forgejo",
"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.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",
)
out := make([]byte, 0, 1024)
scanner := bufio.NewScanner(file)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
line := scanner.Text()
if strings.HasPrefix(line, "license_desc=") {
line = strings.Replace(line, "GitHub", "Forgejo", 1)
}
if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") {
out = append(out, []byte("\n"+line+"\n")...)
} else if strings.HasPrefix(line, "settings.web_hook_name_gitea") {
out = append(out, []byte("\n"+line+"\n")...)
out = append(out, []byte("settings.web_hook_name_forgejo = Forgejo\n")...)
} else if strings.HasPrefix(line, "migrate.gitea.description") {
re := regexp.MustCompile(`(.*Gitea)`)
out = append(out, []byte(re.ReplaceAllString(line, "${1}/Forgejo")+"\n")...)
} else {
out = append(out, []byte(replacer.Replace(line)+"\n")...)
}
}
file.Close()
return out
}
func main() {
locales := generate_locale_list()
var err error
var localeFile *ini.File
for _, locale := range locales {
giteaLocale := sourceFolder + "gitea_" + locale
localeFile, err = ini.LoadSources(ini.LoadOptions{
IgnoreInlineComment: true,
}, giteaLocale, renameGiteaForgejo(giteaLocale))
if err != nil {
panic(err)
}
err = localeFile.SaveTo("options/locale/locale_" + locale)
if err != nil {
panic(err)
}
}
}

View file

@ -42,7 +42,7 @@ func runGenerateActionsRunnerToken(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setting.Init(&setting.Options{})
setting.MustInstalled()
scope := c.String("scope")

View file

@ -348,6 +348,10 @@ func runRepoSyncReleases(_ *cli.Context) error {
return err
}
if err := git.InitSimple(ctx); err != nil {
return err
}
log.Trace("Synchronizing repository releases (this may take a while)")
for page := 1; ; page++ {
repos, count, err := repo_model.SearchRepositoryByName(ctx, &repo_model.SearchRepoOptions{

View file

@ -55,17 +55,28 @@ func runGenerateAccessToken(c *cli.Context) error {
return err
}
accessTokenScope, err := auth_model.AccessTokenScope(c.String("scopes")).Normalize()
// construct token with name and user so we can make sure it is unique
t := &auth_model.AccessToken{
Name: c.String("token-name"),
UID: user.ID,
}
exist, err := auth_model.AccessTokenByNameExists(t)
if err != nil {
return err
}
t := &auth_model.AccessToken{
Name: c.String("token-name"),
UID: user.ID,
Scope: accessTokenScope,
if exist {
return fmt.Errorf("access token name has been used already")
}
// make sure the scopes are valid
accessTokenScope, err := auth_model.AccessTokenScope(c.String("scopes")).Normalize()
if err != nil {
return fmt.Errorf("invalid access token scope provided: %w", err)
}
t.Scope = accessTokenScope
// create the token
if err := auth_model.NewAccessToken(t); err != nil {
return err
}

View file

@ -63,7 +63,7 @@ Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.`,
},
}
func publicKey(priv interface{}) interface{} {
func publicKey(priv any) any {
switch k := priv.(type) {
case *rsa.PrivateKey:
return &k.PublicKey
@ -74,7 +74,7 @@ func publicKey(priv interface{}) interface{} {
}
}
func pemBlockForKey(priv interface{}) *pem.Block {
func pemBlockForKey(priv any) *pem.Block {
switch k := priv.(type) {
case *rsa.PrivateKey:
return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)}
@ -94,7 +94,7 @@ func runCert(c *cli.Context) error {
return err
}
var priv interface{}
var priv any
var err error
switch c.String("ecdsa-curve") {
case "":

View file

@ -58,7 +58,7 @@ func confirm() (bool, error) {
}
func initDB(ctx context.Context) error {
setting.Init(&setting.Options{})
setting.MustInstalled()
setting.LoadDBSetting()
setting.InitSQLLoggersForCli(log.INFO)
@ -106,5 +106,21 @@ func setupConsoleLogger(level log.Level, colorize bool, out io.Writer) {
WriterOption: log.WriterConsoleOption{Stderr: out == os.Stderr},
}
writer := log.NewEventWriterConsole("console-default", writeMode)
log.GetManager().GetLogger(log.DEFAULT).RemoveAllWriters().AddWriters(writer)
log.GetManager().GetLogger(log.DEFAULT).ReplaceAllWriters(writer)
}
// 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 c.Bool("quiet") || c.GlobalBoolT("quiet") {
level = log.FATAL
}
if c.Bool("debug") || c.GlobalBool("debug") || c.Bool("verbose") || c.GlobalBool("verbose") {
level = log.TRACE
}
log.SetConsoleLogger(log.DEFAULT, "console-default", level)
return nil
}
}

View file

@ -91,7 +91,7 @@ func runRecreateTable(ctx *cli.Context) error {
golog.SetOutput(log.LoggerToWriter(log.GetLogger(log.DEFAULT).Info))
debug := ctx.Bool("debug")
setting.Init(&setting.Options{})
setting.MustInstalled()
setting.LoadDBSetting()
if debug {
@ -151,7 +151,7 @@ func setupDoctorDefaultLogger(ctx *cli.Context, colorize bool) {
log.FallbackErrorf("unable to create file log writer: %v", err)
return
}
log.GetManager().GetLogger(log.DEFAULT).RemoveAllWriters().AddWriters(writer)
log.GetManager().GetLogger(log.DEFAULT).ReplaceAllWriters(writer)
}
}

View file

@ -98,14 +98,14 @@ var outputTypeEnum = &outputType{
// CmdDump represents the available dump sub-command.
var CmdDump = cli.Command{
Name: "dump",
Usage: "Dump Gitea files and database",
Usage: "Dump Forgejo files and database",
Description: `Dump compresses all related files and database into zip file.
It can be used for backup and capture Gitea server image to send to maintainer`,
It can be used for backup and capture Forgejo server image to send to maintainer`,
Action: runDump,
Flags: []cli.Flag{
cli.StringFlag{
Name: "file, f",
Value: fmt.Sprintf("gitea-dump-%d.zip", time.Now().Unix()),
Value: fmt.Sprintf("forgejo-dump-%d.zip", time.Now().Unix()),
Usage: "Name of the dump file which will be created. Supply '-' for stdout. See type for available types.",
},
cli.BoolFlag{
@ -161,7 +161,7 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
},
}
func fatal(format string, args ...interface{}) {
func fatal(format string, args ...any) {
fmt.Fprintf(os.Stderr, format+"\n", args...)
log.Fatal(format, args...)
}
@ -182,7 +182,7 @@ func runDump(ctx *cli.Context) error {
}
fileName += "." + outType
}
setting.Init(&setting.Options{})
setting.MustInstalled()
// make sure we are logging to the console no matter what the configuration tells us do to
// FIXME: don't use CfgProvider directly
@ -202,7 +202,7 @@ func runDump(ctx *cli.Context) error {
if !setting.InstallLock {
log.Error("Is '%s' really the right config path?\n", setting.CustomConf)
return fmt.Errorf("gitea is not initialized")
return fmt.Errorf("forgejo is not initialized")
}
setting.LoadSettings() // cannot access session settings otherwise
@ -236,7 +236,7 @@ func runDump(ctx *cli.Context) error {
return err
}
var iface interface{}
var iface any
if fileName == "-" {
iface, err = archiver.ByExtension(fmt.Sprintf(".%s", outType))
} else {
@ -281,7 +281,7 @@ func runDump(ctx *cli.Context) error {
fatal("Path does not exist: %s", tmpDir)
}
dbDump, err := os.CreateTemp(tmpDir, "gitea-db.sql")
dbDump, err := os.CreateTemp(tmpDir, "forgejo-db.sql")
if err != nil {
fatal("Failed to create tmp file: %v", err)
}
@ -303,8 +303,8 @@ func runDump(ctx *cli.Context) error {
fatal("Failed to dump database: %v", err)
}
if err := addFile(w, "gitea-db.sql", dbDump.Name(), verbose); err != nil {
fatal("Failed to include gitea-db.sql: %v", err)
if err := addFile(w, "forgejo-db.sql", dbDump.Name(), verbose); err != nil {
fatal("Failed to include forgejo-db.sql: %v", err)
}
if len(setting.CustomConf) > 0 {
@ -353,9 +353,9 @@ func runDump(ctx *cli.Context) error {
}
excludes = append(excludes, setting.RepoRootPath)
excludes = append(excludes, setting.LFS.Path)
excludes = append(excludes, setting.Attachment.Path)
excludes = append(excludes, setting.Packages.Path)
excludes = append(excludes, setting.LFS.Storage.Path)
excludes = append(excludes, setting.Attachment.Storage.Path)
excludes = append(excludes, setting.Packages.Storage.Path)
excludes = append(excludes, setting.Log.RootPath)
excludes = append(excludes, absFileName)
if err := addRecursiveExclude(w, "data", setting.AppDataPath, excludes, verbose); err != nil {

View file

@ -22,9 +22,9 @@ import (
"github.com/urfave/cli"
)
// Cmdembedded represents the available extract sub-command.
// 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",
@ -99,11 +99,6 @@ type assetFile struct {
func initEmbeddedExtractor(c *cli.Context) error {
setupConsoleLogger(log.ERROR, log.CanColorStderr, os.Stderr)
// Read configuration file
setting.Init(&setting.Options{
AllowEmpty: true,
})
patterns, err := compileCollectPatterns(c.Args())
if err != nil {
return err

221
cmd/forgejo/actions.go Normal file
View file

@ -0,0 +1,221 @@
// Copyright The Forgejo Authors.
// SPDX-License-Identifier: MIT
package forgejo
import (
"context"
"encoding/hex"
"fmt"
"io"
"os"
"strings"
actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
private_routers "code.gitea.io/gitea/routers/private"
"github.com/urfave/cli"
)
func CmdActions(ctx context.Context) cli.Command {
return cli.Command{
Name: "actions",
Usage: "Commands for managing Forgejo Actions",
Subcommands: []cli.Command{
SubcmdActionsGenerateRunnerToken(ctx),
SubcmdActionsGenerateRunnerSecret(ctx),
SubcmdActionsRegister(ctx),
},
}
}
func SubcmdActionsGenerateRunnerToken(ctx context.Context) cli.Command {
return cli.Command{
Name: "generate-runner-token",
Usage: "Generate a new token for a runner to use to register with the server",
Action: func(cliCtx *cli.Context) error { return RunGenerateActionsRunnerToken(ctx, cliCtx) },
Flags: []cli.Flag{
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{
Name: "generate-secret",
Usage: "Generate a secret suitable for input to the register subcommand",
Action: func(cliCtx *cli.Context) error { return RunGenerateSecret(ctx, cliCtx) },
}
}
func SubcmdActionsRegister(ctx context.Context) cli.Command {
return cli.Command{
Name: "register",
Usage: "Idempotent registration of a runner using a shared secret",
Action: func(cliCtx *cli.Context) error { return RunRegister(ctx, cliCtx) },
Flags: []cli.Flag{
cli.StringFlag{
Name: "secret",
Usage: "the secret the runner will use to connect as a 40 character hexadecimal string",
},
cli.StringFlag{
Name: "secret-stdin",
Usage: "the secret the runner will use to connect as a 40 character hexadecimal string, read from stdin",
},
cli.StringFlag{
Name: "secret-file",
Usage: "path to the file containing the secret the runner will use to connect as a 40 character hexadecimal string",
},
cli.StringFlag{
Name: "scope, s",
Value: "",
Usage: "{owner}[/{repo}] - leave empty for a global runner",
},
cli.StringFlag{
Name: "labels",
Value: "",
Usage: "comma separated list of labels supported by the runner (e.g. docker,ubuntu-latest,self-hosted) (not required since v1.21)",
},
cli.StringFlag{
Name: "name",
Value: "runner",
Usage: "name of the runner (default runner)",
},
cli.StringFlag{
Name: "version",
Value: "",
Usage: "version of the runner (not required since v1.21)",
},
},
}
}
func readSecret(ctx context.Context, cliCtx *cli.Context) (string, error) {
if cliCtx.IsSet("secret") {
return cliCtx.String("secret"), nil
}
if cliCtx.IsSet("secret-stdin") {
buf, err := io.ReadAll(ContextGetStdin(ctx))
if err != nil {
return "", err
}
return string(buf), nil
}
if cliCtx.IsSet("secret-file") {
path := cliCtx.String("secret-file")
buf, err := os.ReadFile(path)
if err != nil {
return "", err
}
return string(buf), nil
}
return "", fmt.Errorf("at least one of the --secret, --secret-stdin, --secret-file options is required")
}
func validateSecret(secret string) error {
secretLen := len(secret)
if secretLen != 40 {
return fmt.Errorf("the secret must be exactly 40 characters long, not %d: generate-secret can provide a secret matching the requirements", secretLen)
}
if _, err := hex.DecodeString(secret); err != nil {
return fmt.Errorf("the secret must be an hexadecimal string: %w", err)
}
return nil
}
func RunRegister(ctx context.Context, cliCtx *cli.Context) error {
if !ContextGetNoInit(ctx) {
var cancel context.CancelFunc
ctx, cancel = installSignals(ctx)
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
}
setting.MustInstalled()
secret, err := readSecret(ctx, cliCtx)
if err != nil {
return err
}
if err := validateSecret(secret); err != nil {
return err
}
scope := cliCtx.String("scope")
labels := cliCtx.String("labels")
name := cliCtx.String("name")
version := cliCtx.String("version")
//
// There are two kinds of tokens
//
// - "registration token" only used when a runner interacts to
// register
//
// - "token" obtained after a successful registration and stored by
// the runner to authenticate
//
// The register subcommand does not need a "registration token", it
// needs a "token". Using the same name is confusing and secret is
// preferred for this reason in the cli.
//
// The ActionsRunnerRegister argument is token to be consistent with
// the internal naming. It is still confusing to the developer but
// not to the user.
//
owner, repo, err := private_routers.ParseScope(ctx, scope)
if err != nil {
return err
}
runner, err := actions_model.RegisterRunner(ctx, owner, repo, secret, strings.Split(labels, ","), name, version)
if err != nil {
return fmt.Errorf("error while registering runner: %v", err)
}
if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", runner.UUID); err != nil {
panic(err)
}
return nil
}
func RunGenerateSecret(ctx context.Context, cliCtx *cli.Context) error {
setting.MustInstalled()
runner := actions_model.ActionRunner{}
if err := runner.GenerateToken(); err != nil {
return err
}
if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", runner.Token); err != nil {
panic(err)
}
return nil
}
func RunGenerateActionsRunnerToken(ctx context.Context, cliCtx *cli.Context) error {
if !ContextGetNoInit(ctx) {
var cancel context.CancelFunc
ctx, cancel = installSignals(ctx)
defer cancel()
}
setting.MustInstalled()
scope := cliCtx.String("scope")
respText, extra := private.GenerateActionsRunnerToken(ctx, scope)
if extra.HasError() {
return handleCliResponseExtra(ctx, extra)
}
if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", respText); err != nil {
panic(err)
}
return nil
}

147
cmd/forgejo/forgejo.go Normal file
View file

@ -0,0 +1,147 @@
// Copyright The Forgejo Authors.
// SPDX-License-Identifier: MIT
package forgejo
import (
"context"
"fmt"
"io"
"os"
"os/signal"
"syscall"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli"
)
type key int
const (
noInitKey key = iota + 1
noExitKey
stdoutKey
stderrKey
stdinKey
)
func CmdForgejo(ctx context.Context) cli.Command {
return cli.Command{
Name: "forgejo-cli",
Usage: "Forgejo CLI",
Flags: []cli.Flag{},
Subcommands: []cli.Command{
CmdActions(ctx),
},
}
}
func ContextSetNoInit(ctx context.Context, value bool) context.Context {
return context.WithValue(ctx, noInitKey, value)
}
func ContextGetNoInit(ctx context.Context) bool {
value, ok := ctx.Value(noInitKey).(bool)
return ok && value
}
func ContextSetNoExit(ctx context.Context, value bool) context.Context {
return context.WithValue(ctx, noExitKey, value)
}
func ContextGetNoExit(ctx context.Context) bool {
value, ok := ctx.Value(noExitKey).(bool)
return ok && value
}
func ContextSetStderr(ctx context.Context, value io.Writer) context.Context {
return context.WithValue(ctx, stderrKey, value)
}
func ContextGetStderr(ctx context.Context) io.Writer {
value, ok := ctx.Value(stderrKey).(io.Writer)
if !ok {
return os.Stderr
}
return value
}
func ContextSetStdout(ctx context.Context, value io.Writer) context.Context {
return context.WithValue(ctx, stdoutKey, value)
}
func ContextGetStdout(ctx context.Context) io.Writer {
value, ok := ctx.Value(stderrKey).(io.Writer)
if !ok {
return os.Stdout
}
return value
}
func ContextSetStdin(ctx context.Context, value io.Reader) context.Context {
return context.WithValue(ctx, stdinKey, value)
}
func ContextGetStdin(ctx context.Context) io.Reader {
value, ok := ctx.Value(stdinKey).(io.Reader)
if !ok {
return os.Stdin
}
return value
}
// copied from ../cmd.go
func initDB(ctx context.Context) error {
setting.MustInstalled()
setting.LoadDBSetting()
setting.InitSQLLoggersForCli(log.INFO)
if setting.Database.Type == "" {
log.Fatal(`Database settings are missing from the configuration file: %q.
Ensure you are running in the correct environment or set the correct configuration file with -c.
If this is the intended configuration file complete the [database] section.`, setting.CustomConf)
}
if err := db.InitEngine(ctx); err != nil {
return fmt.Errorf("unable to initialize the database using the configuration in %q. Error: %w", setting.CustomConf, err)
}
return nil
}
// copied from ../cmd.go
func installSignals(ctx context.Context) (context.Context, context.CancelFunc) {
ctx, cancel := context.WithCancel(ctx)
go func() {
// install notify
signalChannel := make(chan os.Signal, 1)
signal.Notify(
signalChannel,
syscall.SIGINT,
syscall.SIGTERM,
)
select {
case <-signalChannel:
case <-ctx.Done():
}
cancel()
signal.Reset()
}()
return ctx, cancel
}
func handleCliResponseExtra(ctx context.Context, extra private.ResponseExtra) error {
if false && extra.UserMsg != "" {
if _, err := fmt.Fprintf(ContextGetStdout(ctx), "%s", extra.UserMsg); err != nil {
panic(err)
}
}
if ContextGetNoExit(ctx) {
return extra.Error
}
return cli.NewExitError(extra.Error, 1)
}

View file

@ -15,6 +15,7 @@ import (
"time"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
@ -32,6 +33,7 @@ var (
Name: "hook",
Usage: "Delegate commands to corresponding Git hooks",
Description: "This should only be called by Git",
Before: PrepareConsoleLoggerLevel(log.FATAL),
Subcommands: []cli.Command{
subcmdHookPreReceive,
subcmdHookUpdate,

View file

@ -8,6 +8,7 @@ import (
"fmt"
"strings"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"github.com/urfave/cli"
@ -17,6 +18,7 @@ import (
var CmdKeys = cli.Command{
Name: "keys",
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{

View file

@ -16,7 +16,7 @@ func runSendMail(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setting.Init(&setting.Options{})
setting.MustInstalled()
if err := argsSet(c, "title"); err != nil {
return err

26
cmd/main.go Normal file
View file

@ -0,0 +1,26 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package cmd
import (
"fmt"
"strings"
"github.com/urfave/cli"
)
func RunMainApp(app *cli.App, args ...string) error {
err := app.Run(args)
if err == nil {
return nil
}
if strings.HasPrefix(err.Error(), "flag provided but not defined:") {
// the cli package should already have output the error message, so just exit
cli.OsExiter(1)
return err
}
_, _ = fmt.Fprintf(app.ErrWriter, "Command error: %v\n", err)
cli.OsExiter(1)
return err
}

View file

@ -4,9 +4,16 @@
package cmd
import (
"fmt"
"io"
"strings"
"testing"
"code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/test"
"github.com/stretchr/testify/assert"
"github.com/urfave/cli"
)
func TestMain(m *testing.M) {
@ -14,3 +21,64 @@ func TestMain(m *testing.M) {
GiteaRootPath: "..",
})
}
func newTestApp(testCmdAction func(ctx *cli.Context) error) *cli.App {
app := cli.NewApp()
app.HelpName = "gitea"
testCmd := cli.Command{Name: "test-cmd", Action: testCmdAction}
app.Commands = append(app.Commands, testCmd)
return app
}
type runResult struct {
Stdout string
Stderr string
ExitCode int
}
func runTestApp(app *cli.App, args ...string) (runResult, error) {
outBuf := new(strings.Builder)
errBuf := new(strings.Builder)
app.Writer = outBuf
app.ErrWriter = errBuf
exitCode := -1
defer test.MockVariableValue(&cli.ErrWriter, app.ErrWriter)()
defer test.MockVariableValue(&cli.OsExiter, func(code int) {
if exitCode == -1 {
exitCode = code // save the exit code once and then reset the writer (to simulate the exit)
app.Writer, app.ErrWriter, cli.ErrWriter = io.Discard, io.Discard, io.Discard
}
})()
err := RunMainApp(app, args...)
return runResult{outBuf.String(), errBuf.String(), exitCode}, err
}
func TestCliCmdError(t *testing.T) {
app := newTestApp(func(ctx *cli.Context) error { return fmt.Errorf("normal error") })
r, err := runTestApp(app, "./gitea", "test-cmd")
assert.Error(t, err)
assert.Equal(t, 1, r.ExitCode)
assert.Equal(t, "", r.Stdout)
assert.Equal(t, "Command error: normal error\n", r.Stderr)
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)
assert.Equal(t, "", r.Stdout)
assert.Equal(t, "exit error\n", r.Stderr)
app = newTestApp(func(ctx *cli.Context) error { return nil })
r, err = runTestApp(app, "./gitea", "test-cmd", "--no-such")
assert.Error(t, err)
assert.Equal(t, 1, r.ExitCode)
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 })
r, err = runTestApp(app, "./gitea", "test-cmd")
assert.NoError(t, err)
assert.Equal(t, -1, r.ExitCode) // the cli.OsExiter is not called
assert.Equal(t, "", r.Stdout)
assert.Equal(t, "", r.Stderr)
}

View file

@ -178,7 +178,7 @@ func runAddConnLogger(c *cli.Context) error {
defer cancel()
setup(ctx, c.Bool("debug"))
vals := map[string]interface{}{}
vals := map[string]any{}
mode := "conn"
vals["net"] = "tcp"
if c.IsSet("protocol") {
@ -208,7 +208,7 @@ func runAddFileLogger(c *cli.Context) error {
defer cancel()
setup(ctx, c.Bool("debug"))
vals := map[string]interface{}{}
vals := map[string]any{}
mode := "file"
if c.IsSet("filename") {
vals["filename"] = c.String("filename")
@ -236,7 +236,7 @@ func runAddFileLogger(c *cli.Context) error {
return commonAddLogger(c, mode, vals)
}
func commonAddLogger(c *cli.Context, mode string, vals map[string]interface{}) error {
func commonAddLogger(c *cli.Context, mode string, vals map[string]any) error {
if len(c.String("level")) > 0 {
vals["level"] = log.LevelFromString(c.String("level")).String()
}

View file

@ -179,7 +179,7 @@ func runMigrateStorage(ctx *cli.Context) error {
switch strings.ToLower(ctx.String("storage")) {
case "":
fallthrough
case string(storage.LocalStorageType):
case string(setting.LocalStorageType):
p := ctx.String("path")
if p == "" {
log.Fatal("Path must be given when storage is loal")
@ -187,22 +187,24 @@ func runMigrateStorage(ctx *cli.Context) error {
}
dstStorage, err = storage.NewLocalStorage(
stdCtx,
storage.LocalStorageConfig{
&setting.Storage{
Path: p,
})
case string(storage.MinioStorageType):
case string(setting.MinioStorageType):
dstStorage, err = storage.NewMinioStorage(
stdCtx,
storage.MinioStorageConfig{
Endpoint: ctx.String("minio-endpoint"),
AccessKeyID: ctx.String("minio-access-key-id"),
SecretAccessKey: ctx.String("minio-secret-access-key"),
Bucket: ctx.String("minio-bucket"),
Location: ctx.String("minio-location"),
BasePath: ctx.String("minio-base-path"),
UseSSL: ctx.Bool("minio-use-ssl"),
InsecureSkipVerify: ctx.Bool("minio-insecure-skip-verify"),
ChecksumAlgorithm: ctx.String("minio-checksum-algorithm"),
&setting.Storage{
MinioConfig: setting.MinioStorageConfig{
Endpoint: ctx.String("minio-endpoint"),
AccessKeyID: ctx.String("minio-access-key-id"),
SecretAccessKey: ctx.String("minio-secret-access-key"),
Bucket: ctx.String("minio-bucket"),
Location: ctx.String("minio-location"),
BasePath: ctx.String("minio-base-path"),
UseSSL: ctx.Bool("minio-use-ssl"),
InsecureSkipVerify: ctx.Bool("minio-insecure-skip-verify"),
ChecksumAlgorithm: ctx.String("minio-checksum-algorithm"),
},
})
default:
return fmt.Errorf("unsupported storage type: %s", ctx.String("storage"))

View file

@ -13,6 +13,7 @@ import (
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
packages_module "code.gitea.io/gitea/modules/packages"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
packages_service "code.gitea.io/gitea/services/packages"
@ -57,7 +58,7 @@ func TestMigratePackages(t *testing.T) {
dstStorage, err := storage.NewLocalStorage(
ctx,
storage.LocalStorageConfig{
&setting.Storage{
Path: p,
})
assert.NoError(t, err)

View file

@ -51,7 +51,7 @@ func runRestoreRepository(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setting.Init(&setting.Options{})
setting.MustInstalled()
var units []string
if s := c.String("units"); s != "" {
units = strings.Split(s, ",")

View file

@ -44,6 +44,7 @@ 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{
@ -61,7 +62,7 @@ func setup(ctx context.Context, debug bool) {
} else {
setupConsoleLogger(log.FATAL, false, os.Stderr)
}
setting.Init(&setting.Options{})
setting.MustInstalled()
if debug {
setting.RunMode = "dev"
}
@ -94,7 +95,7 @@ var (
// fail prints message to stdout, it's mainly used for git serv and git hook commands.
// The output will be passed to git client and shown to user.
func fail(ctx context.Context, userMessage, logMsgFmt string, args ...interface{}) error {
func fail(ctx context.Context, userMessage, logMsgFmt string, args ...any) error {
if userMessage == "" {
userMessage = "Internal Server Error (no specific error)"
}
@ -170,13 +171,13 @@ func runServ(c *cli.Context) error {
}
switch key.Type {
case asymkey_model.KeyTypeDeploy:
println("Hi there! You've successfully authenticated with the deploy key named " + key.Name + ", but Gitea does not provide shell access.")
println("Hi there! You've successfully authenticated with the deploy key named " + key.Name + ", but Forgejo does not provide shell access.")
case asymkey_model.KeyTypePrincipal:
println("Hi there! You've successfully authenticated with the principal " + key.Content + ", but Gitea does not provide shell access.")
println("Hi there! You've successfully authenticated with the principal " + key.Content + ", but Forgejo does not provide shell access.")
default:
println("Hi there, " + user.Name + "! You've successfully authenticated with the key named " + key.Name + ", but Gitea does not provide shell access.")
println("Hi there, " + user.Name + "! You've successfully authenticated with the key named " + key.Name + ", but Forgejo does not provide shell access.")
}
println("If this is unexpected, please log in with password and setup Gitea under another user.")
println("If this is unexpected, please log in with password and setup Forgejo under another user.")
return nil
} else if c.Bool("debug") {
log.Debug("SSH_ORIGINAL_COMMAND: %s", os.Getenv("SSH_ORIGINAL_COMMAND"))

View file

@ -35,6 +35,7 @@ var CmdWeb = cli.Command{
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{
@ -101,12 +102,111 @@ func createPIDFile(pidPath string) {
}
}
func runWeb(ctx *cli.Context) error {
if ctx.Bool("verbose") {
setupConsoleLogger(log.TRACE, log.CanColorStdout, os.Stdout)
} else if ctx.Bool("quiet") {
setupConsoleLogger(log.FATAL, log.CanColorStdout, os.Stdout)
func serveInstall(ctx *cli.Context) error {
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())
// Flag for port number in case first time run conflict
if ctx.IsSet("port") {
if err := setPort(ctx.String("port")); err != nil {
return err
}
}
if ctx.IsSet("install-port") {
if err := setPort(ctx.String("install-port")); err != nil {
return err
}
}
c := install.Routes()
err := listen(c, false)
if err != nil {
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 Gitea Web Finished", os.Getpid())
log.GetManager().Close()
return err
default:
}
return nil
}
func serveInstalled(ctx *cli.Context) error {
setting.InitCfgProvider(setting.CustomConf)
setting.LoadCommonSettings()
setting.MustInstalled()
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 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 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 must set it manually, otherwise there might be bugs when accessing the git repositories.", setting.AppWorkPath, setting.CustomConf, err)
}
}
}
routers.InitWebInstalled(graceful.GetManager().HammerContext())
// We check that AppDataPath exists here (it should have been created during installation)
// We can't check it in `InitWebInstalled`, because some integration tests
// use cmd -> InitWebInstalled, but the AppDataPath doesn't exist during those tests.
if _, err := os.Stat(setting.AppDataPath); err != nil {
log.Fatal("Can not find APP_DATA_PATH %q", setting.AppDataPath)
}
// Override the provided port number within the configuration
if ctx.IsSet("port") {
if err := setPort(ctx.String("port")); err != nil {
return err
}
}
// Set up Chi routes
c := routers.NormalRoutes(graceful.GetManager().HammerContext())
err := listen(c, true)
<-graceful.GetManager().Done()
log.Info("PID: %d Gitea Web Finished", os.Getpid())
log.GetManager().Close()
return err
}
func servePprof() {
http.DefaultServeMux.Handle("/debug/fgprof", fgprof.Handler())
_, _, finished := process.GetManager().AddTypedContext(context.Background(), "Web: PProf Server", process.SystemProcessType, true)
// The pprof server is for debug purpose only, it shouldn't be exposed on public network. At the moment it's not worth to introduce a configurable option for it.
log.Info("Starting pprof server on localhost:6060")
log.Info("Stopped pprof server: %v", http.ListenAndServe("localhost:6060", nil))
finished()
}
func runWeb(ctx *cli.Context) error {
defer func() {
if panicked := recover(); panicked != nil {
log.Fatal("PANIC: %v\n%s", panicked, log.Stack(2))
@ -128,75 +228,19 @@ func runWeb(ctx *cli.Context) error {
createPIDFile(ctx.String("pid"))
}
// Perform pre-initialization
needsInstall := install.PreloadSettings(graceful.GetManager().HammerContext())
if needsInstall {
// Flag for port number in case first time run conflict
if ctx.IsSet("port") {
if err := setPort(ctx.String("port")); err != nil {
return err
}
}
if ctx.IsSet("install-port") {
if err := setPort(ctx.String("install-port")); err != nil {
return err
}
}
c := install.Routes()
err := listen(c, false)
if err != nil {
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 Gitea Web Finished", os.Getpid())
log.GetManager().Close()
if !setting.InstallLock {
if err := serveInstall(ctx); err != nil {
return err
default:
}
} else {
NoInstallListener()
}
if setting.EnablePprof {
go func() {
http.DefaultServeMux.Handle("/debug/fgprof", fgprof.Handler())
_, _, finished := process.GetManager().AddTypedContext(context.Background(), "Web: PProf Server", process.SystemProcessType, true)
// The pprof server is for debug purpose only, it shouldn't be exposed on public network. At the moment it's not worth to introduce a configurable option for it.
log.Info("Starting pprof server on localhost:6060")
log.Info("Stopped pprof server: %v", http.ListenAndServe("localhost:6060", nil))
finished()
}()
go servePprof()
}
log.Info("Global init")
// Perform global initialization
setting.Init(&setting.Options{})
routers.GlobalInitInstalled(graceful.GetManager().HammerContext())
// We check that AppDataPath exists here (it should have been created during installation)
// We can't check it in `GlobalInitInstalled`, because some integration tests
// use cmd -> GlobalInitInstalled, but the AppDataPath doesn't exist during those tests.
if _, err := os.Stat(setting.AppDataPath); err != nil {
log.Fatal("Can not find APP_DATA_PATH '%s'", setting.AppDataPath)
}
// Override the provided port number within the configuration
if ctx.IsSet("port") {
if err := setPort(ctx.String("port")); err != nil {
return err
}
}
// Set up Chi routes
c := routers.NormalRoutes(graceful.GetManager().HammerContext())
err := listen(c, true)
<-graceful.GetManager().Done()
log.Info("PID: %d Gitea Web Finished", os.Getpid())
log.GetManager().Close()
return err
return serveInstalled(ctx)
}
func setPort(port string) error {
@ -217,9 +261,15 @@ func setPort(port string) error {
defaultLocalURL += ":" + setting.HTTPPort + "/"
// Save LOCAL_ROOT_URL if port changed
setting.CfgProvider.Section("server").Key("LOCAL_ROOT_URL").SetValue(defaultLocalURL)
if err := setting.CfgProvider.Save(); err != nil {
return fmt.Errorf("Failed to save config file: %v", err)
rootCfg := setting.CfgProvider
saveCfg, err := rootCfg.PrepareSaving()
if err != nil {
return fmt.Errorf("failed to save config file: %v", err)
}
rootCfg.Section("server").Key("LOCAL_ROOT_URL").SetValue(defaultLocalURL)
saveCfg.Section("server").Key("LOCAL_ROOT_URL").SetValue(defaultLocalURL)
if err = saveCfg.Save(); err != nil {
return fmt.Errorf("failed to save config file: %v", err)
}
}
return nil

View file

@ -5,7 +5,6 @@ package main
import (
"os"
"strings"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
@ -13,22 +12,19 @@ import (
"github.com/urfave/cli"
)
// EnvironmentPrefix environment variables prefixed with this represent ini values to write
const EnvironmentPrefix = "GITEA"
func main() {
app := cli.NewApp()
app.Name = "environment-to-ini"
app.Usage = "Use provided environment to update configuration ini"
app.Description = `As a helper to allow docker users to update the gitea configuration
app.Description = `As a helper to allow docker users to update the forgejo configuration
through the environment, this command allows environment variables to
be mapped to values in the ini.
Environment variables of the form "GITEA__SECTION_NAME__KEY_NAME"
Environment variables of the form "FORGEJO__SECTION_NAME__KEY_NAME"
will be mapped to the ini section "[section_name]" and the key
"KEY_NAME" with the value as provided.
Environment variables of the form "GITEA__SECTION_NAME__KEY_NAME__FILE"
Environment variables of the form "FORGEJO__SECTION_NAME__KEY_NAME__FILE"
will be mapped to the ini section "[section_name]" and the key
"KEY_NAME" with the value loaded from the specified file.
@ -46,8 +42,8 @@ func main() {
...
"""
You would set the environment variables: "GITEA__LOG_0x2E_CONSOLE__COLORIZE=false"
and "GITEA__LOG_0x2E_CONSOLE__STDERR=false". Other examples can be found
You would set the environment variables: "FORGEJO__LOG_0x2E_CONSOLE__COLORIZE=false"
and "FORGEJO__LOG_0x2E_CONSOLE__STDERR=false". Other examples can be found
on the configuration cheat sheet.`
app.Flags = []cli.Flag{
cli.StringFlag{
@ -63,26 +59,15 @@ func main() {
cli.StringFlag{
Name: "work-path, w",
Value: setting.AppWorkPath,
Usage: "Set the gitea working path",
Usage: "Set the forgejo working path",
},
cli.StringFlag{
Name: "out, o",
Value: "",
Usage: "Destination file to write to",
},
cli.BoolFlag{
Name: "clear",
Usage: "Clears the matched variables from the environment",
},
cli.StringFlag{
Name: "prefix, p",
Value: EnvironmentPrefix,
Usage: "Environment prefix to look for - will be suffixed by __ (2 underscores)",
},
}
app.Action = runEnvironmentToIni
setting.SetCustomPathAndConf("", "", "")
err := app.Run(os.Args)
if err != nil {
log.Fatal("Failed to run app with %s: %v", os.Args, err)
@ -90,19 +75,20 @@ func main() {
}
func runEnvironmentToIni(c *cli.Context) error {
providedCustom := c.String("custom-path")
providedConf := c.String("config")
providedWorkPath := c.String("work-path")
setting.SetCustomPathAndConf(providedCustom, providedConf, providedWorkPath)
// the config system may change the environment variables, so get a copy first, to be used later
env := append([]string{}, os.Environ()...)
setting.InitWorkPathAndCfgProvider(os.Getenv, setting.ArgWorkPathAndCustomConf{
WorkPath: c.String("work-path"),
CustomPath: c.String("custom-path"),
CustomConf: c.String("config"),
})
cfg, err := setting.NewConfigProviderFromFile(&setting.Options{CustomConf: setting.CustomConf, AllowEmpty: true})
cfg, err := setting.NewConfigProviderFromFile(setting.CustomConf)
if err != nil {
log.Fatal("Failed to load custom conf '%s': %v", setting.CustomConf, err)
}
prefixGitea := c.String("prefix") + "__"
suffixFile := "__FILE"
changed := setting.EnvironmentToConfig(cfg, prefixGitea, suffixFile, os.Environ())
changed := setting.EnvironmentToConfig(cfg, env)
// try to save the config file
destination := c.String("out")
@ -117,19 +103,5 @@ func runEnvironmentToIni(c *cli.Context) error {
}
}
// clear Gitea's specific environment variables if requested
if c.Bool("clear") {
for _, kv := range os.Environ() {
idx := strings.IndexByte(kv, '=')
if idx < 0 {
continue
}
eKey := kv[:idx]
if strings.HasPrefix(eKey, prefixGitea) {
_ = os.Unsetenv(eKey)
}
}
}
return nil
}

View file

@ -1,5 +1,5 @@
[Unit]
Description=Gitea (Git with a cup of tea)
Description=Forgejo (Beyond coding. We forge.)
After=syslog.target
After=network.target
###
@ -25,21 +25,21 @@ After=network.target
# If using socket activation for main http/s
###
#
#After=gitea.main.socket
#Requires=gitea.main.socket
#After=forgejo.main.socket
#Requires=forgejo.main.socket
#
###
# (You can also provide gitea an http fallback and/or ssh socket too)
# (You can also provide forgejo an http fallback and/or ssh socket too)
#
# An example of /etc/systemd/system/gitea.main.socket
# An example of /etc/systemd/system/forgejo.main.socket
###
##
## [Unit]
## Description=Gitea Web Socket
## PartOf=gitea.service
## Description=Forgejo Web Socket
## PartOf=forgejo.service
##
## [Socket]
## Service=gitea.service
## Service=forgejo.service
## ListenStream=<some_port>
## NoDelay=true
##
@ -52,32 +52,31 @@ After=network.target
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
# LimitNOFILE=524288:524288
RestartSec=2s
Type=notify
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
# If using Unix socket: tells systemd to create the /run/gitea folder, which will contain the gitea.sock file
# (manually creating /run/gitea doesn't work, because it would not persist across reboots)
#RuntimeDirectory=gitea
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
WorkingDirectory=/var/lib/forgejo/
# If using Unix socket: tells systemd to create the /run/forgejo folder, which will contain the forgejo.sock file
# (manually creating /run/forgejo doesn't work, because it would not persist across reboots)
#RuntimeDirectory=forgejo
ExecStart=/usr/local/bin/forgejo web --config /etc/forgejo/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
WatchdogSec=30s
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/forgejo
# If you install Git to directory prefix other than default PATH (which happens
# for example if you install other versions of Git side-to-side with
# distribution version), uncomment below line and add that prefix to PATH
# Don't forget to place git-lfs binary on the PATH below if you want to enable
# Git LFS support
#Environment=PATH=/path/to/git/bin:/bin:/sbin:/usr/bin:/usr/sbin
# If you want to bind Gitea to a port below 1024, uncomment
# the two values below, or use socket activation to pass Gitea its ports as above
# If you want to bind Forgejo to a port below 1024, uncomment
# the two values below, or use socket activation to pass Forgejo its ports as above
###
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE
###
# In some cases, when using CapabilityBoundingSet and AmbientCapabilities option, you may want to
# set the following value to false to allow capabilities to be applied on gitea process. The following
# value if set to true sandboxes gitea service and prevent any processes from running with privileges
# set the following value to false to allow capabilities to be applied on Forgejo process. The following
# value if set to true sandboxes Forgejo service and prevent any processes from running with privileges
# in the host user namespace.
###
#PrivateUsers=false

View file

@ -1,42 +1,42 @@
#!/usr/bin/env bash
# This is an update script for gitea installed via the binary distribution
# from dl.gitea.com on linux as systemd service. It performs a backup and updates
# Gitea in place.
# NOTE: This adds the GPG Signing Key of the Gitea maintainers to the keyring.
# This is an update script for forgejo installed via the binary distribution
# from codeberg.org/forgejo/forgejo on linux as systemd service. It
# performs a backup and updates Forgejo in place.
# NOTE: This adds the GPG Signing Key of the Forgejo maintainers to the keyring.
# Depends on: bash, curl, xz, sha256sum. optionally jq, gpg
# See section below for available environment vars.
# When no version is specified, updates to the latest release.
# Examples:
# upgrade.sh 1.15.10
# giteahome=/opt/gitea giteaconf=$giteahome/app.ini upgrade.sh
# forgejohome=/opt/forgejo forgejoconf=$forgejohome/app.ini upgrade.sh
# Check if gitea service is running
if ! pidof gitea &> /dev/null; then
echo "Error: gitea is not running."
# Check if forgejo service is running
if ! pidof forgejo &> /dev/null; then
echo "Error: forgejo is not running."
exit 1
fi
# Continue with rest of the script if gitea is running
echo "Gitea is running. Continuing with rest of script..."
# Continue with rest of the script if forgejo is running
echo "Forgejo is running. Continuing with rest of script..."
# apply variables from environment
: "${giteabin:="/usr/local/bin/gitea"}"
: "${giteahome:="/var/lib/gitea"}"
: "${giteaconf:="/etc/gitea/app.ini"}"
: "${giteauser:="git"}"
: "${forgejobin:="/usr/local/bin/forgejo"}"
: "${forgejohome:="/var/lib/forgejo"}"
: "${forgejoconf:="/etc/forgejo/app.ini"}"
: "${forgejouser:="git"}"
: "${sudocmd:="sudo"}"
: "${arch:="linux-amd64"}"
: "${service_start:="$sudocmd systemctl start gitea"}"
: "${service_stop:="$sudocmd systemctl stop gitea"}"
: "${service_status:="$sudocmd systemctl status gitea"}"
: "${backupopts:=""}" # see `gitea dump --help` for available options
: "${service_start:="$sudocmd systemctl start forgejo"}"
: "${service_stop:="$sudocmd systemctl stop forgejo"}"
: "${service_status:="$sudocmd systemctl status forgejo"}"
: "${backupopts:=""}" # see `forgejo dump --help` for available options
function giteacmd {
function forgejocmd {
if [[ $sudocmd = "su" ]]; then
# `-c` only accept one string as argument.
"$sudocmd" - "$giteauser" -c "$(printf "%q " "$giteabin" "--config" "$giteaconf" "--work-path" "$giteahome" "$@")"
"$sudocmd" - "$forgejouser" -c "$(printf "%q " "$forgejobin" "--config" "$forgejoconf" "--work-path" "$forgejohome" "$@")"
else
"$sudocmd" --user "$giteauser" "$giteabin" --config "$giteaconf" --work-path "$giteahome" "$@"
"$sudocmd" --user "$forgejouser" "$forgejobin" --config "$forgejoconf" --work-path "$forgejohome" "$@"
fi
}
@ -49,7 +49,7 @@ function require {
# parse command line arguments
while true; do
case "$1" in
-v | --version ) giteaversion="$2"; shift 2 ;;
-v | --version ) forgejoversion="$2"; shift 2 ;;
-y | --yes ) no_confirm="yes"; shift ;;
--ignore-gpg) ignore_gpg="yes"; shift ;;
"" | -- ) shift; break ;;
@ -65,9 +65,9 @@ if [[ -f /etc/os-release ]]; then
if [[ "$os_release" =~ "OpenWrt" ]]; then
sudocmd="su"
service_start="/etc/init.d/gitea start"
service_stop="/etc/init.d/gitea stop"
service_status="/etc/init.d/gitea status"
service_start="/etc/init.d/forgejo start"
service_stop="/etc/init.d/forgejo stop"
service_status="/etc/init.d/forgejo status"
else
require systemctl
fi
@ -76,31 +76,31 @@ fi
require curl xz sha256sum "$sudocmd"
# select version to install
if [[ -z "${giteaversion:-}" ]]; then
if [[ -z "${forgejoversion:-}" ]]; then
require jq
giteaversion=$(curl --connect-timeout 10 -sL https://dl.gitea.com/gitea/version.json | jq -r .latest.version)
echo "Latest available version is $giteaversion"
forgejoversion=$(curl --connect-timeout 10 -sL 'https://codeberg.org/api/v1/repos/forgejo/forgejo/releases?draft=false&pre-release=false&limit=1' -H 'accept: application/json' | jq -r '.[0].tag_name | sub("v"; "")')
echo "Latest available version is $forgejoversion"
fi
# confirm update
echo "Checking currently installed version..."
current=$(giteacmd --version | cut -d ' ' -f 3)
[[ "$current" == "$giteaversion" ]] && echo "$current is already installed, stopping." && exit 1
current=$(forgejocmd --version | cut -d ' ' -f 3)
[[ "$current" == "$forgejoversion" ]] && echo "$current is already installed, stopping." && exit 1
if [[ -z "${no_confirm:-}" ]]; then
echo "Make sure to read the changelog first: https://github.com/go-gitea/gitea/blob/main/CHANGELOG.md"
echo "Are you ready to update Gitea from ${current} to ${giteaversion}? (y/N)"
echo "Make sure to read the changelog first: https://codeberg.org/forgejo/forgejo/src/branch/forgejo/CHANGELOG.md"
echo "Are you ready to update forgejo from ${current} to ${forgejoversion}? (y/N)"
read -r confirm
[[ "$confirm" == "y" ]] || [[ "$confirm" == "Y" ]] || exit 1
fi
echo "Upgrading gitea from $current to $giteaversion ..."
echo "Upgrading forgejo from $current to $forgejoversion ..."
pushd "$(pwd)" &>/dev/null
cd "$giteahome" # needed for gitea dump later
cd "$forgejohome" # needed for forgejo dump later
# download new binary
binname="gitea-${giteaversion}-${arch}"
binurl="https://dl.gitea.com/gitea/${giteaversion}/${binname}.xz"
binname="forgejo-${forgejoversion}-${arch}"
binurl="https://codeberg.org/forgejo/forgejo/releases/download/v${forgejoversion}/${binname}.xz"
echo "Downloading $binurl..."
curl --connect-timeout 10 --silent --show-error --fail --location -O "$binurl{,.sha256,.asc}"
@ -108,28 +108,28 @@ curl --connect-timeout 10 --silent --show-error --fail --location -O "$binurl{,.
sha256sum -c "${binname}.xz.sha256"
if [[ -z "${ignore_gpg:-}" ]]; then
require gpg
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --keyserver keys.openpgp.org --recv EB114F5E6C0DC2BCDD183550A4B61A2DC5923710
gpg --verify "${binname}.xz.asc" "${binname}.xz" || { echo 'Signature does not match'; exit 1; }
fi
rm "${binname}".xz.{sha256,asc}
# unpack binary + make executable
xz --decompress --force "${binname}.xz"
chown "$giteauser" "$binname"
chown "$forgejouser" "$binname"
chmod +x "$binname"
# stop gitea, create backup, replace binary, restart gitea
echo "Flushing gitea queues at $(date)"
giteacmd manager flush-queues
echo "Stopping gitea at $(date)"
# stop forgejo, create backup, replace binary, restart forgejo
echo "Flushing forgejo queues at $(date)"
forgejocmd manager flush-queues
echo "Stopping forgejo at $(date)"
$service_stop
echo "Creating backup in $giteahome"
giteacmd dump $backupopts
echo "Updating binary at $giteabin"
cp -f "$giteabin" "$giteabin.bak" && mv -f "$binname" "$giteabin"
echo "Creating backup in $forgejohome"
forgejocmd dump $backupopts
echo "Updating binary at $forgejobin"
cp -f "$forgejobin" "$forgejobin.bak" && mv -f "$binname" "$forgejobin"
$service_start
$service_status
echo "Upgrade to $giteaversion successful!"
echo "Upgrade to $forgejoversion successful!"
popd

View file

@ -4,7 +4,7 @@
;; Do not copy the whole file as-is, as it contains some invalid sections for illustrative purposes.
;; If you don't know what a setting is you should not set it.
;;
;; see https://docs.gitea.io/en-us/config-cheat-sheet/ for additional documentation.
;; see https://docs.gitea.com/administration/config-cheat-sheet for additional documentation.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -16,26 +16,23 @@
;;
;; - _`AppPath`_: This is the absolute path of the running gitea binary.
;; - _`AppWorkPath`_: This refers to "working path" of the `gitea` binary. It is determined by using the first set thing in the following hierarchy:
;; - The "WORK_PATH" option in "app.ini" file
;; - The `--work-path` flag passed to the binary
;; - The environment variable `$GITEA_WORK_DIR`
;; - A built-in value set at build time (see building from source)
;; - Otherwise it defaults to the directory of the _`AppPath`_
;; - If any of the above are relative paths then they are made absolute against
;; the directory of the _`AppPath`_
;; - _`CustomPath`_: This is the base directory for custom templates and other options.
;; It is determined by using the first set thing in the following hierarchy:
;; - If any of the above are relative paths then they are made absolute against the directory of the _`AppPath`_
;; - _`CustomPath`_: This is the base directory for custom templates and other options. It is determined by using the first set thing in the following hierarchy:
;; - The `--custom-path` flag passed to the binary
;; - The environment variable `$GITEA_CUSTOM`
;; - A built-in value set at build time (see building from source)
;; - Otherwise it defaults to _`AppWorkPath`_`/custom`
;; - If any of the above are relative paths then they are made absolute against the
;; the directory of the _`AppWorkPath`_
;; - If any of the above are relative paths then they are made absolute against the directory of the _`AppWorkPath`_
;; - _`CustomConf`_: This is the path to the `app.ini` file.
;; - The `--config` flag passed to the binary
;; - A built-in value set at build time (see building from source)
;; - Otherwise it defaults to _`CustomPath`_`/conf/app.ini`
;; - If any of the above are relative paths then they are made absolute against the
;; the directory of the _`CustomPath`_
;; - If any of the above are relative paths then they are made absolute against the directory of the _`CustomPath`_
;;
;; In addition there is _`StaticRootPath`_ which can be set as a built-in at build time, but will otherwise default to _`AppWorkPath`_
@ -52,6 +49,9 @@ RUN_USER = ; git
;; Application run mode, affects performance and debugging: "dev" or "prod", default is "prod"
;; Mode "dev" makes Gitea easier to develop and debug, values other than "dev" are treated as "prod" which is for production use.
;RUN_MODE = prod
;;
;; The working directory, see the comment of AppWorkPath above
;WORK_PATH =
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -365,7 +365,7 @@ USER = root
;; SQLite Configuration
;;
;DB_TYPE = sqlite3
;PATH= ; defaults to data/gitea.db
;PATH= ; defaults to data/forgejo.db
;SQLITE_TIMEOUT = ; Query timeout defaults to: 500
;SQLITE_JOURNAL_MODE = ; defaults to sqlite database default (often DELETE), can be used to enable WAL mode. https://www.sqlite.org/pragma.html#pragma_journal_mode
;;
@ -476,8 +476,8 @@ INTERNAL_TOKEN=
;;Classes include "lower,upper,digit,spec"
;PASSWORD_COMPLEXITY = off
;;
;; Password Hash algorithm, either "argon2", "pbkdf2", "scrypt" or "bcrypt"
;PASSWORD_HASH_ALGO = pbkdf2
;; Password Hash algorithm, either "argon2", "pbkdf2"/"pbkdf2_v2", "pbkdf2_hi", "scrypt" or "bcrypt"
;PASSWORD_HASH_ALGO = pbkdf2_hi
;;
;; Set false to allow JavaScript to read CSRF cookie
;CSRF_COOKIE_HTTP_ONLY = true
@ -1414,8 +1414,8 @@ LEVEL = Info
;; Provides the suffix of the default redis/disk unique queue set name - specific queues can be overridden within in their [queue.name] sections.
;SET_NAME = "_unique"
;;
;; Dynamically scale the worker pool to at this many workers
;MAX_WORKERS = 10
;; Maximum number of worker go-routines for the queue. Default value is "CpuNum/2" clipped to between 1 and 10.
;MAX_WORKERS = ; (dynamic)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -1724,8 +1724,8 @@ LEVEL = Info
;; Session cookie name
;COOKIE_NAME = i_like_gitea
;;
;; If you use session in https only, default is false
;COOKIE_SECURE = false
;; If you use session in https only: true or false. If not set, it defaults to `true` if the ROOT_URL is an HTTPS URL.
;COOKIE_SECURE =
;;
;; Session GC time interval in seconds, default is 86400 (1 day)
;GC_INTERVAL_TIME = 86400
@ -1804,8 +1804,9 @@ LEVEL = Info
;; Currently, only `minio` is supported.
;SERVE_DIRECT = false
;;
;; Path for attachments. Defaults to `data/attachments` only available when STORAGE_TYPE is `local`
;PATH = data/attachments
;; Path for attachments. Defaults to `attachments`. Only available when STORAGE_TYPE is `local`
;; Relative paths will be resolved to `${AppDataPath}/${attachment.PATH}`
;PATH = attachments
;;
;; Minio endpoint to connect only available when STORAGE_TYPE is `minio`
;MINIO_ENDPOINT = localhost:9000
@ -2159,7 +2160,8 @@ LEVEL = Info
;RUN_AT_START = false
;ENABLE_SUCCESS_NOTICE = false
;SCHEDULE = @every 168h
;HTTP_ENDPOINT = https://dl.gitea.io/gitea/version.json
;HTTP_ENDPOINT = https://dl.gitea.com/gitea/version.json
;DOMAIN_ENDPOINT = release.forgejo.org
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -2392,6 +2394,10 @@ LEVEL = Info
;; Enable/Disable package registry capabilities
;ENABLED = true
;;
;STORAGE_TYPE = local
;; override the minio base path if storage type is minio
;MINIO_BASE_PATH = packages/
;;
;; Path for chunked uploads. Defaults to APP_DATA_PATH + `tmp/package-upload`
;CHUNKED_UPLOAD_PATH = tmp/package-upload
;;
@ -2452,6 +2458,19 @@ LEVEL = Info
;; storage type
;STORAGE_TYPE = local
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; repo-archive storage will override storage
;;
;[repo-archive]
;STORAGE_TYPE = local
;;
;; Where your lfs files reside, default is data/lfs.
;PATH = data/repo-archive
;;
;; override the minio base path if storage type is minio
;MINIO_BASE_PATH = repo-archive/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; settings for repository archives, will override storage setting
@ -2471,6 +2490,9 @@ LEVEL = Info
;;
;; Where your lfs files reside, default is data/lfs.
;PATH = data/lfs
;;
;; override the minio base path if storage type is minio
;MINIO_BASE_PATH = lfs/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -2520,8 +2542,8 @@ LEVEL = Info
; [actions]
;; Enable/Disable actions capabilities
;ENABLED = false
;; Default address to get action plugins, e.g. the default value means downloading from "https://gitea.com/actions/checkout" for "uses: actions/checkout@v3"
;DEFAULT_ACTIONS_URL = https://gitea.com
;; Default address to get action plugins, e.g. the default value means downloading from "https://code.forgejo.org/actions/checkout" for "uses: actions/checkout@v3"
;DEFAULT_ACTIONS_URL = https://code.forgejo.org
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -2,7 +2,15 @@
if [ ! -d /data/git/.ssh ]; then
mkdir -p /data/git/.ssh
chmod 700 /data/git/.ssh
fi
# 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.
chmod 700 /data/git/.ssh
if [ -f /data/git/.ssh/authorized_keys ]; then
chmod 600 /data/git/.ssh/authorized_keys
fi
if [ ! -f /data/git/.ssh/environment ]; then
@ -24,7 +32,7 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
fi
# Substitute the environment variables in the template
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
APP_NAME=${APP_NAME:-"Forgejo: Beyond coding. We forge."} \
RUN_MODE=${RUN_MODE:-"prod"} \
DOMAIN=${DOMAIN:-"localhost"} \
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \
@ -48,11 +56,11 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
chown ${USER}:git ${GITEA_CUSTOM}/conf/app.ini
fi
# Replace app.ini settings with env variables in the form GITEA__SECTION_NAME__KEY_NAME
environment-to-ini --config ${GITEA_CUSTOM}/conf/app.ini
# only chown if current owner is not already the gitea ${USER}. No recursive check to save time
if ! [[ $(ls -ld /data/gitea | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /data/gitea; fi
if ! [[ $(ls -ld /app/gitea | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /app/gitea; fi
if ! [[ $(ls -ld /data/git | awk '{print $3}') = ${USER} ]]; then chown -R ${USER}:git /data/git; fi
chmod 0755 /data/gitea /app/gitea /data/git
# Replace app.ini settings with env variables in the form GITEA__SECTION_NAME__KEY_NAME
su $USER -c "environment-to-ini --config ${GITEA_CUSTOM}/conf/app.ini"

View file

@ -46,7 +46,6 @@ PATH = /data/gitea/attachments
[log]
MODE = console
LEVEL = info
ROUTER = console
ROOT_PATH = /data/gitea/log
[security]

View file

@ -8,7 +8,7 @@
#
# And place the original in /usr/lib/gitea with working files in /data/gitea
GITEA="/app/gitea/gitea"
WORK_DIR="/app/gitea"
WORK_DIR="/data/gitea"
CUSTOM_PATH="/data/gitea"
# Provide docker defaults

View file

@ -26,7 +26,7 @@ if [ ! -f ${GITEA_APP_INI} ]; then
fi
# Substitute the environment variables in the template
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
APP_NAME=${APP_NAME:-"Forgejo: Beyond coding. We forge."} \
RUN_MODE=${RUN_MODE:-"prod"} \
RUN_USER=${USER:-"git"} \
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \

View file

@ -1,36 +0,0 @@
THEME := themes/gitea
PUBLIC := public
ARCHIVE := https://dl.gitea.com/theme/main.tar.gz
HUGO_PACKAGE := github.com/gohugoio/hugo@v0.111.3
.PHONY: all
all: build
.PHONY: clean
clean:
rm -rf $(PUBLIC) $(THEME)
.PHONY: trans-copy
trans-copy:
bash scripts/trans-copy.sh
.PHONY: server
server: $(THEME)
go run $(HUGO_PACKAGE) server
.PHONY: build
build: $(THEME)
go run $(HUGO_PACKAGE) --cleanDestinationDir
.PHONY: build-offline
build-offline: $(THEME)
go run $(HUGO_PACKAGE) --baseURL="/" --cleanDestinationDir
.PHONY: update
update: $(THEME)
$(THEME): $(THEME)/theme.toml
$(THEME)/theme.toml:
mkdir -p $$(dirname $@)
curl -L -s $(ARCHIVE) | tar xz -C $$(dirname $@)

View file

@ -3,36 +3,7 @@
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com")
## Hosting
These pages are hosted using [netlifycms](https://www.netlifycms.org/) and get
automatically updated on every push to the `master` branch.
## Install
These pages use the [Hugo](https://gohugo.io/) static site generator.
If you are planning to contribute you'll want to download and install Hugo on
your local machine.
The installation of Hugo is out of the scope of this document, so please take
the [official install instructions](https://gohugo.io/overview/installing/) to
get Hugo up and running.
## Development
To generate the website and serve it on [localhost:1313](http://localhost:1313)
just execute this command and stop it with `Ctrl+C`:
```
make server
```
When you are done with your changes just create a pull request, after merging
the pull request the website will be updated automatically.
## Contributing
Fork -> Patch -> Push -> Pull Request
These docs are ingested by our [docs repo](https://gitea.com/gitea/gitea-docusaurus).
## Authors

View file

@ -4,27 +4,7 @@
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com")
## 关于托管方式
本页面托管在我们 Docker 容器内的基础设施上, 它会在每次推送到 `master` 分支的时候自动更新,如果你想自己管理这个页面,你可以从我们的 Docker 镜像 [gitea/docs](https://hub.docker.com/r/gitea/docs/) 中获取它。
## 安装 Hugo
本页面使用了 [Hugo](https://github.com/spf13/hugo) 静态页面生成工具,如果您有维护它的意愿,则需要在本地计算机上下载并安装 Hugo。Hugo 的安装教程不在本文档的讲述范围之内,详情请参见 [官方文档](https://gohugo.io/overview/installing/)。
## 如何部署
在 [localhost:1313](http://localhost:1313) 处构建和运行网站的命令如下,如果需要停止可以使用组合键 `Ctrl+C`:
```
make server
```
完成更改后,只需创建一个 Pull Request (PR),该 PR 一经合并网站将自动更新。
## 如何贡献您的代码
Fork -> Patch -> Push -> Pull Request
https://gitea.com/gitea/gitea-docusaurus
## 关于我们

View file

@ -1,174 +0,0 @@
/* global Fuse, Mark */
function ready(fn) {
if (document.readyState !== 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
ready(doSearch);
const summaryInclude = 60;
const fuseOptions = {
shouldSort: true,
includeMatches: true,
matchAllTokens: true,
threshold: 0, // for parsing diacritics
tokenize: true,
location: 0,
distance: 100,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: [{
name: 'title',
weight: 0.8
},
{
name: 'contents',
weight: 0.5
},
{
name: 'tags',
weight: 0.3
},
{
name: 'categories',
weight: 0.3
}
]
};
function param(name) {
return decodeURIComponent((window.location.search.split(`${name}=`)[1] || '').split('&')[0]).replace(/\+/g, ' ');
}
const searchQuery = param('s');
function doSearch() {
if (searchQuery) {
document.getElementById('search-query').value = searchQuery;
executeSearch(searchQuery);
} else {
const para = document.createElement('P');
para.textContent = 'Please enter a word or phrase above';
document.getElementById('search-results').append(para);
}
}
function getJSON(url, fn) {
const request = new XMLHttpRequest();
request.open('GET', url, true);
request.addEventListener('load', () => {
if (request.status >= 200 && request.status < 400) {
const data = JSON.parse(request.responseText);
fn(data);
} else {
console.error(`Target reached on ${url} with error ${request.status}`);
}
});
request.addEventListener('error', () => {
console.error(`Connection error ${request.status}`);
});
request.send();
}
function executeSearch(searchQuery) {
getJSON(`/${document.LANG}/index.json`, (data) => {
const pages = data;
const fuse = new Fuse(pages, fuseOptions);
const result = fuse.search(searchQuery);
document.getElementById('search-results').innerHTML = '';
if (result.length > 0) {
populateResults(result);
} else {
const para = document.createElement('P');
para.textContent = 'No matches found';
document.getElementById('search-results').append(para);
}
});
}
function populateResults(result) {
for (const [key, value] of result.entries()) {
const content = value.item.contents;
let snippet = '';
const snippetHighlights = [];
if (fuseOptions.tokenize) {
snippetHighlights.push(searchQuery);
for (const mvalue of value.matches) {
if (mvalue.key === 'tags' || mvalue.key === 'categories') {
snippetHighlights.push(mvalue.value);
} else if (mvalue.key === 'contents') {
const ind = content.toLowerCase().indexOf(searchQuery.toLowerCase());
const start = ind - summaryInclude > 0 ? ind - summaryInclude : 0;
const end = ind + searchQuery.length + summaryInclude < content.length ? ind + searchQuery.length + summaryInclude : content.length;
snippet += content.substring(start, end);
if (ind > -1) {
snippetHighlights.push(content.substring(ind, ind + searchQuery.length));
} else {
snippetHighlights.push(mvalue.value.substring(mvalue.indices[0][0], mvalue.indices[0][1] - mvalue.indices[0][0] + 1));
}
}
}
}
if (snippet.length < 1) {
snippet += content.substring(0, summaryInclude * 2);
}
// pull template from hugo template definition
const templateDefinition = document.getElementById('search-result-template').innerHTML;
// replace values
const output = render(templateDefinition, {
key,
title: value.item.title,
link: value.item.permalink,
tags: value.item.tags,
categories: value.item.categories,
snippet
});
document.getElementById('search-results').append(htmlToElement(output));
for (const snipvalue of snippetHighlights) {
new Mark(document.getElementById(`summary-${key}`)).mark(snipvalue);
}
}
}
function render(templateString, data) {
let conditionalMatches, copy;
const conditionalPattern = /\$\{\s*isset ([a-zA-Z]*) \s*\}(.*)\$\{\s*end\s*\}/g;
// since loop below depends on re.lastIndex, we use a copy to capture any manipulations whilst inside the loop
copy = templateString;
while ((conditionalMatches = conditionalPattern.exec(templateString)) !== null) {
if (data[conditionalMatches[1]]) {
// valid key, remove conditionals, leave content.
copy = copy.replace(conditionalMatches[0], conditionalMatches[2]);
} else {
// not valid, remove entire section
copy = copy.replace(conditionalMatches[0], '');
}
}
templateString = copy;
// now any conditionals removed we can do simple substitution
let key, find, re;
for (key of Object.keys(data)) {
find = `\\$\\{\\s*${key}\\s*\\}`;
re = new RegExp(find, 'g');
templateString = templateString.replace(re, data[key]);
}
return templateString;
}
/**
* By Mark Amery: https://stackoverflow.com/a/35385518
* @param {String} HTML representing a single element
* @return {Element}
*/
function htmlToElement(html) {
const template = document.createElement('template');
html = html.trim(); // Never return a text node of whitespace as the result
template.innerHTML = html;
return template.content.firstChild;
}

View file

@ -1,369 +0,0 @@
baseurl: https://docs.gitea.io/
languageCode: en-us
title: Docs
theme: gitea
defaultContentLanguage: en-us
defaultContentLanguageInSubdir: true
enableMissingTranslationPlaceholders: true
enableEmoji: true
permalinks:
post: /:year/:month/:title/
doc: /:sections[1:]/:slug/
page: /:slug/
default: /:slug/
params:
description: Git with a cup of tea
author: The Gitea Authors
website: https://docs.gitea.io
version: 1.19.0 # FIXME: this version was used as "latest stable release", but it always gets outdated and doesn't make sense
minGoVersion: 1.20
goVersion: 1.20
minNodeVersion: 16
search: nav
repo: "https://github.com/go-gitea/gitea"
docContentPath: "docs/content"
markup:
tableOfContents:
startLevel: 1
endLevel: 9
outputs:
home:
- HTML
- RSS
- JSON
menu:
page:
- name: Website
url: https://gitea.io/en-us/
weight: 10
pre: home
- name: Docs
url: /en-us/
weight: 20
pre: question
post: active
- name: API
url: https://try.gitea.io/api/swagger
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/
weight: 30
pre: rss
- name: Shop
url: https://shop.gitea.io/
weight: 40
pre: shopping-cart
- name: Translation
url: https://crowdin.com/project/gitea
weight: 41
pre: language
- name: Downloads
url: https://dl.gitea.io/
weight: 50
pre: download
- name: GitHub
url: https://github.com/go-gitea/
weight: 60
pre: github
- name: Discord Chat
url: https://discord.gg/Gitea
weight: 70
pre: comment
- name: Forum
url: https://discourse.gitea.io/
weight: 80
pre: group
languages:
en-us:
weight: 0
languageName: English
zh-cn:
weight: 1
languageName: 中文(简体)
menu:
page:
- name: 网站
url: https://gitea.io/zh-cn/
weight: 10
pre: home
- name: 文档
url: /zh-cn/
weight: 20
pre: question
post: active
- name: API
url: https://try.gitea.io/api/swagger
weight: 45
pre: plug
- name: 博客
url: https://blog.gitea.io/
weight: 30
pre: rss
- name: 导入
url: https://code.gitea.io/
weight: 40
pre: code
- name: 翻译
url: https://crowdin.com/project/gitea
weight: 41
pre: language
- name: 下载
url: https://dl.gitea.io/
weight: 50
pre: download
- name: GitHub
url: https://github.com/go-gitea/
weight: 60
pre: github
- name: Discord Chat
url: https://discord.gg/Gitea
weight: 70
pre: comment
- name: Forum
url: https://discourse.gitea.io/
weight: 80
pre: group
zh-tw:
weight: 2
languageName: 中文(繁體)
menu:
page:
- name: 網站
url: https://gitea.io/zh-tw/
weight: 10
pre: home
- name: 文件
url: /zh-tw/
weight: 20
pre: question
post: active
- name: API
url: https://try.gitea.io/api/swagger
weight: 45
pre: plug
- name: 部落格
url: https://blog.gitea.io/
weight: 30
pre: rss
- name: 商店
url: https://shop.gitea.io/
weight: 40
pre: shopping-cart
- name: 翻譯
url: https://crowdin.com/project/gitea
weight: 41
pre: language
- name: 下載
url: https://dl.gitea.io/
weight: 50
pre: download
- name: GitHub
url: https://github.com/go-gitea/
weight: 60
pre: github
- name: Discord 聊天室
url: https://discord.gg/Gitea
weight: 70
pre: comment
- name: 討論區
url: https://discourse.gitea.io/
weight: 80
pre: group
pt-br:
weight: 3
languageName: Português Brasileiro
menu:
page:
- name: Página inicial
url: https://gitea.io/pt-br/
weight: 10
pre: home
- name: Documentação
url: /pt-br/
weight: 20
pre: question
post: active
- name: API
url: https://try.gitea.io/api/swagger
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/
weight: 30
pre: rss
- name: Código-fonte
url: https://code.gitea.io/
weight: 40
pre: code
- name: Translation
url: https://crowdin.com/project/gitea
weight: 41
pre: language
- name: Downloads
url: https://dl.gitea.io/
weight: 50
pre: download
- name: GitHub
url: https://github.com/go-gitea/
weight: 60
pre: github
- name: Chat no Discord
url: https://discord.gg/Gitea
weight: 70
pre: comment
- name: Forum
url: https://discourse.gitea.io/
weight: 80
pre: group
nl-nl:
weight: 4
languageName: Nederlands
menu:
page:
- name: Website
url: https://gitea.io/nl-nl/
weight: 10
pre: home
- name: Docs
url: /nl-nl/
weight: 20
pre: question
post: active
- name: API
url: https://try.gitea.io/api/swagger
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/
weight: 30
pre: rss
- name: Code
url: https://code.gitea.io/
weight: 40
pre: code
- name: Translation
url: https://crowdin.com/project/gitea
weight: 41
pre: language
- name: Downloads
url: https://dl.gitea.io/
weight: 50
pre: download
- name: GitHub
url: https://github.com/go-gitea/
weight: 60
pre: github
- name: Discord Chat
url: https://discord.gg/Gitea
weight: 70
pre: comment
- name: Forum
url: https://discourse.gitea.io/
weight: 80
pre: group
fr-fr:
weight: 5
languageName: Français
menu:
page:
- name: Site
url: https://gitea.io/en-us/
weight: 10
pre: home
post: active
- name: Documentation
url: /fr-fr/
weight: 20
pre: question
- name: API
url: https://try.gitea.io/api/swagger
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/
weight: 30
pre: rss
- name: Code
url: https://code.gitea.io/
weight: 40
pre: code
- name: Translation
url: https://crowdin.com/project/gitea
weight: 41
pre: language
- name: Téléchargement
url: https://dl.gitea.io/
weight: 50
pre: download
- name: GitHub
url: https://github.com/go-gitea/
weight: 60
pre: github
- name: Discord Chat
url: https://discord.gg/Gitea
weight: 70
pre: comment
- name: Forum
url: https://discourse.gitea.io/
weight: 80
pre: group
de-de:
weight: 6
languageName: Deutsch
menu:
page:
- name: Webseite
url: https://gitea.io/en-us/
weight: 10
pre: home
post: active
- name: Dokumentation
url: /de-de/
weight: 20
pre: question
- name: API
url: https://try.gitea.io/api/swagger
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/
weight: 30
pre: rss
- name: Code
url: https://code.gitea.io/
weight: 40
pre: code
- name: Übersetzung
url: https://crowdin.com/project/gitea
weight: 41
pre: language
- name: Downloads
url: https://dl.gitea.io/
weight: 50
pre: download
- name: GitHub
url: https://github.com/go-gitea/
weight: 60
pre: github
- name: Discord Chat
url: https://discord.gg/Gitea
weight: 70
pre: comment
- name: Forum
url: https://discourse.gitea.io/
weight: 80
pre: group

View file

@ -2,12 +2,12 @@
date: "2023-04-27T14:00:00+08:00"
title: "Actions"
slug: "actions"
weight: 36
sidebar_position: 36
toc: false
draft: false
menu:
sidebar:
name: "Usage - Actions"
weight: 31
sidebar_position: 31
identifier: "actions"
---

View file

@ -2,13 +2,13 @@
date: "2016-12-01T16:00:00+02:00"
title: "Administration"
slug: "administration"
weight: 30
sidebar_position: 30
toc: false
draft: false
menu:
sidebar:
name: "Administration"
weight: 20
sidebar_position: 20
collapse: true
identifier: "administration"
---

View file

@ -2,12 +2,12 @@
date: "2017-08-23T09:00:00+02:00"
title: "Avancé"
slug: "administration"
weight: 30
sidebar_position: 30
toc: false
draft: false
menu:
sidebar:
name: "Avancé"
weight: 20
sidebar_position: 20
identifier: "administration"
---

View file

@ -2,12 +2,12 @@
date: "2016-12-01T16:00:00+02:00"
title: "运维"
slug: "administration"
weight: 30
sidebar_position: 30
toc: false
draft: false
menu:
sidebar:
name: "运维"
weight: 20
sidebar_position: 20
identifier: "administration"
---

View file

@ -2,12 +2,12 @@
date: "2016-12-01T16:00:00+02:00"
title: "運維"
slug: "administration"
weight: 30
sidebar_position: 30
toc: false
draft: false
menu:
sidebar:
name: "運維"
weight: 20
sidebar_position: 20
identifier: "administration"
---

View file

@ -2,7 +2,7 @@
date: "2019-12-28"
title: "Adding Legal Pages"
slug: adding-legal-pages
weight: 110
sidebar_position: 110
toc: false
draft: false
aliases:
@ -12,7 +12,7 @@ menu:
parent: "administration"
name: "Adding Legal Pages"
identifier: "adding-legal-pages"
weight: 110
sidebar_position: 110
---
Some jurisdictions (such as EU), requires certain legal pages (e.g. Privacy Policy) to be added to website. Follow these steps to add them to your Gitea instance.

Some files were not shown because too many files have changed in this diff Show more