Commit graph

19696 commits

Author SHA1 Message Date
Gergely Nagy 4bccc96684
mailer: Put the username in X-Forgejo-Sender and -Recipient
Following gitea#28981, set `X-Forgejo-Sender` and `X-Forgejo-Recipient`
to the username of the respective users, rather than their display name.
The username is more appropriate for these headers, for filtering
purposes. The display name is already included in the From header.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-28 08:27:37 +02:00
Gergely Nagy 887c027ec2
mailer: Switch X-Mailer to "Forgejo"
Fixes #3930.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-28 08:19:03 +02:00
silverwind afa1380672
Change --border-radius-circle to --border-radius-full (gitea#30936)
Cherry-pick of 2ced31e81d adapted to Forgejo releases UI.

Percentage-based `border-radius` [creates undesirable
ellipse](https://jsfiddle.net/silverwind/j9ko5wnt/4/) on non-square
content. Instead, use pixel value and use same wording `full` like
tailwind does, but increast to 99999px over their 9999px.

(cherry picked from commit 2ced31e81dd9e45659660c1abff529d0192fd8ed)
2024-05-27 13:15:20 +02:00
Earl Warren 95ccbb5995 Merge pull request 'Update dependency updates to v16.1.1' (#3920) from renovate/updates-16.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3920
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-27 05:47:51 +00:00
Earl Warren d17c8ad7fc Merge pull request 'Update dependency markdownlint-cli to v0.41.0' (#3919) from renovate/markdownlint-cli-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3919
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-27 05:46:18 +00:00
0ko b6849b8e7d Merge pull request 'Port: Fix long branch name overflows (https://github.com/go-gitea/gitea/pull/30345)' (#3890) from 0ko/forgejo:fix-branch-overflow-2 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3890
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-05-27 04:24:41 +00:00
0ko b2eba34506 Unify usercards margins (#3915)
These are some slight design changes to how usercards are presented.

- `margin`: removed one of the sides so the margins are the same in both axis
- `margin`: increased from 10px to 15px
Previously it was (Y, X) = (20, 10); now it's (15, 15)
 - `width`: slightly decreased so that the point, where too small screen width causes card relocation to another row, doesn't increase
- `padding`: this change does nothing visually. `padding-bottom` was useless because padding was already set for all sides by another rule `.ui.segment {padding: 1em};`. This change just ensures that padding stays the same for all sides even if `.ui.segment` changes, instead of causing inconsistency
- `margin-bottom`: added as an override to margin caused by `display: flex`. From my research, usually there's `25px` gap between the content and the pagination. It was `39px` here, now it's `25px` too

### Before

![image](/attachments/0ebf6f44-6b27-4d4d-8856-77568291518c)

### After

![image](/attachments/1e0a3d95-ac49-4d10-8e00-86cc041d4338)

I can't show the distance between the content and the pagination, but the change does work when applying via devtools on https://codeberg.org/forgejo/forgejo/stars.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3915
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
Reviewed-by: Caesar Schinas <caesar@caesarschinas.com>
2024-05-27 04:22:48 +00:00
Renovate Bot 23a991a0b4 Update dependency updates to v16.1.1 2024-05-27 00:04:27 +00:00
Renovate Bot 319acec27c Update dependency markdownlint-cli to v0.41.0 2024-05-27 00:04:18 +00:00
Earl Warren 4a9dd87496 Merge pull request 'fix(release): golang:1.22-alpine3.20 does not have all architectures' (#3918) from earl-warren/forgejo:wip-alpine into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3918
Reviewed-by: thefox <thefox@noreply.codeberg.org>
2024-05-26 20:24:52 +00:00
Earl Warren d59ed64345
fix(release): golang:1.22-alpine3.20 does not have all architectures
It was premature to try to use them, try again later.

https://codeberg.org/forgejo-integration/forgejo/actions/runs/2147

github.com/docker/buildx v0.14.1 59582a88fca7858dbe1886fd1556b2a0d79e43a3
::endgroup::
[command]/usr/bin/docker buildx build --build-arg RELEASE_VERSION=8.0-test --file Dockerfile --iidfile /tmp/docker-actions-toolkit-UzuWxS/iidfile --platform linux/amd64,linux/arm64,linux/arm/v6 --tag codeberg.org/***/forgejo:8.0-test --metadata-file /tmp/docker-actions-toolkit-UzuWxS/metadata-file --push .
------
 > [linux/arm/v6 internal] load metadata for code.forgejo.org/oci/golang:1.22-alpine3.20:
------
Dockerfile:3
--------------------
   1 |     FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
   2 |
   3 | >>> FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/golang:1.22-alpine3.20 as build-env
   4 |
   5 |     ARG GOPROXY
--------------------
Dockerfile:1
--------------------
   1 | >>> FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
   2 |
   3 |     FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/golang:1.22-alpine3.20 as build-env
--------------------
Dockerfile:54
--------------------
  52 |     RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
  53 |
  54 | >>> FROM code.forgejo.org/oci/golang:1.22-alpine3.20
  55 |     ARG RELEASE_VERSION
  56 |     LABEL maintainer="contact@forgejo.org" \
--------------------
ERROR: failed to solve: code.forgejo.org/oci/golang:1.22-alpine3.20: failed to resolve source metadata for code.forgejo.org/oci/golang:1.22-alpine3.20: no match for platform in manifest: not found
::error::buildx failed with: ERROR: failed to solve: code.forgejo.org/oci/golang:1.22-alpine3.20: failed to resolve source metadata for code.forgejo.org/oci/golang:1.22-alpine3.20: no match for platform in manifest: not found
2024-05-26 21:51:57 +02:00
Zettat123 df15abd072
Support setting the default attribute of the issue template dropdown field (#31045)
Fix #31044

According to [GitHub issue template
documentation](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-for-dropdown),
the `default` attribute can be used to specify the preselected option
for a dropdown field.

(cherry picked from commit 7ab0988af140aa3e0204979765f75961f1dc9c11)
2024-05-26 20:13:09 +02:00
Kemal Zebari d6e454c320
Sync up deleted branches & action assets related cleanup documentation (#31022)
Syncs up docs associated to actions and deleted branch cleanup i.e. in
custom/app.example.ini and the config cheat sheet.

(cherry picked from commit c9eac519961ecd5d0e1d6ee856ab532e8c16c65d)

Conflicts:
	docs/content/administration/config-cheat-sheet.en-us.md
	docs do not exist here in Forgejo
2024-05-26 20:09:01 +02:00
6543 2717d7bdad
Add nix flake for dev shell (#30967)
To try it you need **nix** installed `nix-daemon ` running and your user
has to be member of the **nix-users** group. Or use NixOS.

then by just:
```sh
nix develop -c $SHELL
```
a dedicated development environment with all needed packages will be
created.

(cherry picked from commit de6f0488a67ad65bd2ac40356b08a78a365414cd)
2024-05-26 20:08:07 +02:00
Denys Konovalov 07fe5a8b13
use existing oauth grant for public client (#31015)
Do not try to create a new authorization grant when one exists already,
thus preventing a DB-related authorization issue.

Fix https://github.com/go-gitea/gitea/pull/30790#issuecomment-2118812426

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 9c8c9ff6d10b35de8d2d7eae0fc2646ad9bbe94a)
2024-05-26 19:02:48 +02:00
Lunny Xiao 7d7ea45465
Fix automerge will not work because of some events haven't been triggered (#30780)
Replace #25741
Close #24445
Close #30658
Close #20646
~Depends on #30805~

Since #25741 has been rewritten totally, to make the contribution
easier, I will continue the work in this PR. Thanks @6543

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit c6cf96d31d80ab79d370a6192fd761b4443daec2)

Conflicts:
	tests/integration/editor_test.go
	trivial context conflict because of 75ce1e2ac1 [GITEA] Allow user to select email for file operations in Web UI
	tests/integration/pull_merge_test.go
	trivial context conflicts in imports because more tests were added in Forgejo
2024-05-26 19:01:36 +02:00
Kemal Zebari 0e0ab349fb
Don't include link of deleted branch when listing branches (#31028)
From
https://github.com/go-gitea/gitea/issues/31018#issuecomment-2119622680.

This commit removes the link to a deleted branch name because it returns
a 404 while it is in this deleted state. GitHub also throws a 404 when
navigating to a branch link that was just deleted, but this deleted
branch is removed from the branch list after a page refresh. Since with
Gitea this deleted branch would be kept around for quite some time
(well, until the "cleanup deleted branches" cron job begins), it makes
sense to not have this as a link that users can navigate to.

(cherry picked from commit 1007ce764ea80b48120b796175d7d1210cbb6f74)
2024-05-26 18:45:23 +02:00
wxiaoguang 5612cf32e5
Refactor sha1 and time-limited code (#31023)
Remove "EncodeSha1", it shouldn't be used as a general purpose hasher
(just like we have removed "EncodeMD5" in #28622)

Rewrite the "time-limited code" related code and write better tests, the
old code doesn't seem quite right.

(cherry picked from commit fb1ad920b769799aa1287441289d15477d9878c5)

Conflicts:
	modules/git/utils_test.go
	trivial context conflict because sha256 testing in Forgejo has diverged
2024-05-26 18:43:30 +02:00
Zettat123 886a675f62
Return access_denied error when an OAuth2 request is denied (#30974)
According to [RFC
6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1),
when the resource owner or authorization server denied an request, an
`access_denied` error should be returned. But currently in this case
Gitea does not return any error.

For example, if the user clicks "Cancel" here, an `access_denied` error
should be returned.

<img width="360px"
src="https://github.com/go-gitea/gitea/assets/15528715/be31c09b-4c0a-4701-b7a4-f54b8fe3a6c5"
/>

(cherry picked from commit f1d9f18d96050d89a4085c961f572f07b1e653d1)
2024-05-26 18:37:20 +02:00
wxiaoguang f6e50abd65
Fix data-race during testing (#30999)
Fix #30992

(cherry picked from commit 47accfebbd69e5f47d1b97a3e39cf181fab7e597)

Conflicts:
	models/unit/unit.go
	trivial context conflict because of
	e07b0e75ff Add a direct link from repo header to unit settings
2024-05-26 18:28:26 +02:00
wxiaoguang a649610d61
Fix "force private" logic (#31012)
When creating a repo, the "FORCE_PRIVATE" config option should be
respected, `readonly` doesn't work for checkbox, so it should use
`disabled` attribute.

(cherry picked from commit edbf74c418061b013a5855f604dd6be6baf34132)

Conflicts:
	templates/repo/create.tmpl
	templates/repo/migrate/codebase.tmpl
	templates/repo/migrate/git.tmpl
	templates/repo/migrate/gitbucket.tmpl
	templates/repo/migrate/gitea.tmpl
	templates/repo/migrate/github.tmpl
	templates/repo/migrate/gitlab.tmpl
	templates/repo/migrate/gogs.tmpl
	templates/repo/migrate/onedev.tmpl
	already in forgejo fc0c5e80da Fix and improve repo visibility checkbox when FORCE_PRIVATE is on (#3786)
        enforcing FORCE_PRIVATE on repo settings was manually tested
	with a repository of an unprivileged user after setting
	FORCE_PRIVATE = true
2024-05-26 18:20:33 +02:00
GiteaBot 4d30a49031
[skip ci] Updated licenses and gitignores
(cherry picked from commit 82a0c36332824b8ab41efdf6503e86170ce92f08)
2024-05-26 17:59:46 +02:00
Earl Warren f2204d81f1 Merge pull request 'tests(web): verify compressed files are not re-compressed' (#3909) from earl-warren/forgejo:wip-skip-gzip into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3909
Reviewed-by: Victoria <efertone@noreply.codeberg.org>
2024-05-26 11:12:05 +00:00
0ko c3ffa30e7a [I18N] Fixes and improvements to English locale (#3912)
Mostly cap fixes and a few improvements.

As for `activity.active_prs_count_`, it currently looks like this in the UI, I fixed it:
![image](/attachments/5d2dc089-519e-4655-8f8b-f78964ff179a)

Although I'm also the person who [introduced](4c1af0d9a6) the inconsistency.

`send_reset_mail` is a button, removed redundant word from it. It would be good to refactor such keys, but it will be an impossibly long process. Anyway, key refactors are done in separate PRs for easier merges.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3912
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-26 11:06:28 +00:00
Earl Warren 8790ce1890 Merge pull request 'Delete .changelog.yml' (#3913) from 0ko/forgejo:_.changelog.yml into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3913
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-26 10:50:36 +00:00
0ko b4c7cf6099 Delete .changelog.yml 2024-05-26 09:49:38 +05:00
Earl Warren a05eb66c99
tests(web): verify compressed files are not re-compressed
the test file used has a size below the default threshold and will
never be compressed because of that, regardless of its extension. Reduce
the threshold to 10 bytes otherwise the test is a false positive.
2024-05-25 23:54:28 +02:00
Codeberg Translate 0281af75f4 [I18N] Translations update from Weblate (#3851)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: leana8959 <leana8959@users.noreply.translate.codeberg.org>
Co-authored-by: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: Anonymous <anonymous@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: kdh8219 <kdh8219@monamo.dev>
Co-authored-by: emansije <emansije@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: Kaede Fujisaki <ledyba@users.noreply.translate.codeberg.org>
Co-authored-by: NameLessGO <NameLessGO@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3851
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-05-25 18:32:20 +00:00
Earl Warren bd32dedb48 Merge pull request 'fix(services): set SendNotificationEmailOnNewUser' (#3904) from earl-warren/forgejo:wip-new-user-notify into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3904
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-05-25 15:11:16 +00:00
Earl Warren ff2a3f4e3a
fix(services): set SendNotificationEmailOnNewUser
regression from 767e9634d3. It changed
the parsing of the [admin] section from being derived from the content
of each key with mustMapSetting(rootCfg, "admin", &Admin) to
explicitly listing all keys in the code.

SEND_NOTIFICATION_EMAIL_ON_NEW_USER was not added and therefore
ignored. As a consequence notifications of newly registered users were
never sent.
2024-05-25 16:27:44 +02:00
Earl Warren b1e78f0354 Merge pull request 'Update redis Docker tag to v7.2.5' (#3896) from renovate/redis-7.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3896
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-25 08:40:32 +00:00
Earl Warren 3cf92e07df Merge pull request 'Update dependency codespell to v2.3.0' (#3898) from renovate/codespell-2.x-lockfile into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3898
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-25 08:23:55 +00:00
Earl Warren b208b368d8 Merge pull request 'fix(cli): add missing quote in storage help' (#3893) from earl-warren/forgejo:wip-cli-typo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3893
Reviewed-by: Victoria <efertone@noreply.codeberg.org>
2024-05-25 07:46:22 +00:00
Earl Warren 8153dafc73 Merge pull request 'feat(release): fetch OCI alpine images from code.forgejo.org/oci' (#3892) from earl-warren/forgejo:wip-alpine into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3892
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-25 07:45:37 +00:00
Earl Warren c7711dac6d
chore: fix typos identified by mispell 2024-05-25 09:43:50 +02:00
Earl Warren 041932ed01
feat(release): fetch OCI alpine images from code.forgejo.org/oci
Use code.forgejo.org/oci instead of docker.io
so that builds are not subject to rate-limiting when debugging.

The mirrored images are updated daily

https://code.forgejo.org/forgejo/oci-mirror/src/branch/main/.forgejo/workflows/mirror.yml
2024-05-25 08:55:31 +02:00
Earl Warren 8c3c68e613 Merge pull request 'Update code.forgejo.org/oci/alpine Docker tag to v3.20' (#3897) from renovate/code.forgejo.org-oci-alpine-3.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3897
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-25 06:34:06 +00:00
Earl Warren 98be7826a3
chore(dependency): pin redis to 7.2 for testing
There is no need to pin a specific patch version for testing. The
worst that can happen in this context is that the CI fails and it can
be addressed in this context. It will not impact releases.
2024-05-25 08:25:51 +02:00
Earl Warren 534f88dd9a Merge pull request 'Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.58.2' (#3895) from renovate/github.com-golangci-golangci-lint-cmd-golangci-lint-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3895
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-25 06:17:21 +00:00
Renovate Bot 5d5ac041cd Update dependency codespell to v2.3.0 2024-05-25 02:07:08 +00:00
Renovate Bot 3b0501e69f Update code.forgejo.org/oci/alpine Docker tag to v3.20 2024-05-25 02:05:40 +00:00
Renovate Bot 237362ddd3 Update redis Docker tag to v7.2.5 2024-05-25 00:05:17 +00:00
Renovate Bot 5f0380cefb Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.58.2 2024-05-25 00:05:01 +00:00
Earl Warren 84bc4662c2
fix(cli): add missing quote in storage help 2024-05-25 00:32:36 +02:00
0ko b478bfb3cf Merge pull request 'Update dependency @github/text-expander-element to v2.7.0' (#3807) from renovate/github-text-expander-element-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3807
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-05-24 17:34:21 +00:00
0ko da12320a0c Replace imgage diff png background pattern with gradient (#3870)
Made the checkerboard background be more flexible in terms of scale and coloring. Provides dark theme for image diff.

I suppose these colors should not be re-used for a color-picker for a example, because it's usually more convenient to always have it in the light mode.

## Test

* go to e6d3623c7e
* or migrate https://next.forgejo.org/image-test/image-diff to your local instance

## Before/after

![image](/attachments/3835a455-69e0-4aec-bc67-5b226d8016c1)

(Old any - New Forgejo dark - New Gitea dark - New Forgejo/Gitea light)

---

Gradient property is taken from [here](https://www.reddit.com/r/css/comments/u08pf3/how_to_make_a_checkerboard_using_background/).

[CSS compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/conic-gradient#browser_compatibility): about four years of browser versions.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3870
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-05-24 17:33:13 +00:00
silverwind f6c1fd76f2 Fix long branch name overflows (https://github.com/go-gitea/gitea/pull/30345)
Fixes: https://github.com/go-gitea/gitea/issues/27971
Fixes: https://github.com/go-gitea/gitea/pull/28010

<img width="689" alt="Screenshot 2024-04-09 at 00 19 57"
src="https://github.com/go-gitea/gitea/assets/115237/7c895a47-274f-40a6-a126-290658f1982d">

Also fixes a similar issue in issue list where CSS was there but not
active because of missing `display: block`.

<img width="372" alt="Screenshot 2024-04-09 at 00 18 25"
src="https://github.com/go-gitea/gitea/assets/115237/cfbee7cd-2e15-4ac7-96ce-020816f48798">

---
Little conflict in branch_selector_field (repo.pulls.no_results is renamed in Gitea)
And some weird conflict on new CSS rules added.
2024-05-24 22:11:37 +05:00
Earl Warren 509a077ec0 Merge pull request 'mysql: faster user deletion (hook_task query) for mariadb 10' (#3865) from oliverpool/forgejo:join_delete_hook_task into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3865
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-24 12:44:03 +00:00
Earl Warren 5fa2d8f5ca Merge pull request 'Fix expand diff in pull requests being 404 (port of gitea#31013)' (#3885) from algernon/forgejo:gitea/port/31013 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3885
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-24 12:42:19 +00:00
Michael Jerger 9705d42e02 lint 2024-05-24 13:38:43 +02:00