mirror of
https://github.com/prasathmani/tinyfilemanager.git
synced 2026-04-26 19:05:54 +03:00
[GH-ISSUE #840] Use php function getenv for better Docker support #567
Labels
No labels
Feature
Feature
Is It Really an Issue?
Need More Info
Request
Security
bug
duplicate
enhancement
enhancement
help wanted
invalid
pull-request
question
suggestion
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tinyfilemanager#567
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ethanpil on GitHub (Aug 23, 2022).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/840
I'd love to see better support for Docker environment variables to more easily customize the configuration in a more "Dockery" way. The solution seems easy, to use PHP's
getenv()function when setting the defaults intinyfilemanager.phpFor example, on line 23 of tinyfilemanager.php we have:
$use_auth = true;We can replace this with the following:
$use_auth = getenv("USE_AUTH") ? getenv("USE_AUTH") : true;This will check for an environment variable
USE_AUTHto set the value. If the value doesn't exist, it will default totrueand existing functionality wont change even for users that opted to useconfig.phpWe can even add some error checking to make sure poorly formed values will still work
$use_auth = getenv("USE_AUTH") && is_bool( getenv("USE_AUTH") ) ? getenv("USE_AUTH") : true;Happy to submit a PR to help if you are interested.
Another (simpler) option may be to just use
getenv()to define a config file path which can be loaded...