mirror of
1
Fork 0
Commit Graph

14245 Commits

Author SHA1 Message Date
Loïc Dachary 758cf647cf
Merge remote-tracking branch 'forgejo/v1.18/forgejo-branding' into v1.18/forgejo 2023-02-20 19:56:09 +01:00
Loïc Dachary b63a871ca8
Merge remote-tracking branch 'forgejo/v1.18/forgejo-i18n' into v1.18/forgejo 2023-02-20 19:56:02 +01:00
fnetx 8e80efc771
[I18N] Move source locales to other folder
(cherry picked from commit 90bb00ef5b)
2023-02-20 17:04:00 +01:00
fnetx 9be232ae3a
[I18N] Makefile + gitignore
(cherry picked from commit 75da77f3d7)
2023-02-20 17:03:59 +01:00
fnetx ce880f20b6
[I18N] Add Locale merger script
(cherry picked from commit 84469b3c5c)
2023-02-20 17:03:59 +01:00
fnetx be72ef33e2
[I18N] Rename upstream files
(cherry picked from commit eea077bf7e)
2023-02-20 17:03:59 +01:00
crystal f1f7c119f3
[BRANDING] Change Swagger title to Forgejo API
(cherry picked from commit 79f6a70b53)
2023-02-20 17:00:31 +01:00
Gusted 7eb46fbc6b
[BRANDING] Update nodeinfo branding
- Change the values for the nodeinfo API, to use branded values.
- Resolves https://codeberg.org/forgejo/forgejo/issues/257

(cherry picked from commit fa5130a663)
2023-02-20 16:59:16 +01:00
Earl Warren 0f12ca9222
[BRANDING] define the forgejo webhook type
templates/swagger/v1_json.tmpl updated with `make generate-swagger`

(cherry picked from commit 0f9842fc58)
2023-02-20 16:59:16 +01:00
Earl Warren fd245037ea
[BRANDING] add X-Forgejo-* headers
(cherry picked from commit de86c5e6ef)
2023-02-20 16:59:16 +01:00
Earl Warren b032259089
[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>
(cherry picked from commit b4665b0796)
2023-02-20 16:59:16 +01:00
Gusted 5c4cd14c4f
[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

(cherry picked from commit ffc2db3d69)
2023-02-20 16:59:16 +01:00
TomZ 2b59a90146
[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.

(cherry picked from commit 9c65f0d2ef)
2023-02-20 16:59:16 +01:00
Caesar Schinas 9578a1d83a
[BRANDING] Rebrand default meta tags
(cherry picked from commit fedeadb738)
2023-02-20 16:59:15 +01:00
Caesar Schinas 2716d78a43
[BRANDING] Add Forgejo light, dark, and auto themes
(cherry picked from commit 009bb07ad8)
2023-02-20 16:59:15 +01:00
Loïc Dachary 1d6499c888
[BRANDING] container images: set APP_NAME
(cherry picked from commit 7f4e98d3ab)
2023-02-20 16:59:15 +01:00
Caesar Schinas 97b9024336
[BRANDING] Custom loading animation for Forgejo
(cherry picked from commit 6372a5b1c1)
2023-02-20 16:59:15 +01:00
Caesar Schinas 5f47458a28
[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>
(cherry picked from commit bd7c076623)
2023-02-20 16:59:15 +01:00
Caesar Schinas 9bc830f1b4
[BRANDING] Add `forgejo` emoji
(cherry picked from commit 00603b03fe)
2023-02-20 16:59:15 +01:00
Caesar Schinas 2baac9684e
[BRANDING] Rebrand footer "powered by" links
(cherry picked from commit 02890c31f2)
2023-02-20 16:59:15 +01:00
Gusted 1224b202bf
[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
(cherry picked from commit 43e6d3cdf0)
2023-02-20 16:59:14 +01:00
Caesar Schinas ccf45e7e3f
[BRANDING] add Forgejo logo
(cherry picked from commit 04869eb95d)
2023-02-20 16:59:14 +01:00
Gusted 70cf3e76b8
[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 e68aaa0c16)
2023-02-20 16:38:08 +01:00
Gusted e4061e1010
[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

(cherry picked from commit 6c81fc8f9c)
2023-02-20 16:38:08 +01:00
Earl Warren 82edd2421c
[API] Forgejo API /api/forgejo/v1 2023-02-20 15:09:29 +01:00
Percy Ma af47016bad
[DOCS] LICENSE: add Forgejo Authors
(cherry picked from commit 7c98a4c54e)
2023-02-20 15:05:24 +01:00
Loïc Dachary 75bf53d14f
[DOCS] RELEASE-NOTES.md 2023-02-20 15:05:24 +01:00
Loïc Dachary 6386f9dfc1
[WORKFLOW] issues & pr templates
(cherry picked from commit 9dd224f00c)
2023-02-20 15:05:24 +01:00
Loïc Dachary d18cb242ed
[DOCS] README
(cherry picked from commit a47b474586)
2023-02-20 15:05:24 +01:00
Loïc Dachary f46d4279c7
[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-20 15:05:24 +01:00
Loïc Dachary e772c9bacf
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.

(cherry picked from commit eb85782115)
2023-02-20 15:05:22 +01:00
Loïc Dachary 5cf88a1824
[CI] use test-env:1.18
(cherry picked from commit ae6474ba93)
2023-02-20 13:55:45 +01:00
Loïc Dachary e66cfb6567
[CI] implementation: forgejo container images
(cherry picked from commit e280a94204)
2023-02-20 13:55:44 +01:00
Loïc Dachary 35a0ebbb71
[CI] implementation: Woodpecker based CI 2023-02-20 13:55:44 +01:00
Loïc Dachary abdc1f7e60
[CI] implementation: publish forgejo- binaries instead of gitea-
(cherry picked from commit 3628d16aa3)
2023-02-20 13:49:41 +01:00
Gary Moon ee09afbb4a
Skip GitHub migration tests if the API token is undefined (#21824)
GitHub migration tests will be skipped if the secret for the GitHub API
token hasn't been set.

This change should make all tests pass (or skip in the case of this one)
for anyone running the pipeline on their own infrastructure without
further action on their part.

Resolves https://github.com/go-gitea/gitea/issues/21739

Signed-off-by: Gary Moon <gary@garymoon.net>
(cherry picked from commit af149bd91f)
2023-02-20 13:49:41 +01:00
Lunny Xiao 4c7786b3b6
Add 1.18.4 changelog (#22991)
Feel free to change the content. @go-gitea/maintainers

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-02-20 10:45:07 +08:00
zeripath c702e7995d
Provide the ability to set password hash algorithm parameters (#22942) (#22943)
Backport #22942

This PR refactors and improves the password hashing code within gitea
and makes it possible for server administrators to set the password
hashing parameters

In addition it takes the opportunity to adjust the settings for `pbkdf2`
in order to make the hashing a little stronger.

The majority of this work was inspired by PR #14751 and I would like to
thank @boppy for their work on this.

Thanks to @gusted for the suggestion to adjust the `pbkdf2` hashing
parameters.

Close #14751

---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-19 15:35:52 +08:00
Yarden Shoham b2e58edd74
Notify on container image create (#22806) (#22965)
Backport #22806

Fixes #22791

---------

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-18 21:54:22 +08:00
Yarden Shoham 98b7714c3b
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 15:22:05 +08:00
zeripath 9da4642c8c
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 10:19:24 +08:00
Lunny Xiao 1d191f9b5a
some refactor about code comments(#20821) (#22707)
fix #22691
backport #20821

Co-authored-by: zeripath <art27@cantab.net>
2023-02-16 21:21:25 +08:00
zeripath 2e1afd54b2
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-16 20:33:24 +08:00
Yarden Shoham 9e68261ca7
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-16 11:19:46 +08:00
zeripath e4238583db
Improve trace logging for pulls and processes (#22633) (#22812)
Backport #22633

Our trace logging is far from perfect and is difficult to follow.

This PR:

* Add trace logging for process manager add and remove.
* Fixes an errant read file for git refs in getMergeCommit
* Brings in the pullrequest `String` and `ColorFormat` methods
introduced in #22568
* Adds a lot more logging in to testPR etc.

Ref #22578

---------
Signed-off-by: Andrew Thornton <art27@cantab.net>
2023-02-13 11:17:36 +08:00
Yarden Shoham 656d5a144f
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-12 13:14:19 +02:00
Yarden Shoham 43d1183f67
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-12 09:39:52 +00:00
Gusted 8fa419c4c1
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-11 16:11:54 +08:00
Jason Song 77c89572e9
Fix isAllowed of escapeStreamer (#22814) (#22837)
Backport #22814.

The use of `sort.Search` is wrong: The slice should be sorted, and
`return >= 0` doen't mean it exists, see the
[manual](https://pkg.go.dev/sort#Search).

Could be fixed like this if we really need it:

```diff
diff --git a/modules/charset/escape_stream.go b/modules/charset/escape_stream.go
index 823b63513..fcf1ffbc1 100644
--- a/modules/charset/escape_stream.go
+++ b/modules/charset/escape_stream.go
@@ -20,6 +20,9 @@ import (
 var defaultWordRegexp = regexp.MustCompile(`(-?\d*\.\d\w*)|([^\` + "`" + `\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s\x00-\x1f]+)`)

 func NewEscapeStreamer(locale translation.Locale, next HTMLStreamer, allowed ...rune) HTMLStreamer {
+       sort.Slice(allowed, func(i, j int) bool {
+               return allowed[i] < allowed[j]
+       })
        return &escapeStreamer{
                escaped:                 &EscapeStatus{},
                PassthroughHTMLStreamer: *NewPassthroughStreamer(next),
@@ -284,14 +287,8 @@ func (e *escapeStreamer) runeTypes(runes ...rune) (types []runeType, confusables
 }

 func (e *escapeStreamer) isAllowed(r rune) bool {
-       if len(e.allowed) == 0 {
-               return false
-       }
-       if len(e.allowed) == 1 {
-               return e.allowed[0] == r
-       }
-
-       return sort.Search(len(e.allowed), func(i int) bool {
+       i := sort.Search(len(e.allowed), func(i int) bool {
                return e.allowed[i] >= r
-       }) >= 0
+       })
+       return i < len(e.allowed) && e.allowed[i] == r
 }
```

But I don't think so, a map is better to do it.
2023-02-10 11:36:58 +08:00
John Olheiser 68b908d92a
Load issue before accessing index in merge message (#22822) (#22830)
Backport #22822

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-02-09 16:53:14 -05:00