mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
Update UPDATE.sh
This commit is contained in:
parent
9820571a70
commit
b29364c81b
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir -p /var/log/caddy/coraza_waf
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Adding fix for custom files not loading.. - issue #444"
|
echo "Adding fix for custom files not loading.. - issue #444"
|
||||||
sed -i 's#/usr/local/panel/#/#g' /root/docker-compose.yml
|
sed -i 's#/usr/local/panel/#/#g' /root/docker-compose.yml
|
||||||
@ -21,7 +23,9 @@ echo "Modifying WAF settings in all *.conf files under $CONF_DIR"
|
|||||||
cp -r $CONF_DIR /etc/openpanel/caddy/024-domains
|
cp -r $CONF_DIR /etc/openpanel/caddy/024-domains
|
||||||
|
|
||||||
for file in "$CONF_DIR"/*.conf; do
|
for file in "$CONF_DIR"/*.conf; do
|
||||||
echo "Processing $file"
|
|
||||||
|
DOMAIN_NAME=$(basename "$file" .conf)
|
||||||
|
echo "Processing $DOMAIN_NAME"
|
||||||
|
|
||||||
# Check if all target lines already exist
|
# Check if all target lines already exist
|
||||||
if grep -q 'SecAuditEngine RelevantOnly' "$file" &&
|
if grep -q 'SecAuditEngine RelevantOnly' "$file" &&
|
||||||
@ -52,17 +56,15 @@ for file in "$CONF_DIR"/*.conf; do
|
|||||||
echo " -> 'SecAuditLogParts ABIJDEFHZ' not found in $file, skipping log format addition"
|
echo " -> 'SecAuditLogParts ABIJDEFHZ' not found in $file, skipping log format addition"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
touch /var/log/caddy/coraza_waf/"$DOMAIN_NAME".log
|
||||||
|
sed -i "s|coraza_audit.log|/coraza_waf/$DOMAIN_NAME.log|g" "$conf_file"
|
||||||
|
|
||||||
done
|
done
|
||||||
echo ""
|
echo ""
|
||||||
echo "Done processing domains, backup is created in /etc/openpanel/caddy/024-domains"
|
echo "Done processing domains, backup is created in /etc/openpanel/caddy/024-domains"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Updating template: /etc/openpanel/varnish/default.vcl"
|
echo "Updating template: /etc/openpanel/varnish/default.vcl"
|
||||||
wget -O /etc/openpanel/varnish/default.vcl https://raw.githubusercontent.com/stefanpejcic/openpanel-configuration/refs/heads/main/varnish/default.vcl
|
wget -O /etc/openpanel/varnish/default.vcl https://raw.githubusercontent.com/stefanpejcic/openpanel-configuration/refs/heads/main/varnish/default.vcl
|
||||||
|
Loading…
Reference in New Issue
Block a user