DocWhoZee

@docwhozee Created:

dum spiro spero | 302.04 ppm

computer science, #iphonephotography, #photograpy, #mysteries, #walking, #hiking, occasional #hacker, lately barista at the xyzzy caffè.

blog
blog.xyzzy.cafe
location
#erlangen, #germany, #eu
Visit blog
RSS
206 posts
hidden followers
hidden following
DocWhoZee
@docwhozee
#freebsd jails & unbound

jails, unbound, & ip-transparent

#littlefedi (and other stuff) is running inside its #freebsd #jail on xyzzy.cafe and gets its intertubes traffic through #caddy, which is also running inside a jail. DNS resolution is done by unbound running on the host.

After updating my #freebsd instance today, I noticed that #littlefedi's work queue was "exploding" — and a look into its log showed that DNS resolution was failing. A drill on the jail console failed as well.

The root cause seems to have been that unbound could not bind to the jail interface as that was not up yet (bastille running later, much later). Just using

interface: 0.0.0.0
interface: ::0

and suitable access-control lines did not help. What did help is

ip-transparent: yes

and specific interface lines.

unbound.conf(5) was a bit confusing. nlnetlabs man page was a bit more enlightening:

Allows you to bind to non-local interfaces. For example for non-existent IP addresses that are going to exist later on, with host failover configuration.

And that did the trick.

DocWhoZee
@docwhozee
Close-up photograph capturing a vibrant hibiscus plant featuring striking magenta-purple flowers and large, deeply lobed green leaves. The primary flower, positioned in the center-right of the frame, has a ruffled, velvety texture and a darker center. Its color stands out vividly against the deep green foliage. — ALT text gemma4:12b-mlx
Close-up photograph capturing a vibrant hibiscus plant featuring striking magenta-purple flowers and large, deeply lobed green leaves. The primary flower, positioned in the center-right of the frame, has a ruffled, velvety texture and a darker center. Its color stands out vividly against the deep green foliage. — ALT text gemma4:12b-mlx
:neofox_happy_blep@federation.network: 1
DocWhoZee
@docwhozee
This wide-angle landscape photograph captures a serene autumn scene in a grassy field. The foreground is dominated by dry, golden-brown grass, which is illuminated by a low-hanging sun, casting a long, elongated shadow of the photographer (holding a camera) directly towards the viewer.  In the middle ground, several deciduous trees stand out with vibrant yellow and orange autumn foliage. A particularly large, full-canopied tree stands on the right side of the frame. Behind the trees, a thin line of darker greenery and a few small buildings are visible on the horizon.  The sky is filled with a thick layer of grey and white clouds, with small patches of blue peeking through. The lighting is atmospheric, highlighting the rich, warm tones of the autumn leaves and the dry grass against the cooler, moody colors of the overcast sky. — ALT text generated by gemma4:12b-mlx.
This wide-angle landscape photograph captures a serene autumn scene in a grassy field. The foreground is dominated by dry, golden-brown grass, which is illuminated by a low-hanging sun, casting a long, elongated shadow of the photographer (holding a camera) directly towards the viewer. In the middle ground, several deciduous trees stand out with vibrant yellow and orange autumn foliage. A particularly large, full-canopied tree stands on the right side of the frame. Behind the trees, a thin line of darker greenery and a few small buildings are visible on the horizon. The sky is filled with a thick layer of grey and white clouds, with small patches of blue peeking through. The lighting is atmospheric, highlighting the rich, warm tones of the autumn leaves and the dry grass against the cooler, moody colors of the overcast sky. — ALT text generated by gemma4:12b-mlx.

Glowing autumn tree with shadowy self-portrait thrown in for free.

#SelfPortrait #autumn #trees #sunset #iphonephotography #photography

DocWhoZee
@docwhozee
This vertical photograph captures a scenic, tranquil view from the vineyards overlooking the town of Iphofen. The perspective is from a slightly elevated position, looking down a winding, grey asphalt road that curves from the foreground into the center of the frame. The road is scattered with fallen autumn leaves and small bits of debris.  On the left side of the road, a steep hillside is covered in rows of grapevines, which have turned a vibrant golden-yellow, indicating the autumn season. On the right, a dense cluster of green trees and bushes borders the path. These two sides of greenery act as a natural frame for the expansive view in the center.  Beyond the vineyard, the landscape opens up to reveal the town of Iphofen, characterized by a cluster of white buildings with distinct orange-red roofs. Further out, a patchwork of green and brown agricultural fields stretches toward the horizon. In the middle distance, some white plumes of steam or smoke rise from a building near the edge of a wooded area.  The background features a soft, hazy horizon under a vast sky filled with pale grey and white clouds. The light is diffused and soft, suggesting either an overcast day or the gentle light of late afternoon. The overall composition uses the curve of the road as a leading line, drawing the viewer's eye from the immediate foreground into the heart of the valley. — ALT text generated by gemma4:12b-mlx
This vertical photograph captures a scenic, tranquil view from the vineyards overlooking the town of Iphofen. The perspective is from a slightly elevated position, looking down a winding, grey asphalt road that curves from the foreground into the center of the frame. The road is scattered with fallen autumn leaves and small bits of debris. On the left side of the road, a steep hillside is covered in rows of grapevines, which have turned a vibrant golden-yellow, indicating the autumn season. On the right, a dense cluster of green trees and bushes borders the path. These two sides of greenery act as a natural frame for the expansive view in the center. Beyond the vineyard, the landscape opens up to reveal the town of Iphofen, characterized by a cluster of white buildings with distinct orange-red roofs. Further out, a patchwork of green and brown agricultural fields stretches toward the horizon. In the middle distance, some white plumes of steam or smoke rise from a building near the edge of a wooded area. The background features a soft, hazy horizon under a vast sky filled with pale grey and white clouds. The light is diffused and soft, suggesting either an overcast day or the gentle light of late afternoon. The overall composition uses the curve of the road as a leading line, drawing the viewer's eye from the immediate foreground into the heart of the valley. — ALT text generated by gemma4:12b-mlx
❤ 1
A close-up, top-down view of a small, pale mushroom nestled in a plush bed of vibrant green moss and damp forest floor debris. The scene is filled with rich textures of decaying leaves in shades of brown and gold, scattered among dry pine needles, capturing the quiet, earthy atmosphere of a woodland floor in the Reichswald. — ALT text AI generated (gemma4:12b-mlx)
A close-up, top-down view of a small, pale mushroom nestled in a plush bed of vibrant green moss and damp forest floor debris. The scene is filled with rich textures of decaying leaves in shades of brown and gold, scattered among dry pine needles, capturing the quiet, earthy atmosphere of a woodland floor in the Reichswald. — ALT text AI generated (gemma4:12b-mlx)
❤ 1
A view from inside St. Markus Church in Erlangen, looking out toward Markus Platz through a lead-paned window. The window is composed of many small, textured panes in muted tones of clear, grey, and pale amber. The glass creates a soft, frosted effect, blurring the buildings and trees outside into a peaceful, painterly scene. — ALT text by gemma4:12b-mlx.
A view from inside St. Markus Church in Erlangen, looking out toward Markus Platz through a lead-paned window. The window is composed of many small, textured panes in muted tones of clear, grey, and pale amber. The glass creates a soft, frosted effect, blurring the buildings and trees outside into a peaceful, painterly scene. — ALT text by gemma4:12b-mlx.
❤ 1
DocWhoZee
@docwhozee
A moody autumn street scene in an Erlangen neighborhood. Rows of trees with vibrant gold and orange leaves line a street filled with parked cars, leading toward a wooded area in the distance. The sky is filled with dramatic, heavy grey clouds with bright white highlights, casting a soft, diffused light over the colorful fall foliage and urban buildings. — ALT text generated by gemma4:12b-mlx
A moody autumn street scene in an Erlangen neighborhood. Rows of trees with vibrant gold and orange leaves line a street filled with parked cars, leading toward a wooded area in the distance. The sky is filled with dramatic, heavy grey clouds with bright white highlights, casting a soft, diffused light over the colorful fall foliage and urban buildings. — ALT text generated by gemma4:12b-mlx
DocWhoZee
@docwhozee

Docker Compose Setup for Running Littlefedi

Once we have the Dockerfile for building a littlefedi docker image, we can then make use of it and setup docker compose for it:

networks:
  frontend:
    name: frontend
    external: true

services:
  littlefedi:
    image: littlefedi
    build: ./littlefedi
    environment:
      - LITTLEFEDI_AUTH_MFA_ENCRYPTION_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      - LITTLEFEDI_AUTH_REQUIRE_ADMIN_MFA=true
      - LITTLEFEDI_MEDIA_PROXY_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      - LITTLEFEDI_SMTP_PASSWORD=XXXXXXXXXXXXXXXXX
    ulimits:
      nofile: 65536
    restart: unless-stopped
    networks:
      - frontend
    volumes:
      - ./data:/data
      - ./config:/config
      - ./backup:/backup

Notes:

  • the frontend network is reverse-proxied through caddy

    xyzzy.cafe {
          reverse_proxy littlefedi:8080
    }
    
  • the Dockerfile and the littlefedi sources are located in a littlefedi subdirectory.

  • For the value of the environment variables, have a look at littlefedi's documents.

To give it all a spin:

docker compose build littlefedi
docker compose up

#littlefedi #DockerCompose

DocWhoZee
@docwhozee

Building Littlefedi Docker Image

xyzzy.cafe is powered by littlefedi. I'm running it inside a docker compose setup — which requires a littlefedi docker image to start with:

FROM golang:1.27 AS build

WORKDIR /usr/src/littlefedi

# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY src/go.mod src/go.sum ./
RUN go mod download

COPY src .
RUN make build-blog

FROM debian:trixie-slim
RUN apt-get update && \
    apt install -y --no-install-recommends ca-certificates gosu procps && \
    rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/src/littlefedi/littlefedi-blog /bin/littlefedi
EXPOSE 8080
# Create default app (UID/GID 1000)
RUN groupadd --gid 1000 app && \
    useradd --uid 1000 --gid 1000 --comment "" app
RUN mkdir /config 
RUN mkdir /data
RUN mkdir /backup
VOLUME /config
VOLUME /data
VOLUME /backup
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh

ENTRYPOINT ["entrypoint.sh"]
CMD ["/bin/littlefedi", "--config", "/config/littlefedi.toml"]

I'm using the "official" golang docker image here to build littlefedi from the expanded littlefedi source tar placed in the src subdirectory.

A couple of notes:

  • I want to have the blog-enabled variant of littlefedi, hence the make build-blog incantation.

  • I'm pretty much only interested in the littlefedi binary, thus, the multi-stage docker file: I pull a slim Debian image for the final docker image and copy the generated littlefedi-blog into it (renaming it to littlefedi).

  • To enable littlefedi to do TLS certificate verifications we need the ca-certificates package installed, we need gosu to run littelfedi as non-root, the procps package to install ps (for debugging).

  • Given that this is a slim docker container image I just went with

    instead of faffing around with linux filesystem hierarchy standard compliant folder names.

    • /config to hold the littlefedi.toml configuration file,
    • /data to store media
    • /backup to hold littlefedi's backups

To ensure that mounted volumes (/config, data, /backup) are accessible from outside the docker image entrypoint.sh obtains the UID and GID from the mounted /config volume and modifies the app user and group to match:

#!/bin/bash

CONFIG_UID=$(stat -c '%u' /config)
CONFIG_GID=$(stat -c '%g' /config)

usermod -u "${CONFIG_UID}" app
groupmod -g "${CONFIG_GID}" app

# ensure uid:gid are as intended for 
for v in /config /data /backup ; do
    chown -R app:app ${v}  
done

# run the passed-in args (or CMD if none provided)
exec gosu app "$@"

Using gosu we then run littelfedi (or whatever we pass in as commands) as user app:app.

#littlefedi #docker #dockerfile

DocWhoZee
@docwhozee
A brown leaf, fallen from a tree, on the ground had captured a tiny puddle. The tiny puddle reflected a piece of blue sky.
A brown leaf, fallen from a tree, on the ground had captured a tiny puddle. The tiny puddle reflected a piece of blue sky.

fall(en) leaf capturing a piece of blue sky

#photography #iphonephotography #fall #BlueSky