Skip to content
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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

ian351c
Copy link

@ian351c ian351c commented Jun 5, 2024

Make setting file permissions optional with SKIP_FILE_OWNERSHIP environment variable.

Make setting file permissions optional with SKIP_FILE_OWNERSHIP environment variable.
@ian351c
Copy link
Author

ian351c commented Jun 5, 2024

This is so that I can use NPM in a VM that has "shared folders".

ian351c added 6 commits June 5, 2024 11:45
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"
Copy link
Member

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.

@rrolla
Copy link

rrolla commented Jun 8, 2024

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 /var/lib/mysql

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/

@jc21
Copy link
Member

jc21 commented Jun 25, 2024

Yeah the mysql folder should not be within the data folder for this very reason.

The documentation doesn't do this either (anymore)

@nginxproxymanagerci
Copy link

CI Error:

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
certbot-node: Pulling from nginxproxymanager/nginx-full
Digest: sha256:eaa2ebcb50dd87557c9a8f95a3230128d94cac1ea17800261c036e59378e7d49
Status: Image is up to date for nginxproxymanager/nginx-full:certbot-node
docker.io/nginxproxymanager/nginx-full:certbot-node
�[1;34m❯ �[1;36mBuilding Frontend ...�[0m
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/tabler/tabler.git /usr/local/share/.cache/yarn/v6/.tmp/e11a93799a52aa978c82015e29fbe309
Directory: /app/frontend
Output:
Cloning into '/usr/local/share/.cache/yarn/v6/.tmp/e11a93799a52aa978c82015e29fbe309'...
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 7999 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants