Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Please report any issues you can find. Improvements are welcome!
## First look
#### Nextcloud
![alt tag](https://github.com/nextcloud/nextcloud.com/blob/master/assets/img/features/VMwelcome.png)
#### Adminer (Database Administration) *not default*
#### AdminNeo (Database Administration) *not default*
![alt tag](https://i.imgur.com/tiF4chg.png)
#### Webmin (Server Administration GUI) *not default*
![alt tag](https://i.imgur.com/hLkmA1D.png)
Expand Down
82 changes: 47 additions & 35 deletions apps/adminer.sh → apps/adminneo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
true
SCRIPT_NAME="AdminNeo"
SCRIPT_EXPLAINER="AdminNeo is a full-featured database management tool written in PHP.
It's a continuation of Adminer development after AdminerEvo was archived.
It's a continuation of AdminNeo development after the legacy Evo fork was archived.
More info: https://www.adminneo.org"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh
Expand All @@ -19,8 +19,8 @@ debug_mode
# Check if root
root_check

# Check if adminer is already installed
if ! is_this_installed adminer
# Check if adminneo is already installed
if ! is_this_installed adminneo
then
# Ask for installing
install_popup "$SCRIPT_NAME"
Expand All @@ -29,12 +29,24 @@ else
reinstall_remove_menu "$SCRIPT_NAME"
# Removal
check_external_ip # Check that the script can see the external IP (apache fails otherwise)
a2disconf adminer.conf
a2dissite adminer.conf
a2disconf adminneo.conf
a2dissite adminneo.conf
restart_webserver
rm -f $ADMINER_CONF
rm -rf $ADMINERDIR
check_command apt-get purge adminer -y
rm -f $ADMINNEO_CONF
rm -rf $ADMINNEODIR

# Cleanup of legacy Adminer files if they still exist
if [ -f "$LEGACY_ADMINER_CONF" ] || [ -f "$LEGACY_ADMINER_CONF_ENABLED" ] || [ -d "$LEGACY_ADMINERDIR" ]
then
print_text_in_color "$ICyan" "Removing legacy Adminer files..."
a2disconf adminer.conf >/dev/null 2>&1
a2dissite adminer.conf >/dev/null 2>&1
rm -f /etc/apache2/sites-available/adminer.conf
rm -f /etc/apache2/sites-enabled/adminer.conf
rm -rf /usr/share/adminer
fi

check_command apt-get purge adminneo -y
restart_webserver
# Show successful uninstall if applicable
removal_popup "$SCRIPT_NAME"
Expand All @@ -52,38 +64,38 @@ a2enmod headers
a2enmod rewrite
a2enmod ssl

# Install Adminer
# Install AdminNeo
apt-get update -q4 & spinner_loading
install_if_not adminer
install_if_not adminneo

# AdminerEvo project has been archived, switching to AdminNeo (www.adminneo.org)
# The legacy Evo project has been archived, switching to AdminNeo (www.adminneo.org)
# See: https://github.com/adminneo-org/adminneo
print_text_in_color "$ICyan" "Downloading AdminNeo version ${ADMINER_VERSION}..."
if ! curl_to_dir "https://www.adminneo.org/files/${ADMINER_VERSION}/pgsql_en_default/" "adminneo-${ADMINER_VERSION}.php" "$ADMINERDIR"
print_text_in_color "$ICyan" "Downloading AdminNeo version ${ADMINNEO_VERSION}..."
if ! curl_to_dir "https://www.adminneo.org/files/${ADMINNEO_VERSION}/pgsql_en_default/" "adminneo-${ADMINNEO_VERSION}.php" "$ADMINNEODIR"
then
msg_box "Failed to download AdminNeo. The download URL may have changed.

Please report this issue to: $ISSUES

Attempted to download from:
$ADMINER_DOWNLOAD_URL"
$ADMINNEO_DOWNLOAD_URL"
exit 1
fi

# Rename to standard adminer.php name
if [ -f "$ADMINERDIR/adminneo-${ADMINER_VERSION}.php" ]
# Rename to standard adminneo.php name
if [ -f "$ADMINNEODIR/adminneo-${ADMINNEO_VERSION}.php" ]
then
mv "$ADMINERDIR/adminneo-${ADMINER_VERSION}.php" "$ADMINERDIR/adminer.php"
elif [ -f "$ADMINERDIR/adminerneo-${ADMINER_VERSION}-pgsql.php" ]
mv "$ADMINNEODIR/adminneo-${ADMINNEO_VERSION}.php" "$ADMINNEODIR/adminneo.php"
elif [ -f "$ADMINNEODIR/adminerneo-${ADMINNEO_VERSION}-pgsql.php" ]
then
# Fallback for old naming if somehow still exists
mv "$ADMINERDIR/adminerneo-${ADMINER_VERSION}-pgsql.php" "$ADMINERDIR/adminer.php"
mv "$ADMINNEODIR/adminerneo-${ADMINNEO_VERSION}-pgsql.php" "$ADMINNEODIR/adminneo.php"
else
msg_box "Failed to find downloaded AdminNeo file. Please report this to $ISSUES"
exit 1
fi

print_text_in_color "$IGreen" "AdminNeo ${ADMINER_VERSION} successfully downloaded!"
print_text_in_color "$IGreen" "AdminNeo ${ADMINNEO_VERSION} successfully downloaded!"

# Only add TLS 1.3 on Ubuntu later than 22.04
if version 22.04 "$DISTRO" 24.04.10
Expand All @@ -97,7 +109,7 @@ check_php
# shellcheck disable=2154

# Add ability to add plugins easily
cat << ADMINER_CREATE_PLUGIN > "$ADMINER_CONF_PLUGIN"
cat << ADMINNEO_CREATE_PLUGIN > "$ADMINNEO_CONF_PLUGIN"
<?php
function adminer_object() {
// required to run any plugin
Expand Down Expand Up @@ -130,11 +142,11 @@ function adminer_object() {
return new AdminerPlugin($plugins);
}

// include original Adminer or Adminer Editor
include "./adminer.php";
ADMINER_CREATE_PLUGIN
// include the AdminNeo runtime
include "./adminneo.php";
ADMINNEO_CREATE_PLUGIN

cat << ADMINER_CREATE > "$ADMINER_CONF"
cat << ADMINNEO_CREATE > "$ADMINNEO_CONF"
<VirtualHost *:80>
RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1:9443 [R=301,L]
Expand Down Expand Up @@ -164,18 +176,18 @@ Listen 9443

### YOUR SERVER ADDRESS ###
# ServerAdmin admin@example.com
# ServerName adminer.example.com
# ServerName adminneo.example.com

### SETTINGS ###
<FilesMatch "\.php$">
SetHandler "proxy:unix:/run/php/php$PHPVER-fpm.nextcloud.sock|fcgi://localhost"
</FilesMatch>

DocumentRoot $ADMINERDIR
DocumentRoot $ADMINNEODIR

<Directory $ADMINERDIR>
<Directory $ADMINNEODIR>
<IfModule mod_dir.c>
DirectoryIndex adminer.php
DirectoryIndex adminneo.php
</IfModule>
AllowOverride All

Expand All @@ -188,10 +200,10 @@ Listen 9443
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

</VirtualHost>
ADMINER_CREATE
ADMINNEO_CREATE

# Enable config
check_command a2ensite adminer.conf
check_command a2ensite adminneo.conf

if ! restart_webserver
then
Expand All @@ -203,11 +215,11 @@ else
check_command sed -i "s|local all postgres peer|local all postgres md5|g" /etc/postgresql/*/main/pg_hba.conf
restart_webserver

msg_box "Adminer was successfully installed and can be reached here:
msg_box "AdminNeo was successfully installed and can be reached here:
https://$ADDRESS:9443

You can download more plugins and get more information here:
https://www.adminer.org
https://www.adminneo.org

Your PostgreSQL connection information can be found in $NCPATH/config/config.php.
These are the current values:
Expand All @@ -217,6 +229,6 @@ $(grep dbuser $NCPATH/config/config.php)
$(grep dbpassword $NCPATH/config/config.php)
$(grep dbname $NCPATH/config/config.php)

In case you try to access Adminer and get 'Forbidden' you need to change the IP in:
$ADMINER_CONF"
In case you try to access AdminNeo and get 'Forbidden' you need to change the IP in:
$ADMINNEO_CONF"
fi
18 changes: 11 additions & 7 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,14 @@ PHP_MODS_DIR=/etc/php/"$PHPVER"/mods-available
opcache_interned_strings_buffer_value=24
# Notify push
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"
# AdminNeo
ADMINNEODIR=/usr/share/adminneo
ADMINNEO_CONF="$SITES_AVAILABLE/adminneo.conf"
ADMINNEO_CONF_PLUGIN="$ADMINNEODIR/extra_plugins.php"
# Legacy Adminer references kept for cleanup purposes
LEGACY_ADMINER_CONF="$SITES_AVAILABLE/adminer.conf"
LEGACY_ADMINER_CONF_ENABLED="/etc/apache2/sites-enabled/adminer.conf"
LEGACY_ADMINERDIR=/usr/share/adminer
# Get latest AdminNeo version dynamically from GitHub releases
get_adminneo_version() {
local version
Expand All @@ -183,8 +187,8 @@ get_adminneo_version() {
echo "5.1.1"
fi
}
ADMINER_VERSION=$(get_adminneo_version)
ADMINER_DOWNLOAD_URL="https://www.adminneo.org/files/${ADMINER_VERSION}/pgsql_en_default/adminneo-${ADMINER_VERSION}.php"
ADMINNEO_VERSION=$(get_adminneo_version)
ADMINNEO_DOWNLOAD_URL="https://www.adminneo.org/files/${ADMINNEO_VERSION}/pgsql_en_default/adminneo-${ADMINNEO_VERSION}.php"
# Redis
REDIS_CONF=/etc/redis/redis.conf
REDIS_SOCK=/var/run/redis/redis-server.sock
Expand Down Expand Up @@ -847,7 +851,7 @@ return 0
}


# Check that the script can see the external IP (apache fails otherwise), used e.g. in the adminer app script.
# Check that the script can see the external IP (apache fails otherwise), used e.g. in the adminneo app script.
check_external_ip() {
if [ -z "$WANIP4" ]
then
Expand Down
2 changes: 1 addition & 1 deletion menu/additional_apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ case "$choice" in
;;&
*"AdminNeo"*)
print_text_in_color "$ICyan" "Downloading the AdminNeo script..."
run_script APP adminer
run_script APP adminneo
;;&
*"ClamAV"*)
print_text_in_color "$ICyan" "Downloading the ClamAV script..."
Expand Down
32 changes: 20 additions & 12 deletions nextcloud_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -575,18 +575,26 @@ fi
# Make sure services are restarted
restart_webserver

# Update adminer
if [ -d "$ADMINERDIR" ]
then
print_text_in_color "$ICyan" "Updating Adminer..."
rm -f "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php "$ADMINERDIR"/adminer-pgsql.php
# Download the latest version
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
mv "$ADMINERDIR"/adminer-pgsql.php "$ADMINERDIR"/adminer.php
# Update adminneo
if [ -d "$ADMINNEODIR" ]
then
print_text_in_color "$ICyan" "Updating AdminNeo..."
rm -f "$ADMINNEODIR"/latest.php "$ADMINNEODIR"/adminneo.php "$ADMINNEODIR"/adminneo-pgsql.php

if curl_to_dir "https://www.adminneo.org/files/${ADMINNEO_VERSION}/pgsql_en_default/" "adminneo-${ADMINNEO_VERSION}.php" "$ADMINNEODIR"
then
if [ -f "$ADMINNEODIR/adminneo-${ADMINNEO_VERSION}.php" ]
then
mv "$ADMINNEODIR/adminneo-${ADMINNEO_VERSION}.php" "$ADMINNEODIR/adminneo.php"
elif [ -f "$ADMINNEODIR/adminerneo-${ADMINNEO_VERSION}-pgsql.php" ]
then
mv "$ADMINNEODIR/adminerneo-${ADMINNEO_VERSION}-pgsql.php" "$ADMINNEODIR/adminneo.php"
else
print_text_in_color "$IRed" "AdminNeo download completed but expected files were not found."
fi
else
print_text_in_color "$IRed" "Failed to update AdminNeo from $ADMINNEO_DOWNLOAD_URL"
fi
fi

# Get latest Maxmind databse for Geoblock
Expand Down
6 changes: 3 additions & 3 deletions not-supported/firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ ufw allow https comment https
print_text_in_color "$ICyan" "UPnP"
ufw allow proto udp from 192.168.0.0/16 comment UPnP

# Adminer
print_text_in_color "$ICyan" "Allow Adminer"
ufw allow 9443/tcp comment Adminer
# AdminNeo
print_text_in_color "$ICyan" "Allow AdminNeo"
ufw allow 9443/tcp comment AdminNeo

# Netdata
print_text_in_color "$ICyan" "Allow Netdata"
Expand Down
4 changes: 2 additions & 2 deletions static/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<p>Note: To access Webmin externally you have to open port 10000 in your router, it's not recommended though due to security concerns.</p>
</div>

<h2>Access Adminer</h2>
<h2>Access AdminNeo</h2>

<div class="information">
<p>Use the following address:
Expand All @@ -132,7 +132,7 @@
<h3>
<a href="https://docs.hanssonit.se/s/W6fMouPiqQz3_Mog/virtual-machines-vm/d/W6fMquPiqQz3_Moi/nextcloud-vm-first-setup-instructions?currentPageId=W6ypBePiqQz3_Mp0" target="_blank">Login details</a>
</h3>
<p>Note: Your LAN IP is set as approved in /etc/apache2/sites-available/adminer.conf, all other access is forbidden.</p>
<p>Note: Your LAN IP is set as approved in /etc/apache2/sites-available/adminneo.conf, all other access is forbidden.</p>
</div>

<h2>Follow us on Social Media</h2>
Expand Down
4 changes: 2 additions & 2 deletions static/nhss_index.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<p>Note: To access Webmin externally you have to open port 10000 in your router, it's not recommended though due to security concerns.</p>
</div>

<h2>Access Adminer</h2>
<h2>Access AdminNeo</h2>

<div class="information">
<p>Use the following address:
Expand All @@ -132,7 +132,7 @@
<h3>
<a href="https://docs.hanssonit.se/s/blkkp2qhv0jgrltpicl0/nextcloud-homesme-server/d/blkkp2qhv0jgrltpid50/server-installation-instructions?currentPageId=blkkp2qhv0jgrltpidcg" target="_blank">Login details</a>
</h3>
<p>Note: Your LAN IP is set as approved in /etc/apache2/sites-available/adminer.conf, all other access is forbidden.</p>
<p>Note: Your LAN IP is set as approved in /etc/apache2/sites-available/adminneo.conf, all other access is forbidden.</p>
</div>

<h2>Follow us on Social Media</h2>
Expand Down