linuxserver / docker-ddclient

GNU General Public License v3.0
139 stars 36 forks source link

Allow using read-only volume without errors #48

Closed rugk closed 2 years ago

rugk commented 3 years ago

linuxserver.io


Desired Behavior

You should support read-only images without any errors:

---
version: "2.1"
services:
  ddclient:
    image: ghcr.io/linuxserver/ddclient
    container_name: ddclient
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - <path to data>:/config:ro
    restart: unless-stopped

The permission configuration (setting etc.) may be done once,

This is a security feature.

Current Behavior

If you use the current config, you suggest - <path to data>:/config everything works.

However when you mount the volume read-only, you get errors such as this:

chmod: changing permissions of '/config/ddclient.conf': Read-only file system

The container still works, but this is IMHO not good.

Alternatives Considered

github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

rugk commented 3 years ago

Uhm I did? It's a feature request…

Ah I restarted the browser in between, maybe GitHub missed the state then… sorry.

Roxedus commented 3 years ago

That message always comes on someone's first issue opened in the repo :)

tobbenb commented 3 years ago

The config file has a permission of 600, so it's only the user that could write to the file. I think this is better suited to be modified by yourself if you don't want the user running ddclient to have write access to the config file.

rugk commented 3 years ago

Yes, I can configure the permissions. Even to 600 (it is actually also already done). However, that does not prevent the errors like this from showing up:

chmod: changing permissions of '/config/ddclient.conf': Read-only file system

The container just wants to change the permission of the whole directory.

Maybe there can just be a variable for READ_ONLY_COMPATIBLE=true (or whatever you name variables) to just skip this patch?

tobbenb commented 3 years ago

It changes permissions on the ddclient.conf file, not only the folder. https://github.com/linuxserver/docker-ddclient/blob/4ef0cc7d8ef6ad45e2539e48e1f002e34622b437/root/etc/cont-init.d/30-config#L23-L25

If you want to use a read only volume you will have to modify it to suit your needs. I don't see a reason to implement this.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.