Commit Graph

14252 Commits

Author SHA1 Message Date
Yarden Shoham 67089691bc
Fix 404 error viewing the LFS file (#22945) (#22948)
Backport #22945

Fix #22734.

According to
[`view_file.tmpl`](https://github.com/go-gitea/gitea/blob/main/templates/repo/view_file.tmpl#L82),
`lfs_file.tmpl` should use `AssetUrlPrefix` instead of `AppSubUrl`.

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
2023-02-17 01:18:07 -07:00
zeripath c9908332ed
Fix blame view missing lines (#22826) (#22929)
Backport #22826

Creating a new buffered reader for every part of the blame can miss
lines, as it will read and buffer bytes that the next buffered reader
will not get.

---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-17 01:18:07 -07:00
zeripath 4ec94a6c11
Add command to bulk set must-change-password (#22823) (#22928)
Backport #22823

As part of administration sometimes it is appropriate to forcibly tell
users to update their passwords.

This PR creates a new command `gitea admin user must-change-password`
which will set the `MustChangePassword` flag on the provided users.
---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Jason Song <i@wolfogre.com>
2023-02-17 01:18:07 -07:00
Yarden Shoham af6700152c
fix incorrect role labels for migrated issues and comments (#22914) (#22923)
Backport #22914

Fix #22797.

## Reason
If a comment was migrated from other platforms, this comment may have an
original author and its poster is always not the original author. When
the `roleDescriptor` func get the poster's role descriptor for a
comment, it does not check if the comment has an original author. So the
migrated comments' original authors might be marked as incorrect roles.

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-17 01:18:06 -07:00
Yarden Shoham 26d1650094
Fix PR file tree folders no longer collapsing (#22864) (#22872)
Backport #22864

Collapsing folders currently just throws a console error

```
index.js?v=1.19.0~dev-403-gb6b8feb3d:10 TypeError: this.$set is not a function
    at Proxy.handleClick (index.js?v=1.19.0~dev-403-gb6b8feb3d:58:7159)
    at index.js?v=1.19.0~dev-403-gb6b8feb3d:58:6466
    at index.js?v=1.19.0~dev-403-gb6b8feb3d:10:93922
    at ce (index.js?v=1.19.0~dev-403-gb6b8feb3d:10:1472)
    at Q (index.js?v=1.19.0~dev-403-gb6b8feb3d:10:1567)
    at HTMLDivElement.$e (index.js?v=1.19.0~dev-403-gb6b8feb3d:10:79198)
```

This PR fixes this and allows folders to be collapsed again.

Also:
- better cursor interaction with folders
- added some color to the diff detail stats
- remove green link color from all the file names

Screenshots:

![image](https://user-images.githubusercontent.com/9765622/218269712-2f3dda55-6d70-407f-8d34-2a5d9c8df548.png)

![image](https://user-images.githubusercontent.com/9765622/218269714-6ce8a954-daea-4ed6-9eea-8b2323db4d8f.png)

Co-authored-by: gempir <daniel.pasch.s@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-17 01:18:06 -07:00
Yarden Shoham 40a09dc1bb
escape filename when assemble URL (#22850) (#22871)
Backport #22850

Fixes: #22843 

### Cause:

affdd40296/services/repository/files/content.go (L161)

Previously, we did not escape the **"%"** that might be in "treePath"
when call "url.parse()".


![image](https://user-images.githubusercontent.com/33891828/218066318-5a909e50-2a17-46e6-b32f-684b2aa4b91f.png)

This function will check whether "%" is the beginning of an escape
character. Obviously, the "%" in the example (hello%mother.txt) is not
that. So, the function will return a error.

### Solution:
We can escape "treePath" by call "url.PathEscape()" function firstly.

### Screenshot:

![image](https://user-images.githubusercontent.com/33891828/218069781-1a030f8b-18d0-4804-b0f8-73997849ef43.png)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
Co-authored-by: Andrew Thornton <art27@cantab.net>
2023-02-17 01:18:05 -07:00
Gusted b865d6a4fa
Use proxy for pull mirror (#22771) (#22772)
- Backport #22771
  - Use the proxy (if one is specified) for pull mirrors syncs.
- Pulled the code from
c2774d9e80/modules/git/repo.go (L164-L170)
  - Downstream issue: https://codeberg.org/forgejo/forgejo/issues/302

---------

Co-authored-by: zeripath <art27@cantab.net>
2023-02-17 01:18:01 -07:00
Loïc Dachary e6eb1c752e
Revert [CI] set the platform for cross compilation 2023-02-17 08:09:13 +01:00
Loïc Dachary d5e104fef1
[CI] publish: allow pushing a release to an existing tag
It is necessary to set the tag before uploading to a repository that
does not already have it. But when it does, there is no need. This is
the case for instance in the forgejo integration repository.

It is however best to verify the SHA of the tag is as expected to not
attempt to override a release associated with a different SHA,
presumably from a previous run.
2023-02-17 08:09:05 +01:00
Loïc Dachary 8455b13101 Merge pull request 'Revert "Fixes accessibility of empty repository commit status (#22632)"' (#362) from dachary/forgejo:wip-1.18-a11y into v1.18/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/362
2023-02-13 14:13:25 +00:00
Loïc Dachary 42079960a8
Revert "Fixes accessibility of empty repository commit status (#22632)"
This reverts commit 638e6160e8.

Refs: https://codeberg.org/forgejo/forgejo/issues/361
2023-02-13 14:51:24 +01:00
Loïc Dachary 7da8483b27
Merge branch 'v1.18/forgejo-privacy' into v1.18/forgejo 2023-02-12 00:26:09 +01:00
Loïc Dachary 4fcc358c06
Merge branch 'v1.18/forgejo-branding' into v1.18/forgejo 2023-02-12 00:25:45 +01:00
Loïc Dachary 8f56e699cc
Merge branch 'v1.18/forgejo-a11y' into v1.18/forgejo 2023-02-12 00:24:44 +01:00
Gusted fa5130a663
[BRANDING] Update nodeinfo branding
- Change the values for the nodeinfo API, to use branded values.
- Resolves https://codeberg.org/forgejo/forgejo/issues/257
2023-02-12 00:20:17 +01:00
Earl Warren 0f9842fc58
[BRANDING] define the forgejo webhook type
templates/swagger/v1_json.tmpl updated with `make generate-swagger`
2023-02-12 00:19:58 +01:00
Earl Warren de86c5e6ef
[BRANDING] add X-Forgejo-* headers 2023-02-12 00:19:58 +01:00
Earl Warren b4665b0796
[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>
2023-02-12 00:18:41 +01:00
Gusted ffc2db3d69
[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
2023-02-12 00:18:41 +01:00
TomZ 9c65f0d2ef
[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.
2023-02-12 00:18:41 +01:00
Caesar Schinas fedeadb738
[BRANDING] Rebrand default meta tags 2023-02-12 00:18:40 +01:00
Caesar Schinas 009bb07ad8
[BRANDING] Add Forgejo light, dark, and auto themes 2023-02-12 00:18:40 +01:00
Loïc Dachary 7f4e98d3ab
[BRANDING] container images: set APP_NAME 2023-02-12 00:18:40 +01:00
Caesar Schinas 6372a5b1c1
[BRANDING] Custom loading animation for Forgejo 2023-02-12 00:18:40 +01:00
Caesar Schinas bd7c076623
[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>
2023-02-12 00:18:40 +01:00
Caesar Schinas 00603b03fe
[BRANDING] Add `forgejo` emoji 2023-02-12 00:18:40 +01:00
Caesar Schinas 02890c31f2
[BRANDING] Rebrand footer "powered by" links 2023-02-12 00:18:38 +01:00
Gusted 43e6d3cdf0
[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
2023-02-12 00:18:04 +01:00
Caesar Schinas 04869eb95d
[BRANDING] add Forgejo logo 2023-02-12 00:18:04 +01:00
fnetx 90bb00ef5b
[I18N] Move source locales to other folder 2023-02-12 00:11:35 +01:00
fnetx 75da77f3d7
[I18N] Makefile + gitignore 2023-02-12 00:11:35 +01:00
fnetx 84469b3c5c
[I18N] Add Locale merger script 2023-02-12 00:11:35 +01:00
fnetx eea077bf7e
[I18N] Rename upstream files 2023-02-12 00:11:35 +01:00
wxiaoguang d4610480ee
Add ARIA support for Fomantic UI checkboxes (#22599)
Replace #22593

This is a general approach to add ARIA support for all Fomantic UI
checkboxes (including radioboxes)

* Pros:
* General approach, it works for all Fomantic UI checkboxes / radioboxes
    * No need to write IDs manually everywhere
    * No need to tell new contributors to write IDs again and again

* Cons:
* Slightly affects performance, but it's really trivial, because there
was already a heavy `$('.ui.checkbox').checkbox()` for Fomantic UI
before. So everything is still fine.


Screenshot (from the repo setting page, which has various checkboxes):

<details>


![image](https://user-images.githubusercontent.com/2114189/214480937-3a54d36f-55c3-49de-9c45-c4bb21f1f4c6.png)

</details>
2023-02-12 00:08:43 +01:00
Felipe Leopoldo Sologuren Gutiérrez 6865635369
Fixes accessibility behavior of Watching, Staring and Fork buttons (#22634)
Add tabindex to buttons of repository views.
2023-02-12 00:08:43 +01:00
Felipe Leopoldo Sologuren Gutiérrez e6a557cae3
Add main landmark to templates and adjust titles (#22670)
* Add main aria landmark to templates
 * Adjust some titles to improve understanding of location in navigation

Contributed by @Forgejo
2023-02-12 00:08:43 +01:00
Felipe Leopoldo Sologuren Gutiérrez f016f0fa1e
Improve checkbox accessibility a bit by adding the title attribute (#22593)
EDIT: The main change of this PR was resolved by #22599. This
complements that PR for some cases without label and complicated layout
to be added.

NOTE: Contributed by @Forgejo.
2023-02-12 00:08:43 +01:00
Felipe Leopoldo Sologuren Gutiérrez b0e3382834
Improve accessibility of navigation bar and footer (#22635)
Added ARIA navigation landmark to navigation bar and aria label for both
nav bar and footer.

Contributed by @forgejo.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-12 00:08:42 +01:00
Felipe Leopoldo Sologuren Gutiérrez 638e6160e8
Fixes accessibility of empty repository commit status (#22632)
Avoid empty labelled anchor in repo without commits.

Contributed by @forgejo.

<!--

Please check the following:

1. Make sure you are targeting the `main` branch, pull requests on
release branches are only allowed for bug fixes.
2. Read contributing guidelines:
https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md
3. Describe what your pull request does and which issue you're targeting
(if any)

-->
2023-02-12 00:08:42 +01:00
Gusted e68aaa0c16
[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.
2023-02-11 22:57:55 +01:00
Gusted 6c81fc8f9c
[PRIVACY] Disable `update_checker` cron tasks
- This is being disabled as it will weekly connect to a domain.
- This only affects existing installations, as new installations will
have a explicit value being written into app.ini due to https://github.com/go-gitea/gitea/pull/21655
2023-02-11 22:57:55 +01:00
Loïc Dachary 1184fa36a3
Revert "Use import of OCI structs (#22765) (#22805)"
This reverts commit a239d6c4a9.

Refs: https://codeberg.org/forgejo/forgejo/issues/334
2023-02-11 17:57:13 +01:00
Earl Warren 9a28d844d6
[API] Forgejo API /api/forgejo/v1 2023-02-11 17:34:40 +01:00
Percy Ma 878f54366e
[DOCS] LICENSE: add Forgejo Authors 2023-02-11 17:23:20 +01:00
Loïc Dachary 34a6ee6c93
[DOCS] RELEASE-NOTES.md 2023-02-11 17:23:20 +01:00
Loïc Dachary 61581d1fb9
[WORKFLOW] issues & pr templates 2023-02-11 17:23:20 +01:00
Loïc Dachary ba67f6bb21
[DOCS] README 2023-02-11 17:23:20 +01:00
Loïc Dachary cc3f14c8e1
[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-11 17:23:19 +01:00
Loïc Dachary 5d87dda10d
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.
2023-02-11 17:23:18 +01:00
Loïc Dachary a061e76d34
[CI] the tag SHA in the uploaded repository must match 2023-02-11 17:16:30 +01:00