Skip to content

Commit 2b7eb3d

Browse files
authored
Merge branch 'main' into fix-owner-team-accessmode
2 parents 9654b12 + d673a6f commit 2b7eb3d

File tree

262 files changed

+1679
-1022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+1679
-1022
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ ifeq ($(RACE_ENABLED),true)
7777
endif
7878

7979
STORED_VERSION_FILE := VERSION
80+
HUGO_VERSION ?= 0.111.3
8081

8182
ifneq ($(DRONE_TAG),)
8283
VERSION ?= $(subst v,,$(DRONE_TAG))
@@ -817,7 +818,7 @@ release-docs: | $(DIST_DIRS) docs
817818
.PHONY: docs
818819
docs:
819820
@hash hugo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
820-
curl -sL https://github.com/gohugoio/hugo/releases/download/v0.74.3/hugo_0.74.3_Linux-64bit.tar.gz | tar zxf - -C /tmp && mv /tmp/hugo /usr/bin/hugo && chmod +x /usr/bin/hugo; \
821+
curl -sL https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_$(HUGO_VERSION)_Linux-64bit.tar.gz | tar zxf - -C /tmp && mv /tmp/hugo /usr/bin/hugo && chmod +x /usr/bin/hugo; \
821822
fi
822823
cd docs; make trans-copy clean build-offline;
823824

build/backport-locales.go

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
//go:build ignore
2+
3+
package main
4+
5+
import (
6+
"fmt"
7+
"os"
8+
"os/exec"
9+
"path/filepath"
10+
"strings"
11+
12+
"gopkg.in/ini.v1"
13+
)
14+
15+
func main() {
16+
if len(os.Args) != 2 {
17+
println("usage: backport-locales <to-ref>")
18+
println("eg: backport-locales release/v1.19")
19+
os.Exit(1)
20+
}
21+
22+
ini.PrettyFormat = false
23+
mustNoErr := func(err error) {
24+
if err != nil {
25+
panic(err)
26+
}
27+
}
28+
collectInis := func(ref string) map[string]*ini.File {
29+
inis := map[string]*ini.File{}
30+
err := filepath.WalkDir("options/locale", func(path string, d os.DirEntry, err error) error {
31+
if err != nil {
32+
return err
33+
}
34+
if d.IsDir() || !strings.HasSuffix(d.Name(), ".ini") {
35+
return nil
36+
}
37+
cfg, err := ini.LoadSources(ini.LoadOptions{
38+
IgnoreInlineComment: true,
39+
UnescapeValueCommentSymbols: true,
40+
}, path)
41+
mustNoErr(err)
42+
inis[path] = cfg
43+
fmt.Printf("collecting: %s @ %s\n", path, ref)
44+
return nil
45+
})
46+
mustNoErr(err)
47+
return inis
48+
}
49+
50+
// collect new locales from current working directory
51+
inisNew := collectInis("HEAD")
52+
53+
// switch to the target ref, and collect the old locales
54+
cmd := exec.Command("git", "checkout", os.Args[1])
55+
cmd.Stdout = os.Stdout
56+
cmd.Stderr = os.Stderr
57+
mustNoErr(cmd.Run())
58+
inisOld := collectInis(os.Args[1])
59+
60+
// use old en-US as the base, and copy the new translations to the old locales
61+
enUsOld := inisOld["options/locale/locale_en-US.ini"]
62+
for path, iniOld := range inisOld {
63+
if iniOld == enUsOld {
64+
continue
65+
}
66+
iniNew := inisNew[path]
67+
if iniNew == nil {
68+
continue
69+
}
70+
for _, secEnUS := range enUsOld.Sections() {
71+
secOld := iniOld.Section(secEnUS.Name())
72+
secNew := iniNew.Section(secEnUS.Name())
73+
for _, keyEnUs := range secEnUS.Keys() {
74+
if secNew.HasKey(keyEnUs.Name()) {
75+
oldStr := secOld.Key(keyEnUs.Name()).String()
76+
newStr := secNew.Key(keyEnUs.Name()).String()
77+
// A bug: many of new translations with ";" are broken in Crowdin (due to last messy restoring)
78+
// As the broken strings are gradually fixed, this workaround check could be removed (in a few months?)
79+
if strings.Contains(oldStr, ";") && !strings.Contains(newStr, ";") {
80+
println("skip potential broken string", path, secEnUS.Name(), keyEnUs.Name())
81+
continue
82+
}
83+
secOld.Key(keyEnUs.Name()).SetValue(newStr)
84+
}
85+
}
86+
}
87+
mustNoErr(iniOld.SaveTo(path))
88+
}
89+
}

cmd/dump.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ func runDump(ctx *cli.Context) error {
250250

251251
if ctx.IsSet("skip-lfs-data") && ctx.Bool("skip-lfs-data") {
252252
log.Info("Skip dumping LFS data")
253+
} else if !setting.LFS.StartServer {
254+
log.Info("LFS isn't enabled. Skip dumping LFS data")
253255
} else if err := storage.LFS.IterateObjects("", func(objPath string, object storage.Object) error {
254256
info, err := object.Stat()
255257
if err != nil {
@@ -364,6 +366,8 @@ func runDump(ctx *cli.Context) error {
364366

365367
if ctx.IsSet("skip-package-data") && ctx.Bool("skip-package-data") {
366368
log.Info("Skip dumping package data")
369+
} else if !setting.Packages.Enabled {
370+
log.Info("Packages isn't enabled. Skip dumping package data")
367371
} else if err := storage.Packages.IterateObjects("", func(objPath string, object storage.Object) error {
368372
info, err := object.Stat()
369373
if err != nil {

custom/conf/app.example.ini

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -993,10 +993,6 @@ ROUTER = console
993993
;; List of file extensions for which lines should be wrapped in the Monaco editor
994994
;; Separate extensions with a comma. To line wrap files without an extension, just put a comma
995995
;LINE_WRAP_EXTENSIONS = .txt,.md,.markdown,.mdown,.mkd,
996-
;;
997-
;; Valid file modes that have a preview API associated with them, such as api/v1/markdown
998-
;; Separate the values by commas. The preview tab in edit mode won't be displayed if the file extension doesn't match
999-
;PREVIEWABLE_FILE_MODES = markdown
1000996

1001997
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1002998
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ THEME := themes/gitea
22
PUBLIC := public
33
ARCHIVE := https://dl.gitea.com/theme/main.tar.gz
44

5-
HUGO_PACKAGE := github.com/gohugoio/hugo@v0.82.0
5+
HUGO_PACKAGE := github.com/gohugoio/hugo@v0.111.3
66

77
.PHONY: all
88
all: build

docs/config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ params:
2626
repo: "https://github.com/go-gitea/gitea"
2727
docContentPath: "docs/content"
2828

29+
markup:
30+
tableOfContents:
31+
startLevel: 1
32+
endLevel: 9
33+
2934
outputs:
3035
home:
3136
- HTML
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
date: "2016-12-01T16:00:00+02:00"
3+
title: "Administration"
4+
slug: "administration"
5+
weight: 30
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
name: "Administration"
11+
weight: 20
12+
collapse: true
13+
identifier: "administration"
14+
---
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
date: "2017-08-23T09:00:00+02:00"
33
title: "Avancé"
4-
slug: "advanced"
4+
slug: "administration"
55
weight: 30
66
toc: false
77
draft: false
88
menu:
99
sidebar:
1010
name: "Avancé"
11-
weight: 40
12-
identifier: "advanced"
11+
weight: 20
12+
identifier: "administration"
1313
---
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
date: "2016-12-01T16:00:00+02:00"
3+
title: "运维"
4+
slug: "administration"
5+
weight: 30
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
name: "运维"
11+
weight: 20
12+
identifier: "administration"
13+
---
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
date: "2016-12-01T16:00:00+02:00"
3+
title: "運維"
4+
slug: "administration"
5+
weight: 30
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
name: "運維"
11+
weight: 20
12+
identifier: "administration"
13+
---

docs/content/doc/advanced/adding-legal-pages.en-us.md renamed to docs/content/doc/administration/adding-legal-pages.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ toc: false
77
draft: false
88
menu:
99
sidebar:
10-
parent: "advanced"
10+
parent: "administration"
1111
name: "Adding Legal Pages"
1212
identifier: "adding-legal-pages"
13-
weight: 9
13+
weight: 110
1414
---
1515

1616
Some jurisdictions (such as EU), requires certain legal pages (e.g. Privacy Policy) to be added to website. Follow these steps to add them to your Gitea instance.

docs/content/doc/usage/backup-and-restore.en-us.md renamed to docs/content/doc/administration/backup-and-restore.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toc: false
77
draft: false
88
menu:
99
sidebar:
10-
parent: "usage"
10+
parent: "administration"
1111
name: "Backup and Restore"
1212
weight: 11
1313
identifier: "backup-and-restore"

docs/content/doc/usage/backup-and-restore.zh-cn.md renamed to docs/content/doc/administration/backup-and-restore.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toc: false
77
draft: false
88
menu:
99
sidebar:
10-
parent: "usage"
10+
parent: "administration"
1111
name: "备份与恢复"
1212
weight: 11
1313
identifier: "backup-and-restore"

docs/content/doc/usage/backup-and-restore.zh-tw.md renamed to docs/content/doc/administration/backup-and-restore.zh-tw.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toc: false
77
draft: false
88
menu:
99
sidebar:
10-
parent: "usage"
10+
parent: "administration"
1111
name: "備份與還原"
1212
weight: 11
1313
identifier: "backup-and-restore"

docs/content/doc/advanced/cmd-embedded.en-us.md renamed to docs/content/doc/administration/cmd-embedded.en-us.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ toc: false
77
draft: false
88
menu:
99
sidebar:
10-
parent: "advanced"
10+
parent: "administration"
1111
name: "Embedded data extraction tool"
12-
weight: 40
12+
weight: 20
1313
identifier: "cmd-embedded"
1414
---
1515

@@ -21,7 +21,7 @@ menu:
2121

2222
Gitea's executable contains all the resources required to run: templates, images, style-sheets
2323
and translations. Any of them can be overridden by placing a replacement in a matching path
24-
inside the `custom` directory (see [Customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}})).
24+
inside the `custom` directory (see [Customizing Gitea]({{< relref "doc/administration/customizing-gitea.en-us.md" >}})).
2525

2626
To obtain a copy of the embedded resources ready for editing, the `embedded` command from the CLI
2727
can be used from the OS shell interface.
@@ -85,7 +85,7 @@ The default is the current directory.
8585
The `--custom` flag tells Gitea to extract the files directly into the `custom` directory.
8686
For this to work, the command needs to know the location of the `app.ini` configuration
8787
file (`--config`) and, depending of the configuration, be ran from the directory where
88-
Gitea normally starts. See [Customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}}) for details.
88+
Gitea normally starts. See [Customizing Gitea]({{< relref "doc/administration/customizing-gitea.en-us.md" >}}) for details.
8989

9090
The `--overwrite` flag allows any existing files in the destination directory to be overwritten.
9191

docs/content/doc/usage/command-line.en-us.md renamed to docs/content/doc/administration/command-line.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ toc: false
77
draft: false
88
menu:
99
sidebar:
10-
parent: "usage"
10+
parent: "administration"
1111
name: "Command Line"
12-
weight: 10
12+
weight: 1
1313
identifier: "command-line"
1414
---
1515

0 commit comments

Comments
 (0)