-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
[BUG] local.php file permissions incorrect #58
Comments
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid. |
You can workaround this issue by running this custom-cont-init.d script at startup: #!/usr/bin/env bash
# script to fix file permissions see https://github.com/linuxserver/docker-cops/issues/58
file="/app/www/public/config/local.php"
check_perm(){
perm=$(stat -c "%a" "$file")
}
check_perm
if [[ "$perm" -eq 664 ]]; then
echo "Permissions on $file are correct."
else
echo "Permissions on $file are incorrect."
echo "Current permissions are: $perm"
echo "Changing to: 644"
chmod 664 $file
check_perm
echo "Permissions on $file are now: $perm"
fi |
Hi @nopoz is it possible you started with an existing file config_local.php with permissions -rwx------ in your local /docker/cops directory? Because to help migration from older versions the current init-cops-config/run script will copy that to /config/config/local.php instead of using a new /defaults/config/local.php When I try to install from scratch with an empty local /tmp/config and
I end up with a local.php file with permission 644 for my defined user locally, and for root inside the container, which is correct. |
Hi @mikespub I redid everything from scratch to sanity check my previous testing - no old config directory or anything. I get the same error:
Checking the file permissions of
Checking the local.php file in the config directory as you mention, these are the permissions:
Compose file: services:
cops-test:
container_name: cops-test
environment:
- PUID=666 # cops
- PGID=1337 # ebooks
ports:
- 5231:80
volumes:
- /docker/cops-test:/config
- /ebooks:/books
restart: unless-stopped
image: lscr.io/linuxserver/cops:3.1.2-ls223 |
I'm sorry to hear that, and I can't reproduce here. I'm afraid you'll need someone like @aptalca from linuxserver.io to track down what happens, because I'm seeing: a. original /defaults/config/ dir in container
b. copied /config/config/ files in container
c. final /app/www/public/config/ dir in container
d. new /tmp/config/config/ files on local server
|
I can't reproduce this either. Only thing I can think of is If so, we don't support Try creating a container without the |
Thanks for picking this up @aptalca I was thinking it could be some umask issue, but then I couldn't figure out how it might end up being executable on the host, and I wasn't sure how using s6-overlay would affect all that. Either way, your PR should resolve all that, thanks :-) |
Is there an existing issue for this?
Current Behavior
Getting the error when loading up a default instance of cops using 3.1.2-ls223 (latest as of writing)
Checking the file permissions on
/app/www/public/config/local.php
it's owned by root and the permissions arerwx
for root user only. Since the app runs with the user and groupabc
, the file cannot be read:Changing the permissions to match the other files in the directory with
chmod 664 local.php
, the error goes away and cops loads as expected in the browser.Compose file used:
Expected Behavior
Cops should load correctly.
Steps To Reproduce
Just run the container from scratch with the above compose file.
Environment
CPU architecture
x86-64
Docker creation
Container logs
The text was updated successfully, but these errors were encountered: