Add debian/ubuntu support to __recycledcloud_nginx
This commit is contained in:
parent
d5370c829b
commit
b1aa3aa61d
6 changed files with 34 additions and 7 deletions
|
@ -6,6 +6,10 @@ case "$os" in
|
|||
nginx_user=nginx
|
||||
nginx_certdir=/etc/nginx/ssl
|
||||
;;
|
||||
debian|ubuntu)
|
||||
nginx_user=www-data
|
||||
nginx_certdir=/etc/nginx/ssl
|
||||
;;
|
||||
*)
|
||||
echo "This type does not support $os yet. Aborting." >&2;
|
||||
exit 1;
|
||||
|
|
|
@ -1,12 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
os="$(cat "${__global:?}"/explorer/os)"
|
||||
|
||||
case "$os" in
|
||||
alpine)
|
||||
reload_hook="service nginx --ifstopped start;\
|
||||
service nginx --ifstarted reload"
|
||||
;;
|
||||
debian|ubuntu|*)
|
||||
reload_hook="systemctl reload-or-restart nginx"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check configuration and reload if valid.
|
||||
# TODO: only check if configuration was changed (= listen for __file's
|
||||
# messages).
|
||||
cat << EOF
|
||||
if nginx -t; then
|
||||
service nginx --ifstarted reload
|
||||
service nginx --ifstopped start
|
||||
$reload_hook
|
||||
else
|
||||
echo "NGINX configuration is invalid. Exiting." >2&
|
||||
nginx -t >2&
|
||||
|
|
|
@ -23,7 +23,7 @@ os="$(cat "${__global:?}"/explorer/os)"
|
|||
mkdir -p "${__object:?}/files"
|
||||
|
||||
case "$os" in
|
||||
"alpine")
|
||||
alpine)
|
||||
__package nginx
|
||||
|
||||
nginx_confdir="/etc/nginx"
|
||||
|
@ -38,8 +38,20 @@ case "$os" in
|
|||
export NGINX_WEBROOT="/var/www"
|
||||
export ACME_CHALLENGE_DIR="$NGINX_WEBROOT/.well-known/acme-challenge/"
|
||||
;;
|
||||
debian|ubuntu)
|
||||
__package nginx
|
||||
|
||||
nginx_confdir="/etc/nginx"
|
||||
install_reqs="__package/nginx"
|
||||
|
||||
export NGINX_SITEDIR="$nginx_confdir/sites-enabled"
|
||||
export NGINX_CERTDIR="$nginx_confdir/ssl"
|
||||
export NGINX_SNIPPETSDIR="$nginx_confdir/snippets"
|
||||
export NGINX_WEBROOT="/var/www"
|
||||
export ACME_CHALLENGE_DIR="$NGINX_WEBROOT/.well-known/acme-challenge/"
|
||||
;;
|
||||
*)
|
||||
echo "__nginx_vhost does not support $os yet. Aborting." >&2;
|
||||
echo "This type does not support $os yet. Aborting." >&2;
|
||||
exit 1;
|
||||
esac
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
os="$(cat "${__global:?}"/explorer/os)"
|
||||
|
||||
case "$os" in
|
||||
'alpine')
|
||||
alpine|ubuntu|debian)
|
||||
default_confdir=/etc/ssl/uacme
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
os="$(cat "${__global:?}"/explorer/os)"
|
||||
case "$os" in
|
||||
alpine)
|
||||
alpine|ubuntu|debian)
|
||||
default_confdir=/etc/ssl/uacme
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
os="$(cat "${__global:?}"/explorer/os)"
|
||||
case "$os" in
|
||||
alpine)
|
||||
alpine|ubuntu|debian)
|
||||
__package uacme
|
||||
|
||||
default_challengedir=/var/www/.well-known/acme-challenge
|
||||
|
|
Reference in a new issue