[BUG] Rootless needs /data/git mounted to /var/lib/gitea/git #155
Closed
opened 2021-05-06 14:37:59 +00:00 by viceice
·
15 comments
No Branch/Tag Specified
main
renovate/postgresql-ha-15.x
renovate/postgresql-16.x
renovate/redis-20.x
renovate/redis-cluster-11.x
fix-674
app-ini-recreation
fix-env-to-ini
clean-app-ini
gitea-ha
v10.6.0
v10.5.0
v10.4.1
v10.4.0
v10.3.0
v10.2.0
v10.1.4
v10.1.3
v10.1.2
v10.1.1
v10.1.0
v10.0.2
v10.0.1
v10.0.0
v9.6.1
v9.6.0
v9.5.1
v9.5.0
v9.4.0
v9.3.0
v9.2.1
v9.2.0
v9.1.0
v9.0.4
v9.0.3
v9.0.2
v9.0.1
v9.0.0
v8.3.0
v8.2.0
v8.1.0
v8.0.3
v8.0.2
v8.0.1
v8.0.0
v7.0.4
v7.0.3
v7.0.2
v7.0.1
v7.0.0
v6.0.5
v6.0.4
v6.0.3
v6.0.2
v6.0.1
v6.0.0
v5.0.9
v5.0.8
v5.0.7
v5.0.6
v5.0.5
v5.0.4
v5.0.3
v5.0.2
v5.0.1
v5.0.0
v4.1.1
v4.1.0
v4.0.3
v4.0.2
v4.0.1
v4.0.0
v3.1.4
v3.1.3
v3.1.2
v3.1.1
v3.1.0
v3.0.0
v2.2.5
v2.2.4
v2.2.3
v2.2.2
v2.2.1
v2.2.0
v2.1.11
v2.1.10
v2.1.9
v2.1.8
v2.1.7
v2.1.6
v2.1.5
v2.1.4
v2.1.3
v2.1.2
v2.1.1
v2.1.0
v2.0.7
v2.0.6
v2.0.5
v2.0.4
v2.0.3
v2.0.2
v2.0.0
v1.5.5
v1.5.4
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.4.9
v1.4.8
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.2
Labels
Clear labels
has/backport
in progress
invalid
kind/breaking
kind/bug
kind/build
kind/dependency
kind/deployment
kind/docs
kind/enhancement
kind/feature
kind/lint
kind/proposal
kind/question
kind/refactor
kind/security
kind/testing
kind/translation
kind/ui
need/backport
priority/critical
priority/low
priority/maybe
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
upstream/other
No Label
kind/bug
Milestone
No items
No Milestone
Release 4.0.0
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: lunny/helm-chart#155
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.
No description provided.
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?
With the latest rootless image,
$HOME
is pointing to/var/lib/gitea/git
but this chart is not mounting to that dir.My workaround for now is this:
I did found this, because gitea wasn't able to find my gpg key, which is in
/data/git
instead of/var/lib/gitea/git
Will look into this. Haven't noticed any issues with 1.14.1 on my system.
I only noticed that gitea didn't find the gpg key because of wrong / changed home dir.
using something like:
Seems to be no generic issue with the signing in general. Setting
SIGNING_KEY = default
and configuring via.gitconfig
looks like it works (at least in 1.14.2). You are setting the signing key explicitly inapp.ini
, right?yes, as shown in comment above. ?
? Wasn't sure. Can verify that it doesn't work with the signing key set in
app.ini
but am not sure yet, if it's an issue with the chart or if this setting maybe not working for rootless in general. Will check this.setting works with my additional mount. ?
Hrm. As far as I could find out, it's not working with a basic docker container outside of Kubernetes either. For both image variants. I got it working when configuring the signingkey inside the.gitignore
file as well as settingSIGNING_KEY = <keyid>
inapp.ini
. I am not sure, if this is intended. ?Also, I was not able to get it working with your suggested workaround. The override of thedata
mountPath seems to not properly work (in my environment). Have you changed something else?EDIT: Incorrect statement.
@viceice ? Hi! This time with an awake mind. I was way too tired.
I've tested your report again and don't have problems with commit signing. I didn't change anything in
~/.gitconfig
. Invalues.yaml
I added the following:Manually imported public and private key via
gpg --import ...
from inside the running container withgit
user context.When I create a repository, the initial commit is signed. Changing files through the UI also creates signed commit.
Sorry for any confusion because of my latest posts. Is it possible to share a bit more details about your helm chart configuration?
app.ini
signing settings? Via environment variables or as config object insidevalues.yaml
like I did?~/.gitconfig
looks like?I am using Gitea rootless 1.14.2.
I've migrated from 1.13 root image to 1.14 root. and then to the rootless image. so thd key import was on v1.13 and works with v1.14 root image. but after switch to rootless git searches in the homedir i mentioned.
i can provide my basic config tomorrow.
values.yaml
The
${xxx}
values are replaced by terraformtemplatefile
Additional values via terraform:
gitea.config.security.SECRET_KEY
gitea.config.storage.MINIO_SECRET_ACCESS_KEY
gitea.config.oauth2.JWT_SECRET
persistence.existingClaim
Thanks for sharing. I'll have a closer look at it in the next few days.
I think the major difference bewteen the root and rootless images if the
HOME
path.In old root image i've imported the gpg key on running container and it was saved to
/data/git
, but when i swiched to the rootless image, it starts to search in/var/lib/gitea/git
for the gpg key, as theHOME
path is changed to that path.Thats why it simply works for me to additionally mount my data volume to
/var/lib/gitea
.Hi @viceice.
You are right. That's the main difference and the actual root cause of this issue. I tested your mentioned migration path from rootful to rootless image usage and was able to reproduce that behaviour.
The
HOME
path is not persistent in rootless, so the.gnupg
folder is't either. Since the helm chart always used/data/...
as mount point for storage of all kinds, it would be a minimal impact to just relocate the default dynamic$HOME/.gnupg
folder location to/data/git/.gnupg
. This is where the signing keys are stored when running rootful-based environments. I've created a Pull Request to always use that persistent location for.gnupg
.Doing so should
Can you verify that my PR fixes your issue? Would appreciate your feedback on that.
Sure, I'll can't test the pr directly but it seems i only need to set the
GNUPGHOME
env instead of my mount workaround.Will test it tomorrow or monday. ?
Works ?