APP_DATA_PATH should not default to directory next to executable file #1318

Closed
opened 2025-11-02 03:56:29 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @0rzech on GitHub (Dec 3, 2017).

As of now, the lack of GITEA_CUSTOM variable results in Gitea attempting to create its data directory next to executable file.

This is both counter intuitive and defective, because in most (I guess) cases, the executable will be placed in read-only directory. This may lead to issues like #3052, where developer uses right variable, but user still ends up with broken install.

The APP_DATA_PATH should default to ${HOME}/gitea on Linux and similar directories on other supported operating systems. These directories are writable by default and when there's no home directory, it was likely due to conscious admin decision.

Originally created by @0rzech on GitHub (Dec 3, 2017). As of now, the lack of `GITEA_CUSTOM` variable results in Gitea attempting to create its `data` directory next to executable file. This is both counter intuitive and defective, because in most (I guess) cases, the executable will be placed in read-only directory. This may lead to issues like #3052, where developer uses right variable, but user still ends up with broken install. The `APP_DATA_PATH` should default to `${HOME}/gitea` on Linux and similar directories on other supported operating systems. These directories are writable by default and when there's no home directory, it was likely due to conscious admin decision.
GiteaMirror added the issue/stale label 2025-11-02 03:56:29 -06:00
Author
Owner

@lafriks commented on GitHub (Dec 3, 2017):

If no environment variable is set it defaults to current working directory I think

@lafriks commented on GitHub (Dec 3, 2017): If no environment variable is set it defaults to current working directory I think
Author
Owner

@0rzech commented on GitHub (Dec 3, 2017):

Looks like it was the case until #3052, nevertheless the documentation says:

If you install Gitea from binary, after the installation process ends, you can find the custom folder next to the binary.

All in all, both relative-to-executable and PWD dependent values are rather unusual choices for this kind of software.

@0rzech commented on GitHub (Dec 3, 2017): Looks like it was the case until #3052, nevertheless the [documentation](https://docs.gitea.io/en-us/customizing-gitea/) says: > If you install Gitea from binary, after the installation process ends, you can find the custom folder next to the binary. All in all, both relative-to-executable and `PWD` dependent values are rather unusual choices for this kind of software.
Author
Owner

@lafriks commented on GitHub (Dec 3, 2017):

CWD is for ease of use when developing and also has been so historically.
It has been relative to executable from the start of the development but we have tried to move away from that and with 1.3.0 I hoped we have done that but probably there is still some error somewhere :(

@lafriks commented on GitHub (Dec 3, 2017): `CWD` is for ease of use when developing and also has been so historically. It has been relative to executable from the start of the development but we have tried to move away from that and with 1.3.0 I hoped we have done that but probably there is still some error somewhere :(
Author
Owner

@stale[bot] commented on GitHub (Feb 10, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 10, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Feb 24, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Feb 24, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1318