Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[Homelab] Notes on “How To Run A Server At Home Without An IPv4 Address”

Since my domain provider does not support DynDNS, I can only create subdomains for my VPS with a static IP address, but not for any of my services hosted at home. Fortunately, there is a really cool workaround I’ve been using for some years, which I got from here: https://blog.wirelessmoves.com/2019/06/how-to-run-a-server-at-home-without-an-ipv4-address.html

Now with the migration to a new server running Ubuntu 24.04, I had to redo the steps and noticed three minor differences.

# The .ssh folder and authorized_keys file did not exist per default
mkdir .ssh
sudo nano .ssh/authorized_keys

# The systemd command to restart the ssh service
sudo systemctl restart ssh.service

# Insted of netstat I had to use 'ss' to monitor the tcp ports
watch -n 0.5 "ss -tulpn"

Since I’m really not a Linux or command line expert and would surely forget about it otherwise, I’m writing it down for my next server migration 🙂

[CAP] Get subdomain in a multitenant scenario

Until recently, I was always decoded the JWT to get the subdomain of a subscribed tenant like this:

const jwt = retrieveJwt(req)
const subdomain = decodeJwt(jwt).ext_attr.zdn

I now noticed that you can also use the original request object and the getSubdomain function of the authInfo object. It’s provided by @sap/xssec and is only available when using XSUAA, means not with mocked authentication. This way you can get the subdomain in a single line:

const subdomain = req.http.req.authInfo.getSubdomain()

And there are some more helpful functions, that are documented here: