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