Skip to content

Commit e8c6878

Browse files
committed
Merge branch 'main' into scoped-label-display
2 parents f25778c + 5c4075e commit e8c6878

File tree

157 files changed

+4287
-3767
lines changed

Some content is hidden

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

157 files changed

+4287
-3767
lines changed

.drone.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,9 @@ trigger:
10061006
event:
10071007
exclude:
10081008
- cron
1009+
paths:
1010+
exclude:
1011+
- docs/**
10091012

10101013
steps:
10111014
- name: fetch-tags
@@ -1070,6 +1073,9 @@ trigger:
10701073
event:
10711074
exclude:
10721075
- cron
1076+
paths:
1077+
exclude:
1078+
- docs/**
10731079

10741080
steps:
10751081
- name: fetch-tags
@@ -1298,6 +1304,9 @@ trigger:
12981304
event:
12991305
exclude:
13001306
- cron
1307+
paths:
1308+
exclude:
1309+
- docs/**
13011310

13021311
steps:
13031312
- name: fetch-tags
@@ -1362,6 +1371,9 @@ trigger:
13621371
event:
13631372
exclude:
13641373
- cron
1374+
paths:
1375+
exclude:
1376+
- docs/**
13651377

13661378
steps:
13671379
- name: fetch-tags
@@ -1424,6 +1436,9 @@ trigger:
14241436
event:
14251437
exclude:
14261438
- cron
1439+
paths:
1440+
exclude:
1441+
- docs/**
14271442

14281443
steps:
14291444
- name: fetch-tags
@@ -1571,6 +1586,9 @@ trigger:
15711586
event:
15721587
exclude:
15731588
- cron
1589+
paths:
1590+
exclude:
1591+
- docs/**
15741592

15751593
depends_on:
15761594
- docker-linux-amd64-release-version
@@ -1619,6 +1637,9 @@ trigger:
16191637
event:
16201638
exclude:
16211639
- cron
1640+
paths:
1641+
exclude:
1642+
- docs/**
16221643

16231644
depends_on:
16241645
- docker-linux-amd64-release

.gitpod.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ tasks:
1010
- name: Run backend
1111
command: |
1212
gp sync-await setup
13-
mkdir -p custom/conf/
14-
echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini
15-
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
13+
if [ ! -f custom/conf/app.ini ]
14+
then
15+
mkdir -p custom/conf/
16+
echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini
17+
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
18+
fi
1619
export TAGS="sqlite sqlite_unlock_notify"
1720
make watch-backend
1821
- name: Run frontend

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Steven Kriegler <[email protected]> (@justusbunsi)
4444
Jimmy Praet <[email protected]> (@jpraet)
4545
Leon Hofmeister <[email protected]> (@delvh)
4646
Wim <[email protected]> (@42wim)
47-
Xinyu Zhou <[email protected]> (@xin-u)
4847
Jason Song <[email protected]> (@wolfogre)
4948
Yarden Shoham <[email protected]> (@yardenshoham)
5049
Yu Tian <[email protected]> (@Zettat123)

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,8 @@ fomantic:
859859
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
860860
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
861861
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
862+
# fomantic uses "touchstart" as click event for some browsers, it's not ideal, so we force fomantic to always use "click" as click event
863+
$(SED_INPLACE) -e 's/clickEvent[ \t]*=/clickEvent = "click", unstableClickEvent =/g' $(FOMANTIC_WORK_DIR)/build/semantic.js
862864
$(SED_INPLACE) -e 's/\r//g' $(FOMANTIC_WORK_DIR)/build/semantic.css $(FOMANTIC_WORK_DIR)/build/semantic.js
863865
rm -f $(FOMANTIC_WORK_DIR)/build/*.min.*
864866

build/update-locales.sh

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,49 @@
1-
#!/bin/sh
1+
#!/bin/bash
2+
3+
set -e
4+
5+
SED=sed
6+
7+
if [[ $OSTYPE == 'darwin'* ]]; then
8+
# for macOS developers, use "brew install gnu-sed"
9+
SED=gsed
10+
fi
11+
12+
if [ ! -f ./options/locale/locale_en-US.ini ]; then
13+
echo "please run this script in the root directory of the project"
14+
exit 1
15+
fi
216

317
mv ./options/locale/locale_en-US.ini ./options/
418

5-
# Make sure to only change lines that have the translation enclosed between quotes
6-
sed -i -r -e '/^[a-zA-Z0-9_.-]+[ ]*=[ ]*".*"$/ {
7-
s/^([a-zA-Z0-9_.-]+)[ ]*="/\1=/
8-
s/\\"/"/g
19+
# the "ini" library for locale has many quirks
20+
# * `a="xx"` gets `xx` (no quote)
21+
# * `a=x\"y` gets `x\"y` (no unescaping)
22+
# * `a="x\"y"` gets `"x\"y"` (no unescaping, the quotes are still there)
23+
# * `a='x\"y'` gets `x\"y` (no unescaping, no quote)
24+
# * `a="foo` gets `"foo` (although the quote is not closed)
25+
# * 'a=`foo`' works like single-quote
26+
# crowdin needs the strings to be quoted correctly and doesn't like incomplete quotes
27+
# crowdin always outputs quoted strings if there are quotes in the strings.
28+
29+
# this script helps to unquote the crowdin outputs for the quirky ini library
30+
# * find all `key="...\"..."` lines
31+
# * remove the leading quote
32+
# * remove the trailing quote
33+
# * unescape the quotes
34+
# * eg: key="...\"..." => key=..."...
35+
$SED -i -r -e '/^[-.A-Za-z0-9_]+[ ]*=[ ]*".*"$/ {
36+
s/^([-.A-Za-z0-9_]+)[ ]*=[ ]*"/\1=/
937
s/"$//
38+
s/\\"/"/g
1039
}' ./options/locale/*.ini
1140

41+
# * if the escaped line is incomplete like `key="...` or `key=..."`, quote it with backticks
42+
# * eg: key="... => key=`"...`
43+
# * eg: key=..." => key=`..."`
44+
$SED -i -r -e 's/^([-.A-Za-z0-9_]+)[ ]*=[ ]*(".*[^"])$/\1=`\2`/' ./options/locale/*.ini
45+
$SED -i -r -e 's/^([-.A-Za-z0-9_]+)[ ]*=[ ]*([^"].*")$/\1=`\2`/' ./options/locale/*.ini
46+
1247
# Remove translation under 25% of en_us
1348
baselines=$(wc -l "./options/locale_en-US.ini" | cut -d" " -f1)
1449
baselines=$((baselines / 4))

cmd/dump.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ func runDump(ctx *cli.Context) error {
272272
fatal("Failed to create tmp file: %v", err)
273273
}
274274
defer func() {
275+
_ = dbDump.Close()
275276
if err := util.Remove(dbDump.Name()); err != nil {
276277
log.Warn("Unable to remove temporary file: %s: Error: %v", dbDump.Name(), err)
277278
}

cmd/serv.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"net/url"
1212
"os"
1313
"os/exec"
14+
"path/filepath"
1415
"regexp"
1516
"strconv"
1617
"strings"
@@ -290,17 +291,21 @@ func runServ(c *cli.Context) error {
290291
return nil
291292
}
292293

293-
// Special handle for Windows.
294-
if setting.IsWindows {
295-
verb = strings.Replace(verb, "-", " ", 1)
296-
}
297-
298294
var gitcmd *exec.Cmd
299-
verbs := strings.Split(verb, " ")
300-
if len(verbs) == 2 {
301-
gitcmd = exec.CommandContext(ctx, verbs[0], verbs[1], repoPath)
302-
} else {
303-
gitcmd = exec.CommandContext(ctx, verb, repoPath)
295+
gitBinPath := filepath.Dir(git.GitExecutable) // e.g. /usr/bin
296+
gitBinVerb := filepath.Join(gitBinPath, verb) // e.g. /usr/bin/git-upload-pack
297+
if _, err := os.Stat(gitBinVerb); err != nil {
298+
// if the command "git-upload-pack" doesn't exist, try to split "git-upload-pack" to use the sub-command with git
299+
// ps: Windows only has "git.exe" in the bin path, so Windows always uses this way
300+
verbFields := strings.SplitN(verb, "-", 2)
301+
if len(verbFields) == 2 {
302+
// use git binary with the sub-command part: "C:\...\bin\git.exe", "upload-pack", ...
303+
gitcmd = exec.CommandContext(ctx, git.GitExecutable, verbFields[1], repoPath)
304+
}
305+
}
306+
if gitcmd == nil {
307+
// by default, use the verb (it has been checked above by allowedCommands)
308+
gitcmd = exec.CommandContext(ctx, gitBinVerb, repoPath)
304309
}
305310

306311
process.SetSysProcAttribute(gitcmd)

custom/conf/app.example.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,9 @@ ROUTER = console
18711871
;;
18721872
;; Minio enabled ssl only available when STORAGE_TYPE is `minio`
18731873
;MINIO_USE_SSL = false
1874+
;;
1875+
;; Minio skip SSL verification available when STORAGE_TYPE is `minio`
1876+
;MINIO_INSECURE_SKIP_VERIFY = false
18741877

18751878
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
18761879
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2552,6 +2555,9 @@ ROUTER = console
25522555
;;
25532556
;; Minio enabled ssl only available when STORAGE_TYPE is `minio`
25542557
;MINIO_USE_SSL = false
2558+
;;
2559+
;; Minio skip SSL verification available when STORAGE_TYPE is `minio`
2560+
;MINIO_INSECURE_SKIP_VERIFY = false
25552561

25562562
;[proxy]
25572563
;; Enable the proxy, all requests to external via HTTP will be affected

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ Default templates for project boards:
854854
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when STORAGE_TYPE is `minio`
855855
- `MINIO_BASE_PATH`: **attachments/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio`
856856
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when STORAGE_TYPE is `minio`
857+
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
857858

858859
## Log (`log`)
859860

@@ -1268,6 +1269,7 @@ is `data/lfs` and the default of `MINIO_BASE_PATH` is `lfs/`.
12681269
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio`
12691270
- `MINIO_BASE_PATH`: **lfs/**: Minio base path on the bucket only available when `STORAGE_TYPE` is `minio`
12701271
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
1272+
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
12711273

12721274
## Storage (`storage`)
12731275

@@ -1280,6 +1282,7 @@ Default storage configuration for attachments, lfs, avatars and etc.
12801282
- `MINIO_BUCKET`: **gitea**: Minio bucket to store the data only available when `STORAGE_TYPE` is `minio`
12811283
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio`
12821284
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
1285+
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
12831286

12841287
And you can also define a customize storage like below:
12851288

@@ -1298,6 +1301,8 @@ MINIO_BUCKET = gitea
12981301
MINIO_LOCATION = us-east-1
12991302
; Minio enabled ssl only available when STORAGE_TYPE is `minio`
13001303
MINIO_USE_SSL = false
1304+
; Minio skip SSL verification available when STORAGE_TYPE is `minio`
1305+
MINIO_INSECURE_SKIP_VERIFY = false
13011306
```
13021307

13031308
And used by `[attachment]`, `[lfs]` and etc. as `STORAGE_TYPE`.
@@ -1318,6 +1323,7 @@ is `data/repo-archive` and the default of `MINIO_BASE_PATH` is `repo-archive/`.
13181323
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio`
13191324
- `MINIO_BASE_PATH`: **repo-archive/**: Minio base path on the bucket only available when `STORAGE_TYPE` is `minio`
13201325
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
1326+
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
13211327

13221328
## Proxy (`proxy`)
13231329

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@ MINIO_BUCKET = gitea
431431
MINIO_LOCATION = us-east-1
432432
; Minio enabled ssl only available when STORAGE_TYPE is `minio`
433433
MINIO_USE_SSL = false
434+
; Minio skip SSL verification available when STORAGE_TYPE is `minio`
435+
MINIO_INSECURE_SKIP_VERIFY = false
434436
```
435437

436438
然后你在 `[attachment]`, `[lfs]` 等中可以把这个名字用作 `STORAGE_TYPE` 的值。

docs/content/doc/developers/guidelines-frontend.en-us.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ It's not recommended to use `async` event listeners, which may lead to problems.
8383
The reason is that the code after await is executed outside the event dispatch.
8484
Reference: https://github.com/github/eslint-plugin-github/blob/main/docs/rules/async-preventdefault.md
8585

86+
If an event listener must be `async`, the `e.preventDefault()` should be before any `await`,
87+
it's recommended to put it at the beginning of the function.
88+
8689
If we want to call an `async` function in a non-async context,
8790
it's recommended to use `const _promise = asyncFoo()` to tell readers
8891
that this is done by purpose, we want to call the async function and ignore the Promise.

models/actions/run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWork
192192
if len(needs) > 0 || run.NeedApproval {
193193
status = StatusBlocked
194194
}
195+
job.Name, _ = util.SplitStringAtByteN(job.Name, 255)
195196
runJobs = append(runJobs, &ActionRunJob{
196197
RunID: run.ID,
197198
RepoID: run.RepoID,

models/actions/task.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,9 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
298298
if len(workflowJob.Steps) > 0 {
299299
steps := make([]*ActionTaskStep, len(workflowJob.Steps))
300300
for i, v := range workflowJob.Steps {
301+
name, _ := util.SplitStringAtByteN(v.String(), 255)
301302
steps[i] = &ActionTaskStep{
302-
Name: v.String(),
303+
Name: name,
303304
TaskID: task.ID,
304305
Index: int64(i),
305306
RepoID: task.RepoID,

models/fixtures/repository.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
fork_id: 0
2626
is_template: false
2727
template_id: 0
28-
size: 6708
28+
size: 7028
2929
is_fsck_enabled: true
3030
close_issues_via_commit_in_any_branch: false
3131

0 commit comments

Comments
 (0)