Compare commits

...

10 Commits

Author SHA1 Message Date
Thorsten
8a08129d0d
Merge 292a56a892 into f8f166e26f 2025-01-18 21:17:45 +01:00
community-scripts-pr-app[bot]
f8f166e26f
Update CHANGELOG.md (#1577)
Some checks are pending
Auto Update .app-headers / update-app-headers (push) Waiting to run
Shellcheck / Shellcheck (push) Waiting to run
Create Changelog Pull Request / update-changelog-pull-request (push) Waiting to run
Frontend CI/CD / build (push) Waiting to run
Frontend CI/CD / deploy (push) Blocked by required conditions
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-01-18 21:12:13 +01:00
CanbiZ
b97d40bf5a
update 2025-01-18 21:11:26 +01:00
CanbiZ
0e443536cc
update 2025-01-18 21:07:19 +01:00
community-scripts-pr-app[bot]
0b73d9f689
[Github Action] Update CHANGELOG.md (#1573)
* Update CHANGELOG.md

* update

* update

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com>
2025-01-18 20:57:47 +01:00
Egon
5c11b67507
added cifs support in ubuntu2404-vm.sh (#1461)
added cifs to 
case $STORAGE_TYPE in
nfs | dir | cifs)

So VMs can be deployed on cifs shares
2025-01-18 20:54:43 +01:00
CanbiZ
2f20db8a42
breaking change: homeassistant upgrade os and python3 (#1550)
* breaking change: homeassistant upgrade os and python3

* update json to new date and new ressource values
2025-01-18 20:54:11 +01:00
community-scripts-pr-app[bot]
b04dc0261b
Update CHANGELOG.md (#1566)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-01-18 19:14:34 +01:00
Thorsten
292a56a892
Create post-pmg-install.json 2025-01-17 19:56:56 +01:00
Thorsten
6eee7adff6
Create post-pmg-install.sh
Adding Proxmox Mail Gateway Post Installer
2025-01-17 19:51:52 +01:00
8 changed files with 273 additions and 36 deletions

View File

@ -2,6 +2,7 @@
# Community Scripts Contribution Guide
## **Welcome to the communty-scripts Repository!**
📜 These documents outline the essential coding standards for all our scripts and JSON files. Adhering to these standards ensures that our codebase remains consistent, readable, and maintainable. By following these guidelines, we can improve collaboration, reduce errors, and enhance the overall quality of our project.
### Why Coding Standards Matter

View File

@ -23,10 +23,14 @@ Do not break established syntax in this file, as it is automatically updated by
### 💥 Breaking Changes
- **READ GUIDE FIRST** breaking change: Homeassistant-Core upgrade os and python3 [@MickLesk](https://github.com/MickLesk) ([#1550](https://github.com/community-scripts/ProxmoxVE/pull/1550))
- Update Openwrt: Delete lines that do WAN input and forward accept [@chackl1990](https://github.com/chackl1990) ([#1540](https://github.com/community-scripts/ProxmoxVE/pull/1540))
### 🚀 Updated Scripts
- added cifs support in ubuntu2404-vm.sh [@plonxyz](https://github.com/plonxyz) ([#1461](https://github.com/community-scripts/ProxmoxVE/pull/1461))
- Fix linkwarden update [@burgerga](https://github.com/burgerga) ([#1565](https://github.com/community-scripts/ProxmoxVE/pull/1565))
- [jellyseerr] Update nodejs if not up-to-date [@makstech](https://github.com/makstech) ([#1563](https://github.com/community-scripts/ProxmoxVE/pull/1563))
- Update VM Tags [@oOStroudyOo](https://github.com/oOStroudyOo) ([#1562](https://github.com/community-scripts/ProxmoxVE/pull/1562))
- Update apt-cacher-ng.sh: Typo/Missing $ [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#1545](https://github.com/community-scripts/ProxmoxVE/pull/1545))

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: tteck (tteckster) | Co-Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://www.home-assistant.io/
@ -9,10 +9,10 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m
APP="Home Assistant-Core"
var_tags="automation;smarthome"
var_cpu="2"
var_ram="1024"
var_disk="8"
var_ram="2048"
var_disk="10"
var_os="ubuntu"
var_version="24.04"
var_version="24.10"
var_unprivileged="1"
# App Output & Base Settings
@ -26,6 +26,13 @@ catch_errors
function update_script() {
header_info
# OS Check
if ! lsb_release -d | grep -q "Ubuntu 24.10"; then
msg_error "Wrong OS detected. This script only supports Ubuntu 24.10."
msg_error "Read Guide: https://github.com/community-scripts/ProxmoxVE/discussions/1549"
exit 1
fi
check_container_storage
check_container_resources
if [[ ! -d /srv/homeassistant ]]; then
@ -51,17 +58,13 @@ function update_script() {
echo -e "${GN}Updating to Stable Version${CL}"
BR=""
fi
if [[ "$PY" =~ ^python3\.(11|12)\.[0-9]+$ ]]; then
echo -e "⚠️ Home Assistant will soon require Python 3.13.x";
fi
msg_info "Stopping Home Assistant"
systemctl stop homeassistant
msg_ok "Stopped Home Assistant"
msg_info "Updating Home Assistant"
source /srv/homeassistant/bin/activate
uv pip install ${BR}--upgrade homeassistant &>/dev/null
pip install ${BR}--upgrade homeassistant &>/dev/null
msg_ok "Updated Home Assistant"
msg_info "Starting Home Assistant"
@ -75,7 +78,7 @@ function update_script() {
if [ "$UPD" == "2" ]; then
msg_info "Installing Home Assistant Community Store (HACS)"
apt update &>/dev/null
apt install unzip &>/dev/null
apt install -y unzip &>/dev/null
cd .homeassistant
bash <(curl -fsSL https://get.hacs.xyz) &>/dev/null
msg_ok "Installed Home Assistant Community Store (HACS)"
@ -102,16 +105,19 @@ function update_script() {
msg_ok "Installed FileBrowser"
msg_info "Creating Service"
service_path="/etc/systemd/system/filebrowser.service"
echo "[Unit]
cat <<EOF > /etc/systemd/system/filebrowser.service
[Unit]
Description=Filebrowser
After=network-online.target
[Service]
User=root
WorkingDirectory=/root/
ExecStart=/usr/local/bin/filebrowser -r /root/.homeassistant
[Install]
WantedBy=default.target" >$service_path
WantedBy=default.target
EOF
systemctl enable --now -q filebrowser.service
msg_ok "Created Service"

View File

@ -44,34 +44,36 @@ $STD apt-get install -y \
libavfilter-dev \
libmariadb-dev-compat \
libatlas-base-dev \
software-properties-common
software-properties-common \
libmariadb-dev \
pkg-config
msg_ok "Installed Dependencies"
msg_info "Setup Python3"
$STD add-apt-repository -y ppa:deadsnakes/ppa
msg_info "Setup Python3/pip"
$STD apt-get update
$STD rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
$STD apt-get remove --purge -y python3.12 python3.12-dev python3.12-venv
$STD apt-get install -y \
python3.13-* \
python3.13 \
python3-pip \
python3.13-dev \
python3.13-venv
msg_ok "Setup Python3"
msg_info "Installing UV"
$STD pip install uv
msg_ok "Installed UV"
ln -sf /usr/bin/python3.13 /usr/bin/python3
msg_ok "Setup Python3"
msg_info "Setting up Home Assistant-Core environment"
mkdir /srv/homeassistant
cd /srv/homeassistant
uv venv . &>/dev/null
python3 -m venv .
source bin/activate
msg_ok "Created virtual environment with UV"
msg_ok "Created virtual environment"
msg_info "Installing Home Assistant-Core and packages"
$STD uv pip install webrtcvad wheel homeassistant mysqlclient psycopg2-binary isal
msg_info "Installing Home Assistant-Core"
$STD python3 -m pip install webrtcvad wheel homeassistant mysqlclient psycopg2-binary isal
mkdir -p /root/.homeassistant
msg_ok "Installed Home Assistant-Core and required packages"
msg_ok "Installed Home Assistant-Core"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/homeassistant.service

View File

@ -4,7 +4,7 @@
"categories": [
2
],
"date_created": "2024-04-29",
"date_created": "2025-01-17",
"type": "ct",
"updateable": true,
"privileged": false,
@ -19,10 +19,10 @@
"script": "ct/homeassistant-core.sh",
"resources": {
"cpu": 2,
"ram": 1024,
"hdd": 8,
"ram": 2048,
"hdd": 10,
"os": "ubuntu",
"version": "24.04"
"version": "24.10"
}
}
],
@ -40,7 +40,7 @@
"type": "warning"
},
{
"text": "Use Ubuntu 24.04 ONLY",
"text": "Use Ubuntu 24.10 ONLY",
"type": "warning"
},
{

View File

@ -0,0 +1,47 @@
{
"name": "Proxmox Mail Gateway Post Install",
"slug": "post-pmg-install",
"categories": [
1
],
"date_created": "2025-01-17",
"type": "misc",
"updateable": false,
"privileged": false,
"interface_port": null,
"documentation": null,
"website": null,
"logo": "https://raw.githubusercontent.com/home-assistant/brands/master/core_integrations/proxmoxve/icon.png",
"description": "The script will give options to Disable the Enterprise Repo, Add/Correct PMG Sources, Enable the No-Subscription Repo, Add Test Repo, Disable Subscription Nag, Update Proxmox Mail Gateway and Reboot PMG.",
"install_methods": [
{
"type": "default",
"script": "misc/post-pmg-install.sh",
"resources": {
"cpu": null,
"ram": null,
"hdd": null,
"os": null,
"version": null
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"text": "Proxmox Mail Gateway ONLY",
"type": "info"
},
{
"text": "Execute within the Proxmox Mail Gateway Shell",
"type": "info"
},
{
"text": "It is recommended to answer “yes” (y) to all options presented during the process.",
"type": "info"
}
]
}

177
misc/post-pmg-install.sh Normal file
View File

@ -0,0 +1,177 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 tteck | community-scripts ORG
# Author: thost96 (thost96)
# License: MIT
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
header_info() {
clear
cat <<"EOF"
____ __ __ ____ ____ _ ___ _ _ _
| _ \| \/ |/ ___| | _ \ ___ ___| |_ |_ _|_ __ ___| |_ __ _| | |
| |_) | |\/| | | _ | |_) / _ \/ __| __| | || '_ \/ __| __/ _` | | |
| __/| | | | |_| | | __/ (_) \__ \ |_ | || | | \__ \ || (_| | | |
|_| |_| |_|\____| |_| \___/|___/\__| |___|_| |_|___/\__\__,_|_|_|
EOF
}
RD=$(echo "\033[01;31m")
YW=$(echo "\033[33m")
GN=$(echo "\033[1;92m")
CL=$(echo "\033[m")
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
CROSS="${RD}${CL}"
set -euo pipefail
shopt -s inherit_errexit nullglob
msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
msg_error() {
local msg="$1"
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
}
start_routines() {
header_info
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PMG SOURCES" --menu "This will set the correct sources to update and install Proxmox Mail Gateway.\n \nChange to Proxmox Mail Gateway sources?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Changing to Proxmox Mail Gateway Sources"
cat <<EOF >/etc/apt/sources.list
deb http://deb.debian.org/debian ${VERSION} main contrib
deb http://deb.debian.org/debian ${VERSION}-updates main contrib
deb http://security.debian.org/debian-security ${VERSION}-security main contrib
EOF
msg_ok "Changed to Proxmox Mail Gateway Sources"
;;
no)
msg_error "Selected no to Correcting Proxmox Mail Gateway Sources"
;;
esac
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PMG-ENTERPRISE" --menu "The 'pmg-enterprise' repository is only available to users who have purchased a Proxmox Mail Gateway subscription.\n \nDisable 'pmg-enterprise' repository?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Disabling 'pmg-enterprise' repository"
cat <<EOF >/etc/apt/sources.list.d/pmg-enterprise.list
# deb https://enterprise.proxmox.com/debian/pmg ${VERSION} pmg-enterprise
EOF
msg_ok "Disabled 'pmg-enterprise' repository"
;;
no)
msg_error "Selected no to Disabling 'pmg-enterprise' repository"
;;
esac
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PMG-NO-SUBSCRIPTION" --menu "The 'pmg-no-subscription' repository provides access to all of the open-source components of Proxmox Mail Gateway.\n \nEnable 'pmg-no-subscription' repository?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Enabling 'pmg-no-subscription' repository"
cat <<EOF >/etc/apt/sources.list.d/pmg-install-repo.list
deb http://download.proxmox.com/debian/pmg ${VERSION} pmg-no-subscription
EOF
msg_ok "Enabled 'pmg-no-subscription' repository"
;;
no)
msg_error "Selected no to Enabling 'pmg-no-subscription' repository"
;;
esac
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "PMG TEST" --menu "The 'pmgtest' repository can give advanced users access to new features and updates before they are officially released.\n \nAdd (Disabled) 'pmgtest' repository?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Adding 'pmgtest' repository and set disabled"
cat <<EOF >/etc/apt/sources.list.d/pmgtest-for-beta.list
# deb http://download.proxmox.com/debian/pmg ${VERSION} pmgtest
EOF
msg_ok "Added 'pmgtest' repository"
;;
no)
msg_error "Selected no to Adding 'pmgtest' repository"
;;
esac
if [[ ! -f /etc/apt/apt.conf.d/no-nag-script ]]; then
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUBSCRIPTION NAG" --menu "This will disable the nag message reminding you to purchase a subscription every time you log in to the web interface.\n \nDisable subscription nag?" 14 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "Support Subscriptions" "Supporting the software's development team is essential. Check their official website's Support Subscriptions for pricing. Without their dedicated work, we wouldn't have this exceptional software." 10 58
msg_info "Disabling subscription nag"
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data\.status.*{/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" >/etc/apt/apt.conf.d/no-nag-script
apt --reinstall install proxmox-widget-toolkit &>/dev/null
msg_ok "Disabled subscription nag (Delete browser cache)"
;;
no)
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "Support Subscriptions" "Supporting the software's development team is essential. Check their official website's Support Subscriptions for pricing. Without their dedicated work, we wouldn't have this exceptional software." 10 58
msg_error "Selected no to Disabling subscription nag"
;;
esac
fi
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "UPDATE" --menu "\nUpdate Proxmox Mail Gateway now?" 11 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Updating Proxmox Mail Gateway (Patience)"
apt-get update &>/dev/null
apt-get -y dist-upgrade &>/dev/null
msg_ok "Updated Proxmox Mail Gateway"
;;
no)
msg_error "Selected no to Updating Proxmox Mail Gateway"
;;
esac
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "REBOOT" --menu "\nReboot Proxmox Mail Gateway now? (recommended)" 11 58 2 \
"yes" " " \
"no" " " 3>&2 2>&1 1>&3)
case $CHOICE in
yes)
msg_info "Rebooting Proxmox Mail Gateway"
sleep 2
msg_ok "Completed Post Install Routines"
reboot
;;
no)
msg_error "Selected no to Rebooting Proxmox Mail Gateway (Reboot recommended)"
msg_ok "Completed Post Install Routines"
;;
esac
}
header_info
echo -e "\nThis script will Perform Post Install Routines.\n"
while true; do
read -p "Start the Proxmox Mail Gateway Post Install Script (y/n)?" yn
case $yn in
[Yy]*) break ;;
[Nn]*) clear; exit ;;
*) echo "Please answer yes or no." ;;
esac
done
start_routines

View File

@ -370,7 +370,7 @@ msg_ok "Downloaded ${CL}${BL}${FILE}${CL}"
STORAGE_TYPE=$(pvesm status -storage $STORAGE | awk 'NR>1 {print $2}')
case $STORAGE_TYPE in
nfs | dir)
nfs | dir | cifs)
DISK_EXT=".qcow2"
DISK_REF="$VMID/"
DISK_IMPORT="-format qcow2"