61ff91f960
Fix the wrong oauth2 name ( #27993 )
...
Fix #27989
Regression #27798
2023-11-11 11:27:02 +01:00
1c0566f66d
Render email addresses as such if followed by punctuation ( #27987 )
...
Added the following characters to the regular expression for the email:
- ,
- ;
- ?
- !
Also added a test case.
- Fixes #27616
# Before

# After

Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-11-11 05:08:19 +01:00
6c9e196e54
Show error toast when file size exceeds the limits ( #27985 )
...
As title.
Before that, there was no alert at all.
After:

2023-11-10 19:43:18 +08:00
481e738e7f
Remove title
from elements on Org mode ( #27968 )
...
The Org mode rendering has some problems:
1. `[[https://example.com ][pre https://example.com/example.mp4 post]]`
renders as
`<p><a href="https://example.com " title="pre <video
src="https://example.com/example.mp4 "
title="https://example.com/example.mp4 ">https://example.com/example.mp4 </video>
post">pre <video src="https://example.com/example.mp4 "
title="https://example.com/example.mp4 ">https://example.com/example.mp4 </video>
post</a></p>`
As you can see, the `title` attribute contains the inner html in
unescaped form. I removed the `title` attribute because it is of little
value.
3. The `title` attribute on `img` and `video` is of little value.
4. The inner elements of `video` are different depending on the `if`.
2023-11-10 01:45:13 +00:00
603573366a
Add Profile Readme for Organisations ( #27955 )
...
https://blog.gitea.com/release-of-1.20.0/#-user-profile-readme-23260
(#23260 ) did introduce Profile Readme for Users.
This makes it usable for Organisations:

---
*Sponsored by Kithara Software GmbH*
---------
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: KN4CK3R <admin@oldschoolhack.me >
2023-11-09 14:05:52 +00:00
16ba16dbe9
Allow to set explore page default sort ( #27951 )
...
as title
---
*Sponsored by Kithara Software GmbH*
2023-11-09 10:11:45 +00:00
69d98f83f9
Fix format error ( #27963 )
2023-11-08 21:50:20 +08:00
f48a863b99
Fix citation error when the file size is larger than 1024 bytes ( #27958 )
...
Mentioned in:
https://github.com/go-gitea/gitea/pull/27931#issuecomment-1798016960
Same to #25131 , so use the same method to fix this problem.
2023-11-08 06:40:12 +00:00
6447b3e6b2
Use flex-container on user dashboard ( #27956 )
...
Same as https://github.com/go-gitea/gitea/pull/26046 but for user
dashboard, the sidebar got a bit smaller and there is less padding
between sections.
<img width="1265" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/0c8d2faa-03ec-4515-a4f2-0a106ef2a928 ">
2023-11-08 02:30:39 +00:00
8ef169a173
Document REACTION_MAX_USER_NUM setting option ( #27954 )
...
4a0103fa29/modules/setting/ui.go (L24)
4a0103fa29/modules/setting/ui.go (L77)
---
*Sponsored by Kithara Software GmbH*
2023-11-08 01:50:31 +01:00
4a0103fa29
Add word-break to repo description in home page ( #27924 )
...
In #25315 , @denyskon fixed UI on mobile view.
But for the repo description, on desktop view there's no word-break.
So maybe we can just add `gt-word-break` to fix it on both mobile view
and desktop view.
Before:
desktop view:

mobile view:

After:
desktop view:

mobile view(almost same?)

---------
Co-authored-by: silverwind <me@silverwind.io >
2023-11-07 23:52:08 +00:00
2e6af43a06
Remove go versions from .golangci.yml ( #27953 )
...
1. `linter.lang-version` is deprecated in favor of `run.go`
2. `run.go` defaults to the version in `go.mod` as per
[docs](https://golangci-lint.run/usage/configuration/#run-configuration ):
```yaml
# Define the Go version limit.
# Mainly related to generics support since go1.18.
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18
go: '1.19'
```
So in summary, we don't need these versions in the file as long as we
keep the version in go.mod bumped.
2023-11-07 22:03:27 +01:00
10a6ebb3fd
Fix the overflow style for "Hide all checks" ( #27932 )
...
Fix #27928
---------
Co-authored-by: silverwind <me@silverwind.io >
2023-11-07 18:53:35 +00:00
e80f446d3a
Fix rendering assignee changed comments without assignee ( #27927 )
...
When an assignee changed event comment is rendered, most of it is
guarded behind the assignee ID not being 0. However, if it is 0, that
results in quite broken rendering for that comment and the next one.
This can happen, for example, when repository data imported from outside
of Gitea is incomplete.
This PR makes sure comments with an assignee ID of 0 are not rendered at
all.
---
Screenshot before:
<img width="272" alt="Bildschirmfoto 2023-11-05 um 20 12 18"
src="https://github.com/go-gitea/gitea/assets/42910/7d629d76-fee4-4fe5-9e3a-bf524050cead ">
The comments in this screenshot are:
1. A regular text comment
2. A user being unassigned
3. A user being assigned
4. The title of the PR being changed
Comments 2 and 3 are rendered without any text, which indents the next
comment and does not leave enough vertical space.
Co-authored-by: Giteabot <teabot@gitea.io >
2023-11-07 19:45:06 +01:00
3a924fdc83
Add word break to release title ( #27942 )
...
Before:

After:

2023-11-07 10:53:04 +00:00
abd79ddebf
Update JS dependencies ( #27922 )
...
- Update all JS dependencies minus @mcaptcha/vanilla-glue (unsolved
error, see https://github.com/mCaptcha/glue/issues/65 )
- Migrate deprecated eslint rules to `@stylistic/eslint-plugin-js`
- Enable and autofix `@stylistic/js/no-multiple-empty-lines`
- Regenerate poetry.lock with latest poetry
- Tested Mermaid, Swagger, Citation, Vue
2023-11-06 21:14:32 +00:00
c823af26db
Update environment-to-ini flag parsing ( #27914 )
...
This Fixes #27913
This commit updates `environment-to-ini` to be compatible with update
urfave/cli/v2
Doc: <https://cli.urfave.org/v2/examples/combining-short-options/ >
2023-11-06 21:36:58 +01:00
0999721c7b
Add --no-root
to update-py
( #27937 )
...
Missed this command in https://github.com/go-gitea/gitea/pull/27919 .
2023-11-06 15:44:04 +00:00
1e25c15d98
Remove known issue
section in Gitea Actions Doc ( #27930 )
...
The bug has been fixed for several months in the
`docker/build-push-action`
The fix commit is
[d8823bfaed](d8823bfaed
)
as the Gitea Actions Doc mentioned too.
2023-11-06 22:45:37 +08:00
7a2ff6c162
Fix edit topic UI ( #27925 )
...
Before:
desktop view:

mobile view:

after click `Save` btn:


refresh the page, you will see that `gt-m-0` is missing after save
topic:

After:
desktop view:

mobile view:

after click `Save` btn:

2023-11-06 09:23:50 +00:00
4f4fea734c
Unify two factor check ( #27915 )
...
Fixes #27819
We have support for two factor logins with the normal web login and with
basic auth. For basic auth the two factor check was implemented at three
different places and you need to know that this check is necessary. This
PR moves the check into the basic auth itself.
2023-11-06 08:22:39 +00:00
8557a9455b
Revert #27870 ( #27917 )
...
Now that we have #27798 we don't need the check from #27870 anymore.
With the check it's not possible to remove an inactive auth source from
the user.
2023-11-06 06:09:34 +00:00
1f501dae9e
Fix JS NPE when viewing specific range of PR commits ( #27912 )
...
This should be the easiest fix.
While other solutions might be possible that exterminate the root cause,
they will not be as trivial.
2023-11-06 02:05:24 +00:00
1ccdb546f0
Install poetry dependencies with --no-root ( #27919 )
...
Poetry 1.7.0 or higher will print a warning otherwise, see discussions:
https://github.com/python-poetry/poetry/pull/8369
https://github.com/python-poetry/poetry/issues/1132
> --no-root Do not install the root package (the current project).
2023-11-06 00:11:34 +00:00
37a7c551d4
Show correct commit sha when viewing single commit diff ( #27916 )
...
Show the correct sha when viewing a single commit.

2023-11-06 00:39:32 +01:00
966dcb99e3
Fix 500 when deleting a dismissed review ( #27903 )
...
Fix #27767
Add a test to ensure its behavior
2023-11-05 13:25:40 +00:00
59f9ef9fee
Remove action runners on user deletion ( #27902 )
...
- On user deletion, delete action runners that the user has created.
- Add a database consistency check to remove action runners that have
nonexistent belonging owner.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1720
(cherry picked from commit 009ca7223dab054f7f760b7ccae69e745eebfabb)
Co-authored-by: Gusted <postmaster@gusted.xyz >
2023-11-05 13:48:32 +01:00
da0c4b8d10
Remove SSH workaround ( #27893 )
...
Revert the workaround of #26409 and fix #26411 , update github.com/gliderlabs/ssh to include 02f9d57300
2023-11-03 15:21:05 +00:00
c46080bc9d
Remove "tabindex" from some form buttons ( #27892 )
...
Remove the "tabindex" from some form buttons on the "diff box" / "issue view content" page, let the browser use the default tab order.
---------
Co-authored-by: Gusted <postmaster@gusted.xyz >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-11-03 14:40:48 +00:00
d1dc9cb334
Refactor the function RemoveOrgUser ( #27582 )
...
This PR is a small refactor to merge removeOrgUser into RemoveOrgUser.
2023-11-03 14:01:45 +00:00
ae396ac7c0
Fix DownloadFunc when migrating releases ( #27887 )
...
We should not use `asset.ID` in DownloadFunc because DownloadFunc is a
closure.
1bf5527eac/services/migrations/gitea_downloader.go (L284-L295)
A similar bug when migrating from GitHub has been fixed in #14703 . This
PR fixes the bug when migrating from Gitea and GitLab.
2023-11-03 15:56:53 +08:00
1bf5527eac
Refactor Find Sources and fix bug when view a user who belongs to an unactive auth source ( #27798 )
...
The steps to reproduce it.
First, create a new oauth2 source.
Then, a user login with this oauth2 source.
Disable the oauth2 source.
Visit users -> settings -> security, 500 will be displayed.
This is because this page only load active Oauth2 sources but not all
Oauth2 sources.
2023-11-03 01:41:00 +00:00
80715ae5c7
[skip ci] Updated translations via Crowdin
2023-11-03 00:23:16 +00:00
dcb648ee71
Add Hide/Show all checks
button to commit status check ( #26284 )
...
Step one for a GitHub like commit status check ui:



Step two:


The design now will list all commit status checks which takes too much
space.
This is a pre-improve for #26247
---------
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-11-02 14:49:02 +00:00
0ba4ecc3bd
Fix http protocol auth ( #27875 )
2023-11-02 22:14:33 +08:00
4776fde9e1
Display issue task list on project cards ( #27865 )
...
Display the issue task list on project cards.

Co-authored-by: Giteabot <teabot@gitea.io >
2023-11-02 11:42:02 +01:00
dc52f26d46
Reduce margin/padding on flex-list items and divider ( #27872 )
...
Small CSS tweak, reduces margin/padding from 14px to 10px, which I think
looks better
2023-11-02 12:30:38 +08:00
e378545f30
Filter inactive auth sources ( #27870 )
...
Fix nil access for inactive auth sources.
> Render failed, failed to render template:
user/settings/security/security, error: template error:
builtin(static):user/settings/security/accountlinks:32:20 : executing
"user/settings/security/accountlinks" at <$providerData.IconHTML>: nil
pointer evaluating oauth2.Provider.IconHTML
Code tries to access the auth source of an `ExternalLoginUser` but the
list contains only the active auth sources.
2023-11-02 01:46:26 +02:00
9b6e77c489
refactor postgres connection string building ( #27723 )
...
This patchset changes the connection string builder to use net.URL and
the host/port parser to use the stdlib function for splitting host from
port. It also adds a footnote about a potentially required portnumber
for postgres UNIX sockets.
Fixes : #24552
2023-11-01 18:00:20 +00:00
665d12cf84
doc: actions/act-runner: document running as a systemd service ( #27844 )
...
This documents running `act-runner` as a systemd service under a
dedicated user account.
2023-11-01 23:14:40 +08:00
d519a39302
Support storage base path as prefix ( #27827 )
...
This PR adds a prefix path for all minio storage and override base path
will override the path.
The previous behavior is undefined officially, so it will be marked as
breaking.
2023-11-01 19:17:18 +08:00
a4b242ae7a
Clean up template locale usage ( #27856 )
...
After many refactoring PRs for the "locale" and "template context
function", now the ".locale" is not needed for web templates any more.
This PR does a clean up for:
1. Remove `ctx.Data["locale"]` for web context.
2. Use `ctx.Locale` in `500.tmpl`, for consistency.
3. Add a test check for `500 page` locale usage.
4. Remove the `Str2html` and `DotEscape` from mail template context
data, they are copy&paste errors introduced by #19169 and #16200 . These
functions are template functions (provided by the common renderer), but
not template data variables.
5. Make email `SendAsync` function mockable (I was planning to add more
tests but it would make this PR much too complex, so the tests could be
done in another PR)
2023-10-31 22:11:48 +08:00
16d15ce087
Fix package webhook ( #27839 )
...
Fix #23742
---------
Co-authored-by: KN4CK3R <admin@oldschoolhack.me >
2023-10-31 04:43:38 +00:00
9106514e51
Add user secrets API integration tests ( #27832 )
...
Adds the missing user secrets API integration tests so #27829 does not
happen again
2023-10-31 11:46:09 +08:00
6ca234a356
Fix wrong relative path on obtain token from command line ( #27850 )
...
Caused by #27845
2023-10-30 23:31:09 -04:00
a18ecaed61
doc: actions/act-runner: document obtaining a runner registration token from gitea CLI ( #27845 )
2023-10-30 19:28:02 -04:00
ec0c6829d4
Fix/upload artifact error windows ( #27802 )
...
From issue https://github.com/go-gitea/gitea/issues/27314
When act_runner in `host` mode on Windows. `upload_artifact@v3` actions
use `path.join` to generate `itemPath` params when uploading artifact
chunk. `itemPath` is encoded as `${artifact_name}\${artifact_path}`.
<del>It's twice query escaped from ${artifact_name}/${artifact_path}
that joined by Windows slash \.</del>
**So we need convert Windows slash to linux**.
In https://github.com/go-gitea/gitea/issues/27314 , runner shows logs
from `upload_artifact@v3` like with `%255C`:
```
[artifact-cases/test-artifact-cases] | ::error::Unexpected response. Unable to upload chunk to http://192.168.31.230:3000/api/actions_pipeline/_apis/pipelines/workflows/6/artifacts/34d628a422db9367c869d3fb36be81f5/upload?itemPath=more-files%255Css.json
```
But in gitea server at the same time, But shows `%5C`
```
2023/10/27 19:29:51 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /api/actions_pipeline/_apis/pipelines/workflows/6/artifacts/34d628a422db9367c869d3fb36be81f5/upload?itemPath=more-files%5Css.json for 192.168.31.230:55340, 400 Bad Request in 17.6ms @ <autogenerated>:1(actions.artifactRoutes.uploadArtifact-fm)
```
I found `%255C` is escaped by
`https://github.com/actions/upload-artifact/blob/main/dist/index.js#L2329 `.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-10-30 10:40:05 +00:00
e5f19dd317
Always use whole user name as link ( #27815 )
...
Starting from #25790 this shared template only linked the username of
the user if both display name and username were shown. I experienced
myself always trying to click on the display name - I think it is
annoying for others too.
After:


2023-10-30 09:53:16 +00:00
0e021cd33e
Fix display member unit in the menu bar if there are no hidden members in public org ( #27795 )
...
Follow #26363 .
I missed that org templates also using
`templates/user/overview/header.tmpl`.
You can confirm this problem in https://gitea.com/gitea/-/projects with
anonymous access.
Before: (no login)

After:

2023-10-30 09:11:16 +00:00
c8602a8dfa
Add Index to pull_auto_merge.doer_id ( #27811 )
...
Reported at https://codeberg.org/forgejo/forgejo/issues/1677
This column is used by
[deleteUser](f089be91da/services/user/delete.go (L90)
).
Note: This PR contains a Migration, so we can't backport it to 1.21.
2023-10-30 08:39:29 +00:00