This commit is contained in:
parent
79f4b8ee3a
commit
4a8604b7a9
@ -11,10 +11,10 @@ services:
|
||||
- UPLOAD_SECRETS=set me # You can add multiple secrets. Format: secret1,secret2,secret3
|
||||
- UPLOAD_DIR=./ # The directory to store the uploaded files
|
||||
- USE_RANDOM_FILE_NAMES=true # If true, the uploaded files will be renamed to a random string
|
||||
- FILE_NAME_LENGTH=8 # The length of the random file name
|
||||
- SHOULD_CONVERT_TO_WEBP=true # If true, the uploaded files will be converted to webp
|
||||
- WEBP_QUALITY=95 # The quality of the converted webp files
|
||||
- WEBP_THREADHOLD=1048576 # The minimum file size to convert to webp (1MB in bytes)
|
||||
- FILE_NAME_LENGTH=8 # The length of the random file name
|
||||
ports:
|
||||
- 80:80
|
||||
volumes:
|
||||
|
@ -14,10 +14,10 @@ fi
|
||||
echo "env[DOCKER] = true" >> /etc/php/8.1/fpm/pool.d/www.conf
|
||||
echo "env[UPLOAD_DIR] = ${UPLOAD_DIR}" >> /etc/php/8.1/fpm/pool.d/www.conf
|
||||
echo "env[USE_RANDOM_FILE_NAMES] = ${USE_RANDOM_FILE_NAMES}" >> /etc/php/8.1/fpm/pool.d/www.conf
|
||||
echo "env[FILE_NAME_LENGTH] = ${FILE_NAME_LENGTH}" >> /etc/php/8.1/fpm/pool.d/www.conf
|
||||
echo "env[SHOULD_CONVERT_TO_WEBP] = ${SHOULD_CONVERT_TO_WEBP}" >> /etc/php/8.1/fpm/pool.d/www.conf
|
||||
echo "env[WEBP_QUALITY] = ${WEBP_QUALITY}" >> /etc/php/8.1/fpm/pool.d/www.conf
|
||||
echo "env[WEBP_THREADHOLD] = ${WEBP_THREADHOLD}" >> /etc/php/8.1/fpm/pool.d/www.conf
|
||||
echo "env[FILE_NAME_LENGTH] = ${FILE_NAME_LENGTH}" >> /etc/php/8.1/fpm/pool.d/www.conf
|
||||
|
||||
echo "Setting permissions for upload script"
|
||||
chmod 777 /var/www/html/upload.php
|
||||
|
@ -15,10 +15,10 @@ if (getenv('DOCKER')) { // If the script is running in a Docker container
|
||||
$uploadSecrets = explode(",", getenv('UPLOAD_SECRETS')); // The upload secrets
|
||||
$uploadDir = getenv('UPLOAD_DIR'); // The upload directory
|
||||
$useRandomFileNames = getenv('USE_RANDOM_FILE_NAMES'); // Use random file names instead of the original file name
|
||||
$fileNameLength = getenv('FILE_NAME_LENGTH'); // The length of the random file name
|
||||
$shouldConvertToWebp = getenv('SHOULD_CONVERT_TO_WEBP'); // Should the script convert images to webp?
|
||||
$webpQuality = getenv('WEBP_QUALITY'); // The quality of the webp image (0-100)
|
||||
$webpThreadhold = getenv('WEBP_THREADHOLD'); // The minimum file size for converting to webp (in bytes)
|
||||
$fileNameLength = getenv('FILE_NAME_LENGTH'); // The length of the random file name
|
||||
} else {
|
||||
/**
|
||||
* !!!
|
||||
@ -28,10 +28,10 @@ if (getenv('DOCKER')) { // If the script is running in a Docker container
|
||||
$uploadSecrets = array("set me"); // The upload secrets
|
||||
$uploadDir = "./"; // The upload directory
|
||||
$useRandomFileNames = false; // Use random file names instead of the original file name
|
||||
$fileNameLength = 8; // The length of the random file name
|
||||
$shouldConvertToWebp = true; // Should the script convert images to webp?
|
||||
$webpQuality = 95; // The quality of the webp image (0-100)
|
||||
$webpThreadhold = 1048576; // 1MB - The minimum file size for converting to webp (in bytes)
|
||||
$fileNameLength = 8; // The length of the random file name
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user