Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED
This commit is contained in:
commit
93befbb713
120
ct/dispatcharr.sh
Normal file
120
ct/dispatcharr.sh
Normal file
@ -0,0 +1,120 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: ekke85
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/Dispatcharr/Dispatcharr
|
||||
|
||||
APP="Dispatcharr"
|
||||
APP_NAME=${APP,,}
|
||||
var_tags="${var_tags:-media;arr}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d "/opt/dispatcharr" ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Dispatcharr/Dispatcharr/releases/latest | jq -r '.tag_name' | sed 's/^v//')
|
||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||
msg_ok "Starting update"
|
||||
APP_DIR="/opt/dispatcharr"
|
||||
APP_USER="dispatcharr"
|
||||
APP_GROUP="dispatcharr"
|
||||
|
||||
|
||||
|
||||
msg_info "Stopping $APP"
|
||||
systemctl stop dispatcharr-celery
|
||||
systemctl stop dispatcharr-celerybeat
|
||||
systemctl stop dispatcharr-daphne
|
||||
systemctl stop dispatcharr
|
||||
msg_ok "Stopped $APP"
|
||||
|
||||
msg_info "Creating Backup"
|
||||
BACKUP_FILE="/opt/dispatcharr_$(date +%F).tar.gz"
|
||||
msg_info "Source and Database backup"
|
||||
set -o allexport
|
||||
source /etc/$APP_NAME/$APP_NAME.env
|
||||
set +o allexport
|
||||
PGPASSWORD=$POSTGRES_PASSWORD pg_dump -U $POSTGRES_USER -h $POSTGRES_HOST $POSTGRES_DB > /opt/$POSTGRES_DB-`date +%F`.sql
|
||||
$STD tar -czf "$BACKUP_FILE" /opt/dispatcharr /opt/Dispatcharr_version.txt /opt/$POSTGRES_DB-`date +%F`.sql &>/dev/null
|
||||
msg_ok "Backup Created"
|
||||
|
||||
msg_info "Updating $APP to v${RELEASE}"
|
||||
rm -rf /opt/dispatcharr
|
||||
fetch_and_deploy_gh_release "dispatcharr" "Dispatcharr/Dispatcharr"
|
||||
chown -R "$APP_USER:$APP_GROUP" "$APP_DIR"
|
||||
sed -i 's/program\[\x27channel_id\x27\]/program["channel_id"]/g' "${APP_DIR}/apps/output/views.py"
|
||||
|
||||
msg_ok "Dispatcharr Updated to $RELEASE"
|
||||
|
||||
msg_info "Creating Python Virtual Environment"
|
||||
cd $APP_DIR
|
||||
python3 -m venv env
|
||||
source env/bin/activate
|
||||
$STD pip install --upgrade pip
|
||||
$STD pip install -r requirements.txt
|
||||
$STD pip install gunicorn
|
||||
ln -sf /usr/bin/ffmpeg $APP_DIR/env/bin/ffmpeg
|
||||
msg_ok "Python Environment Setup"
|
||||
|
||||
msg_info "Building Frontend"
|
||||
cd $APP_DIR/frontend
|
||||
$STD npm install --legacy-peer-deps
|
||||
$STD npm run build
|
||||
msg_ok "Built Frontend"
|
||||
|
||||
msg_info "Running Django Migrations"
|
||||
cd $APP_DIR
|
||||
source env/bin/activate
|
||||
set -o allexport
|
||||
source /etc/$APP_NAME/$APP_NAME.env
|
||||
set +o allexport
|
||||
$STD python manage.py migrate --noinput
|
||||
$STD python manage.py collectstatic --noinput
|
||||
msg_ok "Migrations Complete"
|
||||
|
||||
msg_info "Starting $APP"
|
||||
systemctl start dispatcharr-celery
|
||||
systemctl start dispatcharr-celerybeat
|
||||
systemctl start dispatcharr-daphne
|
||||
systemctl start dispatcharr
|
||||
msg_ok "Started $APP"
|
||||
echo "${RELEASE}" > "/opt/${APP}_version.txt"
|
||||
|
||||
msg_info "Cleaning Up"
|
||||
rm -rf /opt/$POSTGRES_DB-`date +%F`.sql
|
||||
msg_ok "Cleanup Completed"
|
||||
|
||||
msg_ok "Update Successful, Backup saved to $BACKUP_FILE"
|
||||
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
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}:9191${CL}"
|
67
ct/freepbx.sh
Normal file
67
ct/freepbx.sh
Normal file
@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -s https://raw.githubusercontent.com/vsc55/community-scripts-ProxmoxVED/refs/heads/freepbx/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Arian Nasr (arian-nasr)
|
||||
# Updated by: Javier Pastor (vsc55)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://www.freepbx.org/
|
||||
|
||||
APP="FreePBX"
|
||||
var_tags="pbx;voip;telephony"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-10}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-12}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /lib/systemd/system/freepbx.service ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Updating $APP LXC"
|
||||
$STD apt-get update
|
||||
$STD apt-get -y upgrade
|
||||
msg_ok "Updated $APP LXC"
|
||||
|
||||
msg_info "Updating $APP Modules"
|
||||
$STD fwconsole ma updateall
|
||||
$STD fwconsole reload
|
||||
msg_ok "Updated $APP Modules"
|
||||
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
|
||||
if whiptail --title "Commercial Modules" --yesno "Remove Commercial modules?" --defaultno 10 50; then
|
||||
export ONLY_OPENSOURCE="yes"
|
||||
|
||||
if whiptail --title "Firewall Module" --yesno "Do you want to KEEP the Firewall module (and sysadmin)?" 10 50; then
|
||||
export REMOVE_FIREWALL="no"
|
||||
else
|
||||
export REMOVE_FIREWALL="yes"
|
||||
fi
|
||||
else
|
||||
export ONLY_OPENSOURCE="no"
|
||||
export REMOVE_FIREWALL="no"
|
||||
fi
|
||||
|
||||
build_container
|
||||
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}${CL}"
|
6
ct/headers/dispatcharr
Normal file
6
ct/headers/dispatcharr
Normal file
@ -0,0 +1,6 @@
|
||||
____ _ __ __
|
||||
/ __ \(_)________ ____ _/ /______/ /_ ____ ___________
|
||||
/ / / / / ___/ __ \/ __ `/ __/ ___/ __ \/ __ `/ ___/ ___/
|
||||
/ /_/ / (__ ) /_/ / /_/ / /_/ /__/ / / / /_/ / / / /
|
||||
/_____/_/____/ .___/\__,_/\__/\___/_/ /_/\__,_/_/ /_/
|
||||
/_/
|
6
ct/headers/freepbx
Normal file
6
ct/headers/freepbx
Normal file
@ -0,0 +1,6 @@
|
||||
______ ____ ____ _ __
|
||||
/ ____/_______ ___ / __ \/ __ ) |/ /
|
||||
/ /_ / ___/ _ \/ _ \/ /_/ / __ | /
|
||||
/ __/ / / / __/ __/ ____/ /_/ / |
|
||||
/_/ /_/ \___/\___/_/ /_____/_/|_|
|
||||
|
34
frontend/public/json/dispatcharr.json
Normal file
34
frontend/public/json/dispatcharr.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "Dispatcharr",
|
||||
"slug": "dispatcharr",
|
||||
"categories": [
|
||||
14
|
||||
],
|
||||
"date_created": "2025-07-01",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 9191,
|
||||
"documentation": "https://dispatcharr.github.io/Dispatcharr-Docs/",
|
||||
"website": "https://dispatcharr.github.io/Dispatcharr-Docs/",
|
||||
"logo": "https://raw.githubusercontent.com/Dispatcharr/Dispatcharr/refs/heads/main/frontend/src/images/logo.png",
|
||||
"description": "Dispatcharr is an open-source powerhouse for managing IPTV streams and EPG data with elegance and control. Born from necessity and built with passion, it started as a personal project by OkinawaBoss and evolved with contributions from legends like dekzter, SergeantPanda and Bucatini.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/dispatcharr.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 1024,
|
||||
"hdd": 8,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
|
40
frontend/public/json/freepbx.json
Normal file
40
frontend/public/json/freepbx.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "FreePBX",
|
||||
"slug": "freepbx",
|
||||
"categories": [
|
||||
0
|
||||
],
|
||||
"date_created": "2025-05-22",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 80,
|
||||
"documentation": "https://sangomakb.atlassian.net/wiki/spaces/FP/overview?homepageId=8454359",
|
||||
"website": "https://www.freepbx.org/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/freepbx.webp",
|
||||
"config_path": "",
|
||||
"description": "FreePBX is a web-based open-source graphical user interface that manages Asterisk, a voice over IP and telephony server.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/freepbx.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 10,
|
||||
"os": "debian",
|
||||
"version": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "This script uses the official FreePBX install script. Check it here: https://github.com/FreePBX/sng_freepbx_debian_install",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
275
install/dispatcharr-install.sh
Normal file
275
install/dispatcharr-install.sh
Normal file
@ -0,0 +1,275 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: ekke85
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/Dispatcharr/Dispatcharr
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
|
||||
APPLICATION="Dispatcharr"
|
||||
APP_NAME="dispatcharr"
|
||||
APP_USER="dispatcharr"
|
||||
APP_GROUP="dispatcharr"
|
||||
APP_DIR="/opt/dispatcharr"
|
||||
GUNICORN_RUNTIME_DIR="dispatcharr"
|
||||
GUNICORN_PORT="5656"
|
||||
NGINX_HTTP_PORT="9191"
|
||||
WEBSOCKET_PORT="8001"
|
||||
|
||||
msg_info "Creating ${APP_USER} user"
|
||||
groupadd -f $APP_GROUP
|
||||
useradd -M -s /usr/sbin/nologin -g $APP_GROUP $APP_USER || true
|
||||
msg_ok "Created ${APP_USER} user"
|
||||
|
||||
setup_uv
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
PG_VERSION="16" setup_postgresql
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
git \
|
||||
curl \
|
||||
wget \
|
||||
build-essential \
|
||||
gcc \
|
||||
libpcre3-dev \
|
||||
libpq-dev \
|
||||
python3-dev \
|
||||
python3-venv \
|
||||
python3-pip \
|
||||
nginx \
|
||||
redis-server \
|
||||
ffmpeg \
|
||||
procps \
|
||||
streamlink
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Configuring PostgreSQL"
|
||||
|
||||
POSTGRES_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
|
||||
{
|
||||
echo "POSTGRES_DB=dispatcharr"
|
||||
echo "POSTGRES_USER=dispatch"
|
||||
echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD"
|
||||
echo "POSTGRES_HOST=localhost"
|
||||
} >> ~/.$APP_NAME.creds
|
||||
|
||||
source ~/.$APP_NAME.creds
|
||||
|
||||
su - postgres -c "psql -tc \"SELECT 1 FROM pg_roles WHERE rolname='${POSTGRES_USER}'\"" | grep -q 1 || \
|
||||
su - postgres -c "psql -c \"CREATE USER ${POSTGRES_USER} WITH PASSWORD '${POSTGRES_PASSWORD}';\""
|
||||
|
||||
su - postgres -c "psql -tc \"SELECT 1 FROM pg_database WHERE datname='${POSTGRES_DB}'\"" | grep -q 1 || \
|
||||
su - postgres -c "psql -c \"CREATE DATABASE ${POSTGRES_DB} OWNER ${POSTGRES_USER};\""
|
||||
|
||||
su - postgres -c "psql -d ${POSTGRES_DB} -c \"ALTER SCHEMA public OWNER TO ${POSTGRES_USER};\""
|
||||
|
||||
|
||||
|
||||
msg_ok "Configured PostgreSQL"
|
||||
|
||||
msg_info "Fetching latest Dispatcharr release version"
|
||||
LATEST_VERSION=$(curl -fsSL https://api.github.com/repos/Dispatcharr/Dispatcharr/releases/latest | grep '"tag_name":' | cut -d '"' -f4)
|
||||
|
||||
if [[ -z "$LATEST_VERSION" ]]; then
|
||||
msg_error "Failed to fetch latest release version from GitHub."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
msg_info "Downloading Dispatcharr $LATEST_VERSION"
|
||||
fetch_and_deploy_gh_release "dispatcharr" "Dispatcharr/Dispatcharr"
|
||||
echo "$LATEST_VERSION" > "/opt/${APPLICATION}_version.txt"
|
||||
mkdir -p /data/{db,epgs,logos,m3us,recordings,uploads}
|
||||
mkdir -p /etc/$APP_NAME
|
||||
cp ~/.$APP_NAME.creds /etc/$APP_NAME/$APP_NAME.env
|
||||
chown -R "$APP_USER:$APP_GROUP" {/etc/$APP_NAME,$APP_DIR,/data}
|
||||
|
||||
|
||||
sed -i 's/program\[\x27channel_id\x27\]/program["channel_id"]/g' "${APP_DIR}/apps/output/views.py"
|
||||
|
||||
msg_ok "Downloaded Dispatcharr $LATEST_VERSION"
|
||||
|
||||
msg_info "Install Python Requirements"
|
||||
cd $APP_DIR
|
||||
python3 -m venv env
|
||||
source env/bin/activate
|
||||
|
||||
$STD pip install --upgrade pip
|
||||
$STD pip install -r requirements.txt
|
||||
$STD pip install gunicorn
|
||||
ln -sf /usr/bin/ffmpeg $APP_DIR/env/bin/ffmpeg
|
||||
msg_ok "Python Requirements Installed"
|
||||
|
||||
msg_info "Building Frontend"
|
||||
cd $APP_DIR/frontend
|
||||
$STD npm install --legacy-peer-deps
|
||||
$STD npm run build
|
||||
msg_ok "Built Frontend"
|
||||
|
||||
msg_info "Running Django Migrations"
|
||||
cd $APP_DIR
|
||||
source env/bin/activate
|
||||
set -o allexport
|
||||
source /etc/$APP_NAME/$APP_NAME.env
|
||||
set +o allexport
|
||||
|
||||
$STD python manage.py migrate --noinput
|
||||
$STD python manage.py collectstatic --noinput
|
||||
msg_ok "Migrations Complete"
|
||||
|
||||
msg_info "Configuring Nginx"
|
||||
cat <<EOF >/etc/nginx/sites-available/dispatcharr.conf
|
||||
server {
|
||||
listen $NGINX_HTTP_PORT;
|
||||
|
||||
location / {
|
||||
include proxy_params;
|
||||
proxy_pass http://127.0.0.1:$GUNICORN_PORT;
|
||||
}
|
||||
|
||||
location /static/ {
|
||||
alias $APP_DIR/static/;
|
||||
}
|
||||
|
||||
location /assets/ {
|
||||
alias $APP_DIR/frontend/dist/assets/;
|
||||
}
|
||||
|
||||
location /media/ {
|
||||
alias $APP_DIR/media/;
|
||||
}
|
||||
|
||||
location /ws/ {
|
||||
proxy_pass http://127.0.0.1:$WEBSOCKET_PORT;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host \$host;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
ln -sf /etc/nginx/sites-available/dispatcharr.conf /etc/nginx/sites-enabled/dispatcharr.conf
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
nginx -t
|
||||
systemctl restart nginx
|
||||
systemctl enable nginx
|
||||
msg_ok "Configured Nginx"
|
||||
|
||||
msg_info "Creating systemd services"
|
||||
|
||||
cat <<EOF >/etc/systemd/system/dispatcharr.service
|
||||
[Unit]
|
||||
Description=Gunicorn for Dispatcharr
|
||||
After=network.target postgresql.service redis-server.service
|
||||
|
||||
[Service]
|
||||
User=$APP_USER
|
||||
Group=$APP_GROUP
|
||||
WorkingDirectory=$APP_DIR
|
||||
RuntimeDirectory=$GUNICORN_RUNTIME_DIR
|
||||
RuntimeDirectoryMode=0775
|
||||
Environment="PATH=$APP_DIR/env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
|
||||
EnvironmentFile=/etc/$APP_NAME/$APP_NAME.env
|
||||
ExecStart=$APP_DIR/env/bin/gunicorn \\
|
||||
--workers=4 \\
|
||||
--worker-class=gevent \\
|
||||
--timeout=300 \\
|
||||
--bind 0.0.0.0:$GUNICORN_PORT \
|
||||
dispatcharr.wsgi:application
|
||||
Restart=always
|
||||
KillMode=mixed
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/systemd/system/dispatcharr-celery.service
|
||||
[Unit]
|
||||
Description=Celery Worker for Dispatcharr
|
||||
After=network.target redis-server.service
|
||||
Requires=dispatcharr.service
|
||||
|
||||
[Service]
|
||||
User=$APP_USER
|
||||
Group=$APP_GROUP
|
||||
WorkingDirectory=$APP_DIR
|
||||
Environment="PATH=$APP_DIR/env/bin"
|
||||
EnvironmentFile=/etc/$APP_NAME/$APP_NAME.env
|
||||
Environment="CELERY_BROKER_URL=redis://localhost:6379/0"
|
||||
ExecStart=$APP_DIR/env/bin/celery -A dispatcharr worker -l info -c 4
|
||||
Restart=always
|
||||
KillMode=mixed
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/systemd/system/dispatcharr-celerybeat.service
|
||||
[Unit]
|
||||
Description=Celery Beat Scheduler for Dispatcharr
|
||||
After=network.target redis-server.service
|
||||
Requires=dispatcharr.service
|
||||
|
||||
[Service]
|
||||
User=$APP_USER
|
||||
Group=$APP_GROUP
|
||||
WorkingDirectory=$APP_DIR
|
||||
Environment="PATH=$APP_DIR/env/bin"
|
||||
EnvironmentFile=/etc/$APP_NAME/$APP_NAME.env
|
||||
Environment="CELERY_BROKER_URL=redis://localhost:6379/0"
|
||||
ExecStart=$APP_DIR/env/bin/celery -A dispatcharr beat -l info
|
||||
Restart=always
|
||||
KillMode=mixed
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/systemd/system/dispatcharr-daphne.service
|
||||
[Unit]
|
||||
Description=Daphne for Dispatcharr (ASGI)
|
||||
After=network.target
|
||||
Requires=dispatcharr.service
|
||||
|
||||
[Service]
|
||||
User=$APP_USER
|
||||
Group=$APP_GROUP
|
||||
WorkingDirectory=$APP_DIR
|
||||
Environment="PATH=$APP_DIR/env/bin"
|
||||
EnvironmentFile=/etc/$APP_NAME/$APP_NAME.env
|
||||
ExecStart=$APP_DIR/env/bin/daphne -b 0.0.0.0 -p $WEBSOCKET_PORT dispatcharr.asgi:application
|
||||
Restart=always
|
||||
KillMode=mixed
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
msg_ok "Created systemd services"
|
||||
|
||||
|
||||
msg_info "Starting Dispatcharr Services"
|
||||
systemctl daemon-reexec
|
||||
systemctl daemon-reload
|
||||
systemctl enable dispatcharr dispatcharr-celery dispatcharr-celerybeat dispatcharr-daphne
|
||||
systemctl restart dispatcharr dispatcharr-celery dispatcharr-celerybeat dispatcharr-daphne
|
||||
msg_ok "Started Dispatcharr Services"
|
||||
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
111
install/freepbx-install.sh
Normal file
111
install/freepbx-install.sh
Normal file
@ -0,0 +1,111 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Arian Nasr (arian-nasr)
|
||||
# Updated by: Javier Pastor (vsc55)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://www.freepbx.org/
|
||||
|
||||
INSTALL_URL="https://github.com/FreePBX/sng_freepbx_debian_install/raw/master/sng_freepbx_debian_install.sh"
|
||||
INSTALL_PATH="/opt/sng_freepbx_debian_install.sh"
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
ONLY_OPENSOURCE="${ONLY_OPENSOURCE:-no}"
|
||||
REMOVE_FIREWALL="${REMOVE_FIREWALL:-no}"
|
||||
msg_ok "Remove Commercial modules is set to: $ONLY_OPENSOURCE"
|
||||
msg_ok "Remove Firewall module is set to: $REMOVE_FIREWALL"
|
||||
|
||||
msg_info "Downloading FreePBX installation script..."
|
||||
if curl -fsSL "$INSTALL_URL" -o "$INSTALL_PATH"; then
|
||||
msg_ok "Download completed successfully"
|
||||
else
|
||||
curl_exit_code=$?
|
||||
msg_error "Error downloading FreePBX installation script (curl exit code: $curl_exit_code)"
|
||||
msg_error "Aborting!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$VERBOSE" == "yes" ]]; then
|
||||
msg_info "Installing FreePBX (Verbose)\n"
|
||||
else
|
||||
msg_info "Installing FreePBX, be patient, this takes time..."
|
||||
fi
|
||||
$STD bash "$INSTALL_PATH"
|
||||
|
||||
if [[ $ONLY_OPENSOURCE == "yes" ]]; then
|
||||
msg_info "Removing Commercial modules..."
|
||||
|
||||
end_count=0
|
||||
max=5
|
||||
count=0
|
||||
while fwconsole ma list | awk '/Commercial/ {found=1} END {exit !found}'; do
|
||||
count=$((count + 1))
|
||||
while read -r module; do
|
||||
msg_info "Removing module: $module"
|
||||
|
||||
if [[ "$REMOVE_FIREWALL" == "no" ]] && [[ "$module" == "sysadmin" ]]; then
|
||||
msg_warn "Skipping sysadmin module removal, it is required for Firewall!"
|
||||
continue
|
||||
fi
|
||||
|
||||
code=0
|
||||
$STD fwconsole ma -f remove $module || code=$?
|
||||
if [[ $code -ne 0 ]]; then
|
||||
msg_error "Module $module could not be removed - error code $code"
|
||||
else
|
||||
msg_ok "Module $module removed successfully"
|
||||
fi
|
||||
done < <(fwconsole ma list | awk '/Commercial/ {print $2}')
|
||||
|
||||
[[ $count -ge $max ]] && break
|
||||
|
||||
com_list=$(fwconsole ma list)
|
||||
end_count=$(awk '/Commercial/ {count++} END {print count + 0}' <<< "$com_list")
|
||||
awk '/Commercial/ {found=1} END {exit !found}' <<< "$com_list" || break
|
||||
if [[ "$REMOVE_FIREWALL" == "no" ]] && \
|
||||
[[ $end_count -eq 1 ]] && \
|
||||
[[ $(awk '/Commercial/ {print $2}' <<< "$com_list") == "sysadmin" ]]; then
|
||||
break
|
||||
fi
|
||||
|
||||
msg_warn "Not all commercial modules could be removed, retrying (attempt $count of $max)..."
|
||||
done
|
||||
|
||||
if [[ $REMOVE_FIREWALL == "yes" ]] && [[ $end_count -gt 0 ]]; then
|
||||
msg_info "Removing Firewall module..."
|
||||
if $STD fwconsole ma -f remove firewall; then
|
||||
msg_ok "Firewall module removed successfully"
|
||||
else
|
||||
msg_error "Firewall module could not be removed, please check manually!"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $end_count -eq 0 ]]; then
|
||||
msg_ok "All commercial modules removed successfully"
|
||||
elif [[ $end_count -eq 1 ]] && [[ $REMOVE_FIREWALL == "no" ]] && [[ $(fwconsole ma list | awk '/Commercial/ {print $2}') == "sysadmin" ]]; then
|
||||
msg_ok "Only sysadmin module left, which is required for Firewall, skipping removal"
|
||||
else
|
||||
msg_warn "Some commercial modules could not be removed, please check the web interface for removal manually!"
|
||||
fi
|
||||
|
||||
msg_info "Reloading FreePBX..."
|
||||
$STD fwconsole reload
|
||||
msg_ok "FreePBX reloaded completely"
|
||||
fi
|
||||
msg_ok "Installed FreePBX finished"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -f "$INSTALL_PATH"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
Loading…
x
Reference in New Issue
Block a user