linuxserver / docker-ddclient

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

PUID/PGID not applied to some config files #53

Closed danepowell closed 3 years ago

danepowell commented 3 years ago

linuxserver.io


Expected Behavior

When setting a PUID and PGID, these IDs should be applied to all files created in the config folder.

Current Behavior

ddclient.conf has the correct owner, but two other directories are created as root regardless of the PUID/PGID:

Steps to Reproduce

version: '3'
services:
  ddclient:
    image: linuxserver/ddclient
    container_name: ddclient
    restart: ${RESTARTPOLICY}
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    volumes:
      - ${DATAFOLDER}/ddclient:/config
    networks:
      - web

networks:
  web:
    external: true

Environment

OS: WSL2 CPU architecture: x86_64 How docker service was installed:

Command used to create docker container (run/create/compose/screenshot)

docker-compose up

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
Setting up watches.
Watches established.
[services.d] done.
WARNING:  cannot connect to myip.dnsomatic.com:80 socket: IO::Socket::INET: Bad hostname 'myip.dnsomatic.com'
WARNING:  found neither ipv4 nor ipv6 address
WARNING:  file /var/cache/ddclient/ddclient.cache, line 3: Invalid Value for keyword 'ip' = ''
SUCCESS:  updating *********************
github-actions[bot] commented 3 years ago

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

aptalca commented 3 years ago

custom init and service folders are meant to be owned by root so an unprivileged user (or app) doesn't gain root inside the container

danepowell commented 3 years ago

Can this be documented, so people don't expect PUID/PGID to apply to these directories? How can one work around the issue of directories being owned by root on the host machine?