diff --git a/ct/hister.sh b/ct/hister.sh index ab0b8c651..8dd0a09c3 100644 --- a/ct/hister.sh +++ b/ct/hister.sh @@ -4,53 +4,15 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_ # Copyright (c) 2021-2026 community-scripts ORG # Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE -# Source: https://github.com/asciimoo/hister APP="Hister" -var_tags="${var_tags:-search;browser-history;personal}" -var_cpu="${var_cpu:-1}" -var_ram="${var_ram:-1024}" -var_disk="${var_disk:-20}" -var_os="${var_os:-debian}" -var_version="${var_version:-13}" -var_arm64="${var_arm64:-yes}" -var_unprivileged="${var_unprivileged:-1}" header_info "$APP" variables color -catch_errors -function update_script() { - header_info - check_container_storage - check_container_resources - - if [[ ! -f /usr/local/bin/hister ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - if check_for_gh_release "hister" "asciimoo/hister"; then - msg_info "Stopping Service" - systemctl stop hister - msg_ok "Stopped Service" - - fetch_and_deploy_gh_release "hister" "asciimoo/hister" "singlefile" "latest" "/usr/local/bin" "hister_*_linux_$(arch_resolve)" - - msg_info "Starting Service" - systemctl start hister - msg_ok "Started Service" - msg_ok "Updated successfully!" - fi - exit -} - -start -build_container -description - -msg_ok "Completed Successfully!\n" -echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" -echo -e "${INFO}${YW}Access it using the following URL:${CL}" -echo -e "${GATEWAY}${BGN}http://${IP}:4433${CL}" +msg_error "This script is no longer available." +msg_warn "Hister has been renamed to Nogon." +msg_warn "Run the Nogon script to migrate an existing installation:" +echo 'bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nogon.sh)"' +exit 1 diff --git a/ct/nogon.sh b/ct/nogon.sh new file mode 100644 index 000000000..f55ad418b --- /dev/null +++ b/ct/nogon.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/asciimoo/nogon + +APP="Nogon" +var_tags="${var_tags:-search;browser-history;personal}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-20}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_arm64="${var_arm64:-yes}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -f /usr/local/bin/nogon && ! -f /usr/local/bin/hister ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + MIGRATING=false + [[ -f /usr/local/bin/hister ]] && MIGRATING=true + + if [[ "$MIGRATING" == "true" ]] || check_for_gh_release "nogon" "asciimoo/nogon"; then + msg_info "Stopping Service" + if [[ "$MIGRATING" == "true" ]]; then + systemctl disable -q --now hister + else + systemctl stop nogon + fi + msg_ok "Stopped Service" + + fetch_and_deploy_gh_release "nogon" "asciimoo/nogon" "singlefile" "latest" "/usr/local/bin" "nogon_*_linux_$(arch_resolve)" + + if [[ "$MIGRATING" == "true" ]]; then + msg_info "Migrating Hister to Nogon" + CONFIG_FILE=/etc/nogon/config.yaml + [[ -f /etc/hister/config.yaml ]] && CONFIG_FILE=/etc/hister/config.yaml + cat </etc/systemd/system/nogon.service +[Unit] +Description=Nogon Search Engine +After=network.target + +[Service] +Type=simple +User=root +ExecStart=/usr/local/bin/nogon listen --config ${CONFIG_FILE} +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF + rm -f /etc/systemd/system/hister.service /usr/local/bin/hister ~/.hister + systemctl daemon-reload + systemctl enable -q nogon + sed -i 's/hister/nogon/g' /usr/bin/update + msg_ok "Migrated Hister to Nogon" + fi + + msg_info "Starting Service" + systemctl start nogon + msg_ok "Started Service" + msg_ok "Updated successfully!" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW}Access it using the following URL:${CL}" +echo -e "${GATEWAY}${BGN}http://${IP}:4433${CL}" diff --git a/install/hister-install.sh b/install/nogon-install.sh similarity index 55% rename from install/hister-install.sh rename to install/nogon-install.sh index aa7c0ad6f..8d3c0d183 100644 --- a/install/hister-install.sh +++ b/install/nogon-install.sh @@ -3,7 +3,7 @@ # Copyright (c) 2021-2026 community-scripts ORG # Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE -# Source: https://github.com/asciimoo/hister +# Source: https://github.com/asciimoo/nogon source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color @@ -13,37 +13,37 @@ setting_up_container network_check update_os -fetch_and_deploy_gh_release "hister" "asciimoo/hister" "singlefile" "latest" "/usr/local/bin" "hister_*_linux_$(arch_resolve)" +fetch_and_deploy_gh_release "nogon" "asciimoo/nogon" "singlefile" "latest" "/usr/local/bin" "nogon_*_linux_$(arch_resolve)" -msg_info "Configuring Hister" -mkdir -p /opt/hister/data /etc/hister +msg_info "Configuring Nogon" +mkdir -p /opt/nogon/data /etc/nogon LOCAL_IP=$(hostname -I | awk '{print $1}') -cat </etc/hister/config.yaml +cat </etc/nogon/config.yaml app: - directory: '/opt/hister/data' + directory: '/opt/nogon/data' server: address: '0.0.0.0:4433' base_url: 'http://${LOCAL_IP}:4433' EOF -msg_ok "Configured Hister" +msg_ok "Configured Nogon" msg_info "Creating Service" -cat </etc/systemd/system/hister.service +cat </etc/systemd/system/nogon.service [Unit] -Description=Hister Search Engine +Description=Nogon Search Engine After=network.target [Service] Type=simple User=root -ExecStart=/usr/local/bin/hister listen --config /etc/hister/config.yaml +ExecStart=/usr/local/bin/nogon listen --config /etc/nogon/config.yaml Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target EOF -systemctl enable -q --now hister +systemctl enable -q --now nogon msg_ok "Created Service" motd_ssh