Update alpine-postgresql-install.sh
This commit is contained in:
parent
897901b837
commit
47dee1ad5c
@ -54,19 +54,60 @@ chmod +x $service_path
|
|||||||
rc-update add postgresql default
|
rc-update add postgresql default
|
||||||
msg_ok "Created PostgreSQL Service"
|
msg_ok "Created PostgreSQL Service"
|
||||||
|
|
||||||
|
msg_info "Configuring PostgreSQL"
|
||||||
|
cat <<EOF >/var/lib/postgresql/data/pg_hba.conf
|
||||||
|
# PostgreSQL Client Authentication Configuration File
|
||||||
|
local all postgres peer
|
||||||
|
local all all md5
|
||||||
|
host all all 127.0.0.1/32 scram-sha-256
|
||||||
|
host all all 0.0.0.0/24 md5
|
||||||
|
host all all ::1/128 scram-sha-256
|
||||||
|
host all all 0.0.0.0/0 md5
|
||||||
|
local replication all peer
|
||||||
|
host replication all 127.0.0.1/32 scram-sha-256
|
||||||
|
host replication all ::1/128 scram-sha-256
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF >/var/lib/postgresql/data/postgresql.conf
|
||||||
|
data_directory = '/var/lib/postgresql/data'
|
||||||
|
hba_file = '/var/lib/postgresql/data/pg_hba.conf'
|
||||||
|
ident_file = '/var/lib/postgresql/data/pg_ident.conf'
|
||||||
|
external_pid_file = '/var/run/postgresql.pid'
|
||||||
|
listen_addresses = '*'
|
||||||
|
port = 5432
|
||||||
|
max_connections = 100
|
||||||
|
unix_socket_directories = '/var/run/postgresql'
|
||||||
|
ssl = off
|
||||||
|
shared_buffers = 128MB
|
||||||
|
dynamic_shared_memory_type = posix
|
||||||
|
max_wal_size = 1GB
|
||||||
|
min_wal_size = 80MB
|
||||||
|
log_line_prefix = '%m [%p] %q%u@%d '
|
||||||
|
log_timezone = 'Etc/UTC'
|
||||||
|
cluster_name = 'alpine_pg'
|
||||||
|
datestyle = 'iso, mdy'
|
||||||
|
timezone = 'Etc/UTC'
|
||||||
|
lc_messages = 'C'
|
||||||
|
lc_monetary = 'C'
|
||||||
|
lc_numeric = 'C'
|
||||||
|
lc_time = 'C'
|
||||||
|
default_text_search_config = 'pg_catalog.english'
|
||||||
|
include_dir = 'conf.d'
|
||||||
|
EOF
|
||||||
|
msg_ok "Configured PostgreSQL"
|
||||||
|
|
||||||
msg_info "Starting PostgreSQL"
|
msg_info "Starting PostgreSQL"
|
||||||
service postgresql start
|
service postgresql start
|
||||||
msg_ok "Started PostgreSQL"
|
msg_ok "Started PostgreSQL"
|
||||||
|
|
||||||
read -p "Do you want to install Adminer with Lighttpd? (y/N): " install_adminer
|
read -p "Do you want to install Adminer with Lighttpd? (y/N): " install_adminer
|
||||||
if [[ "$install_adminer" =~ ^[Yy]$ ]]; then
|
if [[ "$install_adminer" =~ ^[Yy]$ ]]; then
|
||||||
msg_info "Installing Adminer with Lighttpd"
|
msg_info "Installing Adminer with Lighttpd"
|
||||||
apk add --no-cache lighttpd php php-pdo_pgsql php-session php-json php-mbstring
|
|
||||||
msg_ok "Installed Lighttpd and PHP"
|
msg_ok "Installed Lighttpd and PHP"
|
||||||
|
|
||||||
msg_info "Downloading Adminer"
|
msg_info "Downloading Adminer"
|
||||||
mkdir -p /var/www/adminer
|
mkdir -p /var/www/adminer
|
||||||
curl -L "https://www.adminer.org/latest.php" -o /var/www/adminer/index.php
|
curl -fsSL "https://www.adminer.org/latest.php" -o /var/www/adminer/index.php
|
||||||
chown -R lighttpd:lighttpd /var/www/adminer
|
chown -R lighttpd:lighttpd /var/www/adminer
|
||||||
msg_ok "Installed Adminer"
|
msg_ok "Installed Adminer"
|
||||||
|
|
||||||
@ -92,7 +133,7 @@ server.dir-listing = "disable"
|
|||||||
accesslog.filename = "/var/log/lighttpd/access.log"
|
accesslog.filename = "/var/log/lighttpd/access.log"
|
||||||
server.errorlog = "/var/log/lighttpd/error.log"
|
server.errorlog = "/var/log/lighttpd/error.log"
|
||||||
|
|
||||||
include "modules.conf"' > /etc/lighttpd/lighttpd.conf
|
include "modules.conf"' >/etc/lighttpd/lighttpd.conf
|
||||||
|
|
||||||
rc-update add lighttpd default
|
rc-update add lighttpd default
|
||||||
msg_ok "Configured Lighttpd"
|
msg_ok "Configured Lighttpd"
|
||||||
@ -100,10 +141,9 @@ include "modules.conf"' > /etc/lighttpd/lighttpd.conf
|
|||||||
msg_info "Starting Lighttpd"
|
msg_info "Starting Lighttpd"
|
||||||
service lighttpd start
|
service lighttpd start
|
||||||
msg_ok "Started Lighttpd (Adminer available on Port 8080)"
|
msg_ok "Started Lighttpd (Adminer available on Port 8080)"
|
||||||
else
|
else
|
||||||
msg_ok "Skipped Adminer and Lighttpd installation."
|
msg_ok "Skipped Adminer and Lighttpd installation."
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user