55true
66SCRIPT_NAME=" AdminNeo"
77SCRIPT_EXPLAINER=" AdminNeo is a full-featured database management tool written in PHP.
8- It's a continuation of Adminer development after AdminerEvo was archived.
8+ It's a continuation of AdminNeo development after the legacy Evo fork was archived.
99More info: https://www.adminneo.org"
1010# shellcheck source=lib.sh
1111source /var/scripts/fetch_lib.sh
@@ -19,8 +19,8 @@ debug_mode
1919# Check if root
2020root_check
2121
22- # Check if adminer is already installed
23- if ! is_this_installed adminer
22+ # Check if adminneo is already installed
23+ if ! is_this_installed adminer && [ ! -f " $ADMINNEODIR /adminneo.php " ]
2424then
2525 # Ask for installing
2626 install_popup " $SCRIPT_NAME "
2929 reinstall_remove_menu " $SCRIPT_NAME "
3030 # Removal
3131 check_external_ip # Check that the script can see the external IP (apache fails otherwise)
32- a2disconf adminer .conf
32+ a2dissite adminneo .conf
3333 restart_webserver
34- rm -f $ADMINER_CONF
35- rm -rf $ADMINERDIR
36- check_command apt-get purge adminer -y
34+ rm -f $ADMINNEO_CONF
35+ rm -rf $ADMINNEODIR
36+
37+ # Cleanup of legacy Adminer files if they still exist
38+ if [ -f " $LEGACY_ADMINER_CONF " ] || [ -f " $LEGACY_ADMINER_CONF_ENABLED " ] || [ -d " $LEGACY_ADMINERDIR " ]
39+ then
40+ print_text_in_color " $ICyan " " Removing legacy Adminer files..."
41+ a2disconf adminer.conf > /dev/null 2>&1
42+ a2dissite adminer.conf > /dev/null 2>&1
43+ rm -f /etc/apache2/sites-available/adminer.conf
44+ rm -f /etc/apache2/sites-enabled/adminer.conf
45+ rm -rf /usr/share/adminer
46+ check_command apt-get purge adminer -y
47+ fi
48+
3749 restart_webserver
3850 # Show successful uninstall if applicable
3951 removal_popup " $SCRIPT_NAME "
@@ -51,38 +63,34 @@ a2enmod headers
5163a2enmod rewrite
5264a2enmod ssl
5365
54- # Install Adminer
55- apt-get update -q4 & spinner_loading
56- install_if_not adminer
57-
58- # AdminerEvo project has been archived, switching to AdminNeo (www.adminneo.org)
66+ # The legacy Evo project has been archived, switching to AdminNeo (www.adminneo.org)
5967# See: https://github.com/adminneo-org/adminneo
60- print_text_in_color " $ICyan " " Downloading AdminNeo version ${ADMINER_VERSION } ..."
61- if ! curl_to_dir " https://www.adminneo.org/files/${ADMINER_VERSION } /pgsql_en_default/" " adminneo-${ADMINER_VERSION } .php" " $ADMINERDIR "
68+ print_text_in_color " $ICyan " " Downloading AdminNeo version ${ADMINNEO_VERSION } ..."
69+ if ! curl_to_dir " https://www.adminneo.org/files/${ADMINNEO_VERSION } /pgsql_en_default/" " adminneo-${ADMINNEO_VERSION } .php" " $ADMINNEODIR "
6270then
6371 msg_box " Failed to download AdminNeo. The download URL may have changed.
6472
6573Please report this issue to: $ISSUES
6674
6775Attempted to download from:
68- $ADMINER_DOWNLOAD_URL "
76+ $ADMINNEO_DOWNLOAD_URL "
6977 exit 1
7078fi
7179
72- # Rename to standard adminer .php name
73- if [ -f " $ADMINERDIR /adminneo-${ADMINER_VERSION } .php" ]
80+ # Rename to standard adminneo .php name
81+ if [ -f " $ADMINNEODIR /adminneo-${ADMINNEO_VERSION } .php" ]
7482then
75- mv " $ADMINERDIR /adminneo-${ADMINER_VERSION } .php" " $ADMINERDIR /adminer .php"
76- elif [ -f " $ADMINERDIR /adminerneo-${ADMINER_VERSION } -pgsql.php" ]
83+ mv " $ADMINNEODIR /adminneo-${ADMINNEO_VERSION } .php" " $ADMINNEODIR /adminneo .php"
84+ elif [ -f " $ADMINNEODIR /adminerneo-${ADMINNEO_VERSION } -pgsql.php" ]
7785then
7886 # Fallback for old naming if somehow still exists
79- mv " $ADMINERDIR /adminerneo-${ADMINER_VERSION } -pgsql.php" " $ADMINERDIR /adminer .php"
87+ mv " $ADMINNEODIR /adminerneo-${ADMINNEO_VERSION } -pgsql.php" " $ADMINNEODIR /adminneo .php"
8088else
8189 msg_box " Failed to find downloaded AdminNeo file. Please report this to $ISSUES "
8290 exit 1
8391fi
8492
85- print_text_in_color " $IGreen " " AdminNeo ${ADMINER_VERSION } successfully downloaded!"
93+ print_text_in_color " $IGreen " " AdminNeo ${ADMINNEO_VERSION } successfully downloaded!"
8694
8795# Only add TLS 1.3 on Ubuntu later than 22.04
8896if version 22.04 " $DISTRO " 24.04.10
@@ -96,7 +104,7 @@ check_php
96104# shellcheck disable=2154
97105
98106# Add ability to add plugins easily
99- cat << ADMINER_CREATE_PLUGIN > "$ADMINER_CONF_PLUGIN "
107+ cat << ADMINNEO_CREATE_PLUGIN > "$ADMINNEO_CONF_PLUGIN "
100108<?php
101109function adminer_object() {
102110 // required to run any plugin
@@ -129,11 +137,11 @@ function adminer_object() {
129137 return new AdminerPlugin($plugins );
130138}
131139
132- // include original Adminer or Adminer Editor
133- include "./adminer .php";
134- ADMINER_CREATE_PLUGIN
140+ // include the AdminNeo runtime
141+ include "./adminneo .php";
142+ ADMINNEO_CREATE_PLUGIN
135143
136- cat << ADMINER_CREATE > "$ADMINER_CONF "
144+ cat << ADMINNEO_CREATE > "$ADMINNEO_CONF "
137145 <VirtualHost *:80>
138146 RewriteEngine On
139147 RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 :9443 [R=301,L]
@@ -163,18 +171,18 @@ Listen 9443
163171
164172### YOUR SERVER ADDRESS ###
165173166- # ServerName adminer .example.com
174+ # ServerName adminneo .example.com
167175
168176### SETTINGS ###
169177 <FilesMatch "\.php$">
170178 SetHandler "proxy:unix:/run/php/php$PHPVER -fpm.nextcloud.sock|fcgi://localhost"
171179 </FilesMatch>
172180
173- DocumentRoot $ADMINERDIR
181+ DocumentRoot $ADMINNEODIR
174182
175- <Directory $ADMINERDIR >
183+ <Directory $ADMINNEODIR >
176184 <IfModule mod_dir.c>
177- DirectoryIndex adminer .php
185+ DirectoryIndex adminneo .php
178186 </IfModule>
179187 AllowOverride All
180188
@@ -187,10 +195,10 @@ Listen 9443
187195 SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
188196
189197</VirtualHost>
190- ADMINER_CREATE
198+ ADMINNEO_CREATE
191199
192200# Enable config
193- check_command a2ensite adminer .conf
201+ check_command a2ensite adminneo .conf
194202
195203if ! restart_webserver
196204then
@@ -202,11 +210,11 @@ else
202210 check_command sed -i " s|local all postgres peer|local all postgres md5|g" /etc/postgresql/* /main/pg_hba.conf
203211 restart_webserver
204212
205- msg_box " Adminer was successfully installed and can be reached here:
213+ msg_box " AdminNeo was successfully installed and can be reached here:
206214https://$ADDRESS :9443
207215
208216You can download more plugins and get more information here:
209- https://www.adminer .org
217+ https://www.adminneo .org
210218
211219Your PostgreSQL connection information can be found in $NCPATH /config/config.php.
212220These are the current values:
@@ -216,6 +224,6 @@ $(grep dbuser $NCPATH/config/config.php)
216224$( grep dbpassword $NCPATH /config/config.php)
217225$( grep dbname $NCPATH /config/config.php)
218226
219- In case you try to access Adminer and get 'Forbidden' you need to change the IP in:
220- $ADMINER_CONF "
227+ In case you try to access AdminNeo and get 'Forbidden' you need to change the IP in:
228+ $ADMINNEO_CONF "
221229fi
0 commit comments