Skip to content

Commit ae776cd

Browse files
authored
Merge branch 'main' into migrate-pecl-to-os-packages
2 parents f8d5d68 + 25d7e1b commit ae776cd

File tree

12 files changed

+96
-72
lines changed

12 files changed

+96
-72
lines changed

.github/workflows/check-code-with-shellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Github Actions
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v5
13+
- uses: actions/checkout@v6
1414
- name: Run Shellcheck
1515
uses: ludeeus/action-shellcheck@master
1616
with:

.github/workflows/reviewdog.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Shellcheck testing
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515
- name: shellcheck
1616
uses: reviewdog/action-shellcheck@v1
1717
with:
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: spelling or typos
28-
uses: actions/checkout@v5
28+
uses: actions/checkout@v6
2929
- name: misspell
3030
uses: reviewdog/action-misspell@v1
3131
with:

.github/workflows/update-copyright-year.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
pull-requests: write
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919

2020
- name: Get current year
2121
id: year
@@ -36,7 +36,7 @@ jobs:
3636
3737
- name: Create Pull Request
3838
if: steps.verify_diff.outputs.changed == 'true'
39-
uses: peter-evans/create-pull-request@v6
39+
uses: peter-evans/create-pull-request@v7
4040
with:
4141
commit-message: 'Update copyright year to ${{ steps.year.outputs.current_year }}'
4242
title: 'Update copyright year to ${{ steps.year.outputs.current_year }}'

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Server installation. Simplified. :cloud:
3333
* Report [your issue](https://github.com/nextcloud/vm/issues/new)
3434
* Help us with [existing issues](https://github.com/nextcloud/vm/issues)
3535
* Test what's not yet released into the stable VM. Please have a look at [this subfolder](https://github.com/nextcloud/vm/tree/main/not-supported) for further information.
36-
* Write scripts so that the release process becomes automated with [Vagrant](https://www.vagrantup.com/docs/getting-started/), [Terraform](https://www.terraform.io/) or similar
3736
* **[Donate](https://shop.hanssonit.se/product-category/donate/) or buy our [pre-configured VMs](https://shop.hanssonit.se/product-category/virtual-machine/): 500 GB, 1 TB, 2TB for both VMware, Hyper-V and [more](https://docs.hanssonit.se/s/W6fMouPiqQz3_Mog/virtual-machines-vm/d/W7Du9uPiqQz3_Mr1/nextcloud-vm-machine-configuration?currentPageId=bls17dahv0jgrltpif20)**
3837

3938
**FYI**
@@ -73,7 +72,7 @@ Please report any issues you can find. Improvements are welcome!
7372
## First look
7473
#### Nextcloud
7574
![alt tag](https://github.com/nextcloud/nextcloud.com/blob/master/assets/img/features/VMwelcome.png)
76-
#### Adminer (Database Administration) *not default*
75+
#### AdminNeo (Database Administration) *not default*
7776
![alt tag](https://i.imgur.com/tiF4chg.png)
7877
#### Webmin (Server Administration GUI) *not default*
7978
![alt tag](https://i.imgur.com/hLkmA1D.png)

apps/adminer.sh renamed to apps/adminneo.sh

Lines changed: 44 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
true
66
SCRIPT_NAME="AdminNeo"
77
SCRIPT_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.
99
More info: https://www.adminneo.org"
1010
# shellcheck source=lib.sh
1111
source /var/scripts/fetch_lib.sh
@@ -19,8 +19,8 @@ debug_mode
1919
# Check if root
2020
root_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" ]
2424
then
2525
# Ask for installing
2626
install_popup "$SCRIPT_NAME"
@@ -29,11 +29,23 @@ else
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
5163
a2enmod rewrite
5264
a2enmod 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"
6270
then
6371
msg_box "Failed to download AdminNeo. The download URL may have changed.
6472
6573
Please report this issue to: $ISSUES
6674
6775
Attempted to download from:
68-
$ADMINER_DOWNLOAD_URL"
76+
$ADMINNEO_DOWNLOAD_URL"
6977
exit 1
7078
fi
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" ]
7482
then
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" ]
7785
then
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"
8088
else
8189
msg_box "Failed to find downloaded AdminNeo file. Please report this to $ISSUES"
8290
exit 1
8391
fi
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
8896
if 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
101109
function 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 ###
165173
# ServerAdmin [email protected]
166-
# 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

195203
if ! restart_webserver
196204
then
@@ -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:
206214
https://$ADDRESS:9443
207215
208216
You can download more plugins and get more information here:
209-
https://www.adminer.org
217+
https://www.adminneo.org
210218
211219
Your PostgreSQL connection information can be found in $NCPATH/config/config.php.
212220
These 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"
221229
fi

lib.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,14 @@ PHP_MODS_DIR=/etc/php/"$PHPVER"/mods-available
165165
opcache_interned_strings_buffer_value=24
166166
# Notify push
167167
NOTIFY_PUSH_SERVICE_PATH="/etc/systemd/system/notify_push.service"
168-
# Adminer
169-
ADMINERDIR=/usr/share/adminer
170-
ADMINER_CONF="$SITES_AVAILABLE/adminer.conf"
171-
ADMINER_CONF_PLUGIN="$ADMINERDIR/extra_plugins.php"
168+
# AdminNeo
169+
ADMINNEODIR=/usr/share/adminneo
170+
ADMINNEO_CONF="$SITES_AVAILABLE/adminneo.conf"
171+
ADMINNEO_CONF_PLUGIN="$ADMINNEODIR/extra_plugins.php"
172+
# Legacy Adminer references kept for cleanup purposes
173+
LEGACY_ADMINER_CONF="$SITES_AVAILABLE/adminer.conf"
174+
LEGACY_ADMINER_CONF_ENABLED="/etc/apache2/sites-enabled/adminer.conf"
175+
LEGACY_ADMINERDIR=/usr/share/adminer
172176
# Get latest AdminNeo version dynamically from GitHub releases
173177
get_adminneo_version() {
174178
local version
@@ -183,8 +187,8 @@ get_adminneo_version() {
183187
echo "5.1.1"
184188
fi
185189
}
186-
ADMINER_VERSION=$(get_adminneo_version)
187-
ADMINER_DOWNLOAD_URL="https://www.adminneo.org/files/${ADMINER_VERSION}/pgsql_en_default/adminneo-${ADMINER_VERSION}.php"
190+
ADMINNEO_VERSION=$(get_adminneo_version)
191+
ADMINNEO_DOWNLOAD_URL="https://www.adminneo.org/files/${ADMINNEO_VERSION}/pgsql_en_default/adminneo-${ADMINNEO_VERSION}.php"
188192
# Redis
189193
REDIS_CONF=/etc/redis/redis.conf
190194
REDIS_SOCK=/var/run/redis/redis-server.sock
@@ -847,7 +851,7 @@ return 0
847851
}
848852

849853

850-
# Check that the script can see the external IP (apache fails otherwise), used e.g. in the adminer app script.
854+
# Check that the script can see the external IP (apache fails otherwise), used e.g. in the adminneo app script.
851855
check_external_ip() {
852856
if [ -z "$WANIP4" ]
853857
then
@@ -1927,7 +1931,7 @@ fi
19271931
docker_update_specific() {
19281932
if is_docker_running && docker ps -a --format "{{.Names}}" | grep -q "^$1$"
19291933
then
1930-
if docker run --rm --name temporary_watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --cleanup --run-once "$1"
1934+
if docker run --rm --name temporary_watchtower -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/nicholas-fedor/watchtower:latest --cleanup --run-once "$1"
19311935
then
19321936
print_text_in_color "$IGreen" "$2 docker image just got updated!"
19331937
echo "Docker image just got updated! We just updated $2 docker image automatically! $(date +%Y%m%d)" >> "$VMLOGS"/update.log

menu/additional_apps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ case "$choice" in
7373
;;&
7474
*"AdminNeo"*)
7575
print_text_in_color "$ICyan" "Downloading the AdminNeo script..."
76-
run_script APP adminer
76+
run_script APP adminneo
7777
;;&
7878
*"ClamAV"*)
7979
print_text_in_color "$ICyan" "Downloading the ClamAV script..."

network/ddclient-configuration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ cat << DDCLIENT_CONF > "/etc/ddclient.conf"
182182
# /etc/ddclient.conf
183183
184184
# Default system settings
185-
use=web, web=https://api.ipify.org
185+
usev4=webv4, webv4=https://api.ipify.org
186186
187187
# Workaround for ddclient 3.10.0+ parsing bug disabled
188188
# The 'curl=yes' option causes "curl not found" errors even with curl installed

nextcloud_update.sh

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,11 @@ then
339339
# Hold veracrypt if installed since unmounting all drives, updating and mounting them again is not feasible
340340
# If you desperately need the update, you can do so manually
341341
apt-mark hold veracrypt
342+
343+
# Also do not restart services automatically when running apt-get dist-upgrade later on
344+
# As this otherwise restarts the veracrypt automount service and unmounts all drives unexpectedly
345+
export NEEDRESTART_MODE=l
346+
export NEEDRESTART_SUSPEND=1
342347
fi
343348

344349
# Enter maintenance:mode
@@ -513,18 +518,26 @@ fi
513518
# Make sure services are restarted
514519
restart_webserver
515520

516-
# Update adminer
517-
if [ -d "$ADMINERDIR" ]
518-
then
519-
print_text_in_color "$ICyan" "Updating Adminer..."
520-
rm -f "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php "$ADMINERDIR"/adminer-pgsql.php
521-
# Download the latest version
522-
curl_to_dir "https://download.adminerevo.org/latest/adminer" "adminer-pgsql.zip" "$ADMINERDIR"
523-
install_if_not unzip
524-
# Unzip the latest version
525-
unzip "$ADMINERDIR"/adminer-pgsql.zip -d "$ADMINERDIR"
526-
rm -f "$ADMINERDIR"/adminer-pgsql.zip
527-
mv "$ADMINERDIR"/adminer-pgsql.php "$ADMINERDIR"/adminer.php
521+
# Update adminneo
522+
if [ -d "$ADMINNEODIR" ]
523+
then
524+
print_text_in_color "$ICyan" "Updating AdminNeo..."
525+
rm -f "$ADMINNEODIR"/latest.php "$ADMINNEODIR"/adminneo.php "$ADMINNEODIR"/adminneo-pgsql.php
526+
527+
if curl_to_dir "https://www.adminneo.org/files/${ADMINNEO_VERSION}/pgsql_en_default/" "adminneo-${ADMINNEO_VERSION}.php" "$ADMINNEODIR"
528+
then
529+
if [ -f "$ADMINNEODIR/adminneo-${ADMINNEO_VERSION}.php" ]
530+
then
531+
mv "$ADMINNEODIR/adminneo-${ADMINNEO_VERSION}.php" "$ADMINNEODIR/adminneo.php"
532+
elif [ -f "$ADMINNEODIR/adminerneo-${ADMINNEO_VERSION}-pgsql.php" ]
533+
then
534+
mv "$ADMINNEODIR/adminerneo-${ADMINNEO_VERSION}-pgsql.php" "$ADMINNEODIR/adminneo.php"
535+
else
536+
print_text_in_color "$IRed" "AdminNeo download completed but expected files were not found."
537+
fi
538+
else
539+
print_text_in_color "$IRed" "Failed to update AdminNeo from $ADMINNEO_DOWNLOAD_URL"
540+
fi
528541
fi
529542

530543
# Get latest Maxmind databse for Geoblock

not-supported/firewall.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ ufw allow https comment https
5454
print_text_in_color "$ICyan" "UPnP"
5555
ufw allow proto udp from 192.168.0.0/16 comment UPnP
5656

57-
# Adminer
58-
print_text_in_color "$ICyan" "Allow Adminer"
59-
ufw allow 9443/tcp comment Adminer
57+
# AdminNeo
58+
print_text_in_color "$ICyan" "Allow AdminNeo"
59+
ufw allow 9443/tcp comment AdminNeo
6060

6161
# Netdata
6262
print_text_in_color "$ICyan" "Allow Netdata"

0 commit comments

Comments
 (0)