mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-19 15:04:56 +02:00
Compare commits
2 Commits
fix/meilis
...
fix/dispat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
099a9b712a | ||
|
|
c812bb6eb1 |
@@ -54,7 +54,7 @@ function update_script() {
|
|||||||
cp /opt/dispatcharr/.env /tmp/dispatcharr.env.backup
|
cp /opt/dispatcharr/.env /tmp/dispatcharr.env.backup
|
||||||
fi
|
fi
|
||||||
if [[ -f /opt/dispatcharr/start-gunicorn.sh ]]; then
|
if [[ -f /opt/dispatcharr/start-gunicorn.sh ]]; then
|
||||||
cp /opt/dispatcharr/start-gunicorn.sh /tmp/start-gunicorn.sh.backup
|
rm -f /opt/dispatcharr/start-gunicorn.sh
|
||||||
fi
|
fi
|
||||||
if [[ -f /opt/dispatcharr/start-celery.sh ]]; then
|
if [[ -f /opt/dispatcharr/start-celery.sh ]]; then
|
||||||
cp /opt/dispatcharr/start-celery.sh /tmp/start-celery.sh.backup
|
cp /opt/dispatcharr/start-celery.sh /tmp/start-celery.sh.backup
|
||||||
@@ -83,9 +83,6 @@ function update_script() {
|
|||||||
if [[ -f /tmp/dispatcharr.env.backup ]]; then
|
if [[ -f /tmp/dispatcharr.env.backup ]]; then
|
||||||
mv /tmp/dispatcharr.env.backup /opt/dispatcharr/.env
|
mv /tmp/dispatcharr.env.backup /opt/dispatcharr/.env
|
||||||
fi
|
fi
|
||||||
if [[ -f /tmp/start-gunicorn.sh.backup ]]; then
|
|
||||||
mv /tmp/start-gunicorn.sh.backup /opt/dispatcharr/start-gunicorn.sh
|
|
||||||
fi
|
|
||||||
if [[ -f /tmp/start-celery.sh.backup ]]; then
|
if [[ -f /tmp/start-celery.sh.backup ]]; then
|
||||||
mv /tmp/start-celery.sh.backup /opt/dispatcharr/start-celery.sh
|
mv /tmp/start-celery.sh.backup /opt/dispatcharr/start-celery.sh
|
||||||
fi
|
fi
|
||||||
@@ -105,7 +102,35 @@ function update_script() {
|
|||||||
rm -rf .venv
|
rm -rf .venv
|
||||||
$STD uv venv --clear
|
$STD uv venv --clear
|
||||||
$STD uv sync
|
$STD uv sync
|
||||||
$STD uv pip install gunicorn gevent celery redis daphne
|
$STD uv pip install uwsgi gevent celery redis daphne
|
||||||
|
cat <<'UWSGI_EOF' >/opt/dispatcharr/start-uwsgi.sh
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
cd /opt/dispatcharr
|
||||||
|
set -a
|
||||||
|
source .env
|
||||||
|
set +a
|
||||||
|
exec .venv/bin/uwsgi \
|
||||||
|
--chdir=/opt/dispatcharr \
|
||||||
|
--module=dispatcharr.wsgi:application \
|
||||||
|
--master \
|
||||||
|
--workers=4 \
|
||||||
|
--gevent=400 \
|
||||||
|
--http=0.0.0.0:5656 \
|
||||||
|
--http-keepalive=1 \
|
||||||
|
--http-timeout=600 \
|
||||||
|
--socket-timeout=600 \
|
||||||
|
--buffer-size=65536 \
|
||||||
|
--post-buffering=4096 \
|
||||||
|
--lazy-apps \
|
||||||
|
--thunder-lock \
|
||||||
|
--die-on-term \
|
||||||
|
--vacuum
|
||||||
|
UWSGI_EOF
|
||||||
|
chmod +x /opt/dispatcharr/start-uwsgi.sh
|
||||||
|
if grep -q 'start-gunicorn.sh' /etc/systemd/system/dispatcharr.service; then
|
||||||
|
sed -i 's|start-gunicorn.sh|start-uwsgi.sh|g' /etc/systemd/system/dispatcharr.service
|
||||||
|
systemctl daemon-reload
|
||||||
|
fi
|
||||||
msg_ok "Updated Dispatcharr Backend"
|
msg_ok "Updated Dispatcharr Backend"
|
||||||
|
|
||||||
msg_info "Building Frontend"
|
msg_info "Building Frontend"
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ msg_info "Installing Python Dependencies with uv"
|
|||||||
cd /opt/dispatcharr
|
cd /opt/dispatcharr
|
||||||
$STD uv venv --clear
|
$STD uv venv --clear
|
||||||
$STD uv sync
|
$STD uv sync
|
||||||
$STD uv pip install gunicorn gevent celery redis daphne
|
$STD uv pip install uwsgi gevent celery redis daphne
|
||||||
msg_ok "Installed Python Dependencies"
|
msg_ok "Installed Python Dependencies"
|
||||||
|
|
||||||
msg_info "Configuring Dispatcharr"
|
msg_info "Configuring Dispatcharr"
|
||||||
@@ -118,7 +118,7 @@ server {
|
|||||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
# All other requests proxy to Gunicorn
|
# All other requests proxy to uWSGI
|
||||||
location / {
|
location / {
|
||||||
include proxy_params;
|
include proxy_params;
|
||||||
proxy_pass http://127.0.0.1:5656;
|
proxy_pass http://127.0.0.1:5656;
|
||||||
@@ -131,20 +131,30 @@ systemctl restart nginx
|
|||||||
msg_ok "Configured Nginx"
|
msg_ok "Configured Nginx"
|
||||||
|
|
||||||
msg_info "Creating Services"
|
msg_info "Creating Services"
|
||||||
cat <<EOF >/opt/dispatcharr/start-gunicorn.sh
|
cat <<EOF >/opt/dispatcharr/start-uwsgi.sh
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
cd /opt/dispatcharr
|
cd /opt/dispatcharr
|
||||||
set -a
|
set -a
|
||||||
source .env
|
source .env
|
||||||
set +a
|
set +a
|
||||||
exec uv run gunicorn \\
|
exec .venv/bin/uwsgi \\
|
||||||
|
--chdir=/opt/dispatcharr \\
|
||||||
|
--module=dispatcharr.wsgi:application \\
|
||||||
|
--master \\
|
||||||
--workers=4 \\
|
--workers=4 \\
|
||||||
--worker-class=gevent \\
|
--gevent=400 \\
|
||||||
--timeout=300 \\
|
--http=0.0.0.0:5656 \\
|
||||||
--bind 0.0.0.0:5656 \\
|
--http-keepalive=1 \\
|
||||||
dispatcharr.wsgi:application
|
--http-timeout=600 \\
|
||||||
|
--socket-timeout=600 \\
|
||||||
|
--buffer-size=65536 \\
|
||||||
|
--post-buffering=4096 \\
|
||||||
|
--lazy-apps \\
|
||||||
|
--thunder-lock \\
|
||||||
|
--die-on-term \\
|
||||||
|
--vacuum
|
||||||
EOF
|
EOF
|
||||||
chmod +x /opt/dispatcharr/start-gunicorn.sh
|
chmod +x /opt/dispatcharr/start-uwsgi.sh
|
||||||
|
|
||||||
cat <<EOF >/opt/dispatcharr/start-celery.sh
|
cat <<EOF >/opt/dispatcharr/start-celery.sh
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@@ -184,7 +194,7 @@ After=network.target postgresql.service redis-server.service
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=/opt/dispatcharr
|
WorkingDirectory=/opt/dispatcharr
|
||||||
ExecStart=/opt/dispatcharr/start-gunicorn.sh
|
ExecStart=/opt/dispatcharr/start-uwsgi.sh
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
User=root
|
User=root
|
||||||
|
|||||||
Reference in New Issue
Block a user