From 215e66c8a20e8694a9f0113effa6e1d2c031c3a3 Mon Sep 17 00:00:00 2001 From: vhsdream Date: Wed, 27 Nov 2024 17:14:21 -0500 Subject: [PATCH 01/26] Add Hoarder script --- ct/hoarder.sh | 109 +++++++++++++++++++++++ install/hoarder_install.sh | 178 +++++++++++++++++++++++++++++++++++++ 2 files changed, 287 insertions(+) create mode 100644 ct/hoarder.sh create mode 100644 install/hoarder_install.sh diff --git a/ct/hoarder.sh b/ct/hoarder.sh new file mode 100644 index 0000000000..ce4596d2e2 --- /dev/null +++ b/ct/hoarder.sh @@ -0,0 +1,109 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2024 tteck +# Author: vhsdream +# License: MIT +# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +function header_info { +clear +cat <<"EOF" + __ __ __ + / / / /___ ____ __________/ /__ _____ + / /_/ / __ \/ __ `/ ___/ __ / _ \/ ___/ + / __ / /_/ / /_/ / / / /_/ / __/ / +/_/ /_/\____/\__,_/_/ \__,_/\___/_/ + +EOF +} +header_info + +echo -e "Loading..." +APP="Hoarder" +TAGS="bookmark;links" +var_disk="8" +var_cpu="4" +var_ram="4096" +var_os="debian" +var_version="12" +variables +color +catch_errors + +function default_settings() { + CT_TYPE="1" + PW="" + CT_ID=$NEXTID + HN=$NSAPP + DISK_SIZE="$var_disk" + CORE_COUNT="$var_cpu" + RAM_SIZE="$var_ram" + BRG="vmbr0" + NET="dhcp" + GATE="" + APT_CACHER="" + APT_CACHER_IP="" + DISABLEIP6="no" + MTU="" + SD="" + NS="" + MAC="" + VLAN="" + SSH="no" + VERB="no" + echo_default +} + +function update_script() { +header_info +check_container_storage +check_container_resources +if [[ ! -d /opt/hoarder ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +RELEASE=$(curl -s https://api.github.com/repos/hoarder-app/hoarder/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +PREV_VERSION=$(cat /opt/${APP}_version.txt) +if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "${PREV_VERSION}" ]]; then + msg_info "Stopping ${APP} Services" + systemctl stop hoarder-web hoarder-workers hoarder-browser + msg_ok "Stopped ${APP} Services" + msg_info "Updating ${APP} to ${RELEASE}" + cd /opt + mv /opt/hoarder /opt/hoarder_bak + wget -q "https://github.com/hoarder-app/hoarder/archive/refs/tags/v${RELEASE}.zip" + unzip -q v${RELEASE}.zip + mv hoarder-${RELEASE} /opt/hoarder + cd /opt/hoarder/apps/web + pnpm install --frozen-lockfile >/dev/null 2>&1 + cd /opt/hoarder/apps/workers + pnpm install --frozen-lockfile >/dev/null 2>&1 + cd /opt/hoarder/apps/web + export NEXT_TELEMETRY_DISABLED=1 + pnpm exec next build --experimental-build-mode compile >/dev/null 2>&1 + cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web + export DATA_DIR=/opt/hoarder_data + cd /opt/hoarder/packages/db + pnpm migrate >/dev/null 2>&1 + echo "${RELEASE}" >/opt/${APP}_version.txt + cp /opt/hoarder_bak/.env /opt/hoarder/.env + sed -i "s/SERVER_VERSION=${PREV_VERSION}/SERVER_VERSION=${RELEASE}/" /opt/hoarder/.env + msg_ok "Updated ${APP} to ${RELEASE}" + msg_info "Starting ${APP} Services" + systemctl start hoarder-browser hoarder-workers hoarder-web + msg_ok "Started ${APP}" + msg_info "Cleaning up" + rm -R /opt/v${RELEASE}.zip + rm -rf /opt/hoarder_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 "${APP} Setup should be reachable by going to the following URL. + ${BL}http://${IP}:3000${CL} \n" diff --git a/install/hoarder_install.sh b/install/hoarder_install.sh new file mode 100644 index 0000000000..e41aad1002 --- /dev/null +++ b/install/hoarder_install.sh @@ -0,0 +1,178 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: vhsdream +# License: MIT +# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + python3 \ + python3-distutils \ + g++ \ + build-essential \ + curl \ + git \ + sudo \ + gnupg \ + ca-certificates \ + chromium \ + libpixman-1-dev \ + libcairo2-dev \ + libjpeg-dev \ + libpango1.0-dev \ + libgif-dev \ + librsvg2-dev \ + pkg-config \ + mc +msg_ok "Installed Dependencies" + +msg_info "Installing Additional Tools" +wget -q https://github.com/Y2Z/monolith/releases/latest/download/monolith-gnu-linux-x86_64 -O /usr/bin/monolith && chmod +x /usr/bin/monolith +wget -q https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux -O /usr/bin/yt-dlp && chmod +x /usr/bin/yt-dlp +msg_ok "Installed Additional Tools" + +msg_info "Installing Meilisearch" +cd /tmp +wget -q https://github.com/meilisearch/meilisearch/releases/latest/download/meilisearch.deb +$STD dpkg -i meilisearch.deb +wget -q https://raw.githubusercontent.com/meilisearch/meilisearch/latest/config.toml -O /etc/meilisearch.toml +MASTER_KEY=$(openssl rand -base64 12) +sed -i \ + -e 's|^env =.*|env = "production"|' \ + -e "s|^# master_key =.*|master_key = \"$MASTER_KEY\"|" \ + -e 's|^db_path =.*|db_path = "/var/lib/meilisearch/data"|' \ + -e 's|^dump_dir =.*|dump_dir = "/var/lib/meilisearch/dumps"|' \ + -e 's|^snapshot_dir =.*|snapshot_dir = "/var/lib/meilisearch/snapshots"|' \ + -e 's|^# no_analytics = true|no_analytics = true|' \ + /etc/meilisearch.toml +msg_ok "Installed Meilisearch" + +msg_info "Installing Node.js" +mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list +$STD apt-get update +$STD apt-get install -y nodejs +msg_ok "Installed Node.js" + +msg_info "Installing Hoarder" +cd /opt +RELEASE=$(curl -s https://api.github.com/repos/hoarder-app/hoarder/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +wget -q "https://github.com/hoarder-app/hoarder/archive/refs/tags/v${RELEASE}.zip" +unzip -q v${RELEASE}.zip && mv hoarder-${RELEASE} /opt/hoarder + +mkdir -p /opt/hoarder_data + +cd /opt/hoarder +corepack enable +export PUPPETEER_SKIP_DOWNLOAD="true" +export NEXT_TELEMETRY_DISABLED=1 +export CI="true" +cd /opt/hoarder/apps/web && $STD pnpm install --frozen-lockfile +cd /opt/hoarder/apps/workers && $STD pnpm install --frozen-lockfile +cd /opt/hoarder/apps/web && $STD pnpm exec next build --experimental-build-mode compile +cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web + +HOARDER_SECRET=$(openssl rand -base64 36 | cut -c1-24) + +cat </opt/hoarder/.env +SERVER_VERSION=$RELEASE +NEXTAUTH_SECRET="$HOARDER_SECRET" +NEXTAUTH_URL="http://localhost:3000" +DATA_DIR="/opt/hoarder_data" +MEILI_ADDR="http://127.0.0.1:7700" +MEILI_MASTER_KEY="$MASTER_KEY" +BROWSER_WEB_URL="http://127.0.0.1:9222" +#CRAWLER_FULL_PAGE_SCREENSHOT=true +#CRAWLER_FULL_PAGE_ARCHIVE=true +#CRAWLER_VIDEO_DOWNLOAD=true +EOF +echo "${RELEASE}" >"/opt/Hoarder_version.txt" +msg_ok "Installed Hoarder" + +msg_info "Running Database Migration" +cd /opt/hoarder/packages/db +pnpm migrate +msg_ok "Database Migration Completed" + +msg_info "Setting up Services" +# Meilisearch Service +cat </etc/systemd/system/meilisearch.service +[Unit] +Description=Meilisearch +After=network.target + +[Service] +ExecStart=/usr/bin/meilisearch --config-file-path /etc/meilisearch.toml +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + +# Hoarder Web Service +cat </etc/systemd/system/hoarder-web.service +[Unit] +Description=Hoarder Web +Wants=network.target hoarder-workers.service meilisearch.service +After=network.target hoarder-workers.service meilisearch.service + +[Service] +ExecStart=pnpm start +WorkingDirectory=/opt/hoarder/apps/web +EnvironmentFile=/opt/hoarder/.env +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + +# Hoarder Browser Service +cat </etc/systemd/system/hoarder-browser.service +[Unit] +Description=Hoarder Headless Browser +After=network.target + +[Service] +User=root +ExecStart=/usr/bin/chromium --headless --no-sandbox --disable-gpu --disable-dev-shm-usage --remote-debugging-address=127.0.0.1 --remote-debugging-port=9222 --hide-scrollbars +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + +# Hoarder Workers Service +cat </etc/systemd/system/hoarder-workers.service +[Unit] +Description=Hoarder Workers +Wants=network.target hoarder-browser.service +After=network.target hoarder-browser.service + +[Service] +ExecStart=pnpm start:prod +WorkingDirectory=/opt/hoarder/apps/workers +EnvironmentFile=/opt/hoarder/.env +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + +systemctl enable --now meilisearch.service hoarder-web.service hoarder-browser.service hoarder-workers.service +msg_ok "Set up Services" + +msg_info "Cleaning up" +rm -rf /tmp/meilisearch.deb +$STD apt-get autoremove -y +$STD apt-get autoclean -y +msg_ok "Cleaned" From 772fd563fbf66324f507debc994e2ed438db057e Mon Sep 17 00:00:00 2001 From: vhsdream Date: Wed, 27 Nov 2024 17:24:56 -0500 Subject: [PATCH 02/26] Point build.func to correct repo --- ct/hoarder.sh | 1 - misc/build.func | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index ce4596d2e2..b1238d7f7b 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -17,7 +17,6 @@ cat <<"EOF" EOF } header_info - echo -e "Loading..." APP="Hoarder" TAGS="bookmark;links" diff --git a/misc/build.func b/misc/build.func index aee3366a8b..de8be0f37b 100644 --- a/misc/build.func +++ b/misc/build.func @@ -666,7 +666,7 @@ http://dl-cdn.alpinelinux.org/alpine/latest-stable/community EOF' pct exec "$CTID" -- ash -c "apk add bash >/dev/null" fi - lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/$var_install.sh)" || exit + lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/vhsdream/ProxmoxVE/hoarder/install/$var_install.sh)" || exit } From f3b28fc0770d66a659a7342d4c72c80771917a37 Mon Sep 17 00:00:00 2001 From: vhsdream Date: Wed, 27 Nov 2024 17:29:58 -0500 Subject: [PATCH 03/26] I hate testing these scripts --- ct/bazarr.sh | 0 ct/hoarder.sh | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 ct/bazarr.sh diff --git a/ct/bazarr.sh b/ct/bazarr.sh old mode 100755 new mode 100644 diff --git a/ct/hoarder.sh b/ct/hoarder.sh index b1238d7f7b..4242215769 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -s https://raw.githubusercontent.com/vhsdream/ProxmoxVE/hoarder/misc/build.func) # Copyright (c) 2021-2024 tteck # Author: vhsdream # License: MIT From 2bfc30563f6bd59ec2e2ef7ee1dd8bcd0bce6f6c Mon Sep 17 00:00:00 2001 From: vhsdream Date: Wed, 27 Nov 2024 17:39:33 -0500 Subject: [PATCH 04/26] no comment --- install/bazarr-install.sh | 0 install/{hoarder_install.sh => hoarder-install.sh} | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 install/bazarr-install.sh rename install/{hoarder_install.sh => hoarder-install.sh} (100%) diff --git a/install/bazarr-install.sh b/install/bazarr-install.sh old mode 100755 new mode 100644 diff --git a/install/hoarder_install.sh b/install/hoarder-install.sh similarity index 100% rename from install/hoarder_install.sh rename to install/hoarder-install.sh From aace44b2ce8ccbbcec7ad2f83afd2c4e70edc267 Mon Sep 17 00:00:00 2001 From: vhsdream Date: Wed, 27 Nov 2024 17:48:44 -0500 Subject: [PATCH 05/26] Quiesce systemctl enable output; add move DB to hoarder_data --- install/hoarder-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index e41aad1002..bb5024a0cd 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -102,6 +102,7 @@ msg_ok "Installed Hoarder" msg_info "Running Database Migration" cd /opt/hoarder/packages/db pnpm migrate +mv db.db /opt/hoarder_data msg_ok "Database Migration Completed" msg_info "Setting up Services" @@ -168,7 +169,7 @@ Restart=always WantedBy=multi-user.target EOF -systemctl enable --now meilisearch.service hoarder-web.service hoarder-browser.service hoarder-workers.service +systemctl -q enable --now meilisearch.service hoarder-web.service hoarder-browser.service hoarder-workers.service msg_ok "Set up Services" msg_info "Cleaning up" From e80a91765cb9f3e1fb2192e2b4a8e61c9ed5d6a6 Mon Sep 17 00:00:00 2001 From: vhsdream Date: Wed, 27 Nov 2024 18:25:14 -0500 Subject: [PATCH 06/26] add timeout to hoarder-workers --- install/hoarder-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index bb5024a0cd..4361485aa4 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -164,6 +164,7 @@ ExecStart=pnpm start:prod WorkingDirectory=/opt/hoarder/apps/workers EnvironmentFile=/opt/hoarder/.env Restart=always +TimeoutStopSec=5 [Install] WantedBy=multi-user.target @@ -172,6 +173,9 @@ EOF systemctl -q enable --now meilisearch.service hoarder-web.service hoarder-browser.service hoarder-workers.service msg_ok "Set up Services" +motd_ssh +customize + msg_info "Cleaning up" rm -rf /tmp/meilisearch.deb $STD apt-get autoremove -y From 8f6569828eaf4de6062c4df46294667c71d26f5f Mon Sep 17 00:00:00 2001 From: vhsdream Date: Wed, 27 Nov 2024 20:13:19 -0500 Subject: [PATCH 07/26] Restore attribution --- ct/hoarder.sh | 2 +- install/hoarder-install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index 4242215769..4c71b17614 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source <(curl -s https://raw.githubusercontent.com/vhsdream/ProxmoxVE/hoarder/misc/build.func) # Copyright (c) 2021-2024 tteck -# Author: vhsdream +# Author: MickLesk (Canbiz) & vhsdream # License: MIT # https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index 4361485aa4..64bf203841 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Copyright (c) 2021-2024 tteck -# Author: vhsdream +# Author: MickLesk (Canbiz) & vhsdream # License: MIT # https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE From 588d363d03612e6b1e1f797856c3c96f6182b9d6 Mon Sep 17 00:00:00 2001 From: vhsdream Date: Thu, 28 Nov 2024 07:49:49 -0500 Subject: [PATCH 08/26] fix sourcefix source URLs; quiesce migration post-install --- ct/hoarder.sh | 2 +- install/hoarder-install.sh | 2 +- misc/build.func | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index 4c71b17614..5cd3849cb5 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/vhsdream/ProxmoxVE/hoarder/misc/build.func) +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2024 tteck # Author: MickLesk (Canbiz) & vhsdream # License: MIT diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index 64bf203841..6b8f00dd66 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -101,7 +101,7 @@ msg_ok "Installed Hoarder" msg_info "Running Database Migration" cd /opt/hoarder/packages/db -pnpm migrate +$STD pnpm migrate mv db.db /opt/hoarder_data msg_ok "Database Migration Completed" diff --git a/misc/build.func b/misc/build.func index de8be0f37b..aee3366a8b 100644 --- a/misc/build.func +++ b/misc/build.func @@ -666,7 +666,7 @@ http://dl-cdn.alpinelinux.org/alpine/latest-stable/community EOF' pct exec "$CTID" -- ash -c "apk add bash >/dev/null" fi - lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/vhsdream/ProxmoxVE/hoarder/install/$var_install.sh)" || exit + lxc-attach -n "$CTID" -- bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/$var_install.sh)" || exit } From e2449591a4d048d40710af479e04e9f67a5c6009 Mon Sep 17 00:00:00 2001 From: vhsdream <67816022+vhsdream@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:21:28 -0500 Subject: [PATCH 09/26] Update hoarder-install.sh to move commands to separate lines Also made similar changes in some other areas. --- install/hoarder-install.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index 6b8f00dd66..53c4bdbcf8 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -36,8 +36,10 @@ $STD apt-get install -y \ msg_ok "Installed Dependencies" msg_info "Installing Additional Tools" -wget -q https://github.com/Y2Z/monolith/releases/latest/download/monolith-gnu-linux-x86_64 -O /usr/bin/monolith && chmod +x /usr/bin/monolith -wget -q https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux -O /usr/bin/yt-dlp && chmod +x /usr/bin/yt-dlp +wget -q https://github.com/Y2Z/monolith/releases/latest/download/monolith-gnu-linux-x86_64 -O /usr/bin/monolith +chmod +x /usr/bin/monolith +wget -q https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux -O /usr/bin/yt-dlp +chmod +x /usr/bin/yt-dlp msg_ok "Installed Additional Tools" msg_info "Installing Meilisearch" @@ -68,7 +70,8 @@ msg_info "Installing Hoarder" cd /opt RELEASE=$(curl -s https://api.github.com/repos/hoarder-app/hoarder/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') wget -q "https://github.com/hoarder-app/hoarder/archive/refs/tags/v${RELEASE}.zip" -unzip -q v${RELEASE}.zip && mv hoarder-${RELEASE} /opt/hoarder +unzip -q v${RELEASE}.zip +mv hoarder-${RELEASE} /opt/hoarder mkdir -p /opt/hoarder_data @@ -77,9 +80,12 @@ corepack enable export PUPPETEER_SKIP_DOWNLOAD="true" export NEXT_TELEMETRY_DISABLED=1 export CI="true" -cd /opt/hoarder/apps/web && $STD pnpm install --frozen-lockfile -cd /opt/hoarder/apps/workers && $STD pnpm install --frozen-lockfile -cd /opt/hoarder/apps/web && $STD pnpm exec next build --experimental-build-mode compile +cd /opt/hoarder/apps/web +$STD pnpm install --frozen-lockfile +cd /opt/hoarder/apps/workers +$STD pnpm install --frozen-lockfile +cd /opt/hoarder/apps/web +$STD pnpm exec next build --experimental-build-mode compile cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web HOARDER_SECRET=$(openssl rand -base64 36 | cut -c1-24) From e1c52a1a7d5bdb9ffaed41b9f34b903fcf0b7e51 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:54:46 +0100 Subject: [PATCH 10/26] Delete install/bazarr-install.sh --- install/bazarr-install.sh | 68 --------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 install/bazarr-install.sh diff --git a/install/bazarr-install.sh b/install/bazarr-install.sh deleted file mode 100644 index b0e46e72b3..0000000000 --- a/install/bazarr-install.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021-2024 tteck -# Author: tteck (tteckster) -# License: MIT -# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE - -source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" -color -verb_ip6 -catch_errors -setting_up_container -network_check -update_os - -msg_info "Installing Dependencies" -$STD apt-get install -y curl -$STD apt-get install -y sudo -$STD apt-get install -y mc -msg_ok "Installed Dependencies" - -msg_info "Updating Python3" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED -msg_ok "Updated Python3" - -msg_info "Installing Bazarr" -mkdir -p /var/lib/bazarr/ -wget -q https://github.com/morpheus65535/bazarr/releases/latest/download/bazarr.zip -unzip -qq bazarr -d /opt/bazarr -chmod 775 /opt/bazarr /var/lib/bazarr/ -python3 -m pip install -q -r /opt/bazarr/requirements.txt -msg_ok "Installed Bazarr" - -msg_info "Creating Service" -cat </etc/systemd/system/bazarr.service -[Unit] -Description=Bazarr Daemon -After=syslog.target network.target - -[Service] -WorkingDirectory=/opt/bazarr/ -UMask=0002 -Restart=on-failure -RestartSec=5 -Type=simple -ExecStart=/usr/bin/python3 /opt/bazarr/bazarr.py -KillSignal=SIGINT -TimeoutStopSec=20 -SyslogIdentifier=bazarr - -[Install] -WantedBy=multi-user.target -EOF -systemctl enable -q --now bazarr -msg_ok "Created Service" - -motd_ssh -customize - -msg_info "Cleaning up" -rm -rf bazarr.zip -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" \ No newline at end of file From f2bd029d0ea3de49915103534740b991f74e169d Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:55:03 +0100 Subject: [PATCH 11/26] Delete ct/bazarr.sh --- ct/bazarr.sh | 73 ---------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 ct/bazarr.sh diff --git a/ct/bazarr.sh b/ct/bazarr.sh deleted file mode 100644 index f6118d9920..0000000000 --- a/ct/bazarr.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) -# Copyright (c) 2021-2024 tteck -# Author: tteck (tteckster) -# License: MIT -# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE - -function header_info { -clear -cat <<"EOF" - ____ - / __ )____ _____ ____ ___________ - / __ / __ `/_ / / __ `/ ___/ ___/ - / /_/ / /_/ / / /_/ /_/ / / / / -/_____/\__,_/ /___/\__,_/_/ /_/ - -EOF -} -header_info -echo -e "Loading..." -APP="Bazarr" -var_disk="4" -var_cpu="2" -var_ram="1024" -var_os="debian" -var_version="12" -variables -color -catch_errors - -function default_settings() { - CT_TYPE="1" - PW="" - CT_ID=$NEXTID - HN=$NSAPP - DISK_SIZE="$var_disk" - CORE_COUNT="$var_cpu" - RAM_SIZE="$var_ram" - BRG="vmbr0" - NET="dhcp" - GATE="" - APT_CACHER="" - APT_CACHER_IP="" - DISABLEIP6="no" - MTU="" - SD="" - NS="" - MAC="" - VLAN="" - SSH="no" - VERB="no" - echo_default -} - -function update_script() { -header_info -check_container_storage -check_container_resources -if [[ ! -d /var/lib/bazarr/ ]]; then msg_error "No ${APP} Installation Found!"; exit; fi -msg_info "Updating $APP LXC" -apt-get update &>/dev/null -apt-get -y upgrade &>/dev/null -msg_ok "Updated $APP LXC" -exit -} - -start -build_container -description - -msg_ok "Completed Successfully!\n" -echo -e "${APP} should be reachable by going to the following URL. - ${BL}http://${IP}:6767${CL} \n" From 7a805f055a81454114529c38447b56931a78cadc Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:58:31 +0100 Subject: [PATCH 12/26] Update msg_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com> --- ct/hoarder.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index 5cd3849cb5..1ade0b3993 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -64,7 +64,8 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "${PREV_VERSION}" ]] msg_info "Stopping ${APP} Services" systemctl stop hoarder-web hoarder-workers hoarder-browser msg_ok "Stopped ${APP} Services" - msg_info "Updating ${APP} to ${RELEASE}" + + msg_info "Updating ${APP} to v${RELEASE}" cd /opt mv /opt/hoarder /opt/hoarder_bak wget -q "https://github.com/hoarder-app/hoarder/archive/refs/tags/v${RELEASE}.zip" From 9757d070cbe981a97b87c84fbca0ca8914f8d695 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:58:44 +0100 Subject: [PATCH 13/26] Update msg_ok MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com> --- ct/hoarder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index 1ade0b3993..f425da5971 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -63,7 +63,7 @@ PREV_VERSION=$(cat /opt/${APP}_version.txt) if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "${PREV_VERSION}" ]]; then msg_info "Stopping ${APP} Services" systemctl stop hoarder-web hoarder-workers hoarder-browser - msg_ok "Stopped ${APP} Services" + msg_ok "Stopped Services" msg_info "Updating ${APP} to v${RELEASE}" cd /opt From fc259af31cf54632b52521fcf87316dc609789a0 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:58:54 +0100 Subject: [PATCH 14/26] Update msg_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com> --- ct/hoarder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index f425da5971..f703191db5 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -61,7 +61,7 @@ if [[ ! -d /opt/hoarder ]]; then msg_error "No ${APP} Installation Found!"; exit RELEASE=$(curl -s https://api.github.com/repos/hoarder-app/hoarder/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') PREV_VERSION=$(cat /opt/${APP}_version.txt) if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "${PREV_VERSION}" ]]; then - msg_info "Stopping ${APP} Services" + msg_info "Stopping Services" systemctl stop hoarder-web hoarder-workers hoarder-browser msg_ok "Stopped Services" From 322565b79b741a1ef56ece3c31f1fad57e317d92 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:59:09 +0100 Subject: [PATCH 15/26] Update ct/hoarder.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com> --- ct/hoarder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index f703191db5..c3995988ce 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -72,7 +72,7 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "${PREV_VERSION}" ]] unzip -q v${RELEASE}.zip mv hoarder-${RELEASE} /opt/hoarder cd /opt/hoarder/apps/web - pnpm install --frozen-lockfile >/dev/null 2>&1 + pnpm install --frozen-lockfile &>/dev/null cd /opt/hoarder/apps/workers pnpm install --frozen-lockfile >/dev/null 2>&1 cd /opt/hoarder/apps/web From fe2949ad37a8ca101517a9726285907a881d6cfe Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:08:19 +0100 Subject: [PATCH 16/26] Remove bazarr.sh and bazarr-install.sh changes from PR --- ct/bazarr.sh | 73 +++++++++++++++++++++++++++++++++++++++ install/bazarr-install.sh | 68 ++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100755 ct/bazarr.sh create mode 100755 install/bazarr-install.sh diff --git a/ct/bazarr.sh b/ct/bazarr.sh new file mode 100755 index 0000000000..f6118d9920 --- /dev/null +++ b/ct/bazarr.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +function header_info { +clear +cat <<"EOF" + ____ + / __ )____ _____ ____ ___________ + / __ / __ `/_ / / __ `/ ___/ ___/ + / /_/ / /_/ / / /_/ /_/ / / / / +/_____/\__,_/ /___/\__,_/_/ /_/ + +EOF +} +header_info +echo -e "Loading..." +APP="Bazarr" +var_disk="4" +var_cpu="2" +var_ram="1024" +var_os="debian" +var_version="12" +variables +color +catch_errors + +function default_settings() { + CT_TYPE="1" + PW="" + CT_ID=$NEXTID + HN=$NSAPP + DISK_SIZE="$var_disk" + CORE_COUNT="$var_cpu" + RAM_SIZE="$var_ram" + BRG="vmbr0" + NET="dhcp" + GATE="" + APT_CACHER="" + APT_CACHER_IP="" + DISABLEIP6="no" + MTU="" + SD="" + NS="" + MAC="" + VLAN="" + SSH="no" + VERB="no" + echo_default +} + +function update_script() { +header_info +check_container_storage +check_container_resources +if [[ ! -d /var/lib/bazarr/ ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +msg_info "Updating $APP LXC" +apt-get update &>/dev/null +apt-get -y upgrade &>/dev/null +msg_ok "Updated $APP LXC" +exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${APP} should be reachable by going to the following URL. + ${BL}http://${IP}:6767${CL} \n" diff --git a/install/bazarr-install.sh b/install/bazarr-install.sh new file mode 100755 index 0000000000..b0e46e72b3 --- /dev/null +++ b/install/bazarr-install.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +msg_ok "Installed Dependencies" + +msg_info "Updating Python3" +$STD apt-get install -y \ + python3 \ + python3-dev \ + python3-pip +rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED +msg_ok "Updated Python3" + +msg_info "Installing Bazarr" +mkdir -p /var/lib/bazarr/ +wget -q https://github.com/morpheus65535/bazarr/releases/latest/download/bazarr.zip +unzip -qq bazarr -d /opt/bazarr +chmod 775 /opt/bazarr /var/lib/bazarr/ +python3 -m pip install -q -r /opt/bazarr/requirements.txt +msg_ok "Installed Bazarr" + +msg_info "Creating Service" +cat </etc/systemd/system/bazarr.service +[Unit] +Description=Bazarr Daemon +After=syslog.target network.target + +[Service] +WorkingDirectory=/opt/bazarr/ +UMask=0002 +Restart=on-failure +RestartSec=5 +Type=simple +ExecStart=/usr/bin/python3 /opt/bazarr/bazarr.py +KillSignal=SIGINT +TimeoutStopSec=20 +SyslogIdentifier=bazarr + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now bazarr +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -rf bazarr.zip +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" \ No newline at end of file From 70d13d21a719f032da39e410e680b8c12830b27b Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:15:47 +0100 Subject: [PATCH 17/26] Add Json for Website --- json/hoarder.json | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 json/hoarder.json diff --git a/json/hoarder.json b/json/hoarder.json new file mode 100644 index 0000000000..fd99c5a835 --- /dev/null +++ b/json/hoarder.json @@ -0,0 +1,34 @@ +{ + "name": "Hoarder", + "slug": "hoarder", + "categories": [ + 14 + ], + "date_created": "2024-11-28", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3000, + "documentation": "https://docs.hoarder.app/", + "website": "https://hoarder.app/", + "logo": "https://raw.githubusercontent.com/hoarder-app/hoarder/refs/heads/main/screenshots/logo.png", + "description": "Hoarder is an AI-powered bookmarking tool that helps you save and organize your digital content. It automatically tags your links, notes, and images, making them easy to find later. With features like auto-fetching, lists, and full-text search, Hoarder is the perfect tool for anyone who wants to keep track of their digital life.", + "install_methods": [ + { + "type": "default", + "script": "/ct/hoarder.sh", + "resources": { + "cpu": 4, + "ram": 4096, + "hdd": 10, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} \ No newline at end of file From 218bbae50eb9eab0af7fc198da02e1e71722f1bd Mon Sep 17 00:00:00 2001 From: vhsdream <67816022+vhsdream@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:34:07 -0500 Subject: [PATCH 18/26] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com> --- install/hoarder-install.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index 53c4bdbcf8..9259c8c7b3 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -98,11 +98,8 @@ DATA_DIR="/opt/hoarder_data" MEILI_ADDR="http://127.0.0.1:7700" MEILI_MASTER_KEY="$MASTER_KEY" BROWSER_WEB_URL="http://127.0.0.1:9222" -#CRAWLER_FULL_PAGE_SCREENSHOT=true -#CRAWLER_FULL_PAGE_ARCHIVE=true -#CRAWLER_VIDEO_DOWNLOAD=true EOF -echo "${RELEASE}" >"/opt/Hoarder_version.txt" +echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed Hoarder" msg_info "Running Database Migration" @@ -111,8 +108,7 @@ $STD pnpm migrate mv db.db /opt/hoarder_data msg_ok "Database Migration Completed" -msg_info "Setting up Services" -# Meilisearch Service +msg_info "Creating Services" cat </etc/systemd/system/meilisearch.service [Unit] Description=Meilisearch @@ -126,7 +122,6 @@ Restart=always WantedBy=multi-user.target EOF -# Hoarder Web Service cat </etc/systemd/system/hoarder-web.service [Unit] Description=Hoarder Web @@ -143,7 +138,6 @@ Restart=always WantedBy=multi-user.target EOF -# Hoarder Browser Service cat </etc/systemd/system/hoarder-browser.service [Unit] Description=Hoarder Headless Browser @@ -158,7 +152,6 @@ Restart=always WantedBy=multi-user.target EOF -# Hoarder Workers Service cat </etc/systemd/system/hoarder-workers.service [Unit] Description=Hoarder Workers @@ -177,7 +170,7 @@ WantedBy=multi-user.target EOF systemctl -q enable --now meilisearch.service hoarder-web.service hoarder-browser.service hoarder-workers.service -msg_ok "Set up Services" +msg_ok "Created Services" motd_ssh customize From 08e35c9cdbad17165e273cfd6325da95b2443179 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 28 Nov 2024 19:25:24 +0100 Subject: [PATCH 19/26] Update ct/hoarder.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com> --- ct/hoarder.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index c3995988ce..2cad47d6c6 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -19,7 +19,6 @@ EOF header_info echo -e "Loading..." APP="Hoarder" -TAGS="bookmark;links" var_disk="8" var_cpu="4" var_ram="4096" From 60d56149cacc23ce18b2fa1d88a9a324e484ba4f Mon Sep 17 00:00:00 2001 From: vhsdream <67816022+vhsdream@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:38:55 -0500 Subject: [PATCH 20/26] Update hoarder.sh --- ct/hoarder.sh | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index 2cad47d6c6..7a10f10355 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -20,7 +20,7 @@ header_info echo -e "Loading..." APP="Hoarder" var_disk="8" -var_cpu="4" +var_cpu="2" var_ram="4096" var_os="debian" var_version="12" @@ -58,39 +58,33 @@ check_container_storage check_container_resources if [[ ! -d /opt/hoarder ]]; then msg_error "No ${APP} Installation Found!"; exit; fi RELEASE=$(curl -s https://api.github.com/repos/hoarder-app/hoarder/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') -PREV_VERSION=$(cat /opt/${APP}_version.txt) -if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "${PREV_VERSION}" ]]; then +PREV_RELEASE=$(cat /opt/${APP}_version.txt) +if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "${PREV_RELEASE}" ]]; then msg_info "Stopping Services" systemctl stop hoarder-web hoarder-workers hoarder-browser msg_ok "Stopped Services" - msg_info "Updating ${APP} to v${RELEASE}" cd /opt - mv /opt/hoarder /opt/hoarder_bak + mv /opt/hoarder/.env /opt/.env + rm -rf /opt/hoarder wget -q "https://github.com/hoarder-app/hoarder/archive/refs/tags/v${RELEASE}.zip" unzip -q v${RELEASE}.zip mv hoarder-${RELEASE} /opt/hoarder cd /opt/hoarder/apps/web pnpm install --frozen-lockfile &>/dev/null - cd /opt/hoarder/apps/workers - pnpm install --frozen-lockfile >/dev/null 2>&1 - cd /opt/hoarder/apps/web - export NEXT_TELEMETRY_DISABLED=1 pnpm exec next build --experimental-build-mode compile >/dev/null 2>&1 cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web - export DATA_DIR=/opt/hoarder_data - cd /opt/hoarder/packages/db - pnpm migrate >/dev/null 2>&1 - echo "${RELEASE}" >/opt/${APP}_version.txt - cp /opt/hoarder_bak/.env /opt/hoarder/.env - sed -i "s/SERVER_VERSION=${PREV_VERSION}/SERVER_VERSION=${RELEASE}/" /opt/hoarder/.env + cd /opt/hoarder/apps/workers + pnpm install --frozen-lockfile >/dev/null 2>&1 + mv /opt/.env /opt/hoarder/.env + sed -i "s/SERVER_VERSION=${PREV_RELEASE}/SERVER_VERSION=${RELEASE}/" /opt/hoarder/.env msg_ok "Updated ${APP} to ${RELEASE}" - msg_info "Starting ${APP} Services" + msg_info "Starting Services" systemctl start hoarder-browser hoarder-workers hoarder-web - msg_ok "Started ${APP}" + msg_ok "Started Services" msg_info "Cleaning up" rm -R /opt/v${RELEASE}.zip - rm -rf /opt/hoarder_bak + echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Cleaned" msg_ok "Updated Successfully" else From a0f6e148b53c1880cbf0c2c86648a609f8b8dff6 Mon Sep 17 00:00:00 2001 From: vhsdream Date: Thu, 28 Nov 2024 16:57:42 -0500 Subject: [PATCH 21/26] remove unnecessary dependencies; clean up worker & web install; remove zip after cleanup --- install/hoarder-install.sh | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index 9259c8c7b3..52295955a7 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -15,8 +15,6 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - python3 \ - python3-distutils \ g++ \ build-essential \ curl \ @@ -25,13 +23,6 @@ $STD apt-get install -y \ gnupg \ ca-certificates \ chromium \ - libpixman-1-dev \ - libcairo2-dev \ - libjpeg-dev \ - libpango1.0-dev \ - libgif-dev \ - librsvg2-dev \ - pkg-config \ mc msg_ok "Installed Dependencies" @@ -72,9 +63,6 @@ RELEASE=$(curl -s https://api.github.com/repos/hoarder-app/hoarder/releases/late wget -q "https://github.com/hoarder-app/hoarder/archive/refs/tags/v${RELEASE}.zip" unzip -q v${RELEASE}.zip mv hoarder-${RELEASE} /opt/hoarder - -mkdir -p /opt/hoarder_data - cd /opt/hoarder corepack enable export PUPPETEER_SKIP_DOWNLOAD="true" @@ -82,14 +70,12 @@ export NEXT_TELEMETRY_DISABLED=1 export CI="true" cd /opt/hoarder/apps/web $STD pnpm install --frozen-lockfile -cd /opt/hoarder/apps/workers -$STD pnpm install --frozen-lockfile -cd /opt/hoarder/apps/web $STD pnpm exec next build --experimental-build-mode compile cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web +cd /opt/hoarder/apps/workers +$STD pnpm install --frozen-lockfile HOARDER_SECRET=$(openssl rand -base64 36 | cut -c1-24) - cat </opt/hoarder/.env SERVER_VERSION=$RELEASE NEXTAUTH_SECRET="$HOARDER_SECRET" @@ -103,6 +89,7 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed Hoarder" msg_info "Running Database Migration" +mkdir -p /opt/hoarder_data cd /opt/hoarder/packages/db $STD pnpm migrate mv db.db /opt/hoarder_data @@ -177,6 +164,7 @@ customize msg_info "Cleaning up" rm -rf /tmp/meilisearch.deb +rm -f /opt/v${RELEASE}.zip $STD apt-get autoremove -y $STD apt-get autoclean -y msg_ok "Cleaned" From ccf08e78ff2c202011515c688a4591ac95ce3a65 Mon Sep 17 00:00:00 2001 From: vhsdream <67816022+vhsdream@users.noreply.github.com> Date: Fri, 29 Nov 2024 08:12:40 -0500 Subject: [PATCH 22/26] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Håvard Gjøby Thom <34199185+havardthom@users.noreply.github.com> --- ct/hoarder.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index 7a10f10355..088a283b1d 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -72,13 +72,14 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "${PREV_RELEASE}" ]] mv hoarder-${RELEASE} /opt/hoarder cd /opt/hoarder/apps/web pnpm install --frozen-lockfile &>/dev/null - pnpm exec next build --experimental-build-mode compile >/dev/null 2>&1 + pnpm exec next build --experimental-build-mode compile &>/dev/null cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web cd /opt/hoarder/apps/workers pnpm install --frozen-lockfile >/dev/null 2>&1 mv /opt/.env /opt/hoarder/.env sed -i "s/SERVER_VERSION=${PREV_RELEASE}/SERVER_VERSION=${RELEASE}/" /opt/hoarder/.env - msg_ok "Updated ${APP} to ${RELEASE}" + msg_ok "Updated ${APP} to v${RELEASE}" + msg_info "Starting Services" systemctl start hoarder-browser hoarder-workers hoarder-web msg_ok "Started Services" From 91fa4090c5db34417ad82c98f9a40f9f16453029 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 29 Nov 2024 18:13:06 +0100 Subject: [PATCH 23/26] Update hoarder.sh (&>/dev/null) &>/dev/null --- ct/hoarder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index 088a283b1d..21f3eb8c81 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -75,7 +75,7 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "${PREV_RELEASE}" ]] pnpm exec next build --experimental-build-mode compile &>/dev/null cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web cd /opt/hoarder/apps/workers - pnpm install --frozen-lockfile >/dev/null 2>&1 + pnpm install --frozen-lockfile &>/dev/null mv /opt/.env /opt/hoarder/.env sed -i "s/SERVER_VERSION=${PREV_RELEASE}/SERVER_VERSION=${RELEASE}/" /opt/hoarder/.env msg_ok "Updated ${APP} to v${RELEASE}" From 47def6a84ef7840cf02ddd1fe9cee906c8be6422 Mon Sep 17 00:00:00 2001 From: vhsdream Date: Fri, 29 Nov 2024 17:46:35 -0500 Subject: [PATCH 24/26] Fix broken DB migration, other small changes --- ct/hoarder.sh | 3 +++ install/hoarder-install.sh | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index 21f3eb8c81..b28a52a831 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -76,6 +76,9 @@ if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "${PREV_RELEASE}" ]] cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web cd /opt/hoarder/apps/workers pnpm install --frozen-lockfile &>/dev/null + export DATA_DIR=/opt/hoarder_data + cd /opt/hoarder/packages/db + pnpm migrate &>/dev/null mv /opt/.env /opt/hoarder/.env sed -i "s/SERVER_VERSION=${PREV_RELEASE}/SERVER_VERSION=${RELEASE}/" /opt/hoarder/.env msg_ok "Updated ${APP} to v${RELEASE}" diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index 52295955a7..aa83fbd068 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -75,12 +75,13 @@ cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/app cd /opt/hoarder/apps/workers $STD pnpm install --frozen-lockfile +export DATA_DIR=/opt/hoarder_data HOARDER_SECRET=$(openssl rand -base64 36 | cut -c1-24) cat </opt/hoarder/.env SERVER_VERSION=$RELEASE NEXTAUTH_SECRET="$HOARDER_SECRET" NEXTAUTH_URL="http://localhost:3000" -DATA_DIR="/opt/hoarder_data" +DATA_DIR="$DATA_DIR" MEILI_ADDR="http://127.0.0.1:7700" MEILI_MASTER_KEY="$MASTER_KEY" BROWSER_WEB_URL="http://127.0.0.1:9222" @@ -89,10 +90,9 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed Hoarder" msg_info "Running Database Migration" -mkdir -p /opt/hoarder_data +mkdir -p ${DATA_DIR} cd /opt/hoarder/packages/db $STD pnpm migrate -mv db.db /opt/hoarder_data msg_ok "Database Migration Completed" msg_info "Creating Services" @@ -112,8 +112,8 @@ EOF cat </etc/systemd/system/hoarder-web.service [Unit] Description=Hoarder Web -Wants=network.target hoarder-workers.service meilisearch.service -After=network.target hoarder-workers.service meilisearch.service +Wants=network.target hoarder-workers.service +After=network.target hoarder-workers.service [Service] ExecStart=pnpm start @@ -142,8 +142,8 @@ EOF cat </etc/systemd/system/hoarder-workers.service [Unit] Description=Hoarder Workers -Wants=network.target hoarder-browser.service -After=network.target hoarder-browser.service +Wants=network.target hoarder-browser.service meilisearch.service +After=network.target hoarder-browser.service meilisearch.service [Service] ExecStart=pnpm start:prod @@ -156,7 +156,7 @@ TimeoutStopSec=5 WantedBy=multi-user.target EOF -systemctl -q enable --now meilisearch.service hoarder-web.service hoarder-browser.service hoarder-workers.service +systemctl -q enable --now meilisearch.service hoarder-browser.service hoarder-workers.service hoarder-web.service msg_ok "Created Services" motd_ssh From 091bf8a66e9fce0bdeebb0b2e6cfd6e7fdd187cc Mon Sep 17 00:00:00 2001 From: vhsdream Date: Sat, 30 Nov 2024 08:35:49 -0500 Subject: [PATCH 25/26] Update resources in hoarder.json --- json/hoarder.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/json/hoarder.json b/json/hoarder.json index fd99c5a835..87c7e5569f 100644 --- a/json/hoarder.json +++ b/json/hoarder.json @@ -18,9 +18,9 @@ "type": "default", "script": "/ct/hoarder.sh", "resources": { - "cpu": 4, + "cpu": 2, "ram": 4096, - "hdd": 10, + "hdd": 8, "os": "Debian", "version": "12" } @@ -31,4 +31,4 @@ "password": null }, "notes": [] -} \ No newline at end of file +} From 6d41b7e465aab0652ab928a814735cb1a772eefd Mon Sep 17 00:00:00 2001 From: vhsdream <67816022+vhsdream@users.noreply.github.com> Date: Sat, 30 Nov 2024 10:23:01 -0500 Subject: [PATCH 26/26] Update install/hoarder-install.sh with commented refs for AI tagging Co-authored-by: Mohamed Bassem --- install/hoarder-install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index aa83fbd068..92eed2de69 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -85,6 +85,16 @@ DATA_DIR="$DATA_DIR" MEILI_ADDR="http://127.0.0.1:7700" MEILI_MASTER_KEY="$MASTER_KEY" BROWSER_WEB_URL="http://127.0.0.1:9222" + +# If you're planning to use OpenAI for tagging. Uncomment the following line: +# OPENAI_API_KEY="" + +# If you're planning to use ollama for tagging, uncomment the following lines: +# OLLAMA_BASE_URL="" + +# You can change the models used by uncommenting the following lines, and changing them according to your needs: +# INFERENCE_TEXT_MODEL="gpt-4o-mini" +# INFERENCE_IMAGE_MODEL="gpt-4o-mini" EOF echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" msg_ok "Installed Hoarder"