Skip to content

Dump permissions on container's mounted user dir #35612

@homelan-git

Description

@homelan-git

Description

Hi,

I've read some threads about the permissions before. I also read about man: gitea dump and Gitea Backup and Restore. Anyway, for me the problem still exist for my use case:

# all went fine
core@coreos-test:~$ podman exec -u git --workdir /tmp gitea bash -c '/usr/local/bin/gitea dump --skip-db --type tar --file "/tmp/gitea-dump-$(date +%F).tar" --verbose --config /data/gitea/conf/app
.ini'
....
# went wrong:
core@coreos-test:~$ podman exec -u git --workdir /backup gitea bash -c 'ls -la /backup && /usr/local/bin/gitea dump --skip-db --type tar --file "/backup/gitea-dump-$(date +%F).tar" --verbose --config /data/gitea/conf/app.ini'
total 0
drwxr-xr-x    2 root     root            44 Oct  9 19:00 .
dr-xr-xr-x    1 root     root            65 Oct  9 19:47 ..
-rw-r--r--    1 root     root             0 Oct  9 19:47 db-gitea-backup-2025-10-09.sql
2025/10/09 19:48:22 cmd/dump.go:101:fatal() [F] Unable to create dump file "/backup/gitea-dump-2025-10-09.tar": open /backup/gitea-dump-2025-10-09.tar: permission denied

As you can see, I'm using Fedora CoreOS (hence with SELinux), Gitea with MariaDb and have a Quadlet:

[Unit]
Description=Gitea: Git with a cup of tea - A painless self-hosted Git service.
Requires=gitea-db.service
After=gitea-db.service

[Container]
Image=docker.io/gitea/gitea:1.24
ContainerName=gitea
...

Volume=gitea-data:/data:Z
Volume=/etc/localtime:/etc/localtime:ro
Volume=%h/backup/gitea://backup:rw,Z

...

On host I have:

core@coreos-test:~$ ll
drwxr-xr-x. 3 core core  19 Oct  8 19:14 backup
core@coreos-test:~$ ll backup/
drwxr-xr-x. 2 core core 44 Oct  9 19:00 gitea
core@coreos-test:~$ ll backup/gitea/
-rw-r--r--. 1 core core 0 Oct  9 19:47 db-gitea-backup-2025-10-09.sql

Gitea as git user hasn't permissions to write (even root could). How is this use-case intended to be used? Maybe not really a problem with the Image, but not sure about. Any help is appreciated.

Gitea Version

1,24

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

From OCI Image on CentOS with rootless podman.

Database

MySQL/MariaDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/not-a-bugThe reported issue is the intended behavior or the problem is not inside Gitea

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions