mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 10:22:50 +00:00 
			
		
		
		
	merge MariaDB to tools.func Installer (#4753)
* merge MariaDB to tools.func Installer * add more mariadb migrations
This commit is contained in:
		@@ -14,11 +14,8 @@ network_check
 | 
			
		||||
update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
  lsb-release \
 | 
			
		||||
  gpg
 | 
			
		||||
 | 
			
		||||
  lsb-release
 | 
			
		||||
curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /usr/share/keyrings/deb.sury.org-php.gpg
 | 
			
		||||
echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" >/etc/apt/sources.list.d/php.list
 | 
			
		||||
$STD apt-get update
 | 
			
		||||
@@ -26,10 +23,11 @@ $STD apt-get update
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
  nginx \
 | 
			
		||||
  composer \
 | 
			
		||||
  php8.3-{bcmath,common,ctype,curl,fileinfo,fpm,gd,intl,mbstring,mysql,xml,cli} \
 | 
			
		||||
  mariadb-server
 | 
			
		||||
  php8.3-{bcmath,common,ctype,curl,fileinfo,fpm,gd,intl,mbstring,mysql,xml,cli}
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Setting up Database"
 | 
			
		||||
DB_NAME=2fauth_db
 | 
			
		||||
DB_USER=2fauth
 | 
			
		||||
 
 | 
			
		||||
@@ -14,31 +14,32 @@ update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
    build-essential \
 | 
			
		||||
    jq \
 | 
			
		||||
    libcairo2-dev \
 | 
			
		||||
    libturbojpeg0 \
 | 
			
		||||
    libpng-dev \
 | 
			
		||||
    libtool-bin \
 | 
			
		||||
    libossp-uuid-dev \
 | 
			
		||||
    libvncserver-dev \
 | 
			
		||||
    freerdp2-dev \
 | 
			
		||||
    libssh2-1-dev \
 | 
			
		||||
    libtelnet-dev \
 | 
			
		||||
    libwebsockets-dev \
 | 
			
		||||
    libpulse-dev \
 | 
			
		||||
    libvorbis-dev \
 | 
			
		||||
    libwebp-dev \
 | 
			
		||||
    libssl-dev \
 | 
			
		||||
    libpango1.0-dev \
 | 
			
		||||
    libswscale-dev \
 | 
			
		||||
    libavcodec-dev \
 | 
			
		||||
    libavutil-dev \
 | 
			
		||||
    libavformat-dev \
 | 
			
		||||
    mariadb-server \
 | 
			
		||||
    default-jdk
 | 
			
		||||
  build-essential \
 | 
			
		||||
  jq \
 | 
			
		||||
  libcairo2-dev \
 | 
			
		||||
  libturbojpeg0 \
 | 
			
		||||
  libpng-dev \
 | 
			
		||||
  libtool-bin \
 | 
			
		||||
  libossp-uuid-dev \
 | 
			
		||||
  libvncserver-dev \
 | 
			
		||||
  freerdp2-dev \
 | 
			
		||||
  libssh2-1-dev \
 | 
			
		||||
  libtelnet-dev \
 | 
			
		||||
  libwebsockets-dev \
 | 
			
		||||
  libpulse-dev \
 | 
			
		||||
  libvorbis-dev \
 | 
			
		||||
  libwebp-dev \
 | 
			
		||||
  libssl-dev \
 | 
			
		||||
  libpango1.0-dev \
 | 
			
		||||
  libswscale-dev \
 | 
			
		||||
  libavcodec-dev \
 | 
			
		||||
  libavutil-dev \
 | 
			
		||||
  libavformat-dev \
 | 
			
		||||
  default-jdk
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Setup Apache Tomcat"
 | 
			
		||||
RELEASE=$(curl -fsSL https://dlcdn.apache.org/tomcat/tomcat-9/ | grep -oP '(?<=href=")v[^"/]+(?=/")' | sed 's/^v//' | sort -V | tail -n1)
 | 
			
		||||
mkdir -p /opt/apache-guacamole/tomcat9
 | 
			
		||||
@@ -79,19 +80,19 @@ 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 "Guacamole-Credentials"
 | 
			
		||||
    echo "Database User: $DB_USER"
 | 
			
		||||
    echo "Database Password: $DB_PASS"
 | 
			
		||||
    echo "Database Name: $DB_NAME"
 | 
			
		||||
  echo "Guacamole-Credentials"
 | 
			
		||||
  echo "Database User: $DB_USER"
 | 
			
		||||
  echo "Database Password: $DB_PASS"
 | 
			
		||||
  echo "Database Name: $DB_NAME"
 | 
			
		||||
} >>~/guacamole.creds
 | 
			
		||||
cd guacamole-auth-jdbc-1.5.5/mysql/schema
 | 
			
		||||
cat *.sql | mysql -u root ${DB_NAME}
 | 
			
		||||
{
 | 
			
		||||
    echo "mysql-hostname: 127.0.0.1"
 | 
			
		||||
    echo "mysql-port: 3306"
 | 
			
		||||
    echo "mysql-database: $DB_NAME"
 | 
			
		||||
    echo "mysql-username: $DB_USER"
 | 
			
		||||
    echo "mysql-password: $DB_PASS"
 | 
			
		||||
  echo "mysql-hostname: 127.0.0.1"
 | 
			
		||||
  echo "mysql-port: 3306"
 | 
			
		||||
  echo "mysql-database: $DB_NAME"
 | 
			
		||||
  echo "mysql-username: $DB_USER"
 | 
			
		||||
  echo "mysql-password: $DB_PASS"
 | 
			
		||||
 | 
			
		||||
} >>/etc/guacamole/guacamole.properties
 | 
			
		||||
msg_ok "Setup Database"
 | 
			
		||||
 
 | 
			
		||||
@@ -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"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -16,10 +16,11 @@ update_os
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
  php-imap \
 | 
			
		||||
  debconf-utils \
 | 
			
		||||
  mariadb-server
 | 
			
		||||
  debconf-utils
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Setting up Database"
 | 
			
		||||
ROOT_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
 | 
			
		||||
$STD sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$ROOT_PASS'); flush privileges;"
 | 
			
		||||
 
 | 
			
		||||
@@ -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"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -16,10 +16,11 @@ update_os
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
  nginx \
 | 
			
		||||
  mariadb-server \
 | 
			
		||||
  ca-certificates
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Configuring Database"
 | 
			
		||||
DB_NAME=ghost
 | 
			
		||||
DB_USER=ghostuser
 | 
			
		||||
 
 | 
			
		||||
@@ -15,14 +15,15 @@ update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
    git \
 | 
			
		||||
    apache2 \
 | 
			
		||||
    php8.2-{apcu,cli,common,curl,gd,imap,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,zip,redis,bz2,soap} \
 | 
			
		||||
    php-cas \
 | 
			
		||||
    libapache2-mod-php \
 | 
			
		||||
    mariadb-server
 | 
			
		||||
  git \
 | 
			
		||||
  apache2 \
 | 
			
		||||
  php8.2-{apcu,cli,common,curl,gd,imap,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,zip,redis,bz2,soap} \
 | 
			
		||||
  php-cas \
 | 
			
		||||
  libapache2-mod-php
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Setting up database"
 | 
			
		||||
DB_NAME=glpi_db
 | 
			
		||||
DB_USER=glpi
 | 
			
		||||
@@ -33,10 +34,10 @@ 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';"
 | 
			
		||||
mysql -u root -e "GRANT SELECT ON \`mysql\`.\`time_zone_name\` TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
 | 
			
		||||
{
 | 
			
		||||
    echo "GLPI Database Credentials"
 | 
			
		||||
    echo "Database: $DB_NAME"
 | 
			
		||||
    echo "Username: $DB_USER"
 | 
			
		||||
    echo "Password: $DB_PASS"
 | 
			
		||||
  echo "GLPI Database Credentials"
 | 
			
		||||
  echo "Database: $DB_NAME"
 | 
			
		||||
  echo "Username: $DB_USER"
 | 
			
		||||
  echo "Password: $DB_PASS"
 | 
			
		||||
} >>~/glpi_db.creds
 | 
			
		||||
msg_ok "Set up database"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -20,10 +20,11 @@ $STD apt-get install -y \
 | 
			
		||||
  git \
 | 
			
		||||
  expect \
 | 
			
		||||
  composer \
 | 
			
		||||
  mariadb-server \
 | 
			
		||||
  lsb-release
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Adding PHP8.4 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
 | 
			
		||||
 
 | 
			
		||||
@@ -13,11 +13,12 @@ setting_up_container
 | 
			
		||||
network_check
 | 
			
		||||
update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing MariaDB"
 | 
			
		||||
$STD apt-get install -y mariadb-server
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Setup MariaDB"
 | 
			
		||||
sed -i 's/^# *\(port *=.*\)/\1/' /etc/mysql/my.cnf
 | 
			
		||||
sed -i 's/^bind-address/#bind-address/g' /etc/mysql/mariadb.conf.d/50-server.cnf
 | 
			
		||||
msg_ok "Installed MariaDB"
 | 
			
		||||
msg_ok "Setup MariaDB"
 | 
			
		||||
 | 
			
		||||
read -r -p "${TAB3}Would you like to add PhpMyAdmin? <y/N> " prompt
 | 
			
		||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
 | 
			
		||||
 
 | 
			
		||||
@@ -15,13 +15,13 @@ update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
  mariadb-server \
 | 
			
		||||
  apache2 \
 | 
			
		||||
  libapache2-mod-php \
 | 
			
		||||
  php-{bcmath,curl,dom,gd,gmp,iconv,intl,json,mbstring,mysqli,opcache,pdo-mysql,redis,tokenizer,xml,zip} \
 | 
			
		||||
  composer
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules
 | 
			
		||||
 | 
			
		||||
msg_info "Setting up MariaDB"
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -16,12 +16,12 @@ update_os
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
  lsb-release \
 | 
			
		||||
  mariadb-server \
 | 
			
		||||
  mariadb-client \
 | 
			
		||||
  apache2 \
 | 
			
		||||
  composer
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Adding PHP8.4 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
 | 
			
		||||
 
 | 
			
		||||
@@ -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/phpipam/db/SCHEMA.sql
 | 
			
		||||
cp /opt/phpipam/config.dist.php /opt/phpipam/config.php
 | 
			
		||||
sed -i -e "s/\(\$disable_installer = \).*/\1true;/" \
 | 
			
		||||
    -e "s/\(\$db\['user'\] = \).*/\1'$DB_USER';/" \
 | 
			
		||||
    -e "s/\(\$db\['pass'\] = \).*/\1'$DB_PASS';/" \
 | 
			
		||||
    -e "s/\(\$db\['name'\] = \).*/\1'$DB_NAME';/" \
 | 
			
		||||
    /opt/phpipam/config.php
 | 
			
		||||
  -e "s/\(\$db\['user'\] = \).*/\1'$DB_USER';/" \
 | 
			
		||||
  -e "s/\(\$db\['pass'\] = \).*/\1'$DB_PASS';/" \
 | 
			
		||||
  -e "s/\(\$db\['name'\] = \).*/\1'$DB_NAME';/" \
 | 
			
		||||
  /opt/phpipam/config.php
 | 
			
		||||
sed -i '/max_execution_time/s/= .*/= 600/' /etc/php/8.2/apache2/php.ini
 | 
			
		||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
 | 
			
		||||
msg_ok "Installed phpIPAM"
 | 
			
		||||
 
 | 
			
		||||
@@ -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"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -15,12 +15,13 @@ update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
    mariadb-server \
 | 
			
		||||
    apache2 \
 | 
			
		||||
    libapache2-mod-php \
 | 
			
		||||
    php8.2-{pdo,mysql,mbstring,gettext,fileinfo,gd,xml,zip}
 | 
			
		||||
  apache2 \
 | 
			
		||||
  libapache2-mod-php \
 | 
			
		||||
  php8.2-{pdo,mysql,mbstring,gettext,fileinfo,gd,xml,zip}
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Setting up MariaDB"
 | 
			
		||||
DB_NAME=projectsend
 | 
			
		||||
DB_USER=projectsend
 | 
			
		||||
@@ -29,10 +30,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 "projectsend-Credentials"
 | 
			
		||||
    echo "projectsend Database User: $DB_USER"
 | 
			
		||||
    echo "projectsend Database Password: $DB_PASS"
 | 
			
		||||
    echo "projectsend Database Name: $DB_NAME"
 | 
			
		||||
  echo "projectsend-Credentials"
 | 
			
		||||
  echo "projectsend Database User: $DB_USER"
 | 
			
		||||
  echo "projectsend Database Password: $DB_PASS"
 | 
			
		||||
  echo "projectsend Database Name: $DB_NAME"
 | 
			
		||||
} >>~/projectsend.creds
 | 
			
		||||
msg_ok "Set up MariaDB"
 | 
			
		||||
 | 
			
		||||
@@ -47,14 +48,14 @@ chown -R www-data:www-data /opt/projectsend
 | 
			
		||||
chmod -R 775 /opt/projectsend
 | 
			
		||||
chmod 644 /opt/projectsend/includes/sys.config.php
 | 
			
		||||
sed -i -e "s/\(define('DB_NAME', \).*/\1'$DB_NAME');/" \
 | 
			
		||||
    -e "s/\(define('DB_USER', \).*/\1'$DB_USER');/" \
 | 
			
		||||
    -e "s/\(define('DB_PASSWORD', \).*/\1'$DB_PASS');/" \
 | 
			
		||||
    /opt/projectsend/includes/sys.config.php
 | 
			
		||||
  -e "s/\(define('DB_USER', \).*/\1'$DB_USER');/" \
 | 
			
		||||
  -e "s/\(define('DB_PASSWORD', \).*/\1'$DB_PASS');/" \
 | 
			
		||||
  /opt/projectsend/includes/sys.config.php
 | 
			
		||||
sed -i -e "s/^\(memory_limit = \).*/\1 256M/" \
 | 
			
		||||
    -e "s/^\(post_max_size = \).*/\1 256M/" \
 | 
			
		||||
    -e "s/^\(upload_max_filesize = \).*/\1 256M/" \
 | 
			
		||||
    -e "s/^\(max_execution_time = \).*/\1 300/" \
 | 
			
		||||
    /etc/php/8.2/apache2/php.ini
 | 
			
		||||
  -e "s/^\(post_max_size = \).*/\1 256M/" \
 | 
			
		||||
  -e "s/^\(upload_max_filesize = \).*/\1 256M/" \
 | 
			
		||||
  -e "s/^\(max_execution_time = \).*/\1 300/" \
 | 
			
		||||
  /etc/php/8.2/apache2/php.ini
 | 
			
		||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
 | 
			
		||||
msg_ok "Installed projectsend"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,12 +17,12 @@ msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
  lsb-release \
 | 
			
		||||
  redis \
 | 
			
		||||
  mariadb-server \
 | 
			
		||||
  mariadb-client \
 | 
			
		||||
  apache2 \
 | 
			
		||||
  composer
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Adding PHP8.4 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
 | 
			
		||||
 
 | 
			
		||||
@@ -20,6 +20,7 @@ $STD apt-get install -y ca-certificates
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
NODE_VERSION="22" install_node_and_modules
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Installing FFMPEG"
 | 
			
		||||
$STD apt-get install -y ffmpeg
 | 
			
		||||
@@ -41,7 +42,6 @@ sqluser="root"
 | 
			
		||||
sqlpass="root"
 | 
			
		||||
echo "mariadb-server mariadb-server/root_password password $sqlpass" | debconf-set-selections
 | 
			
		||||
echo "mariadb-server mariadb-server/root_password_again password $sqlpass" | debconf-set-selections
 | 
			
		||||
$STD apt-get install -y mariadb-server
 | 
			
		||||
service mysql start
 | 
			
		||||
mysql -u "$sqluser" -p"$sqlpass" -e "source sql/user.sql" || true
 | 
			
		||||
msg_ok "Installed Database"
 | 
			
		||||
 
 | 
			
		||||
@@ -15,13 +15,14 @@ update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
    composer \
 | 
			
		||||
    git \
 | 
			
		||||
    nginx \
 | 
			
		||||
    php8.2-{bcmath,common,ctype,curl,fileinfo,fpm,gd,iconv,intl,mbstring,mysql,soap,xml,xsl,zip,cli} \
 | 
			
		||||
    mariadb-server
 | 
			
		||||
  composer \
 | 
			
		||||
  git \
 | 
			
		||||
  nginx \
 | 
			
		||||
  php8.2-{bcmath,common,ctype,curl,fileinfo,fpm,gd,iconv,intl,mbstring,mysql,soap,xml,xsl,zip,cli}
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Setting up database"
 | 
			
		||||
DB_NAME=snipeit_db
 | 
			
		||||
DB_USER=snipeit
 | 
			
		||||
@@ -30,10 +31,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 "SnipeIT-Credentials"
 | 
			
		||||
    echo "SnipeIT Database User: $DB_USER"
 | 
			
		||||
    echo "SnipeIT Database Password: $DB_PASS"
 | 
			
		||||
    echo "SnipeIT Database Name: $DB_NAME"
 | 
			
		||||
  echo "SnipeIT-Credentials"
 | 
			
		||||
  echo "SnipeIT Database User: $DB_USER"
 | 
			
		||||
  echo "SnipeIT Database Password: $DB_PASS"
 | 
			
		||||
  echo "SnipeIT Database Name: $DB_NAME"
 | 
			
		||||
} >>~/snipeit.creds
 | 
			
		||||
msg_ok "Set up database"
 | 
			
		||||
 | 
			
		||||
@@ -48,9 +49,9 @@ cp .env.example .env
 | 
			
		||||
IPADDRESS=$(hostname -I | awk '{print $1}')
 | 
			
		||||
 | 
			
		||||
sed -i -e "s|^APP_URL=.*|APP_URL=http://$IPADDRESS|" \
 | 
			
		||||
    -e "s|^DB_DATABASE=.*|DB_DATABASE=$DB_NAME|" \
 | 
			
		||||
    -e "s|^DB_USERNAME=.*|DB_USERNAME=$DB_USER|" \
 | 
			
		||||
    -e "s|^DB_PASSWORD=.*|DB_PASSWORD=$DB_PASS|" .env
 | 
			
		||||
  -e "s|^DB_DATABASE=.*|DB_DATABASE=$DB_NAME|" \
 | 
			
		||||
  -e "s|^DB_USERNAME=.*|DB_USERNAME=$DB_USER|" \
 | 
			
		||||
  -e "s|^DB_PASSWORD=.*|DB_PASSWORD=$DB_PASS|" .env
 | 
			
		||||
 | 
			
		||||
chown -R www-data: /opt/snipe-it
 | 
			
		||||
chmod -R 755 /opt/snipe-it
 | 
			
		||||
 
 | 
			
		||||
@@ -15,11 +15,12 @@ update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
    libapache2-mod-php \
 | 
			
		||||
    mariadb-server \
 | 
			
		||||
    php8.2-{curl,mbstring,mysql,xml,zip,gd}
 | 
			
		||||
  libapache2-mod-php \
 | 
			
		||||
  php8.2-{curl,mbstring,mysql,xml,zip,gd}
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Setting up Database"
 | 
			
		||||
DB_NAME=wavelog
 | 
			
		||||
DB_USER=waveloguser
 | 
			
		||||
@@ -28,10 +29,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 "Wavelog-Credentials"
 | 
			
		||||
    echo "Wavelog Database User: $DB_USER"
 | 
			
		||||
    echo "Wavelog Database Password: $DB_PASS"
 | 
			
		||||
    echo "Wavelog Database Name: $DB_NAME"
 | 
			
		||||
  echo "Wavelog-Credentials"
 | 
			
		||||
  echo "Wavelog Database User: $DB_USER"
 | 
			
		||||
  echo "Wavelog Database Password: $DB_PASS"
 | 
			
		||||
  echo "Wavelog Database Name: $DB_NAME"
 | 
			
		||||
} >>~/wavelog.creds
 | 
			
		||||
msg_ok "Set up database"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -15,12 +15,13 @@ update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing Dependencies (Patience)"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
    apache2 \
 | 
			
		||||
    php8.2-{bcmath,common,cli,curl,fpm,gd,snmp,imap,mbstring,mysql,xml,zip} \
 | 
			
		||||
    libapache2-mod-php \
 | 
			
		||||
    mariadb-server
 | 
			
		||||
  apache2 \
 | 
			
		||||
  php8.2-{bcmath,common,cli,curl,fpm,gd,snmp,imap,mbstring,mysql,xml,zip} \
 | 
			
		||||
  libapache2-mod-php
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
install_mariadb
 | 
			
		||||
 | 
			
		||||
msg_info "Setting up Database"
 | 
			
		||||
DB_NAME=wordpress_db
 | 
			
		||||
DB_USER=wordpress
 | 
			
		||||
@@ -29,10 +30,10 @@ $STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
 | 
			
		||||
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
 | 
			
		||||
$STD mysql -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
 | 
			
		||||
{
 | 
			
		||||
    echo "WordPress Credentials"
 | 
			
		||||
    echo "Database User: $DB_USER"
 | 
			
		||||
    echo "Database Password: $DB_PASS"
 | 
			
		||||
    echo "Database Name: $DB_NAME"
 | 
			
		||||
  echo "WordPress Credentials"
 | 
			
		||||
  echo "Database User: $DB_USER"
 | 
			
		||||
  echo "Database Password: $DB_PASS"
 | 
			
		||||
  echo "Database Name: $DB_NAME"
 | 
			
		||||
} >>~/wordpress.creds
 | 
			
		||||
msg_ok "Set up Database"
 | 
			
		||||
 | 
			
		||||
@@ -46,9 +47,9 @@ find . -type d -exec chmod 755 {} \;
 | 
			
		||||
find . -type f -exec chmod 644 {} \;
 | 
			
		||||
mv wp-config-sample.php wp-config.php
 | 
			
		||||
sed -i -e "s|^define( 'DB_NAME', '.*' );|define( 'DB_NAME', '$DB_NAME' );|" \
 | 
			
		||||
    -e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$DB_USER' );|" \
 | 
			
		||||
    -e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$DB_PASS' );|" \
 | 
			
		||||
    /var/www/html/wordpress/wp-config.php
 | 
			
		||||
  -e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$DB_USER' );|" \
 | 
			
		||||
  -e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$DB_PASS' );|" \
 | 
			
		||||
  /var/www/html/wordpress/wp-config.php
 | 
			
		||||
msg_ok "Installed Wordpress"
 | 
			
		||||
 | 
			
		||||
msg_info "Setup Services"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user