feat(app): add the Nostro app, a window for phones and desktops

Linux phones have no banking apps, and a command line is no answer on a
phone. The app does everything the nostro command does and, like it, only
talks to nostrod: it holds no key and no token.

- Nostro.Ui, a toolkit whose screens are functions that fill a frame, ported
  from imsd-messages ca5cd72d; Nostro.App, the app's state, forms and screens;
  Nostro.Ui.Shell, which puts them on a Wayland window with Crafter.Graphics;
  nostro-app; and Nostro.DebugCommands for the --debug-api build.
- Client: every method also in an asynchronous form for an sd-event loop,
  with DaemonMissing and OutcomeUnknown.
- nostrod's Flatpak is net.catcrafts.Nostrod now and the app takes
  net.catcrafts.Nostro; install.sh moves the state. The app's Flatpak, both
  Flatpaks cross-built for aarch64, and the licence texts they carry.
- nostro-fake-system, a made-up bus and bank with a real nostrod on them, to
  look at the app against. The README's screenshots are taken on it.
- The nostro command: an API key's environment is the key's own to say, so
  --sandbox is for bunq-oauth alone, and a virtual card is listed as VIRTUAL.

The published contract changes in three places, before any release (design
rule 10):
- Transactions' query takes `stored`: answered from what nostrod has stored,
  without asking the bank. The app searches with it; before, every search was
  a call to bunq.
- AddBunq's `environment` no longer chooses over what the key says of itself:
  a key of the other environment is refused.
- SetCardStatus refuses to freeze or unfreeze a virtual card. bunq reports one
  as DEACTIVATED however well it pays, and leaves it as it is when asked,
  without an error.

The app is GPL-3.0-only, the library stays LGPL-3.0-only, and no code moved
from one to the other (design rule 13). Transaction's schema is unchanged.

Verified: the 17 tests pass with every line, function and region of what they
link run, and the five lint runs are clean. Every screen was looked at on the
made-up system, at a phone's and a desktop's sizes in the light and the dark
look, on Plasma under Wayland. What is said of bunq's cards comes from its
sandbox, with throwaway users, and from one real virtual card. Known to have
been used against production: connecting, and reading accounts, payments and
cards. Not known to have been tried: a payment from the app against bunq,
OAuth against bunq, and anything on a phone.

Building the app takes --graphics=, a Crafter.Graphics checkout on its branch
claude/nostro-app, until that branch is merged and pinned here.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Jorijn van der Graaf 2026-11-19 12:27:14 +01:00
commit 5b4037955b
106 changed files with 17804 additions and 289 deletions

View file

@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
#
# The system half of nostro for Arch Linux: nostrod's user, its D-Bus and polkit policies, its systemd unit and the
# nostro command. nostrod and the CLI come from the net.catcrafts.Nostro Flatpak, installed system-wide
# nostro command. nostrod and the CLI come from the net.catcrafts.Nostrod Flatpak, installed system-wide
# (nostro-system.install says how). pacman's hooks create the user and reload systemd and D-Bus.
# Build in this directory: makepkg -si
pkgname=nostro-system

View file

@ -2,14 +2,25 @@
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
post_install() {
echo "nostrod and the nostro CLI come from a Flatpak; install it system-wide:"
echo " flatpak install --system net.catcrafts.Nostro.flatpakref"
echo "(packaging/flatpak/ in nostro's source), or from a local build: flatpak install --system <repo> net.catcrafts.Nostro"
echo "nostrod and the nostro CLI come from a Flatpak; install it system-wide, from the Catcrafts Flatpak repository:"
echo " flatpak remote-add --system --if-not-exists catcrafts https://flatpak.catcrafts.net/catcrafts.flatpakrepo"
echo " flatpak install --system catcrafts net.catcrafts.Nostrod"
echo "or from a local build: flatpak install --system <repo> net.catcrafts.Nostrod"
}
post_upgrade() {
# A nostrod still running keeps the old files until it ends.
systemctl try-restart nostrod.service
# nostrod's Flatpak was net.catcrafts.Nostro until the Nostro app took that id, and flatpak keeps an app's data under
# its id. The package and the Flatpaks update independently, so the move is left to the administrator.
if [ -d /var/lib/nostro/.var/app/net.catcrafts.Nostro ]; then
echo "nostrod's Flatpak is now net.catcrafts.Nostrod. Move its state once, as root:"
echo " systemctl stop nostrod.service"
echo " mv /var/lib/nostro/.var/app/net.catcrafts.Nostro /var/lib/nostro/.var/app/net.catcrafts.Nostrod"
echo " flatpak uninstall --system net.catcrafts.Nostro # only the old nostrod; the app has that id now"
echo " flatpak remote-add --system --if-not-exists catcrafts https://flatpak.catcrafts.net/catcrafts.flatpakrepo"
echo " flatpak install --system catcrafts net.catcrafts.Nostrod"
fi
}
pre_remove() {

View file

@ -23,8 +23,16 @@
Types:
connectors (Connectors) a(ssssb): name, bank ("bunq"), environment ("production" or "sandbox"),
auth ("api key" or "oauth"), whether a call to the bank works now
environment (AddBunq) empty: an API key says itself which it is of, a sandbox key by starting with
sandbox_. "production" or "sandbox" only has a key of the other one refused
(InvalidArgument), before anyone is asked and before the key goes anywhere.
AddBunqOAuth needs it named: nothing of an OAuth client says which it is of
connectors (Accounts) a(ssa(ssssx)): connector name, bank, accounts: name, BIC, IBAN, currency, balance
query (Transactions) a{sv}, each key optional: search s, amount x, from x, to x, limit t (100)
query (Transactions) a{sv}, each key optional: search s, amount x, from x, to x, limit t (100),
stored b (false). Transactions asks the bank for what is new before it
answers; with stored true it answers from what nostrod has stored alone, at
once and without the bank: for a search in a list it has just given. A key
nostrod does not know is ignored, so one from before `stored` asks the bank.
transactions a(sssssxxss): name, BIC, IBAN, description, currency, amount, time, the bank's
id, the bank's kind ("MASTERCARD/PAYMENT")
schedule (xaxsusax): start, end, unit (ONCE, HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY),
@ -37,7 +45,11 @@
drafts a(tssa((ss)sxs)s): id, status, created by, entries (counterparty, currency,
amount, description), bunq's time of its last change
cards / updated (tsssssssss): id, kind, product type, status, order status, name on card,
second line, last four digits, expiry, IBAN it pays from
second line, last four digits, expiry, IBAN it pays from. A card whose order
status is VIRTUAL_DELIVERY is a virtual one: bunq has it as DEACTIVATED however
well it pays, so that status says nothing of it until it is LOST, STOLEN,
CANCELLED or EXPIRED. SetCardStatus refuses to set such a card ACTIVE or
DEACTIVATED (InvalidArgument): bunq would leave it as it is, without an error
account / chosen (ssssx): the account apps' checkouts pay from (net.catcrafts.Nostro1.Checkout),
as in Accounts; DefaultCheckoutAccount has none until one is chosen, or once
it is gone. An account reached through OAuth cannot pay a shop, and is refused.

View file

@ -0,0 +1,139 @@
#!/bin/sh
# SPDX-License-Identifier: LGPL-3.0-only
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
# build-aarch64.sh: Nostro's two Flatpaks for aarch64, a phone's architecture, into an OSTree repository: the app
# (net.catcrafts.Nostro) and the service with the nostro command (net.catcrafts.Nostrod). crafter-build cross-compiles
# the executables against the sysroot of make-aarch64-sysroot.sh (run that first), and flatpak's build commands
# assemble them on org.freedesktop.Platform 26.08, with the libc++ they were linked against in /app/lib.
#
# packaging/flatpak/build-aarch64.sh <repo> [branch] # branch: stable by default
#
# The repository is created when it does not exist. On the phone, as root, with the repository copied over:
# packaging/system/install.sh --repo <repo> --app. The cache and $CRAFTER_REF are make-aarch64-sysroot.sh's.
# $NOSTRO_GRAPHICS names a Crafter.Graphics checkout's project.cpp for the app, for as long as project.cpp asks for one
# (--graphics=). Needs flatpak, flock, readelf and appstreamcli.
set -eu
REPO=${1:?usage: build-aarch64.sh <repo> [branch]}
BRANCH=${2:-stable}
APP_ID=net.catcrafts.Nostro
SERVICE_ID=net.catcrafts.Nostrod
ARCH=aarch64
TRIPLE=aarch64-unknown-linux-gnu
MULTIARCH=aarch64-linux-gnu
RUNTIME_VERSION=26.08
CRAFTER_REF=${CRAFTER_REF:-net.catcrafts.CrafterBuild//stable}
CACHE=${NOSTRO_FLATPAK_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/nostro-flatpak}
INSTALLATION="$CACHE/installation"
SYSROOT="$CACHE/sysroot-$ARCH"
LIBCXX="$CACHE/libcxx-$ARCH"
SRC=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd)
# flatpak commands that need the aarch64 Sdk and Platform see their installation; crafter-build runs from wherever it
# is installed.
withsdk() { FLATPAK_USER_DIR="$INSTALLATION" "$@"; }
command -v readelf >/dev/null 2>&1 || { echo "readelf (binutils) is needed: the NEEDED checks below run on it" >&2; exit 1; }
# One build at a time on this cache: the build directories are removed and made again by every run.
mkdir -p "$CACHE"
exec 9>"$CACHE/lock"; flock 9
[ -f "$SYSROOT/.made-from" ] || { echo "no sysroot at $SYSROOT: run packaging/flatpak/make-aarch64-sysroot.sh first" >&2; exit 1; } # under the lock: a sysroot being made is not missing
# Generic armv8-a: a Flatpak is for any aarch64 machine, not one SoC. An output directory's name ends in a hash of the
# configuration, and an older variant left in bin/ would be a second match below: this run's are the only ones.
rm -rf "$SRC/bin/"*"-$TRIPLE-armv8-a-generic-"*
crafter() { (cd "$SRC" && flatpak run "$CRAFTER_REF" --march=armv8-a --mtune=generic --banks=bunq "$@" -- --target="$TRIPLE" --sysroot="$SYSROOT"); }
# The one executable of that name this run built. The library and the command are both called nostro, so a directory
# is told by what it holds.
built() {
name=$1
set -- "$SRC/bin/$name-$TRIPLE-armv8-a-generic-"*/"$name"
[ $# = 1 ] && [ -x "$1" ] || { echo "expected one $name for $TRIPLE under $SRC/bin, found: $*" >&2; exit 1; }
echo "$1"
}
echo ">> the executables for $TRIPLE"
crafter
crafter --product=daemon
crafter --product=app ${NOSTRO_GRAPHICS:+"--graphics=$NOSTRO_GRAPHICS"}
cli=$(built nostro)
daemon=$(built nostrod)
app=$(built nostro-app)
platform=$(withsdk flatpak --user info --show-location --arch="$ARCH" "org.freedesktop.Platform//$RUNTIME_VERSION")/files
# Every library an executable and the libraries it carries need is in the Platform or in /app/lib, or the first start
# would fail on the phone. And one unwinder: LLVM's libunwind, which the carried libc++abi uses, never the Platform's
# libunwind 8 beside it.
checked() {
files=$1
shift
missing=0
for elf in "$@" "$files/lib/"lib*.so.1; do
for lib in $(readelf -d "$elf" | sed -n 's/.*(NEEDED).*\[\(.*\)\]/\1/p'); do
if [ ! -e "$platform/lib/$MULTIARCH/$lib" ] && [ ! -e "$platform/lib/$lib" ] && [ ! -e "$files/lib/$lib" ]; then
echo "$(basename "$elf") needs $lib, which neither the Platform nor /app/lib has" >&2
missing=1
fi
done
if readelf -d "$elf" | grep -q 'NEEDED.*\[libunwind\.so\.8\]'; then
echo "$(basename "$elf") links libunwind 8, not LLVM's libunwind" >&2
missing=1
fi
done
[ "$missing" = 0 ] || exit 1
}
# What both carry: the C++ runtime they were linked against, and the licences of what is in them, which
# packaging/licenses/NOTICE names.
carried() {
files=$1
id=$2
mkdir -p "$files/lib"
cp -a "$LIBCXX/usr/lib/"libc++.so.1* "$LIBCXX/usr/lib/"libc++abi.so.1* "$LIBCXX/usr/lib/"libunwind.so.1* "$files/lib/"
install -Dm644 "$SRC/packaging/flatpak/$id.metainfo.xml" "$files/share/metainfo/$id.metainfo.xml"
install -Dm644 -t "$files/share/licenses/$id" "$SRC/LICENSE" "$SRC/LICENSE.GPL" "$SRC/packaging/licenses/NOTICE" \
"$SRC/packaging/licenses/nlohmann-json-MIT.txt" "$SRC/packaging/licenses/LLVM-LICENSE.TXT"
}
# The AppStream catalogue entry software centres list an app by, with PNG icons: appstreamcli's default, JPEG XL, is
# not read by older clients.
catalogued() {
appstreamcli compose --prefix=/ --origin="$2" --image-format=png \
--result-root="$1" --data-dir="$1/share/app-info/xmls" --icons-dir="$1/share/app-info/icons/flatpak" "$1"
}
mkdir -p "$(dirname "$REPO")"
echo ">> $SERVICE_ID from $cli and $daemon"
build="$CACHE/build-service-$ARCH"
rm -rf "$build"
withsdk flatpak build-init --arch="$ARCH" "$build" "$SERVICE_ID" org.freedesktop.Sdk org.freedesktop.Platform "$RUNTIME_VERSION"
files="$build/files"
install -Dm755 "$cli" "$files/bin/nostro"
install -Dm755 "$daemon" "$files/bin/nostrod"
carried "$files" "$SERVICE_ID"
checked "$files" "$files/bin/nostro" "$files/bin/nostrod"
catalogued "$files" "$SERVICE_ID"
# nostrod talks to the bank, and to the bus, logind and polkit on the system bus; the command talks to nostrod there.
# As packaging/flatpak/net.catcrafts.Nostrod.yaml has it for x86_64.
withsdk flatpak build-finish "$build" --command=nostro --share=network --socket=system-bus
withsdk flatpak build-export --arch="$ARCH" "$REPO" "$build" "$BRANCH"
echo ">> $APP_ID from $app"
build="$CACHE/build-app-$ARCH"
rm -rf "$build"
withsdk flatpak build-init --arch="$ARCH" "$build" "$APP_ID" org.freedesktop.Sdk org.freedesktop.Platform "$RUNTIME_VERSION"
files="$build/files"
# The app finds its fonts and the window library's shaders beside itself.
mkdir -p "$files/bin"
cp -a "$(dirname "$app")/." "$files/bin/"
carried "$files" "$APP_ID"
install -Dm644 "$SRC/packaging/flatpak/$APP_ID.desktop" "$files/share/applications/$APP_ID.desktop"
install -Dm644 "$SRC/packaging/flatpak/$APP_ID.svg" "$files/share/icons/hicolor/scalable/apps/$APP_ID.svg"
install -Dm644 -t "$files/share/licenses/$APP_ID" "$SRC/assets/OFL.txt" "$SRC/packaging/licenses/stb-LICENSE.txt" \
"$SRC/packaging/licenses/wayland-protocols-NOTICE.txt" "$SRC/packaging/licenses/Vulkan-Utility-Libraries-Apache-2.0.txt" \
"$SRC/packaging/licenses/libevdev-COPYING.txt"
checked "$files" "$files/bin/nostro-app"
catalogued "$files" "$APP_ID"
# The compositor, the graphics device, and nostrod on the system bus; the desktop's portals need no permission. As
# project.cpp has it for the x86_64 Flatpak crafter-build makes.
withsdk flatpak build-finish "$build" --command=nostro-app --socket=wayland --device=dri --system-talk-name=net.catcrafts.Nostro1
withsdk flatpak build-export --arch="$ARCH" "$REPO" "$build" "$BRANCH"
echo ">> done: app/$SERVICE_ID/$ARCH/$BRANCH and app/$APP_ID/$ARCH/$BRANCH in $REPO"

View file

@ -0,0 +1,138 @@
#!/bin/sh
# SPDX-License-Identifier: LGPL-3.0-only
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
# make-aarch64-sysroot.sh: what Nostro's aarch64 executables are cross-compiled against, for a phone. crafter-build's
# own Flatpak, which the x86_64 Flatpaks are built with, exists for x86_64 alone, so an aarch64 build is a cross build
# from it against this sysroot: the Freedesktop Sdk for aarch64 (glibc, OpenSSL, libsystemd, Wayland, xkbcommon, udev
# and the Vulkan loader, the libraries the Platform runtime has at run time) plus LLVM's libc++ of the release
# crafter-build itself carries, built for aarch64, which the runtime does not have.
#
# packaging/flatpak/make-aarch64-sysroot.sh
#
# Everything goes under $NOSTRO_FLATPAK_CACHE (default ${XDG_CACHE_HOME:-~/.cache}/nostro-flatpak), outside /tmp, which
# the crafter-build sandbox does not share:
# installation/ a flatpak installation of the aarch64 Sdk and Platform (build-aarch64.sh builds the apps on it)
# sysroot-aarch64/ the Sdk's files as usr/, with libc++ added
# libcxx-aarch64/ libc++, libc++abi and libunwind as installed, which the Flatpaks carry in /app/lib
# A sysroot made from the same Sdk commit, LLVM release and recipe is kept.
#
# Needs flatpak, flock, curl, tar, xz and sha256sum; crafter-build ($CRAFTER_REF, the Crafter.Build Flatpak) provides
# clang, cmake and ninja. Network: Flathub and the LLVM release on GitHub.
set -eu
ARCH=aarch64
TRIPLE=aarch64-unknown-linux-gnu
MULTIARCH=aarch64-linux-gnu
MARCH=armv8-a
RUNTIME_VERSION=26.08
# The LLVM release crafter-build itself carries, whose std module source it ships. The tarball and hash are the ones
# Crafter.Build's manifest builds that LLVM from.
LLVM_VERSION=23.1.2
LLVM_SHA256=c98bbef08a2b4c2613cd50e9aa9ae7b69b1fe6c16b2c40373bc0ab6116fdf78a
CRAFTER_REF=${CRAFTER_REF:-net.catcrafts.CrafterBuild//stable}
CACHE=${NOSTRO_FLATPAK_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/nostro-flatpak}
INSTALLATION="$CACHE/installation"
SYSROOT="$CACHE/sysroot-$ARCH"
LIBCXX="$CACHE/libcxx-$ARCH"
# The Sdk and the Platform for aarch64 go into a flatpak installation of their own; crafter-build is run from wherever
# it is installed.
sdkpak() { FLATPAK_USER_DIR="$INSTALLATION" flatpak --user "$@"; }
# Flathub's CDN answers 502 now and then, and flatpak reports a summary it could not fetch as a runtime that does not
# exist.
retry() {
for attempt in 1 2 3 4 5; do
"$@" && return 0
echo "attempt $attempt of 5 failed: $*" >&2
[ "$attempt" = 5 ] || sleep 30
done
return 1
}
mkdir -p "$CACHE"
# One run at a time on this cache: the sysroot and the LLVM build are removed and made again by a run that finds them
# stale.
exec 9>"$CACHE/lock"; flock 9
echo ">> the $ARCH Sdk and Platform $RUNTIME_VERSION into $INSTALLATION"
retry sdkpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
retry sdkpak install -y --noninteractive --no-related --arch="$ARCH" flathub \
"org.freedesktop.Sdk//$RUNTIME_VERSION" "org.freedesktop.Platform//$RUNTIME_VERSION"
retry sdkpak update -y --noninteractive --no-related --arch="$ARCH"
sdk=$(sdkpak info --show-location --arch="$ARCH" "org.freedesktop.Sdk//$RUNTIME_VERSION")
sdk_commit=$(sdkpak info --show-commit --arch="$ARCH" "org.freedesktop.Sdk//$RUNTIME_VERSION")
# A sysroot is kept while the Sdk commit, the LLVM release and this recipe stay the same.
stamp="sdk $sdk_commit llvm $LLVM_VERSION recipe $(sha256sum "$0" | cut -c1-16)"
if [ -f "$SYSROOT/.made-from" ] && [ "$(cat "$SYSROOT/.made-from")" = "$stamp" ] && [ -f "$LIBCXX/usr/lib/libc++.so.1" ]; then
echo ">> $SYSROOT is current ($stamp)"
exit 0
fi
echo ">> $SYSROOT from the Sdk at $sdk_commit"
rm -rf "$SYSROOT" "$LIBCXX"
mkdir -p "$SYSROOT"
# A copy: libc++ is installed into it, and the installation's files are hard links into its object store.
cp -a --reflink=auto "$sdk/files" "$SYSROOT/usr"
# Linker scripts and the dynamic linker's path name /lib.
ln -s usr/lib "$SYSROOT/lib"
# libc++'s linker script adds -lunwind, which would find the Sdk's libunwind 8 (in the multiarch directory, searched
# first) beside the LLVM libunwind its libc++abi uses: without the Sdk's link name it finds LLVM's.
rm "$SYSROOT/usr/lib/$MULTIARCH/libunwind.so"
src="$CACHE/llvm-project-$LLVM_VERSION.src"
tarball="$CACHE/llvm-project-$LLVM_VERSION.src.tar.xz"
if [ ! -d "$src/runtimes" ] || [ ! -d "$src/libc/shared" ]; then
echo ">> LLVM $LLVM_VERSION's runtimes source"
retry curl -fsSL -o "$tarball" "https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/llvm-project-$LLVM_VERSION.src.tar.xz"
got=$(sha256sum "$tarball" | cut -d' ' -f1)
[ "$got" = "$LLVM_SHA256" ] || { echo "llvm-project-$LLVM_VERSION.src.tar.xz: sha256 $got, expected $LLVM_SHA256" >&2; exit 1; }
rm -rf "$src" "$src.part"
mkdir -p "$src.part"
# Only part of the tree is unpacked; libc is among it because libc++'s from_chars parses floating point with LLVM
# libc's shared headers. It lands under $src only once complete: a tar cut short leaves nothing a later run would
# take for the source.
tar -xJf "$tarball" -C "$src.part" --strip-components=1 \
"llvm-project-$LLVM_VERSION.src/runtimes" "llvm-project-$LLVM_VERSION.src/libcxx" \
"llvm-project-$LLVM_VERSION.src/libcxxabi" "llvm-project-$LLVM_VERSION.src/libunwind" \
"llvm-project-$LLVM_VERSION.src/cmake" "llvm-project-$LLVM_VERSION.src/llvm/cmake" \
"llvm-project-$LLVM_VERSION.src/llvm/utils" "llvm-project-$LLVM_VERSION.src/third-party" \
"llvm-project-$LLVM_VERSION.src/libc"
mv "$src.part" "$src"
rm -f "$tarball"
fi
echo ">> libc++, libc++abi and libunwind $LLVM_VERSION for $TRIPLE"
build="$CACHE/libcxx-build-$ARCH"
rm -rf "$build"
# The classic layout (include/c++/v1, lib/) is where crafter-build looks in a sysroot. libc++abi unwinds with LLVM's
# libunwind, as crafter-build's own libc++ does. Programs come from the sandbox, never from the sysroot: the Sdk's own
# ninja and tools are aarch64 binaries. The C++ compiler cannot link a test program before there is a libc++ to link;
# the C compiler's check still runs.
flatpak run --command=sh "$CRAFTER_REF" -eu -c '
cmake -S "$1/runtimes" -B "$2" -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR="$3" \
-DCMAKE_SYSROOT="$4" \
-DCMAKE_MAKE_PROGRAM=/usr/bin/ninja \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY \
-DCMAKE_C_COMPILER=/app/bin/clang -DCMAKE_CXX_COMPILER=/app/bin/clang++ -DCMAKE_ASM_COMPILER=/app/bin/clang \
-DCMAKE_CXX_COMPILER_WORKS=ON \
-DCMAKE_C_COMPILER_TARGET="$5" -DCMAKE_CXX_COMPILER_TARGET="$5" -DCMAKE_ASM_COMPILER_TARGET="$5" \
-DCMAKE_AR=/app/bin/llvm-ar -DCMAKE_RANLIB=/app/bin/llvm-ranlib -DCMAKE_NM=/app/bin/llvm-nm \
-DCMAKE_C_FLAGS="-march=$6" -DCMAKE_CXX_FLAGS="-march=$6" \
-DCMAKE_INSTALL_PREFIX="$7/usr" \
"-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind" \
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
-DLIBCXXABI_USE_LLVM_UNWINDER=ON \
-DLIBCXX_INSTALL_MODULES=ON \
-DLLVM_INCLUDE_TESTS=OFF -DLIBCXX_INCLUDE_TESTS=OFF -DLIBCXXABI_INCLUDE_TESTS=OFF \
-DLIBUNWIND_INCLUDE_TESTS=OFF -DLIBCXX_INCLUDE_BENCHMARKS=OFF
ninja -C "$2" install
' sh "$src" "$build" "$ARCH" "$SYSROOT" "$TRIPLE" "$MARCH" "$LIBCXX"
rm -rf "$build"
grep -q "_LIBCPP_VERSION 230102" "$LIBCXX/usr/include/c++/v1/__config" || { echo "the installed libc++ headers are not $LLVM_VERSION" >&2; exit 1; }
cp -a "$LIBCXX/usr/." "$SYSROOT/usr/"
echo "$stamp" > "$SYSROOT/.made-from"
echo ">> done: $SYSROOT ($stamp)"

View file

@ -0,0 +1,17 @@
# SPDX-License-Identifier: GPL-3.0-only
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
[Desktop Entry]
Type=Application
Name=Nostro
GenericName=Banking
Comment=See your bank accounts and pay from them
Exec=nostro-app
Icon=net.catcrafts.Nostro
Terminal=false
Categories=Office;Finance;
Keywords=bank;banking;bunq;payment;money;IBAN;
StartupNotify=false
SingleMainWindow=true
X-KDE-FormFactor=handset;tablet;desktop;
X-Purism-FormFactor=Workstation;Mobile;

View file

@ -5,8 +5,8 @@ Branch=stable
Url=https://flatpak.catcrafts.net/repo/
SuggestRemoteName=catcrafts
Homepage=https://catcrafts.net
Comment=Banking client for Linux
Description=nostro and nostrod, its daemon; install it system-wide with the system files from packaging/system
Comment=Your bank accounts on a Linux phone or desktop
Description=The Nostro app; it needs Nostro's service, net.catcrafts.Nostrod, installed system-wide with its system files
Icon=
RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo
IsRuntime=false

View file

@ -1,27 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-License-Identifier: CC0-1.0 -->
<component type="console-application">
<component type="desktop-application">
<id>net.catcrafts.Nostro</id>
<name>Nostro</name>
<summary>Banking client for Linux</summary>
<summary>Your bank accounts on a Linux phone or desktop</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-3.0-only</project_license>
<project_license>GPL-3.0-only AND OFL-1.1</project_license>
<developer id="net.catcrafts">
<name>Catcrafts</name>
</developer>
<description>
<p>
Nostro talks to your bank's API directly: accounts, transactions, payments, requests, schedules, draft payments
and cards, for bunq so far. Its daemon, nostrod, runs as a system user of its own and keeps every local user's
bank connections where no program of theirs can read them; the nostro command asks it over the system bus, and
your password is asked for before anything moves money.
Nostro shows your bank accounts and pays from them, by talking to your bank's API directly: accounts and their
payments, paying now or on a schedule, requests for money, draft payments and cards. bunq is the bank it knows
so far.
</p>
<p>
Apps can have Nostro pay an order at checkout, from an account you chose, once you have confirmed the payment.
This is the app. It holds no key of yours: your bank connections are kept by Nostro's service, where no program
you run can read them, and your system asks for your password before anything moves money. The service,
net.catcrafts.Nostrod, is installed for the whole system together with a few system files; Nostro's README says
how.
</p>
</description>
<provides>
<binary>nostro</binary>
</provides>
<launchable type="desktop-id">net.catcrafts.Nostro.desktop</launchable>
<url type="homepage">https://catcrafts.net</url>
<supports>
<control>touch</control>
<control>pointing</control>
<control>keyboard</control>
</supports>
<recommends>
<display_length compare="ge">360</display_length>
</recommends>
<content_rating type="oars-1.1"/>
<releases>
<release version="0.1.0" date="2026-11-19">
<description>
<p>The first release: everything the nostro command does, in a window that fits a phone and a desktop.</p>
<ul>
<li>Accounts and their payments, with search and filters</li>
<li>Paying now, on a schedule or as a draft, and asking for money</li>
<li>Requests sent and received, scheduled payments and drafts</li>
<li>Cards: freeze, unfreeze, report lost or stolen</li>
<li>Bank connections with an API key or through OAuth, and the account apps are paid from at checkout</li>
</ul>
</description>
</release>
</releases>
</component>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-License-Identifier: GPL-3.0-only -->
<!-- SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts® -->
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128">
<rect x="8" y="8" width="112" height="112" rx="28" fill="#2e70ed"/>
<!-- A bank: a roof, the columns under it and the ground they stand on. -->
<path d="M64 27 102 47v7H26v-7z" fill="#ffffff"/>
<rect x="34" y="60" width="12" height="26" rx="2" fill="#ffffff"/>
<rect x="58" y="60" width="12" height="26" rx="2" fill="#ffffff"/>
<rect x="82" y="60" width="12" height="26" rx="2" fill="#ffffff"/>
<rect x="26" y="92" width="76" height="9" rx="3" fill="#ffffff"/>
</svg>

After

Width:  |  Height:  |  Size: 721 B

View file

@ -0,0 +1,13 @@
[Flatpak Ref]
Title=Nostro service
Name=net.catcrafts.Nostrod
Branch=stable
Url=https://flatpak.catcrafts.net/repo/
SuggestRemoteName=catcrafts
Homepage=https://catcrafts.net
Comment=The daemon and command behind the Nostro banking client
Description=nostrod and the nostro command; install it system-wide with the system files from packaging/system
Icon=
RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo
IsRuntime=false
GPGKey=GPG_KEY_BASE64_PLACEHOLDER

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-License-Identifier: CC0-1.0 -->
<component type="console-application">
<id>net.catcrafts.Nostrod</id>
<name>Nostro service</name>
<summary>The daemon and command behind the Nostro banking client</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-3.0-only</project_license>
<developer id="net.catcrafts">
<name>Catcrafts</name>
</developer>
<description>
<p>
Nostro talks to your bank's API directly: accounts, transactions, payments, requests, schedules, draft payments
and cards, for bunq so far. Its daemon, nostrod, runs as a system user of its own and keeps every local user's
bank connections where no program of theirs can read them; the nostro command and the Nostro app ask it over the
system bus, and your password is asked for before anything moves money.
</p>
<p>
Apps can have Nostro pay an order at checkout, from an account you chose, once you have confirmed the payment.
</p>
</description>
<url type="homepage">https://catcrafts.net</url>
<provides>
<binary>nostro</binary>
</provides>
<content_rating type="oars-1.1"/>
</component>

View file

@ -1,13 +1,15 @@
# SPDX-License-Identifier: LGPL-3.0-only
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
#
# nostro as a Flatpak: the CLI, which is the command, and nostrod, which systemd runs from it as the system user nostro
# (packaging/system/nostrod.service). Install it system-wide, with the system files packaging/system/install.sh or
# packaging/arch/PKGBUILD put in place; a Flatpak cannot install those itself.
# nostrod and the nostro command as a Flatpak: the CLI, which is the command, and nostrod, which systemd runs from it as
# the system user nostro (packaging/system/nostrod.service). Install it system-wide, with the system files
# packaging/system/install.sh or packaging/arch/PKGBUILD put in place; a Flatpak cannot install those itself. Its id was
# net.catcrafts.Nostro until the Nostro app took that name; install.sh moves the state of a nostrod installed under it.
#
# Built with crafter-build's own Flatpak as the base app, for its clang 23 and libc++, then stripped back to the two
# binaries and the three C++ runtime libraries they link. libssl, libcrypto and libsystemd come from the Platform.
app-id: net.catcrafts.Nostro
# binaries and the three C++ runtime libraries they link. libssl, libcrypto and libsystemd come from the Platform. That
# base app exists for x86_64 alone: the aarch64 Flatpak, for a phone, is a cross build, packaging/flatpak/build-aarch64.sh.
app-id: net.catcrafts.Nostrod
runtime: org.freedesktop.Platform
runtime-version: '26.08'
sdk: org.freedesktop.Sdk
@ -24,23 +26,19 @@ modules:
- name: nostro
buildsystem: simple
build-options:
# crafter-build fetches Crafter.Network, Crafter.Thread, Crafter.DB and Crafter.LintRules from git, unpinned (see
# AGENTS.md).
# crafter-build fetches Crafter.Network, Crafter.Thread, Crafter.DB and Crafter.LintRules from git, unpinned, and
# Crafter.Debug's build helper at a pinned commit (see AGENTS.md).
build-args:
- --share=network
# A baseline CPU: crafter-build builds for the building machine's own (-march=native) unless told otherwise.
env:
NOSTRO_MARCH: x86-64-v2
arch:
aarch64:
env:
NOSTRO_MARCH: armv8-a
build-commands:
- HOME="$PWD/.home" crafter-build --banks=bunq --march=$NOSTRO_MARCH --mtune=generic
- HOME="$PWD/.home" crafter-build --banks=bunq --product=daemon --march=$NOSTRO_MARCH --mtune=generic
# A baseline CPU: crafter-build builds for the building machine's own (-march=native) unless told otherwise.
- HOME="$PWD/.home" crafter-build --banks=bunq --march=x86-64-v2 --mtune=generic
- HOME="$PWD/.home" crafter-build --banks=bunq --product=daemon --march=x86-64-v2 --mtune=generic
- install -Dm755 "$(ls -t bin/nostro-*/nostro | head -n1)" /app/bin/nostro
- install -Dm755 "$(ls -t bin/nostrod-*/nostrod | head -n1)" /app/bin/nostrod
- install -Dm644 packaging/flatpak/net.catcrafts.Nostro.metainfo.xml -t /app/share/metainfo/
- install -Dm644 packaging/flatpak/net.catcrafts.Nostrod.metainfo.xml -t /app/share/metainfo/
# The licences of what it carries besides Nostro itself; packaging/licenses/NOTICE says what each text covers.
- install -Dm644 packaging/licenses/NOTICE packaging/licenses/nlohmann-json-MIT.txt packaging/licenses/LLVM-LICENSE.TXT -t /app/share/licenses/net.catcrafts.Nostrod/
sources:
- type: dir
path: ../..
@ -51,13 +49,12 @@ modules:
- build
cleanup-commands:
# The base app's toolchain is in /app too: keep what nostro needs at run time, its metainfo, and the licenses of what
# it ships: its own, which flatpak-builder recorded, and LLVM's, for libc++, libc++abi and libunwind.
# it ships: its own, which flatpak-builder recorded, and the ones the build put beside them.
- mkdir -p /var/tmp/keep/bin /var/tmp/keep/lib /var/tmp/keep/share/metainfo /var/tmp/keep/share/licenses
- cp -a /app/bin/nostro /app/bin/nostrod /var/tmp/keep/bin/
- cp -a /app/lib/libc++.so.1* /app/lib/libc++abi.so.1* /app/lib/libunwind.so.1* /var/tmp/keep/lib/
- cp -a /app/share/metainfo/net.catcrafts.Nostro.metainfo.xml /var/tmp/keep/share/metainfo/
- cp -a /app/share/licenses/net.catcrafts.Nostro /var/tmp/keep/share/licenses/
- install -Dm644 /app/share/licenses/net.catcrafts.CrafterBuild/llvm/LICENSE.TXT /var/tmp/keep/share/licenses/net.catcrafts.Nostro/llvm/LICENSE.TXT
- cp -a /app/share/metainfo/net.catcrafts.Nostrod.metainfo.xml /var/tmp/keep/share/metainfo/
- cp -a /app/share/licenses/net.catcrafts.Nostrod /var/tmp/keep/share/licenses/
- find /app -mindepth 1 -maxdepth 1 -exec rm -rf {} +
- cp -a /var/tmp/keep/. /app/
- rm -rf /var/tmp/keep

View file

@ -0,0 +1,279 @@
==============================================================================
The LLVM Project is under the Apache License v2.0 with LLVM Exceptions:
==============================================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---- LLVM Exceptions to the Apache 2.0 License ----
As an exception, if, as a result of your compiling your source code, portions
of this Software are embedded into an Object form of such source code, you
may redistribute such embedded portions in such Object form without complying
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
In addition, if you combine or link compiled forms of this Software with
software that is licensed under the GPLv2 ("Combined Software") and if a
court of competent jurisdiction determines that the patent provision (Section
3), the indemnity provision (Section 9) or other Section of the License
conflicts with the conditions of the GPLv2, you may retroactively and
prospectively choose to deem waived or otherwise exclude such Section(s) of
the License, but only in their entirety and only with respect to the Combined
Software.
==============================================================================
Software from third parties included in the LLVM Project:
==============================================================================
The LLVM Project contains third party software which is under different license
terms. All such code will be identified clearly using at least one of two
mechanisms:
1) It will be in a separate directory tree with its own `LICENSE.txt` or
`LICENSE` file at the top containing the specific license and restrictions
which apply to that software, or
2) It will contain specific license and restriction terms at the top of every
file.
==============================================================================
Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):
==============================================================================
University of Illinois/NCSA
Open Source License
Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:
LLVM Team
University of Illinois at Urbana-Champaign
http://llvm.org
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
* Neither the names of the LLVM Team, University of Illinois at
Urbana-Champaign, nor the names of its contributors may be used to
endorse or promote products derived from this Software without specific
prior written permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.

36
packaging/licenses/NOTICE Normal file
View file

@ -0,0 +1,36 @@
/app/share/licenses/<app-id> in Nostro's Flatpaks holds the licences of
what they carry.
The service with the nostro command (net.catcrafts.Nostrod):
- LICENSE and LICENSE.GPL (under nostro/ where flatpak-builder put them):
nostrod, the nostro command and the library they are built from
(LGPL-3.0-only: the GNU LGPL version 3, and the GNU GPL version 3 it adds
its permissions to). The Crafter libraries linked in statically are under
the same licence: Crafter.Network with Crafter.Thread, and Crafter.DB.
Their source: https://forgejo.catcrafts.net/Catcrafts/<name>.
- nlohmann-json-MIT.txt: nlohmann/json 3.12.0, which Nostro carries
(lib/json.hpp) and compiles in.
- LLVM-LICENSE.TXT: LLVM's libc++, libc++abi and libunwind in /app/lib
(the Apache License 2.0 with LLVM Exceptions, and for older code the
University of Illinois/NCSA licence).
The app (net.catcrafts.Nostro) carries those three, and:
- LICENSE.GPL: the app itself (GPL-3.0-only: the GNU GPL version 3).
Nostro's library is linked into it under the LGPL in LICENSE, as above,
and so are the Crafter libraries: those two, and Crafter.Graphics with
Crafter.Event, Crafter.Math and Crafter.Asset.
- OFL.txt: the Noto Sans font (the SIL Open Font License 1.1).
- stb-LICENSE.txt: stb_truetype and stb_image_write, which
Crafter.Graphics carries and compiles in.
- wayland-protocols-NOTICE.txt: the code wayland-scanner generated for
the xdg-shell, xdg-decoration-unstable-v1, fractional-scale-v1,
viewporter and text-input-unstable-v3 protocols, which Crafter.Graphics
carries and compiles in.
- Vulkan-Utility-Libraries-Apache-2.0.txt: vk_enum_string_helper.h of the
Vulkan Utility Libraries (Copyright 2023-2025 The Khronos Group Inc.,
Valve Corporation, LunarG, Inc.), which Crafter.Graphics compiles in:
the Apache License 2.0.
- libevdev-COPYING.txt: libevdev, which Crafter.Graphics carries and
builds as a static library (MIT).

View file

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,32 @@
SPDX-License-Identifier: MIT
Copyright © 2013 Red Hat, Inc.
Copyright © 2013 David Herrmann <dh.herrmann@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
The following license is from a Linux kernel header file and there is no GPL
code this package links to.
Copyright (c) 1999-2002 Vojtech Pavlik
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as published by
the Free Software Foundation.

View file

@ -0,0 +1,27 @@
MIT License
Copyright (c) 2013-2026 Niels Lohmann
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
nlohmann/json contains the UTF-8 decoder of Bjoern Hoehrmann
(Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>) and a
modified version of the Grisu2 algorithm of Florian Loitsch
(Copyright (c) 2009 Florian Loitsch), both under the MIT License above, and
a copy of Hedley of Evan Nemerson, which is in the public domain (CC0).

View file

@ -0,0 +1,47 @@
stb_truetype.h v1.26, Sean Barrett (lib/stb_truetype.h of Crafter.Graphics):
------------------------------------------------------------------------------
This software is available under 2 licenses -- choose whichever you prefer.
------------------------------------------------------------------------------
ALTERNATIVE A - MIT License
Copyright (c) 2017 Sean Barrett
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
ALTERNATIVE B - Public Domain (www.unlicense.org)
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and to
the detriment of our heirs and successors. We intend this dedication to be an
overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------
stb_image_write.h v1.02, Sean Barrett (lib/stb_image_write.h of Crafter.Graphics):
This software is dual-licensed to the public domain and under the following
license: you are granted a perpetual, irrevocable license to copy, modify,
publish, and distribute this file as you see fit.

View file

@ -0,0 +1,127 @@
The copyright and permission notices of the Wayland protocols whose
wayland-scanner code Crafter.Graphics carries and compiles in.
xdg-shell:
Copyright © 2008-2013 Kristian Høgsberg
Copyright © 2013 Rafael Antognolli
Copyright © 2013 Jasper St. Pierre
Copyright © 2010-2013 Intel Corporation
Copyright © 2015-2017 Samsung Electronics Co., Ltd
Copyright © 2015-2017 Red Hat Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
xdg-decoration-unstable-v1:
Copyright © 2018 Simon Ser
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
fractional-scale-v1:
Copyright © 2022 Kenny Levinsen
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
viewporter:
Copyright © 2013-2016 Collabora, Ltd.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
text-input-unstable-v3:
Copyright © 2012, 2013 Intel Corporation
Copyright © 2015, 2016 Jan Arne Petersen
Copyright © 2017, 2018 Red Hat, Inc.
Copyright © 2018 Purism SPC
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
the copyright holders not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission. The copyright holders make no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied
warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.

View file

@ -3,20 +3,29 @@
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
#
# Installs nostro for every user of this machine: the system files nostrod needs (its user, its D-Bus and polkit
# policies, its systemd unit, the nostro command) and the net.catcrafts.Nostro Flatpak, system-wide. Run as root.
# policies, its systemd unit, the nostro command) and the net.catcrafts.Nostrod Flatpak, system-wide. Run as root.
#
# install.sh the Flatpak from the system remote "catcrafts" (packaging/flatpak/net.catcrafts.Nostro.flatpakref
# sets it up: flatpak install --system net.catcrafts.Nostro.flatpakref)
# install.sh --repo DIR the Flatpak from a local repository, as flatpak-builder --repo=DIR makes one, for testing
# install.sh the Flatpaks from the system remote "catcrafts", the Catcrafts Flatpak repository, added with
# flatpak remote-add --system --if-not-exists catcrafts https://flatpak.catcrafts.net/catcrafts.flatpakrepo
# install.sh --repo DIR the Flatpaks from a local repository, as flatpak-builder --repo=DIR makes one, for testing
# install.sh --app the Nostro app too, net.catcrafts.Nostro, for every user (each user can install it for
# themselves instead)
#
# Running it again updates. packaging/arch/PKGBUILD installs the same files from a package; uninstall.sh removes them.
# Running it again updates. nostrod's Flatpak was net.catcrafts.Nostro until the app took that id: this moves the state a
# nostrod installed under it kept, and removes that Flatpak. packaging/arch/PKGBUILD installs the same system files from
# a package; uninstall.sh removes them.
set -eu
here=$(cd "$(dirname "$0")" && pwd)
repo=
if [ "${1:-}" = --repo ]; then
repo=$(cd "${2:?--repo needs a directory}" && pwd)
fi
app=false
while [ $# -gt 0 ]; do
case "$1" in
--repo) repo=$(cd "${2:?--repo needs a directory}" && pwd); shift 2 ;;
--app) app=true; shift ;;
*) echo "install.sh: unknown argument '$1'" >&2; exit 2 ;;
esac
done
install -Dm644 "$here/nostro.sysusers" /usr/lib/sysusers.d/nostro.conf
systemd-sysusers /usr/lib/sysusers.d/nostro.conf
@ -26,17 +35,39 @@ install -Dm644 "$here/net.catcrafts.Nostro1.Checkout.service" /usr/share/dbus-1/
install -Dm644 "$here/net.catcrafts.Nostro1.policy" /usr/share/polkit-1/actions/net.catcrafts.Nostro1.policy
install -Dm644 "$here/nostrod.service" /etc/systemd/system/nostrod.service
install -Dm755 "$here/nostro" /usr/local/bin/nostro
systemctl daemon-reload
if [ -n "$repo" ]; then
# A local repository is unsigned: for a build of your own, never for one from elsewhere.
flatpak remote-add --system --if-not-exists --no-gpg-verify nostro-local "file://$repo"
flatpak install --system -y --noninteractive --or-update nostro-local net.catcrafts.Nostro//stable
else
flatpak install --system -y --noninteractive --or-update catcrafts net.catcrafts.Nostro//stable
# A nostrod already running keeps the old files until it ends: stop it, and the next call starts the new one. Stopped, it
# also leaves its state alone while that moves.
systemctl stop nostrod.service
# flatpak keeps an app's data under the app's id, so nostrod's state followed the Flatpak's old id.
apps=/var/lib/nostro/.var/app
if [ -d "$apps/net.catcrafts.Nostro" ]; then
if [ -e "$apps/net.catcrafts.Nostrod" ]; then
echo "install.sh: both $apps/net.catcrafts.Nostro and $apps/net.catcrafts.Nostrod exist; keep the one that holds the bank connections as net.catcrafts.Nostrod, remove the other, and run this again" >&2
exit 1
fi
mv "$apps/net.catcrafts.Nostro" "$apps/net.catcrafts.Nostrod"
echo "moved nostrod's state from $apps/net.catcrafts.Nostro to $apps/net.catcrafts.Nostrod"
fi
# The app's Flatpak runs nostro-app; the old nostrod Flatpak ran nostro.
if flatpak info --system --show-metadata net.catcrafts.Nostro 2>/dev/null | grep -qx 'command=nostro'; then
flatpak uninstall --system -y --noninteractive net.catcrafts.Nostro
fi
remote=catcrafts
if [ -n "$repo" ]; then
# A local repository is unsigned: for a build of your own, never for one from elsewhere. The remote may be left from
# an earlier run with another directory.
remote=nostro-local
flatpak remote-add --system --if-not-exists --no-gpg-verify nostro-local "file://$repo"
flatpak remote-modify --system --no-gpg-verify --url="file://$repo" nostro-local
fi
flatpak install --system -y --noninteractive --or-update "$remote" net.catcrafts.Nostrod//stable
if [ "$app" = true ]; then
flatpak install --system -y --noninteractive --or-update "$remote" net.catcrafts.Nostro//stable
fi
systemctl daemon-reload
busctl call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus ReloadConfig
# A nostrod already running keeps the old files until it ends; stop it, and the next call starts the new one.
systemctl try-restart nostrod.service
echo "nostro is installed: nostrod starts with the first call, such as 'nostro connectors add bunq'"

View file

@ -2,7 +2,7 @@
# SPDX-License-Identifier: LGPL-3.0-only
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
#
# The nostro command: the CLI from the net.catcrafts.Nostro Flatpak, run as you. It asks nostrod over the system bus,
# The nostro command: the CLI from the net.catcrafts.Nostrod Flatpak, run as you. It asks nostrod over the system bus,
# and your session's polkit agent asks for your password before anything moves money. Install: /usr/bin/nostro (a
# package) or /usr/local/bin/nostro (install.sh).
@ -16,4 +16,4 @@ for old in "${XDG_CONFIG_HOME:-$HOME/.config}/nostro/connectors.json" "${XDG_CON
fi
done
exec /usr/bin/flatpak run --system net.catcrafts.Nostro//stable "$@"
exec /usr/bin/flatpak run --system net.catcrafts.Nostrod//stable "$@"

View file

@ -3,7 +3,7 @@
#
# nostrod: every local user's bank connections, one worker process per user, behind net.catcrafts.Nostro1 and
# net.catcrafts.Nostro1.Checkout on the system bus. The first call starts it (D-Bus activation), and it ends by itself
# once idle, so an updated Flatpak takes over at the next call. It runs from the net.catcrafts.Nostro Flatpak as the
# once idle, so an updated Flatpak takes over at the next call. It runs from the net.catcrafts.Nostrod Flatpak as the
# system user nostro, whose home, the state directory, holds the connections: no other user can read it.
#
# The hardening is what bubblewrap, which flatpak runs the daemon in, works under. Not here, because it breaks it:
@ -20,7 +20,7 @@ Type=dbus
BusName=net.catcrafts.Nostro1
User=nostro
Group=nostro
ExecStart=/usr/bin/flatpak run --system --no-session-bus --die-with-parent --command=nostrod net.catcrafts.Nostro//stable
ExecStart=/usr/bin/flatpak run --system --no-session-bus --die-with-parent --command=nostrod net.catcrafts.Nostrod//stable
StateDirectory=nostro
StateDirectoryMode=0700
# flatpak run needs a runtime directory, which a system user does not have.

View file

@ -8,7 +8,12 @@
set -u
systemctl stop nostrod.service 2>/dev/null
flatpak uninstall --system -y --noninteractive net.catcrafts.Nostro 2>/dev/null
flatpak uninstall --system -y --noninteractive net.catcrafts.Nostrod 2>/dev/null
# A nostrod installed before the Nostro app took its id, net.catcrafts.Nostro. The app itself stays: it is an app like
# any other, removed with flatpak uninstall.
if flatpak info --system --show-metadata net.catcrafts.Nostro 2>/dev/null | grep -qx 'command=nostro'; then
flatpak uninstall --system -y --noninteractive net.catcrafts.Nostro 2>/dev/null
fi
flatpak remote-delete --system nostro-local 2>/dev/null
rm -f /usr/share/dbus-1/system.d/net.catcrafts.Nostro1.conf \
/usr/share/dbus-1/system-services/net.catcrafts.Nostro1.service \