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

@ -25,10 +25,9 @@ $STD apt-get install -y \
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules
PG_VERSION="16" install_postgresql PG_VERSION="16" PG_MODULES="postgis" install_postgresql
msg_info "Install/Set up PostgreSQL Database" msg_info "Set up PostgreSQL Database"
$STD apt-get install -y postgresql-16-postgis
DB_NAME="adventurelog_db" DB_NAME="adventurelog_db"
DB_USER="adventurelog_user" DB_USER="adventurelog_user"
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)" DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"

View File

@ -37,7 +37,7 @@ $STD apt-get install -y \
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
setup_uv setup_uv
PG_VERSION="16" install_postgresql PG_VERSION="16" PG_MODULES="contrib" install_postgresql
NODE_VERSION="22" install_node_and_modules NODE_VERSION="22" install_node_and_modules
install_go install_go
@ -61,8 +61,7 @@ cat <<EOF >/etc/GeoIP.conf
EOF EOF
msg_ok "Installed GeoIP" msg_ok "Installed GeoIP"
msg_info "Installing PostgreSQL" msg_info "Setup PostgreSQL Database"
$STD apt-get install -y postgresql-16 postgresql-contrib-16
DB_NAME="authentik" DB_NAME="authentik"
DB_USER="authentik" DB_USER="authentik"
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)" DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"

View File

@ -15,25 +15,26 @@ update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt-get install -y \
postgresql \ apache2 \
apache2 \ libapache2-mod-php \
libapache2-mod-php \ php-{pgsql,dom}
php-{pgsql,dom}
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Setting up PostgreSQL" PG_VERSION="16" install_postgresql
msg_info "Setting up PostgreSQL Database"
DB_NAME=baikal DB_NAME=baikal
DB_USER=baikal DB_USER=baikal
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" $STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER TEMPLATE template0;" $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER TEMPLATE template0;"
{ {
echo "Baikal Credentials" echo "Baikal Credentials"
echo "Baikal Database User: $DB_USER" echo "Baikal Database User: $DB_USER"
echo "Baikal Database Password: $DB_PASS" echo "Baikal Database Password: $DB_PASS"
echo "Baikal Database Name: $DB_NAME" echo "Baikal Database Name: $DB_NAME"
} >>~/baikal.creds } >>~/baikal.creds
msg_ok "Set up PostgreSQL" msg_ok "Set up PostgreSQL Database"
msg_info "Installing Baikal" msg_info "Installing Baikal"
RELEASE=$(curl -fsSL https://api.github.com/repos/sabre-io/Baikal/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') RELEASE=$(curl -fsSL https://api.github.com/repos/sabre-io/Baikal/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')

View File

@ -15,12 +15,13 @@ update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt-get install -y \
postgresql \
apache2 \ apache2 \
php-{curl,dom,json,ctype,pgsql,gmp,mbstring,iconv,zip} \ php-{curl,dom,json,ctype,pgsql,gmp,mbstring,iconv,zip} \
libapache2-mod-php libapache2-mod-php
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
PG_VERSION="16" install_postgresql
msg_info "Setting up PostgreSQL" msg_info "Setting up PostgreSQL"
DB_NAME=freshrss DB_NAME=freshrss
DB_USER=freshrss DB_USER=freshrss

View File

@ -17,7 +17,6 @@ msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt-get install -y \
apache2 \ apache2 \
redis-server \ redis-server \
postgresql \
build-essential \ build-essential \
libxml2-dev \ libxml2-dev \
libxslt1-dev \ libxslt1-dev \
@ -27,6 +26,8 @@ $STD apt-get install -y \
zlib1g-dev zlib1g-dev
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
PG_VERSION="16" install_postgresql
msg_info "Installing Python" msg_info "Installing Python"
$STD apt-get install -y \ $STD apt-get install -y \
python3 \ python3 \

View File

@ -16,7 +16,6 @@ update_os
msg_info "Installing Dependencies (Patience)" msg_info "Installing Dependencies (Patience)"
$STD apt-get install -y \ $STD apt-get install -y \
redis \ redis \
postgresql \
build-essential \ build-essential \
imagemagick \ imagemagick \
fonts-liberation \ fonts-liberation \
@ -37,6 +36,8 @@ $STD apt-get install -y \
libleptonica-dev libleptonica-dev
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
PG_VERSION="16" install_postgresql
msg_info "Setup Python3" msg_info "Setup Python3"
$STD apt-get install -y \ $STD apt-get install -y \
python3 \ python3 \

View File

@ -13,19 +13,7 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Installing Dependencies" PG_VERSION="17" install_postgresql
$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
cat <<EOF >/etc/postgresql/17/main/pg_hba.conf cat <<EOF >/etc/postgresql/17/main/pg_hba.conf
# PostgreSQL Client Authentication Configuration File # PostgreSQL Client Authentication Configuration File
@ -127,7 +115,7 @@ default_text_search_config = 'pg_catalog.english'
include_dir = 'conf.d' include_dir = 'conf.d'
EOF EOF
sudo systemctl restart postgresql systemctl restart postgresql
msg_ok "Installed PostgreSQL" msg_ok "Installed PostgreSQL"
read -r -p "${TAB3}Would you like to add Adminer? <y/N> " prompt read -r -p "${TAB3}Would you like to add Adminer? <y/N> " prompt