karlprieb / writefreely-docker

Deploy WriteFreely using docker.
GNU Affero General Public License v3.0
31 stars 9 forks source link

Permissions error while creating directories #2

Open GilOliveira opened 2 years ago

GilOliveira commented 2 years ago

In both the Debian and the Arch Linux machines I've tried running the scripts on this repo, the container hangs and loops off and on, with the logs looping on the following message:

Copying default templates
cp: can't create directory '/data/templates/': Permission denied

I've managed to fix this issue on my side by editing the Dockerfile so that line 47 now reads:

USER root

And now the container runs well with no permissions issues.

I'm a Docker novice and I'm not sure if switching the USER for the container in the Dockerfile has any security disadvantages, but this was the only way I found to get the containers working.

karlprieb commented 2 years ago

Sorry, but I'm not using this project anymore. It should work with the daemon used as we chown the files two lines before. I can take a look at this container image this week to help you ;) An advice: if you're not using user namespace remap docker feature is really insecure to run apps with root inside the container as it will map the root user of your host OS.

GilOliveira commented 2 years ago

An advice: if you're not using user namespace remap docker feature is really insecure to run apps with root inside the container as it will map the root user of your host OS.

Got it! Thanks!

tegaki-tegaki commented 1 year ago

I noticed that this docker-compose.yml doesn't supply a mariadb/mysql db, but connects to the host?

I've made a write-up on how I host my own writefreely using a modified docker-compose.yml here. It covers permissions as well (host vs container) like the one above. @GilOliveira :)

GilOliveira commented 1 year ago

On Mon, 20 Mar 2023, at 12:24, Tegaki wrote:

I've made a write-up on how I host my own writefreely using a modified docker-compose.yml here https://write.drawsdraws.com/tegaki/how-i-host-my-software-on-the-web. It covers permissions as well (host vs container) like the one above. @GilOliveira https://github.com/GilOliveira :)

Thanks!!