mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 02:12:49 +00:00 
			
		
		
		
	Compare commits
	
		
			12 Commits
		
	
	
		
			2024-12-27
			...
			2024-12-28
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					5f39bb66a5 | ||
| 
						 | 
					773b2fcc79 | ||
| 
						 | 
					938f0f76fa | ||
| 
						 | 
					611a14b55f | ||
| 
						 | 
					304db812a8 | ||
| 
						 | 
					678206768c | ||
| 
						 | 
					92d2e421ee | ||
| 
						 | 
					fe3ff916b6 | ||
| 
						 | 
					d4c95779bf | ||
| 
						 | 
					8c0794c2bb | ||
| 
						 | 
					cdb121a55f | ||
| 
						 | 
					b22d66da1b | 
							
								
								
									
										14
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								CHANGELOG.md
									
									
									
									
									
								
							@@ -16,6 +16,20 @@ All LXC instances created using this repository come pre-installed with Midnight
 | 
			
		||||
> [!IMPORTANT]
 | 
			
		||||
Do not break established syntax in this file, as it is automatically updated by a Github Workflow
 | 
			
		||||
 | 
			
		||||
## 2024-12-28
 | 
			
		||||
 | 
			
		||||
### Changed
 | 
			
		||||
 | 
			
		||||
### 💥 Breaking Changes
 | 
			
		||||
 | 
			
		||||
- Add Figlet into Repo | Creation of local ASCII Header [@MickLesk](https://github.com/MickLesk) ([#1072](https://github.com/community-scripts/ProxmoxVE/pull/1072))
 | 
			
		||||
- Add an IP-Update for MOTD if IP Changed [@MickLesk](https://github.com/MickLesk) ([#1067](https://github.com/community-scripts/ProxmoxVE/pull/1067))
 | 
			
		||||
 | 
			
		||||
### 🚀 Updated Scripts
 | 
			
		||||
 | 
			
		||||
- Zabbix: Fix SQL Path for 7.2 [@MickLesk](https://github.com/MickLesk) ([#1069](https://github.com/community-scripts/ProxmoxVE/pull/1069))
 | 
			
		||||
- Authentik: added missing port to access url [@TheRealVira](https://github.com/TheRealVira) ([#1065](https://github.com/community-scripts/ProxmoxVE/pull/1065))
 | 
			
		||||
 | 
			
		||||
## 2024-12-27
 | 
			
		||||
 | 
			
		||||
### Changed
 | 
			
		||||
 
 | 
			
		||||
@@ -82,4 +82,4 @@ description
 | 
			
		||||
 | 
			
		||||
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}/if/flow/initial-setup/${CL}"
 | 
			
		||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9000/if/flow/initial-setup/${CL}"
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ function update_script() {
 | 
			
		||||
    header_info
 | 
			
		||||
    check_container_storage
 | 
			
		||||
    check_container_resources
 | 
			
		||||
    if [[ ! -f /etc/apt/sources.list.d/mariadb.list ]]; then
 | 
			
		||||
    if [[ ! -d /etc/mysql/mariadb.conf.d ]]; then
 | 
			
		||||
        msg_error "No ${APP} Installation Found!"
 | 
			
		||||
        exit
 | 
			
		||||
    fi
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ function update_script() {
 | 
			
		||||
    cp -R /usr/share/zabbix-* /opt/zabbix-backup/
 | 
			
		||||
    rm -Rf /etc/apt/sources.list.d/zabbix.list
 | 
			
		||||
    cd /tmp
 | 
			
		||||
    wget -q https://repo.zabbix.com/zabbix/7.2/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb
 | 
			
		||||
    wget -q https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb
 | 
			
		||||
    dpkg -i zabbix-release_latest+debian12_all.deb &>/dev/null
 | 
			
		||||
    apt-get update &>/dev/null
 | 
			
		||||
    apt-get install --only-upgrade zabbix-server-pgsql zabbix-frontend-php zabbix-agent2 zabbix-agent2-plugin-* &>/dev/null
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
msg_info "Installing Zabbix"
 | 
			
		||||
cd /tmp
 | 
			
		||||
wget -q https://repo.zabbix.com/zabbix/7.2/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb
 | 
			
		||||
wget -q https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb
 | 
			
		||||
$STD dpkg -i /tmp/zabbix-release_latest+debian12_all.deb
 | 
			
		||||
$STD apt-get update
 | 
			
		||||
$STD apt-get install -y zabbix-server-pgsql zabbix-frontend-php php8.2-pgsql zabbix-apache-conf zabbix-sql-scripts 
 | 
			
		||||
@@ -39,7 +39,7 @@ $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCO
 | 
			
		||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
 | 
			
		||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
 | 
			
		||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
 | 
			
		||||
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u $DB_USER psql $DB_NAME &>/dev/null
 | 
			
		||||
zcat /usr/share/zabbix/sql-scripts/postgresql/server.sql.gz | sudo -u $DB_USER psql $DB_NAME &>/dev/null
 | 
			
		||||
sed -i "s/^DBName=.*/DBName=$DB_NAME/" /etc/zabbix/zabbix_server.conf
 | 
			
		||||
sed -i "s/^DBUser=.*/DBUser=$DB_USER/" /etc/zabbix/zabbix_server.conf
 | 
			
		||||
sed -i "s/^# DBPassword=.*/DBPassword=$DB_PASS/" /etc/zabbix/zabbix_server.conf
 | 
			
		||||
 
 | 
			
		||||
@@ -157,30 +157,76 @@ arch_check() {
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Function to get the current IP address based on the distribution
 | 
			
		||||
get_current_ip() {
 | 
			
		||||
  if [ -f /etc/os-release ]; then
 | 
			
		||||
    # Check for Debian/Ubuntu (uses hostname -I)
 | 
			
		||||
    if grep -qE 'ID=debian|ID=ubuntu' /etc/os-release; then
 | 
			
		||||
      CURRENT_IP=$(hostname -I | awk '{print $1}')
 | 
			
		||||
    # Check for Alpine (uses ip command)
 | 
			
		||||
    elif grep -q 'ID=alpine' /etc/os-release; then
 | 
			
		||||
      CURRENT_IP=$(ip -4 addr show eth0 | awk '/inet / {print $2}' | cut -d/ -f1 | head -n 1)
 | 
			
		||||
    else
 | 
			
		||||
      CURRENT_IP="Unknown"
 | 
			
		||||
    fi
 | 
			
		||||
  fi
 | 
			
		||||
  echo "$CURRENT_IP"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Function to update the IP address in the MOTD file
 | 
			
		||||
update_motd_ip() {
 | 
			
		||||
  MOTD_FILE="/etc/motd"
 | 
			
		||||
  
 | 
			
		||||
  if [ -f "$MOTD_FILE" ]; then
 | 
			
		||||
    # Remove existing IP Address lines to prevent duplication
 | 
			
		||||
    sed -i '/IP Address:/d' "$MOTD_FILE"
 | 
			
		||||
    
 | 
			
		||||
    IP=$(get_current_ip)
 | 
			
		||||
    # Add the new IP address
 | 
			
		||||
    echo -e "${TAB}${NETWORK}${YW} IP Address: ${GN}${IP}${CL}" >> "$MOTD_FILE"
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node.
 | 
			
		||||
header_info() {
 | 
			
		||||
  if [ -f /etc/debian_version ]; then
 | 
			
		||||
    # Debian/Ubuntu
 | 
			
		||||
    if ! grep -q "^deb http://ftp.debian.org/debian bookworm main contrib" /etc/apt/sources.list; then
 | 
			
		||||
      echo "deb http://ftp.debian.org/debian bookworm main contrib" >> /etc/apt/sources.list
 | 
			
		||||
      apt-get update -y &> /dev/null
 | 
			
		||||
    fi
 | 
			
		||||
    apt-get install -y figlet &> /dev/null
 | 
			
		||||
  elif [ -f /etc/alpine-release ]; then
 | 
			
		||||
    # Alpine Linux
 | 
			
		||||
    apk add --no-cache figlet ncurses &> /dev/null
 | 
			
		||||
    export TERM=xterm
 | 
			
		||||
  else
 | 
			
		||||
    echo "Unsupported OS"
 | 
			
		||||
    return 1
 | 
			
		||||
  fi
 | 
			
		||||
  # Check if figlet is installed
 | 
			
		||||
  if ! command -v figlet &> /dev/null; then
 | 
			
		||||
    echo -e "${INFO}${BOLD}${DGN}Figlet for ASCII-Header not found. Installing... ${CL}"
 | 
			
		||||
 | 
			
		||||
  term_width=$(tput cols 2>/dev/null || echo 120)  # Fallback to 120 columns
 | 
			
		||||
    # Install necessary dependencies and figlet
 | 
			
		||||
    if [ -f /etc/debian_version ] || [ -f /etc/lsb-release ]; then
 | 
			
		||||
      apt-get update -y &> /dev/null
 | 
			
		||||
      apt-get install -y tar build-essential &> /dev/null
 | 
			
		||||
    elif [ -f /etc/alpine-release ]; then
 | 
			
		||||
      apk add --no-cache tar build-base &> /dev/null
 | 
			
		||||
      export TERM=xterm
 | 
			
		||||
    else
 | 
			
		||||
      return 1
 | 
			
		||||
    fi
 | 
			
		||||
    temp_dir=$(mktemp -d)
 | 
			
		||||
    curl -sL https://github.com/community-scripts/ProxmoxVE/raw/refs/heads/main/misc/figlet.tar.xz -o "$temp_dir/figlet.tar.xz"
 | 
			
		||||
    mkdir -p /tmp/figlet
 | 
			
		||||
    tar -xf "$temp_dir/figlet.tar.xz" -C /tmp/figlet --strip-components=1
 | 
			
		||||
    cd /tmp/figlet
 | 
			
		||||
    # Run make to compile the figlet binary
 | 
			
		||||
    make >/dev/null
 | 
			
		||||
    # Check if the figlet binary exists
 | 
			
		||||
    if [ -f "figlet" ]; then
 | 
			
		||||
      chmod +x figlet
 | 
			
		||||
      # Move figlet to /usr/local/bin if not already there
 | 
			
		||||
      if [ ! -e /usr/local/bin/figlet ]; then
 | 
			
		||||
        mv figlet /usr/local/bin/
 | 
			
		||||
        mkdir -p /usr/local/share/figlet
 | 
			
		||||
        cp -r /tmp/figlet/fonts/*.flf /usr/local/share/figlet/
 | 
			
		||||
      fi
 | 
			
		||||
      echo -e "${CM}${BOLD}${DGN}Figlet successfully installed. ${CL}"
 | 
			
		||||
    fi
 | 
			
		||||
    rm -rf "$temp_dir"
 | 
			
		||||
  fi
 | 
			
		||||
  term_width=$(tput cols 2>/dev/null || echo 120)
 | 
			
		||||
  ascii_art=$(figlet -f slant -w "$term_width" "$APP")
 | 
			
		||||
  clear
 | 
			
		||||
  cat <<EOF
 | 
			
		||||
$ascii_art
 | 
			
		||||
EOF
 | 
			
		||||
  echo "$ascii_art"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# This function checks if the script is running through SSH and prompts the user to confirm if they want to proceed or exit.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								misc/figlet.tar.xz
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								misc/figlet.tar.xz
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user