Skip to content

Commit

Permalink
update Adminer to AdminerEvo (#2632)
Browse files Browse the repository at this point in the history
  • Loading branch information
enoch85 committed May 11, 2024
1 parent 1cced01 commit bbe98ee
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
50 changes: 47 additions & 3 deletions apps/adminer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ a2enmod ssl
# Install Adminer
apt-get 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
curl_to_dir "https://download.adminerevo.org/latest/adminer" "adminer-pgsql.zip" "$ADMINERDIR"
install_if_not unzip
# Unzip the latest version
unzip "$ADMINERDIR"/adminer-pgsql.zip -d "$ADMINERDIR"
rm -f "$ADMINERDIR"/adminer-pgsql.zip
# curl_to_dir "https://raw.githubusercontent.com/Niyko/Hydra-Dark-Theme-for-Adminer/master" "adminer.css" "$ADMINERDIR"
ln -s "$ADMINERDIR"/adminer-pgsql.php "$ADMINERDIR"/adminer.php

# Only add TLS 1.3 on Ubuntu later than 22.04
if version 22.04 "$DISTRO" 24.04.10
Expand All @@ -65,6 +69,46 @@ fi
# Get PHP version for the conf file
check_php

# shellcheck disable=2154

# Add ability to add plugins easily
cat << ADMINER_CREATE_PLUGIN > "$ADMINER_CONF_PLUGIN"
<?php
function adminer_object() {
// required to run any plugin
include_once "./plugins/plugin.php";
// autoloader
foreach (glob("plugins/*.php") as $filename) {
include_once "./$filename";
}
// enable extra drivers just by including them
//~ include "./plugins/drivers/simpledb.php";
$plugins = array(
// specify enabled plugins here
new AdminerDumpXml(),
new AdminerTinymce(),
new AdminerFileUpload("data/"),
new AdminerSlugify(),
new AdminerTranslation(),
new AdminerForeignSystem(),
);
/* It is possible to combine customization and plugins:
class AdminerCustomization extends AdminerPlugin {
}
return new AdminerCustomization($plugins);
*/
return new AdminerPlugin($plugins);
}
// include original Adminer or Adminer Editor
include "./adminer.php";
ADMINER_CREATE_PLUGIN

cat << ADMINER_CREATE > "$ADMINER_CONF"
<VirtualHost *:80>
RewriteEngine On
Expand Down
1 change: 1 addition & 0 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ NOTIFY_PUSH_SERVICE_PATH="/etc/systemd/system/notify_push.service"
# Adminer
ADMINERDIR=/usr/share/adminer
ADMINER_CONF="$SITES_AVAILABLE/adminer.conf"
ADMINER_CONF_PLUGIN="$ADMINERDIR/extra_plugins.php"
# Redis
REDIS_CONF=/etc/redis/redis.conf
REDIS_SOCK=/var/run/redis/redis-server.sock
Expand Down

0 comments on commit bbe98ee

Please sign in to comment.