remove PHP81
This commit is contained in:
parent
fa739b9e19
commit
3eaf93232e
7 changed files with 113 additions and 141 deletions
|
@ -141,7 +141,6 @@ ENV PUID=0 \
|
|||
IPRT=1 \
|
||||
GOA=false \
|
||||
GOACLA="--agent-list --real-os --double-decode --anonymize-ip --anonymize-level=1 --keep-last=30 --with-output-resolver --no-query-string" \
|
||||
PHP81=false \
|
||||
PHP82=false \
|
||||
PHP83=false
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ so that the barrier for entry here is low.
|
|||
- access.log is disabled by default, unified and moved to `/opt/npm/nginx/access.log`
|
||||
- Error Log written to console
|
||||
- `Server` response header hidden
|
||||
- PHP 8.1/8.2/8.3 optional, with option to add extensions; available packages can added using envs in the compose file
|
||||
- PHP 8.2/8.3 optional, with option to add extensions; available packages can added using envs in the compose file
|
||||
- Allows different acme servers/certbot config file (/opt/npm/tls/certbot/config.ini)
|
||||
- Supports up to 99 domains per cert
|
||||
- Brotli compression can be enabled
|
||||
|
@ -156,8 +156,8 @@ location / {
|
|||
```
|
||||
b) Custom Nginx Configuration (advanced tab), which looks the following for file server and **php**:
|
||||
- Note: the slash at the end of the file path is important
|
||||
- Note: first enable `PHP81`, `PHP82` and/or `PHP83` inside your compose file
|
||||
- Note: you can replace `fastcgi_pass php81;` with `fastcgi_pass` `php82`/`php83` `;`
|
||||
- Note: first enable `PHP82` and/or `PHP83` inside your compose file
|
||||
- Note: you can replace `fastcgi_pass php82;` with `fastcgi_pass php83;`
|
||||
- Note: to add more php extension using envs you can set in the compose file
|
||||
```
|
||||
location / {
|
||||
|
@ -165,7 +165,7 @@ location / {
|
|||
alias /var/www/<your-html-site-folder-name>/;
|
||||
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_pass php81;
|
||||
fastcgi_pass php82;
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
if (!-f $document_root$fastcgi_script_name) {
|
||||
return 404;
|
||||
|
|
12
compose.yaml
12
compose.yaml
|
@ -11,7 +11,7 @@ services:
|
|||
environment:
|
||||
- "TZ=Europe/Berlin" # set timezone, required
|
||||
# - "PUID=1000" # set group id, default 0 (root)
|
||||
# - "PGID=1000" # set user id, default 0 (root)
|
||||
# - "PGID=1000" # set user id, default 0 (root), requires PUID
|
||||
# - "NIBEP=48694" # internal port of the NOMplus API, always bound to 127.0.0.1, default 48693, you need to change it, if you want to run multiple npm instances in network mode host
|
||||
# - "GOAIWSP=48684" # internal port of goaccess, always bound to 127.0.0.1, default 48683, you need to change it, if you want to run multiple npm with goaccess instances in network mode host
|
||||
# - "NPM_PORT=82" # Port the NPM UI should be bound to, default 81, you need to change it, if you want to run multiple npm instances in network mode host
|
||||
|
@ -40,12 +40,10 @@ services:
|
|||
# - "LOGROTATIONS=7" # Set how often the access.log should be rotated until it is deleted, default 3
|
||||
# - "CRT=36" # Set how many hours should be between certbot trying to renew your certs, default 24
|
||||
# - "IPRT=3" # Set how many hours should be between updating ip ranges from aws and cloudflare, default 1, ignored when SKIP_IP_RANGES is true
|
||||
# - "GOA=true" # Enables goaccess, overrides LOGROTATE, default false --- if you download the GeoLite2-Country.mmdb, GeoLite2-City.mmdb AND GeoLite2-ASN.mmdb file from MaxMind and place them in /opt/npm/etc/goaccess/geoip it will automatically enable GeoIP in goaccess after restarting NPMplus (no need to change GOACLA below), you may also use the compose.geoip.yaml
|
||||
# - "GOA=true" # Enables goaccess, requires LOGROTATE, default false --- if you download the GeoLite2-Country.mmdb, GeoLite2-City.mmdb AND GeoLite2-ASN.mmdb file from MaxMind and place them in /opt/npm/etc/goaccess/geoip it will automatically enable GeoIP in goaccess after restarting NPMplus (no need to change GOACLA below), you may also use the compose.geoip.yaml
|
||||
# - "GOACLA=--agent-list --real-os --double-decode --anonymize-ip --anonymize-level=2 --keep-last=7 --with-output-resolver --no-query-string" # Arguments that should be passed to goaccess, default: https://github.com/ZoeyVid/NPMplus/blob/develop/rootfs/usr/local/bin/launch.sh#L50 and: --agent-list --real-os --double-decode --anonymize-ip --anonymize-level=1 --keep-last=30 --with-output-resolver --no-query-string
|
||||
# - "PHP81=true" # Activate PHP81, default false
|
||||
# - "PHP81_APKS=php81-curl php81-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.19&repo=community&arch=x86_64&name=php81-*, default none
|
||||
# - "PHP82=true" # Activate PHP82, default false
|
||||
# - "PHP82_APKS=php82-curl php-82-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.19&repo=community&arch=x86_64&name=php82-*, default none
|
||||
# - "PHP82_APKS=php82-curl php-82-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php82-*, default none, requires PHP82
|
||||
# - "PHP83=true" # Activate PHP83, default false
|
||||
# - "PHP83_APKS=php83-curl php83-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.19&repo=community&arch=x86_64&name=php83-*, default none
|
||||
# - "PHP_APKS=php-pecl-apcu php-pecl-redis" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.19&repo=community&arch=x86_64&name=php-*, default none
|
||||
# - "PHP83_APKS=php83-curl php83-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php83-*, default none, requires PHP83
|
||||
# - "PHP_APKS=php-pecl-apcu php-pecl-redis" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php-*, default none, requires PHP82 and/or PHP83, not recommended, please use PHP82_APKS or PHP83_APKS
|
||||
|
|
|
@ -31,7 +31,7 @@ if [ "$GOA_IPV6_BINDING" != "[::]" ] && [ "$GOA_IPV4_BINDING" != "0.0.0.0" ]; th
|
|||
fi
|
||||
fi
|
||||
|
||||
if (if [ "$GOA" = "true" ]; then [ -f /tmp/goa/index.html ] && nc -z "$HCGOA_IP" "$GOA_PORT"; fi && if [ "$PHP81" = true ]; then cgi-fcgi -bind -connect /run/php81.sock > /dev/null 2>&1; fi && if [ "$PHP82" = true ]; then cgi-fcgi -bind -connect /run/php82.sock > /dev/null 2>&1; fi && if [ "$PHP83" = true ]; then cgi-fcgi -bind -connect /run/php83.sock > /dev/null 2>&1; fi && [ "$(curl -sk https://"$HCNPM_IP":"$NPM_PORT"/api/ | jq --raw-output .status)" = "OK" ]); then
|
||||
if (if [ "$GOA" = "true" ]; then [ -f /tmp/goa/index.html ] && nc -z "$HCGOA_IP" "$GOA_PORT"; fi && if [ "$PHP82" = true ]; then cgi-fcgi -bind -connect /run/php82.sock > /dev/null 2>&1; fi && if [ "$PHP83" = true ]; then cgi-fcgi -bind -connect /run/php83.sock > /dev/null 2>&1; fi && [ "$(curl -sk https://"$HCNPM_IP":"$NPM_PORT"/api/ | jq --raw-output .status)" = "OK" ]); then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
|
|
|
@ -22,13 +22,6 @@ if ! nginx -tq; then
|
|||
sleep inf
|
||||
fi
|
||||
|
||||
if [ "$PHP81" = "true" ]; then
|
||||
if ! PHP_INI_SCAN_DIR=/data/php/81/conf.d php-fpm81 -c /data/php/81 -y /data/php/81/php-fpm.conf -FORt > /dev/null 2>&1; then
|
||||
PHP_INI_SCAN_DIR=/data/php/81/conf.d php-fpm81 -c /data/php/81 -y /data/php/81/php-fpm.conf -FORt
|
||||
sleep inf
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$PHP82" = "true" ]; then
|
||||
if ! PHP_INI_SCAN_DIR=/data/php/82/conf.d php-fpm82 -c /data/php/82 -y /data/php/82/php-fpm.conf -FORt > /dev/null 2>&1; then
|
||||
PHP_INI_SCAN_DIR=/data/php/82/conf.d php-fpm82 -c /data/php/82 -y /data/php/82/php-fpm.conf -FORt
|
||||
|
@ -43,7 +36,6 @@ if [ "$PHP83" = "true" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ "$PHP81" = "true" ]; then PHP_INI_SCAN_DIR=/data/php/81/conf.d php-fpm81 -c /data/php/81 -y /data/php/81/php-fpm.conf -FOR; fi &
|
||||
if [ "$PHP82" = "true" ]; then PHP_INI_SCAN_DIR=/data/php/82/conf.d php-fpm82 -c /data/php/82 -y /data/php/82/php-fpm.conf -FOR; fi &
|
||||
if [ "$PHP83" = "true" ]; then PHP_INI_SCAN_DIR=/data/php/83/conf.d php-fpm83 -c /data/php/83 -y /data/php/83/php-fpm.conf -FOR; fi &
|
||||
if [ "$LOGROTATE" = "true" ]; then while true; do logrotate --verbose --state /data/etc/logrotate.status /etc/logrotate; sleep 25h; done; fi &
|
||||
|
|
|
@ -19,19 +19,20 @@ touch /data/.env
|
|||
. /data/.env
|
||||
|
||||
|
||||
if [ -n "$NPM_CERT_ID" ] && ! echo "$NPM_CERT_ID" | grep -q "^[0-9]\+$"; then
|
||||
echo "NPM_CERT_ID needs to be a number."
|
||||
echo "NPM_CERT_ID is deprecated, please change it to DEFAULT_CERT_ID"
|
||||
if [ -n "$NPM_CERT_ID" ]; then
|
||||
echo "NPM_CERT_ID is replaced by DEFAULT_CERT_ID, please change it to DEFAULT_CERT_ID"
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ -n "$NPM_CERT_ID" ] && [ -z "$DEFAULT_CERT_ID" ]; then
|
||||
echo "NPM_CERT_ID is deprecated, please change it to DEFAULT_CERT_ID"
|
||||
export DEFAULT_CERT_ID="$NPM_CERT_ID"
|
||||
if [ -n "$PHP81" ]; then
|
||||
find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s|fastcgi_pass php81;|fastcgi_pass php82;|g" {} \;
|
||||
echo "PHP81 was removed, please use PHP82 or PHP83"
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ -n "$NPM_CERT_ID" ] && [ -n "$DEFAULT_CERT_ID" ]; then
|
||||
echo "You've set DEFAULT_CERT_ID, but didn't removed NPM_CERT_ID, please remove it."
|
||||
if [ -n "$PHP81_APKS" ]; then
|
||||
find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s|fastcgi_pass php81;|fastcgi_pass php82;|g" {} \;
|
||||
echo "PHP81_APKS was removed, please use PHP82_APKS or PHP83_APKS"
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
|
@ -41,6 +42,7 @@ if [ -z "$TZ" ] || ! echo "$TZ" | grep -q "^[A-Za-z0-9_+-]\+/[A-Za-z0-9_+-]\+$";
|
|||
sleep inf
|
||||
fi
|
||||
|
||||
|
||||
if ! echo "$PUID" | grep -q "^[0-9]\+$"; then
|
||||
echo "PUID needs to be a number."
|
||||
sleep inf
|
||||
|
@ -51,6 +53,12 @@ if ! echo "$PGID" | grep -q "^[0-9]\+$"; then
|
|||
sleep inf
|
||||
fi
|
||||
|
||||
if [ "$PGID" != "0" ] && [ "$PUID" = "0" ]; then
|
||||
echo "You've set PGID but not PUID. Which is required."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
|
||||
if ! echo "$NIBEP" | grep -q "^[0-9]\+$"; then
|
||||
echo "NIBEP needs to be a number."
|
||||
sleep inf
|
||||
|
@ -61,6 +69,7 @@ if ! echo "$GOAIWSP" | grep -q "^[0-9]\+$"; then
|
|||
sleep inf
|
||||
fi
|
||||
|
||||
|
||||
if ! echo "$NPM_PORT" | grep -q "^[0-9]\+$"; then
|
||||
echo "NPM_PORT needs to be a number."
|
||||
sleep inf
|
||||
|
@ -71,6 +80,29 @@ if ! echo "$GOA_PORT" | grep -q "^[0-9]\+$"; then
|
|||
sleep inf
|
||||
fi
|
||||
|
||||
|
||||
if ! echo "$NPM_LISTEN_LOCALHOST" | grep -q "^true$\|^false$"; then
|
||||
echo "NPM_LISTEN_LOCALHOST needs to be true or false."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ "$NPM_LISTEN_LOCALHOST" = "true" ]; then
|
||||
export NPM_IPV4_BINDING="127.0.0.1"
|
||||
export NPM_IPV6_BINDING="[::1]"
|
||||
fi
|
||||
|
||||
|
||||
if ! echo "$GOA_LISTEN_LOCALHOST" | grep -q "^true$\|^false$"; then
|
||||
echo "GOA_LISTEN_LOCALHOST needs to be true or false."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ "$GOA_LISTEN_LOCALHOST" = "true" ]; then
|
||||
export GOA_IPV4_BINDING="127.0.0.1"
|
||||
export GOA_IPV6_BINDING="[::1]"
|
||||
fi
|
||||
|
||||
|
||||
if ! echo "$IPV4_BINDING" | grep -q "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$"; then
|
||||
echo "IPV4_BINDING needs to be a IPv4-Address: four blocks of numbers separated by dots."
|
||||
sleep inf
|
||||
|
@ -86,6 +118,7 @@ if ! echo "$GOA_IPV4_BINDING" | grep -q "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$";
|
|||
sleep inf
|
||||
fi
|
||||
|
||||
|
||||
if ! echo "$IPV6_BINDING" | grep -q "^\[[0-9a-f:]\+\]$"; then
|
||||
echo "IPV6_BINDING needs to be a IPv6-Address inside []: lower letters a-f, numbers 0-9 and colons."
|
||||
sleep inf
|
||||
|
@ -116,15 +149,6 @@ if ! echo "$GOA_DISABLE_IPV6" | grep -q "^true$\|^false$"; then
|
|||
sleep inf
|
||||
fi
|
||||
|
||||
if ! echo "$NPM_LISTEN_LOCALHOST" | grep -q "^true$\|^false$"; then
|
||||
echo "NPM_LISTEN_LOCALHOST needs to be true or false."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if ! echo "$GOA_LISTEN_LOCALHOST" | grep -q "^true$\|^false$"; then
|
||||
echo "GOA_LISTEN_LOCALHOST needs to be true or false."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if ! echo "$DEFAULT_CERT_ID" | grep -q "^[0-9]\+$"; then
|
||||
echo "DEFAULT_CERT_ID needs to be a number."
|
||||
|
@ -191,134 +215,80 @@ if ! echo "$IPRT" | grep -q "^[0-9]\+$"; then
|
|||
sleep inf
|
||||
fi
|
||||
|
||||
|
||||
if ! echo "$GOA" | grep -q "^true$\|^false$"; then
|
||||
echo "GOA needs to be true or false."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ "$GOA" = "true" ] && [ "$LOGROTATE" = "false" ]; then
|
||||
echo "You've enabled GOA but not LOGROTATE. Which is required."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ -s /data/etc/goaccess/geoip/GeoLite2-Country.mmdb ] && [ -s /data/etc/goaccess/geoip/GeoLite2-City.mmdb ] && [ -s /data/etc/goaccess/geoip/GeoLite2-ASN.mmdb ] && echo "$GOACLA" | grep -vq "geoip-database"; then
|
||||
export GOACLA="$GOACLA --geoip-database=/data/etc/goaccess/geoip/GeoLite2-Country.mmdb --geoip-database=/data/etc/goaccess/geoip/GeoLite2-City.mmdb --geoip-database=/data/etc/goaccess/geoip/GeoLite2-ASN.mmdb"
|
||||
fi
|
||||
|
||||
if [ -n "$GOACLA" ] && ! echo "$GOACLA" | grep -q "^-[a-zA-Z0-9 =/_.-]\+$"; then
|
||||
echo "GOACLA must start with a hyphen and can consist of lower and upper letters a-z A-Z, numbers 0-9, spaces, equals signs, slashes, underscores, dots and hyphens."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if ! echo "$PHP81" | grep -q "^true$\|^false$"; then
|
||||
echo "PHP81 needs to be true or false."
|
||||
|
||||
if [ -n "$PHP_APKS" ] && [ "$PHP82" = "false" ] && [ "$PHP83" = "false" ]; then
|
||||
echo "PHP_APKS is set, but PHP82 and PHP83 is disabled."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ -n "$PHP81_APKS" ] && ! echo "$PHP81_APKS" | grep -q "^[a-z0-9 _-]\+$"; then
|
||||
echo "PHP81_APKS can consist of lower letters a-z, numbers 0-9, spaces, underscores and hyphens."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if ! echo "$PHP82" | grep -q "^true$\|^false$"; then
|
||||
echo "PHP82 needs to be true or false."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ -n "$PHP82_APKS" ] && [ "$PHP82" = "false" ]; then
|
||||
echo "PHP82_APKS is set, but PHP82 is disabled."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ -n "$PHP82_APKS" ] && ! echo "$PHP82_APKS" | grep -q "^[a-z0-9 _-]\+$"; then
|
||||
echo "PHP82_APKS can consist of lower letters a-z, numbers 0-9, spaces, underscores and hyphens."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
|
||||
if ! echo "$PHP83" | grep -q "^true$\|^false$"; then
|
||||
echo "PHP83 needs to be true or false."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ -n "$PHP83_APKS" ] && [ "$PHP83" = "false" ]; then
|
||||
echo "PHP83_APKS is set, but PHP83 is disabled."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ -n "$PHP83_APKS" ] && ! echo "$PHP83_APKS" | grep -q "^[a-z0-9 _-]\+$"; then
|
||||
echo "PHP83_APKS can consist of lower letters a-z, numbers 0-9, spaces, underscores and hyphens."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$NC_AIO" ] && ! echo "$NC_AIO" | grep -q "^true$\|^false$"; then
|
||||
echo "NC_AIO needs to be true or false."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
if [ -n "$NC_AIO" ] && ! echo "$NC_DOMAIN" | grep -q "^[a-z0-9.]\+$"; then
|
||||
echo "NC_DOMAIN can consist of lower letters a-z, numbers 0-9 and dots and is required in AIO mode."
|
||||
if [ "$NC_AIO" = "true" ] && ([ -z "$NC_DOMAIN" ] || ! echo "$NC_DOMAIN" | grep -q "^[a-z0-9.]\+$"); then
|
||||
echo "NC_DOMAIN must consist of lower letters a-z, numbers 0-9 and dots and is required in AIO mode."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
|
||||
if [ "$PGID" != "0" ] && [ "$PUID" = "0" ]; then
|
||||
echo "You've set PGID but not PUID. Resetting PGID to 0."
|
||||
export PGID="0"
|
||||
fi
|
||||
|
||||
if [ "$GOA" = "true" ] && [ "$LOGROTATE" = "false" ]; then
|
||||
echo "You've enabled GOA but not LOGROTATE. Enabling LOGROTATE."
|
||||
export LOGROTATE="true"
|
||||
fi
|
||||
|
||||
if [ "$NC_AIO" = "true" ]; then
|
||||
export DISABLE_HTTP="true"
|
||||
fi
|
||||
|
||||
if [ "$NPM_LISTEN_LOCALHOST" = "true" ]; then
|
||||
export NPM_IPV4_BINDING="127.0.0.1"
|
||||
export NPM_IPV6_BINDING="[::1]"
|
||||
fi
|
||||
|
||||
if [ "$GOA_LISTEN_LOCALHOST" = "true" ]; then
|
||||
export GOA_IPV4_BINDING="127.0.0.1"
|
||||
export GOA_IPV6_BINDING="[::1]"
|
||||
fi
|
||||
|
||||
|
||||
if [ -s /data/etc/goaccess/geoip/GeoLite2-Country.mmdb ] && [ -s /data/etc/goaccess/geoip/GeoLite2-City.mmdb ] && [ -s /data/etc/goaccess/geoip/GeoLite2-ASN.mmdb ] && echo "$GOACLA" | grep -vq "geoip-database"; then
|
||||
export GOACLA="$GOACLA --geoip-database=/data/etc/goaccess/geoip/GeoLite2-Country.mmdb --geoip-database=/data/etc/goaccess/geoip/GeoLite2-City.mmdb --geoip-database=/data/etc/goaccess/geoip/GeoLite2-ASN.mmdb"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$PHP81" = "true" ] || [ "$PHP82" = "true" ] || [ "$PHP83" = "true" ]; then
|
||||
|
||||
apk add --no-cache fcgi
|
||||
|
||||
# From https://github.com/nextcloud/all-in-one/pull/1377/files
|
||||
if [ -n "$PHP_APKS" ]; then
|
||||
for apk in $(echo "$PHP_APKS" | tr " " "\n"); do
|
||||
|
||||
if ! echo "$apk" | grep -q "^php-.*$"; then
|
||||
echo "$apk is a non allowed value."
|
||||
echo "It needs to start with \"php-\"."
|
||||
echo "It is set to \"$apk\"."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
echo "Installing $apk via apk..."
|
||||
if ! apk add --no-cache "$apk" > /dev/null 2>&1; then
|
||||
echo "The apk \"$apk\" was not installed!"
|
||||
fi
|
||||
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$PHP81" = "true" ]; then
|
||||
|
||||
apk add --no-cache php81-fpm
|
||||
|
||||
# From https://github.com/nextcloud/all-in-one/pull/1377/files
|
||||
if [ -n "$PHP81_APKS" ]; then
|
||||
for apk in $(echo "$PHP81_APKS" | tr " " "\n"); do
|
||||
|
||||
if ! echo "$apk" | grep -q "^php81-.*$"; then
|
||||
echo "$apk is a non allowed value."
|
||||
echo "It needs to start with \"php81-\"."
|
||||
echo "It is set to \"$apk\"."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
echo "Installing $apk via apk..."
|
||||
if ! apk add --no-cache "$apk" > /dev/null 2>&1; then
|
||||
echo "The apk \"$apk\" was not installed!"
|
||||
fi
|
||||
|
||||
done
|
||||
fi
|
||||
|
||||
mkdir -vp /data/php
|
||||
cp -varnT /etc/php81 /data/php/81
|
||||
sed -i "s|listen =.*|listen = /run/php81.sock|" /data/php/81/php-fpm.d/www.conf
|
||||
sed -i "s|;error_log =.*|error_log = /proc/self/fd/2|g" /data/php/81/php-fpm.conf
|
||||
sed -i "s|include=.*|include=/data/php/81/php-fpm.d/*.conf|g" /data/php/81/php-fpm.conf
|
||||
|
||||
elif [ "$FULLCLEAN" = "true" ]; then
|
||||
rm -vrf /data/php/81
|
||||
fi
|
||||
|
||||
if [ "$PHP82" = "true" ]; then
|
||||
|
||||
|
@ -386,6 +356,31 @@ elif [ "$FULLCLEAN" = "true" ]; then
|
|||
rm -vrf /data/php/83
|
||||
fi
|
||||
|
||||
if [ "$PHP82" = "true" ] || [ "$PHP83" = "true" ]; then
|
||||
|
||||
apk add --no-cache fcgi
|
||||
|
||||
# From https://github.com/nextcloud/all-in-one/pull/1377/files
|
||||
if [ -n "$PHP_APKS" ]; then
|
||||
for apk in $(echo "$PHP_APKS" | tr " " "\n"); do
|
||||
|
||||
if ! echo "$apk" | grep -q "^php-.*$"; then
|
||||
echo "$apk is a non allowed value."
|
||||
echo "It needs to start with \"php-\"."
|
||||
echo "It is set to \"$apk\"."
|
||||
sleep inf
|
||||
fi
|
||||
|
||||
echo "Installing $apk via apk..."
|
||||
if ! apk add --no-cache "$apk" > /dev/null 2>&1; then
|
||||
echo "The apk \"$apk\" was not installed!"
|
||||
fi
|
||||
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ "$LOGROTATE" = "true" ]; then
|
||||
apk add --no-cache logrotate
|
||||
sed -i "s|rotate [0-9]\+|rotate $LOGROTATIONS|g" /etc/logrotate
|
||||
|
@ -522,7 +517,7 @@ if [ -s "$DB_SQLITE_FILE" ]; then
|
|||
fi
|
||||
|
||||
if [ "$FULLCLEAN" = "true" ]; then
|
||||
if [ "$PHP81" != "true" ] && [ "$PHP82" != "true" ] && [ "$PHP83" != "true" ]; then
|
||||
if [ "$PHP82" != "true" ] && [ "$PHP83" != "true" ]; then
|
||||
rm -vrf /data/php
|
||||
fi
|
||||
fi
|
||||
|
@ -927,10 +922,6 @@ if [ "$PUID" != "0" ]; then
|
|||
/tmp \
|
||||
-not \( -uid "$PUID" -and -gid "$PGID" \) \
|
||||
-exec chown "$PUID:$PGID" {} \;
|
||||
if [ "$PHP81" = "true" ]; then
|
||||
sed -i "s|user =.*|;user = root|" /data/php/81/php-fpm.d/www.conf
|
||||
sed -i "s|group =.*|;group = root|" /data/php/81/php-fpm.d/www.conf
|
||||
fi
|
||||
if [ "$PHP82" = "true" ]; then
|
||||
sed -i "s|user =.*|;user = root|" /data/php/82/php-fpm.d/www.conf
|
||||
sed -i "s|group =.*|;group = root|" /data/php/82/php-fpm.d/www.conf
|
||||
|
@ -948,10 +939,6 @@ else
|
|||
/tmp \
|
||||
-not \( -uid 0 -and -gid 0 \) \
|
||||
-exec chown 0:0 {} \;
|
||||
if [ "$PHP81" = "true" ]; then
|
||||
sed -i "s|;user =.*|user = root|" /data/php/81/php-fpm.d/www.conf
|
||||
sed -i "s|;group =.*|group = root|" /data/php/81/php-fpm.d/www.conf
|
||||
fi
|
||||
if [ "$PHP82" = "true" ]; then
|
||||
sed -i "s|;user =.*|user = root|" /data/php/82/php-fpm.d/www.conf
|
||||
sed -i "s|;group =.*|group = root|" /data/php/82/php-fpm.d/www.conf
|
||||
|
|
|
@ -86,10 +86,6 @@ http {
|
|||
websocket "socket";
|
||||
}
|
||||
|
||||
upstream php81 {
|
||||
server unix:/run/php81.sock;
|
||||
}
|
||||
|
||||
upstream php82 {
|
||||
server unix:/run/php82.sock;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue