Skip to content

Commit b572e62

Browse files
committed
Squashed commit of the following:
commit 0baf2df Author: CLHatch <[email protected]> Date: Sat Oct 25 00:53:38 2025 -0500 Remove `-T` from the `--pm-config` and `--pm-config-auto` usages text (GhostWriters#2285) commit d60ce73 Author: CLHatch <[email protected]> Date: Sat Oct 25 00:40:28 2025 -0500 Add the missing `--config-pm` and `--config-pm-auto` usage text (GhostWriters#2284) commit 24ff1ad Author: CLHatch <[email protected]> Date: Fri Oct 24 23:34:52 2025 -0500 Add package manager selection options (GhostWriters#2283) commit 79f4ab5 Author: CLHatch <[email protected]> Date: Fri Oct 24 12:55:45 2025 -0500 Allow optional arguments during fresh install. (GhostWriters#2282) commit 89f07d4 Author: CLHatch <[email protected]> Date: Thu Oct 23 03:17:56 2025 -0500 Change `menu.ini` to `dockstarter.ini` (GhostWriters#2281) commit 9653caa Author: CLHatch <[email protected]> Date: Tue Oct 21 03:17:22 2025 -0500 Add `backrest` (GhostWriters#2280) commit b457e6d Author: CLHatch <[email protected]> Date: Mon Oct 20 23:57:12 2025 -0500 Remove extraneous newline in Calibre variable file (GhostWriters#2279) commit 2e9ba0c Author: CLHatch <[email protected]> Date: Mon Oct 20 23:53:38 2025 -0500 Adjust a comment heading slightly for Calibre (GhostWriters#2278) commit e69d985 Author: CLHatch <[email protected]> Date: Mon Oct 20 22:49:44 2025 -0500 Update Calibre ports and variables (GhostWriters#2277) Resolves GhostWriters#2271 commit bf35f6f Author: CLHatch <[email protected]> Date: Sun Oct 19 07:47:51 2025 -0500 Move the `.dialogrc` and `.dialogoptions` files to the temp folder (GhostWriters#2276) commit acaf094 Author: CLHatch <[email protected]> Date: Sun Oct 19 06:10:16 2025 -0500 Correct the branch from `macos` to `main` (GhostWriters#2275) commit 0d09be4 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Oct 19 02:33:31 2025 +0000 Update mstruebing/editorconfig-checker Docker tag to v3.4.1 commit 0ac574f Author: CLHatch <[email protected]> Date: Sat Oct 18 21:32:56 2025 -0500 Fix typo in error message (GhostWriters#2274) commit c296ce3 Author: CLHatch <[email protected]> Date: Sat Oct 18 21:28:49 2025 -0500 Remove extraneous character in bash version check (GhostWriters#2273) commit 96b87fc Author: CLHatch <[email protected]> Date: Sat Oct 18 19:27:44 2025 -0500 Support MacOS (GhostWriters#2272) commit afc32e0 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Wed Oct 15 14:02:17 2025 +0000 Update dependency mkdocs-material to v9.6.22
1 parent e0e4d8d commit b572e62

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1069
-133
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Borders='yes'
22
LineCharacters='yes'
3+
PackageManager=''
34
Scrollbar='yes'
45
Shadow='yes'
56
Theme='DockSTARTer'

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Cache directory - created in .scripts/install_docker.sh and .scripts/install_yq.sh
22
/.cache
33

4-
# Dialog configuration file - created by .scripts/menu.sh for dialog interface settings
5-
/.dialogrc
6-
74
# Dialog options file
85
/.dialogoptions
96

7+
# Dialog configuration file
8+
/.dialogrc
9+
1010
# Temporary folder
1111
/.temp/
1212

@@ -43,12 +43,12 @@
4343
# Alternative configuration directory - legacy path, referenced in migration scripts
4444
/configs/
4545

46+
# DockSTARTer preferences file
47+
/dockstarter.ini
48+
4649
# Application log file - created by .scripts/log.sh for DockSTARTer output
4750
/dockstarter.log
4851

49-
# Menu configuration file - created by .scripts/menu.sh for storing menu preferences
50-
/menu.ini
51-
5252
# Shared data directory - created by .scripts/compose_setup.sh for container volume mounts
5353
/share/
5454

.includes/cmdline.sh

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ parse_arguments() {
5353
;;
5454

5555
# --command
56+
--config-pm-auto) ;&
57+
--config-pm-list | --config-pm-table) ;&
58+
--config-pm-existing-list | --config-pm-existing-table) ;&
5659
-e | --env) ;&
5760
-i | --install) ;&
5861
-l | --list) ;&
@@ -99,6 +102,19 @@ parse_arguments() {
99102
break
100103
;;
101104

105+
--config-pm)
106+
if [[ -z ${!OPTIND-} || ${!OPTIND} == "-"* ]]; then
107+
cmdline_error \
108+
"${OPTION}" \
109+
"Command %c requires a package manager name." \
110+
"${ParsedArgs[@]}" "${CurrentFlags[@]}" "${CurrentCommand[@]}" "${OPTION}"
111+
exit 1
112+
fi
113+
CurrentCommand+=("${OPTION}" "${!OPTIND}")
114+
OPTIND+=1
115+
break
116+
;;
117+
102118
-M | --menu)
103119
CurrentCommand=("${OPTION}")
104120
if [[ -n ${!OPTIND-} && ${!OPTIND} != "-"* ]]; then
@@ -364,6 +380,12 @@ run_command() {
364380
["--add"]="appvars_create"
365381
["-c"]="docker_compose"
366382
["--compose"]="docker_compose"
383+
["--config-pm"]="config_package_manager"
384+
["--config-pm-auto"]="config_package_manager"
385+
["--config-pm-list"]="package_manager_list"
386+
["--config-pm-table"]="package_manager_table"
387+
["--config-pm-existing-list"]="package_manager_existing_list"
388+
["--config-pm-existing-table"]="package_manager_existing_table"
367389
["-e"]="appvars_create_all"
368390
["--env"]="appvars_create_all"
369391
["--env-appvars"]="appvars_list"
@@ -441,6 +463,12 @@ run_command() {
441463
["-a"]=1
442464
["--add"]=1
443465
["-e"]=1
466+
["--config-pm"]=1
467+
["--config-pm-auto"]=1
468+
["--config-pm-list"]=1
469+
["--config-pm-table"]=1
470+
["--config-pm-existing-list"]=1
471+
["--config-pm-existing-table"]=1
444472
["--env"]=1
445473
["--list"]=1
446474
["-r"]=1
@@ -452,6 +480,12 @@ run_command() {
452480
CommandTitle+=(
453481
["-a"]="Add Application"
454482
["--add"]="Add Application"
483+
["--config-pm"]="Select package manager"
484+
["--config-pm-auto"]="Select package manager"
485+
["--config-pm-list"]="List known package managers"
486+
["--config-pm-table"]="List known package managers"
487+
["--config-pm-existing-list"]="List existing package managers"
488+
["--config-pm-existing-table"]="List existing package managers"
455489
["-e"]="${DC["TitleSuccess"]-}Creating environment variables for added apps"
456490
["--env"]="${DC["TitleSuccess"]-}Creating environment variables for added apps"
457491
["--env-appvars"]="Variables for Application"
@@ -674,6 +708,9 @@ run_command() {
674708
;;
675709
-a | --add) ;&
676710
-c | --compose) ;&
711+
--config-pm) ;&
712+
--config-pm-list | --config-pm-table) ;&
713+
--config-pm-existing-list | --config-pm-existing-table) ;&
677714
-e | --env) ;&
678715
-i | --install) ;&
679716
--list) ;&
@@ -725,6 +762,44 @@ run_command() {
725762
fi
726763
;;
727764

765+
--config-pm-auto)
766+
if [[ -z ${Script} ]]; then
767+
fatal \
768+
"No script is defined for command '${C["UserCommand"]-}${Command}${NC-}'.\n" \
769+
"Please let the dev know."
770+
fi
771+
if [[ -n ${EnvCreate-} ]]; then
772+
run_script 'env_create'
773+
fi
774+
if [[ -n ${EnvBackup-} ]]; then
775+
run_script 'env_backup'
776+
fi
777+
if [[ ${RequireDialog-} ]]; then
778+
if [[ -z ${DIALOG-} ]]; then
779+
fatal \
780+
"The GUI requires the '${C["Program"]-}dialog${NC-}' command to be installed.\n" \
781+
"'${C["Program"]-}dialog${NC-}' command not found. Run '${C["UserCommand"]-}${APPLICATION_COMMAND} -i${NC-}' to install all dependencies.\n" \
782+
"\n" \
783+
"Unable to start GUI without the '${C["Program"]-}dialog${NC-}' command.\n"
784+
fi
785+
declare -gx PROMPT="GUI"
786+
run_script "${Script}" ""
787+
result=$?
788+
else
789+
if [[ ${UseDialog} ]]; then
790+
run_script_dialog "${Title}" "${SubTitle}" "" \
791+
"${Script}" ""
792+
result=$?
793+
else
794+
run_script "${Script}" ""
795+
result=$?
796+
fi
797+
fi
798+
if [[ -n ${EnvUpdate-} ]]; then
799+
run_script 'env_update'
800+
fi
801+
;;
802+
728803
--menu-config-app)
729804
if [[ -z ${Script} ]]; then
730805
fatal \
@@ -766,10 +841,10 @@ run_command() {
766841
fi
767842
notice "${NoticeText}"
768843
if use_dialog_box; then
769-
run_script 'apply_theme' "${ThemeName}" && run_script 'menu_dialog_example' "" "${CURRENT_COMMANDLINE}"
844+
run_script 'config_theme' "${ThemeName}" && run_script 'menu_dialog_example' "" "${CURRENT_COMMANDLINE}"
770845
result=$?
771846
else
772-
run_script 'apply_theme' "${ThemeName}"
847+
run_script 'config_theme' "${ThemeName}"
773848
result=$?
774849
fi
775850
;;

.includes/dialog_functions.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ DIALOG=$(command -v dialog) || true
88
declare -Agx DC
99

1010
declare -rgx DIALOGRC_NAME='.dialogrc'
11+
declare -rgx DIALOG_OPTIONS_NAME='.dialogoptions'
12+
1113
declare -rgx DIALOGRC="${SCRIPTPATH}/${DIALOGRC_NAME}"
12-
declare -rgx DIALOG_OPTIONS_FILE="${SCRIPTPATH}/.dialogoptions"
14+
declare -rgx DIALOG_OPTIONS_FILE="${SCRIPTPATH}/${DIALOG_OPTIONS_NAME}"
1315

1416
declare -rigx DIALOGTIMEOUT=3
1517
declare -rigx DIALOG_OK=0
@@ -131,7 +133,7 @@ dialog_pipe() {
131133
local SubTitle=${2:-}
132134
local TimeOut=${3:-0}
133135
if [[ -z ${DC["_defined_"]-} ]]; then
134-
run_script 'apply_theme'
136+
run_script 'config_theme'
135137
fi
136138
Title="$(strip_ansi_colors "${Title}")"
137139
SubTitle="$(strip_ansi_colors "${SubTitle}")"
@@ -151,7 +153,7 @@ run_script_dialog() {
151153
shift 4
152154
if use_dialog_box; then
153155
if [[ -z ${DC["_defined_"]-} ]]; then
154-
run_script 'apply_theme'
156+
run_script 'config_theme'
155157
fi
156158
# Using the GUI, pipe output to a dialog box
157159
coproc {
@@ -195,7 +197,7 @@ dialog_info() {
195197
Title="$(strip_ansi_colors "${Title}")"
196198
Message="$(strip_ansi_colors "${Message}")"
197199
if [[ -z ${DC["_defined_"]-} ]]; then
198-
run_script 'apply_theme'
200+
run_script 'config_theme'
199201
fi
200202
_dialog_ \
201203
--title "${Title}" \
@@ -210,7 +212,7 @@ dialog_message() {
210212
Title="$(strip_ansi_colors "${Title}")"
211213
Message="$(strip_ansi_colors "${Message}")"
212214
if [[ -z ${DC["_defined_"]-} ]]; then
213-
run_script 'apply_theme'
215+
run_script 'config_theme'
214216
fi
215217
_dialog_ \
216218
--title "${Title}" \
@@ -224,7 +226,7 @@ dialog_error() {
224226
local Message=${2:-}
225227
local TimeOut=${3:-0}
226228
if [[ -z ${DC["_defined_"]-} ]]; then
227-
run_script 'apply_theme'
229+
run_script 'config_theme'
228230
fi
229231
dialog_message "${DC["TitleError"]-}${Title}" "${Message}" "${TimeOut}"
230232
}
@@ -233,7 +235,7 @@ dialog_warning() {
233235
local Message=${2:-}
234236
local TimeOut=${3:-0}
235237
if [[ -z ${DC["_defined_"]-} ]]; then
236-
run_script 'apply_theme'
238+
run_script 'config_theme'
237239
fi
238240
dialog_message "${DC["TitleWarning"]-}${Title}" "${Message}" "${TimeOut}"
239241
}
@@ -242,7 +244,7 @@ dialog_success() {
242244
local Message=${2:-}
243245
local TimeOut=${3:-0}
244246
if [[ -z ${DC["_defined_"]-} ]]; then
245-
run_script 'apply_theme'
247+
run_script 'config_theme'
246248
fi
247249
dialog_message "${DC["TitleSuccess"]-}${Title}" "${Message}" "${TimeOut}"
248250
}

.includes/global_variables.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,30 @@ sudo chown "${DETECTED_PUID}":"${DETECTED_PGID}" "${TEMP_FOLDER}"
1414
sudo chmod a=,a+rX,u+w,g+w "${TEMP_FOLDER}"
1515

1616
declare -rgx COMPOSE_FOLDER_NAME="compose"
17+
declare -rgx DEFAULTS_FOLDER_NAME=".defaults"
1718
declare -rgx THEME_FOLDER_NAME=".themes"
19+
1820
declare -rgx COMPOSE_FOLDER="${SCRIPTPATH}/${COMPOSE_FOLDER_NAME}"
21+
declare -rgx DEFAULTS_FOLDER="${SCRIPTPATH}/${DEFAULTS_FOLDER_NAME}"
1922
declare -rgx THEME_FOLDER="${SCRIPTPATH}/${THEME_FOLDER_NAME}"
2023

21-
declare -rgx INSTANCES_FOLDER_NAME=".instances"
22-
declare -rgx TEMPLATES_FOLDER_NAME=".apps"
23-
declare -rgx APP_ENV_FOLDER_NAME="env_files"
2424
declare -rgx DOCKER_COMPOSE_FILE="${COMPOSE_FOLDER}/docker-compose.yml"
2525
declare -rgx COMPOSE_OVERRIDE_NAME="docker-compose.override.yml"
2626
declare -rgx COMPOSE_ENV="${COMPOSE_FOLDER}/.env"
2727
declare -rgx COMPOSE_ENV_DEFAULT_FILE="${COMPOSE_FOLDER}/.env.example"
2828
declare -rgx COMPOSE_OVERRIDE="${COMPOSE_FOLDER}/${COMPOSE_OVERRIDE_NAME}"
29+
30+
declare -rgx APP_ENV_FOLDER_NAME="env_files"
31+
declare -rgx INSTANCES_FOLDER_NAME=".instances"
32+
declare -rgx TEMPLATES_FOLDER_NAME=".apps"
33+
declare -rgx TIMESTAMPS_FOLDER_NAME=".timestamps"
34+
2935
declare -rgx APP_ENV_FOLDER="${COMPOSE_FOLDER}/${APP_ENV_FOLDER_NAME}"
30-
declare -rgx TEMPLATES_FOLDER="${COMPOSE_FOLDER}/${TEMPLATES_FOLDER_NAME}"
3136
declare -rgx INSTANCES_FOLDER="${COMPOSE_FOLDER}/${INSTANCES_FOLDER_NAME}"
32-
declare -rgx TIMESTAMPS_FOLDER="${COMPOSE_FOLDER}/.timestamps"
37+
declare -rgx TEMPLATES_FOLDER="${COMPOSE_FOLDER}/${TEMPLATES_FOLDER_NAME}"
38+
declare -rgx TIMESTAMPS_FOLDER="${COMPOSE_FOLDER}/${TIMESTAMPS_FOLDER_NAME}"
39+
40+
declare -rgx APPLICATION_INI_NAME="dockstarter.ini"
41+
declare -rgx APPLICATION_INI_FILE="${SCRIPTPATH}/${APPLICATION_INI_NAME}"
3342

34-
declare -rgx MENU_INI_NAME='menu.ini'
35-
declare -rgx MENU_INI_FILE="${SCRIPTPATH}/${MENU_INI_NAME}"
36-
declare -rgx THEME_FILE_NAME='theme.ini'
43+
declare -rgx THEME_FILE_NAME="theme.ini"

.includes/pm_variables.sh

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
set -Eeuo pipefail
33
IFS=$'\n\t'
44

5-
declare -gx PM=''
6-
75
declare -argx PM_PACKAGE_MANAGERS=(
8-
apk
96
nala
107
apt
11-
dnf
8+
apk
129
pacman
10+
dnf
1311
yum
1412
brew
13+
none
1514
)
1615

1716
declare -Argx PM_PACKAGE_MANAGER_COMMAND=(
@@ -23,6 +22,31 @@ declare -Argx PM_PACKAGE_MANAGER_COMMAND=(
2322
["yum"]="yum"
2423
["brew"]="brew"
2524
["port"]="port"
25+
["none"]="bash"
26+
)
27+
28+
declare -Argx PM_NICENAME=(
29+
["apk"]="APK"
30+
["nala"]="Nala"
31+
["apt"]="APT"
32+
["dnf"]="DNF"
33+
["pacman"]="Pacman"
34+
["yum"]="YUM"
35+
["brew"]="Homebrew"
36+
["port"]="MacPorts"
37+
["none"]="None"
38+
)
39+
40+
declare -Argx PM_DESCRIPTION=(
41+
["apk"]="Alpine Package Keeper (Alpine Linux)"
42+
["nala"]="Nala alternative to Apt (Debian, Ubuntu)"
43+
["apt"]="Advanced Package Tool (Debian, Ubuntu)"
44+
["dnf"]="Dandified YUM (Fedora, CentOS)"
45+
["yum"]="Yellowdog Updater, Modified (Fedora, CentOS)"
46+
["pacman"]="Package Manager (Arch Linux)"
47+
["brew"]="Homebrew (macOS)"
48+
["port"]="MacPorts (macOS)"
49+
["none"]="No package manager"
2650
)
2751

2852
declare -argx PM__COMMAND_DEPS=(
@@ -70,37 +94,25 @@ declare -argx PM_PORT_COMMAND_DEPS=(
7094
"ip"
7195
)
7296

97+
declare -argx PM_NONE_COMMAND_DEPS=(
98+
"column"
99+
"curl"
100+
"dialog"
101+
"gfind"
102+
"git"
103+
"ggrep"
104+
"gsed"
105+
"gstat"
106+
"ip"
107+
)
108+
73109
declare -Argx PM_PORT_DEP_PACKAGE=(
74110
["dialog"]="dialog"
75111
["find"]="findutils"
76112
["gsed"]="gnu-sed"
77113
["ip"]="iproute2mac"
78114
)
79115

80-
pm_find_package_manager() {
81-
for pmname in "${PM_PACKAGE_MANAGERS[@]}"; do
82-
if [[ -n $(command -v "${PM_PACKAGE_MANAGER_COMMAND["${pmname}"]}") ]]; then
83-
PM="${pmname}"
84-
break
85-
fi
86-
done
87-
if [[ -v PM_${PM^^}_COMMAND_DEPS ]]; then
88-
declare -ngx PM_COMMAND_DEPS="PM_${PM^^}_COMMAND_DEPS"
89-
else
90-
declare -ngx PM_COMMAND_DEPS="PM__COMMAND_DEPS"
91-
fi
92-
if [[ -v PM_${PM^^}_DEP_PACKAGE ]]; then
93-
declare -ngx PM_DEP_PACKAGE="PM_${PM^^}_DEP_PACKAGE"
94-
else
95-
declare -ngx PM_DEP_PACKAGE="PM__DEP_PACKAGE"
96-
fi
97-
if [[ -v PM_${PM^^}_PACKAGE_BLACKLIST ]]; then
98-
declare -ngx PM_PACKAGE_BLACKLIST="PM_${PM^^}_PACKAGE_BLACKLIST"
99-
else
100-
declare -ngx PM_PACKAGE_BLACKLIST="PM__PACKAGE_BLACKLIST"
101-
fi
102-
}
103-
104116
pm_check_dependency() {
105117
local Dep=${1}
106118
case "${Dep}" in
@@ -195,5 +207,3 @@ pm_check_dependencies() {
195207
fi
196208
return 0
197209
}
198-
199-
pm_find_package_manager

0 commit comments

Comments
 (0)