Update alpine-postgresql-install.sh
This commit is contained in:
parent
d5a34b9948
commit
afe927269d
@ -36,50 +36,37 @@ sed -i '/^host\s\+all\s\+all\s\+127.0.0.1\/32\s\+md5/ s/.*/host all all 0.0.0.0\
|
|||||||
rc-service postgresql restart
|
rc-service postgresql restart
|
||||||
msg_ok "Configured and Restarted PostgreSQL"
|
msg_ok "Configured and Restarted PostgreSQL"
|
||||||
|
|
||||||
read -p "Do you want to install Adminer with Lighttpd? (y/N): " install_adminer
|
read -r -p "Would you like to install Adminer with lighttpd? <y/N>: " prompt
|
||||||
if [[ "$install_adminer" =~ ^[Yy]$ ]]; then
|
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||||
msg_info "Installing Adminer with Lighttpd"
|
msg_info "Installing Adminer and dependencies"
|
||||||
apk add --no-cache php php-pdo_pgsql php-session php-json php-mbstring lighttpd
|
$STD apk add --no-cache \
|
||||||
msg_ok "Installed Lighttpd and PHP"
|
lighttpd \
|
||||||
|
lighttpd-openrc \
|
||||||
|
php83 \
|
||||||
|
php83-cgi \
|
||||||
|
php83-common \
|
||||||
|
php83-curl \
|
||||||
|
php83-gd \
|
||||||
|
php83-mbstring \
|
||||||
|
php83-mysqli \
|
||||||
|
php83-mysqlnd \
|
||||||
|
php83-openssl \
|
||||||
|
php83-zip \
|
||||||
|
php83-session \
|
||||||
|
jq
|
||||||
|
|
||||||
msg_info "Downloading Adminer"
|
sed -i 's|# *include "mod_fastcgi.conf"|include "mod_fastcgi.conf"|' /etc/lighttpd/lighttpd.conf
|
||||||
mkdir -p /var/www/adminer
|
mkdir -p /var/www/localhost/htdocs
|
||||||
curl -fsSL "https://www.adminer.org/latest.php" -o /var/www/adminer/index.php
|
ADMINER_VERSION=$(curl -fsSL https://api.github.com/repos/vrana/adminer/releases/latest | jq -r '.tag_name' | sed 's/^v//')
|
||||||
chown -R lighttpd:lighttpd /var/www/adminer
|
curl -fsSL "https://github.com/vrana/adminer/releases/download/v${ADMINER_VERSION}/adminer-${ADMINER_VERSION}.php" -o /var/www/localhost/htdocs/adminer.php
|
||||||
msg_ok "Installed Adminer"
|
chown lighttpd:lighttpd /var/www/localhost/htdocs/adminer.php
|
||||||
|
chmod 755 /var/www/localhost/htdocs/adminer.php
|
||||||
|
msg_ok "Adminer Installed"
|
||||||
|
|
||||||
msg_info "Configuring Lighttpd"
|
msg_info "Starting Lighttpd"
|
||||||
echo 'server.modules = (
|
$STD rc-update add lighttpd default
|
||||||
"mod_access",
|
$STD rc-service lighttpd restart
|
||||||
"mod_alias",
|
msg_ok "Lighttpd Started"
|
||||||
"mod_fastcgi"
|
|
||||||
)
|
|
||||||
|
|
||||||
server.document-root = "/var/www/adminer"
|
|
||||||
server.port = 9000
|
|
||||||
server.bind = "0.0.0.0"
|
|
||||||
index-file.names = ("index.php")
|
|
||||||
|
|
||||||
fastcgi.server = ( ".php" => ((
|
|
||||||
"bin-path" => "/usr/bin/php-cgi",
|
|
||||||
"socket" => "/var/run/php-fcgi.sock"
|
|
||||||
)))
|
|
||||||
|
|
||||||
server.dir-listing = "disable"
|
|
||||||
|
|
||||||
accesslog.filename = "/var/log/lighttpd/access.log"
|
|
||||||
server.errorlog = "/var/log/lighttpd/error.log"
|
|
||||||
|
|
||||||
include "modules.conf"' >/etc/lighttpd/lighttpd.conf
|
|
||||||
|
|
||||||
rc-update add lighttpd default
|
|
||||||
msg_ok "Configured Lighttpd"
|
|
||||||
|
|
||||||
msg_info "Starting Lighttpd"
|
|
||||||
service lighttpd start
|
|
||||||
msg_ok "Started Lighttpd (Adminer available on Port 8080)"
|
|
||||||
else
|
|
||||||
msg_ok "Skipped Adminer and Lighttpd installation."
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user