Skip to content

Commit 9dd01d2

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Attempt clarify AppWorkPath etc. (go-gitea#21656) Set last login when activating account (go-gitea#21731) Quick fixes monaco-editor error: "vs.editor.nullLanguage" (go-gitea#21734) Fix UI language switching bug (go-gitea#21597) Add package registry quota limits (go-gitea#21584)
2 parents 0ac5fce + 99688ef commit 9dd01d2

File tree

27 files changed

+516
-119
lines changed

27 files changed

+516
-119
lines changed

cmd/migrate_storage_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ func TestMigratePackages(t *testing.T) {
4444
PackageFileInfo: packages_service.PackageFileInfo{
4545
Filename: "a.go",
4646
},
47-
Data: buf,
48-
IsLead: true,
47+
Creator: creator,
48+
Data: buf,
49+
IsLead: true,
4950
})
5051
assert.NoError(t, err)
5152
assert.NotNil(t, v)

custom/conf/app.example.ini

+77-14
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.
@@ -1296,7 +1330,7 @@ ROUTER = console
12961330
;ISSUE_INDEXER_TYPE = bleve
12971331
;;
12981332
;; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
1299-
;ISSUE_INDEXER_PATH = indexers/issues.bleve
1333+
;ISSUE_INDEXER_PATH = indexers/issues.bleve ; Relative paths will be made absolute against _`AppWorkPath`_.
13001334
;;
13011335
;; Issue indexer connection string, available when ISSUE_INDEXER_TYPE is elasticsearch
13021336
;ISSUE_INDEXER_CONN_STR = http://elastic:changeme@localhost:9200
@@ -1314,7 +1348,7 @@ ROUTER = console
13141348
;; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the path where the queue will be saved.
13151349
;; This can be overridden by `ISSUE_INDEXER_QUEUE_CONN_STR`.
13161350
;; default is queues/common
1317-
;ISSUE_INDEXER_QUEUE_DIR = queues/common; **DEPRECATED** use settings in `[queue.issue_indexer]`.
1351+
;ISSUE_INDEXER_QUEUE_DIR = queues/common; **DEPRECATED** use settings in `[queue.issue_indexer]`. Relative paths will be made absolute against `%(APP_DATA_PATH)s`.
13181352
;;
13191353
;; When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string.
13201354
;; When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this is a directory or additional options of
@@ -1370,7 +1404,7 @@ ROUTER = console
13701404
;TYPE = persistable-channel
13711405
;;
13721406
;; data-dir for storing persistable queues and level queues, individual queues will default to `queues/common` meaning the queue is shared.
1373-
;DATADIR = queues/
1407+
;DATADIR = queues/ ; Relative paths will be made absolute against `%(APP_DATA_PATH)s`.
13741408
;;
13751409
;; Default queue length before a channel queue will block
13761410
;LENGTH = 20
@@ -1672,7 +1706,7 @@ ROUTER = console
16721706
;; file: session file path, e.g. `data/sessions`
16731707
;; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
16741708
;; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
1675-
;PROVIDER_CONFIG = data/sessions
1709+
;PROVIDER_CONFIG = data/sessions ; Relative paths will be made absolute against _`AppWorkPath`_.
16761710
;;
16771711
;; Session cookie name
16781712
;COOKIE_NAME = i_like_gitea
@@ -2335,6 +2369,35 @@ ROUTER = console
23352369
;;
23362370
;; Path for chunked uploads. Defaults to APP_DATA_PATH + `tmp/package-upload`
23372371
;CHUNKED_UPLOAD_PATH = tmp/package-upload
2372+
;;
2373+
;; Maxmimum count of package versions a single owner can have (`-1` means no limits)
2374+
;LIMIT_TOTAL_OWNER_COUNT = -1
2375+
;; Maxmimum size of packages a single owner can use (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2376+
;LIMIT_TOTAL_OWNER_SIZE = -1
2377+
;; Maxmimum size of a Composer upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2378+
;LIMIT_SIZE_COMPOSER = -1
2379+
;; Maxmimum size of a Conan upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2380+
;LIMIT_SIZE_CONAN = -1
2381+
;; Maxmimum size of a Container upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2382+
;LIMIT_SIZE_CONTAINER = -1
2383+
;; Maxmimum size of a Generic upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2384+
;LIMIT_SIZE_GENERIC = -1
2385+
;; Maxmimum size of a Helm upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2386+
;LIMIT_SIZE_HELM = -1
2387+
;; Maxmimum size of a Maven upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2388+
;LIMIT_SIZE_MAVEN = -1
2389+
;; Maxmimum size of a npm upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2390+
;LIMIT_SIZE_NPM = -1
2391+
;; Maxmimum size of a NuGet upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2392+
;LIMIT_SIZE_NUGET = -1
2393+
;; Maxmimum size of a Pub upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2394+
;LIMIT_SIZE_PUB = -1
2395+
;; Maxmimum size of a PyPI upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2396+
;LIMIT_SIZE_PYPI = -1
2397+
;; Maxmimum size of a RubyGems upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2398+
;LIMIT_SIZE_RUBYGEMS = -1
2399+
;; Maxmimum size of a Vagrant upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2400+
;LIMIT_SIZE_VAGRANT = -1
23382401

23392402
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
23402403
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

0 commit comments

Comments
 (0)