mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-22 06:24:14 -05:00
Allow configuration of standard Unix layout #157
Closed
opened 2025-11-02 03:11:10 -06:00 by GiteaMirror
·
24 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v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1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#157
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @couling on GitHub (Dec 26, 2016).
The current install instructions suggests gitea should be run from a single directory (
/home/git/gitea)This is very non-standard for *nix operating systems and will irritate a lot of sysadmins. I've had earlier versions (gogs) running based on standard layout by configuring
app.inito point to the various directories. But this seems to have broken. The following now seems to be partially ignored.My current work around is to construct a directory
/var/lib/gitea/and use symlinks to bring everything into one place.Our aim ought to be to allow the following layout relatively purely through a handful of
app.inisettings and command-line args:@kjellkvinge commented on GitHub (Dec 26, 2016):
Hi. In my setup, I have the binary in /usr/local/bin,
It was somewhat confusing to get the files where I wanted them, but I managed without symlinks.
the configfile contains:
working directory + /data is where sessions and tmp is placed. This is set by the init script.
I am not sure if there is more "hidden" config values that could make this more easy.
@tboerger commented on GitHub (Dec 26, 2016):
I also don't like the current default behavior for the directories, but changing that means possibly breaking things. Hopefully we will provide better defaults in future releases
@tboerger commented on GitHub (Dec 26, 2016):
Let's see if I can prepare a proper showcase within the docker container.
@strk commented on GitHub (Dec 27, 2016):
I think the milestone of this should be 1.0.x, as it breaks upgrades from Gogs.
Is it a problem to make STATIC_ROOT_PATH work again with the new bindata mechanism ?
@couling commented on GitHub (Dec 27, 2016):
Digging into this a little more. The current thing stopping my setup is that I get the error:
This seems to be failing if the conf directory isn't in the CWD (eg: the CWD isn't set to
/home/git/custom). This a subtly a different bug than I thought. Do you want me to raise a seperate issue and keep this one clean?@bkcsoft commented on GitHub (Dec 29, 2016):
This should do it, if it doesn't then we have a bug :trollface:
@couling commented on GitHub (Jan 4, 2017):
Yeah that still fails unless I set my working directory first.
This is the only item I know if that is affected by the current working directory. I'm pretty sure its a recent change that's caused it but I can't find what it was.
@bkcsoft commented on GitHub (Jan 20, 2017):
@couling
conf/is built into the binary when built withTAGS="bindata", should fix your issue :)@couling commented on GitHub (Jan 20, 2017):
Is there a full list of tags recorded somewhere that I need to build with?
@bkcsoft commented on GitHub (Jan 21, 2017):
there's a few oneliners floating around for
greping the files for build-tags, but AFAIK there's onlybindata,sqlite🙂@tboerger commented on GitHub (Jan 24, 2017):
https://docs.gitea.io/en-us/install-from-source/#build lists the regular build tags ;)
@blankoworld commented on GitHub (May 17, 2017):
@couling I encount the same problem as you about conf/locale/locale_en-US.ini but I don't understand the way you fix the problem.
Mine was:
So I agree with this topic that it's quite difficult on standard Unix to deal with files and directories without the "bindata" option when building Gitea. AUR package doesn't provide any "bindata" option when building.
@couling commented on GitHub (May 17, 2017):
@blankoworld There are basically two options:
cdto the conf directory directorymakeYou need
make TAGS="bindata"@blankoworld commented on GitHub (May 17, 2017):
@couling :
@couling commented on GitHub (May 17, 2017):
@blankoworld I have a similar setup. I use
/srv/gitea/but the principle is the same. The other difference is that I spread out some files across the filesystem (eg my config files are in/etc). If you work in a single directory, you will want to change the home directory of the user running gitea to/srv/www/gitea. If your configuration is there as well then before running gitea you need tocd /srv/www/gitea/confOR you need to build gitea with the bindata tag as indicated above..To my mind gitea defaults really need an overhaul to bring them inline with linux standards.
@MTecknology commented on GitHub (Jul 30, 2017):
I don't disagree with gitea being written to run from a single directory. There are many applications that are written to run this way because of the developer's workflow. Gitea has a lot of configuration options available in app.ini and I'd say we're pretty close to being able to deploy gitea in the "standard unix" structure.
If #2229, and to a lesser degree #2228, were resolved, the rest isn't much more than tweaking the default configuration file when deploying from a package. Easy peasy. :)
@MTecknology commented on GitHub (Oct 26, 2017):
It took a LOT of hacking and the result isn't very pretty, but I have something that follows a standard layout. https://people.debian.org/~mtecknology/ppa/README (unfinished, but presentable for this discussion)
Some of the relevant hacking:
@bkcsoft commented on GitHub (Oct 29, 2017):
@MTecknology could you please send that as a PR? 🙂
@MTecknology commented on GitHub (Oct 30, 2017):
@bkc No, not really. The hacks that I needed for this deployment approach
wouldn't work well for dev-style deployments. (I would encourage you to review
them.) We need some sort of compromise and I'm hoping a working example of gitea
running this way can aid that discussion.
The first thing I noticed is that gitea uses the location of the binary
location as the root for all relative paths. This can be overridden with an
environment variable, but environment variables are rather clunky for
production-style deployments (and undocumented). It would be more convenient if
the root could be configured via app.ini or build-time variable.
It would also be nice if the expected location for app.ini could be
configured at build time.
One big headache I noticed was how frequently I needed to set static paths.
This would be hard to fix, but setting some top level dirs (data/, public/,
custom/, etc.) in a global config section and making all making other
variable relative to them (instead of just setting static paths all over) would
clean up that logic.
We have STATIC_ROOT_PATH and APP_DATA_PATH in the configuration file, but they
seem to be in sections that lack useful scope and seem to be ineffective where
they're at.
The actual directory structure is mostly fine, but the way the configuration is
clunky. I do think indexers should move to being underneath data/ since data/
seems to be variable stuff.
Something that I found extremely annoying, that I suspect will someday come
back to bite, is gitea needing write access to config file locations. Gitea
shouldn't need to re-create app.ini when it starts. It shouldn't need to write
anything at all. Instead, it won't start when it can't edit.
@blankoworld commented on GitHub (Oct 30, 2017):
You're right about documentation, a lot of variables aren't documented. But we have https://docs.gitea.io/en-us/specific-variables/. And it should be fine if developers or contributors can complete progressively this page ^_^.
I was also afraid since Gitea 1.2.2 to see that app.ini should be overwritten by Gitea itself. But this seems to be same thing for other tools as Mattermost. In Mattermost, either you edit the configuration and then you start the service or you start the service and update the configuration through the web interface (which update your configuration file). Seems to be dangerous, but I don't know how to keep configuration you update through the web interface.
@lafriks commented on GitHub (Feb 19, 2018):
I think currently it is possible to have correct standard unix layout with correctly configured app.ini so I think we can close this issue
@MTecknology commented on GitHub (Feb 19, 2018):
With enough fiddling, yes, it's possible to get gitea to mostly adhere to standards. I absolutely wouldn't consider this closed, but I'm also not interested in chasing this. (using gitolite now)
@lafriks commented on GitHub (Feb 20, 2018):
@MTecknology changes are needed only in app.ini. In previous versions it was still using relative to binary paths that were not possible to set in app.ini but with latest version this has been fixed.
What else needs to be done to consider this issue fixed?
@zeripath commented on GitHub (May 1, 2019):
Since #6631 you can build Gitea with the defaults in the correct place