Merge pull request 'fixed both sh files' (#8) from profilarr-script into dev
Reviewed-on: #8
This commit is contained in:
33
README.md
33
README.md
@ -1,10 +1,3 @@
|
||||
# proxmox-ve-install-scripts
|
||||
|
||||
huntarr:
|
||||
`bash -c "$(curl -fsSL https://git.bila.li/Proxmox/proxmox-ve-install-scripts/raw/branch/dev/ct/huntarr.sh)"`
|
||||
|
||||
# Proxmox VE Install Scripts
|
||||
|
||||
A collection of installation scripts for Proxmox VE containers.
|
||||
|
||||
## Installation Commands
|
||||
@ -17,28 +10,10 @@ Create a new Huntarr LXC container:
|
||||
bash -c "$(curl -fsSL https://git.bila.li/Proxmox/proxmox-ve-install-scripts/raw/branch/dev/ct/huntarr.sh)"
|
||||
```
|
||||
|
||||
Install Huntarr in an existing container:
|
||||
### Profilarr
|
||||
|
||||
Create a new Profilarr LXC container:
|
||||
|
||||
```bash
|
||||
bash -c "$(curl -fsSL https://git.bila.li/Proxmox/proxmox-ve-install-scripts/raw/branch/dev/install/huntarr-install.sh)"
|
||||
bash -c "$(curl -fsSL https://git.bila.li/Proxmox/proxmox-ve-install-scripts/raw/branch/dev/ct/profilarr.sh)"
|
||||
```
|
||||
|
||||
### Custom Options
|
||||
|
||||
You can customize the LXC creation with environment variables:
|
||||
|
||||
```bash
|
||||
var_cpu=4 var_ram=4096 var_disk=16 HUNTARR_VERSION=6.2 bash -c "$(curl -fsSL https://git.bila.li/Proxmox/proxmox-ve-install-scripts/raw/branch/dev/lxc/huntarr.sh)"
|
||||
```
|
||||
|
||||
#### Available Options:
|
||||
|
||||
- var_cpu: Number of CPU cores
|
||||
- var_ram: RAM in MB
|
||||
- var_disk: Disk size in GB
|
||||
- var_os: Operating system (debian, ubuntu)
|
||||
- var_version: OS version (12, 11, 22.04, etc.)
|
||||
- HUNTARR_VERSION: Version of Huntarr to install
|
||||
|
||||
Tag creator:
|
||||
https://patorjk.com/software/taag/#p=display&f=Slant&t=Huntarr
|
||||
|
||||
158
ct/profilarr.sh
158
ct/profilarr.sh
@ -1,104 +1,96 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: GitHub Copilot
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/Dictionarry-Hub/profilarr
|
||||
|
||||
# Import Functions and Setup
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
# App Default Values
|
||||
APP="Profilarr"
|
||||
var_tags="arr;automation"
|
||||
var_cpu="2"
|
||||
var_ram="2048"
|
||||
var_disk="8"
|
||||
var_os="debian"
|
||||
var_version="12"
|
||||
var_unprivileged="1"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
APPLICATION="profilarr"
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
curl \
|
||||
wget \
|
||||
git \
|
||||
unzip \
|
||||
build-essential \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
ca-certificates \
|
||||
gnupg
|
||||
msg_ok "Installed Dependencies"
|
||||
# Check if installation is present
|
||||
if [[ ! -d /opt/${APP}/backend ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Installing Node.js"
|
||||
$STD mkdir -p /etc/apt/keyrings
|
||||
$STD curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
$STD echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y nodejs
|
||||
msg_ok "Installed Node.js"
|
||||
|
||||
msg_info "Setup ${APPLICATION}"
|
||||
# Crawling the new version and checking whether an update is required
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Dictionarry-Hub/profilarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
|
||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||
# Stopping Services
|
||||
msg_info "Stopping $APP"
|
||||
systemctl stop profilarr
|
||||
msg_ok "Stopped $APP"
|
||||
|
||||
# Creating Backup
|
||||
msg_info "Creating Backup"
|
||||
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/${APP} /opt/${APP}_config
|
||||
msg_ok "Backup Created"
|
||||
|
||||
# Execute Update
|
||||
msg_info "Updating $APP to v${RELEASE}"
|
||||
temp_file=$(mktemp)
|
||||
$STD curl -fsSL -o "$temp_file" "https://github.com/Dictionarry-Hub/profilarr/archive/refs/tags/v${RELEASE}.zip"
|
||||
curl -fsSL -o "$temp_file" "https://github.com/Dictionarry-Hub/profilarr/archive/refs/tags/v${RELEASE}.zip"
|
||||
cd /tmp
|
||||
$STD unzip -q "$temp_file"
|
||||
$STD mkdir -p /opt/${APPLICATION}
|
||||
$STD mkdir -p /opt/${APPLICATION}_config
|
||||
$STD mv "profilarr-${RELEASE}/backend" /opt/${APPLICATION}/
|
||||
$STD mv "profilarr-${RELEASE}/frontend" /opt/${APPLICATION}/
|
||||
$STD chown -R root:root /opt/${APPLICATION}
|
||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Setup ${APPLICATION}"
|
||||
unzip -q "$temp_file"
|
||||
rm -rf /opt/${APP}/backend /opt/${APP}/frontend
|
||||
mv "profilarr-${RELEASE}/backend" /opt/${APP}/
|
||||
mv "profilarr-${RELEASE}/frontend" /opt/${APP}/
|
||||
|
||||
msg_info "Setting up Python Virtual Environment"
|
||||
$STD python3 -m venv /opt/${APPLICATION}/venv
|
||||
$STD /opt/${APPLICATION}/venv/bin/pip install --upgrade pip
|
||||
cd /opt/${APPLICATION}/backend
|
||||
$STD /opt/${APPLICATION}/venv/bin/pip install -r requirements.txt
|
||||
$STD /opt/${APPLICATION}/venv/bin/pip install gunicorn
|
||||
msg_ok "Setup Python Environment"
|
||||
# Update Python dependencies
|
||||
cd /opt/${APP}/backend
|
||||
/opt/${APP}/venv/bin/pip install -r requirements.txt
|
||||
|
||||
msg_info "Building Frontend"
|
||||
cd /opt/${APPLICATION}/frontend
|
||||
$STD npm install
|
||||
$STD npm run build
|
||||
$STD mkdir -p /opt/${APPLICATION}/backend/app/static
|
||||
$STD cp -r dist/* /opt/${APPLICATION}/backend/app/static/
|
||||
msg_ok "Built Frontend"
|
||||
# Build frontend
|
||||
cd /opt/${APP}/frontend
|
||||
npm install
|
||||
npm run build
|
||||
cp -r dist/* /opt/${APP}/backend/app/static/
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/${APPLICATION}.service
|
||||
[Unit]
|
||||
Description=Profilarr Profile Manager
|
||||
After=network.target
|
||||
msg_ok "Updated $APP to v${RELEASE}"
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/${APPLICATION}/backend
|
||||
Environment=PATH=/opt/${APPLICATION}/venv/bin
|
||||
Environment=CONFIG_PATH=/opt/${APPLICATION}_config
|
||||
ExecStart=/opt/${APPLICATION}/venv/bin/gunicorn --bind 0.0.0.0:6868 --workers 2 --timeout 120 app.main:create_app()
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
# Starting Services
|
||||
msg_info "Starting $APP"
|
||||
systemctl start profilarr
|
||||
msg_ok "Started $APP"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
$STD systemctl daemon-reload
|
||||
$STD systemctl enable ${APPLICATION}.service
|
||||
$STD systemctl start ${APPLICATION}.service
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
# Cleaning up
|
||||
msg_info "Cleaning Up"
|
||||
rm -f "$temp_file"
|
||||
rm -rf "/tmp/profilarr-${RELEASE}"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
msg_ok "Cleanup Completed"
|
||||
|
||||
# Last Action
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Update Successful"
|
||||
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}:6868${CL}"
|
||||
|
||||
@ -1,96 +1,104 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: GitHub Copilot
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/Dictionarry-Hub/profilarr
|
||||
|
||||
# App Default Values
|
||||
APP="Profilarr"
|
||||
var_tags="arr;automation"
|
||||
var_cpu="2"
|
||||
var_ram="2048"
|
||||
var_disk="8"
|
||||
var_os="debian"
|
||||
var_version="12"
|
||||
var_unprivileged="1"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
# Import Functions and Setup
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
APPLICATION="profilarr"
|
||||
|
||||
# Check if installation is present
|
||||
if [[ ! -d /opt/${APP}/backend ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
curl \
|
||||
wget \
|
||||
git \
|
||||
unzip \
|
||||
build-essential \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
ca-certificates \
|
||||
gnupg
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
# Crawling the new version and checking whether an update is required
|
||||
msg_info "Installing Node.js"
|
||||
$STD mkdir -p /etc/apt/keyrings
|
||||
$STD curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
$STD echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y nodejs
|
||||
msg_ok "Installed Node.js"
|
||||
|
||||
msg_info "Setup ${APPLICATION}"
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Dictionarry-Hub/profilarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
|
||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||
# Stopping Services
|
||||
msg_info "Stopping $APP"
|
||||
systemctl stop profilarr
|
||||
msg_ok "Stopped $APP"
|
||||
|
||||
# Creating Backup
|
||||
msg_info "Creating Backup"
|
||||
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/${APP} /opt/${APP}_config
|
||||
msg_ok "Backup Created"
|
||||
|
||||
# Execute Update
|
||||
msg_info "Updating $APP to v${RELEASE}"
|
||||
temp_file=$(mktemp)
|
||||
curl -fsSL -o "$temp_file" "https://github.com/Dictionarry-Hub/profilarr/archive/refs/tags/v${RELEASE}.zip"
|
||||
$STD curl -fsSL -o "$temp_file" "https://github.com/Dictionarry-Hub/profilarr/archive/refs/tags/v${RELEASE}.zip"
|
||||
cd /tmp
|
||||
unzip -q "$temp_file"
|
||||
rm -rf /opt/${APP}/backend /opt/${APP}/frontend
|
||||
mv "profilarr-${RELEASE}/backend" /opt/${APP}/
|
||||
mv "profilarr-${RELEASE}/frontend" /opt/${APP}/
|
||||
$STD unzip -q "$temp_file"
|
||||
$STD mkdir -p /opt/${APPLICATION}
|
||||
$STD mkdir -p /opt/${APPLICATION}_config
|
||||
$STD mv "profilarr-${RELEASE}/backend" /opt/${APPLICATION}/
|
||||
$STD mv "profilarr-${RELEASE}/frontend" /opt/${APPLICATION}/
|
||||
$STD chown -R root:root /opt/${APPLICATION}
|
||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Setup ${APPLICATION}"
|
||||
|
||||
# Update Python dependencies
|
||||
cd /opt/${APP}/backend
|
||||
/opt/${APP}/venv/bin/pip install -r requirements.txt
|
||||
msg_info "Setting up Python Virtual Environment"
|
||||
$STD python3 -m venv /opt/${APPLICATION}/venv
|
||||
$STD /opt/${APPLICATION}/venv/bin/pip install --upgrade pip
|
||||
cd /opt/${APPLICATION}/backend
|
||||
$STD /opt/${APPLICATION}/venv/bin/pip install -r requirements.txt
|
||||
$STD /opt/${APPLICATION}/venv/bin/pip install gunicorn
|
||||
msg_ok "Setup Python Environment"
|
||||
|
||||
# Build frontend
|
||||
cd /opt/${APP}/frontend
|
||||
npm install
|
||||
npm run build
|
||||
cp -r dist/* /opt/${APP}/backend/app/static/
|
||||
msg_info "Building Frontend"
|
||||
cd /opt/${APPLICATION}/frontend
|
||||
$STD npm install
|
||||
$STD npm run build
|
||||
$STD mkdir -p /opt/${APPLICATION}/backend/app/static
|
||||
$STD cp -r dist/* /opt/${APPLICATION}/backend/app/static/
|
||||
msg_ok "Built Frontend"
|
||||
|
||||
msg_ok "Updated $APP to v${RELEASE}"
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/${APPLICATION}.service
|
||||
[Unit]
|
||||
Description=Profilarr Profile Manager
|
||||
After=network.target
|
||||
|
||||
# Starting Services
|
||||
msg_info "Starting $APP"
|
||||
systemctl start profilarr
|
||||
msg_ok "Started $APP"
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/${APPLICATION}/backend
|
||||
Environment=PATH=/opt/${APPLICATION}/venv/bin
|
||||
Environment=CONFIG_PATH=/opt/${APPLICATION}_config
|
||||
ExecStart=/opt/${APPLICATION}/venv/bin/gunicorn --bind 0.0.0.0:6868 --workers 2 --timeout 120 app.main:create_app()
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
# Cleaning up
|
||||
msg_info "Cleaning Up"
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
$STD systemctl daemon-reload
|
||||
$STD systemctl enable ${APPLICATION}.service
|
||||
$STD systemctl start ${APPLICATION}.service
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -f "$temp_file"
|
||||
rm -rf "/tmp/profilarr-${RELEASE}"
|
||||
msg_ok "Cleanup Completed"
|
||||
|
||||
# Last Action
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Update Successful"
|
||||
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}:6868${CL}"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
|
||||
Reference in New Issue
Block a user