-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Update 30-ownership.sh to make chown optional #3792
base: develop
Are you sure you want to change the base?
Conversation
Make setting file permissions optional with SKIP_FILE_OWNERSHIP environment variable.
This is so that I can use NPM in a VM that has "shared folders". |
Fix bad boolean logic
Fix boolean logic for IPv6
Clean up log_info messages. Otherwise this appears to work...
chown -R "$PUID:$PGID" "$1" | ||
|
||
# ensure the files are still owned by the npm user | ||
chown -R "$PUID:$PGID" "$1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only this line in this file should be wrapped in the IF statement. You still want the SED above to function.
Also there is a big problem with mariadb On logs it shows that cannot create table, but that because of file ownership, mariadb cannot access those files, that live in app_1 | [6/8/2024] [2:40:17 AM] [Global ] › ✖ error create table `migrations` (`id` int unsigned not null auto_increment primary key, `name` varchar(255), `batch` int, `migration_time` timestamp) - ER_CANT_CREATE_TABLE: Can't create table `npm`.`migrations` (errno: 13 "Permission denied")
example docker-compose.yml app:
image: 'jc21/nginx-proxy-manager:2.11.2'
...
environment:
PUID: 1000
PGID: 1000
DB_MYSQL_HOST: "db"
DB_MYSQL_PORT: 3306
DB_MYSQL_USER: "npm"
DB_MYSQL_PASSWORD: "npm"
DB_MYSQL_NAME: "npm"
volumes:
- ./data:/data
db:
image: 'jc21/mariadb-aria:10.11.5'
environment:
MYSQL_ROOT_PASSWORD: 'npm'
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'npm'
MYSQL_PASSWORD: 'npm'
MARIADB_AUTO_UPGRADE: '1'
volumes:
- ./data/mysql:/var/lib/mysql On start application Setting ownership by envs PUID: 1000 PGID: 1000 also for ./data/mysql directory ant thats why mysql is not working anymore, because it runs as mysql user As dirty workaround, to at least nginx proxy manager starts and works is to # after running docker compose up need to change owner for mysql
docker exec -it nginx-proxy-manager_db_1 chown -vR mysql /var/lib/mysql/ |
Yeah the The documentation doesn't do this either (anymore) |
CI Error:
|
Make setting file permissions optional with SKIP_FILE_OWNERSHIP environment variable.