Commit Graph

14735 Commits

Author SHA1 Message Date
Loïc Dachary f8641c7909 Merge pull request '[DOCS] RELEASE-NOTES: relevant repositories' (#478) from earl-warren/forgejo:wip-1.19-release-notes-relevant into forgejo-development
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/478
2023-03-12 09:10:37 +00:00
Earl Warren 5b7f94dc11 Merge pull request '[ACTIONS] forgejo actions --registration-token-admin' (#505) from earl-warren/forgejo:wip-runner into forgejo-development
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/505
2023-03-11 07:22:52 +00:00
Loïc Dachary 402c979125 Merge pull request '[DOCS] RELEASE-NOTES: 1.19.0-0 is really : 1.19.0-2' (#509) from earl-warren/forgejo:wip-1.19-release-notes into forgejo-development
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/509
2023-03-10 17:21:56 +00:00
Earl Warren de6ed5b87f
[DOCS] RELEASE-NOTES: relevant repositories 2023-03-10 18:01:21 +01:00
Earl Warren 60d770c2c9
[DOCS] RELEASE-NOTES: 1.19.0-0 is really : 1.19.0-2 2023-03-10 17:20:01 +01:00
Loïc Dachary da8b1ed282 Merge pull request '[DOCS] RELEASE-NOTES: cosmetic improvements' (#507) from dachary/forgejo:doc-release-notes-1.19.0 into forgejo-development
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/507
2023-03-10 15:15:56 +00:00
Loïc Dachary b93df350d9
[DOCS] RELEASE-NOTES: cosmetic improvements 2023-03-10 15:31:35 +01:00
Earl Warren 5a0428ede3
do not run initDB within integration tests 2023-03-09 14:46:23 +01:00
Earl Warren dc4eb0ea17 Merge pull request '[DOCS] RELEASE-NOTES: webhook authorization header' (#479) from earl-warren/forgejo:wip-1.19-release-notes-webhooks into forgejo-development
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/479
2023-03-09 13:28:05 +00:00
Earl Warren 6621b04458
s/Printf/Print/ 2023-03-09 13:36:39 +01:00
Earl Warren d8f313f9e2
address oliverpool comments 2023-03-09 11:36:26 +01:00
Earl Warren 481d813539
[ACTIONS] forgejo actions --registration-token-admin 2023-03-09 11:02:59 +01:00
Loïc Dachary bc4ecc7025 Merge pull request '[DOCS] RELEASE-NOTES: move scoped labels to the documentation' (#496) from earl-warren/forgejo:wip-1.19-release-notes-labels into forgejo-development
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/496
2023-03-06 10:21:30 +00:00
Loïc Dachary 300139ee53 Merge pull request '[DOCS] RELEASE-NOTES: video element in markdown' (#495) from earl-warren/forgejo:wip-1.19-release-notes-video into forgejo-development
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/495
2023-03-06 10:20:16 +00:00
Earl Warren c5eedaf4f3
[DOCS] RELEASE-NOTES: move scoped labels to the documentation 2023-03-06 10:43:59 +01:00
Earl Warren bcb0bd51d2
[DOCS] RELEASE-NOTES: video element in markdown 2023-03-06 10:27:49 +01:00
Earl Warren c35e2c4f6f
[DOCS] RELEASE-NOTES: webhook authorization header 2023-03-05 21:59:49 +01:00
Loïc Dachary ad08ca9955
[DOCS] RELEASE-NOTES: 1.19.0-0-rc0
(cherry picked from commit e84e43887b)

[DOCS] RELEASE-NOTES: add scoped access tokens

(cherry picked from commit 688f831853)

[DOCS] RELEASE-NOTES: Scoped labels

(cherry picked from commit 747479a07b)

[DOCS] RELEASE-NOTES: OIDC groups

(cherry picked from commit 10c505fe89)

[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 148b2ff093)

[DOCS] RELEASE-NOTES: Copy citation

(cherry picked from commit d0f217735f)

[DOCS] RELEASE-NOTES: Support org/user level projects

(cherry picked from commit de845c7bcf)

[DOCS] RELEASE-NOTES: v1.19 has a documentation

(cherry picked from commit 9a5b46da32)

[DOCS] RELEASE-NOTES: do not split webhook section

(cherry picked from commit 00ed020321)

[DOCS] RELEASE-NOTES: Incoming emails

(cherry picked from commit 06c455b33b)

[DOCS] RELEASE-NOTES: secrets are an implementation detail

(cherry picked from commit 8236dc3a57)

[DOCS] RELEASE-NOTES: Prohibit fork if user reached maximum

(cherry picked from commit 0f80b8c696)

[DOCS] RELEASE-NOTES: scoped tokens: do not duplicate the docs

(cherry picked from commit 9bc4793c07)

[DOCS] RELEASE-NOTES: rss feed for tags and releases

(cherry picked from commit 599b36fada)

[DOCS] RELEASE-NOTES: protected branches wildcard

(cherry picked from commit 2b316c4950)

[DOCS] RELEASE-NOTES: disable releases

(cherry picked from commit 9a60773f1d)

[DOCS] RELEASE-NOTES: review box

(cherry picked from commit 09867dd122)

[DOCS] RELEASE-NOTES: asciicast support

(cherry picked from commit ea9658379b)

[DOCS] RELEASE-NOTES: attention blocks

(cherry picked from commit 70b387750b)

[DOCS] RELEASE-NOTES: commit cross reference

(cherry picked from commit fe706dad13)

[DOCS] RELEASE-NOTES: strip user completion border case

(cherry picked from commit 33ca51b4b6)

[DOCS] RELEASE-NOTES: card preview

(cherry picked from commit 626cd78ca6)

[DOCS] RELEASE-NOTES: raw copy button

(cherry picked from commit edfb467d64)

[DOCS] RELEASE-NOTES: allow edits by maintainers by default

(cherry picked from commit 7006405bc6)

[DOCS] RELEASE-NOTES: database auto migration is a little arcane

(cherry picked from commit 78030fa9af)

[DOCS] RELEASE-NOTES: fix typos & minor rewording

(cherry picked from commit ae1d47f656)
2023-03-05 20:28:14 +01:00
Loïc Dachary bd2a5fa292
[SECURITY] default to pbkdf2 with 320,000 iterations
(cherry picked from commit 3ea0b287d7)
(cherry picked from commit db8392a8ac)
2023-03-05 20:28:11 +01:00
Earl Warren 5ea2309851
[API] Forgejo API /api/forgejo/v1
(cherry picked from commit 20b5669269)
(cherry picked from commit 1574643a6a)

Update semantic version according to specification

(cherry picked from commit 22510f4130)

Mise à jour de 'Makefile'

(cherry picked from commit c3d85d8409)
2023-03-05 20:28:07 +01:00
Percy Ma e7fbfb34a9
[DOCS] LICENSE: add Forgejo Authors
(cherry picked from commit 7c98a4c54e)
(cherry picked from commit 1ec4a8e6cf)
(cherry picked from commit 79de60a5d8)
2023-03-05 20:28:06 +01:00
Loïc Dachary ca85c880b4
[DOCS] RELEASE-NOTES.md
(cherry picked from commit b07123ee7b)
2023-03-05 20:28:06 +01:00
Loïc Dachary b90dc5fc4f
[WORKFLOW] issues & pr templates
(cherry picked from commit 9dd224f00c)
(cherry picked from commit 710af007bc)
(cherry picked from commit 2ccd6e2bd6)
2023-03-05 20:28:06 +01:00
Loïc Dachary b90ffbb309
[DOCS] README
(cherry picked from commit a47b474586)
(cherry picked from commit 2fcc61c1d9)
(cherry picked from commit 67debe2247)
2023-03-05 20:28:06 +01:00
Loïc Dachary 5df52b8a4f
[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 08dcef0c8c)

[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 83cc389239)
2023-03-05 20:27:49 +01:00
Loïc Dachary d17fe25e2f
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 eb85782115)
(cherry picked from commit 34401f2004)
(cherry picked from commit ef43b1c691)
2023-03-05 20:22:28 +01:00
Loïc Dachary 0b81815209
[CI] set PASSWORD_HASH_ALGO = argon2 for integration tests
(cherry picked from commit 1d7ce2a39c)
(cherry picked from commit 3af8757583)
2023-03-05 19:11:42 +01:00
Loïc Dachary e7673e5d22
[CI] implementation: forgejo container images
(cherry picked from commit dd1971d4e6)
(cherry picked from commit 3981dbaf8c)
(cherry picked from commit 8dff3cc2d1)
2023-03-05 19:11:42 +01:00
Loïc Dachary 63608a221e
[CI] implementation: Woodpecker based CI
(cherry picked from commit c2a7aaeee8)
(cherry picked from commit 6b6007fbce)
2023-03-05 19:11:41 +01:00
Loïc Dachary ef232fa20c
[CI] implementation: publish forgejo- binaries instead of gitea-
(cherry picked from commit 6d910daafb)
(cherry picked from commit d447861cc9)
(cherry picked from commit dc6e9d8799)
2023-03-05 19:11:41 +01:00
Hester Gong ea7f0d6fcf
Change interactiveBorder to fix popup preview (#23169)
Close #23073. 
Used the solution as reference to the reply:
https://github.com/go-gitea/gitea/issues/23073#issuecomment-1440124609
Here made the change inside the `contextpopup.js` because this is where
the popup component is created and tippy configuration is given.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-03-05 23:40:50 +08:00
wxiaoguang 21a1d76911
Improve the frontend guideline (#23298)
### The CustomEvent prefix

There was already `ce-quick-submit`, the `ce-` prefix seems better than
`us-`. Rename the only `us-` prefixed `us-load-context-popup` to `ce-`
prefixed.

### Styles and Attributes in Go HTML Template

https://github.com/go-gitea/gitea/pull/21855#issuecomment-1429643073

Suggest to stick to `class="c1 {{if $var}}c2{{end}}"`

The readability and maintainability should be applied to the code which
is read by developers, but not for the generated outputs.

The template code is the code for developers, while the generated HTML
are only for browsers.

The `class="c1 {{if $var}}c2{{end}}"` style is clearer for developers
and more intuitive, and the generated HTML also makes browsers happy (a
few spaces do not affect anything)

Think about a more complex case:

* `class="{{if $active}}active{{end}} menu item {{if $show}}show{{end}}
{{if $warn}}warn{{end}}"`
* --vs--
* `class="{{if $active}}active {{end}}menu item{{if $show}}
show{{end}}{{if $warn}} warn{{end}}"`

The first style make it clearer to see each CSS class name with its
`{{if}}` block.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-03-05 22:23:42 +08:00
Brecht Van Lommel e8935606f5
Scoped labels: set aria-disabled on muted Exclusive option for a11y (#23306)
It is convenient to be able to toggle off this option after removing /
from the name. This ensures the muted state is communicated to blind
users even when the input is not fully disabled.

Part of #22974

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-03-05 21:25:25 +08:00
Brecht Van Lommel 5d621fe9a7
Add basic documentation for labels, including scoped labels (#23304)
Part of #22974

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-03-05 20:35:12 +08:00
GiteaBot 390d270064 [skip ci] Updated translations via Crowdin 2023-03-05 00:15:41 +00:00
Lunny Xiao 8d6e9bc819
Re-add accidentally removed `hacking-on-gitea.zh-cn.md` (#23297)
#21627 accidentally removed the docs file `hacking-on-gitea.zh-cn.md`.
This re-adds it and merges some changes from #23289
2023-03-04 22:34:02 +01:00
yp05327 6864583957
Add default owner team to privated_org and limited_org in unit test (#23109)
Related to https://github.com/go-gitea/gitea/pull/22705 's CI result
[here](https://drone.gitea.io/go-gitea/gitea/68043/2/16)
> IsOrganizationOwner() [E] [63f61849-7] Organization does not have
owner team: 23
2023-03-04 19:23:51 +00:00
silverwind b6d2c94966
Improve sed detection in update-locales.sh (#23254)
- ~~Make scripts work from any directory~~
- Detect sed version just like Makefile does

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2023-03-04 14:29:28 +00:00
Sandeep Bhat 547c173dab
Support sanitising the URL by removing extra slashes in the URL (#21333)
Changes in this PR :

Strips incoming request URL of additional slashes (/). For example an
input like

`https://git.data.coop//halfd/new-website.git` is translated to
`https://git.data.coop/halfd/new-website.git`

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

Fix #23242

---------

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-03-04 21:31:24 +08:00
wxiaoguang 188c8c12c2
Make Ctrl+Enter submit a pending comment (starting review) instead of submitting a single comment (#23245)
Close #23241

Before: press Ctrl+Enter in the Code Review Form, a single comment will
be added.

After: press Ctrl+Enter in the Code Review Form, start the review with
pending comments.


The old name `is_review` is not clear, so the new code use
`pending_review` as the new name.

Co-authored-by: delvh <leon@kske.dev>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-03-04 02:13:37 -05:00
Jason Song 47b912cd52
Avoid panic caused by broken payload when creating commit status (#23216)
When creating commit status for Actons jobs, a payload with nil
`HeadCommit` will cause panic.

Reported at:
https://gitea.com/gitea/act_runner/issues/28#issuecomment-732166

Although the `HeadCommit` probably can not be nil after #23215,
`CreateCommitStatus` should protect itself, to avoid being broken in the
future.

In addition, it's enough to print error log instead of returning err
when `CreateCommitStatus` failed.

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-03-04 02:12:37 -05:00
yp05327 ca84a61761
Add run status in action view page (#23212)
Before:

![image](https://user-images.githubusercontent.com/18380374/222084932-a7643fbe-2d9f-48db-b25d-74ace49e03f4.png)

![image](https://user-images.githubusercontent.com/18380374/222084887-fde3500d-dad3-4902-9c82-c4f71f23f83b.png)

After:

![image](https://user-images.githubusercontent.com/18380374/222084565-eeef1110-9d9d-40b4-a26b-fbd5a307f14e.png)

![image](https://user-images.githubusercontent.com/18380374/222084728-6c96d7c1-a399-43d5-8369-392ad5017b7f.png)

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-03-04 00:41:37 -05:00
techknowlogick af4b00c283
update to mermaid v10 (#23178)
fix #23153

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-03-04 00:39:07 -05:00
wxiaoguang 787a05a3a2
Fix code wrap for unbroken lines (#23268)
## The Problem

`overflow-wrap: break-word` doesn't work well for unbroken lines. Use
`overflow-wrap: anywhere` instead, and remove legacy alias `word-wrap`

## Before


![image](https://user-images.githubusercontent.com/2114189/222743939-5f38d9e4-18d8-4ae0-8078-4b3a59195a30.png)

## After


![image](https://user-images.githubusercontent.com/2114189/222743833-0e0cfdbb-7b2e-420d-99f9-b1b45dde521a.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-03-03 23:48:59 -05:00
Brecht Van Lommel 47bb5f11cb
Fix stray backticks appearing in pull request timeline (#23282)
Caused by #23189.
2023-03-03 23:48:05 -05:00
Jason Song 7b9e23cc1d
Fill head commit to in payload when notifying push commits for mirroring (#23215)
Just like what has been done when pushing manually:

7a5af25592/services/repository/push.go (L225-L226)

Before:

<img width="448" alt="image"
src="https://user-images.githubusercontent.com/9418365/222100123-cd4839d1-2d4d-45f7-b7a0-0cbc73162b44.png">

After:

<img width="448" alt="image"
src="https://user-images.githubusercontent.com/9418365/222100225-f3c5bb65-7ab9-41e2-8e39-9d84c23c352d.png">

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-03-03 23:45:53 -05:00
wxiaoguang b2359f3df6
Fix various bugs for "install" page (#23194)
## TLDR

* Fix the broken page / broken image problem when click "Install"
* Close #20089
* Fix the Password Hash Algorithm display problem for #22942
* Close #23183
* Close #23184

## Details

### The broken page / broken image problem when click "Install"
(Redirect failed after install gitea #23184)

Before: when click "install", all new requests will fail, because the
server has been restarted. Users just see a broken page with broken
images, sometimes the server is not ready but the user would have been
redirect to "/user/login" page, then the users see a new broken page
(connection refused or something wrong ...)

After: only check InstallLock=true for necessary handlers, and sleep for
a while before restarting the server, then the browser has enough time
to load the "post-install" page. And there is a script to check whether
"/user/login" is ready, the user will only be redirected to the login
page when the server is ready.

### During new instance setup make 'Gitea Base URL' filled from
window.location.origin #20089

If the "app_url" input contains `localhost` (the default value from
config), use current window's location href as the `app_url` (aka
ROOT_URL)

### Fix the Password Hash Algorithm display problem for "Provide the
ability to set password hash algorithm parameters #22942"

Before: the UI shows `pbkdf2$50000$50`

<details>

![image](https://user-images.githubusercontent.com/2114189/221917143-e1e54798-1698-4fee-a18d-00c48081fc39.png)

</details>

After: the UI shows `pbkdf2`

<details>

![image](https://user-images.githubusercontent.com/2114189/221916999-97a15be8-2ebb-4a01-bf93-dac18e354fcc.png)

</details>

### GET data: net::ERR_INVALID_URL #23183

Cause by empty `data:` in `<link rel="manifest"
href="data:{{.ManifestData}}">`

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-03-04 10:12:02 +08:00
zeripath 5c4075e16d
Fix GetFilesChangedBetween if the file name may be escaped (#23272)
The code for GetFilesChangedBetween uses `git diff --name-only
base..head` to get the names of files changed between base and head
however this forgets that git will escape certain values.

This PR simply switches to use `-z` which has the `NUL` character as the
separator.

Ref https://github.com/go-gitea/gitea/pull/22568#discussion_r1123138096

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-03-03 17:28:38 -05:00
Hester Gong 7f9d58fab8
Support paste treepath when creating a new file or updating the file name (#23209)
Close #23204 

Quick Demo:


https://user-images.githubusercontent.com/17645053/222058727-ad30a37c-f0ac-4184-9946-a71fcee473b5.mov

---------

Co-authored-by: delvh <leon@kske.dev>
2023-03-03 17:28:20 -05:00
ChristianSch 79acf7acc4
Fix grammar in error message (#23273)
Fixes the grammar in the error message in case a runner token has
already been activated
2023-03-03 14:53:46 -06:00