PosgreSQL is removed from automated install and marked as beta.
This commit is contained in:
Pinga 2024-02-20 11:14:16 +02:00
parent c8300c3bec
commit d437635fef
2 changed files with 21 additions and 21 deletions

View file

@ -111,7 +111,7 @@ systemctl restart php8.2-fpm
## 2. Database installation (please choose one): ## 2. Database installation (please choose one):
### 2a. Install and configure MariaDB: ### 2a. Install and configure MariaDB: (please use this for v1.0)
```bash ```bash
curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp' curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp'
@ -140,7 +140,7 @@ mysql_secure_installation
[Tune your MariaDB](https://github.com/major/MySQLTuner-perl) [Tune your MariaDB](https://github.com/major/MySQLTuner-perl)
### 2b. Install and configure PostgreSQL: ### 2b. Install and configure PostgreSQL: (beta!)
```bash ```bash
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

View file

@ -37,7 +37,7 @@ if [[ ("$OS" == "Ubuntu" && "$VER" == "22.04") || ("$OS" == "Debian GNU/Linux" &
YOUR_IPV4_ADDRESS=$(prompt_for_input "Enter your IPv4 address") YOUR_IPV4_ADDRESS=$(prompt_for_input "Enter your IPv4 address")
YOUR_IPV6_ADDRESS=$(prompt_for_input "Enter your IPv6 address (leave blank if not available)") YOUR_IPV6_ADDRESS=$(prompt_for_input "Enter your IPv6 address (leave blank if not available)")
YOUR_EMAIL=$(prompt_for_input "Enter your email for TLS") YOUR_EMAIL=$(prompt_for_input "Enter your email for TLS")
DB_TYPE=$(prompt_for_input "Enter preferred database type (MariaDB/PostgreSQL)") #DB_TYPE=$(prompt_for_input "Enter preferred database type (MariaDB/PostgreSQL)")
DB_USER=$(prompt_for_input "Enter database user") DB_USER=$(prompt_for_input "Enter database user")
DB_PASSWORD=$(prompt_for_password "Enter database password") DB_PASSWORD=$(prompt_for_password "Enter database password")
echo "" # Add a newline after the password input echo "" # Add a newline after the password input
@ -103,7 +103,7 @@ if [[ ("$OS" == "Ubuntu" && "$VER" == "22.04") || ("$OS" == "Debian GNU/Linux" &
systemctl restart php8.2-fpm systemctl restart php8.2-fpm
echo "PHP configuration update complete!" echo "PHP configuration update complete!"
if [ "$DB_TYPE" == "MariaDB" ]; then #if [ "$DB_TYPE" == "MariaDB" ]; then
echo "Setting up MariaDB..." echo "Setting up MariaDB..."
curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp' curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp'
@ -153,24 +153,24 @@ EOF
mysql -u root -e "GRANT ALL PRIVILEGES ON registryAudit.* TO '$DB_USER'@'localhost';" mysql -u root -e "GRANT ALL PRIVILEGES ON registryAudit.* TO '$DB_USER'@'localhost';"
mysql -u root -e "FLUSH PRIVILEGES;" mysql -u root -e "FLUSH PRIVILEGES;"
elif [ "$DB_TYPE" == "PostgreSQL" ]; then #elif [ "$DB_TYPE" == "PostgreSQL" ]; then
echo "Setting up PostgreSQL..." # echo "Setting up PostgreSQL..."
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' # sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null # wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null
apt update # apt update
apt install -y postgresql postgresql-client php8.2-pgsql # apt install -y postgresql postgresql-client php8.2-pgsql
psql --version # psql --version
echo "Configuring PostgreSQL..." # echo "Configuring PostgreSQL..."
sudo -u postgres psql -c "ALTER USER postgres PASSWORD '$DB_PASSWORD';" # sudo -u postgres psql -c "ALTER USER postgres PASSWORD '$DB_PASSWORD';"
sudo -u postgres psql -c "CREATE DATABASE registry;" # sudo -u postgres psql -c "CREATE DATABASE registry;"
sudo -u postgres psql -c "CREATE DATABASE registryTransaction;" # sudo -u postgres psql -c "CREATE DATABASE registryTransaction;"
sudo -u postgres psql -c "CREATE DATABASE registryAudit;" # sudo -u postgres psql -c "CREATE DATABASE registryAudit;"
echo "Importing SQL files into PostgreSQL..." # echo "Importing SQL files into PostgreSQL..."
sudo -u postgres psql -U postgres -d registry -f /opt/registry/database/registry.postgres.sql # sudo -u postgres psql -U postgres -d registry -f /opt/registry/database/registry.postgres.sql
sudo -u postgres psql -U postgres -d registrytransaction -f /opt/registry/database/registryTransaction.postgres.sql # sudo -u postgres psql -U postgres -d registrytransaction -f /opt/registry/database/registryTransaction.postgres.sql
echo "SQL import completed." # echo "SQL import completed."
fi #fi
mkdir /usr/share/adminer mkdir /usr/share/adminer
wget "http://www.adminer.org/latest.php" -O /usr/share/adminer/latest.php wget "http://www.adminer.org/latest.php" -O /usr/share/adminer/latest.php