mirror of
https://github.com/linuxserver/docker-swag.git
synced 2025-11-02 22:17:42 +09:00
add new dns methods, check confs, add workflows
add gehirn and sakuracloud dns validation add conf checker add trigger workflows remove deprecated certbot option for public ip logging
This commit is contained in:
@@ -45,8 +45,6 @@ chown -R abc:abc /config/dns-conf
|
||||
|
||||
# copy reverse proxy configs
|
||||
cp -R /defaults/proxy-confs /config/nginx/
|
||||
# remove outdated files (remove this action after 2020/10/17)
|
||||
rm -f /config/nginx/proxy-confs/seafile.subdomain.config.sample /config/nginx/proxy-confs/librespeed.subdomain.com.sample
|
||||
|
||||
# copy/update the fail2ban config defaults to/in /config
|
||||
cp -R /defaults/fail2ban/filter.d /config/fail2ban/
|
||||
@@ -92,7 +90,7 @@ if ! grep -q 'PARAMETERS' "/config/nginx/dhparams.pem"; then
|
||||
fi
|
||||
|
||||
# check to make sure DNSPLUGIN is selected if dns validation is used
|
||||
[[ "$VALIDATION" = "dns" ]] && [[ ! "$DNSPLUGIN" =~ ^(aliyun|cloudflare|cloudxns|cpanel|digitalocean|dnsimple|dnsmadeeasy|domeneshop|gandi|google|inwx|linode|luadns|netcup|nsone|ovh|rfc2136|route53|transip)$ ]] && \
|
||||
[[ "$VALIDATION" = "dns" ]] && [[ ! "$DNSPLUGIN" =~ ^(aliyun|cloudflare|cloudxns|cpanel|digitalocean|dnsimple|dnsmadeeasy|domeneshop|gandi|gehirn|google|inwx|linode|luadns|netcup|nsone|ovh|rfc2136|route53|sakuracloud|transip)$ ]] && \
|
||||
echo "Please set the DNSPLUGIN variable to a valid plugin name. See docker info for more details." && \
|
||||
sleep infinity
|
||||
|
||||
@@ -176,32 +174,32 @@ fi
|
||||
if [ "$VALIDATION" = "dns" ]; then
|
||||
if [ "$DNSPLUGIN" = "route53" ]; then
|
||||
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
|
||||
PREFCHAL="--dns-${DNSPLUGIN} ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
|
||||
PREFCHAL="--dns-${DNSPLUGIN} ${PROPAGATIONPARAM}"
|
||||
elif [[ "$DNSPLUGIN" =~ ^(cpanel)$ ]]; then
|
||||
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--certbot-dns-${DNSPLUGIN}:${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
|
||||
PREFCHAL="-a certbot-dns-${DNSPLUGIN}:${DNSPLUGIN} --certbot-dns-${DNSPLUGIN}:${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
|
||||
PREFCHAL="-a certbot-dns-${DNSPLUGIN}:${DNSPLUGIN} --certbot-dns-${DNSPLUGIN}:${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM}"
|
||||
elif [[ "$DNSPLUGIN" =~ ^(gandi)$ ]]; then
|
||||
if [ -n "$PROPAGATION" ];then echo "Gandi dns plugin does not support setting propagation time"; fi
|
||||
PREFCHAL="-a certbot-plugin-${DNSPLUGIN}:dns --certbot-plugin-${DNSPLUGIN}:dns-credentials /config/dns-conf/${DNSPLUGIN}.ini --manual-public-ip-logging-ok"
|
||||
PREFCHAL="-a certbot-plugin-${DNSPLUGIN}:dns --certbot-plugin-${DNSPLUGIN}:dns-credentials /config/dns-conf/${DNSPLUGIN}.ini"
|
||||
elif [[ "$DNSPLUGIN" =~ ^(google)$ ]]; then
|
||||
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
|
||||
PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.json ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
|
||||
PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.json ${PROPAGATIONPARAM}"
|
||||
elif [[ "$DNSPLUGIN" =~ ^(aliyun|domeneshop|inwx|transip)$ ]]; then
|
||||
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
|
||||
PREFCHAL="-a certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN} --certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
|
||||
PREFCHAL="-a certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN} --certbot-dns-${DNSPLUGIN}:dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM}"
|
||||
elif [[ "$DNSPLUGIN" =~ ^(netcup)$ ]]; then
|
||||
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
|
||||
PREFCHAL="-a dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
|
||||
PREFCHAL="-a dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM}"
|
||||
else
|
||||
if [ -n "$PROPAGATION" ];then PROPAGATIONPARAM="--dns-${DNSPLUGIN}-propagation-seconds ${PROPAGATION}"; fi
|
||||
PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM} --manual-public-ip-logging-ok"
|
||||
PREFCHAL="--dns-${DNSPLUGIN} --dns-${DNSPLUGIN}-credentials /config/dns-conf/${DNSPLUGIN}.ini ${PROPAGATIONPARAM}"
|
||||
fi
|
||||
echo "${VALIDATION} validation via ${DNSPLUGIN} plugin is selected"
|
||||
elif [ "$VALIDATION" = "tls-sni" ]; then
|
||||
PREFCHAL="--non-interactive --standalone --preferred-challenges http"
|
||||
echo "*****tls-sni validation has been deprecated, attempting http validation instead"
|
||||
elif [ "$VALIDATION" = "duckdns" ]; then
|
||||
PREFCHAL="--non-interactive --manual --preferred-challenges dns --manual-public-ip-logging-ok --manual-auth-hook /app/duckdns-txt"
|
||||
PREFCHAL="--non-interactive --manual --preferred-challenges dns --manual-auth-hook /app/duckdns-txt"
|
||||
chmod +x /app/duckdns-txt
|
||||
echo "duckdns validation is selected"
|
||||
if [ "$SUBDOMAINS" = "wildcard" ]; then
|
||||
|
||||
42
root/etc/cont-init.d/70-templates
Normal file
42
root/etc/cont-init.d/70-templates
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
nginx_confs=( \
|
||||
authelia-location.conf \
|
||||
authelia-server.conf \
|
||||
geoip2.conf \
|
||||
ldap.conf \
|
||||
nginx.conf \
|
||||
proxy.conf \
|
||||
site-confs/default \
|
||||
ssl.conf )
|
||||
|
||||
for i in ${nginx_confs[@]}; do
|
||||
if [ "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' /config/nginx/${i})" != "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' /defaults/$(basename ${i}))" ]; then
|
||||
nginx_confs_changed="/config/nginx/${i}\n${nginx_confs_changed}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$nginx_confs_changed" ]; then
|
||||
echo "**** The following nginx confs have different version dates than the defaults that are shipped. ****"
|
||||
echo "**** This may be due to user customization or an update to the defaults. ****"
|
||||
echo "**** To update them to the latest defaults shipped within the image, delete these files and restart the container. ****"
|
||||
echo "**** If they are user customized, check the date version at the top and compare to the upstream changelog via the link. ****"
|
||||
echo -e "${nginx_confs_changed}"
|
||||
fi
|
||||
|
||||
proxy_confs=$(ls /config/nginx/proxy-confs/*.conf)
|
||||
|
||||
for i in $proxy_confs; do
|
||||
if [ -f "${i}.sample" ]; then
|
||||
if [ "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' ${i})" != "$(sed -nE 's|^## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' ${i}.sample)" ]; then
|
||||
proxy_confs_changed="${i}\n${proxy_confs_changed}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$proxy_confs_changed" ]; then
|
||||
echo "**** The following reverse proxy confs have different version dates than the samples that are shipped. ****"
|
||||
echo "**** This may be due to user customization or an update to the samples. ****"
|
||||
echo "**** You should compare them to the samples in the same folder to make sure you have the latest updates. ****"
|
||||
echo -e "${proxy_confs_changed}"
|
||||
fi
|
||||
Reference in New Issue
Block a user