mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-12-21 14:36:25 +01:00
Compare commits
1 Commits
refactor-c
...
fix-zabbix
| Author | SHA1 | Date | |
|---|---|---|---|
| 2211561872 |
@ -5,15 +5,14 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
|
|||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Source: https://https://cosmos-cloud.io/
|
# Source: https://https://cosmos-cloud.io/
|
||||||
|
|
||||||
APP="Cosmos"
|
APP="cosmos"
|
||||||
var_tags="${var_tags:-cloud;docker}"
|
var_tags="${var_tags:-os,docker}"
|
||||||
var_cpu="${var_cpu:-2}"
|
var_cpu="${var_cpu:-2}"
|
||||||
var_ram="${var_ram:-2048}"
|
var_ram="${var_ram:-2048}"
|
||||||
var_disk="${var_disk:-8}"
|
var_disk="${var_disk:-8}"
|
||||||
var_os="${var_os:-debian}"
|
var_os="${var_os:-debian}"
|
||||||
var_version="${var_version:-13}"
|
var_version="${var_version:-12}"
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
var_fuse="${var_fuse:-yes}"
|
|
||||||
|
|
||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
variables
|
variables
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
"ram": 2048,
|
"ram": 2048,
|
||||||
"hdd": 8,
|
"hdd": 8,
|
||||||
"os": "debian",
|
"os": "debian",
|
||||||
"version": "13"
|
"version": "12"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -36,10 +36,6 @@
|
|||||||
{
|
{
|
||||||
"type": "info",
|
"type": "info",
|
||||||
"text": "The file `/etc/sysconfig/CosmosCloud` is optional. If you need custom settings, you can create it yourself."
|
"text": "The file `/etc/sysconfig/CosmosCloud` is optional. If you need custom settings, you can create it yourself."
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "warning",
|
|
||||||
"text": "Requires FUSE support for mergerfs functionality. FUSE is enabled by default during installation."
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,23 +14,38 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt install -y \
|
$STD apt-get install -y \
|
||||||
ca-certificates \
|
|
||||||
openssl \
|
|
||||||
snapraid \
|
snapraid \
|
||||||
avahi-daemon \
|
avahi-daemon \
|
||||||
fdisk \
|
fdisk
|
||||||
mergerfs \
|
|
||||||
unzip
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
setup_docker
|
msg_info "Install mergerfs"
|
||||||
fetch_and_deploy_gh_release "cosmos" "azukaar/Cosmos-Server" "prebuild" "latest" "/opt/cosmos" "cosmos-cloud-*-amd64.zip"
|
MERGERFS_VERSION="2.40.2"
|
||||||
|
curl -fsSL "https://github.com/trapexit/mergerfs/releases/download/${MERGERFS_VERSION}/mergerfs_${MERGERFS_VERSION}.debian-bullseye_amd64.deb" -o "mergerfs_${MERGERFS_VERSION}.debian-bullseye_amd64.deb"
|
||||||
|
$STD dpkg -i "mergerfs_${MERGERFS_VERSION}.debian-bullseye_amd64.deb" || $STD apt-get install -f -y
|
||||||
|
rm "mergerfs_${MERGERFS_VERSION}.debian-bullseye_amd64.deb"
|
||||||
|
msg_ok "Installed mergerfs"
|
||||||
|
|
||||||
msg_info "Setting up Cosmos"
|
msg_info "Install Docker"
|
||||||
|
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||||
|
$STD sh get-docker.sh
|
||||||
|
rm get-docker.sh
|
||||||
|
msg_ok "Installed Docker"
|
||||||
|
|
||||||
|
msg_info "Install Cosmos"
|
||||||
|
mkdir -p /opt/cosmos
|
||||||
|
LATEST_RELEASE=$(curl -fsSL https://api.github.com/repos/azukaar/Cosmos-Server/releases/latest | grep "tag_name" | cut -d '"' -f 4)
|
||||||
|
ZIP_FILE="cosmos-cloud-${LATEST_RELEASE#v}-amd64.zip"
|
||||||
|
curl -fsSL "https://github.com/azukaar/Cosmos-Server/releases/download/${LATEST_RELEASE}/${ZIP_FILE}" -o "/opt/cosmos/${ZIP_FILE}"
|
||||||
cd /opt/cosmos
|
cd /opt/cosmos
|
||||||
|
$STD unzip -o -q "${ZIP_FILE}"
|
||||||
|
LATEST_RELEASE_NO_V=${LATEST_RELEASE#v}
|
||||||
|
mv /opt/cosmos/cosmos-cloud-${LATEST_RELEASE_NO_V}/* /opt/cosmos/
|
||||||
|
rmdir /opt/cosmos/cosmos-cloud-${LATEST_RELEASE_NO_V}
|
||||||
chmod +x /opt/cosmos/cosmos
|
chmod +x /opt/cosmos/cosmos
|
||||||
msg_ok "Set up Cosmos"
|
rm -f "/opt/cosmos/cosmos-cloud-${LATEST_RELEASE#v}-amd64.zip"
|
||||||
|
msg_ok "Installed Cosmos"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/cosmos.service
|
cat <<EOF >/etc/systemd/system/cosmos.service
|
||||||
|
|||||||
@ -44,7 +44,14 @@ curl -fsSL "$ZABBIX_DEB_URL" -o /tmp/"$ZABBIX_DEB_FILE"
|
|||||||
$STD dpkg -i /tmp/"$ZABBIX_DEB_FILE"
|
$STD dpkg -i /tmp/"$ZABBIX_DEB_FILE"
|
||||||
$STD apt update
|
$STD apt update
|
||||||
$STD apt install -y zabbix-server-pgsql zabbix-frontend-php php8.4-pgsql zabbix-apache-conf zabbix-sql-scripts
|
$STD apt install -y zabbix-server-pgsql zabbix-frontend-php php8.4-pgsql zabbix-apache-conf zabbix-sql-scripts
|
||||||
zcat /usr/share/zabbix/sql-scripts/postgresql/server.sql.gz | sudo -u "$PG_DB_USER" psql "$PG_DB_NAME" &>/dev/null
|
|
||||||
|
if [[ "$ZABBIX_VERSION" == "7.0" ]]; then
|
||||||
|
ZABBIX_SQL="/usr/share/zabbix-sql-scripts/postgresql/server.sql.gz"
|
||||||
|
else
|
||||||
|
ZABBIX_SQL="/usr/share/zabbix/sql-scripts/postgresql/server.sql.gz"
|
||||||
|
fi
|
||||||
|
|
||||||
|
zcat "$ZABBIX_SQL" | sudo -u "$PG_DB_USER" psql "$PG_DB_NAME" &>/dev/null
|
||||||
sed -i "s/^DBName=.*/DBName=$PG_DB_NAME/" /etc/zabbix/zabbix_server.conf
|
sed -i "s/^DBName=.*/DBName=$PG_DB_NAME/" /etc/zabbix/zabbix_server.conf
|
||||||
sed -i "s/^DBUser=.*/DBUser=$PG_DB_USER/" /etc/zabbix/zabbix_server.conf
|
sed -i "s/^DBUser=.*/DBUser=$PG_DB_USER/" /etc/zabbix/zabbix_server.conf
|
||||||
sed -i "s/^# DBPassword=.*/DBPassword=$PG_DB_PASS/" /etc/zabbix/zabbix_server.conf
|
sed -i "s/^# DBPassword=.*/DBPassword=$PG_DB_PASS/" /etc/zabbix/zabbix_server.conf
|
||||||
|
|||||||
Reference in New Issue
Block a user