From 557f74e512ec70bb9c9039eedad2de765a925c8a Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 9 Dec 2025 14:41:54 +0100 Subject: [PATCH] minor fixes --- ct/deferred/hoodik.sh | 73 ------------------------ ct/hoodik.sh | 86 ++++++++++++++++++++++++++++ ct/koel.sh | 3 - install/deferred/hoodik-install.sh | 72 ----------------------- install/hoodik-install.sh | 91 ++++++++++++++++++++++++++++++ install/koel-install.sh | 2 +- 6 files changed, 178 insertions(+), 149 deletions(-) delete mode 100644 ct/deferred/hoodik.sh create mode 100644 ct/hoodik.sh delete mode 100644 install/deferred/hoodik-install.sh create mode 100644 install/hoodik-install.sh diff --git a/ct/deferred/hoodik.sh b/ct/deferred/hoodik.sh deleted file mode 100644 index 0e7597b1..00000000 --- a/ct/deferred/hoodik.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env bash -source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func) -# Copyright (c) 2021-2025 community-scripts ORG -# Author: MickLesk (CanbiZ) -# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE -# Source: - -APP="Hoodik" -# shellcheck disable=SC2034 -var_tags="${var_tags:-sharing}" -var_disk="${var_disk:-7}" -var_cpu="${var_cpu:-4}" -var_ram="${var_ram:-2048}" -var_os="${var_os:-debian}" -var_version="${var_version:-12}" -var_unprivileged="${var_unprivileged:-1}" - -header_info "$APP" -variables -color -catch_errors - -function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/hoodik ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/hudikhq/hoodik/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then - msg_info "Stopping Services" - systemctl stop hoodik - msg_ok "Services Stopped" - - msg_info "Updating ${APP} to ${RELEASE}" - cd /opt - if [ -d hoodik_bak ]; then - rm -rf hoodik_bak - fi - mv hoodik hoodik_bak - curl -fsSL "https://github.com/hudikhq/hoodik/archive/refs/tags/${RELEASE}.zip" - unzip -q ${RELEASE}.zip - mv hoodik-${RELEASE} /opt/hoodik - cd /opt/hoodik - cargo update -q - cargo build -q --release - msg_ok "Updated Hoodik" - - msg_info "Starting Services" - systemctl start hoodik - msg_ok "Started Services" - - msg_info "Cleaning Up" - rm -R /opt/${RELEASE}.zip - rm -R /opt/hoodik_bak - msg_ok "Cleaned" - msg_ok "Updated Successfully" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - 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 "${TAB}${GATEWAY}${BGN}http://${IP}:8088${CL}" diff --git a/ct/hoodik.sh b/ct/hoodik.sh new file mode 100644 index 00000000..c9524aa5 --- /dev/null +++ b/ct/hoodik.sh @@ -0,0 +1,86 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/hudikhq/hoodik + +APP="Hoodik" +var_tags="${var_tags:-cloud;storage}" +var_cpu="${var_cpu:-4}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +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/hoodik ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + RELEASE=$(curl -fsSL https://api.github.com/repos/hudikhq/hoodik/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + CURRENT_VERSION=$(cat /opt/hoodik_version.txt 2>/dev/null || echo "none") + + if [[ "${RELEASE}" != "${CURRENT_VERSION}" ]]; then + msg_info "Stopping Services" + systemctl stop hoodik + msg_ok "Stopped Services" + + msg_info "Backing up Configuration" + cp /opt/hoodik/.env /tmp/hoodik.env.bak + msg_ok "Backed up Configuration" + + msg_info "Updating ${APP} to ${RELEASE} (Patience - this takes 10-15 minutes)" + source ~/.cargo/env + cd /opt + rm -rf /opt/hoodik + curl -fsSL "https://github.com/hudikhq/hoodik/archive/refs/tags/${RELEASE}.zip" -o "${RELEASE}.zip" + unzip -q "${RELEASE}.zip" + mv "hoodik-${RELEASE#v}" hoodik + cd /opt/hoodik + $STD cargo build --release + cp /opt/hoodik/target/release/hoodik /usr/local/bin/hoodik + chmod +x /usr/local/bin/hoodik + echo "${RELEASE}" >/opt/hoodik_version.txt + msg_ok "Updated ${APP}" + + msg_info "Restoring Configuration" + cp /tmp/hoodik.env.bak /opt/hoodik/.env + rm -f /tmp/hoodik.env.bak + msg_ok "Restored Configuration" + + msg_info "Cleaning Up" + rm -f /opt/${RELEASE}.zip + rm -rf /opt/hoodik/target + msg_ok "Cleaned" + + msg_info "Starting Services" + systemctl start hoodik + msg_ok "Started Services" + + msg_ok "Updated Successfully" + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + 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 "${TAB}${GATEWAY}${BGN}https://${IP}:5443${CL}" diff --git a/ct/koel.sh b/ct/koel.sh index ef39be1b..aa902d9d 100644 --- a/ct/koel.sh +++ b/ct/koel.sh @@ -41,10 +41,7 @@ function update_script() { cp -r /opt/koel/public/img /tmp/koel_backup/ 2>/dev/null || true msg_ok "Created Backup" - msg_info "Updating ${APP}" - rm -rf /opt/koel/app /opt/koel/config /opt/koel/resources /opt/koel/routes CLEAN_INSTALL=1 fetch_and_deploy_gh_release "koel" "koel/koel" "prebuild" "latest" "/opt/koel" "koel-*.tar.gz" - msg_ok "Updated ${APP}" msg_info "Restoring Data" cp /tmp/koel_backup/.env /opt/koel/ diff --git a/install/deferred/hoodik-install.sh b/install/deferred/hoodik-install.sh deleted file mode 100644 index d6505fd4..00000000 --- a/install/deferred/hoodik-install.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021-2024 community-scripts ORG -# Author: MickLesk (Canbiz) -# License: MIT -# https://github.com/tteck/Proxmox/raw/main/LICENSE -# Source: https://github.com/hudikhq/hoodik - -source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" -color -verb_ip6 -catch_errors -setting_up_container -network_check -update_os - -msg_info "Installing Dependencies (Patience)" -$STD apt-get install -y \ - pkg-config \ - libssl-dev \ - libc6-dev \ - libpq-dev \ - clang \ - llvm \ - nettle-dev \ - build-essential \ - curl \ - sudo \ - make \ - mc -msg_ok "Installed Dependencies" - -msg_info "Installing Rust (Patience)" -$STD bash <(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs) -y -source ~/.cargo/env -msg_ok "Installed Rust" - -msg_info "Installing Hoodik (Patience)" -cd /opt -RELEASE=$(curl -s https://api.github.com/repos/hudikhq/hoodik/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -wget -q "https://github.com/hudikhq/hoodik/archive/refs/tags/${RELEASE}.zip" -unzip -q ${RELEASE}.zip -mv "hoodik-${RELEASE:1}" hoodik -cd hoodik -cargo build -q --release -msg_ok "Installed hoodik" - -msg_info "Creating Service" -cat </etc/systemd/system/hoodik.service -[Unit] -Description=Start Hoodik Service -After=network.target - -[Service] -User=root -WorkingDirectory=/opt/hoodik -ExecStart=/root/.cargo/bin/cargo run -q --release - -[Install] -WantedBy=multi-user.target -EOF -systemctl enable -q --now hoodik.service -msg_ok "Created Service" - -motd_ssh -customize - -msg_info "Cleaning up" -rm -rf /opt/${RELEASE}.zip -$STD apt-get autoremove -$STD apt-get autoclean -msg_ok "Cleaned" diff --git a/install/hoodik-install.sh b/install/hoodik-install.sh new file mode 100644 index 00000000..adf629d1 --- /dev/null +++ b/install/hoodik-install.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/hudikhq/hoodik + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y \ + pkg-config \ + libssl-dev \ + libc6-dev \ + libpq-dev \ + clang \ + llvm \ + nettle-dev \ + build-essential \ + make +msg_ok "Installed Dependencies" + +msg_info "Installing Rust" +$STD bash <(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs) -y +source ~/.cargo/env +msg_ok "Installed Rust" + +msg_info "Building Hoodik (Patience - this takes 10-15 minutes)" +RELEASE=$(curl -fsSL https://api.github.com/repos/hudikhq/hoodik/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') +cd /opt +curl -fsSL "https://github.com/hudikhq/hoodik/archive/refs/tags/${RELEASE}.zip" -o "${RELEASE}.zip" +unzip -q "${RELEASE}.zip" +mv "hoodik-${RELEASE#v}" hoodik +cd /opt/hoodik +$STD cargo build --release +cp /opt/hoodik/target/release/hoodik /usr/local/bin/hoodik +chmod +x /usr/local/bin/hoodik +echo "${RELEASE}" >/opt/hoodik_version.txt +msg_ok "Built Hoodik ${RELEASE}" + +msg_info "Configuring Hoodik" +mkdir -p /opt/hoodik_data +JWT_SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32) +cat </opt/hoodik/.env +DATA_DIR=/opt/hoodik_data +HTTP_PORT=5443 +HTTP_ADDRESS=0.0.0.0 +JWT_SECRET=${JWT_SECRET} +APP_URL=https://localhost:5443 +SSL_DISABLED=true +MAILER_TYPE=none +RUST_LOG=hoodik=info,error=info +EOF +msg_ok "Configured Hoodik" + +msg_info "Creating Service" +cat </etc/systemd/system/hoodik.service +[Unit] +Description=Hoodik - Encrypted File Storage +After=network.target + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/hoodik +EnvironmentFile=/opt/hoodik/.env +ExecStart=/usr/local/bin/hoodik -a 0.0.0.0 -p 5443 +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now hoodik.service +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -f /opt/${RELEASE}.zip +rm -rf /opt/hoodik/target +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" diff --git a/install/koel-install.sh b/install/koel-install.sh index d7dab71f..4ef7a949 100644 --- a/install/koel-install.sh +++ b/install/koel-install.sh @@ -14,7 +14,7 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y \ +$STD apt install -y \ nginx \ ffmpeg \ cron \