This commit is contained in:
CanbiZ 2025-11-10 13:06:41 +01:00
parent d3f9c7326e
commit aefeddd9d4

View File

@ -29,22 +29,23 @@ msg_ok "Installed Dependencies"
PHP_VERSION="8.4" PHP_APACHE="YES" PHP_FPM="YES" PHP_MODULE="mysql" setup_php PHP_VERSION="8.4" PHP_APACHE="YES" PHP_FPM="YES" PHP_MODULE="mysql" setup_php
setup_composer setup_composer
setup_mariadb setup_mariadb
DB_NAME="domain_monitor" DB_USER="domainmonitor" setup_mariadb_db
fetch_and_deploy_gh_release "domain-monitor" "Hosteroid/domain-monitor" "prebuild" "latest" "/opt/domain-monitor" "domain-monitor-v*.zip" fetch_and_deploy_gh_release "domain-monitor" "Hosteroid/domain-monitor" "prebuild" "latest" "/opt/domain-monitor" "domain-monitor-v*.zip"
msg_info "Configuring Database" # msg_info "Configuring Database"
DB_NAME=domain_monitor # DB_NAME=domain_monitor
DB_USER=domainmonitor # DB_USER=domainmonitor
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) # DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
$STD mariadb -u root -e "CREATE DATABASE $DB_NAME CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" # $STD mariadb -u root -e "CREATE DATABASE $DB_NAME CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" # $STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" # $STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
{ # {
echo "Domain Monitor Credentials" # echo "Domain Monitor Credentials"
echo "Database User: $DB_USER" # echo "Database User: $DB_USER"
echo "Database Password: $DB_PASS" # echo "Database Password: $DB_PASS"
echo "Database Name: $DB_NAME" # echo "Database Name: $DB_NAME"
} >>~/domain-monitor.creds # } >>~/domain-monitor.creds
msg_ok "Configured Database" # msg_ok "Configured Database"
msg_info "Setting up Domain Monitor" msg_info "Setting up Domain Monitor"
ENC_KEY=$(openssl rand -base64 48 | tr -dc 'A-Za-z0-9' | head -c 32) ENC_KEY=$(openssl rand -base64 48 | tr -dc 'A-Za-z0-9' | head -c 32)