From 23a20ec5f5a347cbd0e349a0955b93fceb7a0a6f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 27 May 2025 14:32:01 +0200 Subject: [PATCH] add more mariadb migrations --- install/bookstack-install.sh | 23 ++++++++++++----------- install/firefly-install.sh | 19 ++++++++++--------- install/paymenter-install.sh | 28 ++++++++++++++-------------- install/phpipam-install.sh | 27 ++++++++++++++------------- install/plant-it-install.sh | 16 ++++++++-------- 5 files changed, 58 insertions(+), 55 deletions(-) diff --git a/install/bookstack-install.sh b/install/bookstack-install.sh index 4756a0868..7df4d0e8f 100644 --- a/install/bookstack-install.sh +++ b/install/bookstack-install.sh @@ -15,15 +15,16 @@ update_os msg_info "Installing Dependencies (Patience)" $STD apt-get install -y \ - unzip \ - mariadb-server \ - apache2 \ - php8.2-{mbstring,gd,fpm,curl,intl,ldap,tidy,bz2,mysql,zip,xml} \ - composer \ - libapache2-mod-php \ - make + unzip \ + apache2 \ + php8.2-{mbstring,gd,fpm,curl,intl,ldap,tidy,bz2,mysql,zip,xml} \ + composer \ + libapache2-mod-php \ + make msg_ok "Installed Dependencies" +install_mariadb + msg_info "Setting up Database" DB_NAME=bookstack DB_USER=bookstack @@ -32,10 +33,10 @@ $STD sudo mysql -u root -e "CREATE DATABASE $DB_NAME;" $STD sudo mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');" $STD sudo mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" { - echo "Bookstack-Credentials" - echo "Bookstack Database User: $DB_USER" - echo "Bookstack Database Password: $DB_PASS" - echo "Bookstack Database Name: $DB_NAME" + echo "Bookstack-Credentials" + echo "Bookstack Database User: $DB_USER" + echo "Bookstack Database Password: $DB_PASS" + echo "Bookstack Database Name: $DB_NAME" } >>~/bookstack.creds msg_ok "Set up database" diff --git a/install/firefly-install.sh b/install/firefly-install.sh index ed9f89a33..917e6d0fc 100644 --- a/install/firefly-install.sh +++ b/install/firefly-install.sh @@ -18,13 +18,14 @@ curl -fsSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/p echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ bookworm main" >/etc/apt/sources.list.d/php.list $STD apt-get update $STD apt-get install -y \ - apache2 \ - libapache2-mod-php8.4 \ - php8.4-{bcmath,cli,intl,curl,zip,gd,xml,mbstring,mysql} \ - mariadb-server \ - composer + apache2 \ + libapache2-mod-php8.4 \ + php8.4-{bcmath,cli,intl,curl,zip,gd,xml,mbstring,mysql} \ + composer msg_ok "Installed Dependencies" +install_mariadb + msg_info "Setting up database" DB_NAME=firefly DB_USER=firefly @@ -34,10 +35,10 @@ mysql -u root -e "CREATE DATABASE $DB_NAME;" mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');" mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" { - echo "Firefly-Credentials" - echo "Firefly Database User: $DB_USER" - echo "Firefly Database Password: $DB_PASS" - echo "Firefly Database Name: $DB_NAME" + echo "Firefly-Credentials" + echo "Firefly Database User: $DB_USER" + echo "Firefly Database Password: $DB_PASS" + echo "Firefly Database Name: $DB_NAME" } >>~/firefly.creds msg_ok "Set up database" diff --git a/install/paymenter-install.sh b/install/paymenter-install.sh index d2d17f857..cbde29d51 100644 --- a/install/paymenter-install.sh +++ b/install/paymenter-install.sh @@ -15,16 +15,16 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - git \ - software-properties-common \ - apt-transport-https \ - ca-certificates \ - gnupg2 \ - mariadb-server \ - nginx \ - redis-server + git \ + software-properties-common \ + apt-transport-https \ + ca-certificates \ + nginx \ + redis-server msg_ok "Installed Dependencies" +install_mariadb + msg_info "Adding PHP Repository" $STD curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb $STD dpkg -i /tmp/debsuryorg-archive-keyring.deb @@ -35,8 +35,8 @@ msg_ok "Added PHP Repository" msg_info "Installing PHP" $STD apt-get remove -y php8.2* $STD apt-get install -y \ - php8.3 \ - php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm,redis} + php8.3 \ + php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm,redis} msg_info "Installed PHP" msg_info "Installing Composer" @@ -62,10 +62,10 @@ mysql -u root -e "CREATE DATABASE $DB_NAME;" mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" mysql -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost' WITH GRANT OPTION;" { - echo "Paymenter Database Credentials" - echo "Database: $DB_NAME" - echo "Username: $DB_USER" - echo "Password: $DB_PASS" + echo "Paymenter Database Credentials" + echo "Database: $DB_NAME" + echo "Username: $DB_USER" + echo "Password: $DB_PASS" } >>~/paymenter_db.creds cp .env.example .env $STD composer install --no-dev --optimize-autoloader --no-interaction diff --git a/install/phpipam-install.sh b/install/phpipam-install.sh index 3950ff88d..e6d4b9ad4 100644 --- a/install/phpipam-install.sh +++ b/install/phpipam-install.sh @@ -15,13 +15,14 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - mariadb-server \ - apache2 \ - libapache2-mod-php \ - php8.2 php8.2-{fpm,curl,cli,mysql,gd,intl,imap,apcu,pspell,tidy,xmlrpc,mbstring,gmp,xml,ldap,common,snmp} \ - php-pear + apache2 \ + libapache2-mod-php \ + php8.2 php8.2-{fpm,curl,cli,mysql,gd,intl,imap,apcu,pspell,tidy,xmlrpc,mbstring,gmp,xml,ldap,common,snmp} \ + php-pear msg_ok "Installed Dependencies" +install_mariadb + msg_info "Setting up MariaDB" DB_NAME=phpipam DB_USER=phpipam @@ -30,10 +31,10 @@ $STD mysql -u root -e "CREATE DATABASE $DB_NAME;" $STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');" $STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" { - echo "phpIPAM-Credentials" - echo "phpIPAM Database User: $DB_USER" - echo "phpIPAM Database Password: $DB_PASS" - echo "phpIPAM Database Name: $DB_NAME" + echo "phpIPAM-Credentials" + echo "phpIPAM Database User: $DB_USER" + echo "phpIPAM Database Password: $DB_PASS" + echo "phpIPAM Database Name: $DB_NAME" } >>~/phpipam.creds msg_ok "Set up MariaDB" @@ -45,10 +46,10 @@ unzip -q "phpipam-v${RELEASE}.zip" mysql -u root "${DB_NAME}" /opt/${APPLICATION}_version.txt msg_ok "Installed phpIPAM" diff --git a/install/plant-it-install.sh b/install/plant-it-install.sh index 21fda4fad..87df2c51b 100644 --- a/install/plant-it-install.sh +++ b/install/plant-it-install.sh @@ -15,12 +15,12 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - gnupg2 \ - mariadb-server \ - redis \ - nginx + redis \ + nginx msg_ok "Installed Dependencies" +install_mariadb + msg_info "Setting up Adoptium Repository" mkdir -p /etc/apt/keyrings curl -fsSL "https://packages.adoptium.net/artifactory/api/gpg/key/public" | gpg --dearmor >/etc/apt/trusted.gpg.d/adoptium.gpg @@ -41,10 +41,10 @@ $STD mysql -u root -e "CREATE DATABASE $DB_NAME;" $STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');" $STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" { - echo "Plant-it Credentials" - echo "Plant-it Database User: $DB_USER" - echo "Plant-it Database Password: $DB_PASS" - echo "Plant-it Database Name: $DB_NAME" + echo "Plant-it Credentials" + echo "Plant-it Database User: $DB_USER" + echo "Plant-it Database Password: $DB_PASS" + echo "Plant-it Database Name: $DB_NAME" } >>~/plant-it.creds msg_ok "Set up MariaDB"