minor improvements
Updated the installation script to improve PostgreSQL setup and removed redundant credential output method.
This commit is contained in:
parent
809a0c701b
commit
19cd7176dd
|
|
@ -16,7 +16,6 @@ update_os
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt install -y \
|
$STD apt install -y \
|
||||||
build-essential \
|
build-essential \
|
||||||
gcc \
|
|
||||||
nginx \
|
nginx \
|
||||||
redis-server
|
redis-server
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
@ -24,7 +23,7 @@ msg_ok "Installed Dependencies"
|
||||||
NODE_VERSION="24" setup_nodejs
|
NODE_VERSION="24" setup_nodejs
|
||||||
PG_VERSION="17" setup_postgresql
|
PG_VERSION="17" setup_postgresql
|
||||||
|
|
||||||
msg_info "Creating PostgreSQL Database"
|
msg_info "Setup PostgreSQL Database"
|
||||||
DB_NAME=patchmon_db
|
DB_NAME=patchmon_db
|
||||||
DB_USER=patchmon_usr
|
DB_USER=patchmon_usr
|
||||||
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)"
|
||||||
|
|
@ -32,14 +31,13 @@ $STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PAS
|
||||||
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
|
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
|
||||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
|
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
|
||||||
$STD sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME TO $DB_USER;"
|
$STD sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME TO $DB_USER;"
|
||||||
|
{
|
||||||
cat <<EOF >~/patchmon.creds
|
echo "PatchMon Credentials"
|
||||||
PatchMon Credentials
|
echo "PatchMon Database Name: $DB_NAME"
|
||||||
PatchMon Database Name: $DB_NAME
|
echo "PatchMon Database User: $DB_USER"
|
||||||
PatchMon Database User: $DB_USER
|
echo "PatchMon Database Password: $DB_PASS"
|
||||||
PatchMon Database Password: $DB_PASS
|
} >>~/patchmon.creds
|
||||||
EOF
|
msg_ok "Setup PostgreSQL Database"
|
||||||
msg_ok "Created PostgreSQL Database"
|
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "PatchMon" "PatchMon/PatchMon" "tarball" "latest" "/opt/patchmon"
|
fetch_and_deploy_gh_release "PatchMon" "PatchMon/PatchMon" "tarball" "latest" "/opt/patchmon"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user