Skip to content

[Bug]: Docker entrypoint prevents non root user usage #18582

@Syntax3rror404

Description

@Syntax3rror404

Snipe-IT Version

docker.io/snipe/snipe-it:v8.3.7-alpine

PHP Version

embedded

Composer Version

embedded

MySQL/MariaDB version

docker-registry1.mariadb.com/library/mariadb:11.8.2

How did you install Snipe-IT?

Docker

Is this a fresh install or an upgrade?

Fresh install

What happened?

I want to use snipeit without root user for security, so I want to use user 100 with group 101.

But the entrypoint dont allows that, because it always try to chown the dirs, which isnt possible without privilege escalation.

See startup.sh https://github.com/grokability/snipe-it/blob/master/docker/startup.sh

chown -R docker:root /var/lib/snipeit/data/*
chown -R docker:root /var/lib/snipeit/dumps
chown -R docker:root /var/lib/snipeit/keys
chown -R docker:root /var/www/html/storage/framework/cache

What browsers are you seeing the problem on?

No response

Can you reproduce this on the public demo?

Yes

Do you have full multiple company support enabled?

Yes

If you have full multiple company support enabled, do you have location scoping to company enabled?

Yes

Application log output

[...]
chown: /var/lib/snipeit/data/private_uploads/assets/assets: Operation not permitted
chown: /var/lib/snipeit/data/private_uploads/assets/hardware-252-ROzpfPkD-screenshot-20200205-164439-kk.jpg: Operation not permitted
chown: /var/lib/snipeit/data/uploads/assets: Operation not permitted
chown: /var/lib/snipeit/data/uploads/assets: Operation not permitted
chown: /var/lib/snipeit/data/uploads: Operation not permitted
chown: /var/lib/snipeit/data/uploads: Operation not permitted
chown: /var/lib/snipeit/dumps/snipe-it-manual-backup-2025-03-05-18-27-17.zip: Operation not permitted
chown: /var/lib/snipeit/dumps: Operation not permitted
chown: /var/lib/snipeit/dumps: Operation not permitted
chown: /var/lib/snipeit/keys/oauth-private.key: Operation not permitted
chown: /var/lib/snipeit/keys/oauth-public.key: Operation not permitted
chown: /var/lib/snipeit/keys: Operation not permitted
chown: /var/lib/snipeit/keys: Operation not permitted
chown: /var/www/html/storage/framework/cache: Operation not permitted
chown: /var/www/html/storage/framework/cache: Operation not permitted
[...]

Browser console output

Common Issues

  • I have searched this repo for existing issues related to my issue (including closed issues)
  • My APP_URL is set correctly in my .env file (including http or https and no trailing slash)
  • I have searched the official Snipe-IT documentation and have checked the Common Issues documentation (where applicable)
  • I have run database migrations (where applicable).
  • I have attached screenshots and/or videos of the issue (where applicable)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions