Skip to content

Commit

Permalink
add ubuntu 24.04 (LTS) support
Browse files Browse the repository at this point in the history
  • Loading branch information
cremesk committed Nov 10, 2024
1 parent abf8a99 commit 6506a29
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 61 deletions.
54 changes: 40 additions & 14 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ steps:
- test -d .ci/build && rm -r .ci/build



- name: ffdd-ubuntu2004-build
image: ubuntu:20.04
commands:
Expand All @@ -94,22 +95,18 @@ steps:
recursive: false
delete: false

#
# u22.04 can't build uci
# use u20.04 build for u22.04

#- name: ffdd-ubuntu2004-clear
# image: ubuntu:20.04
# commands:
# - test -d .ci/build && rm -r .ci/build
- name: ffdd-ubuntu2004-clear
image: ubuntu:20.04
commands:
- test -d .ci/build && rm -r .ci/build


#- name: ffdd-ubuntu2204-build
# image: ubuntu:22.04
# commands:
# - cd .ci
# - bash install_deps.sh
# - bash build_uci.sh
- name: ffdd-ubuntu2204-build
image: ubuntu:22.04
commands:
- cd .ci
- bash install_deps.sh
- bash build_uci.sh

- name: ffdd-ubuntu2204-deploy
image: drillster/drone-rsync
Expand All @@ -131,3 +128,32 @@ steps:
image: ubuntu:22.04
commands:
- test -d .ci/build && rm -r .ci/build


- name: ffdd-ubuntu2404-build
image: ubuntu:24.04
commands:
- cd .ci
- bash install_deps.sh
- bash build_uci.sh

- name: ffdd-ubuntu2404-deploy
image: drillster/drone-rsync
settings:
hosts:
from_secret: HOST
port:
from_secret: PORT
key:
from_secret: SSH_PRIVATE_KEY
user:
from_secret: USER
source: .ci/build/*.deb
target: /var/www/files/server/packages/ubuntu24/
recursive: false
delete: false

- name: ffdd-ubuntu2404-clear
image: ubuntu:24.04
commands:
- test -d .ci/build && rm -r .ci/build
46 changes: 41 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ docker:ffdd-debian11:

ffdd-debian11-staging:
stage: deploy
image: debian:11
image: debian:12
only:
- master
dependencies:
Expand Down Expand Up @@ -58,7 +58,7 @@ docker:ffdd-debian12:

ffdd-debian12-staging:
stage: deploy
image: debian:11
image: debian:12
only:
- master
dependencies:
Expand All @@ -75,6 +75,7 @@ ffdd-debian12-staging:
- docker2



docker:ffdd-ubuntu2004:
except:
- schedules
Expand All @@ -93,7 +94,7 @@ docker:ffdd-ubuntu2004:

ffdd-ubuntu2004-staging:
stage: deploy
image: debian:11
image: debian:12
only:
- master
dependencies:
Expand Down Expand Up @@ -126,9 +127,9 @@ docker:ffdd-ubuntu2204:
tags:
- docker2

ffdd-ubuntu2004-staging:
ffdd-ubuntu2204-staging:
stage: deploy
image: debian:11
image: debian:12
only:
- master
dependencies:
Expand All @@ -143,3 +144,38 @@ ffdd-ubuntu2004-staging:
- rsync -avz -e "ssh -p $PORT" .ci/build/* "$USER"@"$HOST":"$RPATH"/ubuntu22/
tags:
- docker2


docker:ffdd-ubuntu2404:
except:
- schedules
image: ubuntu:24.04
stage: build
script:
- cd .ci
- bash install_deps.sh
- bash build_uci.sh
artifacts:
paths:
- .ci/build/*.deb
expire_in: 24 hour
tags:
- docker2

ffdd-ubuntu2404-staging:
stage: deploy
image: debian:12
only:
- master
dependencies:
- docker:ffdd-ubuntu2404
before_script:
- apt-get update -y && apt-get install -y openssh-client rsync
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh ; chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- ssh-keyscan -p "$PORT" "$HOST" >> ~/.ssh/known_hosts
script:
- rsync -avz -e "ssh -p $PORT" .ci/build/* "$USER"@"$HOST":"$RPATH"/ubuntu24/
tags:
- docker2
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Freifunk Dresden: ffdd-server - Changelog
`current version:` ![calver](https://img.shields.io/github/v/release/freifunk-dresden/ffdd-server?include_prereleases)

## version 1.6.0rc1
- add support for ubuntu 24.04 (LTS)

## version 1.5.1rc1
- fix salt installation and change to new salt repo
- install 'saltext-apache' extensions to replace deprecated 'apache' functionality in salt
- add persistent keepalive for wireguard vpn gateway connections
- update dns for vpn5 and vpn21
- update bind (dns) zonefiles
- fix monitorix sources

## version 1.5.0
Expand Down
14 changes: 9 additions & 5 deletions init_server.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
#version="1.5.1"
#version="1.6.0"

# check if user has set the environment variable REV, then use this
REV="T_RELEASE_latest" # means git rev/branch/tag
Expand Down Expand Up @@ -33,16 +33,17 @@ install_uci() {
libuci='libuci_20200427_amd64.deb'
uci='uci_20200427_amd64.deb'

pkgs=("$libubox" "$libuci" "$uci")
PKGS=("$libubox" "$libuci" "$uci")
DIST="$1"

for PKG in "${pkgs[@]}"; do
for PKG in "${PKGS[@]}"; do
PKG_NAME="$(echo "$PKG" | cut -d'_' -f 1)"
PKG_VERSION="$(echo "$PKG" | cut -d'_' -f 2 | grep -o '[0-9]*')"
# check pkg is not installed or has another version
if [ "$(dpkg-query -W -f='${Status}' "$PKG_NAME" 2>/dev/null | grep -c "ok installed")" -eq 0 ] || \
[ "$(dpkg-query -W -f='${Version}' "$PKG_NAME")" != "$PKG_VERSION" ]; then
TEMP_DEB="$(mktemp)" &&
wget -O "$TEMP_DEB" "$DL_URL/$1/$PKG" &&
wget -O "$TEMP_DEB" "$DL_URL/$DIST/$PKG" &&
dpkg -i "$TEMP_DEB"
rm -f "$TEMP_DEB"
fi
Expand Down Expand Up @@ -74,7 +75,7 @@ print_not_supported_os() {
printf 'OS is not supported! (for more Informations read the Repository README.md)\n'
printf 'Supported OS List:\n'
printf ' - Debian (11/12)\n'
printf ' - Ubuntu Server LTS (20.04/22.04)\n'
printf ' - Ubuntu Server LTS (20.04/22.04/24.04)\n'
exit 1
}

Expand Down Expand Up @@ -231,6 +232,9 @@ elif [ "$os_id" = 'ubuntu' ]; then
22.04*) PKGMNGR='apt-get'
install_uci ubuntu22
;;
24.04*) PKGMNGR='apt-get'
install_uci ubuntu24
;;
*) print_not_supported_os ;;
esac
printf '\nOK.\n'
Expand Down
3 changes: 3 additions & 0 deletions salt/freifunk/base/bmxd/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ bmxd:
{% elif grains['os'] == 'Ubuntu' and grains['oscodename'] == 'jammy' %}
- bmxd: {{ freifunk_dl_url }}/ubuntu22/bmxd-{{ bmxd_version }}-ubuntu-jammy-amd64.deb
{% elif grains['os'] == 'Ubuntu' and grains['oscodename'] == 'noble' %}
- bmxd: {{ freifunk_dl_url }}/ubuntu24/bmxd-{{ bmxd_version }}-ubuntu-noble-amd64.deb
{% endif %}
Expand Down
25 changes: 5 additions & 20 deletions salt/freifunk/base/devel.sls
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,21 @@ devel:
- libssl-dev
- libnacl-dev
- libjson-c-dev

{% if grains['os'] == 'Ubuntu' and grains['oscodename'] == 'focal' %}
- libcurl4
{# dep. to build fastd2 #}
- libmnl-dev

{% elif grains['os'] == 'Ubuntu' and grains['oscodename'] == 'jammy' %}
- libcurl4
{# dep. to build fastd2 #}
- libmnl-dev

{% elif grains['os'] == 'Debian' and grains['oscodename'] == 'bullseye' %}
{% if grains['os'] == 'Ubuntu' and grains['oscodename'] == 'noble' %}
- libcurl4t64
{% else %}
- libcurl4
{# dep. to build fastd2 #}
- libmnl-dev
{% endif %}

{% if grains['os'] == 'Debian' and grains['oscodename'] == 'bullseye' %}
{# workaround for fastd libjson-c-dev #}
/usr/lib/x86_64-linux-gnu/libjson-c.so.3:
file.symlink:
- target: /usr/lib/x86_64-linux-gnu/libjson-c.so.5
- force: true
- require:
- pkg: libjson-c-dev

{% elif grains['os'] == 'Debian' and grains['oscodename'] == 'bookworm' %}
- libcurl4
{# dep. to build fastd2 #}
- libmnl-dev

{% else %}
- libcurl3

{% endif %}
29 changes: 13 additions & 16 deletions salt/freifunk/base/install_pkg.sls
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,6 @@ install_pkg:

- jq

{% if grains['os'] == 'Debian' and grains['oscodename'] == 'bullseye' %}
- python-apt-common
- iptraf-ng
{% elif grains['os'] == 'Debian' and grains['oscodename'] == 'bookworm' %}
- python-apt-common
- iptraf-ng
{% elif grains['os'] == 'Ubuntu' and grains['oscodename'] == 'jammy' %}
- python3-apt
- python3-pycurl
- iptraf-ng
{% else %}
- python-apt
- iptraf
{% endif %}


{% if grains['os'] == 'Debian' %}
- firmware-linux
{% elif grains['os'] == 'Ubuntu' %}
Expand All @@ -75,5 +59,18 @@ install_pkg:


{% if grains['os'] == 'Ubuntu' and grains['oscodename'] == 'focal' %}
- python-apt
- python-pycurl
- iptraf
{% elif grains['os'] == 'Ubuntu' and grains['oscodename'] == 'jammy' %}
- python3-apt
- python3-pycurl
- iptraf-ng
{% elif grains['os'] == 'Ubuntu' and grains['oscodename'] == 'noble' %}
- python3-apt
- python3-pycurl
- iptraf-ng
{% if grains['os'] == 'Debian' %}
- python-apt-common
- iptraf-ng
{% endif %}
5 changes: 5 additions & 0 deletions salt/freifunk/base/uci/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ uci:
- libuci: {{ freifunk_dl_url }}/ubuntu22/libuci_{{ libuci_version }}_amd64.deb
- uci: {{ freifunk_dl_url }}/ubuntu22/uci_{{ uci_version }}_amd64.deb
{% elif grains['os'] == 'Ubuntu' and grains['oscodename'] == 'noble' %}
- libubox: {{ freifunk_dl_url }}/ubuntu24/libubox_{{ libubox_version }}_amd64.deb
- libuci: {{ freifunk_dl_url }}/ubuntu24/libuci_{{ libuci_version }}_amd64.deb
- uci: {{ freifunk_dl_url }}/ubuntu24/uci_{{ uci_version }}_amd64.deb
{% endif %}
uci_ldconfig:
Expand Down

0 comments on commit 6506a29

Please sign in to comment.