diff options
author | Daniel Hansson <github@hanssonit.se> | 2020-09-13 02:35:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-13 02:35:28 +0300 |
commit | 8f9ab23c1bf815d8408f3b5afe6613da30f29ef8 (patch) | |
tree | a0023cfea5fc49c66f0e25a8f4d5552d7ff81892 /apps/adminer.sh | |
parent | c9938f76b4da6673c1b8ca85c777c4bb9ddce2c6 (diff) |
add default theme to adminer + other fixes (#1447)
Diffstat (limited to 'apps/adminer.sh')
-rw-r--r-- | apps/adminer.sh | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/apps/adminer.sh b/apps/adminer.sh index 6a59c45f..b2c94db4 100644 --- a/apps/adminer.sh +++ b/apps/adminer.sh @@ -31,16 +31,13 @@ then check_external_ip # Check that the script can see the external IP (apache fails otherwise) a2disconf adminer.conf rm -f $ADMINER_CONF - rm -f $ADMINERDIR/adminer.php + rm -rf $ADMINERDIR check_command apt-get purge adminer -y restart_webserver # Ask for reinstalling reinstall_popup fi -# Warn user about HTTP/2 -http2_warn Adminer - # Inform users print_text_in_color "$ICyan" "Installing and securing Adminer..." @@ -54,22 +51,42 @@ check_distro_version apt update -q4 & spinner_loading install_if_not adminer curl_to_dir "http://www.adminer.org" "latest.php" "$ADMINERDIR" +curl_to_dir "https://raw.githubusercontent.com/Niyko/Hydra-Dark-Theme-for-Adminer/master" "adminer.css" "$ADMINERDIR" ln -s "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php cat << ADMINER_CREATE > "$ADMINER_CONF" -Alias /adminer.php $ADMINERDIR/adminer.php +Listen 8443 -<Directory $ADMINERDIR> +<VirtualHost *:8443> + Header add Strict-Transport-Security: "max-age=15768000;includeSubdomains" + SSLEngine on + +### YOUR SERVER ADDRESS ### +# ServerAdmin admin@example.com +# ServerName adminer.example.com + +### SETTINGS ### + <FilesMatch "\.php$"> + SetHandler "proxy:unix:/run/php/php7.4-fpm.nextcloud.sock|fcgi://localhost" + </FilesMatch> -<IfModule mod_dir.c> -DirectoryIndex adminer.php -</IfModule> -AllowOverride None + DocumentRoot $ADMINERDIR -# Only allow connections from localhost: -Require ip $GATEWAY/24 +<Directory $ADMINERDIR> + <IfModule mod_dir.c> + DirectoryIndex adminer.php + </IfModule> + AllowOverride None + # Only allow connections from localhost: + Require ip $GATEWAY/24 </Directory> + +### LOCATION OF CERT FILES ### + SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem + SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key + +</VirtualHost> ADMINER_CREATE # Enable config @@ -82,7 +99,7 @@ The script will exit." exit 1 else msg_box "Adminer was sucessfully installed and can be reached here: -http://$ADDRESS/adminer.php +https://$ADDRESS/adminer:8443 You can download more plugins and get more information here: https://www.adminer.org |