From 5e5740af69cb0f44ff0c1576a2387388d75bb4c2 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 23 Jan 2022 19:02:29 +0000 Subject: [PATCH] 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 --- custom/conf/app.example.ini | 5 +++-- docker/root/etc/templates/app.ini | 4 +++- docker/rootless/etc/templates/app.ini | 4 +++- docs/content/doc/usage/git-lfs-support.md | 4 +++- integrations/mssql.ini.tmpl | 4 +++- integrations/mysql8.ini.tmpl | 4 +++- integrations/pgsql.ini.tmpl | 4 +++- integrations/sqlite.ini.tmpl | 4 +++- routers/install/install.go | 2 +- 9 files changed, 25 insertions(+), 10 deletions(-) diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index 3343af95a..bc98f4ca1 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -211,8 +211,6 @@ RUN_MODE = ; prod ;; Enables git-lfs support. true or false, default is false. ;LFS_START_SERVER = false ;; -;; Where your lfs files reside, default is data/lfs. -;LFS_CONTENT_PATH = data/lfs ;; ;; LFS authentication secret, change this yourself LFS_JWT_SECRET = @@ -2183,6 +2181,9 @@ PATH = ;; ;[lfs] ;STORAGE_TYPE = local +;; +;; Where your lfs files reside, default is data/lfs. +;PATH = data/lfs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/docker/root/etc/templates/app.ini b/docker/root/etc/templates/app.ini index c5212a935..7e8aa0bd0 100644 --- a/docker/root/etc/templates/app.ini +++ b/docker/root/etc/templates/app.ini @@ -20,7 +20,6 @@ DISABLE_SSH = $DISABLE_SSH SSH_PORT = $SSH_PORT SSH_LISTEN_PORT = $SSH_LISTEN_PORT LFS_START_SERVER = $LFS_START_SERVER -LFS_CONTENT_PATH = /data/git/lfs [database] PATH = /data/gitea/gitea.db @@ -59,3 +58,6 @@ REVERSE_PROXY_TRUSTED_PROXIES = * [service] DISABLE_REGISTRATION = $DISABLE_REGISTRATION REQUIRE_SIGNIN_VIEW = $REQUIRE_SIGNIN_VIEW + +[lfs] +PATH = /data/git/lfs diff --git a/docker/rootless/etc/templates/app.ini b/docker/rootless/etc/templates/app.ini index 905b2adb3..f106f01f5 100644 --- a/docker/rootless/etc/templates/app.ini +++ b/docker/rootless/etc/templates/app.ini @@ -23,7 +23,6 @@ SSH_PORT = $SSH_PORT SSH_LISTEN_PORT = $SSH_LISTEN_PORT BUILTIN_SSH_SERVER_USER = $RUN_USER LFS_START_SERVER = $LFS_START_SERVER -LFS_CONTENT_PATH = $GITEA_WORK_DIR/git/lfs [database] PATH = $GITEA_WORK_DIR/data/gitea.db @@ -55,3 +54,6 @@ REVERSE_PROXY_TRUSTED_PROXIES = * [service] DISABLE_REGISTRATION = $DISABLE_REGISTRATION REQUIRE_SIGNIN_VIEW = $REQUIRE_SIGNIN_VIEW + +[lfs] +PATH = $GITEA_WORK_DIR/git/lfs diff --git a/docs/content/doc/usage/git-lfs-support.md b/docs/content/doc/usage/git-lfs-support.md index a8f935de2..8b2c997bf 100644 --- a/docs/content/doc/usage/git-lfs-support.md +++ b/docs/content/doc/usage/git-lfs-support.md @@ -21,8 +21,10 @@ To use Gitea's built-in LFS support, you must update the `app.ini` file: [server] ; Enables git-lfs support. true or false, default is false. LFS_START_SERVER = true + +[lfs] ; Where your lfs files reside, default is data/lfs. -LFS_CONTENT_PATH = /home/gitea/data/lfs +PATH = /home/gitea/data/lfs ``` **Note**: LFS server support needs at least Git v2.1.2 installed on the server diff --git a/integrations/mssql.ini.tmpl b/integrations/mssql.ini.tmpl index b9ed26dcc..e97174ee8 100644 --- a/integrations/mssql.ini.tmpl +++ b/integrations/mssql.ini.tmpl @@ -45,7 +45,6 @@ SSH_LISTEN_HOST = localhost SSH_PORT = 2201 START_SSH_SERVER = true LFS_START_SERVER = true -LFS_CONTENT_PATH = integrations/gitea-integration-mssql/data/lfs OFFLINE_MODE = false LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w APP_DATA_PATH = integrations/gitea-integration-mssql/data @@ -100,3 +99,6 @@ DISABLE_GIT_HOOKS = false INSTALL_LOCK = true SECRET_KEY = 9pCviYTWSb INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTU1NTE2MTh9.hhSVGOANkaKk3vfCd2jDOIww4pUk0xtg9JRde5UogyQ + +[lfs] +PATH = integrations/gitea-integration-mssql/data/lfs diff --git a/integrations/mysql8.ini.tmpl b/integrations/mysql8.ini.tmpl index 81a1d8836..606aa41d5 100644 --- a/integrations/mysql8.ini.tmpl +++ b/integrations/mysql8.ini.tmpl @@ -45,7 +45,6 @@ SSH_LISTEN_HOST = localhost SSH_PORT = 2204 START_SSH_SERVER = true LFS_START_SERVER = true -LFS_CONTENT_PATH = integrations/gitea-integration-mysql8/data/lfs OFFLINE_MODE = false LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w APP_DATA_PATH = integrations/gitea-integration-mysql8/data @@ -97,3 +96,6 @@ DISABLE_GIT_HOOKS = false INSTALL_LOCK = true SECRET_KEY = 9pCviYTWSb INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTU1NTE2MTh9.hhSVGOANkaKk3vfCd2jDOIww4pUk0xtg9JRde5UogyQ + +[lfs] +PATH = integrations/gitea-integration-mysql8/data/lfs diff --git a/integrations/pgsql.ini.tmpl b/integrations/pgsql.ini.tmpl index db1914a1b..a325ea028 100644 --- a/integrations/pgsql.ini.tmpl +++ b/integrations/pgsql.ini.tmpl @@ -46,7 +46,6 @@ SSH_LISTEN_HOST = localhost SSH_PORT = 2202 START_SSH_SERVER = true LFS_START_SERVER = true -LFS_CONTENT_PATH = integrations/gitea-integration-pgsql/data/lfs OFFLINE_MODE = false LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w APP_DATA_PATH = integrations/gitea-integration-pgsql/data @@ -101,3 +100,6 @@ DISABLE_GIT_HOOKS = false INSTALL_LOCK = true SECRET_KEY = 9pCviYTWSb INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTU1NTE2MTh9.hhSVGOANkaKk3vfCd2jDOIww4pUk0xtg9JRde5UogyQ + +[lfs] +PATH = integrations/gitea-integration-pgsql/data/lfs diff --git a/integrations/sqlite.ini.tmpl b/integrations/sqlite.ini.tmpl index 76d9420d8..e82780ad8 100644 --- a/integrations/sqlite.ini.tmpl +++ b/integrations/sqlite.ini.tmpl @@ -41,7 +41,6 @@ SSH_LISTEN_HOST = localhost SSH_PORT = 2203 START_SSH_SERVER = true LFS_START_SERVER = true -LFS_CONTENT_PATH = integrations/gitea-integration-sqlite/data/lfs OFFLINE_MODE = false LFS_JWT_SECRET = Tv_MjmZuHqpIY6GFl12ebgkRAMt4RlWt0v4EHKSXO0w APP_DATA_PATH = integrations/gitea-integration-sqlite/data @@ -99,3 +98,6 @@ INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0OTI3OTU5ODN9.O [oauth2] JWT_SECRET = KZb_QLUd4fYVyxetjxC4eZkrBgWM2SndOOWDNtgUUko + +[lfs] +PATH = integrations/gitea-integration-sqlite/data/lfs diff --git a/routers/install/install.go b/routers/install/install.go index 043fae26d..eb2cd2346 100644 --- a/routers/install/install.go +++ b/routers/install/install.go @@ -418,7 +418,7 @@ func SubmitInstall(ctx *context.Context) { if form.LFSRootPath != "" { cfg.Section("server").Key("LFS_START_SERVER").SetValue("true") - cfg.Section("server").Key("LFS_CONTENT_PATH").SetValue(form.LFSRootPath) + cfg.Section("lfs").Key("PATH").SetValue(form.LFSRootPath) var lfsJwtSecret string if lfsJwtSecret, err = generate.NewJwtSecretBase64(); err != nil { ctx.RenderWithErr(ctx.Tr("install.lfs_jwt_secret_failed", err), tplInstall, &form)