Coder Social home page Coder Social logo

Comments (15)

Akjo4712 avatar Akjo4712 commented on August 19, 2024 1

Long Story Short, i mixed up how to properly set Environment Variables and didn't notice while debugging. I should have used a equation sign for the variables. Its the small things which matter. 😆

from docker-nginx-webdav-nononsense.

vitjok avatar vitjok commented on August 19, 2024

Hello,
I did some searching/testing and I found, that it works as expected with latest build from docker hub:

$ sudo docker run --rm=true -it -e PGID=1002 -e PUID=1003 -e HOME=/root dgraziotin/nginx-webdav-nononsense bash
Unable to find image 'dgraziotin/nginx-webdav-nononsense:latest' locally
latest: Pulling from dgraziotin/nginx-webdav-nononsense
d8b3c89fedca: Already exists 
73fe378574c5: Already exists 
4d5722c9380e: Already exists 
b445ca4bb77f: Already exists 
641a8023ecce: Already exists 
18792a0c5d08: Already exists 
750c20048139: Already exists 
2004db8fde4a: Pull complete 
4f4fb700ef54: Pull complete 
4d28955de9d3: Pull complete 
eb32dd4d8370: Pull complete 
9e4c50c9404e: Pull complete 
b3a9d81dff0a: Pull complete 
0a662af47fc3: Pull complete 
119dcc9a2fa3: Pull complete 
7dcb030f2424: Pull complete 
Digest: sha256:e8d692802da821aede90d5ffa7417271614053347797c36d8163017a99a11d3a
Status: Downloaded newer image for dgraziotin/nginx-webdav-nononsense:latest
[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:    1003
User gid:    1002
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
root@721c2fcdff4f:/usr/src/nginx-1.21.1# id abc
uid=1003(abc) gid=1002(abc) groups=1002(abc),100(users)
root@721c2fcdff4f:/usr/src/nginx-1.21.1#

As described in #17 , the latest label was pushed on Jul 13, 2021. So I tested with label 1.21.4, it was pushed on Dec 17, 2021. And in this test the same issue seams to occur:

$ sudo docker run --rm=true -it -e PGID=1002 -e PUID=1003 -e HOME=/root dgraziotin/nginx-webdav-nononsense:1.21.4 bash
Unable to find image 'dgraziotin/nginx-webdav-nononsense:1.21.4' locally
1.21.4: Pulling from dgraziotin/nginx-webdav-nononsense
d8b3c89fedca: Already exists 
73fe378574c5: Already exists 
4d5722c9380e: Already exists 
b445ca4bb77f: Already exists 
641a8023ecce: Already exists 
18792a0c5d08: Already exists 
750c20048139: Already exists 
e121e8f7df57: Pull complete 
0058e9433bd5: Pull complete 
63d39ccdc2f6: Pull complete 
af27e6eb347a: Pull complete 
e9d4faaa523a: Pull complete 
9e28aaeb8b70: Pull complete 
18dcf75aa4df: Pull complete 
2b9adfbdcc55: Pull complete 
c04a7cc83a64: Pull complete 
Digest: sha256:c091ed9937f7b1a4a2ff98e7c71e0b119679246a698192736cd2209253b99ab6
Status: Downloaded newer image for dgraziotin/nginx-webdav-nononsense:1.21.4
root@04a306307c9e:/data# id abc
uid=911(abc) gid=1000(abc) groups=1000(abc),100(users)
root@04a306307c9e:/data# 

Note: The PGID setting is also ignored.

from docker-nginx-webdav-nononsense.

Akjo4712 avatar Akjo4712 commented on August 19, 2024

Can confirm the Issue, was just about to open a new Issue for this Issue.

from docker-nginx-webdav-nononsense.

dgraziotin avatar dgraziotin commented on August 19, 2024

This is fixed in master.

docker-compose up
Recreating nginxwebdav ... done
Attaching to nginxwebdav
nginxwebdav    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
nginxwebdav    | [s6-init] ensuring user provided files have correct perms...exited 0.
nginxwebdav    | [fix-attrs.d] applying ownership & permissions fixes...
nginxwebdav    | [fix-attrs.d] done.
nginxwebdav    | [cont-init.d] executing container initialization scripts...
nginxwebdav    | [cont-init.d] 01-envfile: executing...
nginxwebdav    | [cont-init.d] 01-envfile: exited 0.
nginxwebdav    | [cont-init.d] 01-migrations: executing...
nginxwebdav    | [migrations] started
nginxwebdav    | [migrations] no migrations found
nginxwebdav    | [cont-init.d] 01-migrations: exited 0.
nginxwebdav    | [cont-init.d] 10-adduser: executing...
nginxwebdav    |
nginxwebdav    | -------------------------------------
nginxwebdav    |           _         ()
nginxwebdav    |          | |  ___   _    __
nginxwebdav    |          | | / __| | |  /  \
nginxwebdav    |          | | \__ \ | | | () |
nginxwebdav    |          |_| |___/ |_|  \__/
nginxwebdav    |
nginxwebdav    |
nginxwebdav    | Brought to you by linuxserver.io
nginxwebdav    | -------------------------------------
nginxwebdav    |
nginxwebdav    | To support LSIO projects visit:
nginxwebdav    | https://www.linuxserver.io/donate/
nginxwebdav    | -------------------------------------
nginxwebdav    | GID/UID
nginxwebdav    | -------------------------------------
nginxwebdav    |
nginxwebdav    | User uid:    666
nginxwebdav    | User gid:    666
nginxwebdav    | -------------------------------------
nginxwebdav    |
nginxwebdav    | [cont-init.d] 10-adduser: exited 0.
nginxwebdav    | [cont-init.d] 30-config: executing...
nginxwebdav    | [cont-init.d] 30-config: exited 0.
nginxwebdav    | [cont-init.d] 90-custom-folders: executing...
nginxwebdav    | [cont-init.d] 90-custom-folders: exited 0.
nginxwebdav    | [cont-init.d] 99-custom-scripts: executing...
nginxwebdav    | [custom-init] no custom files found exiting...
nginxwebdav    | [cont-init.d] 99-custom-scripts: exited 0.
nginxwebdav    | [cont-init.d] done.
nginxwebdav    | [services.d] starting services
nginxwebdav    | [services.d] done.
docker exec nginxwebdav id abc
uid=666(abc) gid=666(abc) groups=666(abc),100(users)

from docker-nginx-webdav-nononsense.

dgraziotin avatar dgraziotin commented on August 19, 2024

This was closed automatically via a push. @vitjok, @Akjo4712, please reopen in case it is not working for you (build from source).

from docker-nginx-webdav-nononsense.

Akjo4712 avatar Akjo4712 commented on August 19, 2024

@dgraziotin: When Building a Docker Image from Main, the Container is still running with UID 911 and GID 911. My Environment Settings seem to be ignored. See the Logs and my compose.yml below. I don't know if I am doing something wrong, or there is another Bug around.

I think my compose.yml looks exactly as documented by linuxserver.io

Note: I can't reopen the Issue, as I am not the reporter.

image

  webdav:
    image: registry.gitlab.com/xxxxxx.xx/projects/xxxxxx/webdav:latest
    restart: unless-stopped
    volumes: 
      - ftp:/data/
      - ~/wwms/webdav/htpasswd:/etc/nginx/htpasswd
    environment:
      - PUID:1000
      - PGID:1000
      - TZ:"Europe/Vienna"
      - SERVER_NAMES:"xxx.xxxxxxx.xx"

from docker-nginx-webdav-nononsense.

Akjo4712 avatar Akjo4712 commented on August 19, 2024

Maybe you could Push a Image to Docker Hub? This would kind of sort out Errors on my side.

from docker-nginx-webdav-nononsense.

dgraziotin avatar dgraziotin commented on August 19, 2024

@Akjo4712 could you try building from master? It’s as easy as cloning the repo and running

docker compose build && docker compose up

(Sorry for typos, I’m on mobile)

I can otherwise push an image for testing but I’m not home right now.

from docker-nginx-webdav-nononsense.

Akjo4712 avatar Akjo4712 commented on August 19, 2024

I did also try that. I am not Home, can’t do additional testing now. Will give it another try tomorrow.

from docker-nginx-webdav-nononsense.

dgraziotin avatar dgraziotin commented on August 19, 2024

I pushed to dgraziotin/nginx-webdav-nononsense:uid.

I also tested it on a fresh VPS.

docker-compose.yml:

version: '3.3'
services:
    nginxwebdav:
        container_name: nginxwebdav
        image: dgraziotin/nginx-webdav-nononsense:uid
        volumes:
            - ./data:/data
        environment:
            - PUID=666
            - PGID=666
            - TZ=Europe/Berlin
            - WEBDAV_USERNAME=user
            - WEBDAV_PASSWORD=password
            - SERVER_NAMES=localhost
            - TIMEOUTS_S=1200 # these are seconds
            - CLIENT_MAX_BODY_SIZE=120M # must end with M(egabytes) or G(igabytes)
        ports:
          - 32080:80
$ sudo docker-compose up
Starting nginxwebdav ... done
Attaching to nginxwebdav
nginxwebdav    | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
nginxwebdav    | [s6-init] ensuring user provided files have correct perms...exited 0.
nginxwebdav    | [fix-attrs.d] applying ownership & permissions fixes...
nginxwebdav    | [fix-attrs.d] done.
nginxwebdav    | [cont-init.d] executing container initialization scripts...
nginxwebdav    | [cont-init.d] 01-envfile: executing... 
nginxwebdav    | [cont-init.d] 01-envfile: exited 0.
nginxwebdav    | [cont-init.d] 01-migrations: executing... 
nginxwebdav    | [migrations] started
nginxwebdav    | [migrations] no migrations found
nginxwebdav    | [cont-init.d] 01-migrations: exited 0.
nginxwebdav    | [cont-init.d] 10-adduser: executing... 
nginxwebdav    | 
nginxwebdav    | -------------------------------------
nginxwebdav    |           _         ()
nginxwebdav    |          | |  ___   _    __
nginxwebdav    |          | | / __| | |  /  \
nginxwebdav    |          | | \__ \ | | | () |
nginxwebdav    |          |_| |___/ |_|  \__/
nginxwebdav    | 
nginxwebdav    | 
nginxwebdav    | Brought to you by linuxserver.io
nginxwebdav    | -------------------------------------
nginxwebdav    | 
nginxwebdav    | To support LSIO projects visit:
nginxwebdav    | https://www.linuxserver.io/donate/
nginxwebdav    | -------------------------------------
nginxwebdav    | GID/UID
nginxwebdav    | -------------------------------------
nginxwebdav    | 
nginxwebdav    | User uid:    666
nginxwebdav    | User gid:    666
nginxwebdav    | -------------------------------------
nginxwebdav    | 
nginxwebdav    | [cont-init.d] 10-adduser: exited 0.
nginxwebdav    | [cont-init.d] 30-config: executing... 
nginxwebdav    | Adding password for user user
nginxwebdav    | [cont-init.d] 30-config: exited 0.
nginxwebdav    | [cont-init.d] 90-custom-folders: executing... 
nginxwebdav    | [cont-init.d] 90-custom-folders: exited 0.
nginxwebdav    | [cont-init.d] 99-custom-scripts: executing... 
nginxwebdav    | [custom-init] no custom files found exiting...
nginxwebdav    | [cont-init.d] 99-custom-scripts: exited 0.
nginxwebdav    | [cont-init.d] done.
nginxwebdav    | [services.d] starting services
nginxwebdav    | [services.d] done.
^CGracefully stopping... (press Ctrl+C again to force)
Stopping nginxwebdav ... 
Killing nginxwebdav  ... done
ERROR: 2
$ ls -la data
total 0
drwxr-xr-x+ 1    666   666   0 Jan  5 17:58 .
drwxr-xr-x+ 1 daniel daniel 376 Jan  5 17:58 ..

from docker-nginx-webdav-nononsense.

Akjo4712 avatar Akjo4712 commented on August 19, 2024

Hmmm, thats interesting, just launched the Image with the Tag UID and although it works for you, i am still facing the same Issue. But, what I just found out with your compose.yml it works properly. UID and GID is set to 666. I will do some additional Debugging what exactly is the Issue with my compose.yml and write it down here for reference once I found the Issue.

Docker Inspect
image

Logs
image

Docker Compose
image

from docker-nginx-webdav-nononsense.

dgraziotin avatar dgraziotin commented on August 19, 2024

@Akjo4712 damn, I didn’t notice that you mixed the two syntaxes above. So it’s working now, isn’t it?

from docker-nginx-webdav-nononsense.

Akjo4712 avatar Akjo4712 commented on August 19, 2024

Yes, it is working now, thanks, must have been late in the night when I wrote this. All settings apart from puid and pgid did work with the mixed syntax.

from docker-nginx-webdav-nononsense.

vitjok avatar vitjok commented on August 19, 2024

Can confirm, that it's working now with 86fc55c.
Thanks!

Just one thing: Is it needed to modify the permissions of existing files?

/root/etc/cont-init.d/30-config

# permissions
chown -R abc:abc /data

It's not documented in the readme.md, and I don't think it's expected by the users. At least, I wouldn't expect that. And I can imagine some use cases where it would be helpful to let the permissions unchanged.

from docker-nginx-webdav-nononsense.

dgraziotin avatar dgraziotin commented on August 19, 2024

Thanks both for confirming!

@vitjok I think that the permission change is good to have. It ensures that all files in the /data folder can be read by abc (which is either default IDs or the IDs specified by env variables).

LS.io does the same with their nginx image. I can't think of a reason for not doing the same. Suggestions welcome! I will close this one meanwhile, as the original issue seems resolved.

Edit: actually, they do not chown the served folder. You might be right that it is not needed. Will revert.

from docker-nginx-webdav-nononsense.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.