Skip to content

threadwaste/landing-pod

Repository files navigation

landing-pod

A tiny web server that reads bookmarks from a nb notebook and serves an index. Built to be used from any device on your network.

landing-pod filtered to the #clothing tag

What it does

nb stores bookmarks as a markdown file within a notebook. landing-pod walks the notebook, parses each *.bookmark.md for its title, URL, and tags; honors the notebook's .pindex for pin order; and serves a single HTML page with:

  • A bookmark index. Pinned items appear first.
  • A tag selector that filters via query string (/?tag=foo)
  • Re-parsing on every request, so edits (or git commits) to the notebook show up on refresh.

Quick start

cargo run --release -- <notebook> [port]

Port defaults to 3000. The notebook directory is resolved as $NB_DIR/<notebook>, or ~/.nb/<notebook> if $NB_DIR is unset.

cargo run --release -- bookmarks 8080
open http://localhost:8080

Deploying remotely

landing-pod is intentionally just "directory in, HTTP out." It doesn't pull, sync, or speak git. Pair it with whatever sync mechanism fits.

Possible patterns:

  1. On the same host where you work with a copy of your notebook
  2. Keep a checked out copy in sync (e.g., systemd timer)

Docker

The provided Dockerfile is built on ghcr.io/linuxserver/baseimage-alpine and follows the linuxserver.io conventions: PUID/PGID for host UID/GID mapping, TZ for timezone, s6-overlay for signal handling and supervision.

docker build -t landing-pod .
docker run -d \
  --name landing-pod \
  -e NOTEBOOK=bookmarks \
  -e PUID=$(id -u) \
  -e PGID=$(id -g) \
  -e TZ=America/New_York \
  -v ~/.nb:/nb:ro \
  -p 3000:3000 \
  --restart unless-stopped \
  landing-pod

Or with compose:

services:
  landing-pod:
    build: .
    container_name: landing-pod
    environment:
      - NOTEBOOK=bookmarks
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
    volumes:
      - ~/.nb:/nb:ro
    ports:
      - 3000:3000
    restart: unless-stopped
Variable Default Purpose
NOTEBOOK bookmarks Notebook name under /nb to serve
PORT 3000 HTTP port (also EXPOSEd)
BIND_ADDRESS 0.0.0.0 in the image (127.0.0.1 outside) Address the binary binds to. Docker needs 0.0.0.0 so port-forwarding works.
PUID / PGID 911 UID/GID the process runs as (set to match your host user)
TZ unset Timezone, e.g. America/New_York

Mount your nb root at /nb — landing-pod only reads, so :ro is safe.

Architecture

Path Role
src/lib.rs + src/nb.rs Parses nb's .bookmark.md format and .pindex.
src/main.rs HTTP server (tiny_http)
src/render.rs Server-side HTML generation via maud.
assets/ Static web assets.

License

MIT — see LICENSE.

About

a tiny web server that reads bookmarks from a nb notebook and serves an index. built to be used from any device on your network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors