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

Closed
opened 2025-11-02 10:07:24 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @Evidlo on GitHub (Jan 21, 2024).

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

Originally created by @Evidlo on GitHub (Jan 21, 2024). ### 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](https://github.com/go-gitea/gitea/assets/5455841/e7568399-fc7c-4da6-b321-e2702f022bbc) 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
GiteaMirror added the issue/needs-feedback label 2025-11-02 10:07:24 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jan 22, 2024):

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 on GitHub (Jan 22, 2024): 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.
Author
Owner

@wxiaoguang commented on GitHub (Jan 24, 2024):

Feel free to reopen if there is still any problem.

@wxiaoguang commented on GitHub (Jan 24, 2024): Feel free to reopen if there is still any problem.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 29, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Feb 29, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12365