mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-24 21:27:16 +02:00
Refactor: Calibre-Web database creation (#16842)
* calibre-web: point cps at explicit db path, src-layout package has no default anymore * calibre-web: fix empty-library bootstrap, migrate pre-existing library on update
This commit is contained in:
committed by
GitHub
parent
bd0529547c
commit
c1cff5ce2e
@@ -57,6 +57,18 @@ function update_script() {
|
|||||||
|
|
||||||
restore_backup
|
restore_backup
|
||||||
|
|
||||||
|
mkdir -p /opt/calibre-web-library
|
||||||
|
if [[ -f /opt/calibre-web/data/metadata.db && ! -f /opt/calibre-web-library/metadata.db ]]; then
|
||||||
|
msg_info "Migrating Calibre Library to its own directory"
|
||||||
|
find /opt/calibre-web/data -mindepth 1 -maxdepth 1 ! -name app.db ! -name .calibre-web -exec mv -t /opt/calibre-web-library -- {} +
|
||||||
|
msg_ok "Migrated Calibre Library"
|
||||||
|
fi
|
||||||
|
if [[ ! -f /opt/calibre-web-library/metadata.db ]]; then
|
||||||
|
msg_info "Creating Empty Calibre Library"
|
||||||
|
$STD calibredb list --with-library /opt/calibre-web-library
|
||||||
|
msg_ok "Created Empty Calibre Library"
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
systemctl start calibre-web
|
systemctl start calibre-web
|
||||||
msg_ok "Started Service"
|
msg_ok "Started Service"
|
||||||
|
|||||||
@@ -42,8 +42,14 @@ $STD uv pip install --python /opt/calibre-web/.venv/bin/python --no-cache-dir --
|
|||||||
$STD uv pip install --python /opt/calibre-web/.venv/bin/python --no-cache-dir .
|
$STD uv pip install --python /opt/calibre-web/.venv/bin/python --no-cache-dir .
|
||||||
msg_ok "Installed Python Dependencies"
|
msg_ok "Installed Python Dependencies"
|
||||||
|
|
||||||
|
mkdir -p /opt/calibre-web/data /opt/calibre-web-library
|
||||||
|
if [[ ! -f /opt/calibre-web-library/metadata.db ]]; then
|
||||||
|
msg_info "Creating Empty Calibre Library"
|
||||||
|
$STD calibredb list --with-library /opt/calibre-web-library
|
||||||
|
msg_ok "Created Empty Calibre Library"
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
mkdir -p /opt/calibre-web/data
|
|
||||||
cat <<EOF >/etc/systemd/system/calibre-web.service
|
cat <<EOF >/etc/systemd/system/calibre-web.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Calibre-Web Service
|
Description=Calibre-Web Service
|
||||||
|
|||||||
Reference in New Issue
Block a user