lancachenet / monolithic

A monolithic lancache service capable of caching all CDNs in a single instance
https://hub.docker.com/r/lancachenet/monolithic
Other
725 stars 73 forks source link

Not possible to run monolithic as any other user than www-data #184

Open jenssels opened 7 months ago

jenssels commented 7 months ago

Describe the issue you are having

I'm trying to run the monolithic docker container under a custom user using the WEBUSER Env variable but it seems to only work using www-data user.

This is annoying as all my share permissions are configured for custom users.

For now I have to make the share readable for www-data which might be used by other containers.

How are you running the container(s)

version: '3'  

services:
    core:
        image: lancachenet/monolithic:latest
        container_name: lancache-core
        hostname: lancache-core
        user: 0:1920
        networks:
            cache_network:
                ipv4_address: 192.168.x.x
        ports:
          - 80:80
          - 443:443
        environment:
          - PUID=1920 # I know this doesn't work but included for documentation purposes
          - PGID=1920 # I know this doesn't work but included for documentation purposes
          - UMASK=007 # I know this doesn't work but included for documentation purposes
          - TZ=Europe/Brussels
          - WEBUSER=sels-net-cachcor # also tried with the UID. Same issue
          - CACHE_DISK_SIZE=4000g
          - CACHE_INDEX_SIZE=1000m
          - UPSTREAM_DNS=192.168.x.x
        volumes:
          - '/path/to/cache:/data/cache'
          - '/somedir/Domains/:/data/cachedomains'
          - '/somedir/Logs/:/data/logs'
          - '/somedir/:/var/www'
        restart: unless-stopped  

    dns:
        image: lancachenet/lancache-dns:latest
        container_name: lancache-dns
        hostname: lancache-dns
        user: 0:1920
        depends_on:
            - core
        networks:
            cache_network:
                ipv4_address: 192.168.x.x
        ports:
          - 53:53
        environment:
          - PUID=1921 # I know this doesn't work but included for documentation purposes
          - PGID=1920 # I know this doesn't work but included for documentation purposes
          - UMASK=007 # I know this doesn't work but included for documentation purposes
          - TZ=Europe/Brussels
          - LANCACHE_IP=192.168.x.x
          - UPSTREAM_DNS=192.168.x.x
          - USE_GENERIC_CACHE=true
        restart: unless-stopped

networks:
  cache_network:
    external:
         name: LanNetwork

DNS Configuration

Not relevant. Dns is working

Output of container(s)

nginx: [emerg] getpwnam("sels-net-cachcor") failed in /etc/nginx/nginx.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
ERROR: hook /hooks/supervisord-pre.d/99_config_check.sh} returned a non-zero exit status '0'

This causes the container to crash and restart

VibroAxe commented 7 months ago

Can you provide the full container output into a gist. The lines above contain the actual nginx config generated which would be very helpful here?

jenssels commented 7 months ago

_lancache-core_logs.txt

Here are the full logs