Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mm/customer requests #174

Merged
merged 9 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.7.16
current_version = 0.7.17

commit = True
tag = True
Expand Down
17 changes: 7 additions & 10 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions src/_configure_plextrac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 change the home directory of the plextrac user and try to install plextrac again"
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.

Expand Down
2 changes: 1 addition & 1 deletion src/_podman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
20 changes: 14 additions & 6 deletions src/plextrac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -Eeuo pipefail

VERSION=0.7.16
VERSION=0.7.17

## Podman Global Declaration Variable
declare -A svcValues
Expand Down Expand Up @@ -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}"
Expand All @@ -137,9 +136,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 " --install-dir | --plextrac-home ${DIM}path to non-standard install directory. The default is /opt/plextrac${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}. 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 system updates during the initialization step${RESET}"
}


Expand Down Expand Up @@ -243,6 +243,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
Expand Down Expand Up @@ -316,7 +320,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_UPDATE:-false}" == "false" ]; then
system_packages__do_system_upgrade
else
info "SKIP_SYSTEM_UPDATE is set to true. Skipping system updates."
fi
system_packages__install_system_dependencies
if [ "$CONTAINER_RUNTIME" == "docker" ]; then
install_docker "${FORCEUPGRADE-}"
Expand Down Expand Up @@ -392,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
Expand Down