https://github.com/imarc/craft-volume-permissions
A craft module to set all default local volume permissions using ENV vars
https://github.com/imarc/craft-volume-permissions
Last synced: 5 months ago
JSON representation
A craft module to set all default local volume permissions using ENV vars
- Host: GitHub
- URL: https://github.com/imarc/craft-volume-permissions
- Owner: imarc
- License: mit
- Created: 2019-09-24T16:18:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-21T17:18:56.000Z (about 6 years ago)
- Last Synced: 2025-10-28T12:53:57.589Z (8 months ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Craft Volume Permissions
This is a Craft 3 module which allows settings the default permissions
of all local volumes with environment variables. The following environment
variables are available:
VOLUME_FILE_PUBLIC_PERMISSION=664
VOLUME_FILE_PRIVATE_PERMISSION=660
VOLUME_DIR_PUBLIC_PERMISSION=775
VOLUME_DIR_PRIVATE_PERMISSION=770
Being able to set the proper non-standard file permissions can be critical in certain environments.
A specific example is deploying to a filesystem using ACLs where it is essential that directories and files are group writable.
## Install
Install in your Craft 3 project using composer:
composer require imarc/craft-volume-permissions
Then enable the module within your `config/app.php` file:
[
'volume-permissions' => \Imarc\Craft\Modules\VolumePermissions::class,
],
'bootstrap' => [
'volume-permissions',
],
];
Then use the environment variables to configure the permissions.
### Dirty Hack?
This module is a bit of a hack as it uses Reflection to alter Flysystem's
hardcoded Local adapter defaults. Ideally a better solution is found in the future.
## License
The MIT License (MIT)
## Copyright
Copyright (c) 2019 iMarc LLC