Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jenssels opened this issue Dec 1, 2023 · 3 comments
Open

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

jenssels opened this issue Dec 1, 2023 · 3 comments

Comments

@jenssels
Copy link

jenssels commented Dec 1, 2023

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
Copy link
Member

VibroAxe commented Dec 1, 2023

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
Copy link
Author

jenssels commented Dec 1, 2023

_lancache-core_logs.txt

Here are the full logs

@VibroAxe
Copy link
Member

VibroAxe commented Jul 8, 2024

This is error is being generated because the sels-net-cachcor user doesn't exist in the context. Looking into this it's because the WEB_USER context is created during the container build and is not a user env. We perhaps need to look into how this might work in the future if it's needed in more use cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants