Skip to content

Commit 5e5740a

Browse files
author
Gusted
authored
Switch to non-deprecation setting (#18358)
* Switch to non-deprecation setting (Avoid by-default: "Deprecated fallback `[server]` `LFS_CONTENT_PATH` present. Use `[lfs]` `PATH` instead. This fallback will be removed in v1.18.0") * Update all references
1 parent 8472884 commit 5e5740a

File tree

9 files changed

+25
-10
lines changed

9 files changed

+25
-10
lines changed

custom/conf/app.example.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,6 @@ RUN_MODE = ; prod
211211
;; Enables git-lfs support. true or false, default is false.
212212
;LFS_START_SERVER = false
213213
;;
214-
;; Where your lfs files reside, default is data/lfs.
215-
;LFS_CONTENT_PATH = data/lfs
216214
;;
217215
;; LFS authentication secret, change this yourself
218216
LFS_JWT_SECRET =
@@ -2183,6 +2181,9 @@ PATH =
21832181
;;
21842182
;[lfs]
21852183
;STORAGE_TYPE = local
2184+
;;
2185+
;; Where your lfs files reside, default is data/lfs.
2186+
;PATH = data/lfs
21862187

21872188
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21882189
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docker/root/etc/templates/app.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ DISABLE_SSH = $DISABLE_SSH
2020
SSH_PORT = $SSH_PORT
2121
SSH_LISTEN_PORT = $SSH_LISTEN_PORT
2222
LFS_START_SERVER = $LFS_START_SERVER
23-
LFS_CONTENT_PATH = /data/git/lfs
2423

2524
[database]
2625
PATH = /data/gitea/gitea.db
@@ -59,3 +58,6 @@ REVERSE_PROXY_TRUSTED_PROXIES = *
5958
[service]
6059
DISABLE_REGISTRATION = $DISABLE_REGISTRATION
6160
REQUIRE_SIGNIN_VIEW = $REQUIRE_SIGNIN_VIEW
61+
62+
[lfs]
63+
PATH = /data/git/lfs

docker/rootless/etc/templates/app.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ SSH_PORT = $SSH_PORT
2323
SSH_LISTEN_PORT = $SSH_LISTEN_PORT
2424
BUILTIN_SSH_SERVER_USER = $RUN_USER
2525
LFS_START_SERVER = $LFS_START_SERVER
26-
LFS_CONTENT_PATH = $GITEA_WORK_DIR/git/lfs
2726

2827
[database]
2928
PATH = $GITEA_WORK_DIR/data/gitea.db
@@ -55,3 +54,6 @@ REVERSE_PROXY_TRUSTED_PROXIES = *
5554
[service]
5655
DISABLE_REGISTRATION = $DISABLE_REGISTRATION
5756
REQUIRE_SIGNIN_VIEW = $REQUIRE_SIGNIN_VIEW
57+
58+
[lfs]
59+
PATH = $GITEA_WORK_DIR/git/lfs

docs/content/doc/usage/git-lfs-support.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ To use Gitea's built-in LFS support, you must update the `app.ini` file:
2121
[server]
2222
; Enables git-lfs support. true or false, default is false.
2323
LFS_START_SERVER = true
24+
25+
[lfs]
2426
; Where your lfs files reside, default is data/lfs.
25-
LFS_CONTENT_PATH = /home/gitea/data/lfs
27+
PATH = /home/gitea/data/lfs
2628
```
2729

2830
**Note**: LFS server support needs at least Git v2.1.2 installed on the server

integrations/mssql.ini.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ SSH_LISTEN_HOST = localhost
4545
SSH_PORT = 2201
4646
START_SSH_SERVER = true
4747
LFS_START_SERVER = true
48-
LFS_CONTENT_PATH = integrations/gitea-integration-mssql/data/lfs
4948
OFFLINE_MODE = false
5049
LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w
5150
APP_DATA_PATH = integrations/gitea-integration-mssql/data
@@ -100,3 +99,6 @@ DISABLE_GIT_HOOKS = false
10099
INSTALL_LOCK = true
101100
SECRET_KEY = 9pCviYTWSb
102101
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTU1NTE2MTh9.hhSVGOANkaKk3vfCd2jDOIww4pUk0xtg9JRde5UogyQ
102+
103+
[lfs]
104+
PATH = integrations/gitea-integration-mssql/data/lfs

integrations/mysql8.ini.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ SSH_LISTEN_HOST = localhost
4545
SSH_PORT = 2204
4646
START_SSH_SERVER = true
4747
LFS_START_SERVER = true
48-
LFS_CONTENT_PATH = integrations/gitea-integration-mysql8/data/lfs
4948
OFFLINE_MODE = false
5049
LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w
5150
APP_DATA_PATH = integrations/gitea-integration-mysql8/data
@@ -97,3 +96,6 @@ DISABLE_GIT_HOOKS = false
9796
INSTALL_LOCK = true
9897
SECRET_KEY = 9pCviYTWSb
9998
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTU1NTE2MTh9.hhSVGOANkaKk3vfCd2jDOIww4pUk0xtg9JRde5UogyQ
99+
100+
[lfs]
101+
PATH = integrations/gitea-integration-mysql8/data/lfs

integrations/pgsql.ini.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ SSH_LISTEN_HOST = localhost
4646
SSH_PORT = 2202
4747
START_SSH_SERVER = true
4848
LFS_START_SERVER = true
49-
LFS_CONTENT_PATH = integrations/gitea-integration-pgsql/data/lfs
5049
OFFLINE_MODE = false
5150
LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w
5251
APP_DATA_PATH = integrations/gitea-integration-pgsql/data
@@ -101,3 +100,6 @@ DISABLE_GIT_HOOKS = false
101100
INSTALL_LOCK = true
102101
SECRET_KEY = 9pCviYTWSb
103102
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTU1NTE2MTh9.hhSVGOANkaKk3vfCd2jDOIww4pUk0xtg9JRde5UogyQ
103+
104+
[lfs]
105+
PATH = integrations/gitea-integration-pgsql/data/lfs

integrations/sqlite.ini.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ SSH_LISTEN_HOST = localhost
4141
SSH_PORT = 2203
4242
START_SSH_SERVER = true
4343
LFS_START_SERVER = true
44-
LFS_CONTENT_PATH = integrations/gitea-integration-sqlite/data/lfs
4544
OFFLINE_MODE = false
4645
LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w
4746
APP_DATA_PATH = integrations/gitea-integration-sqlite/data
@@ -99,3 +98,6 @@ INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTI3OTU5ODN9.O
9998

10099
[oauth2]
101100
JWT_SECRET = KZb_QLUd4fYVyxetjxC4eZkrBgWM2SndOOWDNtgUUko
101+
102+
[lfs]
103+
PATH = integrations/gitea-integration-sqlite/data/lfs

routers/install/install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func SubmitInstall(ctx *context.Context) {
418418

419419
if form.LFSRootPath != "" {
420420
cfg.Section("server").Key("LFS_START_SERVER").SetValue("true")
421-
cfg.Section("server").Key("LFS_CONTENT_PATH").SetValue(form.LFSRootPath)
421+
cfg.Section("lfs").Key("PATH").SetValue(form.LFSRootPath)
422422
var lfsJwtSecret string
423423
if lfsJwtSecret, err = generate.NewJwtSecretBase64(); err != nil {
424424
ctx.RenderWithErr(ctx.Tr("install.lfs_jwt_secret_failed", err), tplInstall, &form)

0 commit comments

Comments
 (0)