-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
CurrentUsername
is not always reliable
#1640
Comments
I would say that this is a bug in |
One could see it that way, sure. But where are the chances better that it gets fixed? 😜 Btw, I just figured how Unknwon worked around that. The Gogs repo contains an init.d script which, with some minor adjustments, could be used for Gitea as well. And guess how it's achieved there? See e.g. lines 27 + 51:
As it would solve the underlying issue, may I suggest to "pull" that script, make the 3 minor adjustments (variables |
[x]
):Description
This is an issue existing with Gogs as well (but not considered an issue by Unknwon):
When starting Gitea via e.g.
init.d
usingstart-stop-daemon
(defining the correct user/group), I get the following error:Took me a while to figure (and only the linked Gogs issue brought me on the right path): the environment variable
$USER
still points toroot
, thoughid -un
as well aswhoami
indicate the script is running under the correct user (i.e.git:git
). I've worked around that using a shell script, prefixing thegitea web
command by a line statingUSER=$(id -un)
– but shouldn't Gitea figure that itself? Some other users might give up before figuring :)And while on it: is there a way to tell Gitea it should run in "daemon mode" instead of "in foreground" – other than using
&
?The text was updated successfully, but these errors were encountered: