mirror of
https://github.com/casjaysdevdocker/opengist
synced 2026-06-24 14:01:06 -04:00
🗃️ Updated 🗃️
Dockerfile .env.scripts .gitattributes .gitea/workflows/build.yml .gitignore README.md rootfs/root/docker/setup/00-init.sh rootfs/root/docker/setup/01-system.sh rootfs/root/docker/setup/02-packages.sh rootfs/root/docker/setup/03-files.sh rootfs/root/docker/setup/04-users.sh rootfs/root/docker/setup/05-custom.sh rootfs/root/docker/setup/06-post.sh rootfs/root/docker/setup/07-cleanup.sh rootfs/tmp/etc/opengist/config.yaml rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/functions/entrypoint.sh rootfs/usr/local/etc/docker/init.d/00-opengist.sh rootfs/usr/local/etc/resolv.conf
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
##@Version : 202606041215-git
|
||||
##@Version : 202606051249-git
|
||||
# @@Author : Jason Hempstead
|
||||
# @@Contact : git-admin@casjaysdev.pro
|
||||
# @@License : LICENSE.md
|
||||
@@ -25,11 +25,11 @@ if [ -f "/config/.debug" ] && [ -z "$DEBUGGER_OPTIONS" ]; then
|
||||
export DEBUGGER_OPTIONS="$(<"/config/.debug")"
|
||||
fi
|
||||
if [ "$DEBUGGER" = "on" ] || [ -f "/config/.debug" ]; then
|
||||
set -o pipefail
|
||||
set -eo pipefail
|
||||
[ -n "$DEBUGGER_OPTIONS" ] && set -"$DEBUGGER_OPTIONS"
|
||||
export DEBUGGER="on"
|
||||
else
|
||||
set -o pipefail
|
||||
set -eo pipefail
|
||||
fi
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
__remove_extra_spaces() { sed -E 's/ +/ /g; s|^ ||'; }
|
||||
@@ -257,7 +257,8 @@ __trim() {
|
||||
__banner() {
|
||||
local message="$*"
|
||||
local total_width=80
|
||||
local content_width=$((total_width - 14)) # Account for "# - - - " and " - - - #"
|
||||
# Account for "# - - - " and " - - - #"
|
||||
local content_width=$((total_width - 14))
|
||||
printf '# - - - %-*s - - - #\n' "$content_width" "$message"
|
||||
}
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
@@ -267,9 +268,12 @@ __service_banner() {
|
||||
local service="${3:-service}"
|
||||
local full_message="$message $service"
|
||||
local total_width=80
|
||||
local content_width=$((total_width - 14)) # Account for "# - - - " and " - - - #"
|
||||
local icon_width=2 # Most emojis are 2 chars wide
|
||||
local text_width=$((content_width - icon_width * 2 - 2)) # Account for both icons and spaces
|
||||
# Account for "# - - - " and " - - - #"
|
||||
local content_width=$((total_width - 14))
|
||||
# Most emojis are 2 chars wide
|
||||
local icon_width=2
|
||||
# Account for both icons and spaces
|
||||
local text_width=$((content_width - icon_width * 2 - 2))
|
||||
printf '# - - - %s %-*s %s - - - #\n' "$icon" "$text_width" "$full_message" "$icon"
|
||||
}
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
@@ -325,9 +329,12 @@ __find_mongodb_conf() {
|
||||
__random_password() { tr -dc '0-9a-zA-Z' < /dev/urandom | head -c${1:-16} && echo ""; }
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
__init_working_dir() {
|
||||
local service_name="$SERVICE_NAME" # get service name
|
||||
local workdir="$(eval echo "${WORK_DIR:-}")" # expand variables
|
||||
local home="$(eval echo "${workdir//\/root/\/tmp\/docker}")" # expand variables
|
||||
# get service name
|
||||
local service_name="$SERVICE_NAME"
|
||||
# expand variables
|
||||
local workdir="$(eval echo "${WORK_DIR:-}")"
|
||||
# expand variables
|
||||
local home="$(eval echo "${workdir//\/root/\/tmp\/docker}")"
|
||||
# set working directories
|
||||
[ "$home" = "$workdir" ] && workdir=""
|
||||
[ "$home" = "/root" ] && home="/tmp/$service_name"
|
||||
@@ -978,10 +985,10 @@ __start_init_scripts() {
|
||||
[ "$1" = " " ] && shift 1
|
||||
if [ "$DEBUGGER" = "on" ]; then
|
||||
echo "Enabling debugging"
|
||||
set -o pipefail
|
||||
set -eo pipefail
|
||||
[ -n "$DEBUGGER_OPTIONS" ] && set -"$DEBUGGER_OPTIONS"
|
||||
else
|
||||
set -o pipefail
|
||||
set -eo pipefail
|
||||
fi
|
||||
local retPID=""
|
||||
local basename=""
|
||||
@@ -1614,3 +1621,4 @@ export ENTRYPOINT_PID_FILE ENTRYPOINT_INIT_FILE ENTRYPOINT_FIRST_RUN
|
||||
export -f __get_pid __start_init_scripts __is_running __update_ssl_certs __create_ssl_cert
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# end of functions
|
||||
# vim: set ft=sh ts=4 sw=4 st=4 et :
|
||||
|
||||
Reference in New Issue
Block a user