Compare commits

...

9 Commits

Author SHA1 Message Date
community-scripts-pr-app[bot]
773b2fcc79
Update CHANGELOG.md (#1074)
Some checks are pending
Create Changelog Pull Request / update-changelog-pull-request (push) Waiting to run
Shellcheck / Shellcheck (push) Waiting to run
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-12-28 21:00:35 +01:00
CanbiZ
938f0f76fa
Add Figlet into Repo | Creation of local ASCII Header (#1072)
* Add Figlet into Repo | Creation of local ASCII Header

* update develop > main
2024-12-28 20:59:16 +01:00
CanbiZ
611a14b55f
Add Figlet into repo 2024-12-28 20:53:37 +01:00
community-scripts-pr-app[bot]
304db812a8
Update CHANGELOG.md (#1070)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-12-28 20:48:31 +01:00
CanbiZ
678206768c
Zabbix: Fix SQL Path for 7.2 (#1069) 2024-12-28 20:47:50 +01:00
community-scripts-pr-app[bot]
92d2e421ee
Update CHANGELOG.md (#1066)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-12-28 20:42:56 +01:00
CanbiZ
fe3ff916b6
Add MOTD IP Update (#1067) 2024-12-28 20:37:58 +01:00
Johanna Rührig
d4c95779bf
Added missing port to access url (#1065) 2024-12-28 20:31:25 +01:00
community-scripts-pr-app[bot]
8c0794c2bb
Update CHANGELOG.md (#1056) 2024-12-28 14:58:18 +01:00
5 changed files with 81 additions and 21 deletions

View File

@ -16,6 +16,20 @@ All LXC instances created using this repository come pre-installed with Midnight
> [!IMPORTANT] > [!IMPORTANT]
Do not break established syntax in this file, as it is automatically updated by a Github Workflow 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 ## 2024-12-27
### Changed ### Changed

View File

@ -82,4 +82,4 @@ description
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${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}"

View File

@ -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 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 default_transaction_isolation TO 'read committed';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" $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/^DBName=.*/DBName=$DB_NAME/" /etc/zabbix/zabbix_server.conf
sed -i "s/^DBUser=.*/DBUser=$DB_USER/" /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 sed -i "s/^# DBPassword=.*/DBPassword=$DB_PASS/" /etc/zabbix/zabbix_server.conf

View File

@ -157,30 +157,76 @@ arch_check() {
fi 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. # This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node.
header_info() { header_info() {
if [ -f /etc/debian_version ]; then # Check if figlet is installed
# Debian/Ubuntu if ! command -v figlet &> /dev/null; then
if ! grep -q "^deb http://ftp.debian.org/debian bookworm main contrib" /etc/apt/sources.list; then echo -e "${INFO}${BOLD}${DGN}Figlet for ASCII-Header not found. Installing... ${CL}"
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
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") ascii_art=$(figlet -f slant -w "$term_width" "$APP")
clear clear
cat <<EOF echo "$ascii_art"
$ascii_art
EOF
} }
# This function checks if the script is running through SSH and prompts the user to confirm if they want to proceed or exit. # 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

Binary file not shown.