mirror of
https://github.com/casjaysdevdocker/ntfy
synced 2025-01-18 00:34:30 -05:00
🗃️ Fixed: rootfs/usr/local/etc/docker/functions/entrypoint.sh 🗃️
Dockerfile rootfs/usr/local/etc/docker/functions/entrypoint.sh
This commit is contained in:
parent
05f888fdc0
commit
616c3d1778
@ -121,8 +121,8 @@ RUN \
|
|||||||
py_version="$($pip_bin --version | sed 's|[pP]ython ||g' | awk -F '.' '{print $1$2}' | grep '[0-9]' || echo "0")"; \
|
py_version="$($pip_bin --version | sed 's|[pP]ython ||g' | awk -F '.' '{print $1$2}' | grep '[0-9]' || echo "0")"; \
|
||||||
[ "$py_version" -gt "310" ] && pip_opts="--break-system-packages " || pip_opts=""; \
|
[ "$py_version" -gt "310" ] && pip_opts="--break-system-packages " || pip_opts=""; \
|
||||||
if [ -n "$pip_bin" ];then $pip_bin -m pip install certbot-dns-rfc2136 certbot-dns-duckdns certbot-dns-cloudflare certbot-nginx $pip_opts || true;fi; \
|
if [ -n "$pip_bin" ];then $pip_bin -m pip install certbot-dns-rfc2136 certbot-dns-duckdns certbot-dns-cloudflare certbot-nginx $pip_opts || true;fi; \
|
||||||
[ -f "$BASH_CMD" ] && rm -rf "/bin/sh" && ln -sf "$BASH_CMD" "/bin/sh" || true; \
|
[ -f "$BASH_CMD" ] && { rm -rf "/bin/sh" || true; } && ln -sf "$BASH_CMD" "/bin/sh" || true; \
|
||||||
[ -n "$BASH_CMD" ] && sed -i 's|root:x:.*|root:x:0:0:root:/root:$BASH_CMD|g' "/etc/passwd" || true; [ -f "/usr/share/zoneinfo/${TZ}" ] && ln -sf "/usr/share/zoneinfo/${TZ}" "/etc/localtime" || true; [ -n "$PHP_FPM" ] && [ -z "$(command -v php-fpm 2>/dev/null)" ] && ln -sf "$PHP_FPM" "/usr/bin/php-fpm" 2>/dev/null || true; if [ -f "/etc/profile.d/color_prompt.sh.disabled" ]; then mv -f "/etc/profile.d/color_prompt.sh.disabled" "/etc/profile.d/color_prompt.sh";fi ; \
|
[ -n "$BASH_CMD" ] && sed -i 's|root:x:.*|root:x:0:0:root:/root:'$BASH_CMD'|g' "/etc/passwd" || true; [ -f "/usr/share/zoneinfo/${TZ}" ] && ln -sf "/usr/share/zoneinfo/${TZ}" "/etc/localtime" || true; [ -n "$PHP_FPM" ] && [ -z "$(command -v php-fpm 2>/dev/null)" ] && ln -sf "$PHP_FPM" "/usr/bin/php-fpm" 2>/dev/null || true; if [ -f "/etc/profile.d/color_prompt.sh.disabled" ]; then mv -f "/etc/profile.d/color_prompt.sh.disabled" "/etc/profile.d/color_prompt.sh";fi ; \
|
||||||
{ [ -f "/etc/bash/bashrc" ] && cp -Rf "/etc/bash/bashrc" "/root/.bashrc"; } || { [ -f "/etc/bashrc" ] && cp -Rf "/etc/bashrc" "/root/.bashrc"; } || { [ -f "/etc/bash.bashrc" ] && cp -Rf "/etc/bash.bashrc" "/root/.bashrc"; } || true; \
|
{ [ -f "/etc/bash/bashrc" ] && cp -Rf "/etc/bash/bashrc" "/root/.bashrc"; } || { [ -f "/etc/bashrc" ] && cp -Rf "/etc/bashrc" "/root/.bashrc"; } || { [ -f "/etc/bash.bashrc" ] && cp -Rf "/etc/bash.bashrc" "/root/.bashrc"; } || true; \
|
||||||
if [ -z "$(command -v "apt-get" 2>/dev/null)" ];then grep -s -q 'alias quit' "/root/.bashrc" || printf '# Profile\n\n%s\n%s\n%s\n' '. /etc/profile' '. /root/.profile' "alias quit='exit 0 2>/dev/null'" >>"/root/.bashrc"; fi; \
|
if [ -z "$(command -v "apt-get" 2>/dev/null)" ];then grep -s -q 'alias quit' "/root/.bashrc" || printf '# Profile\n\n%s\n%s\n%s\n' '. /etc/profile' '. /root/.profile' "alias quit='exit 0 2>/dev/null'" >>"/root/.bashrc"; fi; \
|
||||||
if [ -f "/usr/local/etc/docker/env/default.sample" ] && [ -d "/etc/profile.d" ];then cp -Rf "/usr/local/etc/docker/env/default.sample" "/etc/profile.d/container.env.sh" && chmod 755 "/etc/profile.d/container.env.sh";fi; \
|
if [ -f "/usr/local/etc/docker/env/default.sample" ] && [ -d "/etc/profile.d" ];then cp -Rf "/usr/local/etc/docker/env/default.sample" "/etc/profile.d/container.env.sh" && chmod 755 "/etc/profile.d/container.env.sh";fi; \
|
||||||
|
@ -451,7 +451,7 @@ __create_service_user() {
|
|||||||
local exitStatus=0
|
local exitStatus=0
|
||||||
local set_home_dir=""
|
local set_home_dir=""
|
||||||
local create_user="${1:-$SERVICE_USER}"
|
local create_user="${1:-$SERVICE_USER}"
|
||||||
local create_group="${2:-$SERVICE_GROUP}"
|
local create_group="${2:-${SERVICE_GROUP:-$create_user}}"
|
||||||
local create_home_dir="${3:-${WORK_DIR:-/home/$create_user}}"
|
local create_home_dir="${3:-${WORK_DIR:-/home/$create_user}}"
|
||||||
local create_uid="${4:-${SERVICE_UID:-$USER_UID}}"
|
local create_uid="${4:-${SERVICE_UID:-$USER_UID}}"
|
||||||
local create_gid="${5:-${SERVICE_GID:-$USER_GID}}"
|
local create_gid="${5:-${SERVICE_GID:-$USER_GID}}"
|
||||||
@ -620,6 +620,15 @@ EOF
|
|||||||
__symlink "/config/ssmtp/$file" "/etc/ssmtp/$file"
|
__symlink "/config/ssmtp/$file" "/etc/ssmtp/$file"
|
||||||
__initialize_replace_variables "/etc/ssmtp/$file"
|
__initialize_replace_variables "/etc/ssmtp/$file"
|
||||||
done
|
done
|
||||||
|
if [ -f "/etc/ssmtp/revaliases" ] && [ ! -f "/config/ssmtp/revaliases" ]; then
|
||||||
|
mv -f "/etc/ssmtp/revaliases" "/config/ssmtp/revaliases"
|
||||||
|
__symlink "/config/ssmtp/revaliases" "/etc/ssmtp/revaliases"
|
||||||
|
__initialize_replace_variables "/etc/ssmtp/revaliases"
|
||||||
|
else
|
||||||
|
touch "/config/ssmtp/revaliases"
|
||||||
|
__symlink "/config/ssmtp/revaliases" "/etc/ssmtp/revaliases"
|
||||||
|
__initialize_replace_variables "/etc/ssmtp/revaliases"
|
||||||
|
fi
|
||||||
echo "Done setting up ssmtp"
|
echo "Done setting up ssmtp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -720,6 +729,11 @@ __initialize_replace_variables() {
|
|||||||
__find_replace "REPLACE_APP_GROUP" "${SERVICE_GROUP:-${SERVICE_USER:-${RUNAS_USER:-root}}}" "$set_dir"
|
__find_replace "REPLACE_APP_GROUP" "${SERVICE_GROUP:-${SERVICE_USER:-${RUNAS_USER:-root}}}" "$set_dir"
|
||||||
__find_replace "REPLACE_WWW_GROUP" "${SERVICE_GROUP:-${SERVICE_USER:-${RUNAS_USER:-root}}}" "$set_dir"
|
__find_replace "REPLACE_WWW_GROUP" "${SERVICE_GROUP:-${SERVICE_USER:-${RUNAS_USER:-root}}}" "$set_dir"
|
||||||
__find_replace "REPLACE_SERVICE_USER" "${SERVICE_USER:-${RUNAS_USER:-root}}" "$set_dir"
|
__find_replace "REPLACE_SERVICE_USER" "${SERVICE_USER:-${RUNAS_USER:-root}}" "$set_dir"
|
||||||
|
__find_replace "REPLACE_SERVICE_GROUP" "${SERVICE_GROUP:-${RUNAS_USER:-root}}" "$set_dir"
|
||||||
|
if [ -n "$VAR_DIR" ]; then
|
||||||
|
mkdir -p "$VAR_DIR"
|
||||||
|
__find_replace "REPLACE_VAR_DIR" "$VAR_DIR" "$set_dir"
|
||||||
|
fi
|
||||||
[ -n "$SERVICE_PORT" ] && __find_replace "REPLACE_SERVER_PORT" "${SERVICE_PORT:-80}" "$set_dir"
|
[ -n "$SERVICE_PORT" ] && __find_replace "REPLACE_SERVER_PORT" "${SERVICE_PORT:-80}" "$set_dir"
|
||||||
[ -n "$HOSTNAME" ] && __find_replace "REPLACE_SERVER_NAME" "${FULL_DOMAIN_NAME:-$HOSTNAME}" "$set_dir"
|
[ -n "$HOSTNAME" ] && __find_replace "REPLACE_SERVER_NAME" "${FULL_DOMAIN_NAME:-$HOSTNAME}" "$set_dir"
|
||||||
[ -n "$CONTAINER_NAME" ] && __find_replace "REPLACE_SERVER_SOFTWARE" "${CONTAINER_NAME:-docker}" "$set_dir"
|
[ -n "$CONTAINER_NAME" ] && __find_replace "REPLACE_SERVER_SOFTWARE" "${CONTAINER_NAME:-docker}" "$set_dir"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user