From 9533bc88b343ced74c6a6f00c91a0b280f87c0ac Mon Sep 17 00:00:00 2001 From: MahrWe <28512631+MahrWe@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:25:56 +0100 Subject: [PATCH 1/3] Update .env file location in hoarder-install.sh --- install/hoarder-install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install/hoarder-install.sh b/install/hoarder-install.sh index 4b56b076..a513460c 100644 --- a/install/hoarder-install.sh +++ b/install/hoarder-install.sh @@ -78,7 +78,8 @@ $STD pnpm install --frozen-lockfile export DATA_DIR=/opt/hoarder_data HOARDER_SECRET=$(openssl rand -base64 36 | cut -c1-24) -cat </opt/hoarder/.env +mkdir -p /etc/hoarder +cat </etc/hoarder/hoarder.env SERVER_VERSION=$RELEASE NEXTAUTH_SECRET="$HOARDER_SECRET" NEXTAUTH_URL="http://localhost:3000" @@ -129,7 +130,7 @@ After=network.target hoarder-workers.service [Service] ExecStart=pnpm start WorkingDirectory=/opt/hoarder/apps/web -EnvironmentFile=/opt/hoarder/.env +EnvironmentFile=/etc/hoarder/hoarder.env Restart=always [Install] @@ -159,7 +160,7 @@ After=network.target hoarder-browser.service meilisearch.service [Service] ExecStart=pnpm start:prod WorkingDirectory=/opt/hoarder/apps/workers -EnvironmentFile=/opt/hoarder/.env +EnvironmentFile=/etc/hoarder/hoarder.env Restart=always TimeoutStopSec=5 From 0ad212400cab26e18f3d1d78105e9af6395d1930 Mon Sep 17 00:00:00 2001 From: MahrWe <28512631+MahrWe@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:31:08 +0100 Subject: [PATCH 2/3] Update .env file location in hoarder.sh No more need to move around the .env file --- ct/hoarder.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index b91765ec..197b9cc9 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -40,7 +40,6 @@ function update_script() { msg_ok "Stopped Services" msg_info "Updating ${APP} to v${RELEASE}" cd /opt - 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 @@ -54,8 +53,7 @@ function update_script() { 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 + sed -i "s/SERVER_VERSION=${PREV_RELEASE}/SERVER_VERSION=${RELEASE}/" /etc/hoarder/hoarder.env msg_ok "Updated ${APP} to v${RELEASE}" msg_info "Starting Services" @@ -79,4 +77,4 @@ 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}:3000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" From 4bb27b0620374f9fca8abcb253632b1baefe73bd Mon Sep 17 00:00:00 2001 From: MahrWe <28512631+MahrWe@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:46:14 +0100 Subject: [PATCH 3/3] migration of .env to hoarder.env in hoarder.sh --- ct/hoarder.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ct/hoarder.sh b/ct/hoarder.sh index 197b9cc9..e4f25b1d 100644 --- a/ct/hoarder.sh +++ b/ct/hoarder.sh @@ -40,6 +40,10 @@ function update_script() { msg_ok "Stopped Services" msg_info "Updating ${APP} to v${RELEASE}" cd /opt + if [[ -f /opt/hoarder/.env ]] && [[ ! -f /etc/hoarder/hoarder.env ]]; then + mkdir -p /etc/hoarder + mv /opt/hoarder/.env /etv/hoarder/hoarder.env + fi rm -rf /opt/hoarder wget -q "https://github.com/hoarder-app/hoarder/archive/refs/tags/v${RELEASE}.zip" unzip -q v${RELEASE}.zip