merge PostgreSQL to tools.func Installer (#4752)

* Update tools.func

* Merge PostgreSQL to tools.func Installer
This commit is contained in:
CanbiZ 2025-05-27 15:28:05 +02:00 committed by GitHub
parent 8708980786
commit 58586cbfc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 23 additions and 33 deletions

View file

@ -13,19 +13,7 @@ setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y gnupg
msg_ok "Installed Dependencies"
msg_info "Setting up PostgreSQL Repository"
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
echo "deb http://apt.postgresql.org/pub/repos/apt ${VERSION}-pgdg main" >/etc/apt/sources.list.d/pgdg.list
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor --output /etc/apt/trusted.gpg.d/postgresql.gpg
msg_ok "Setup PostgreSQL Repository"
msg_info "Installing PostgreSQL"
$STD apt-get update
$STD apt-get install -y postgresql
PG_VERSION="17" install_postgresql
cat <<EOF >/etc/postgresql/17/main/pg_hba.conf
# PostgreSQL Client Authentication Configuration File
@ -127,7 +115,7 @@ default_text_search_config = 'pg_catalog.english'
include_dir = 'conf.d'
EOF
sudo systemctl restart postgresql
systemctl restart postgresql
msg_ok "Installed PostgreSQL"
read -r -p "${TAB3}Would you like to add Adminer? <y/N> " prompt