Commit Graph

2469 Commits (forgejo)

Author SHA1 Message Date
Earl Warren a5df1e5c91
Merge remote-tracking branch 'forgejo/forgejo-dependency' into forgejo 2023-09-18 19:08:19 +02:00
Earl Warren 9a975f77a1
Merge remote-tracking branch 'forgejo/forgejo-moderation' into forgejo 2023-09-18 19:08:12 +02:00
Earl Warren ff08f9d50b
Merge remote-tracking branch 'forgejo/forgejo-branding' into forgejo 2023-09-18 19:07:50 +02:00
Earl Warren a88e3cadd6
Merge remote-tracking branch 'forgejo/forgejo-i18n' into forgejo 2023-09-18 19:07:45 +02:00
Aravinth Manivannan 7d2d997011
[GITEA] notifies admins on new user registration
Sends email with information on the new user (time of creation and time of last sign-in) and a link to manage the new user from the admin panel


Co-authored-by: Aravinth Manivannan <>
Co-committed-by: Aravinth Manivannan <>
(cherry picked from commit c721aa828b)
(cherry picked from commit 6487efcb9d)

(cherry picked from commit 7ea66ee1c5)

2023-09-18 16:15:52 +02:00
Gusted a92b4cfeb6
[MODERATION] Add repo transfers to blocked functionality (squash)
- When someone gets blocked, remove all pending repository transfers
from the blocked user to the doer.
- Do not allow to start transferring repositories to the doer as blocked user.
- Added unit testing.
- Added integration testing.

(cherry picked from commit 8a3caac330)
2023-09-18 15:56:34 +02:00
Gusted d629314def
[MODERATION] Purge issues on user deletion
- Forgejo has the option to delete users, in which all data except
issues and comments are removed, this makes sense in some cases where
users need to be removed cleanly but without removing their existing bug
reports or comments to an discussion. In the case of spammers, admins
have the option to enable purging, where comments are removed.
- Add issues to the list of things to be removed if purge is checked.
- No unit testing, as this gigantic function doesn't have one to begin
- Add integration test.
- Resolves

(cherry picked from commit 3ed381c758)
(cherry picked from commit 44d00650ce)
(cherry picked from commit 7f4da82779)
2023-09-18 15:56:34 +02:00
Gusted 6a9626839c
[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.

(cherry picked from commit 687d852480)
(cherry picked from commit 0c32a4fde5)
(cherry picked from commit 1791130e3c)
(cherry picked from commit 37858b7e8f)
(cherry picked from commit a3e2bfd7e9)
(cherry picked from commit 7009b9fe87)

(cherry picked from commit b2aec34791)
(cherry picked from commit e2f1b73752)

[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 <>
(cherry picked from commit 0505a10421)
(cherry picked from commit 37b4e6ef9b)
(cherry picked from commit c17c121f2c)

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

Changes to adapt to:

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

(cherry picked from commit 523635f83c)
(cherry picked from commit 4743eaa6a0)
(cherry picked from commit eff5b43d2e)

(cherry picked from commit 9d359be5ed)
(cherry picked from commit b1f3069a22)

[MODERATION] add user blocking API

- Follow up for: #540, #802
- Add API routes for user blocking from user and organization
- 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 f3afaf15c7)
(cherry picked from commit 6d754db3e5)
(cherry picked from commit 2a89ddc0ac)
(cherry picked from commit 4a147bff7e)

(cherry picked from commit bb8c339185)
(cherry picked from commit 5a11569a01)
(cherry picked from commit 2373c801ee)

[MODERATION] restore redirect on unblock

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

was replaced by


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

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

(cherry picked from commit 597c243707)
(cherry picked from commit cfa539e590)

[MODERATION] Add test case (squash)

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

(cherry picked from commit 70dadb1916)

[MODERATION] Block adding collaborators

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

(cherry picked from commit 747be949a1)

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


(cherry picked from commit e53f955c88)

(cherry picked from commit b4a454b576)


[MODERATION] Remove blocked user collaborations with doer

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

(cherry picked from commit ec87016178)
(cherry picked from commit 313e6174d8)

[MODERATION] QoL improvements (squash)

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

(cherry picked from commit e9d638d075)

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

(cherry picked from commit ce8b30be13)
(cherry picked from commit f911dc4025)

(cherry picked from commit c1b37b7fda)
(cherry picked from commit 856a2e0903)

[MODERATION] Show graceful error on comment creation

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

(cherry picked from commit 490646302e)
(cherry picked from commit d3d88667cb)
(cherry picked from commit 6818de13a9)

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

(cherry picked from commit 1588d4834a)
(cherry picked from commit d510ea52d0)
(cherry picked from commit 8249e93a14)

[MODERATION] Refactor integration testing (squash)

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

(cherry picked from commit ffb393213d)
(cherry picked from commit 85505e0f81)
(cherry picked from commit 0f3cf17761)

[MODERATION] Fix network error (squash)

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

(cherry picked from commit 112bc25e54)
(cherry picked from commit 1194fe4899)
(cherry picked from commit 9abb95a844)

[MODERATION] Modernize frontend (squash)

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

(cherry picked from commit ec935a16a3)
(cherry picked from commit 67f37c8346)

2023-09-18 15:56:34 +02:00
Panagiotis "Ivory" Vasilopoulos 5cec1d9c2d
[GITEA] add option for banning dots in usernames

Author:    Panagiotis "Ivory" Vasilopoulos <>
Date:      Mon Jun 12 13:57:01 2023 +0200

Co-authored-by: Gusted <>
(cherry picked from commit fabdda5c6e)
(cherry picked from commit d2c7f45621)
(cherry picked from commit dfdbaba3d6)
(cherry picked from commit a3cda092b8)
(cherry picked from commit f0fdb5905c)
(cherry picked from commit 9697e48c1f)
(cherry picked from commit 46e31009a8)
(cherry picked from commit 5bb2c54b6f)
(cherry picked from commit 682f9d24e1)
(cherry picked from commit 1863481005)
(cherry picked from commit 4f1b7c4ddb)
(cherry picked from commit 6afe70bbf1)
2023-09-18 15:40:46 +02:00
Rodion Borisov cb5f0513f2
[BRANDING] Replace links to GitHub with Codeberg guides about adding SSH/GPG keys
(cherry picked from commit f409deabe6)
(cherry picked from commit a62a3d0cf6)
(cherry picked from commit a28d2ddd5e)
(cherry picked from commit 2f8ac92a17)
(cherry picked from commit d43c158a2f)
(cherry picked from commit a2fc2dd1e2)
(cherry picked from commit 00e6fa60d7)
(cherry picked from commit 350f14bc8a)

(cherry picked from commit b325b2653f)
2023-09-18 15:13:30 +02:00
fnetx e94fb8986b
[I18N] Move source locales to other folder
(cherry picked from commit d38ad85a05)
(cherry picked from commit b94f9b8c1b)
(cherry picked from commit c728ce8b32)
(cherry picked from commit 2911286336)
(cherry picked from commit bd4dc797c7)
(cherry picked from commit 35889addf9)
(cherry picked from commit 9eaf321db4)
(cherry picked from commit 7b64ef0c9b)
(cherry picked from commit 6cd86bf244)
(cherry picked from commit 275dd36f58)
(cherry picked from commit d5ace5a0ae)
(cherry picked from commit c067466f8c)
(cherry picked from commit 0d51a2228f)
(cherry picked from commit 4973e19dd3)
(cherry picked from commit f553b4d543)
(cherry picked from commit 18312a6f74)
(cherry picked from commit d09dc97f8b)
(cherry picked from commit 10c552e54e)
(cherry picked from commit edf895e866)
(cherry picked from commit 786a486cfc)
(cherry picked from commit 2aa16d5cb9)
(cherry picked from commit 1e940cf6cd)
(cherry picked from commit 7355f3a653)
(cherry picked from commit e630328f5f)
(cherry picked from commit 4f819cb97c)
(cherry picked from commit 3ffdabd3ed)
(cherry picked from commit df4fb86007)
(cherry picked from commit 3826909cbb)
(cherry picked from commit d9825f7165)
(cherry picked from commit 78ce758e60)
2023-09-18 14:53:36 +02:00
fnetx 98e157c222
[I18N] Rename upstream files
(cherry picked from commit 2d67a9a621)
(cherry picked from commit 4eac51f6a4)
(cherry picked from commit 34401a28f5)
(cherry picked from commit 7210b45a61)
(cherry picked from commit cc741116d2)
(cherry picked from commit 67a160ef0a)
(cherry picked from commit adb2587672)
(cherry picked from commit 1b57a3d601)
(cherry picked from commit 02fbbf0538)
(cherry picked from commit 164af88c4b)
(cherry picked from commit 5102d0aded)
(cherry picked from commit f1e1e620f4)
(cherry picked from commit 2bd4ab7b46)
(cherry picked from commit 28b511a33a)
(cherry picked from commit dc501ba1c1)
(cherry picked from commit 252d336537)
(cherry picked from commit 8208f11db0)
(cherry picked from commit da711c70b5)
(cherry picked from commit 62e9a4d917)
(cherry picked from commit 7fe6e09073)
(cherry picked from commit cfd6782313)
(cherry picked from commit 5188e3a0f1)
(cherry picked from commit 5d741ae440)
(cherry picked from commit b8a72e0111)
(cherry picked from commit 2fbbf1ef8d)
(cherry picked from commit 33597ea6c0)
(cherry picked from commit 966e0cf8c0)
(cherry picked from commit 38d0da9167)
(cherry picked from commit b740ebf5f6)
(cherry picked from commit 36e0978f6e)
2023-09-18 14:53:36 +02:00
Gusted 0bc4b3508c
[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 0baefb546a)
(cherry picked from commit e8ee41880b)
(cherry picked from commit 7eca4f3bf1)
(cherry picked from commit 6dde3992dc)
(cherry picked from commit fb3a37fbfc)
(cherry picked from commit 8304af1e9d)
(cherry picked from commit 0543a7d12a)
(cherry picked from commit c3a22933b7)
(cherry picked from commit e243707694)
(cherry picked from commit 7eb6d1bcf7)
(cherry picked from commit 1d7b9535cd)
(cherry picked from commit 05920dce67)
(cherry picked from commit f173f27d7c)
(cherry picked from commit 90e1c9340e)
(cherry picked from commit de68610ea7)
(cherry picked from commit 8d5757ea04)
(cherry picked from commit c7a7fff316)
(cherry picked from commit 39ac8b8fc1)
(cherry picked from commit 9889203301)

[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

(cherry picked from commit 61eae5b105)
(cherry picked from commit 091def20a1)
(cherry picked from commit d5d11bf45a)
(cherry picked from commit 71863d4707)
(cherry picked from commit 11ece4aab1)
(cherry picked from commit afdd7e714f)
(cherry picked from commit 39170e2f1d)
(cherry picked from commit 4b3a52aab8)
(cherry picked from commit 9d763c5fc8)
(cherry picked from commit 638db15482)
(cherry picked from commit a52bfdd8e7)
(cherry picked from commit dc93d00e85)
2023-09-18 14:53:09 +02:00
cassiozareck e4c9525b13
[FEAT] add Forgero Git Service
Signed-off-by: cassiozareck <>
(cherry picked from commit a878adfe62)

Adding description and Forgejo SVG

(cherry picked from commit 13738c0380)

Undo reordering and tmpl redirection

(cherry picked from commit 9ae51c46f4)
(cherry picked from commit 70fffdc61d)
(cherry picked from commit c0ebfa9da3)
(cherry picked from commit 9922c92787)
(cherry picked from commit 00c0effbc7)
2023-09-18 14:11:24 +02:00
puni9869 a50d9af876
Display archived labels specially when listing labels (#26820)
Follow up

Added archived label for org labels and added into issue filter list.

Part of


Signed-off-by: puni9869 <>
Co-authored-by: silverwind <>
2023-09-18 04:54:05 +00:00
GiteaBot 558eea69bd [skip ci] Updated licenses and gitignores 2023-09-18 00:23:39 +00:00
Lunny Xiao 47b878858a
Search branches (#27055)
Resolve #25233 

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

<img width="1297" alt="图片"
2023-09-17 08:24:40 +00:00
GiteaBot ea83c0647c [skip ci] Updated translations via Crowdin 2023-09-17 00:24:27 +00:00
KN4CK3R ed64f1c2b8
Support `.git-blame-ignore-revs` file (#26395)
Closes #26329

This PR adds the ability to ignore revisions specified in the
`.git-blame-ignore-revs` file in the root of the repository.


The banner is displayed in this case. I intentionally did not add a UI
way to bypass the ignore file (same behaviour as Github) but you can add
`?bypass-blame-ignore=true` to the url manually.


Co-authored-by: wxiaoguang <>
2023-09-16 17:42:34 +00:00
GiteaBot 684ab403aa [skip ci] Updated translations via Crowdin 2023-09-16 00:21:59 +00:00
GiteaBot f8a1094406 [skip ci] Updated translations via Crowdin 2023-09-15 00:22:32 +00:00
Lunny Xiao 198a9ca635
Display all user types and org types on admin management UI (#27050)
Follow #24026 

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


Co-authored-by: delvh <>
2023-09-14 06:53:36 +00:00
GiteaBot d0318c4ae0 [skip ci] Updated translations via Crowdin 2023-09-14 00:22:27 +00:00
GiteaBot 7d56459c6c [skip ci] Updated translations via Crowdin 2023-09-13 00:22:36 +00:00
GiteaBot f599814001 [skip ci] Updated translations via Crowdin 2023-09-12 00:21:32 +00:00
GiteaBot 148c9c4b05 [skip ci] Updated translations via Crowdin 2023-09-11 00:22:57 +00:00
GiteaBot a20e0affba [skip ci] Updated translations via Crowdin 2023-09-10 00:23:48 +00:00
GiteaBot 049b9f3718 [skip ci] Updated translations via Crowdin 2023-09-09 00:21:42 +00:00
Lunny Xiao 9c0a3532a4
Add a new column schedule_id for action_run to track (#26975)
Fix #26971 

And the UI now will display it's scheduled but not triggered by a push.

<img width="954" alt="图片"
2023-09-08 23:01:19 +08:00
GiteaBot 6cbbd51ad4 [skip ci] Updated translations via Crowdin 2023-09-08 00:21:56 +00:00
Lunny Xiao f20e317d6d
Improve hint when uploading a too large avatar (#26935)
Fix #26390


Co-authored-by: delvh <>
Co-authored-by: wxiaoguang <>
Co-authored-by: Giteabot <>
Co-authored-by: silverwind <>
2023-09-07 13:35:45 +00:00
GiteaBot 9860dba566 [skip ci] Updated translations via Crowdin 2023-09-07 00:22:15 +00:00
FuXiaoHei 460a2b0edf
Artifacts retention and auto clean up (#26131)
Currently, Artifact does not have an expiration and automatic cleanup
mechanism, and this feature needs to be added. It contains the following
key points:

- [x] add global artifact retention days option in config file. Default
value is 90 days.
- [x] add cron task to clean up expired artifacts. It should run once a
- [x] support custom retention period from `retention-days: 5` in
- [x] artifacts link in actions view should be non-clickable text when
2023-09-06 07:41:06 +00:00
Lunny Xiao 31c92d9695
Add missing translation (#26926)
Fix #26923
2023-09-05 22:13:08 -04:00
wxiaoguang c17fd68be7
Show queue's active worker number (#26896) 2023-09-04 21:07:32 +08:00
GiteaBot a38cf868c5 [skip ci] Updated licenses and gitignores 2023-09-04 00:23:31 +00:00
Jack Hay 9881b8a4e2
Add more descriptive error on forgot password page (#26848)
## Changes
- Forces flashed error to render immediately when forgot password code
is incorrect or has expired.
- Adds a link back to the `forgot_password` page so that the user can
restart the process (in the event that their link has expired)
2023-09-01 16:15:39 +00:00
GiteaBot 3ff81d38d8 [skip ci] Updated translations via Crowdin 2023-09-01 00:24:05 +00:00
Denys Konovalov 5b5bb8d354
User details page (#26713)
This PR implements a proposal to clean up the admin users table by
moving some information out to a separate user details page (which also
displays some additional information).

Other changes:
- move edit user page from `/admin/users/{id}` to
`/admin/users/{id}/edit` -> `/admin/users/{id}` now shows the user
details page
- show if user is instance administrator as a label instead of a
separate column
- separate explore users template into a page- and a shared one, to make
it possible to use it on the user details page
- fix issue where there was no margin between alert message and
following content on admin pages






Partially resolves #25939


Co-authored-by: Giteabot <>
2023-08-31 11:21:18 +02:00
GiteaBot 10aab8a385 [skip ci] Updated translations via Crowdin 2023-08-31 00:22:07 +00:00
yp05327 008f5d8cf1
Add default label in branch select list (#26697) 2023-08-29 12:15:19 +00:00
GiteaBot aeeeac8edf [skip ci] Updated translations via Crowdin 2023-08-29 00:22:17 +00:00
GiteaBot 2401e6e121 [skip ci] Updated licenses and gitignores 2023-08-28 00:22:48 +00:00
Lunny Xiao 476b9d1589
Use instead of (#26739) 2023-08-27 11:59:12 +00:00
puni9869 e0a796a641
Adding hint `Archived` to archive label. (#26741)
## Archived labels UI

* Enhanced the Filtered UI page to seamlessly incorporate a list of
archived labels.

* Defer the implementation of specialized handling for archived labels
to upcoming pull requests. This step will be undertaken subsequent to
the successful merge of this pull request.






Part of


Co-authored-by: Giteabot <>
Co-authored-by: silverwind <>
2023-08-27 09:32:54 +00:00
GiteaBot 37b3ba22a1 [skip ci] Updated translations via Crowdin 2023-08-27 00:27:26 +00:00
silverwind 8b5c081d76
Remove fomantic loader module (#26670)
Replace Fomantic `loader` CSS module with our existing `is-loading`
spinner. Only three places in the UI used this module, which are
pictured here:

<img width="1237" alt="Screenshot 2023-08-22 at 22 18 01"

<img width="894" alt="Screenshot 2023-08-22 at 22 05 05"

heatmap (I removed the previous loading text, it was unreadable because
it was tiny and on fast machines only visible for a fraction of a
<img width="764" alt="Screenshot 2023-08-22 at 22 18 44"

Also, heatmap container does not resize any more after loading now and
previous duplicate id `user-heatmap` is gone.


Co-authored-by: wxiaoguang <>
2023-08-25 16:03:14 +00:00
yp05327 d2e4039def
Add `member`, `collaborator`, `contributor`, and `first-time contributor` roles and tooltips (#26658)
GitHub like role descriptor





Co-authored-by: delvh <>
Co-authored-by: wxiaoguang <>
Co-authored-by: Lunny Xiao <>
2023-08-24 13:06:17 +08:00
Lunny Xiao 0d55f64e6c
chore(actions): support cron schedule task (#26655)
Replace #22751 

1. only support the default branch in the repository setting.
2. autoload schedule data from the schedule table after starting the
3. support specific syntax like `@yearly`, `@monthly`, `@weekly`,
`@daily`, `@hourly`

## How to use

See the [GitHub Actions
for getting more detailed information.

    - cron: '30 5 * * 1,3'
    - cron: '30 5 * * 2,4'

    runs-on: ubuntu-latest
      - name: Not on Monday or Wednesday
        if: github.event.schedule != '30 5 * * 1,3'
        run: echo "This step will be skipped on Monday and Wednesday"
      - name: Every time
        run: echo "This step will always run"

Signed-off-by: Bo-Yi.Wu <>


Co-authored-by: Jason Song <>
Co-authored-by: techknowlogick <>
Co-authored-by: wxiaoguang <>
Co-authored-by: Lunny Xiao <>
2023-08-24 03:06:51 +00:00
yp05327 a4a567f29f
Check disabled workflow when rerun jobs (#26535)
In GitHub, we can not rerun jobs if the workflow is disabled.


Co-authored-by: silverwind <>
Co-authored-by: wxiaoguang <>
2023-08-22 10:30:02 +08:00