Skip to content

Commit

Permalink
Skip chown command in startup script by setting BAIKAL_SKIP_CHOWN (#138)
Browse files Browse the repository at this point in the history
* Ensure correct file permissions, unless behaviour is explicitly disabled

* Documented skipping of chown commands in README.md

* Corrected paths glob pattern in Github workflows

---------

Co-authored-by: Cyrill Kulka <[email protected]>
  • Loading branch information
2 people authored and MrAlucardDante committed Dec 30, 2023
1 parent cf51c7f commit 2786a1c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
paths:
- .github/workflows/docker-build.yml
- Dockerfile
- files/*
- files/**
release:
types:
- published
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ The image exposes the `/var/www/baikal/Specific` and `/var/www/baikal/config` fo

If you want to use local folders instead of Docker volumes, see [examples/docker-compose.localvolumes.yaml](https://github.com/MrAlucardDante/baikal-docker-hass/blob/master/examples/docker-compose.localvolumes.yaml) to avoid file permission issues.

When the container starts, the startup script `/docker-entrypoint.d/40-fix-baikal-file-permissions.sh` ([Apache httpd](https://github.com/ckulka/baikal-docker/blob/master/files/docker-entrypoint.d/httpd/40-fix-baikal-file-permissions.sh), [nginx](https://github.com/ckulka/baikal-docker/blob/master/files/docker-entrypoint.d/nginx/40-fix-baikal-file-permissions.sh)) ensures that the file permissions are correct. You can disable this behaviour by setting the environment variable `BAIKAL_SKIP_CHOWN` to any value, e.g. `FALSE`.

### Further Guides

You can find more installation and configuration guides here:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

chown -R nginx:nginx /var/www/baikal
# Ensure correct file permissions, unless behaviour is explicitly disabled
if [ -z ${BAIKAL_SKIP_CHOWN+x} ]
then
chown -R nginx:nginx /var/www/baikal
fi

0 comments on commit 2786a1c

Please sign in to comment.