From ac62721a53f8818b75e81e219b25e0fe6fbc87d7 Mon Sep 17 00:00:00 2001 From: Mike Morgan Date: Tue, 4 Feb 2025 11:51:28 -0700 Subject: [PATCH 1/7] initial tweaks --- src/_configure_plextrac.sh | 12 ++++++++++++ src/plextrac | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/_configure_plextrac.sh b/src/_configure_plextrac.sh index bd4b5ed..3b573c5 100644 --- a/src/_configure_plextrac.sh +++ b/src/_configure_plextrac.sh @@ -25,6 +25,18 @@ function generate_default_config() { source <(echo "${existingCfg}") set +o allexport + # Check if the PLEXTRAC_HOME matches the HOME of current plextrac user + if [ ${PLEXTRAC_HOME} != ${HOME} ]; then + info "It appears you are trying to install plextrac to a different directory than default. Would you like to install to the same directory as the plextrac user home?" + info "Install directory [${HOME}]" + info "If this is not correct, please reinitialize with the flag --install-dir" + if get_user_approval; then + export PLEXTRAC_HOME=${HOME} + else + die "Unable to install to a different directory than the home of the plextrac user" + fi + fi + # NOTE: we need to leave API_INTEGRATION_AUTH_CONFIG_NOTIFICATION_SERVICE until all cloud-hosted environments are no # longer running code that relies on this variable. It has been replaced by INTERNAL_API_KEY_SHARED for newer versions. diff --git a/src/plextrac b/src/plextrac index a365208..ad2b8e8 100755 --- a/src/plextrac +++ b/src/plextrac @@ -316,7 +316,11 @@ function mod_initialize() { requires_user_root if [ "${AIRGAPPED:-false}" == "false" ]; then info "Setting up system packages" - system_packages__do_system_upgrade + if [ "${SKIP_SYSTEM_UPGRADE:-false}" == "false" ]; then + system_packages__do_system_upgrade + else + info "SKIP_SYSTEM_UPGRADE is set to true. Skipping system upgrades." + fi system_packages__install_system_dependencies if [ "$CONTAINER_RUNTIME" == "docker" ]; then install_docker "${FORCEUPGRADE-}" From 3fd7b00d908c3948746fb45562c922851d82d4cd Mon Sep 17 00:00:00 2001 From: Mike Morgan Date: Tue, 4 Feb 2025 12:06:27 -0700 Subject: [PATCH 2/7] add documentation --- src/plextrac | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plextrac b/src/plextrac index ad2b8e8..10baae8 100755 --- a/src/plextrac +++ b/src/plextrac @@ -137,9 +137,10 @@ function mod_help() { log " -d | --debug ${DIM}enables debug output VERY NOISY${RESET}" log " -v | --verbose ${DIM}enables verbose output, helpful for troubleshooting errors${RESET}" log " -y | --assume-yes ${DIM}assumes yes to all questions in script${RESET}" - log " -uid | --user-id ${DIM}during initialization, assign a specific user ID on 'plextrac' user creation${RESET}" + log " -uid | --user-id ${DIM}during initialization, assign a specific user ID on 'plextrac' user creation${RESET}" log " --install-dir | --plextrac-home ${DIM}path to non-standard install directory. The default is /opt/plextrac${RESET}" log " --install-timeout NUM ${DIM}seconds to wait for install migrations to complete. The default is 600 (10 mins)${RESET}" + log " --skip-system-updates ${DIM}skip the system updates during the inititalization step${RESET}" } @@ -243,6 +244,10 @@ function main() { AIRGAPPED="true" shift ;; + "--skip-system-updates") + SKIP_SYSTEM_UPDATE="true" + shift + ;; *) if declare -f mod_$1 >/dev/null 2>&1; then # enable event logging for sub commands @@ -316,10 +321,10 @@ function mod_initialize() { requires_user_root if [ "${AIRGAPPED:-false}" == "false" ]; then info "Setting up system packages" - if [ "${SKIP_SYSTEM_UPGRADE:-false}" == "false" ]; then + if [ "${SKIP_SYSTEM_UPDATE:-false}" == "false" ]; then system_packages__do_system_upgrade else - info "SKIP_SYSTEM_UPGRADE is set to true. Skipping system upgrades." + info "SKIP_SYSTEM_UPDATE is set to true. Skipping system updates." fi system_packages__install_system_dependencies if [ "$CONTAINER_RUNTIME" == "docker" ]; then From 7ad52048b508157fd4a3b38f0bebdeb126e210e9 Mon Sep 17 00:00:00 2001 From: Mike Morgan Date: Tue, 4 Feb 2025 14:08:18 -0700 Subject: [PATCH 3/7] updated documentation --- src/_configure_plextrac.sh | 2 +- src/plextrac | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/_configure_plextrac.sh b/src/_configure_plextrac.sh index 3b573c5..d17fbc2 100644 --- a/src/_configure_plextrac.sh +++ b/src/_configure_plextrac.sh @@ -29,7 +29,7 @@ function generate_default_config() { if [ ${PLEXTRAC_HOME} != ${HOME} ]; then info "It appears you are trying to install plextrac to a different directory than default. Would you like to install to the same directory as the plextrac user home?" info "Install directory [${HOME}]" - info "If this is not correct, please reinitialize with the flag --install-dir" + info "If this is not correct, please change the home directory of the plextrac user and try to install plextrac again" if get_user_approval; then export PLEXTRAC_HOME=${HOME} else diff --git a/src/plextrac b/src/plextrac index 10baae8..f846056 100755 --- a/src/plextrac +++ b/src/plextrac @@ -125,7 +125,6 @@ function mod_help() { log "info ${DIM}display information about the current PlexTrac Instance${RESET}" log "install ${DIM}install PlexTrac (assumes previously initialized system)${RESET}" log "logs ${DIM}display logs from PlexTrac services. Usage: ${GREEN}plextrac logs [-s|--service plextracapi|plextracnginx|plextracdb|etc]${RESET}" - log "migrate ${DIM}migrate current instance from legacy management scripts${RESET}" log "reload-cert ${DIM}reload PlexTrac SSL certificates${RESET}" log "restore ${DIM}restore instance from backups${RESET}" log "start ${DIM}manually start a PlexTrac instance if normal processes did not succeed${RESET}" @@ -138,7 +137,7 @@ function mod_help() { log " -v | --verbose ${DIM}enables verbose output, helpful for troubleshooting errors${RESET}" log " -y | --assume-yes ${DIM}assumes yes to all questions in script${RESET}" log " -uid | --user-id ${DIM}during initialization, assign a specific user ID on 'plextrac' user creation${RESET}" - log " --install-dir | --plextrac-home ${DIM}path to non-standard install directory. The default is /opt/plextrac${RESET}" + log " --install-dir | --plextrac-home ${DIM}path to non-standard install directory. The default is /opt/plextrac${RESET}. Must be used during initialization." log " --install-timeout NUM ${DIM}seconds to wait for install migrations to complete. The default is 600 (10 mins)${RESET}" log " --skip-system-updates ${DIM}skip the system updates during the inititalization step${RESET}" } From 16c80d2defe7c5e8956651f545da0c4208efce52 Mon Sep 17 00:00:00 2001 From: Mike Morgan Date: Tue, 4 Feb 2025 15:38:34 -0700 Subject: [PATCH 4/7] updated getting started doc --- docs/getting-started.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index b3b6428..661b432 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -21,18 +21,15 @@ title: Getting Started The latest release can be retrieved from GitHub: ```console -$ curl -Ls `curl -Ls https://api.github.com/repos/PlexTrac/plextrac-manager-util/releases/latest \ - | jq -r '.assets[].browser_download_url'` \ - > /tmp/plextrac -$ chmod a+x /tmp/plextrac; sudo /tmp/plextrac initialize - -______ _ _____ -| ___ \ | |_ _| -| |_/ / | _____ _| |_ __ __ _ ___ +$ wget -O /tmp/plextrac -q https://github.com/PlexTrac/plextrac-manager-util/releases/latest/download/plextrac; chmod a+x /tmp/plextrac; sudo bash /tmp/plextrac initialize -v + +______ _ _____ +| ___ \ | |_ _| +| |_/ / | _____ _| |_ __ __ _ ___ | __/| |/ _ \ \/ / | '__/ _\ |/ __| -| | | | __/> <| | | | (_| | (__ +| | | | __/> <| | | | (_| | (__ \_| |_|\___/_/\_\_/_| \__,_|\___| - + Instance Management Utility v0.1.2 From 7ec37a603d9adceeb742fe843ba12a06152f6d28 Mon Sep 17 00:00:00 2001 From: Mike Morgan Date: Tue, 4 Feb 2025 15:44:40 -0700 Subject: [PATCH 5/7] updated links to internal documentation --- src/_podman.sh | 2 +- src/plextrac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_podman.sh b/src/_podman.sh index 97764b6..2140230 100644 --- a/src/_podman.sh +++ b/src/_podman.sh @@ -151,7 +151,7 @@ function plextrac_install_podman() { info "Post installation note:" log "If you wish to have access to historical logs, you can configure docker to send logs to journald." log "Please see the config steps at" - log "https://docs.plextrac.com/plextrac-documentation/product-documentation-1/on-premise-management/setting-up-historical-logs" + log "https://helpcenter.plextrac.com/s/article/Setting-Up-Historical-Logs" } function plextrac_start_podman() { diff --git a/src/plextrac b/src/plextrac index f846056..61b65bf 100755 --- a/src/plextrac +++ b/src/plextrac @@ -400,7 +400,7 @@ function mod_install() { info "Post installation note:" log "If you wish to have access to historical logs, you can configure docker to send logs to journald." log "Please see the config steps at" - log "https://docs.plextrac.com/plextrac-documentation/product-documentation-1/on-premise-management/setting-up-historical-logs" + log "https://helpcenter.plextrac.com/s/article/Setting-Up-Historical-Logs" else plextrac_install_podman "svcValues" fi From 46538da971c0455ca2b3ab46c199ab85085303d2 Mon Sep 17 00:00:00 2001 From: Mike Morgan Date: Tue, 4 Feb 2025 15:48:09 -0700 Subject: [PATCH 6/7] spelling is hard --- src/plextrac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plextrac b/src/plextrac index 61b65bf..e9bf510 100755 --- a/src/plextrac +++ b/src/plextrac @@ -139,7 +139,7 @@ function mod_help() { log " -uid | --user-id ${DIM}during initialization, assign a specific user ID on 'plextrac' user creation${RESET}" log " --install-dir | --plextrac-home ${DIM}path to non-standard install directory. The default is /opt/plextrac${RESET}. Must be used during initialization." log " --install-timeout NUM ${DIM}seconds to wait for install migrations to complete. The default is 600 (10 mins)${RESET}" - log " --skip-system-updates ${DIM}skip the system updates during the inititalization step${RESET}" + log " --skip-system-updates ${DIM}skip system updates during the initialization step${RESET}" } From 7a9e37788421c3f69aa662901a352bed3a2c5650 Mon Sep 17 00:00:00 2001 From: Mike Morgan Date: Tue, 4 Feb 2025 16:43:36 -0700 Subject: [PATCH 7/7] bump version --- .bumpversion.cfg | 2 +- src/plextrac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 6caed5d..bb54798 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.7.16 +current_version = 0.7.17 commit = True tag = True diff --git a/src/plextrac b/src/plextrac index e9bf510..8429ff9 100755 --- a/src/plextrac +++ b/src/plextrac @@ -1,7 +1,7 @@ #!/bin/bash set -Eeuo pipefail -VERSION=0.7.16 +VERSION=0.7.17 ## Podman Global Declaration Variable declare -A svcValues