borgbase / vorta-docker

Run Vorta inside Docker and access over VNC
https://vorta.borgbase.com
GNU General Public License v3.0
21 stars 2 forks source link

Running as root #20

Closed David-Lor closed 10 months ago

David-Lor commented 10 months ago

I'm trying this Docker image, but for my use-case it would be more suited to run Borg/Vorta as root, because I want to backup directories which may be owned by different users.

When trying to do so (by specifying the environment variables USER_ID=0 & GROUP_ID=0), the container fails to start:

[cont-init   ] 50-init.sh: usermod: user app is currently used by process 1

This seems to be caused by this call: https://github.com/borgbase/vorta-docker/blob/d70df5afc8c4ad71cf494773df0b8cc1a9e9809f/rootfs/etc/cont-init.d/50-init.sh#L9

I've tried building an image with the mentioned line commented out, and deployed it. Everything seems to be working fine, at least for now. If I re-create the container, with the same Home (/config) mounted, my saved profiles are kept.

So my question would be: what does the mentioned command does; could it be safely ignored?

Ranbato commented 10 months ago

It is really not recommended to run containers as root. Any vulnerability in the container and there goes your machine. That being said, I think you will also need to change: https://github.com/borgbase/vorta-docker/blob/d70df5afc8c4ad71cf494773df0b8cc1a9e9809f/rootfs/startapp.sh#L3

David-Lor commented 10 months ago

@Ranbato Understood, thanks for the hints. I'll be closing the PR then. Regards!