mirror of
https://github.com/nextcloud/vm.git
synced 2025-10-26 11:27:32 +00:00
update Adminer to AdminerEvo (#2632)
This commit is contained in:
parent
1cced01e6d
commit
bbe98eeeb4
@ -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
|
||||
@ -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
|
||||
|
||||
1
lib.sh
1
lib.sh
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user