use env vars for secrets
All checks were successful
/ docker (push) Successful in 1m34s

This commit is contained in:
Lee 2023-07-05 01:08:00 +01:00
parent b6fd907373
commit cae4d4f051
2 changed files with 8 additions and 1 deletions

View File

@ -8,6 +8,7 @@ services:
restart: always
environment:
- MAX_UPLOAD_SIZE=500M
- UPLOAD_SECRETS=set me # You can add multiple secrets. Format: secret1,secret2,secret3
ports:
- 80:80
volumes:

View File

@ -10,7 +10,13 @@ header('Content-type:application/json;charset=utf-8'); // Set the response conte
/**
* Configuration
*/
$uploadSecrets = array("set me"); // Your secret keys
$uploadSecrets;
// Check if the environment variable UPLOAD_SECRETS is set
if (getenv('UPLOAD_SECRETS')) {
$uploadSecrets = explode(",", getenv('UPLOAD_SECRETS'));
} else {
$uploadSecrets = array("set me"); // Use this if you are not using environment variables (eg: Not using Docker)
}
$uploadDir = "./"; // The upload directory
$useRandomFileNames = false; // Use random file names instead of the original file name
$shouldConvertToWebp = true; // Should the script convert images to webp?