Seji64 / SniDust

SmartDNS Proxy to hide your GeoLocation. Based on DnsDist and nginx
GNU General Public License v3.0
149 stars 40 forks source link

Docker issues (Synology) #82

Open syhreality opened 2 days ago

syhreality commented 2 days ago

I have had issues running this with Docker on a Synology NAS. I seem to be having permission issues as per the following error: nginx: [emerg] mkdir() "/var/lib/nginx/tmp/client_body" failed (13: Permission denied).

I can allow access to this directory using chmod, but will I also need to define a volume path in the Docker config? Does this project need to be ran as root?

The compose file I am using is as follows:


  snidust:
    container_name: snidust
    image: 'ghcr.io/seji64/snidust:1.0.15'
    environment:
      PUID: 1027
      PGID: 100
      TZ: <MY_REGION>
      ALLOWED_CLIENTS: 0.0.0.0
      EXTERNAL_IP: <MY_IP>
      SPOOF_ALL_DOMAINS: false
    networks:
      snidust_network:
        ipv4_address: 192.168.1.200
    ports:
      - 443:8443/tcp
      - 80:8080/tcp
      - 53:5300/udp
    restart: always

networks:
  snidust_network:
    name: snidust_network
    driver: macvlan
    driver_opts:
      parent: eth4
    ipam:
      config:
        - gateway: "192.168.1.1"
          ip_range: "192.168.1.254/24"
          subnet: "192.168.1.0/24"
Seji64 commented 2 days ago

Hi,

no SniDust does not run as root (see: https://github.com/Seji64/SniDust/blob/9cbe5c27ef02ab4130096a7837bef61029b79125/Dockerfile#L80)

The root cause of your problem is that you specify a 'PUID' and 'PGUID'. So the Unix user 1027 indeed does not have the correct permission. What's the reason you specify 'PUID' ?

syhreality commented 2 days ago

Ahh, that's my mistake. PUID is for a docker user account that was created, it is used by my other containers.

I have removed the PUID and PGID environment variables and rebuilt the project however I still have the same issues in accessing nginx; nginx: [emerg] mkdir() "/var/lib/nginx/tmp/client_body" failed (13: Permission denied).

Do I need to create a user called snidust and give it permissions to /var/lib/nginx/?