Skip to content

Commit ed2ec72

Browse files
committed
Upgrade OS --> 26.04
- Bump supported Ubuntu range to 24.04 - 26.04 (Resolute Raccoon) - PHP 8.3 -> 8.5, PostgreSQL 16 -> 18 (defaults on 26.04) - Centralize version checks in lib.sh: SUPPORTED_VERSION_MIN/MAX, LATEST_VERSION (derived), SUPPORTED_CODENAMES — single source of truth - Make check_php() fully dynamic (regex on `php -v`, /etc/php fallback) - Replace hardcoded stop_if_installed lists with brace-expansion loops covering php7.0-7.9, php8.0-8.9 and postgresql-9.x through postgresql-30 Signed-off-by: enoch85 <mailto@danielhansson.nu>
1 parent 1c8dc01 commit ed2ec72

23 files changed

Lines changed: 196 additions & 118 deletions

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
name: Github Actions
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
13+
- uses: actions/checkout@v6
1414
- name: Run Shellcheck
15-
uses: ludeeus/action-shellcheck@00b27aa7cb85167568cb48a3838b75f4265f2bca # master
15+
uses: ludeeus/action-shellcheck@master
1616
with:
1717
check_together: 'yes'
1818
env:
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: 'install-smoke-test'
2+
3+
# Manual / scheduled smoke test that runs nextcloud_install_production.sh
4+
# end-to-end inside a privileged Ubuntu 26.04 container. Catches:
5+
# - apt package availability changes between LTS releases
6+
# - PHP/PG/Apache config breakage
7+
# - Nextcloud download + occ install regressions
8+
# - lib.sh sourcing / version-gate regressions
9+
#
10+
# Does NOT cover:
11+
# - real LVM snapshot / lvextend behaviour (loopback approximation)
12+
# - hypervisor-specific kernel installs (Hyper-V, VMware, QEMU)
13+
# - reboot path (stubbed)
14+
#
15+
# Manual trigger only — runtime ~25 min, ~3 GB RAM.
16+
17+
on:
18+
pull_request:
19+
workflow_dispatch:
20+
inputs:
21+
ubuntu_image:
22+
description: 'Ubuntu image to test against (e.g. ubuntu:26.04, ubuntu:24.04)'
23+
default: 'ubuntu:26.04'
24+
required: true
25+
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
install:
31+
name: 'Run nextcloud_install_production.sh -p'
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 45
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v6
37+
with:
38+
# Default checks out the ref that fired workflow_dispatch (so picking
39+
# `upgrade-os-26.04` from the UI tests that branch).
40+
ref: ${{ github.ref }}
41+
42+
- name: Prepare host
43+
run: |
44+
# Loopback devices the install script expects
45+
sudo truncate -s 6G /tmp/disk-sdb.img
46+
sudo losetup -fP /tmp/disk-sdb.img
47+
LOOP_SDB=$(losetup -j /tmp/disk-sdb.img | cut -d: -f1)
48+
echo "LOOP_SDB=$LOOP_SDB" >> "$GITHUB_ENV"
49+
# Show what we created
50+
lsblk
51+
52+
- name: Run install script in privileged container
53+
env:
54+
UBUNTU_IMAGE: ${{ inputs.ubuntu_image || 'ubuntu:26.04' }}
55+
run: |
56+
set -e
57+
docker run --rm \
58+
--privileged \
59+
--name nc-install \
60+
-v "$PWD:/repo:ro" \
61+
-v "${LOOP_SDB}:/dev/sdb" \
62+
-e DEBIAN_FRONTEND=noninteractive \
63+
-e SUDO_USER=root \
64+
-e RUNLEVEL=1 \
65+
"$UBUNTU_IMAGE" \
66+
bash -c '
67+
set -e
68+
# Bare image bootstrap so the install script can run
69+
apt-get update -qq
70+
apt-get install -qqy --no-install-recommends \
71+
sudo curl ca-certificates lsb-release iproute2 \
72+
netcat-openbsd whiptail kmod
73+
# Stub reboot so the script does not actually try to reboot.
74+
# (Using printf instead of heredoc — heredoc closing tag cannot be
75+
# indented inside a YAML run block, which silently swallows the rest
76+
# of the script as heredoc content.)
77+
printf "#!/bin/sh\necho \"[reboot stubbed in CI: \$*]\" >&2\nexit 0\n" \
78+
> /usr/local/sbin/reboot
79+
chmod +x /usr/local/sbin/reboot
80+
ln -sf /usr/local/sbin/reboot /usr/local/sbin/shutdown
81+
# Make a copy we can edit (script lives in read-only mount)
82+
cp -a /repo /work
83+
cd /work
84+
# Run installer in provisioning mode (no prompts)
85+
bash nextcloud_install_production.sh -p
86+
'
87+
88+
- name: Verify Nextcloud is installed
89+
if: always()
90+
run: |
91+
# Container exited; attach a fresh one to the same host paths to inspect state
92+
# (Skipped here because container is --rm; rely on script exit code.)
93+
# Show host-side artifacts in case anything was written via bind mount.
94+
ls -la /tmp/disk-sdb.img || true
95+
96+
- name: Cleanup loopback
97+
if: always()
98+
run: |
99+
sudo losetup -d "$LOOP_SDB" || true
100+
sudo rm -f /tmp/disk-sdb.img

.github/workflows/reviewdog.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
name: Shellcheck testing
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
14+
- uses: actions/checkout@v6
1515
- name: shellcheck
16-
uses: reviewdog/action-shellcheck@4c07458293ac342d477251099501a718ae5ef86e # v1
16+
uses: reviewdog/action-shellcheck@v1
1717
with:
1818
github_token: ${{ secrets.github_token }}
1919
reporter: github-pr-review
@@ -25,9 +25,9 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: spelling or typos
28-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
28+
uses: actions/checkout@v6
2929
- name: misspell
30-
uses: reviewdog/action-misspell@d6429416b12b09b4e2768307d53bef58d172e962 # v1
30+
uses: reviewdog/action-misspell@v1
3131
with:
3232
github_token: ${{ secrets.github_token }}
3333
locale: "US"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ Server installation. Simplified. :cloud:
1717
--------------------
1818

1919
## Dependencies:
20-
(Ubuntu Server 24.04 LTS *minimal* 64-bit)
20+
(Ubuntu Server 26.04 LTS *minimal* 64-bit)
2121
<br>
22-
(Linux Kernel: 6.8)
22+
(Linux Kernel: 7.0)
2323
- Apache 2.4
24-
- PostgreSQL 16
25-
- PHP-FPM 8.3
24+
- PostgreSQL 18
25+
- PHP-FPM 8.5
2626
- Redis Memcache (Ubuntu package)
2727
- PHP-igbinary (Ubuntu package)
2828
- PHP-smbclient (Ubuntu package)

addons/redis-server-ubuntu.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ debug_mode
1616
root_check
1717

1818
# Check Ubuntu version
19-
if ! version 18.04 "$DISTRO" 24.04.10
19+
if ! version 18.04 "$DISTRO" "$SUPPORTED_VERSION_MAX"
2020
then
21-
msg_box "Your current Ubuntu version is $DISTRO but must be between 18.04 - 24.04.10 to run this script."
21+
msg_box "Your current Ubuntu version is $DISTRO but must be between 18.04 - $SUPPORTED_VERSION_MAX to run this script."
2222
msg_box "Please contact us to get support for upgrading your server:
2323
https://www.hanssonit.se/#contact
2424
https://shop.hanssonit.se/"

apps/adminneo.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ fi
9292

9393
print_text_in_color "$IGreen" "AdminNeo ${ADMINNEO_VERSION} successfully downloaded!"
9494

95-
# Only add TLS 1.3 on Ubuntu later than 22.04
96-
if version 22.04 "$DISTRO" 24.04.10
95+
# Only add TLS 1.3 on supported Ubuntu releases
96+
if version "$SUPPORTED_VERSION_MIN" "$DISTRO" "$SUPPORTED_VERSION_MAX"
9797
then
9898
TLS13="+TLSv1.3"
9999
fi

apps/collabora_docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ a2enmod proxy_http
135135
a2enmod ssl
136136
a2enmod headers
137137

138-
# Only add TLS 1.3 on Ubuntu later than 22.04
139-
if version 22.04 "$DISTRO" 24.04.10
138+
# Only add TLS 1.3 on supported Ubuntu releases
139+
if version "$SUPPORTED_VERSION_MIN" "$DISTRO" "$SUPPORTED_VERSION_MAX"
140140
then
141141
TLS13="+TLSv1.3"
142142
fi

apps/onlyoffice_docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ a2enmod proxy_http
152152
a2enmod ssl
153153
a2enmod headers
154154

155-
# Only add TLS 1.3 on Ubuntu later than 22.04
156-
if version 22.04 "$DISTRO" 24.04.10
155+
# Only add TLS 1.3 on supported Ubuntu releases
156+
if version "$SUPPORTED_VERSION_MIN" "$DISTRO" "$SUPPORTED_VERSION_MAX"
157157
then
158158
TLS13="+TLSv1.3"
159159
fi

apps/pico_cms.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ a2enmod proxy_http
214214
a2enmod ssl
215215
a2enmod headers
216216

217-
# Only add TLS 1.3 on Ubuntu later than 22.04
218-
if version 22.04 "$DISTRO" 24.04.10
217+
# Only add TLS 1.3 on supported Ubuntu releases
218+
if version "$SUPPORTED_VERSION_MIN" "$DISTRO" "$SUPPORTED_VERSION_MAX"
219219
then
220220
TLS13="+TLSv1.3"
221221
fi

apps/smbmount.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,14 @@ We please you to do the math yourself if the number is high enough for your setu
350350
# Get installed php version
351351
check_php
352352
# Enable Inotify
353-
if [ ! -f $PHP_MODS_DIR/inotify.ini ]
353+
if [ ! -f "$PHP_MODS_DIR"/inotify.ini ]
354354
then
355-
touch $PHP_MODS_DIR/inotify.ini
355+
touch "$PHP_MODS_DIR"/inotify.ini
356356
fi
357-
if ! grep -qFx extension=inotify.so $PHP_MODS_DIR/inotify.ini
357+
if ! grep -qFx extension=inotify.so "$PHP_MODS_DIR"/inotify.ini
358358
then
359-
echo "# PECL inotify" > $PHP_MODS_DIR/inotify.ini
360-
echo "extension=inotify.so" >> $PHP_MODS_DIR/inotify.ini
359+
echo "# PECL inotify" > "$PHP_MODS_DIR"/inotify.ini
360+
echo "extension=inotify.so" >> "$PHP_MODS_DIR"/inotify.ini
361361
check_command phpenmod -v ALL inotify
362362
fi
363363

0 commit comments

Comments
 (0)