Commit graph

1748 commits

Author SHA1 Message Date
Gusted
f0899d35c8 chore(deps): Update gitlab api to updated library (#6487)
- Per https://github.com/xanzy/go-gitlab?tab=readme-ov-file#go-gitlab-deprecated
- Move to https://gitlab.com/gitlab-org/api/client-go
- Use v0.116.0 because v0.117.0 has incorrect requirement of go 1.23.4, it will be fixed in v0.119.0 which is not yet released

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6487
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-01-07 19:06:33 +00:00
limiting-factor
604c21ffd7
fix: f3: label color must start with # 2025-01-07 17:13:21 +01:00
limiting-factor
63204e8edf
fix: f3: update milestone is_closed & deadline_unix 2025-01-07 17:13:21 +01:00
limiting-factor
946b77115e
fix: f3: update issue is_locked 2025-01-07 17:13:21 +01:00
limiting-factor
168c1d806b
fix: f3: update issue labels 2025-01-07 17:13:21 +01:00
limiting-factor
d8f71b513c
fix: f3: update issue assignees
The ID must be obtained from the repository ID and the index,
otherwise it is zero and the assignees are not updated.
2025-01-07 17:13:21 +01:00
limiting-factor
16564fd9e8
fix: f3: support modify milestone 2025-01-07 17:13:21 +01:00
hiifong
af91f4e203
Fix duplicate co-author in squashed merge commit messages (#33020)
Fix: #31980

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a87168869a4ceffb2a3d84986640da357b0793cf)
2025-01-05 12:15:51 +00:00
wxiaoguang
e8c769d8e6
Test webhook email (#33033)
Close #27918

(cherry picked from commit 1dbf0d7f0822c10b379a21c192c2d63e34fd52f9)
2025-01-05 12:00:26 +00:00
Otto
b59522f0b3 Merge pull request 'Rewrite OpenGraph Header' (#6447) from JakobDev/forgejo:ogrewrite into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6447
Reviewed-by: Otto <otto@codeberg.org>
2025-01-03 13:41:32 +00:00
Gusted
cfb18e2b6c Merge pull request 'feat(webhook): sourcehut: submit SSH URL for private repository (or when pre-filled)' (#6445) from oliverpool/forgejo:sourcehut-refactor into forgejo
Some checks failed
/ release (push) Waiting to run
testing / test-e2e (push) Blocked by required conditions
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Integration tests for the release process / release-simulation (push) Has been cancelled
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6445
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-01-03 00:22:33 +00:00
JakobDev
e99bf7f16d
Rewrite OpenGraph Header 2025-01-01 20:43:20 +01:00
oliverpool
3bea06f906 sourcehut: use ssh sources URL when appropriate
Co-authored-by: Jordan Anderson <jordan@jba.io>
2025-01-01 19:46:05 +01:00
Otto
b01f3b9b05 Merge pull request 'feat: Add summary card for repos and releases' (#6269) from JakobDev/forgejo:repocard into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6269
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2025-01-01 17:48:28 +00:00
oliverpool
6e13ac4d5f add manifest tests 2025-01-01 11:31:49 +01:00
oliverpool
faf1c836eb refactor sourcehut manifest building 2025-01-01 11:01:51 +01:00
Earl Warren
8d6f0d49c6 Merge pull request '[gitea] week 2024-53 cherry pick (gitea/main -> forgejo)' (#6391) from earl-warren/wcp/2024-53 into forgejo
Some checks are pending
Integration tests for the release process / release-simulation (push) Waiting to run
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6391
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-12-30 08:26:15 +00:00
JakobDev
a82cd18d9a Merge branch 'forgejo' into repocard 2024-12-29 11:20:09 +00:00
Lunny Xiao
2ffa9a5e6e
demilestone should not include milestone (#32923)
Fix #32887

(cherry picked from commit f44712f22bc7bfce049c64c27f60453ff1e41a5c)

Conflicts:
	services/issue/milestone_test.go
  trivial conflicts (require vs assert)
2024-12-28 19:24:24 +00:00
Maks1mS
8a3fb4885e Merge branch 'forgejo' into feat/add-oidc-ssh-keys 2024-12-26 14:33:09 +00:00
Earl Warren
1fffd116e5 Merge pull request '[gitea] week 2024-52 cherry pick (gitea/main -> forgejo)' (#6342) from earl-warren/wcp/2024-52 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6342
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-12-24 06:28:36 +00:00
George Bartolomey
13ca6c14f1
feat: allow changing default branch update style
This commit allows chaning default branch update style through global
and repository settings. The setting affects "Update branch" button
in PR view (button shows when some commits are ahead of master branch).
When default update style is set to "rebase", dropdown button updates branch
by rebase by default. When update style is set to other value, dropdown button
updates branch by merge. Any of these actions may be selected using dropdown
in any case.

Signed-off-by: George Bartolomey <george@bh4.ru>
2024-12-23 18:55:25 +03:00
Snoweuph
be076c98d4
fix: repo avatar generating (#6338) 2024-12-22 18:18:37 +01:00
Gusted
54255688f5 Merge pull request 'fix: template config path (#2836)' (#6335) from Snoweuph/forgejo:fix/template-file into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6335
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-12-22 14:53:16 +00:00
Snoweuph
fcb98c6d3c
fix: template config path (#2836) 2024-12-22 11:05:24 +01:00
Lunny Xiao
a5399b473f
Add more load functions to make sure the reference object loaded (#32901)
Fix #32897

(cherry picked from commit dc8f59baa54d4f47edab6feb76a6903947584326)
2024-12-22 08:46:38 +01:00
Gabriel A. Giovanini
b698b256f1 fix: Ignore self review request notification
A notification would be trigger if a user request itself as review of a
PR.
2024-12-21 20:03:36 +01:00
JakobDev
265174bd5e Merge branch 'forgejo' into repocard 2024-12-19 15:11:12 +00:00
Maxim Slipenko
bbcd7d6fae Merge remote-tracking branch 'upstream/forgejo' into feat/add-oidc-ssh-keys 2024-12-19 10:45:59 +00:00
JakobDev
25bfd2983e
Update 2024-12-18 20:26:39 +01:00
Lunny Xiao
2b5c69c451
Detect whether action view branch was deleted (#32764)
Fix #32761

![图片](https://github.com/user-attachments/assets/a5a7eef8-0fea-4242-b199-1b0b73d9bbdb)

(cherry picked from commit 6370d2fb93a5ee897b82969ca30a9feb33667714)

Conflicts:
	routers/web/repo/actions/actions.go
	routers/web/repo/actions/view.go
  trivial context conflicts
2024-12-15 09:45:10 +01:00
JakobDev
7685a1e98e
feat: Add summary card for repos and releases 2024-12-14 19:36:09 +01:00
Gusted
7f8f9b878f
fix: Revert "allow synchronizing user status from OAuth2 login providers (#31572)"
This commit has a fundamental flaw, in order to syncronize if external
users are still active the commit checks if the refresh token is
accepted by the OAuth provider, if that is not the case it sees that as
the user is disabled and sets the is active field to `false` to signal
that. Because it might be possible (this commit makes this a highly
likelyhood) that the OAuth provider still recognizes this user the
commit introduces code to allow users to re-active themselves via the
oauth flow if they were disabled because of this. However this code
makes no distinction in why the user was disabled and always re-actives
the user.

Thus the reactivation via the OAuth flow allows users to bypass the
manually activation setting (`[service].REGISTER_MANUAL_CONFIRM`) or if
the admin for other reasons disabled the user.

This reverts commit 21fdd28f08.
2024-12-12 05:59:06 +01:00
Maxim Slipenko
a87e0d0e46 fix: do not rewrite when there are no keys 2024-12-10 14:01:02 +00:00
Maxim Slipenko
47fd9a421f style: run make fmt 2024-12-10 07:41:04 +00:00
Maxim Slipenko
4500757acd feat: add synchronization for SSH keys with OpenID Connect
Co-authored-by:  Kirill Kolmykov <cyberk1ra@ya.ru>
2024-12-09 18:59:11 +03:00
dragon
37a300b105 Add support for indexing arch files 2024-12-09 11:34:50 +08:00
Andreas Shimokawa
3c9b3ddf5c Do not rewrite ssh keys files when deleting a user without one (#6097)
### Problem

Big instances can have huge authorized_keys files when using OpenSSH instead of the internal ssh server. Forgejo always re-generates the contents of that file when a user is deleted, even if he does not even have a public key uploaded. In case of codeberg.org, a 15MB file gets rewritten. If we batch delete 100 Spam users without ssh keys, we rewrite 1.5GB, this takes time and wears the SSD. In addition, there is a high chance of hitting a race contidion bug, when deleting users in parallel.

### Solution / Mitigation

This patch prevents rewriting authorized_keys files, when not necessary. It greatly speeds up deleting malicious users, saves IO bandwidth and SSD wear. It also greatly reduces the chance of hitting a race condition bug. Fixing the race condition is not the scope of this patch though.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6097
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Andreas Shimokawa <shimokawa@fsfe.org>
Co-committed-by: Andreas Shimokawa <shimokawa@fsfe.org>
2024-12-05 21:32:09 +00:00
Earl Warren
56007ff3a2 Merge pull request '[gitea] week 2024-49 cherry pick (gitea/main -> forgejo)' (#6110) from earl-warren/wcp/2024-49 into forgejo
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6110
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-12-03 15:06:55 +00:00
Rowan Bohde
2e00ae4cdd
Validate OAuth Redirect URIs (#32643)
This fixes a TODO in the code to validate the RedirectURIs when adding
or editing an OAuth application in user settings.

This also includes a refactor of the user settings tests to only create
the DB once per top-level test to avoid reloading fixtures.

(cherry picked from commit 16a7d343d78807e39df124756e5d43a69a2203a3)

Conflicts:
	services/forms/user_form.go
	tests/integration/user_settings_test.go
  simple conflicts
2024-12-03 10:19:22 +01:00
Lunny Xiao
3973f1022d
Add github compatible tarball download API endpoints (#32572)
Fix #29654
Fix #32481

(cherry picked from commit 703be6bf307ed19ce8dc8cd311d24aeb6e5b9861)

Conflicts:
	routers/api/v1/repo/file.go
	routers/web/repo/repo.go
	services/repository/archiver/archiver.go
	services/repository/archiver/archiver_test.go
  trivial context conflicts
  add missing function PathParam skipped in a very large refactor
2024-12-03 10:19:22 +01:00
Earl Warren
9dfea97080 Merge pull request 'fix: clean up log files that no longer exist' (#6128) from gusted/forgejo-cleanup into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6128
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-12-03 07:07:39 +00:00
Gusted
4e8677a911
fix: clean up log files that no longer exist
- If for some reason a action log file does not longer exist in the
database or on the file system, then mark it as being cleaned up.
- Unit test added.
2024-12-03 05:09:47 +01:00
Gusted
b525eec82b Merge pull request 'fix: dbconsistency check adding missing quotes' (#6124) from 71rd/forgejo:dbconsistency-forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6124
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-12-03 04:05:20 +00:00
Gusted
45cec645de Merge pull request 'fix: return correct type in GetSubModule' (#6114) from gusted/forgejo-submodule-entry into forgejo
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6114
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-12-03 03:24:01 +00:00
71rd
2953080339 fix: dbconsistency check adding missing quotes
On postgres the new check for orphaned authorization tokens fails with:
- [E] Error: pq: syntax error at or near "." whilst counting Authorization token without existing User

Adding marks to the user table reference allows the check to succeed
2024-12-02 16:05:51 +00:00
Gusted
e7cffc378f
Fix: return correct type in GetSubModule
- `GetSubModules` already solely stores the URL of the submodule and not
a `*SubModule` entry, so don't try to type assert it to be a struct.
- I am not able to pinpoint when this was regressed but if I had to
guess it might be #4941.
- Added integration test.
2024-12-02 01:08:09 +01:00
Fermé le Lundi
ac99be3bb7 Merge branch 'forgejo' into forgejo 2024-11-28 22:53:34 +00:00
Otto
48b91fa31a Merge pull request 'Improve Swagger documentation for user endpoints' (#6050) from JakobDev/forgejo:userswagger into forgejo
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6050
Reviewed-by: Otto <otto@codeberg.org>
2024-11-28 20:42:19 +00:00
FermeLeLundi
decb673f28 Update services/repository/branch.go
Typo
2024-11-28 10:13:56 +00:00