go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.08k stars 5.41k forks source link

Can't set APP_DATA_PATH/WORK_PATH from environment variables #28884

Closed Evidlo closed 7 months ago

Evidlo commented 7 months ago

Description

I'm starting with a fresh install of Gitea. I'm trying to install Gitea to /storage/gitea, but it tries to write to /usr/bin/data which it doesn't have permission to do and fails.

out2

I tried a few environment variables, but I couldn't figure out how to get it to stop trying to write to /usr/bin/data

gitea@tikhonov:~$ GITEA_CUSTOM=/storage/gitea APP_DATA_PATH=/storage/gitea/ gitea web -c /etc/gitea/app.ini
2024/01/21 13:55:14 .../setting/security.go:168:loadSecurityFrom() [W] Enabling Query API Auth tokens is not recommended. DISABLE_QUERY_AUTH_TOKEN will default to true in gitea 1.23 and will be removed in gitea 1.24.
2024/01/21 13:55:14 cmd/web.go:242:runWeb() [I] Starting Gitea on PID: 2791210
2024/01/21 13:55:14 cmd/web.go:111:showWebStartupMessage() [I] Gitea version: 1.21.4 built with GNU Make 4.3, go1.21.5 : bindata, sqlite, sqlite_unlock_notify
2024/01/21 13:55:14 cmd/web.go:112:showWebStartupMessage() [I] * RunMode: prod
2024/01/21 13:55:14 cmd/web.go:113:showWebStartupMessage() [I] * AppPath: /usr/bin/gitea
2024/01/21 13:55:14 cmd/web.go:114:showWebStartupMessage() [I] * WorkPath: /usr/bin
2024/01/21 13:55:14 cmd/web.go:115:showWebStartupMessage() [I] * CustomPath: /storage/gitea
2024/01/21 13:55:14 cmd/web.go:116:showWebStartupMessage() [I] * ConfigFile: /etc/gitea/app.ini

Gitea Version

1.21.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.25.1

Operating System

Ubuntu 20.04

How are you running Gitea?

From commandline and installed as per https://gitlab.com/packaging/gitea

Database

SQLite

wxiaoguang commented 7 months ago

Not APP_DATA_PATH, use GITEA_WORK_DIR:

GITEA_WORK_DIR=/storage/gitea/ gitea web -c /etc/gitea/app.ini

or

gitea --config /etc/gitea/app.ini --work-path /storage/gitea/ web

Don't set others like GITEA_CUSTOM , they are not needed.

wxiaoguang commented 7 months ago

Feel free to reopen if there is still any problem.

github-actions[bot] commented 6 months ago

Automatically locked because of our CONTRIBUTING guidelines