-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Allow configuration of standard Unix layout #480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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.
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. |
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 |
Let's see if I can prepare a proper showcase within the docker container. |
I think the milestone of this should be 1.0.x, as it breaks upgrades from Gogs. |
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 |
This should do it, if it doesn't then we have a bug
|
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. |
@couling |
Is there a full list of tags recorded somewhere that I need to build with? |
there's a few oneliners floating around for |
https://docs.gitea.io/en-us/install-from-source/#build lists the regular build tags ;) |
@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.
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. |
@blankoworld There are basically two options:
|
@couling :
|
@blankoworld I have a similar setup. I use To my mind gitea defaults really need an overhaul to bring them inline with linux standards. |
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. :) |
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:
|
@MTecknology could you please send that as a PR? 🙂 |
@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.
|
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. |
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 |
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) |
@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. |
Since #6631 you can build Gitea with the defaults in the correct place |
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.ini
to 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.ini
settings and command-line args:The text was updated successfully, but these errors were encountered: