Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Adminer to AdminerEvo #2632

Merged
merged 7 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 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://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"/latest.php "$ADMINERDIR"/adminer.php
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,44 @@ fi
# Get PHP version for the conf file
check_php

# Add ability to add plugins easily
cat << ADMINER_CREATE_PLUGIN > "$ADMINER_CONF_PLUGIN"
enoch85 marked this conversation as resolved.
Show resolved Hide resolved
enoch85 marked this conversation as resolved.
Show resolved Hide resolved
enoch85 marked this conversation as resolved.
Show resolved Hide resolved
enoch85 marked this conversation as resolved.
Show resolved Hide resolved
<?php
function adminer_object() {
// required to run any plugin
include_once "./plugins/plugin.php";

// autoloader
foreach (glob("plugins/*.php") as $filename) {
enoch85 marked this conversation as resolved.
Show resolved Hide resolved
include_once "./$filename";
}

// enable extra drivers just by including them
//~ include "./plugins/drivers/simpledb.php";

$plugins = array(
enoch85 marked this conversation as resolved.
Show resolved Hide resolved
// 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
Loading