Skip to content

Commit 1e85ffa

Browse files
authored
Merge branch 'master' into ssh-passthrough-docker
2 parents 22a4106 + bc455ed commit 1e85ffa

File tree

150 files changed

+3914
-6947
lines changed

Some content is hidden

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

150 files changed

+3914
-6947
lines changed

.drone.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ steps:
1818
- make node_modules
1919

2020
- name: lint-frontend
21-
pull: always
2221
image: node:14
2322
commands:
2423
- make lint-frontend
@@ -35,7 +34,6 @@ steps:
3534
TAGS: bindata sqlite sqlite_unlock_notify
3635

3736
- name: checks-frontend
38-
pull: always
3937
image: node:14
4038
commands:
4139
- make checks-frontend
@@ -49,7 +47,6 @@ steps:
4947
depends_on: [lint-backend]
5048

5149
- name: build-frontend
52-
pull: always
5350
image: node:14
5451
commands:
5552
- make frontend
@@ -66,7 +63,6 @@ steps:
6663
depends_on: [checks-backend]
6764

6865
- name: build-backend-arm64
69-
pull: always
7066
image: golang:1.15
7167
environment:
7268
GO111MODULE: on
@@ -80,7 +76,6 @@ steps:
8076
depends_on: [checks-backend]
8177

8278
- name: build-backend-386
83-
pull: always
8479
image: golang:1.15
8580
environment:
8681
GO111MODULE: on
@@ -108,33 +103,28 @@ workspace:
108103

109104
services:
110105
- name: mysql
111-
pull: default
112106
image: mysql:5.7
113107
environment:
114108
MYSQL_ALLOW_EMPTY_PASSWORD: yes
115109
MYSQL_DATABASE: test
116110

117111
- name: mysql8
118-
pull: default
119112
image: mysql:8.0
120113
environment:
121114
MYSQL_ALLOW_EMPTY_PASSWORD: yes
122115
MYSQL_DATABASE: testgitea
123116

124117
- name: mssql
125-
pull: default
126118
image: mcr.microsoft.com/mssql/server:latest
127119
environment:
128120
ACCEPT_EULA: Y
129121
MSSQL_PID: Standard
130122
SA_PASSWORD: MwantsaSecurePassword1
131123

132124
- name: ldap
133-
pull: default
134125
image: gitea/test-openldap:latest
135126

136127
- name: elasticsearch
137-
pull: default
138128
environment:
139129
discovery.type: single-node
140130
image: elasticsearch:7.5.0
@@ -149,7 +139,6 @@ services:
149139

150140
steps:
151141
- name: fetch-tags
152-
pull: default
153142
image: docker:git
154143
commands:
155144
- git fetch --tags --force
@@ -175,7 +164,6 @@ steps:
175164
- git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
176165

177166
- name: unit-test
178-
pull: always
179167
image: golang:1.15
180168
commands:
181169
- make unit-test-coverage test-check
@@ -186,7 +174,6 @@ steps:
186174
from_secret: github_read_token
187175

188176
- name: test-mysql
189-
pull: always
190177
image: golang:1.15
191178
commands:
192179
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
@@ -202,7 +189,6 @@ steps:
202189
- build
203190

204191
- name: test-mysql8
205-
pull: always
206192
image: golang:1.15
207193
commands:
208194
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
@@ -217,7 +203,6 @@ steps:
217203
- build
218204

219205
- name: test-mssql
220-
pull: always
221206
image: golang:1.15
222207
commands:
223208
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
@@ -232,7 +217,6 @@ steps:
232217
- build
233218

234219
- name: generate-coverage
235-
pull: always
236220
image: golang:1.15
237221
commands:
238222
- make coverage
@@ -295,7 +279,6 @@ services:
295279

296280
steps:
297281
- name: fetch-tags
298-
pull: default
299282
image: docker:git
300283
commands:
301284
- git fetch --tags --force
@@ -315,7 +298,6 @@ steps:
315298
TAGS: bindata sqlite sqlite_unlock_notify
316299

317300
- name: test-sqlite
318-
pull: always
319301
image: golang:1.15
320302
commands:
321303
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
@@ -329,7 +311,6 @@ steps:
329311
- build
330312

331313
- name: test-pgsql
332-
pull: always
333314
image: golang:1.15
334315
commands:
335316
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
@@ -431,7 +412,6 @@ depends_on:
431412

432413
steps:
433414
- name: fetch-tags
434-
pull: default
435415
image: docker:git
436416
commands:
437417
- git fetch --tags --force
@@ -485,7 +465,6 @@ steps:
485465
- push
486466

487467
- name: release-master
488-
pull: always
489468
image: plugins/s3:1
490469
settings:
491470
acl: public-read
@@ -644,7 +623,6 @@ trigger:
644623

645624
steps:
646625
- name: fetch-tags
647-
pull: default
648626
image: docker:git
649627
commands:
650628
- git fetch --tags --force
@@ -668,7 +646,6 @@ steps:
668646
- pull_request
669647

670648
- name: publish-rootless
671-
pull: always
672649
image: plugins/docker:linux-amd64
673650
settings:
674651
dockerfile: Dockerfile.rootless
@@ -747,7 +724,6 @@ trigger:
747724
- "refs/tags/**"
748725
steps:
749726
- name: fetch-tags
750-
pull: default
751727
image: docker:git
752728
commands:
753729
- git fetch --tags --force
@@ -774,7 +750,6 @@ steps:
774750
- pull_request
775751

776752
- name: publish-rootless
777-
pull: always
778753
image: plugins/docker:linux-arm64
779754
settings:
780755
dockerfile: Dockerfile.rootless
@@ -817,7 +792,6 @@ steps:
817792
from_secret: docker_username
818793

819794
- name: manifest
820-
pull: always
821795
image: plugins/manifest
822796
settings:
823797
auto_tag: true

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ charset = utf-8
99
trim_trailing_whitespace = true
1010
insert_final_newline = true
1111

12-
[*.{go, tmpl, html}]
12+
[*.{go,tmpl,html}]
1313
indent_style = tab
1414

1515
[Makefile]

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ignorePatterns:
99

1010
parserOptions:
1111
sourceType: module
12-
ecmaVersion: 2020
12+
ecmaVersion: 2021
1313

1414
plugins:
1515
- eslint-plugin-unicorn
@@ -235,6 +235,7 @@ rules:
235235
no-new-symbol: [2]
236236
no-new-wrappers: [2]
237237
no-new: [0]
238+
no-nonoctal-decimal-escape: [2]
238239
no-obj-calls: [2]
239240
no-octal-escape: [2]
240241
no-octal: [2]

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
/vendor/** -text -eol linguist-vendored
33
/public/vendor/** -text -eol linguist-vendored
44
/templates/**/*.tmpl linguist-language=Handlebars
5+
/.eslintrc linguist-language=YAML
6+
/.stylelintrc linguist-language=YAML

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
audit=false
2+
fund=false
13
package-lock=true
24
save-exact=true

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ swagger-check: generate-swagger
255255
echo "Please run 'make generate-swagger' and commit the result:"; \
256256
echo "$${diff}"; \
257257
exit 1; \
258-
fi;
258+
fi
259259

260260
.PHONY: swagger-validate
261261
swagger-validate:
@@ -296,7 +296,7 @@ fmt-check:
296296
echo "Please run 'make fmt' and commit the result:"; \
297297
echo "$${diff}"; \
298298
exit 1; \
299-
fi;
299+
fi
300300

301301
.PHONY: checks
302302
checks: checks-frontend checks-backend
@@ -348,7 +348,7 @@ test-check:
348348
echo "You should change the tests to create these files in a temporary directory."; \
349349
echo "Do not simply add these files to .gitignore"; \
350350
exit 1; \
351-
fi;
351+
fi
352352

353353
.PHONY: test\#%
354354
test\#%:
@@ -373,7 +373,7 @@ test-vendor: vendor
373373
echo "Please run 'make vendor' and commit the result:"; \
374374
echo "$${diff}"; \
375375
exit 1; \
376-
fi;
376+
fi
377377

378378
generate-ini-sqlite:
379379
sed -e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
@@ -637,6 +637,9 @@ npm-update: node-check | node_modules
637637
fomantic: $(FOMANTIC_DEST)
638638

639639
$(FOMANTIC_DEST): $(FOMANTIC_CONFIGS) | node_modules
640+
@if [ ! -d node_modules/fomantic-ui ]; then \
641+
npm install --no-save --no-package-lock [email protected]; \
642+
fi
640643
rm -rf $(FOMANTIC_DEST_DIR)
641644
cp -f web_src/fomantic/theme.config.less node_modules/fomantic-ui/src/theme.config
642645
cp -rf web_src/fomantic/_site/* node_modules/fomantic-ui/src/_site/
@@ -664,7 +667,7 @@ svg-check: svg
664667
echo "Please run 'make svg' and 'git add $(SVG_DEST_DIR)' and commit the result:"; \
665668
echo "$${diff}"; \
666669
exit 1; \
667-
fi;
670+
fi
668671

669672
.PHONY: update-translations
670673
update-translations:

custom/conf/app.example.ini

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
APP_NAME = Gitea: Git with a cup of tea
99
; Change it if you run locally
1010
RUN_USER = git
11-
; Either "dev", "prod" or "test", default is "dev"
12-
RUN_MODE = dev
11+
; Application run mode, affects performance and debugging. Either "dev", "prod" or "test", default is "prod"
12+
RUN_MODE = prod
1313

1414
[project]
1515
; Default templates for project boards
@@ -1187,6 +1187,14 @@ QUEUE_CONN_STR = "addrs=127.0.0.1:6379 db=0"
11871187
MAX_ATTEMPTS = 3
11881188
; Backoff time per http/https request retry (seconds)
11891189
RETRY_BACKOFF = 3
1190+
; Allowed domains for migrating, default is blank. Blank means everything will be allowed.
1191+
; Multiple domains could be separated by commas.
1192+
ALLOWED_DOMAINS =
1193+
; Blocklist for migrating, default is blank. Multiple domains could be separated by commas.
1194+
; When ALLOWED_DOMAINS is not blank, this option will be ignored.
1195+
BLOCKED_DOMAINS =
1196+
; Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291 (false by default)
1197+
ALLOW_LOCALNETWORKS = false
11901198

11911199
; default storage for attachments, lfs and avatars
11921200
[storage]

docker/root/etc/s6/gitea/setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
2525

2626
# Substitude the environment variables in the template
2727
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
28-
RUN_MODE=${RUN_MODE:-"dev"} \
28+
RUN_MODE=${RUN_MODE:-"prod"} \
2929
DOMAIN=${DOMAIN:-"localhost"} \
3030
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \
3131
HTTP_PORT=${HTTP_PORT:-"3000"} \

docker/rootless/usr/local/bin/docker-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if [ ! -f ${GITEA_APP_INI} ]; then
2727

2828
# Substitude the environment variables in the template
2929
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
30-
RUN_MODE=${RUN_MODE:-"dev"} \
30+
RUN_MODE=${RUN_MODE:-"prod"} \
3131
RUN_USER=${USER:-"git"} \
3232
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \
3333
HTTP_PORT=${HTTP_PORT:-"3000"} \

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
3636
- `APP_NAME`: **Gitea: Git with a cup of tea**: Application name, used in the page title.
3737
- `RUN_USER`: **git**: The user Gitea will run as. This should be a dedicated system
3838
(non-user) account. Setting this incorrectly will cause Gitea to not start.
39-
- `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when
40-
deployed to a production environment. The installation process will set this to `prod`
41-
automatically. \[prod, dev, test\]
39+
- `RUN_MODE`: **prod**: Application run mode, affects performance and debugging. Either "dev", "prod" or "test".
4240

4341
## Repository (`repository`)
4442

@@ -846,6 +844,9 @@ Task queue configuration has been moved to `queue.task`. However, the below conf
846844

847845
- `MAX_ATTEMPTS`: **3**: Max attempts per http/https request on migrations.
848846
- `RETRY_BACKOFF`: **3**: Backoff time per http/https request retry (seconds)
847+
- `ALLOWED_DOMAINS`: **\<empty\>**: Domains allowlist for migrating repositories, default is blank. It means everything will be allowed. Multiple domains could be separated by commas.
848+
- `BLOCKED_DOMAINS`: **\<empty\>**: Domains blocklist for migrating repositories, default is blank. Multiple domains could be separated by commas. When `ALLOWED_DOMAINS` is not blank, this option will be ignored.
849+
- `ALLOW_LOCALNETWORKS`: **false**: Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291
849850

850851
## Mirror (`mirror`)
851852

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ IS_INPUT_FILE = false
313313

314314
- `MAX_ATTEMPTS`: **3**: 在迁移过程中的 http/https 请求重试次数。
315315
- `RETRY_BACKOFF`: **3**: 等待下一次重试的时间,单位秒。
316+
- `ALLOWED_DOMAINS`: **\<empty\>**: 迁移仓库的域名白名单,默认为空,表示允许从任意域名迁移仓库,多个域名用逗号分隔。
317+
- `BLOCKED_DOMAINS`: **\<empty\>**: 迁移仓库的域名黑名单,默认为空,多个域名用逗号分隔。如果 `ALLOWED_DOMAINS` 不为空,此选项将会被忽略。
318+
- `ALLOW_LOCALNETWORKS`: **false**: Allow private addresses defined by RFC 1918
316319

317320
## LFS (`lfs`)
318321

docs/content/doc/installation/with-docker-rootless.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ You can configure some of Gitea's settings via environment variables:
240240
(Default values are provided in **bold**)
241241

242242
* `APP_NAME`: **"Gitea: Git with a cup of tea"**: Application name, used in the page title.
243-
* `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment.
243+
* `RUN_MODE`: **prod**: Application run mode, affects performance and debugging. Either "dev", "prod" or "test".
244244
* `SSH_DOMAIN`: **localhost**: Domain name of this server, used for the displayed clone URL in Gitea's UI.
245245
* `SSH_PORT`: **2222**: SSH port displayed in clone URL.
246246
* `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.

0 commit comments

Comments
 (0)