GITEA_WORK_DIR not being used for GITEA_CUSTOM when looking up locales #9702

Closed
opened 2025-11-02 08:47:08 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @plsnp on GitHub (Oct 18, 2022).

Description

https://docs.gitea.io/en-us/environment-variables/

The documentation says:

GITEA_CUSTOM: Gitea uses GITEA_WORK_DIR/custom folder by default. Use this variable to change custom directory.

However setting GITEA_WORK_DIR is not sufficient for looking up locales and GITEA_CUSTOM must be set explicitly.

gitea2@myserver~/gitea
» HOME=/home/gitea2 GITEA_WORK_DIR=/home/gitea2/gitea /usr/local/bin/gitea2 -c /home/gitea2/gitea/conf/app.ini web
.. some log messages before
2022/10/18 15:16:59 ...ation/translation.go:60:InitLocales() [F] Failed to list locale files: Failed to check if custom directory stat /etc/gitea/options/locale: permission denied is a directory. %!v(MISSING)
gitea2@myserver~/gitea
» HOME=/home/gitea2 GITEA_CUSTOM=/home/gitea2/gitea/custom GITEA_WORK_DIR=/home/gitea2/gitea /usr/local/bin/gitea2 -c /home/gitea2/gitea/conf/app.ini web
2022/10/18 15:17:25 cmd/web.go:106:runWeb() [I] Starting Gitea on PID: 23564
.. after this failure doesn't show up and booting of gitea continues ..

I looked in app.ini for keywords etc and locale but i didn't see any reason why it might be reading from the path /etc/gitea/options/locale

Gitea Version

1.17.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

downloaded binary from official website

Database

PostgreSQL

Originally created by @plsnp on GitHub (Oct 18, 2022). ### Description https://docs.gitea.io/en-us/environment-variables/ The documentation says: > GITEA_CUSTOM: Gitea uses GITEA_WORK_DIR/custom folder by default. Use this variable to change custom directory. However setting `GITEA_WORK_DIR` is not sufficient for looking up locales and `GITEA_CUSTOM` must be set explicitly. ``` gitea2@myserver~/gitea » HOME=/home/gitea2 GITEA_WORK_DIR=/home/gitea2/gitea /usr/local/bin/gitea2 -c /home/gitea2/gitea/conf/app.ini web .. some log messages before 2022/10/18 15:16:59 ...ation/translation.go:60:InitLocales() [F] Failed to list locale files: Failed to check if custom directory stat /etc/gitea/options/locale: permission denied is a directory. %!v(MISSING) ``` ``` gitea2@myserver~/gitea » HOME=/home/gitea2 GITEA_CUSTOM=/home/gitea2/gitea/custom GITEA_WORK_DIR=/home/gitea2/gitea /usr/local/bin/gitea2 -c /home/gitea2/gitea/conf/app.ini web 2022/10/18 15:17:25 cmd/web.go:106:runWeb() [I] Starting Gitea on PID: 23564 .. after this failure doesn't show up and booting of gitea continues .. ``` I looked in `app.ini` for keywords `etc` and `locale` but i didn't see any reason why it might be reading from the path `/etc/gitea/options/locale` ### Gitea Version 1.17.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? downloaded binary from official website ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 08:47:08 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9702