Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED
This commit is contained in:
commit
e605b7ba38
12
ct/trip.sh
12
ct/trip.sh
@ -34,8 +34,8 @@ function update_script() {
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Backing up Configuration"
|
||||
cp -r /opt/trip/.env /opt/trip.env.bak 2>/dev/null || true
|
||||
cp -r /opt/trip/data /opt/trip_data_backup 2>/dev/null || true
|
||||
cp /opt/trip.env /opt/trip.env.bak
|
||||
cp -r /opt/trip_storage /opt/trip_storage_backup
|
||||
msg_ok "Backed up Configuration"
|
||||
|
||||
fetch_and_deploy_gh_release "trip" "itskovacs/TRIP"
|
||||
@ -49,14 +49,14 @@ function update_script() {
|
||||
|
||||
msg_info "Updating Backend"
|
||||
cd /opt/trip/backend
|
||||
$STD /opt/trip/.venv/bin/pip install --no-cache-dir -r trip/requirements.txt
|
||||
$STD uv pip install --python /opt/trip/.venv/bin/python -r trip/requirements.txt
|
||||
msg_ok "Updated Backend"
|
||||
|
||||
msg_info "Restoring Configuration"
|
||||
cp /opt/trip.env.bak /opt/trip/.env 2>/dev/null || true
|
||||
cp -r /opt/trip_data_backup/. /opt/trip/data 2>/dev/null || true
|
||||
cp /opt/trip.env.bak /opt/trip.env
|
||||
cp -r /opt/trip_storage_backup/. /opt/trip_storage
|
||||
rm -f /opt/trip.env.bak
|
||||
rm -rf /opt/trip_data_backup
|
||||
rm -rf /opt/trip_storage_backup
|
||||
msg_ok "Restored Configuration"
|
||||
|
||||
msg_info "Starting Service"
|
||||
|
||||
@ -9,10 +9,10 @@
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 8000,
|
||||
"documentation": "https://github.com/itskovacs/TRIP",
|
||||
"documentation": "https://itskovacs.github.io/trip/docs/intro",
|
||||
"website": "https://github.com/itskovacs/TRIP",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/trip.webp",
|
||||
"config_path": "/opt/trip/.env",
|
||||
"config_path": "/opt/trip.env",
|
||||
"description": "Minimalist POI Map Tracker and Trip Planner. Self-hosted.",
|
||||
"install_methods": [
|
||||
{
|
||||
|
||||
@ -31,13 +31,23 @@ msg_ok "Built Frontend"
|
||||
msg_info "Setting up Backend"
|
||||
cd /opt/trip/backend
|
||||
$STD uv venv /opt/trip/.venv
|
||||
$STD /opt/trip/.venv/bin/pip install --no-cache-dir -r trip/requirements.txt
|
||||
$STD uv pip install --python /opt/trip/.venv/bin/python -r trip/requirements.txt
|
||||
msg_ok "Set up Backend"
|
||||
|
||||
msg_info "Configuring Application"
|
||||
mkdir -p /opt/trip/frontend
|
||||
cp -r /opt/trip/src/dist/trip/browser/* /opt/trip/frontend/
|
||||
mkdir -p /opt/trip/data
|
||||
mkdir -p /opt/trip_storage/{attachments,backups,assets}
|
||||
|
||||
cat <<EOF >/opt/trip.env
|
||||
# TRIP Configuration
|
||||
# https://itskovacs.github.io/trip/docs/getting-started/configuration/
|
||||
ATTACHMENTS_FOLDER=/opt/trip_storage/attachments
|
||||
BACKUPS_FOLDER=/opt/trip_storage/backups
|
||||
ASSETS_FOLDER=/opt/trip_storage/assets
|
||||
FRONTEND_FOLDER=/opt/trip/frontend
|
||||
SQLITE_FILE=/opt/trip_storage/trip.sqlite
|
||||
EOF
|
||||
msg_ok "Configured Application"
|
||||
|
||||
msg_info "Creating Service"
|
||||
@ -49,7 +59,7 @@ After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/trip/backend
|
||||
Environment="PYTHONPATH=/opt/trip/backend"
|
||||
EnvironmentFile=/opt/trip.env
|
||||
ExecStart=/opt/trip/.venv/bin/fastapi run /opt/trip/backend/trip/main.py --host 0.0.0.0 --port 8000
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user