Big NodeJS Update: Use Helper Function on all Install-Scripts (#4744)

* Big NodeJS Update: Use Helper Function on all Install-Scripts

* add jq in node_function

* add more
This commit is contained in:
CanbiZ 2025-05-27 13:48:34 +02:00 committed by GitHub
parent e6805db9f5
commit 72db97b226
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
58 changed files with 148 additions and 791 deletions

View file

@ -24,25 +24,11 @@ $STD apt-get install -y \
python3-pip
msg_ok "Installed Dependencies"
msg_info "Setting up Node.js Repository"
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
msg_ok "Set up Node.js Repository"
msg_info "Setting up PostgreSQL Repository"
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
echo "deb https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" >/etc/apt/sources.list.d/pgdg.list
msg_ok "Set up PostgreSQL Repository"
msg_info "Installing Node.js"
$STD apt-get update
$STD apt-get install -y nodejs
$STD npm install -g pnpm
msg_ok "Installed Node.js"
NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules
PG_VERSION="16" install_postgresql
msg_info "Install/Set up PostgreSQL Database"
$STD apt-get install -y postgresql-16 postgresql-16-postgis
$STD apt-get install -y postgresql-16-postgis
DB_NAME="adventurelog_db"
DB_USER="adventurelog_user"
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"