Skip to content

Commit 4e26e5c

Browse files
committed
Merge branch 'master' into markup
2 parents 2bef1fe + eed88dc commit 4e26e5c

File tree

830 files changed

+55775
-32576
lines changed

Some content is hidden

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

830 files changed

+55775
-32576
lines changed

.drone.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ steps:
277277
- test-mysql
278278
when:
279279
branch:
280-
- master
280+
- main
281281
event:
282282
- push
283283
- pull_request
@@ -294,7 +294,7 @@ steps:
294294
- generate-coverage
295295
when:
296296
branch:
297-
- master
297+
- main
298298
event:
299299
- push
300300
- pull_request
@@ -383,7 +383,7 @@ platform:
383383

384384
trigger:
385385
branch:
386-
- master
386+
- main
387387
event:
388388
- cron
389389
cron:
@@ -443,7 +443,7 @@ platform:
443443

444444
trigger:
445445
branch:
446-
- master
446+
- main
447447
event:
448448
- cron
449449
cron:
@@ -482,7 +482,7 @@ workspace:
482482

483483
trigger:
484484
branch:
485-
- master
485+
- main
486486
- "release/*"
487487
event:
488488
- push
@@ -545,7 +545,7 @@ steps:
545545
event:
546546
- push
547547

548-
- name: release-master
548+
- name: release-main
549549
image: plugins/s3:1
550550
settings:
551551
acl: public-read
@@ -554,15 +554,15 @@ steps:
554554
path_style: true
555555
source: "dist/release/*"
556556
strip_prefix: dist/release/
557-
target: /gitea/master
557+
target: /gitea/main
558558
environment:
559559
AWS_ACCESS_KEY_ID:
560560
from_secret: aws_access_key_id
561561
AWS_SECRET_ACCESS_KEY:
562562
from_secret: aws_secret_access_key
563563
when:
564564
branch:
565-
- master
565+
- main
566566
event:
567567
- push
568568

@@ -683,7 +683,7 @@ steps:
683683
from_secret: netlify_token
684684
when:
685685
branch:
686-
- master
686+
- main
687687
event:
688688
- push
689689

@@ -701,7 +701,7 @@ depends_on:
701701

702702
trigger:
703703
ref:
704-
- refs/heads/master
704+
- refs/heads/main
705705
- "refs/tags/**"
706706
event:
707707
exclude:
@@ -798,7 +798,7 @@ depends_on:
798798

799799
trigger:
800800
ref:
801-
- refs/heads/master
801+
- refs/heads/main
802802
- "refs/tags/**"
803803
event:
804804
exclude:
@@ -886,7 +886,7 @@ steps:
886886

887887
trigger:
888888
ref:
889-
- refs/heads/master
889+
- refs/heads/main
890890
- "refs/tags/**"
891891
event:
892892
exclude:
@@ -909,7 +909,7 @@ clone:
909909

910910
trigger:
911911
branch:
912-
- master
912+
- main
913913
- "release/*"
914914
event:
915915
- push

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ rules:
412412
unicorn/prefer-spread: [0]
413413
unicorn/prefer-starts-ends-with: [2]
414414
unicorn/prefer-string-slice: [0]
415+
unicorn/prefer-switch: [0]
415416
unicorn/prefer-ternary: [0]
416417
unicorn/prefer-text-content: [2]
417418
unicorn/prefer-trim-start-end: [2]

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ RUN addgroup \
5353
-u 1000 \
5454
-G git \
5555
git && \
56-
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
56+
echo "git:*" | chpasswd -e
5757

5858
ENV USER git
5959
ENV GITEA_CUSTOM /data/gitea

Dockerfile.rootless

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ RUN addgroup \
4646
-s /bin/bash \
4747
-u 1000 \
4848
-G git \
49-
git && \
50-
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
49+
git
5150

5251
RUN mkdir -p /var/lib/gitea /etc/gitea
5352
RUN chown git:git /var/lib/gitea /etc/gitea

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ else
7474
ifneq ($(DRONE_BRANCH),)
7575
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
7676
else
77-
VERSION ?= master
77+
VERSION ?= main
7878
endif
7979

8080
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
@@ -210,9 +210,10 @@ git-check:
210210
.PHONY: node-check
211211
node-check:
212212
$(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | cut -c2- | tr '.' ' ');))
213+
$(eval MIN_NODE_VER_FMT := $(shell printf "%g.%g.%g" $(shell echo $(MIN_NODE_VERSION) | grep -o ...)))
213214
$(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1))
214215
@if [ "$(NODE_VERSION)" -lt "$(MIN_NODE_VERSION)" -o "$(NPM_MISSING)" = "1" ]; then \
215-
echo "Gitea requires Node.js 10 or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
216+
echo "Gitea requires Node.js $(MIN_NODE_VER_FMT) or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
216217
exit 1; \
217218
fi
218219

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<p align="center">
22
<a href="https://gitea.io/">
3-
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea.svg" width="220"/>
3+
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/img/gitea.svg" width="220"/>
44
</a>
55
</p>
66
<h1 align="center">Gitea - Git with a cup of tea</h1>
77

88
<p align="center">
99
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
10-
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/master">
10+
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/main">
1111
</a>
1212
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
1313
<img src="https://img.shields.io/discord/322538954119184384.svg">
@@ -16,7 +16,7 @@
1616
<img src="https://images.microbadger.com/badges/image/gitea/gitea.svg">
1717
</a>
1818
<a href="https://codecov.io/gh/go-gitea/gitea" title="Codecov">
19-
<img src="https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg">
19+
<img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
2020
</a>
2121
<a href="https://godoc.org/code.gitea.io/gitea" title="Go Report Card">
2222
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
@@ -150,7 +150,7 @@ We're [working on it](https://github.com/go-gitea/gitea/issues/1029).
150150
## License
151151

152152
This project is licensed under the MIT License.
153-
See the [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) file
153+
See the [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) file
154154
for the full license text.
155155

156156
## Screenshots

README_ZH.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<p align="center">
22
<a href="https://gitea.io/">
3-
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea.svg" width="220"/>
3+
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/img/gitea.svg" width="220"/>
44
</a>
55
</p>
66
<h1 align="center">Gitea - Git with a cup of tea</h1>
77

88
<p align="center">
99
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
10-
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/master">
10+
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/main">
1111
</a>
1212
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
1313
<img src="https://img.shields.io/discord/322538954119184384.svg">
@@ -16,7 +16,7 @@
1616
<img src="https://images.microbadger.com/badges/image/gitea/gitea.svg">
1717
</a>
1818
<a href="https://codecov.io/gh/go-gitea/gitea" title="Codecov">
19-
<img src="https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg">
19+
<img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
2020
</a>
2121
<a href="https://godoc.org/code.gitea.io/gitea" title="Go Report Card">
2222
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
@@ -79,7 +79,7 @@ Fork -> Patch -> Push -> Pull Request
7979

8080
## 授权许可
8181

82-
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) 文件中。
82+
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) 文件中。
8383

8484
## 截图
8585

cmd/admin.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
pwd "code.gitea.io/gitea/modules/password"
2222
repo_module "code.gitea.io/gitea/modules/repository"
2323
"code.gitea.io/gitea/modules/setting"
24+
"code.gitea.io/gitea/modules/storage"
2425

2526
"github.com/urfave/cli"
2627
)
@@ -489,6 +490,10 @@ func runDeleteUser(c *cli.Context) error {
489490
return err
490491
}
491492

493+
if err := storage.Init(); err != nil {
494+
return err
495+
}
496+
492497
var err error
493498
var user *models.User
494499
if c.IsSet("email") {

cmd/web_letsencrypt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func runLetsEncrypt(listenAddr, domain, directory, email string, m http.Handler)
3232
DisableTLSALPNChallenge: !enableTLSALPNChallenge,
3333
})
3434

35-
magic.Issuer = myACME
35+
magic.Issuers = []certmagic.Issuer{myACME}
3636

3737
// this obtains certificates or renews them if necessary
3838
err := magic.ManageSync([]string{domain})

custom/conf/app.example.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,14 @@ RUN_AT_START = false
11451145
NO_SUCCESS_NOTICE = false
11461146
SCHEDULE = @every 72h
11471147

1148+
; Delete all old actions from database
1149+
[cron.delete_old_actions]
1150+
ENABLED = false
1151+
RUN_AT_START = false
1152+
NO_SUCCESS_NOTICE = false
1153+
SCHEDULE = @every 168h
1154+
OLDER_THAN = 8760h
1155+
11481156
[git]
11491157
; The path of git executable. If empty, Gitea searches through the PATH environment.
11501158
PATH =

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
5959
- `MIRROR_QUEUE_LENGTH`: **1000**: Patch test queue length, increase if pull request patch
6060
testing starts hanging.
6161
- `PREFERRED_LICENSES`: **Apache License 2.0,MIT License**: Preferred Licenses to place at
62-
the top of the list. Name must match file name in conf/license or custom/conf/license.
62+
the top of the list. Name must match file name in options/license or custom/options/license.
6363
- `DISABLE_HTTP_GIT`: **false**: Disable the ability to interact with repositories over the
6464
HTTP protocol.
6565
- `USE_COMPAT_SSH_URI`: **false**: Force ssh:// clone url instead of scp-style uri when
@@ -582,7 +582,7 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type
582582
## Session (`session`)
583583

584584
- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, db, mysql, couchbase, memcache, postgres\].
585-
- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for others, the connection string.
585+
- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for db, empty (database config will be used); for others, the connection string.
586586
- `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access.
587587
- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID.
588588
- `GC_INTERVAL_TIME`: **86400**: GC interval in seconds.
@@ -786,6 +786,13 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
786786
- `NO_SUCCESS_NOTICE`: **false**: Set to true to switch off success notices.
787787
- `SCHEDULE`: **@every 72h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`.
788788

789+
#### Cron - Delete all old actions from database ('cron.delete_old_actions')
790+
- `ENABLED`: **false**: Enable service.
791+
- `RUN_AT_START`: **false**: Run tasks at start up time (if ENABLED).
792+
- `NO_SUCCESS_NOTICE`: **false**: Set to true to switch off success notices.
793+
- `SCHEDULE`: **@every 128h**: Cron syntax for scheduling a work, e.g. `@every 128h`.
794+
- `OLDER_THAN`: **@every 8760h**: any action older than this expression will be deleted from database, suggest using `8760h` (1 year) because that's the max length of heatmap.
795+
789796
## Git (`git`)
790797

791798
- `PATH`: **""**: The path of git executable. If empty, Gitea searches through the PATH environment.

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Again `gitea help` will allow you review this variable and you can override it u
3535
`--config` option on the `gitea` binary.
3636

3737
- [Quick Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/)
38-
- [Complete List](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
38+
- [Complete List](https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini)
3939

4040
If the `CustomPath` folder can't be found despite checking `gitea help`, check the `GITEA_CUSTOM`
4141
environment variable; this can be used to override the default path to something else.
@@ -87,14 +87,14 @@ directory at the top of this document).
8787
Every single page of Gitea can be changed. Dynamic content is generated using [go templates](https://golang.org/pkg/html/template/),
8888
which can be modified by placing replacements below the `$GITEA_CUSTOM/templates` directory.
8989

90-
To obtain any embedded file (including templates), the [`gitea embedded` tool]({{< relref "doc/advanced/cmd-embedded.en-us.md" >}}) can be used. Alternatively, they can be found in the [`templates`](https://github.com/go-gitea/gitea/tree/master/templates) directory of Gitea source (Note: the example link is from the `master` branch. Make sure to use templates compatible with the release you are using).
90+
To obtain any embedded file (including templates), the [`gitea embedded` tool]({{< relref "doc/advanced/cmd-embedded.en-us.md" >}}) can be used. Alternatively, they can be found in the [`templates`](https://github.com/go-gitea/gitea/tree/main/templates) directory of Gitea source (Note: the example link is from the `main` branch. Make sure to use templates compatible with the release you are using).
9191

9292
Be aware that any statement contained inside `{{` and `}}` are Gitea's template syntax and
9393
shouldn't be touched without fully understanding these components.
9494

9595
### Customizing startpage / homepage
9696

97-
Copy [`home.tmpl`](https://github.com/go-gitea/gitea/blob/master/templates/home.tmpl) for your version of Gitea from `templates` to `$GITEA_CUSTOM/templates`.
97+
Copy [`home.tmpl`](https://github.com/go-gitea/gitea/blob/main/templates/home.tmpl) for your version of Gitea from `templates` to `$GITEA_CUSTOM/templates`.
9898
Edit as you wish.
9999
Dont forget to restart your gitea to apply the changes.
100100

@@ -113,7 +113,7 @@ For more information, see [Adding Legal Pages](https://docs.gitea.io/en-us/addin
113113
You can add new tabs in the same way, putting them in `extra_tabs.tmpl`.
114114
The exact HTML needed to match the style of other tabs is in the file
115115
`templates/repo/header.tmpl`
116-
([source in GitHub](https://github.com/go-gitea/gitea/blob/master/templates/repo/header.tmpl))
116+
([source in GitHub](https://github.com/go-gitea/gitea/blob/main/templates/repo/header.tmpl))
117117

118118
### Other additions to the page
119119

@@ -258,7 +258,7 @@ Then restart gitea and open a STL file on your gitea instance.
258258

259259
The `$GITEA_CUSTOM/templates/mail` folder allows changing the body of every mail of Gitea.
260260
Templates to override can be found in the
261-
[`templates/mail`](https://github.com/go-gitea/gitea/tree/master/templates/mail)
261+
[`templates/mail`](https://github.com/go-gitea/gitea/tree/main/templates/mail)
262262
directory of Gitea source.
263263
Override by making a copy of the file under `$GITEA_CUSTOM/templates/mail` using a
264264
full path structure matching source.
@@ -282,7 +282,7 @@ To add custom .gitignore, add a file with existing [.gitignore rules](https://gi
282282

283283
### Labels
284284

285-
To add a custom label set, add a file that follows the [label format](https://github.com/go-gitea/gitea/blob/master/options/label/Default) to `$GITEA_CUSTOM/options/label`
285+
To add a custom label set, add a file that follows the [label format](https://github.com/go-gitea/gitea/blob/main/options/label/Default) to `$GITEA_CUSTOM/options/label`
286286
`#hex-color label name ; label description`
287287

288288
### Licenses
@@ -293,7 +293,7 @@ To add a custom license, add a file with the license text to `$GITEA_CUSTOM/opti
293293

294294
Locales are managed via our [crowdin](https://crowdin.com/project/gitea).
295295
You can override a locale by placing an altered locale file in `$GITEA_CUSTOM/options/locale`.
296-
Gitea's default locale files can be found in the [`options/locale`](https://github.com/go-gitea/gitea/tree/master/options/locale) source folder and these should be used as examples for your changes.
296+
Gitea's default locale files can be found in the [`options/locale`](https://github.com/go-gitea/gitea/tree/main/options/locale) source folder and these should be used as examples for your changes.
297297

298298
To add a completely new locale, as well as placing the file in the above location, you will need to add the new lang and name to the `[i18n]` section in your `app.ini`. Keep in mind that Gitea will use those settings as **overrides**, so if you want to keep the other languages as well you will need to copy/paste the default values and add your own to them.
299299

docs/content/doc/advanced/external-renderers.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ IS_INPUT_FILE = true
7070
[markup.restructuredtext]
7171
ENABLED = true
7272
FILE_EXTENSIONS = .rst
73-
RENDER_COMMAND = rst2html.py
73+
RENDER_COMMAND = "timeout 30s pandoc +RTS -M512M -RTS -f rst"
7474
IS_INPUT_FILE = false
7575
```
7676

docs/content/doc/developers/api-usage.en-us.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ API Reference guide is auto-generated by swagger and available on:
7979
or on
8080
[gitea demo instance](https://try.gitea.io/api/swagger)
8181

82+
The OpenAPI document is at:
83+
`https://gitea.your.host/swagger.v1.json`
84+
8285
## Listing your issued tokens via the API
8386

8487
As mentioned in

0 commit comments

Comments
 (0)