pupcloud icon indicating copy to clipboard operation
pupcloud copied to clipboard

allow_edits=1 in docker makes '/data' read only

Open kjames2001 opened this issue 2 years ago • 25 comments

docker runs well, i can serve files in /data, and logs shows its running in '+ Read/Write'.

i turned on allow edits by adding environment variable: '-e PUP_ALLOW_EDITS=1' to docker run command.

webui add buttons for creating folder and upload files, but get a permission denied message. logs says its running in '+ Read Only'.

kjames2001 avatar May 08 '22 23:05 kjames2001

neat app btw!

kjames2001 avatar May 08 '22 23:05 kjames2001

Thanks! I'll try to reproduce this and - of course - fix it.

proofrock avatar May 09 '22 06:05 proofrock

Can you confirm that it's only in the root? I can see that it's impossible e.g. to create a folder there, but it seems fine in a subpath. This should be related to the Dockerfile not setting the correct permissions of the /data folder. Then there would be an additional bug - + Read Only shouldn't be shown. I'll investigate better in the afternoon.

proofrock avatar May 09 '22 06:05 proofrock

thanks for looking into it so soon!

i can confirm your find. its only in the root, subfolders works fine.

kjames2001 avatar May 09 '22 07:05 kjames2001

immagine Ahem... should be the other way around 🙄

proofrock avatar May 09 '22 07:05 proofrock

Installed pupcloud on Docker last night. User the pre-build version. Building myself threw an error on make.

I can create a folder/directory in the pupcloud root, and anywhere else.

Looks like a permission problem outside of Docker.

marioscube avatar May 09 '22 08:05 marioscube

That is really strange. It doesn't work for me. Anyways, setting the proper ownership of the /data dir wouldn't hurt, and the dockerfile doesn't do it, so... I'll make the change, and if you and @kjames2001 could test it again, that would be great.

Also, which error do you get while building the docker? Feel free to file a separate issue if you feel that it isn't some kind of quirk of your system.

proofrock avatar May 09 '22 08:05 proofrock

I start pupcloud on docker with: -p 17178:17178
-p 17179:17179
-v /home/user/Docker/pupcloud:/data
-e PID=1000
-e PGID=1000
-e PUP_PASSWORD=ciao
-e PUP_ALLOW_EDITS=1 \

~/Docker$ ls -l drwxr-xr-x 3 user user 4096 May 9 10:41 pupcloud

~/Docker$ id 1000 uid=1000(user) gid=1000(user)

I will try new docker image if available.

marioscube avatar May 09 '22 09:05 marioscube

I see. And I noticed that my test wasn't accurate, I couldn't write in the directory I was mapping even from "outside" docker and pupcloud, so no wonder I couldn't from "inside". @kjames2001 which user are you specifying for PUID and PGID (if any); and which user/group owns the folder you're mapping?

@marioscube you may want to use PUID, not PID

proofrock avatar May 09 '22 09:05 proofrock

OK I used -e PID 1000 from the example on DockerHub

Changed to -e PUID=1000

No problems with creating or deleting a folder/directory. Screenshot 2022-05-09 at 11 31 04

marioscube avatar May 09 '22 09:05 marioscube

I used -e PID 1000 from the example on DockerHub

Oops... fixed, thanks!

proofrock avatar May 09 '22 09:05 proofrock

Build docker pupcloud on anaother PC (newer Docker version) and all went well.

The /data directory inside the pupcloud container has already the permissions pup:pup. No need to chown pup:pup /data ?

chmod 777 /data would probably fix all, but brrrrrrrrr.

marioscube avatar May 09 '22 10:05 marioscube

Haha no, I don't want to chmod 777... and yes, you're right, no need to chown pup:pup... then we'll wait for @kjames2001 to give us more details. Thanks!

proofrock avatar May 09 '22 10:05 proofrock

Hi, I'm running it on unraid, so I use puID of 99 and pgID of 100 I even put umask of 022.

As for ownership of folders in unraid, all files and folders are owned by nobody, and at the same time belongs to everybody. Lol, very confusing to me.

Hope I'm doing things right, as I'm not very familiar with Linux permissions.

kjames2001 avatar May 09 '22 12:05 kjames2001

What's the commandline you use to run your docker? I would say that you need to run it with -e PUID=99 and -e PGID=100. Of course you may already be doing that.

proofrock avatar May 09 '22 12:05 proofrock

Yeah, that's what I did.

kjames2001 avatar May 09 '22 12:05 kjames2001

I'll do some more tests. I think I've found the issue.

proofrock avatar May 09 '22 13:05 proofrock

@kjames2001 if you can, try this: germanorizzo/puptest:latest

The command (pupcloud) wasn't started with the correct uid/gid. Now it should be fixed. I don't know if it solves the problem, but I tested creating an user and a group with your IDs, and it works for me.

proofrock avatar May 09 '22 14:05 proofrock

Just got home, just checked, there doesn't seem to be an update for pupcloud docker.

kjames2001 avatar May 09 '22 15:05 kjames2001

It's germanorizzo/puptest

proofrock avatar May 09 '22 15:05 proofrock

docker pull germanorizzo/puptest docker run etc..... -e PUID=1000 -e GUID=1000

The container seems to work, however .... Screenshot 2022-05-09 at 17 58 34

I like my users to be not nobody ..... ;-) And I like this popup unlike some others.

marioscube avatar May 09 '22 16:05 marioscube

Lol, didn't read carefully. Let me try now.

kjames2001 avatar May 09 '22 16:05 kjames2001

Yes, it's working now.

But logs still shows read only.

kjames2001 avatar May 09 '22 16:05 kjames2001

Yes, it's working now.

Good!

But logs still shows read only.

Yes, it's the "old" 0.8.0 packaged in a new Dockerfile. The fix will go into 0.8.1. Thanks!

proofrock avatar May 09 '22 16:05 proofrock

docker pull germanorizzo/puptest docker run etc..... -e PUID=1000 -e GUID=1000

The container seems to work, however ....

I like my users to be not nobody ..... ;-) And I like this popup unlike some others.

Uff... it's a whack-a-mole game. I don't know what I can do here, being inside Docker hides all the usernames (previously it was pup:pup, but only for ID 1000, so it was wrong anyway). Please open an issue so we can discuss what to do.

proofrock avatar May 09 '22 16:05 proofrock