-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Change behavior for GITEA_WORK_DIR #1419
Comments
Can you post your gitea configuration file or at least tell me if the path to your database is absolute? |
Is was relative. Thanks for that. But this doesn't solve the unexpected behavior of |
GITEA_WORK_DIR should be set yourself in your shell profile? |
I agree the behavior should be for the default to be |
Yes. But this isn't the point of this issue. Also, in my opinion it's not documentend well enough, that you should set GITEA_WORK_DIR. |
I think it's fixed by #2192. Reopen if there is still issue |
Background
If I add SSH keys, I won't be able to log in. I get this error message:
[...io/gitea/cmd/serv.go:99 runServ()] [F] setup: Failed to connect to database: Failed to create directories: mkdir data: permission denied
in
/var/log/gitea/serv.log
.To fix this, I have to replace
command="/usr/bin/gitea serv key-3 --config=/etc/gitea/app.ini"
with
command="GITEA_WORK_DIR=/var/lib/gitea /usr/bin/gitea serv key-3 --config=/etc/gitea/app.ini"
in
.ssh/authorized_keys
.Change behavior for GITEA_WORK_DIR
A quick check with
strace
shows, thatgitea
does achdir("/usr/bin")
followed by a
stat64("data", 0x11f99614) = -1 ENOENT (No such file or directory)
.You can find this
chdir
in cmd/serv.go.I don't get why this environment variable is defaulted to
/usr/bin
. By default it should bepwd
.I first tried to write
command="cd /var/lib/gitea && /usr/bin/gitea serv key-3 --config=/etc/gitea/app.ini"
and this (obviously) didn't work for this reason.
Setup
The text was updated successfully, but these errors were encountered: