Skip to content
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

Doctor's AppPath might be different when run inside Docker #14468

Closed
CirnoT opened this issue Jan 26, 2021 · 2 comments · Fixed by #17846
Closed

Doctor's AppPath might be different when run inside Docker #14468

CirnoT opened this issue Jan 26, 2021 · 2 comments · Fixed by #17846
Labels
topic/distribution This PR changes something about the packaging of Gitea type/bug

Comments

@CirnoT
Copy link
Contributor

CirnoT commented Jan 26, 2021

I run gitea with this command:

docker run -d --restart=always --publish 3000:3000 \
--publish 22:22 --network gitea \
-v /opt/gitea:/data \
-v /etc/timezone:/etc/timezone:ro \
-v /etc/localtime:/etc/localtime:ro \
-e USER_UID=1218 -e USER_GID=1218 \
-e GITEA_WORK_DIR=/data/gitea -e GITEA_CUSTOM=/data/gitea/custom \
--name=gitea gitea/gitea:latest

The AppPath is /app/gitea/gitea and such is written to authorized_keys, however when executing docker exec -ti gitea su git bash -c "cd /data/gitea/log && gitea doctor" the AppPath is /usr/local/bin/gitea. This issue leads to doctor always complaining that authorized_keys is out of date.

@lunny lunny added the type/bug label Jan 26, 2021
@CirnoT
Copy link
Contributor Author

CirnoT commented Jan 26, 2021

This can be mitigated by using docker exec -ti gitea su git bash -c "cd /data/gitea/log && /app/gitea/gitea doctor", i.e explicitly providing /app/gitea/gitea as path

@zeripath
Copy link
Contributor

I suspect it would be easier to change the docker PATH to place /app/gitea/ on the PATH before /use/local/bin

Another option would be to change the docker exec to run /use/local/bin/gitea instead of /app/gitea/gitea but I think that would no doubt cause other issues with data paths etc.

zeripath added a commit to zeripath/gitea that referenced this issue Oct 31, 2021
Too many docker users are caught out by the default location for the
app.ini file being environment dependent so that when they docker exec
into the container the `gitea` commands do not work properly and require
additional `-c` arguments to correctly pick up the configuration.

This PR simply builds the default locations into the build.

Fix go-gitea#14468
Reference go-gitea#17497
Reference go-gitea#12082
Reference go-gitea#8941
 ... amongst others ...

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Nov 28, 2021
Too many docker users are caught out by the default location for the
app.ini file being environment dependent so that when they docker exec
into the container the gitea commands do not work properly and require
additional -c arguments to correctly pick up the configuration.

This PR simply shadows the gitea binary using variants of the FHS
compatible script to make the command gitea have the default locations
by default.

Fix go-gitea#14468
Reference go-gitea#17497
Reference go-gitea#12082
Reference go-gitea#8941
... amongst others ...
Replace go-gitea#17501

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Dec 1, 2021
Too many docker users are caught out by the default location for the
app.ini file being environment dependent so that when they docker exec
into the container the gitea commands do not work properly and require
additional -c arguments to correctly pick up the configuration.

This PR simply shadows the gitea binary using variants of the FHS
compatible script to make the command gitea have the default locations
by default.

Fix #14468
Reference #17497
Reference #12082
Reference #8941
... amongst others ...
Replace #17501

Signed-off-by: Andrew Thornton <art27@cantab.net>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
Too many docker users are caught out by the default location for the
app.ini file being environment dependent so that when they docker exec
into the container the gitea commands do not work properly and require
additional -c arguments to correctly pick up the configuration.

This PR simply shadows the gitea binary using variants of the FHS
compatible script to make the command gitea have the default locations
by default.

Fix go-gitea#14468
Reference go-gitea#17497
Reference go-gitea#12082
Reference go-gitea#8941
... amongst others ...
Replace go-gitea#17501

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
@delvh delvh added topic/distribution This PR changes something about the packaging of Gitea and removed theme/docker labels Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/distribution This PR changes something about the packaging of Gitea type/bug
Projects
None yet
4 participants