inital version
Some checks failed
build container icingaweb2 / build (push) Failing after 4s

This commit is contained in:
2025-01-31 22:29:17 +01:00
parent feb978e1f6
commit 09307cc58a
3 changed files with 242 additions and 0 deletions

38
init.sh Normal file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
ICINGAWEB2_FILE_APACHE_DEFAULT=/etc/apache2/sites-available/000-default.conf
ICINGAWEB2_FILE_APACHE_PORTS=/etc/apache2/ports.conf
ICINGAWEB2_PORT=8080
## init icinga config files if need
if [ -z "$(ls -A /data)" ]; then
ICINGAWEB2_CONF_ONCE=false
export INIT_DB=true
## move init files
echo init icingaweb2 config
cp -ax /data-init/* /data
rm -rf /data-init
## enable modules
icingacli module enable icingadb
mkdir -p /etc/icingaweb2/modules/icingadb/
fi
## apache setup
if [ ! -z "$ICINGAWEB2_PORT" ]; then
echo set icingaweb2 apache ports
sed -i "s|^Listen .*|Listen $ICINGAWEB2_PORT|" $ICINGAWEB2_FILE_APACHE_PORTS
sed -i "s|VirtualHost \*:.*>|VirtualHost \*:$ICINGAWEB2_PORT>|g" $ICINGAWEB2_FILE_APACHE_DEFAULT
fi
## edit icingaweb2 config only on first setup or is enabled
if [ ! $ICINGAWEB2_CONF_ONCE ] || [ "$ICINGAWEB2_CONF_ONCE" = false ]; then
/usr/bin/python3 /root/conf_icingaweb2.py
fi
## init apache
. /etc/apache2/envvars
# run CMD
exec "$@"