Skip to content

Commit a6d8a67

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 a6d8a67

23 files changed

Lines changed: 206 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: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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 behavior (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: Run install script in privileged container
43+
env:
44+
UBUNTU_IMAGE: ${{ inputs.ubuntu_image || 'ubuntu:26.04' }}
45+
run: |
46+
set -e
47+
docker run --rm \
48+
--privileged \
49+
--user 0:0 \
50+
--name nc-install \
51+
-v "$PWD:/repo:ro" \
52+
-e DEBIAN_FRONTEND=noninteractive \
53+
-e SUDO_USER=root \
54+
-e RUNLEVEL=1 \
55+
-e TERM=dumb \
56+
-e LANG=C.UTF-8 \
57+
-e LC_ALL=C.UTF-8 \
58+
"$UBUNTU_IMAGE" \
59+
bash -c '
60+
set -e
61+
# Diagnostics — confirm we are root inside the container
62+
id
63+
# Bare image bootstrap so the install script can run
64+
apt-get update -qq
65+
apt-get install -qqy --no-install-recommends \
66+
sudo curl ca-certificates lsb-release iproute2 \
67+
netcat-openbsd whiptail locales mount util-linux
68+
# Generate the C.UTF-8 locale so ram_check can parse meminfo
69+
locale-gen C.UTF-8 en_US.UTF-8
70+
update-locale LANG=C.UTF-8 LC_ALL=C.UTF-8
71+
# Override the default policy-rc.d that blocks service starts in
72+
# apt postinst. Without this, postgresql installs but its cluster
73+
# never gets started → install script'"'"'s psql calls fail.
74+
# The install script does NOT want a pre-installed postgres
75+
# (stop_if_installed postgresql), so we just allow it to install
76+
# cleanly and start itself.
77+
printf "#!/bin/sh\nexit 0\n" > /usr/sbin/policy-rc.d
78+
chmod 0755 /usr/sbin/policy-rc.d
79+
# Pre-seed /var/scripts so fetch_lib.sh uses THIS branch'"'"'s lib.sh
80+
# instead of downloading the stale copy from main.
81+
# fetch_lib.sh skips the download when both files already exist.
82+
mkdir -p /var/scripts
83+
cp /repo/lib.sh /var/scripts/lib.sh
84+
touch /var/scripts/nextcloud-startup-script.sh
85+
# Loop device for /dev/sdb (script expects a second disk for ZFS).
86+
# Best-effort: skip silently if losetup unavailable in this kernel.
87+
# `loop` is built into the host kernel on GH runners, no modprobe needed.
88+
set +e
89+
truncate -s 6G /tmp/disk-sdb.img
90+
LOOP=$(losetup -f 2>/dev/null)
91+
if [ -n "$LOOP" ] && losetup -P "$LOOP" /tmp/disk-sdb.img 2>/dev/null; then
92+
ln -sf "$LOOP" /dev/sdb
93+
echo "Created /dev/sdb -> $LOOP"
94+
else
95+
echo "WARNING: could not create loop device; format-sdb step will fail" >&2
96+
fi
97+
set -e
98+
# Stub reboot so the script does not actually try to reboot.
99+
# (printf instead of heredoc — closing heredoc tag cannot be indented
100+
# inside a YAML run block.)
101+
printf "#!/bin/sh\necho \"[reboot stubbed in CI: \$*]\" >&2\nexit 0\n" \
102+
> /usr/local/sbin/reboot
103+
chmod +x /usr/local/sbin/reboot
104+
ln -sf /usr/local/sbin/reboot /usr/local/sbin/shutdown
105+
# Make a copy we can edit (script lives in read-only mount)
106+
cp -a /repo /work
107+
cd /work
108+
# Run installer in provisioning mode (no prompts)
109+
bash nextcloud_install_production.sh -p
110+
'

.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)