🗃️ Committing everything that changed 🗃️

This commit is contained in:
casjay
2023-03-16 11:27:40 -04:00
parent 8663deafd6
commit 553e65338b
10 changed files with 592 additions and 124 deletions

View File

@@ -23,13 +23,13 @@ done
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# execute command variables
WORKDIR="" # set working directory
SERVICE_UID="0" # set the user id
SERVICE_USER="root" # execute command as another user
SERVICE_PORT="" # port which service is listening on
EXEC_CMD_BIN="caddy" # command to execute
EXEC_CMD_ARGS="run --config /etc/caddy/Caddyfile" # command arguments
PRE_EXEC_MESSAGE="" # Show message before execute
WORKDIR="" # set working directory
SERVICE_UID="0" # set the user id
SERVICE_USER="root" # execute command as another user
SERVICE_PORT="" # port which service is listening on
EXEC_CMD_BIN="caddy" # command to execute
EXEC_CMD_ARGS="run --config /etc/caddy/Caddyfile" # command arguments
PRE_EXEC_MESSAGE="" # Show message before execute
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Other variables that are needed
etc_dir="/etc/caddy"
@@ -40,9 +40,8 @@ caddy_bin="$(type -P 'caddy' || type -P 'Caddy')"
# use this function to update config files - IE: change port
__update_conf_files() {
echo "Initializing caddy web server in $conf_dir"
[ -d "$etc_dir" ] || mkdir -p "$etc_dir"
[ -d "$conf_dir" ] && cp -Rf "$conf_dir/." "$etc_dir/"
[ -f "$etc_dir/Caddyfile" ] && rm -Rf "$etc_dir/Caddyfile"
[ -d "$etc_dir" ] || mkdir -p "$etc_dir" "$conf_dir"
[ -d "$conf_dir" ] && cp -Rf "$conf_dir/." "$etc_dir/" || cp -Rf "$etc_dir/." "$conf_dir/"
#
[ -d "/data/logs/caddy" ] || mkdir -p "/data/logs/caddy"
chmod -Rf 777 "/data/logs/caddy"
@@ -56,7 +55,6 @@ __update_conf_files() {
__replace "REPLACE_SERVER_NAME" "${SERVER_NAME:-$HOSTNAME}" "$etc_dir/Caddyfile"
__replace "REPLACE_SERVER_ADMIN" "${SERVER_ADMIN:-root@$SERVER_NAME}" "$etc_dir/Caddyfile"
[ -f "$www_dir/www/index.php" ] && __replace "REPLACE_SERVER_SOFTWARE" "caddy" "$www_dir/www/index.php"
[ -f "$www_dir/www/index.html" ] && __replace "REPLACE_SERVER_SOFTWARE" "caddy" "$www_dir/www/index.html"
if [ -z "$PHP_BIN_DIR" ]; then
[ -f "$www_dir/www/info.php" ] && echo "PHP support is not enabled" >"$www_dir/www/info.php"
[ -f "$etc_dir/conf.d/php-fpm.conf" ] && echo "# PHP support is not enabled" >"$etc_dir/conf.d/php-fpm.conf"