Skip to content

Commit 12a9b8a

Browse files
committed
Merge branch 'main' into dev-find-file
2 parents 28951f9 + 23dd0f3 commit 12a9b8a

File tree

187 files changed

+3146
-6491
lines changed

Some content is hidden

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

187 files changed

+3146
-6491
lines changed

.drone.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ steps:
331331
image: gitea/test_env:linux-amd64 # https://gitea.com/gitea/test-env
332332
user: gitea
333333
commands:
334-
- timeout -s ABRT 40m make test-mysql8-migration test-mysql8
334+
- timeout -s ABRT 50m make test-mysql8-migration test-mysql8
335335
environment:
336336
GOPROXY: https://goproxy.io
337337
TAGS: bindata
@@ -469,7 +469,7 @@ steps:
469469
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
470470
user: gitea
471471
commands:
472-
- timeout -s ABRT 40m make test-sqlite-migration test-sqlite
472+
- timeout -s ABRT 50m make test-sqlite-migration test-sqlite
473473
environment:
474474
GOPROXY: https://goproxy.io
475475
TAGS: bindata gogit sqlite sqlite_unlock_notify
@@ -485,7 +485,7 @@ steps:
485485
image: gitea/test_env:linux-arm64 # https://gitea.com/gitea/test-env
486486
user: gitea
487487
commands:
488-
- timeout -s ABRT 40m make test-pgsql-migration test-pgsql
488+
- timeout -s ABRT 50m make test-pgsql-migration test-pgsql
489489
environment:
490490
GOPROXY: https://goproxy.io
491491
TAGS: bindata gogit

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ Leon Hofmeister <[email protected]> (@delvh)
4747
Gusted <[email protected]) (@Gusted)
4848
singuliere <[email protected]> (@singuliere)
4949
silentcode <[email protected]> (@silentcodeg)
50+
Wim <[email protected]> (@42wim)

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -616,27 +616,27 @@ release-windows: | $(DIST_DIRS)
616616
ifeq (,$(findstring gogit,$(TAGS)))
617617
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'netgo osusergo gogit $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION)-gogit .
618618
endif
619-
ifeq ($(CI),drone)
619+
ifeq ($(CI),true)
620620
cp /build/* $(DIST)/binaries
621621
endif
622622

623623
.PHONY: release-linux
624624
release-linux: | $(DIST_DIRS)
625625
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out gitea-$(VERSION) .
626-
ifeq ($(CI),drone)
626+
ifeq ($(CI),true)
627627
cp /build/* $(DIST)/binaries
628628
endif
629629

630630
.PHONY: release-darwin
631631
release-darwin: | $(DIST_DIRS)
632632
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin-10.12/amd64,darwin-10.12/arm64' -out gitea-$(VERSION) .
633-
ifeq ($(CI),drone)
633+
ifeq ($(CI),true)
634634
cp /build/* $(DIST)/binaries
635635
endif
636636

637637
.PHONY: release-copy
638638
release-copy: | $(DIST_DIRS)
639-
cd $(DIST); for file in `find /build -type f -name "*"`; do cp $${file} ./release/; done;
639+
cd $(DIST); for file in `find . -type f -name "*"`; do cp $${file} ./release/; done;
640640

641641
.PHONY: release-check
642642
release-check: | $(DIST_DIRS)
@@ -703,7 +703,6 @@ fomantic:
703703
cd $(FOMANTIC_WORK_DIR) && npm install --no-save
704704
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
705705
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
706-
cp -f web_src/js/vendor/dropdown.js $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/definitions/modules
707706
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
708707
rm -f $(FOMANTIC_WORK_DIR)/build/*.min.*
709708

@@ -762,7 +761,7 @@ generate-gitignore:
762761

763762
.PHONY: generate-images
764763
generate-images: | node_modules
765-
npm install --no-save --no-package-lock fabric@4 imagemin-zopfli@7
764+
npm install --no-save --no-package-lock fabric@5 imagemin-zopfli@7
766765
node build/generate-images.js $(TAGS)
767766

768767
.PHONY: generate-manpage

build/generate-images.js

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1+
#!/usr/bin/env node
12
import imageminZopfli from 'imagemin-zopfli';
23
import {optimize} from 'svgo';
34
import {fabric} from 'fabric';
4-
import fs from 'fs';
5-
import {resolve, dirname} from 'path';
6-
import {fileURLToPath} from 'url';
7-
8-
const {readFile, writeFile} = fs.promises;
9-
const __dirname = dirname(fileURLToPath(import.meta.url));
10-
const logoFile = resolve(__dirname, '../assets/logo.svg');
11-
const faviconFile = resolve(__dirname, '../assets/favicon.svg');
5+
import {readFile, writeFile} from 'fs/promises';
126

137
function exit(err) {
148
if (err) console.error(err);
@@ -23,8 +17,10 @@ function loadSvg(svg) {
2317
});
2418
}
2519

26-
async function generate(svg, outputFile, {size, bg}) {
27-
if (outputFile.endsWith('.svg')) {
20+
async function generate(svg, path, {size, bg}) {
21+
const outputFile = new URL(path, import.meta.url);
22+
23+
if (String(outputFile).endsWith('.svg')) {
2824
const {data} = optimize(svg, {
2925
plugins: [
3026
'preset-default',
@@ -69,19 +65,18 @@ async function generate(svg, outputFile, {size, bg}) {
6965

7066
async function main() {
7167
const gitea = process.argv.slice(2).includes('gitea');
72-
const logoSvg = await readFile(logoFile, 'utf8');
73-
const faviconSvg = await readFile(faviconFile, 'utf8');
68+
const logoSvg = await readFile(new URL('../assets/logo.svg', import.meta.url), 'utf8');
69+
const faviconSvg = await readFile(new URL('../assets/favicon.svg', import.meta.url), 'utf8');
7470

7571
await Promise.all([
76-
generate(logoSvg, resolve(__dirname, '../public/img/logo.svg'), {size: 32}),
77-
generate(logoSvg, resolve(__dirname, '../public/img/logo.png'), {size: 512}),
78-
generate(faviconSvg, resolve(__dirname, '../public/img/favicon.svg'), {size: 32}),
79-
generate(faviconSvg, resolve(__dirname, '../public/img/favicon.png'), {size: 180}),
80-
generate(logoSvg, resolve(__dirname, '../public/img/avatar_default.png'), {size: 200}),
81-
generate(logoSvg, resolve(__dirname, '../public/img/apple-touch-icon.png'), {size: 180, bg: true}),
82-
gitea && generate(logoSvg, resolve(__dirname, '../public/img/gitea.svg'), {size: 32}),
72+
generate(logoSvg, '../public/img/logo.svg', {size: 32}),
73+
generate(logoSvg, '../public/img/logo.png', {size: 512}),
74+
generate(faviconSvg, '../public/img/favicon.svg', {size: 32}),
75+
generate(faviconSvg, '../public/img/favicon.png', {size: 180}),
76+
generate(logoSvg, '../public/img/avatar_default.png', {size: 200}),
77+
generate(logoSvg, '../public/img/apple-touch-icon.png', {size: 180, bg: true}),
78+
gitea && generate(logoSvg, '../public/img/gitea.svg', {size: 32}),
8379
]);
8480
}
8581

8682
main().then(exit).catch(exit);
87-

build/generate-svg.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
#!/usr/bin/env node
12
import fastGlob from 'fast-glob';
23
import {optimize} from 'svgo';
3-
import {resolve, parse, dirname} from 'path';
4-
import fs from 'fs';
4+
import {parse} from 'path';
5+
import {readFile, writeFile, mkdir} from 'fs/promises';
56
import {fileURLToPath} from 'url';
67

7-
const {readFile, writeFile, mkdir} = fs.promises;
8-
const __dirname = dirname(fileURLToPath(import.meta.url));
9-
const glob = (pattern) => fastGlob.sync(pattern, {cwd: resolve(__dirname), absolute: true});
10-
const outputDir = resolve(__dirname, '../public/img/svg');
8+
const glob = (pattern) => fastGlob.sync(pattern, {
9+
cwd: fileURLToPath(new URL('..', import.meta.url)),
10+
absolute: true,
11+
});
1112

1213
function exit(err) {
1314
if (err) console.error(err);
@@ -16,7 +17,6 @@ function exit(err) {
1617

1718
async function processFile(file, {prefix, fullName} = {}) {
1819
let name;
19-
2020
if (fullName) {
2121
name = fullName;
2222
} else {
@@ -35,7 +35,8 @@ async function processFile(file, {prefix, fullName} = {}) {
3535
{name: 'addAttributesToSVGElement', params: {attributes: [{'width': '16'}, {'height': '16'}, {'aria-hidden': 'true'}]}},
3636
],
3737
});
38-
await writeFile(resolve(outputDir, `${name}.svg`), data);
38+
39+
await writeFile(fileURLToPath(new URL(`../public/img/svg/${name}.svg`, import.meta.url)), data);
3940
}
4041

4142
function processFiles(pattern, opts) {
@@ -44,15 +45,14 @@ function processFiles(pattern, opts) {
4445

4546
async function main() {
4647
try {
47-
await mkdir(outputDir);
48+
await mkdir(fileURLToPath(new URL('../public/img/svg', import.meta.url)), {recursive: true});
4849
} catch {}
4950

5051
await Promise.all([
51-
...processFiles('../node_modules/@primer/octicons/build/svg/*-16.svg', {prefix: 'octicon'}),
52-
...processFiles('../web_src/svg/*.svg'),
53-
...processFiles('../public/img/gitea.svg', {fullName: 'gitea-gitea'}),
52+
...processFiles('node_modules/@primer/octicons/build/svg/*-16.svg', {prefix: 'octicon'}),
53+
...processFiles('web_src/svg/*.svg'),
54+
...processFiles('public/img/gitea.svg', {fullName: 'gitea-gitea'}),
5455
]);
5556
}
5657

5758
main().then(exit).catch(exit);
58-

cmd/admin.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
asymkey_model "code.gitea.io/gitea/models/asymkey"
1818
"code.gitea.io/gitea/models/auth"
1919
"code.gitea.io/gitea/models/db"
20+
repo_model "code.gitea.io/gitea/models/repo"
2021
user_model "code.gitea.io/gitea/models/user"
2122
"code.gitea.io/gitea/modules/git"
2223
"code.gitea.io/gitea/modules/graceful"
@@ -722,9 +723,9 @@ func runRepoSyncReleases(_ *cli.Context) error {
722723

723724
log.Trace("Synchronizing repository releases (this may take a while)")
724725
for page := 1; ; page++ {
725-
repos, count, err := models.SearchRepositoryByName(&models.SearchRepoOptions{
726+
repos, count, err := repo_model.SearchRepositoryByName(&repo_model.SearchRepoOptions{
726727
ListOptions: db.ListOptions{
727-
PageSize: models.RepositoryListDefaultPageSize,
728+
PageSize: repo_model.RepositoryListDefaultPageSize,
728729
Page: page,
729730
},
730731
Private: true,

cmd/serv.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"code.gitea.io/gitea/modules/log"
2525
"code.gitea.io/gitea/modules/pprof"
2626
"code.gitea.io/gitea/modules/private"
27+
"code.gitea.io/gitea/modules/process"
2728
repo_module "code.gitea.io/gitea/modules/repository"
2829
"code.gitea.io/gitea/modules/setting"
2930
"code.gitea.io/gitea/services/lfs"
@@ -306,6 +307,7 @@ func runServ(c *cli.Context) error {
306307
}
307308
}
308309

310+
process.SetSysProcAttribute(gitcmd)
309311
gitcmd.Dir = setting.RepoRootPath
310312
gitcmd.Stdout = os.Stdout
311313
gitcmd.Stdin = os.Stdin

custom/conf/app.example.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,9 @@ PATH =
948948
;; List of keywords used in Pull Request comments to automatically reopen a related issue
949949
;REOPEN_KEYWORDS = reopen,reopens,reopened
950950
;;
951+
;; Set default merge style for repository creating, valid options: merge, rebase, rebase-merge, squash
952+
;DEFAULT_MERGE_STYLE = merge
953+
;;
951954
;; In the default merge message for squash commits include at most this many commits
952955
;DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT = 50
953956
;;
@@ -2088,7 +2091,7 @@ PATH =
20882091
;[mirror]
20892092
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20902093
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2091-
;; Enables the mirror functionality. Set to **false** to disable all mirrors.
2094+
;; Enables the mirror functionality. Set to **false** to disable all mirrors. Pre-existing mirrors remain valid but won't be updated; may be converted to regular repo.
20922095
;ENABLED = true
20932096
;; Disable the creation of **new** pull mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`.
20942097
;DISABLE_NEW_PULL = false

docker/root/etc/s6/openssh/setup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ if [ -d /etc/ssh ]; then
4949
SSH_DSA_CERT="${SSH_DSA_CERT:+"HostCertificate "}${SSH_DSA_CERT}" \
5050
SSH_MAX_STARTUPS="${SSH_MAX_STARTUPS:+"MaxStartups "}${SSH_MAX_STARTUPS}" \
5151
SSH_MAX_SESSIONS="${SSH_MAX_SESSIONS:+"MaxSessions "}${SSH_MAX_SESSIONS}" \
52+
SSH_INCLUDE_FILE="${SSH_INCLUDE_FILE:+"Include "}${SSH_INCLUDE_FILE}" \
5253
SSH_LOG_LEVEL=${SSH_LOG_LEVEL:-"INFO"} \
5354
envsubst < /etc/templates/sshd_config > /etc/ssh/sshd_config
5455

docker/root/etc/templates/sshd_config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ Banner none
4141
Subsystem sftp /usr/lib/ssh/sftp-server
4242

4343
AcceptEnv GIT_PROTOCOL
44+
45+
${SSH_INCLUDE_FILE}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
9292
keywords used in Pull Request comments to automatically close a related issue
9393
- `REOPEN_KEYWORDS`: **reopen**, **reopens**, **reopened**: List of keywords used in Pull Request comments to automatically reopen
9494
a related issue
95+
- `DEFAULT_MERGE_STYLE`: **merge**: Set default merge style for repository creating, valid options: `merge`, `rebase`, `rebase-merge`, `squash`
9596
- `DEFAULT_MERGE_MESSAGE_COMMITS_LIMIT`: **50**: In the default merge message for squash commits include at most this many commits. Set to `-1` to include all commits
9697
- `DEFAULT_MERGE_MESSAGE_SIZE`: **5120**: In the default merge message for squash commits limit the size of the commit messages. Set to `-1` to have no limit. Only used if `POPULATE_SQUASH_COMMENT_WITH_COMMIT_MESSAGES` is `true`.
9798
- `DEFAULT_MERGE_MESSAGE_ALL_AUTHORS`: **false**: In the default merge message for squash commits walk all commits to include all authors in the Co-authored-by otherwise just use those in the limited list
@@ -1094,7 +1095,7 @@ Task queue configuration has been moved to `queue.task`. However, the below conf
10941095

10951096
## Mirror (`mirror`)
10961097

1097-
- `ENABLED`: **true**: Enables the mirror functionality. Set to **false** to disable all mirrors.
1098+
- `ENABLED`: **true**: Enables the mirror functionality. Set to **false** to disable all mirrors. Pre-existing mirrors remain valid but won't be updated; may be converted to regular repo.
10981099
- `DISABLE_NEW_PULL`: **false**: Disable the creation of **new** pull mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`.
10991100
- `DISABLE_NEW_PUSH`: **false**: Disable the creation of **new** push mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`.
11001101
- `DEFAULT_INTERVAL`: **8h**: Default interval between each check

0 commit comments

Comments
 (0)