diff --git a/docker-compose.yml b/docker-compose.yml index 0b4279e..c50f6da 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/upload.php b/upload.php index b2a6113..5f1a1c4 100644 --- a/upload.php +++ b/upload.php @@ -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?