mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-01-30 20:40:15 +00:00
Fix broken DB migration, other small changes
This commit is contained in:
parent
91fa4090c5
commit
47def6a84e
@ -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
|
cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web
|
||||||
cd /opt/hoarder/apps/workers
|
cd /opt/hoarder/apps/workers
|
||||||
pnpm install --frozen-lockfile &>/dev/null
|
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
|
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}/" /opt/hoarder/.env
|
||||||
msg_ok "Updated ${APP} to v${RELEASE}"
|
msg_ok "Updated ${APP} to v${RELEASE}"
|
||||||
|
@ -75,12 +75,13 @@ cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/app
|
|||||||
cd /opt/hoarder/apps/workers
|
cd /opt/hoarder/apps/workers
|
||||||
$STD pnpm install --frozen-lockfile
|
$STD pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
export DATA_DIR=/opt/hoarder_data
|
||||||
HOARDER_SECRET=$(openssl rand -base64 36 | cut -c1-24)
|
HOARDER_SECRET=$(openssl rand -base64 36 | cut -c1-24)
|
||||||
cat <<EOF >/opt/hoarder/.env
|
cat <<EOF >/opt/hoarder/.env
|
||||||
SERVER_VERSION=$RELEASE
|
SERVER_VERSION=$RELEASE
|
||||||
NEXTAUTH_SECRET="$HOARDER_SECRET"
|
NEXTAUTH_SECRET="$HOARDER_SECRET"
|
||||||
NEXTAUTH_URL="http://localhost:3000"
|
NEXTAUTH_URL="http://localhost:3000"
|
||||||
DATA_DIR="/opt/hoarder_data"
|
DATA_DIR="$DATA_DIR"
|
||||||
MEILI_ADDR="http://127.0.0.1:7700"
|
MEILI_ADDR="http://127.0.0.1:7700"
|
||||||
MEILI_MASTER_KEY="$MASTER_KEY"
|
MEILI_MASTER_KEY="$MASTER_KEY"
|
||||||
BROWSER_WEB_URL="http://127.0.0.1:9222"
|
BROWSER_WEB_URL="http://127.0.0.1:9222"
|
||||||
@ -89,10 +90,9 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
|||||||
msg_ok "Installed Hoarder"
|
msg_ok "Installed Hoarder"
|
||||||
|
|
||||||
msg_info "Running Database Migration"
|
msg_info "Running Database Migration"
|
||||||
mkdir -p /opt/hoarder_data
|
mkdir -p ${DATA_DIR}
|
||||||
cd /opt/hoarder/packages/db
|
cd /opt/hoarder/packages/db
|
||||||
$STD pnpm migrate
|
$STD pnpm migrate
|
||||||
mv db.db /opt/hoarder_data
|
|
||||||
msg_ok "Database Migration Completed"
|
msg_ok "Database Migration Completed"
|
||||||
|
|
||||||
msg_info "Creating Services"
|
msg_info "Creating Services"
|
||||||
@ -112,8 +112,8 @@ EOF
|
|||||||
cat <<EOF >/etc/systemd/system/hoarder-web.service
|
cat <<EOF >/etc/systemd/system/hoarder-web.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Hoarder Web
|
Description=Hoarder Web
|
||||||
Wants=network.target hoarder-workers.service meilisearch.service
|
Wants=network.target hoarder-workers.service
|
||||||
After=network.target hoarder-workers.service meilisearch.service
|
After=network.target hoarder-workers.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=pnpm start
|
ExecStart=pnpm start
|
||||||
@ -142,8 +142,8 @@ EOF
|
|||||||
cat <<EOF >/etc/systemd/system/hoarder-workers.service
|
cat <<EOF >/etc/systemd/system/hoarder-workers.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Hoarder Workers
|
Description=Hoarder Workers
|
||||||
Wants=network.target hoarder-browser.service
|
Wants=network.target hoarder-browser.service meilisearch.service
|
||||||
After=network.target hoarder-browser.service
|
After=network.target hoarder-browser.service meilisearch.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=pnpm start:prod
|
ExecStart=pnpm start:prod
|
||||||
@ -156,7 +156,7 @@ TimeoutStopSec=5
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
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"
|
msg_ok "Created Services"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
Loading…
Reference in New Issue
Block a user