diff --git a/Dockerfile b/Dockerfile index 1dd1333..d240d31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,6 @@ ARG DEFAULT_FILE_DIR="/usr/local/share/template-files" ARG DEFAULT_DATA_DIR="/usr/local/share/template-files/data" ARG DEFAULT_CONF_DIR="/usr/local/share/template-files/config" ARG DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults" -ARG LENPATE_VERSION="1.3.1" ARG USER="root" ARG SHELL_OPTS="set -e -o pipefail" @@ -29,8 +28,8 @@ ARG PULL_URL="casjaysdev/alpine" ARG DISTRO_VERSION="${IMAGE_VERSION}" ARG BUILD_VERSION="${BUILD_DATE}" -FROM ghcr.io/lcomrade/lenpaste:${LENPATE_VERSION} AS lenpaste FROM tianon/gosu:latest AS gosu +FROM ghcr.io/lcomrade/lenpaste:${LENPATE_VERSION:-1.3.1} AS lenpaste FROM ${PULL_URL}:${DISTRO_VERSION} AS build ARG TZ ARG USER diff --git a/rootfs/usr/local/etc/docker/init.d/01-lenpaste.sh b/rootfs/usr/local/etc/docker/init.d/01-lenpaste.sh index a606634..9162436 100755 --- a/rootfs/usr/local/etc/docker/init.d/01-lenpaste.sh +++ b/rootfs/usr/local/etc/docker/init.d/01-lenpaste.sh @@ -146,7 +146,7 @@ user_pass="${LENPASTE_USER_PASS_WORD:-}" # normal user password # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Additional variables -LENPASTE_ADDRESS="${SERVICE_PORT:-:80}" # ADDRESS:PORT for HTTP server. +LENPASTE_ADDRESS="${LENPASTE_ADDRESS:-}" # ADDRESS:PORT for HTTP server. DATABASE_DIR="${DATABASE_DIR:-/data/db/sqlite}" # Database location LENPASTE_DB_DRIVER="${LENPASTE_DB_DRIVER:-sqlite3}" # Currently supported drivers: 'sqlite3' and 'postgres'. LENPASTE_DB_SOURCE="${LENPASTE_DB_SOURCE:-$DATABASE_DIR}" # DB source. @@ -185,7 +185,7 @@ CMD_ENV="" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Overwrite based on file/directory if ! echo "$LENPASTE_ADDRESS" | grep -q ':[0-9][0-9]'; then -LENPASTE_ADDRESS="$LENPASTE_ADDRESS:$SERVICE_PORT" +LENPASTE_ADDRESS="${LENPASTE_ADDRESS:-$HOSTNAME}:$SERVICE_PORT" fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Per Application Variables or imports @@ -245,13 +245,13 @@ __update_conf_files() { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # define actions + if [ -n "$LENPASTE_ADDRESS" ]; then + RUN_CMD+="-address $LENPASTE_ADDRESS," + fi [ -d "$DATA_DIR/html" ] || mkdir -p "$DATA_DIR/html" if [ -f "/config/secure/auth/root/lenpasswd" ]; then RUN_CMD+="-lenpasswd-file /config/secure/auth/root/lenpasswd," fi - if [ -n "$LENPASTE_ADDRESS" ]; then - RUN_CMD+="-address $LENPASTE_ADDRESS," - fi if [ "$LENPASTE_DB_DRIVER" = "postgres" ]; then RUN_CMD+="-db-driver postgres," elif [ "$LENPASTE_DB_DRIVER" = "" ] || [ "$LENPASTE_DB_DRIVER" = "sqlite" ] || [ "$LENPASTE_DB_DRIVER" = "sqlite3" ]; then