Skip to content
Merged
Changes from 2 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"
<?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