Commit graph

14673 commits

Author SHA1 Message Date
Loïc Dachary e7382cc71e
[BRANDING] reserve forgejo-actions username
(cherry picked from commit 2a25be788b)
(cherry picked from commit b270d5815c)
2023-02-25 17:02:37 +01:00
Gusted 6601328d3c
[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 4608c57688)
(cherry picked from commit e837e8a529)
2023-02-25 17:02:37 +01:00
Earl Warren 1a742446c1
[BRANDING] define the forgejo webhook type
templates/swagger/v1_json.tmpl updated with `make generate-swagger`

(cherry picked from commit 88899c492e)
(cherry picked from commit 7171bd9617)
2023-02-25 17:02:37 +01:00
Earl Warren eb9646c7ef
[BRANDING] add X-Forgejo-* headers
(cherry picked from commit 0a3388f93f)
(cherry picked from commit 7eba0a440a)
2023-02-25 17:02:37 +01:00
Earl Warren aee1afc509
[BRANDING] parse FORGEJO__* in the container environment
Add the FORGEJO__ prefix as equivalent to GITEA__ when interpreted by
environment-to-ini. It is used when running the Forgejo container like
so:

  docker run --name forgejo -e FORGEJO__security__INSTALL_LOCK=true \
             -d codeberg.org/forgejo/forgejo:1.18

Signed-off-by: Earl Warren <contact@earl-warren.org>
(cherry picked from commit 6cd61e2ab7)
(cherry picked from commit 62cae8cc6a)
2023-02-25 17:02:37 +01:00
Gusted a7ae2e4c09
[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 0b45380765)

[BRANDING] Change Swagger title to Forgejo API

(cherry picked from commit 79f6a70b53)
(cherry picked from commit 6cd47afe33)
2023-02-25 17:02:37 +01:00
TomZ eb2b4ce388
[BRANDING] Rename usage of Gitea in user-visible places
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 103991d73f)
(cherry picked from commit 2a0d3f85f1)
2023-02-25 17:02:37 +01:00
Caesar Schinas ef58efb8e0
[BRANDING] Rebrand default meta tags
(cherry picked from commit b1a792b635)
(cherry picked from commit ba71acccdb)
2023-02-25 17:02:37 +01:00
Caesar Schinas 837da0c1f4
[BRANDING] Add Forgejo light, dark, and auto themes
(cherry picked from commit faab0c670e)
(cherry picked from commit b6d59493c7)
2023-02-25 17:02:37 +01:00
Loïc Dachary 0d7da06c47
[BRANDING] container images: set APP_NAME
(cherry picked from commit 12d7bc447e)
(cherry picked from commit 1335b17fc3)
2023-02-25 17:02:36 +01:00
Caesar Schinas e1bf4de211
[BRANDING] Custom loading animation for Forgejo
(cherry picked from commit a3b3b8a2df)
(cherry picked from commit de0fd2d2e4)
2023-02-25 17:02:36 +01:00
Caesar Schinas f63536538c
[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 ca1319aa16)
(cherry picked from commit 52a4d238a0)
2023-02-25 17:02:36 +01:00
Caesar Schinas f29cf9cfc1
[BRANDING] Add forgejo emoji
(cherry picked from commit ade55ad308)
(cherry picked from commit 107f726618)
2023-02-25 17:02:36 +01:00
Caesar Schinas 456abff8c0
[BRANDING] Rebrand footer "powered by" links
(cherry picked from commit 8b9237e47e)
(cherry picked from commit 47e5543f33)
2023-02-25 17:02:36 +01:00
Gusted 37e15a2f41
[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 fa78e52b5d)
(cherry picked from commit e36d649989)
2023-02-25 17:02:36 +01:00
Caesar Schinas afa2a31bb9
[BRANDING] add Forgejo logo
(cherry picked from commit f42622c7d5)
(cherry picked from commit a39e7f2a79)
2023-02-25 17:02:36 +01:00
Loïc Dachary db8392a8ac
[SECURITY] default to pbkdf2 with 320,000 iterations
(cherry picked from commit 3ea0b287d7)
2023-02-25 15:50:53 +01:00
Earl Warren 1574643a6a
[API] Forgejo API /api/forgejo/v1
(cherry picked from commit 20b5669269)
2023-02-25 15:50:53 +01:00
Percy Ma 79de60a5d8
[DOCS] LICENSE: add Forgejo Authors
(cherry picked from commit 7c98a4c54e)
(cherry picked from commit 1ec4a8e6cf)
2023-02-25 15:50:53 +01:00
Loïc Dachary b07123ee7b
[DOCS] RELEASE-NOTES.md 2023-02-25 15:50:46 +01:00
Loïc Dachary 2ccd6e2bd6
[WORKFLOW] issues & pr templates
(cherry picked from commit 9dd224f00c)
(cherry picked from commit 710af007bc)
2023-02-25 15:50:46 +01:00
Loïc Dachary 67debe2247
[DOCS] README
(cherry picked from commit a47b474586)
(cherry picked from commit 2fcc61c1d9)
2023-02-25 15:50:46 +01:00
Loïc Dachary 08dcef0c8c
[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
2023-02-25 15:50:37 +01:00
Loïc Dachary ef43b1c691
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)
2023-02-25 15:48:41 +01:00
Loïc Dachary 3af8757583
[CI] set PASSWORD_HASH_ALGO = argon2 for integration tests
(cherry picked from commit 1d7ce2a39c)
2023-02-25 13:55:40 +01:00
Loïc Dachary 8dff3cc2d1
[CI] implementation: forgejo container images
(cherry picked from commit dd1971d4e6)
(cherry picked from commit 3981dbaf8c)
2023-02-25 13:55:40 +01:00
Loïc Dachary 6b6007fbce
[CI] implementation: Woodpecker based CI
(cherry picked from commit c2a7aaeee8)
2023-02-25 13:55:40 +01:00
Loïc Dachary dc6e9d8799
[CI] implementation: publish forgejo- binaries instead of gitea-
(cherry picked from commit 6d910daafb)
(cherry picked from commit d447861cc9)
2023-02-25 13:55:40 +01:00
Yarden Shoham 8540fc45b1
Fix secrets overview page missing from docs sidebar (#23143)
There was a warning while building the docs: `Building sites … WARN
2023/02/25 08:56:37
"/workspace/gitea/docs/content/doc/secrets/overview.en-us.md:1:1":
duplicate menu entry with identifier "overview" in menu "sidebar"`.

### Before

![image](https://user-images.githubusercontent.com/20454870/221348741-55cef254-f2ac-4507-9a66-818b406c668f.png)

### After

![image](https://user-images.githubusercontent.com/20454870/221348757-42066303-e1b7-43fe-9c4f-e05182fbabdd.png)

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
2023-02-25 10:56:02 +01:00
Brecht Van Lommel 10cdcb9ea8
Add "Reviewed by you" filter for pull requests (#22927)
This includes pull requests that you approved, requested changes or
commented on. Currently such pull requests are not visible in any of the
filters on /pulls, while they may need further action like merging, or
prodding the author or reviewers.

Especially when working with a large team on a repository it's helpful
to get a full overview of pull requests that may need your attention,
without having to sift through the complete list.
2023-02-24 21:55:50 -05:00
Brecht Van Lommel 843f81113e
Projects: rename Board to Column in interface and improve consistency (#22767) 2023-02-24 18:10:50 -05:00
zeripath d827215011
Fix DBConsistency checks on MSSQL (#23132)
Unfortunately xorm's `builder.Select(...).From(...)` does not escape the
table names. This is mostly not a problem but is a problem with the
`user` table.

This PR simply escapes the user table. No other uses of `From("user")`
where found in the codebase so I think this should be all that is
needed.

Fix #23064

Signed-off-by: Andrew Thornton <art27@cantab.net>
2023-02-24 16:45:55 -05:00
Brecht Van Lommel f4920c9c7f
Add pagination for dashboard and user activity feeds (#22937)
Previously only the last few activities where available. This works for
all activity and for activity on a date chosen on the heatmap.
2023-02-24 16:15:10 -05:00
zeripath 740a5ecdd9
Update go.mod dependencies (#23126)
This PR does a bulk update of a lot of our go deps.

I have not included nektos/act and xorm for the following reasons:
* Xorm updates can sometimes be complex and I'd rather do that in a
separate PR
* I think people more update with the actions code should double check
that the latest nektos/act library works correctly.

---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-02-24 20:18:49 +00:00
Zettat123 347df0cbf0
Show empty repos in Admin Repository Management page (#23114)
The **Admin Repository Management** page and the **Explore Repository**
page both use the `RenderRepoSearch` function. In this function, the
`OnlyShowRelevant` search option is `true` when querying repositories
for admin page.


edf98a2dc3/routers/web/explore/repo.go (L99-L115)

Refer to
[#19361](https://github.com/go-gitea/gitea/pull/19361/files#diff-8058dfb85557010e0592d586675ec62ce406af7068e6311f39c160deac37f149R497),
the repositories with `is_empty=true` will be hidden if
`OnlyShowRelevant` is `true`.

Administrators should be able to see all repositories. So
`OnlyShowRelevant` shouldn't be set to `true` .

---------

Co-authored-by: Andrew Thornton <art27@cantab.net>
2023-02-24 19:11:31 +00:00
yp05327 9eb61b77ac
Redirect to the commit page after applying patch (#23056)
Fixes https://github.com/go-gitea/gitea/issues/22621
2023-02-24 16:56:41 +00:00
WÁNG Xuěruì e77528baed
Bump go.etcd.io/bbolt and blevesearch deps (#23062)
This notably brings support for GOARCH=loong64, among other fixes.

---------

Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
Co-authored-by: zeripath <art27@cantab.net>
2023-02-24 15:45:28 +00:00
HesterG d20b29d7ce
Fix height for sticky head on large screen on PR page (#23111)
Right now on the PR 'File Change' Tab, the file title header sticky to
the top on large screens has wrong height, resulting in wrong ui
behavior when scrolling down. This PR is to fix this.

Before:

<img width="964" alt="截屏2023-02-24 17 12 29"
src="https://user-images.githubusercontent.com/17645053/221140409-025c4a84-6bbe-4b5b-a13f-bd2b79063522.png">

After:
<img width="1430" alt="截屏2023-02-24 21 10 12"
src="https://user-images.githubusercontent.com/17645053/221186750-0344d652-4610-4a90-a4c0-7f6269f950d6.png">
2023-02-24 14:29:49 +00:00
Lunny Xiao a8c4f8cebc
Fix db.Find bug (#23115)
Caused by #20821 

Fix #23110
2023-02-24 21:17:09 +08:00
Lunny Xiao 91fa0eb9d7
Avoid warning for system setting when start up (#23054)
Partially fix #23050

After #22294 merged, it always has a warning log like `cannot get
context cache` when starting up. This should not affect any real life
but it's annoying. This PR will fix the problem. That means when
starting up, getting the system settings will not try from the cache but
will read from the database directly.

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
2023-02-24 18:23:13 +08:00
Jason Song edf98a2dc3
Require approval to run actions for fork pull request (#22803)
Currently, Gitea will run actions automatically which are triggered by
fork pull request. It's a security risk, people can create a PR and
modify the workflow yamls to execute a malicious script.

So we should require approval for first-time contributors, which is the
default strategy of a public repo on GitHub, see [Approving workflow
runs from public
forks](https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks).

Current strategy:

- don't need approval if it's not a fork PR;
- always need approval if the user is restricted;
- don't need approval if the user can write;
- don't need approval if the user has been approved before;
- otherwise, need approval.

https://user-images.githubusercontent.com/9418365/217207121-badf50a8-826c-4425-bef1-d82d1979bc81.mov

GitHub has an option for that, you can see that at
`/<owner>/<repo>/settings/actions`, and we can support that later.

<img width="835" alt="image"
src="https://user-images.githubusercontent.com/9418365/217199990-2967e68b-e693-4e59-8186-ab33a1314a16.png">

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-24 15:58:49 +08:00
Zettat123 a6175b01d9
Fix nil context in RenderMarkdownToHtml (#23092)
Fix #23082.

This bug is caused by a nil context in
https://github.com/go-gitea/gitea/issues/23082#issuecomment-1441276546 .

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-24 14:36:07 +08:00
HesterG 045becf9aa
Add HesterG to maintainers (#23104)
[List of mine merged
PR](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3AHesterG+is%3Amerged+)
2023-02-24 14:31:02 +08:00
yp05327 5b87c05a95
improve FindProjects (#23085)
I found `FindAndCount` which can `Find` and `Count` in the same time
Maybe it is better to use it in `FindProjects`

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-24 13:18:52 +08:00
wxiaoguang 0bc8bb3cc4
Make issue meta dropdown support Enter, confirm before reloading (#23014)
As the title. Label/assignee share the same code.

* Close #22607
* Close #20727

Also:

* partially fix for #21742, now the comment reaction and menu work with
keyboard.
* partially fix for #17705, in most cases the comment won't be lost.
* partially fix for #21539
* partially fix for #20347
* partially fix for #7329

### The `Enter` support

Before, if user presses Enter, the dropdown just disappears and nothing
happens or the window reloads.

After, Enter can be used to select/deselect labels, and press Esc to
hide the dropdown to update the labels (still no way to cancel ....
maybe you can do a Cmd+R or F5 to refresh the window to discard the
changes .....)


This is only a quick patch, the UX is still not perfect, but it's much
better than before.


### The `confirm` before reloading

And more fixes for the `reload` problem, the new behaviors:

* If nothing changes (just show/hide the dropdown), then the page won't
be reloaded.
* If there are draft comments, show a confirm dialog before reloading,
to avoid losing comments.

That's the best effect can be done at the moment, unless completely
refactor these dropdown related code.

Screenshot of the confirm dialog:

<details>


![image](https://user-images.githubusercontent.com/2114189/220538288-e2da8459-6a4e-43cb-8596-74057f8a03a2.png)

</details>

---------

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-24 09:26:27 +08:00
sillyguodong 1f09051f2b
Fix SyncOnCommit always return false in API of push_mirrors (#23088)
Fix: #22990

---
Before, the return value of the api is always false,regrardless of
whether the entry of `sync_on_commit` is true or false.
I have confirmed that the value of `sync_on_commit` dropped into the
database is correct.
So, I think it is enough to make some small changes.
2023-02-23 15:50:33 -06:00
yp05327 ed954b070d
Fix commit name in Apply Patch page (#23086)
Fixes
https://github.com/go-gitea/gitea/issues/22621#issuecomment-1439309200
2023-02-23 15:14:07 -06:00
HesterG 8ed6096158
Add wrapper to author to avoid long name ui problem (#23030)
This PR is a possible solution for issue #22866. Main change is to add a
`author-wrapper` class around author name, like the wrapper added to
message. The `max-width` is set to 200px on PC, and 100px on mobile
device for now.
2023-02-23 14:28:18 -06:00
Sven 659cf30b69
Avoid Hugo from adding quote to actions url (#23097) 2023-02-23 12:19:52 -05:00
KN4CK3R 0ae1ed749d
Remove all package data after tests (#22984)
Fixes #21020

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2023-02-23 22:11:56 +08:00