Skip to content

Commit 5856890

Browse files
authored
Merge branch 'main' into fix-20456-prepend-refs-heads
2 parents ff439a9 + 2cbea23 commit 5856890

File tree

32 files changed

+520
-352
lines changed

32 files changed

+520
-352
lines changed

.dockerignore

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Compiled Object files, Static and Dynamic libs (Shared Objects)
2+
*.o
3+
*.a
4+
*.so
5+
6+
# Folders
7+
_obj
8+
_test
9+
10+
# IntelliJ
11+
.idea
12+
# Goland's output filename can not be set manually
13+
/go_build_*
14+
15+
# MS VSCode
16+
.vscode
17+
__debug_bin
18+
19+
# Architecture specific extensions/prefixes
20+
*.[568vq]
21+
[568vq].out
22+
23+
*.cgo1.go
24+
*.cgo2.c
25+
_cgo_defun.c
26+
_cgo_gotypes.go
27+
_cgo_export.*
28+
29+
_testmain.go
30+
31+
*.exe
32+
*.test
33+
*.prof
34+
35+
*coverage.out
36+
coverage.all
37+
cpu.out
38+
39+
/modules/migration/bindata.go
40+
/modules/migration/bindata.go.hash
41+
/modules/options/bindata.go
42+
/modules/options/bindata.go.hash
43+
/modules/public/bindata.go
44+
/modules/public/bindata.go.hash
45+
/modules/templates/bindata.go
46+
/modules/templates/bindata.go.hash
47+
48+
*.db
49+
*.log
50+
51+
/gitea
52+
/gitea-vet
53+
/debug
54+
/integrations.test
55+
56+
/bin
57+
/dist
58+
/custom/*
59+
!/custom/conf
60+
/custom/conf/*
61+
!/custom/conf/app.example.ini
62+
/data
63+
/indexers
64+
/log
65+
/public/img/avatar
66+
/tests/integration/gitea-integration-*
67+
/tests/integration/indexers-*
68+
/tests/e2e/gitea-e2e-*
69+
/tests/e2e/indexers-*
70+
/tests/e2e/reports
71+
/tests/e2e/test-artifacts
72+
/tests/e2e/test-snapshots
73+
/tests/*.ini
74+
/node_modules
75+
/yarn.lock
76+
/yarn-error.log
77+
/npm-debug.log*
78+
/public/js
79+
/public/serviceworker.js
80+
/public/css
81+
/public/fonts
82+
/public/img/webpack
83+
/vendor
84+
/web_src/fomantic/node_modules
85+
/web_src/fomantic/build/*
86+
!/web_src/fomantic/build/semantic.js
87+
!/web_src/fomantic/build/semantic.css
88+
!/web_src/fomantic/build/themes
89+
/web_src/fomantic/build/themes/*
90+
!/web_src/fomantic/build/themes/default
91+
/web_src/fomantic/build/themes/default/assets/*
92+
!/web_src/fomantic/build/themes/default/assets/fonts
93+
/web_src/fomantic/build/themes/default/assets/fonts/*
94+
!/web_src/fomantic/build/themes/default/assets/fonts/icons.woff2
95+
!/web_src/fomantic/build/themes/default/assets/fonts/outline-icons.woff2
96+
/VERSION
97+
/.air
98+
/.go-licenses
99+
100+
# Snapcraft
101+
snap/.snapcraft/
102+
parts/
103+
stage/
104+
prime/
105+
*.snap
106+
*.snap-build
107+
*_source.tar.bz2
108+
.DS_Store
109+
110+
# Make evidence files
111+
/.make_evidence
112+
113+
# Manpage
114+
/man

cmd/admin.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ var (
413413
Usage: "SMTP Authentication Type (PLAIN/LOGIN/CRAM-MD5) default PLAIN",
414414
},
415415
cli.StringFlag{
416-
Name: "addr",
416+
Name: "host",
417417
Value: "",
418-
Usage: "SMTP Addr",
418+
Usage: "SMTP Host",
419419
},
420420
cli.IntFlag{
421421
Name: "port",
@@ -955,8 +955,8 @@ func parseSMTPConfig(c *cli.Context, conf *smtp.Source) error {
955955
}
956956
conf.Auth = c.String("auth-type")
957957
}
958-
if c.IsSet("addr") {
959-
conf.Addr = c.String("addr")
958+
if c.IsSet("host") {
959+
conf.Host = c.String("host")
960960
}
961961
if c.IsSet("port") {
962962
conf.Port = c.Int("port")

custom/conf/app.example.ini

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,38 @@
77
;; see https://docs.gitea.io/en-us/config-cheat-sheet/ for additional documentation.
88

99

10+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11+
;; Default Configuration (non-`app.ini` configuration)
12+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13+
;;
14+
;; These values are environment-dependent but form the basis of a lot of values. They will be
15+
;; reported as part of the default configuration when running `gitea --help` or on start-up. The order they are emitted there is slightly different but we will list them here in the order they are set-up.
16+
;;
17+
;; - _`AppPath`_: This is the absolute path of the running gitea binary.
18+
;; - _`AppWorkPath`_: This refers to "working path" of the `gitea` binary. It is determined by using the first set thing in the following hierarchy:
19+
;; - The `--work-path` flag passed to the binary
20+
;; - The environment variable `$GITEA_WORK_DIR`
21+
;; - A built-in value set at build time (see building from source)
22+
;; - Otherwise it defaults to the directory of the _`AppPath`_
23+
;; - If any of the above are relative paths then they are made absolute against the
24+
;; the directory of the _`AppPath`_
25+
;; - _`CustomPath`_: This is the base directory for custom templates and other options.
26+
;; It is determined by using the first set thing in the following hierarchy:
27+
;; - The `--custom-path` flag passed to the binary
28+
;; - The environment variable `$GITEA_CUSTOM`
29+
;; - A built-in value set at build time (see building from source)
30+
;; - Otherwise it defaults to _`AppWorkPath`_`/custom`
31+
;; - If any of the above are relative paths then they are made absolute against the
32+
;; the directory of the _`AppWorkPath`_
33+
;; - _`CustomConf`_: This is the path to the `app.ini` file.
34+
;; - The `--config` flag passed to the binary
35+
;; - A built-in value set at build time (see building from source)
36+
;; - Otherwise it defaults to _`CustomPath`_`/conf/app.ini`
37+
;; - If any of the above are relative paths then they are made absolute against the
38+
;; the directory of the _`CustomPath`_
39+
;;
40+
;; In addition there is _`StaticRootPath`_ which can be set as a built-in at build time, but will otherwise default to _`AppWorkPath`_
41+
1042
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1143
;; General Settings
1244
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -26,7 +58,7 @@ RUN_MODE = ; prod
2658
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2759
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2860
;;
29-
;; The protocol the server listens on. One of 'http', 'https', 'unix' or 'fcgi'. Defaults to 'http'
61+
;; The protocol the server listens on. One of 'http', 'https', 'http+unix', 'fcgi' or 'fcgi+unix'. Defaults to 'http'
3062
;PROTOCOL = http
3163
;;
3264
;; Expect PROXY protocol headers on connections
@@ -51,6 +83,8 @@ RUN_MODE = ; prod
5183
;STATIC_URL_PREFIX =
5284
;;
5385
;; The address to listen on. Either a IPv4/IPv6 address or the path to a unix socket.
86+
;; If PROTOCOL is set to `http+unix` or `fcgi+unix`, this should be the name of the Unix socket file to use.
87+
;; Relative paths will be made absolute against the _`AppWorkPath`_.
5488
;HTTP_ADDR = 0.0.0.0
5589
;;
5690
;; The port to listen on. Leave empty when using a unix socket.
@@ -64,7 +98,7 @@ RUN_MODE = ; prod
6498
;PORT_TO_REDIRECT = 80
6599
;;
66100
;; expect PROXY protocol header on connections to https redirector.
67-
;REDIRECTOR_USE_PROXY_PROTOCOL = %(USE_PROXY_PROTOCOL)
101+
;REDIRECTOR_USE_PROXY_PROTOCOL = %(USE_PROXY_PROTOCOL)s
68102
;; Minimum and maximum supported TLS versions
69103
;SSL_MIN_VERSION=TLSv1.2
70104
;SSL_MAX_VERSION=
@@ -91,7 +125,7 @@ RUN_MODE = ; prod
91125
;LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
92126
;;
93127
;; When making local connections pass the PROXY protocol header.
94-
;LOCAL_USE_PROXY_PROTOCOL = %(USE_PROXY_PROTOCOL)
128+
;LOCAL_USE_PROXY_PROTOCOL = %(USE_PROXY_PROTOCOL)s
95129
;;
96130
;; Disable SSH feature when not available
97131
;DISABLE_SSH = false
@@ -145,7 +179,7 @@ RUN_MODE = ; prod
145179
;;
146180
;; For the built-in SSH server, choose the keypair to offer as the host key
147181
;; The private key should be at SSH_SERVER_HOST_KEY and the public SSH_SERVER_HOST_KEY.pub
148-
;; relative paths are made absolute relative to the APP_DATA_PATH
182+
;; relative paths are made absolute relative to the %(APP_DATA_PATH)s
149183
;SSH_SERVER_HOST_KEYS=ssh/gitea.rsa, ssh/gogs.rsa
150184
;;
151185
;; Directory to create temporary files in when testing public keys using ssh-keygen,
@@ -241,10 +275,10 @@ RUN_MODE = ; prod
241275
;;
242276
;; Root directory containing templates and static files.
243277
;; default is the path where Gitea is executed
244-
;STATIC_ROOT_PATH =
278+
;STATIC_ROOT_PATH = ; Will default to the built-in value _`StaticRootPath`_
245279
;;
246280
;; Default path for App data
247-
;APP_DATA_PATH = data
281+
;APP_DATA_PATH = data ; relative paths will be made absolute with _`AppWorkPath`_
248282
;;
249283
;; Enable gzip compression for runtime-generated content, static resources excluded
250284
;ENABLE_GZIP = false
@@ -255,7 +289,7 @@ RUN_MODE = ; prod
255289
;ENABLE_PPROF = false
256290
;;
257291
;; PPROF_DATA_PATH, use an absolute path when you start gitea as service
258-
;PPROF_DATA_PATH = data/tmp/pprof
292+
;PPROF_DATA_PATH = data/tmp/pprof ; Path is relative to _`AppWorkPath`_
259293
;;
260294
;; Landing page, can be "home", "explore", "organizations", "login", or any URL such as "/org/repo" or even "https://anotherwebsite.com"
261295
;; The "login" choice is not a security measure but just a UI flow change, use REQUIRE_SIGNIN_VIEW to force users to log in.
@@ -633,7 +667,7 @@ ROUTER = console
633667
;PATH =
634668
;;
635669
;; The HOME directory for Git
636-
;HOME_PATH = %(APP_DATA_PATH)/home
670+
;HOME_PATH = %(APP_DATA_PATH)s/home
637671
;;
638672
;; Disables highlight of added and removed changes
639673
;DISABLE_DIFF_HIGHLIGHT = false
@@ -838,8 +872,8 @@ ROUTER = console
838872
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
839873
;[repository]
840874
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
841-
;; Root path for storing all repository data. By default, it is set to %(APP_DATA_PATH)/gitea-repositories.
842-
;; A relative path is interpreted as %(GITEA_WORK_DIR)/%(ROOT)
875+
;; Root path for storing all repository data. By default, it is set to %(APP_DATA_PATH)s/gitea-repositories.
876+
;; A relative path is interpreted as _`AppWorkPath`_/%(ROOT)s
843877
;ROOT =
844878
;;
845879
;; The script type this server supports. Usually this is `bash`, but some users report that only `sh` is available.
@@ -1104,6 +1138,9 @@ ROUTER = console
11041138
;; allow request with credentials
11051139
;ALLOW_CREDENTIALS = false
11061140
;;
1141+
;; headers to permit
1142+
;HEADERS = Content-Type,User-Agent
1143+
;;
11071144
;; set X-FRAME-OPTIONS header
11081145
;X_FRAME_OPTIONS = SAMEORIGIN
11091146

@@ -1296,7 +1333,7 @@ ROUTER = console
12961333
;ISSUE_INDEXER_TYPE = bleve
12971334
;;
12981335
;; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
1299-
;ISSUE_INDEXER_PATH = indexers/issues.bleve
1336+
;ISSUE_INDEXER_PATH = indexers/issues.bleve ; Relative paths will be made absolute against _`AppWorkPath`_.
13001337
;;
13011338
;; Issue indexer connection string, available when ISSUE_INDEXER_TYPE is elasticsearch
13021339
;ISSUE_INDEXER_CONN_STR = http://elastic:changeme@localhost:9200
@@ -1314,7 +1351,7 @@ ROUTER = console
13141351
;; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the path where the queue will be saved.
13151352
;; This can be overridden by `ISSUE_INDEXER_QUEUE_CONN_STR`.
13161353
;; default is queues/common
1317-
;ISSUE_INDEXER_QUEUE_DIR = queues/common; **DEPRECATED** use settings in `[queue.issue_indexer]`.
1354+
;ISSUE_INDEXER_QUEUE_DIR = queues/common; **DEPRECATED** use settings in `[queue.issue_indexer]`. Relative paths will be made absolute against `%(APP_DATA_PATH)s`.
13181355
;;
13191356
;; When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string.
13201357
;; When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this is a directory or additional options of
@@ -1370,7 +1407,7 @@ ROUTER = console
13701407
;TYPE = persistable-channel
13711408
;;
13721409
;; data-dir for storing persistable queues and level queues, individual queues will default to `queues/common` meaning the queue is shared.
1373-
;DATADIR = queues/
1410+
;DATADIR = queues/ ; Relative paths will be made absolute against `%(APP_DATA_PATH)s`.
13741411
;;
13751412
;; Default queue length before a channel queue will block
13761413
;LENGTH = 20
@@ -1672,7 +1709,7 @@ ROUTER = console
16721709
;; file: session file path, e.g. `data/sessions`
16731710
;; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
16741711
;; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
1675-
;PROVIDER_CONFIG = data/sessions
1712+
;PROVIDER_CONFIG = data/sessions ; Relative paths will be made absolute against _`AppWorkPath`_.
16761713
;;
16771714
;; Session cookie name
16781715
;COOKIE_NAME = i_like_gitea

0 commit comments

Comments
 (0)