foundryvtt-docker
foundryvtt-docker copied to clipboard
Update umask before launching foundry if CONTAINER_UMASK is set
๐ฃ Description
This change introduces an environment variable, ${CONTAINER_UMASK}, to control the umask of the node process. If this variable is set, launcher.sh passes it to the umask command before launching node.
๐ญ Motivation and context
This change makes it easier to manage shared assets between containers without needing them all run as the same user.
TODO: describe this better.
๐งช Testing
TODO: describe this better.
To check if umask is set:
- Start container using docker compose.
- Check logs for umask messages
- Run
docker compose exec foundry find -L /proc -maxdepth 2 -name exe -samefile /usr/local/bin/node -print -execdir grep Umask status \;to check the umask of the foundry process - there should only be one match. - Stop the container.
Repeat the check for at least these situations:
CONTAINER_UMASKunset => no log, umask is 0022CONTAINER_UMASK=0002=> info message printed, umask is 0002CONTAINER_UMASK=(symbolic representation - TODO)=> info message printed, umask matchesCONTAINER_UMASK=oops=> info message, warning message, umask is 0022. Container starts as normal.
โ Pre-approval checklist
- [x] This PR has an informative and human-readable title.
- [x] Changes are limited to a single goal - eschew scope creep!
- [ ] All future TODOs are captured in issues, which are referenced in code comments.
- [ ] All relevant type-of-change labels have been added.
- [x] I have read the CONTRIBUTING document.
- [ ] These code changes follow cisagov code standards.
- [x] All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
- [ ] Tests have been added and/or modified to cover the changes in this PR.
- [ ] All new and existing tests pass.
โ Pre-merge checklist
- [ ] Revert dependencies to default branches.
- [ ] Finalize version.
โ Post-merge checklist
- [ ] Add a tag or create a release.