Erste Schritte¶
Die englische Version dieser Seite ist neuer. Englische Version lesen.
Voraussetzungen¶
-
Docker mit dem Compose-v2-Plugin, Version 2.23.1 oder neuer. Prüfe das mit
docker compose version. Ältere Versionen können die Inline-Konfiguration in der Compose-Datei nicht lesen. Docker Desktop enthält das Plugin. Bei einer reinen Docker Engine unter Linux installierst du es aus dem Paket-Repository von Docker (https://docs.docker.com/compose/install/linux/). Unter macOS mit Colima installierst du es mit Homebrew und verlinkst es als Docker-Plugin: -
Ein Host mit Linux, macOS oder Windows (amd64 oder arm64)
- Mindestens 1 GB freier RAM für CashPilot und die verwalteten Dienste
- Ein CashPilot pro Docker-Host. Siehe die Warnung unten.
Ein CashPilot pro Docker-Host
Betreibe nicht zwei CashPilot-Installationen auf einem Docker-Host. Die Compose-Dateien
verwenden feste Container-Namen (cashpilot-ui, cashpilot-worker,
cashpilot-socket-proxy), daher scheitert eine zweite Kopie der Datei an einem
Namenskonflikt. Benennst du sie um, um daran vorbeizukommen, teilen sich die beiden
Installationen trotzdem den Host. Jeder Worker verwaltet jeden Container, der die
Labels von CashPilot trägt, egal welche Installation ihn erstellt hat. Jedes Dashboard
listet, stoppt und ersetzt also die Verdienst-Apps des anderen. Die beiden teilen sich
außerdem das Netzwerk cashpilot-isolated, die Namen der Verdienst-Apps (cashpilot-<service>),
ihre Host-Ports und Volumes wie mysterium-data. Für eine zweite
Installation nimm einen anderen Host oder eine VM. Um Verdienst-Apps auf weiteren Servern
laufen zu lassen, füge stattdessen einem Dashboard weitere Worker hinzu (Flotte).
Schnellstart¶
1. Compose-Datei holen und starten¶
curl -fsSLO https://raw.githubusercontent.com/GeiserX/CashPilot/main/docker-compose.yml
docker compose up -d
Das startet drei dauerhaft laufende Container. Vor ihnen läuft bei jedem up ein einmaliger
cashpilot-migrate und beendet sich mit Code 0, daher zeigt
docker compose ps -a ihn als Exited (0). Das ist normal.
| Container | Port | Zweck |
|---|---|---|
| cashpilot-migrate | keiner | Läuft einmal und beendet sich. Er verschiebt Daten, die ein älteres Release angelegt hat, auf Volumes, die der Socket-Proxy akzeptiert, und findet bei einer neuen Installation nichts zu tun |
| cashpilot-ui | 8080 | Web-Dashboard, Erfassung der Einnahmen, Dienstkatalog |
| cashpilot-worker | 8081 | Docker-Agent, der die Container der Dienste bereitstellt und überwacht |
| cashpilot-socket-proxy | keiner | Hält den Docker-Socket und gibt dem Worker eine gefilterte Kopie (Sicherheitsvoreinstellungen) |
2. Dashboard öffnen¶
Öffne http://localhost:8080 in deinem Browser. Da noch kein Konto existiert, landest du auf der Willkommensseite, die das Eigentümerkonto anlegt.
Port 8080 schon belegt?
Wähle in einer .env-Datei neben docker-compose.yml einen anderen Host-Port,
statt die Compose-Datei zu bearbeiten:
Öffne dann http://localhost:8088. Lass den Wert in .env stehen, denn das
In-App-Update liest diese Datei und nicht deine Shell. (printf beginnt mit einem
Zeilenumbruch, damit die Zeile nie an die letzte Zeile einer vorhandenen .env angehängt wird.)
Die Variable braucht eine docker-compose.yml, deren ports:-Zeile
${CASHPILOT_UI_PORT:-8080}:8080 lautet. Die Datei aus v1.61 und älter legt
8080:8080 fest und ignoriert sie. Lade die aktuelle Datei herunter oder
behalte deine eigene bearbeitete Port-Zuordnung: Das In-App-Update akzeptiert auch diese.
Setup-Token für den ersten Start nötig
Beim ersten Start erzeugt CashPilot ein einmaliges Setup-Token und schreibt es in die Logs des Containers cashpilot-ui:
Suche nach einer Zeile wie dieser:
FIRST-RUN SETUP: no account exists yet. Open /register and enter this
one-time setup token to create the owner account: <token>
Kopiere dieses Token in das Feld Setup token (Setup-Token) im Schritt Owner account (Eigentümerkonto) der Willkommensseite, zusammen mit einem Benutzernamen und einem Passwort, um das erste Konto (das Eigentümerkonto) anzulegen. Es erscheint nur in den Logs, nie in einer URL, und wird endgültig verworfen, sobald das Eigentümerkonto existiert.
3. Dienstkatalog durchsehen¶
Die Seite Catalog (Katalog) listet jeden Dienst mit seinen Plattformen, einer monatlichen Schätzung und dem, was er braucht (Residential-IP, GPU). Filtere nach Kategorie (Bandwidth, DePIN, Storage, Compute, Mining) oder suche nach Namen. Add (Hinzufügen) öffnet den Einrichtungsassistenten für diesen Dienst, Details (Details) zeigt seine Beschreibung, seine Auszahlungen und das Risiko der Bereitstellung, und Dienste, die nicht in Docker laufen, bekommen stattdessen einen Link Visit (Besuchen).
Zwei Arten von Diensten solltest du dir vorher genauer ansehen: Dienste, die erst zahlen, wenn du einen Token-Stake hinterlegst, etwa Anyone Protocol, Sia und Flux, und Relays, die deine IP veröffentlichen, was die Zahlungen von Bandbreiten-Apps für Residential-IPs senken kann. Siehe Zwei Dinge vor dem Bereitstellen prüfen.
4. Dienste mit dem Assistenten hinzufügen¶
Sobald das Eigentümerkonto existiert, öffnet Add services (Dienste hinzufügen) den Einrichtungsassistenten; später öffnet ihn die Schaltfläche + Add service (+ Dienst hinzufügen) in der oberen Leiste erneut. Wähle Kategorien, dann Dienste. Für jeden Dienst zeigt der Assistent einen Link Sign Up (Registrieren), fragt nur die Zugangsdaten ab, die dieser Dienst braucht (E-Mail und Passwort, API-Token und so weiter), und lässt dich die Worker wählen, auf denen er laufen soll. Klicke auf Deploy (Bereitstellen), und CashPilot lädt das Image, erstellt den Container und beginnt, ihn zu überwachen.
5. Auf dem Dashboard verfolgen¶
Das Dashboard zeigt jeden bereitgestellten Dienst mit seinem Status und Guthaben, und die Seite Fleet (Flotte) zeigt jeden Worker.
So funktioniert es¶
graph LR
A[User] -->|Browse & Configure| B[CashPilot UI<br>Port 8080]
B -->|Deploy Commands| C[CashPilot Worker<br>Port 8081]
C -->|Docker API| D[Service Containers]
D -->|Health & Status| C
C -->|Heartbeat| B
B -->|Collect Earnings| E[Service APIs]
E -->|Balance Data| B
- Du konfigurierst Dienste über die Web-UI: Dienst wählen, Zugangsdaten eingeben, bereitstellen.
- Die UI sendet die Container-Spezifikation (Image, Umgebungsvariablen, Volumes) per REST-API an den Worker.
- Der Worker erstellt den Docker-Container und beginnt, seinen Zustand zu überwachen.
- Der Worker meldet den Container-Status alle 60 Sekunden per Lebenszeichen an die UI zurück.
- Die UI erfasst die Einnahmen aus den APIs der Dienste nach einem einstellbaren Zeitplan (Standard: jede Stunde).
- Das Dashboard zeigt zusammengefasste Einnahmen, Aufschlüsselungen pro Dienst und den Zustand der Container.
Konfiguration¶
Umgebungsvariablen der UI¶
| Variable | Standard | Beschreibung |
|---|---|---|
TZ |
UTC |
Zeitzone für Zeitplanung und Anzeige |
CASHPILOT_SECRET_KEY |
(automatisch erzeugt) | Signaturschlüssel für Anmeldesitzungen. Gespeichert unter /data/.secret_key. Verschlüsselt keine Zugangsdaten |
CASHPILOT_ENCRYPTION_KEY |
(automatisch erzeugt) | Fernet-Schlüssel, der gespeicherte Zugangsdaten im Ruhezustand verschlüsselt. Gespeichert unter /data/.fernet_key. Wird nur verwendet, wenn diese Datei fehlt, und nie in /data geschrieben. CASHPILOT_ENCRYPTION_KEY_FILE (ein Pfad) hat Vorrang vor beiden: siehe Verschlüsselungsschlüssel außerhalb des Datenordners |
CASHPILOT_API_KEY |
(aus /fleet) |
Gemeinsamer Aufnahmeschlüssel für Worker. Jeder Worker bekommt bei der Aufnahme seinen eigenen Schlüssel; siehe Flotte |
CASHPILOT_COLLECT_INTERVAL |
60 |
Minuten zwischen zwei Erfassungsläufen der Einnahmen |
CASHPILOT_UI_PORT |
8080 |
Host-Port, auf dem die UI veröffentlicht wird. Setze ihn in .env, wenn 8080 belegt ist |
CASHPILOT_BIND_ADDR |
127.0.0.1 |
Host-Schnittstelle, auf der der UI-Port veröffentlicht wird. Standardmäßig Loopback: Das Dashboard kann dem Worker mit Docker-Socket Befehle geben, daher ist es ab Werk nicht in deinem Netzwerk erreichbar. Setze eine bestimmte IP (z. B. eine Tailscale- oder VPN-Adresse) oder 0.0.0.0, um es freizugeben, oder (besser) betreibe davor einen Reverse Proxy mit Authentifizierung |
Der Web-Port der UI im Container ist fest auf 8080 eingestellt (über das CMD des Containers). CASHPILOT_UI_PORT und CASHPILOT_BIND_ADDR bestimmen nur den Host-Port und die Schnittstelle, auf denen er veröffentlicht wird.
Umgebungsvariablen des Workers¶
| Variable | Standard | Beschreibung |
|---|---|---|
TZ |
UTC |
Zeitzone |
CASHPILOT_UI_URL |
-- | URL des UI-Containers, z. B. http://cashpilot-ui:8080 |
CASHPILOT_API_KEY |
-- | Muss dem Aufnahmeschlüssel der UI entsprechen. Nur für die Aufnahme nötig; danach verwendet der Worker seinen eigenen Schlüssel |
CASHPILOT_WORKER_NAME |
(Hostname) | Anzeigename dieses Workers im Flotten-Dashboard |
CASHPILOT_WORKER_URL |
(automatisch erkannt) | URL, über die die UI diesen Worker erreicht, z. B. http://192.168.1.50:8081. Setze sie bei Flotten über mehrere Hosts ausdrücklich: Die automatische Erkennung kann eine nicht erreichbare, container-interne IP melden |
CASHPILOT_WORKER_BIND_ADDR |
127.0.0.1 |
Nur Compose für Flotten und entfernte Worker (docker-compose.fleet.yml): Host-Schnittstelle, auf der der API-Port des Workers mit Docker-Socket veröffentlicht wird, standardmäßig Loopback. Die Standard-docker-compose.yml veröffentlicht Port 8081 überhaupt nicht. Die Worker-API kann jeden Container bereitstellen und stoppen (= root auf dem Host), binde also bei einem entfernten Worker eine private oder VPN-Schnittstelle (z. B. eine Tailscale-IP), niemals eine öffentliche IP |
CASHPILOT_PORT |
8081 |
Port, den der Worker der UI mitteilt. Er ändert nicht den Port, auf dem der Worker lauscht; der ist durch das CMD des Images festgelegt; siehe die Konfigurationsreferenz |
Docker-Compose-Beispiel¶
# CashPilot - Self-hosted passive income orchestrator
# https://github.com/GeiserX/CashPilot
#
# UI + Worker on the same server. For multi-server fleet, see docker-compose.fleet.yml
#
# Start / update: docker compose pull && docker compose up -d
#
# ONE CashPilot per Docker host. The container names in this file are fixed,
# and a worker manages every container on its Docker engine that carries
# CashPilot's labels, whichever install made it. A second install on the same
# host would list, stop and replace the first one's earners. Put it on another
# host or VM. docs/getting-started.md has the details.
#
# Images are PINNED to a major.minor tag, which is what the lines below say.
# `docker compose pull && up -d` therefore gets the newest patch of that series,
# not the newest release overall. To move to a newer series, read UPGRADING.md
# first, then edit the tags on the UI host first and on every worker after it.
#
# This header used to claim the file tracked `latest` while pinning 1.4, and the
# string `:latest` it told you to replace did not appear anywhere. Following the
# quickstart therefore installed a version many releases behind, and issue #188
# is someone hitting a first-run bug that had been fixed for months because of
# it. Keep this comment honest about what the file actually does.
# See https://hub.docker.com/r/drumsergio/cashpilot/tags for available tags.
# NOTE: versions before 1.0.0 predate the per-worker fleet-key auth cutover and
# are not compatible with a worker running 1.x -- pin UI and worker together.
# Building from source? Use: docker compose -f docker-compose.build.yml up -d
services:
cashpilot-ui:
image: drumsergio/cashpilot:3.3
pull_policy: always
container_name: cashpilot-ui
# Published on loopback by default: the dashboard can command the Docker-socket
# worker, so it must not be exposed to your LAN/the internet out of the box.
# To reach it from another machine, point CASHPILOT_BIND_ADDR at a specific
# interface (e.g. a Tailscale/VPN IP) or, better, run an authenticating reverse
# proxy in front. CASHPILOT_BIND_ADDR=0.0.0.0 publishes on all interfaces.
# Host port 8080 already taken? Set CASHPILOT_UI_PORT=8088 (and CASHPILOT_BIND_ADDR)
# in a .env file next to this compose file, not on the command line. The in-app
# update reads .env and never sees your shell. The container port stays 8080.
ports:
- "${CASHPILOT_BIND_ADDR:-127.0.0.1}:${CASHPILOT_UI_PORT:-8080}:8080"
volumes:
- cashpilot_data:/data
- cashpilot_fleet_owned:/fleet
environment:
- TZ=${TZ:-UTC}
- CASHPILOT_SECRET_KEY=${CASHPILOT_SECRET_KEY:-}
# Optional: only needed to RESTORE credentials onto a fresh volume.
# An existing /data/.fernet_key always wins, so setting this is safe.
- CASHPILOT_ENCRYPTION_KEY=${CASHPILOT_ENCRYPTION_KEY:-}
- CASHPILOT_ALLOW_EPHEMERAL_KEY=${CASHPILOT_ALLOW_EPHEMERAL_KEY:-false}
- CASHPILOT_API_KEY=${CASHPILOT_API_KEY:-}
- CASHPILOT_ADMIN_API_KEY=${CASHPILOT_ADMIN_API_KEY:-}
# Optional bearer key for reporting only (Home Assistant, Grafana,
# cashpilot-mcp with CASHPILOT_READ_ONLY=true). See docs/configuration.md.
- CASHPILOT_READONLY_API_KEY=${CASHPILOT_READONLY_API_KEY:-}
# Optional Prometheus /metrics. true serves it; set a token to require
# Authorization: Bearer. See docs/guides/prometheus-metrics.md.
- CASHPILOT_METRICS_ENABLED=${CASHPILOT_METRICS_ENABLED:-false}
- CASHPILOT_METRICS_TOKEN=${CASHPILOT_METRICS_TOKEN:-}
# Optional CAPTCHA on the sign-in page, for a UI the internet can reach:
# turnstile, hcaptcha or recaptcha (v2 checkbox), plus both keys. Empty = off.
# See docs/security-defaults.md, "Protect the sign-in page with a CAPTCHA".
- CASHPILOT_CAPTCHA_PROVIDER=${CASHPILOT_CAPTCHA_PROVIDER:-}
- CASHPILOT_CAPTCHA_SITE_KEY=${CASHPILOT_CAPTCHA_SITE_KEY:-}
- CASHPILOT_CAPTCHA_SECRET_KEY=${CASHPILOT_CAPTCHA_SECRET_KEY:-}
# Warn when a container misses a later catalog fix. false turns it off.
- CASHPILOT_DRIFT_WARNINGS=${CASHPILOT_DRIFT_WARNINGS:-true}
init: true
# The image declares its own HEALTHCHECK, so `docker ps` will show
# "(unhealthy)" when the app stops answering. NOTHING ACTS ON THAT BY
# DEFAULT: `restart: unless-stopped` restarts a container that EXITS, and a
# container failing its healthcheck is still running. It will sit there
# unhealthy indefinitely. (Docker Swarm reschedules unhealthy tasks; plain
# Compose does not.)
#
# To act on it, either alert on it -- see the CashPilotDown rule in
# docs/guides/prometheus-metrics.md -- or add an autoheal sidecar, which is
# documented in the same place along with the fact that it needs the Docker
# socket, i.e. root on the host.
restart: unless-stopped
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:size=64M
# cashpilot_fleet_owned is filled by cashpilot-migrate on an upgrade.
depends_on:
cashpilot-migrate:
condition: service_completed_successfully
# Where the UI reaches the worker. Labelled for the proxy, so the in-app
# update may attach the worker to it.
networks:
- cashpilot_owned
# Runs once at every `docker compose up`, before the proxy, and exits.
# Releases before owner isolation made volumes and the LAN fence's network
# without the proxy's owner label, and Docker cannot add a label later, so
# this copies each one to a backup, recreates it with the label, copies the
# data back and checks it, then recreates the service container as it was.
# The backups (<volume>-pre-isolation) and the volumes this file renamed are
# never deleted: UPGRADING.md says how to remove them. It holds the raw
# socket only while it runs; a second run finds nothing to do.
cashpilot-migrate:
image: drumsergio/cashpilot-worker:3.3
pull_policy: always
container_name: cashpilot-migrate
user: "0:0"
entrypoint: ["python", "-m", "app.owner_migrate"]
environment:
# old=new compose volume keys: the data moves into the labelled volume.
- CASHPILOT_MIGRATE_COMPOSE_VOLUMES=cashpilot_worker_data=cashpilot_worker_data_owned,cashpilot_fleet=cashpilot_fleet_owned
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# Each step it finished, so a run killed halfway is completed by the next.
# A folder, not a volume: the in-app update runs docker compose through
# the proxy, and Compose checks every volume of the worker's dependencies,
# this one included, which the proxy will not let the worker see.
- ./cashpilot-migrate-state:/state
network_mode: none
restart: "no"
healthcheck:
disable: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
# Holds the host's Docker socket so the worker does not have to. It serves
# a filtered copy in the cashpilot_docker_api volume and refuses every call
# the worker does not make: a privileged container, a bind of / or of the
# socket, a capability or device outside the catalog's, exec of anything but
# the catalog's readers, swarm, plugins, builds. The policy is the configs
# block at the end of this file. docs/security-defaults.md has the details.
#
# Pinned by digest and bumped on purpose; the in-app update never recreates
# it (it runs `up --no-deps` on the UI and worker only).
cashpilot-socket-proxy:
image: codeswhat/sockguard:2.4.10@sha256:af66f6dcab2d6c04c4a45823ea9b72549985bf1957dea3bb4382c1515ab9461e
container_name: cashpilot-socket-proxy
# Root with no capabilities: uid 0 opens the root-owned host socket, and
# group 1000 (the worker's) lets it give the worker its socket.
user: "0:0"
group_add:
- "1000"
cap_drop:
- ALL
# One capability it never uses, and that no container the worker creates
# may ask for. A container that joins this one's process namespace then
# holds less than the proxy does, so the kernel refuses it the proxy's
# files (/proc/1/root), the host socket among them.
cap_add:
- WAKE_ALARM
security_opt:
- no-new-privileges:true
# Unix sockets only; it needs no network at all.
network_mode: none
restart: unless-stopped
# It peaks near 45 MB, streams included; the cap only stops a leak
# from taking the host's memory with it.
mem_limit: 256m
# One log line per Docker call (refusals included), so the log is capped.
logging:
driver: json-file
options:
max-size: "5m"
max-file: "2"
# `sockguard verify` asks the host's Docker through the socket this proxy
# holds, so a stale or missing host socket (a Docker update replaced it,
# docs/faq.md) turns it unhealthy. Exec form: the image has no shell.
healthcheck:
test: ["CMD", "/sockguard", "verify"]
interval: 60s
timeout: 10s
retries: 3
start_period: 20s
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- cashpilot_docker_api:/run/cashpilot-docker
environment:
# Host paths containers may bind: your compose folder (the in-app
# update needs it) and each folder a service keeps its data in (Storj's
# identity and data folders, for example), comma-separated. Set both in
# the .env next to this file. The proxy binds a listed path only as
# itself, never a folder under it, so list every path a service binds.
# Write each as an exact absolute path, with no trailing slash, `//`, `.`
# or `..`: the proxy refuses to start on any other spelling.
# The placeholders sit under /dev/null, where no directory can ever exist
# (Docker cannot create one there), so an unset variable allows nothing.
- SOCKGUARD_REQUEST_BODY_CONTAINER_CREATE_ALLOWED_BIND_MOUNTS=${CASHPILOT_COMPOSE_DIR:-/dev/null/cashpilot-compose-dir-unset},${CASHPILOT_PROXY_BIND_MOUNTS:-/dev/null/cashpilot-bind-mounts-unset}
# The policy's fingerprint. Compose does not recreate a container when
# only its config's content changes, so this line is what makes
# `docker compose up -d` restart the proxy on a new policy.
- CASHPILOT_PROXY_POLICY=bf36af85a1e0f393
configs:
- source: cashpilot_socket_policy
target: /etc/sockguard/sockguard.yaml
depends_on:
cashpilot-migrate:
condition: service_completed_successfully
cashpilot-worker:
image: drumsergio/cashpilot-worker:3.3
pull_policy: always
container_name: cashpilot-worker
# The proxy's owner label: the worker may read its own container, and the
# in-app update may recreate it through the proxy.
labels:
cashpilot.deployed-by: worker
expose:
- "8081"
# The worker reads host GPU information from sysfs. Leave the GPU
# devices on the host so it can grant them to catalog services
# that declare docker.gpu. See docs/gpu.md.
volumes:
# No Docker socket here: the worker reaches Docker through the proxy's
# filtered socket in this volume (DOCKER_HOST below).
- cashpilot_docker_api:/run/cashpilot-docker
# SEPARATE FROM THE UI'S /data, DELIBERATELY. This container drives
# Docker, so a flaw in it reaches the host. The UI's /data holds
# cashpilot.db and .fernet_key -- the credential store and the only key
# that can decrypt it -- and the component that can start any container
# on the machine has no business being able to read them.
#
# /fleet IS shared on purpose: it holds only the shared enrolment key,
# which both sides need by definition.
#
# Consolidating these into one volume is the obvious "simplification" and
# it silently removes that boundary. tests/test_beads_batch_69.py fails if
# anyone does.
- cashpilot_worker_data_owned:/data
- cashpilot_fleet_owned:/fleet
environment:
- TZ=${TZ:-UTC}
- CASHPILOT_UI_URL=http://cashpilot-ui:8080
- CASHPILOT_API_KEY=${CASHPILOT_API_KEY:-}
- CASHPILOT_WORKER_NAME=local
- CASHPILOT_MINERS=${CASHPILOT_MINERS:-}
- DOCKER_HOST=unix:///run/cashpilot-docker/docker.sock
# The proxy policy's fingerprint (scripts/socket_proxy_policy.py), so the
# worker can say when its image needs a newer policy than this file has.
- CASHPILOT_PROXY_POLICY=bf36af85a1e0f393
# The same two values the proxy gets, so the worker can say what to set
# before the proxy refuses (the in-app update, a host-folder bind).
- CASHPILOT_COMPOSE_DIR=${CASHPILOT_COMPOSE_DIR:-}
- CASHPILOT_PROXY_BIND_MOUNTS=${CASHPILOT_PROXY_BIND_MOUNTS:-}
# Earners are fenced off your LAN and this host by default (docs/isolation.md).
# off keeps Docker's default bridge.
- CASHPILOT_ISOLATION=${CASHPILOT_ISOLATION:-auto}
- CASHPILOT_DRIFT_WARNINGS=${CASHPILOT_DRIFT_WARNINGS:-true}
depends_on:
- cashpilot-socket-proxy
init: true
restart: unless-stopped
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:size=64M
# Labelled for the proxy, so the in-app update may attach the worker to it.
networks:
- cashpilot_owned
volumes:
cashpilot_data:
# The worker's own data and the enrolment key it shares with the UI. They
# carry the proxy's owner label, so the in-app update may mount them. Compose
# never relabels a volume, so they are new ones: cashpilot-migrate copied
# cashpilot_worker_data and cashpilot_fleet into them and left the old ones
# as backups. The UI's cashpilot_data never carries the label.
cashpilot_worker_data_owned:
labels:
cashpilot.deployed-by: worker
cashpilot_fleet_owned:
labels:
cashpilot.deployed-by: worker
# Fixed name: the in-app update mounts it by name to reach the proxy. It
# replaced cashpilot-docker-api, which held nothing but the socket.
cashpilot_docker_api:
name: cashpilot-docker-api-owned
labels:
cashpilot.deployed-by: worker
networks:
cashpilot_owned:
labels:
cashpilot.deployed-by: worker
# The Docker socket proxy's policy. scripts/socket_proxy_policy.py writes it
# from the catalog; `$$` is how compose spells a literal `$`. Needs Docker
# Compose 2.23.1 or newer (inline config content).
configs:
cashpilot_socket_policy:
content: |
# BEGIN socket proxy policy: written by scripts/socket_proxy_policy.py, do not edit by hand
listen:
socket: /run/cashpilot-docker/docker.sock
# The worker runs as uid/gid 1000 (Dockerfile.worker). The proxy runs as
# root with no capabilities and joins group 1000, so it can hand the socket
# to that group without asking for the host's docker group id.
socket_mode: "0660"
socket_gid: 1000
upstream:
socket: /var/run/docker.sock
# Image pulls and container waits take minutes; the default cuts them at 60 s.
request_timeout: "off"
log:
level: info
format: json
# One line per call, refusals included: docker logs cashpilot-socket-proxy
# shows what was refused and why. The compose file caps the log's size.
access_log: true
health:
enabled: false
# The worker reads its own containers' logs and files (backups, the update check).
insecure_allow_read_exfiltration: true
response:
# A refusal carries the rule's reason, which the worker shows to you.
deny_verbosity: verbose
# The worker reads Env, Mounts and IPAM back (recreates, the isolation check).
redact_container_env: false
redact_mount_paths: false
redact_network_topology: false
request_body:
container_create:
allow_privileged: false
# The LAN fence helper and the isolation check's control probe run on the
# host network; no earner does (the worker refuses it for every catalog
# service, and the catalog refuses it to any service with NET_ADMIN).
allow_host_network: true
allow_host_pid: false
allow_host_ipc: false
allow_host_userns: false
allow_host_cgroupns: false
allowed_capabilities: [NET_ADMIN, NET_RAW, SETUID, SETGID]
allowed_devices: [/dev/net/tun, /dev/dri/renderD128, /dev/dri/renderD129, /dev/dri/renderD130, /dev/dri/renderD131, /dev/dri/renderD132, /dev/dri/renderD133, /dev/dri/renderD134, /dev/dri/renderD135, /dev/kfd, /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2, /dev/ttyUSB3, /dev/ttyUSB4, /dev/ttyUSB5, /dev/ttyUSB6, /dev/ttyUSB7, /dev/ttyUSB8, /dev/ttyUSB9, /dev/ttyACM0, /dev/ttyACM1, /dev/ttyACM2, /dev/ttyACM3, /dev/ttyACM4, /dev/ttyACM5, /dev/ttyACM6, /dev/ttyACM7, /dev/ttyACM8, /dev/ttyACM9]
allowed_device_requests: [{driver: nvidia, allowed_capabilities: [[gpu]]}]
allowed_runtimes: [runc, runsc, runsc-hostnet, runsc-hostnet-raw]
allow_sysctls: true # the tunnel sidecar turns IPv6 off in its own namespace
require_no_new_privileges: true
deny_unconfined_seccomp: true
deny_unconfined_apparmor: true
deny_unconfined_system_paths: true
# Host folders containers may bind come from CASHPILOT_COMPOSE_DIR and
# CASHPILOT_PROXY_BIND_MOUNTS, through the proxy service's environment.
allowed_bind_mounts: []
container_remove:
allow_force: true
allow_remove_volumes: true
container_archive:
# The only folder the worker writes into a container: the tunnel
# sidecar's proxy settings.
allowed_paths: [/run/cashpilot-secret]
allow_setid: false
allow_device_nodes: false
allow_escaping_links: false
exec:
allow_privileged: false
allow_root_user: true
# The worker's exec calls send no environment. This name is never sent,
# so any Env entry (PATH, LD_PRELOAD) is refused.
allowed_env_vars: [CASHPILOT_EXEC_SENDS_NO_ENV]
allowed_commands:
- ["cat", "/run/ready"]
- ["sh", "-c", "id=$$(wget -qO- -T 5 http://127.0.0.1:4050/identities | grep -o '0x[0-9a-fA-F]\\{40\\}' | head -1) && wget -qO- -T 5 \"http://127.0.0.1:4050/identities/$$id\" && { echo; wget -qO- -T 5 \"http://127.0.0.1:4050/transactor/settle/history?page_size=1000\" || true; }"]
- ["sh", "-c", "id=$$(wget -qO- -T 5 http://127.0.0.1:4050/identities | grep -o '0x[0-9a-fA-F]\\{40\\}' | head -1) && wget -qO- -T 5 \"http://127.0.0.1:4050/identities/$$id/beneficiary\""]
- ["timeout", "12", "sh", "-c", "if m=$$(wget -qO- -Y off -T 5 http://127.0.0.1:4050/node/monitoring-status); then\n echo \"monitoring read: $$m\"\nfi\nset -o pipefail\nif s=$$(wget -qO- -Y off -T 5 \"http://127.0.0.1:4050/sessions?direction=Provided&status=Completed&page_size=100\") &&\n sorted=$$(echo \"$$s\" | sed 's/},{/}\\n{/g' | awk '\n match($$0, /\"created_at\":\"[^\"]+\"/) {\n t = substr($$0, RSTART + 14, 19); gsub(/[-T:]/, \" \", t)\n d = 0; if (match($$0, /\"duration\":[0-9]+/)) d = substr($$0, RSTART + 11, RLENGTH - 11)\n print mktime(t) + d, $$0\n }' | sort -rn); then\n [ -z \"$$sorted\" ] || echo \"$$sorted\" | head -5\n echo \"sessions read: all\"\nfi"]
- ["sh", "-c", "T=\"\"; command -v timeout >/dev/null 2>&1 && T=\"timeout 5\"; $$T iptables-nft -t nat -S MYST 2>/dev/null; if grep -qx nat /proc/net/ip_tables_names 2>/dev/null; then $$T iptables-legacy -t nat -S MYST 2>/dev/null; $$T iptables -t nat -S MYST 2>/dev/null; else case \"$$($$T iptables -V 2>/dev/null)\" in *nf_tables*) $$T iptables -t nat -S MYST 2>/dev/null;; esac; fi"]
- ["cat", "/etc/anon/anonrc"]
image_pull:
allow_all_registries: true # catalog and custom services come from many registries
network:
# The LAN fence (app/lan_fence.py) creates its bridge with three driver
# options (interface name, no masquerade, no inter-container traffic) and
# moves an earner across with a forced disconnect. Custom drivers, swarm
# scope, custom IPAM and endpoint settings stay refused.
allow_driver_options: true
allow_disconnect_force: true
volume:
# Plain local volumes only: driver options could point one at a host folder.
allow_custom_drivers: false
allow_driver_opts: false
# The worker sees and touches only what carries the owner label below: what
# it created through this proxy, and what app/owner_migrate.py labelled. The
# UI's container and its data volume never carry it.
ownership:
owner: worker
label_key: cashpilot.deployed-by
# Images carry no owner: one pulled for an earner is shared with the host.
allow_unowned_images: true
allow_cross_owner_namespace_sharing: false
rules:
- {match: {method: GET, path: "/_ping"}, action: allow}
- {match: {method: HEAD, path: "/_ping"}, action: allow}
- {match: {method: GET, path: "/version"}, action: allow}
- {match: {method: GET, path: "/info"}, action: allow}
- {match: {method: GET, path: "/containers/json"}, action: allow}
- {match: {method: GET, path: "/containers/*/json"}, action: allow}
- {match: {method: POST, path: "/containers/create"}, action: allow}
- {match: {method: POST, path: "/containers/*/start"}, action: allow}
- {match: {method: POST, path: "/containers/*/stop"}, action: allow}
- {match: {method: POST, path: "/containers/*/restart"}, action: allow}
- {match: {method: POST, path: "/containers/*/pause"}, action: allow}
- {match: {method: POST, path: "/containers/*/unpause"}, action: allow}
- {match: {method: POST, path: "/containers/*/wait"}, action: allow}
- {match: {method: POST, path: "/containers/*/rename"}, action: allow}
- {match: {method: DELETE, path: "/containers/*"}, action: allow}
- {match: {method: GET, path: "/containers/*/logs"}, action: allow}
- {match: {method: GET, path: "/containers/*/stats"}, action: allow}
- {match: {method: GET, path: "/containers/*/archive"}, action: allow}
- {match: {method: PUT, path: "/containers/*/archive"}, action: allow}
- {match: {method: POST, path: "/containers/*/exec"}, action: allow}
- {match: {method: POST, path: "/exec/*/start"}, action: allow}
- {match: {method: GET, path: "/exec/*/json"}, action: allow}
- {match: {method: GET, path: "/images/**/json"}, action: allow}
- {match: {method: POST, path: "/images/create"}, action: allow}
- {match: {method: GET, path: "/networks"}, action: allow}
- {match: {method: GET, path: "/networks/*"}, action: allow}
- {match: {method: POST, path: "/networks/create"}, action: allow}
- {match: {method: POST, path: "/networks/*/connect"}, action: allow}
- {match: {method: POST, path: "/networks/*/disconnect"}, action: allow}
- {match: {method: DELETE, path: "/networks/*"}, action: allow}
- {match: {method: POST, path: "/volumes/create"}, action: allow}
- {match: {method: GET, path: "/volumes/*"}, action: allow}
- {match: {method: DELETE, path: "/volumes/*"}, action: allow}
- {match: {method: "*", path: "/**"}, action: deny, reason: "the CashPilot worker does not use this Docker API call"}
# END socket proxy policy
Das ist die echte Datei
Der Block oben wird unverändert aus docker-compose.yml im
Repository eingebunden, daher kann er nicht von dem abweichen, was wirklich ausgeliefert wird. Früher
hat eine von Hand kopierte Version davon die Docker-Socket-API des Workers auf jeder
Schnittstelle veröffentlicht und :latest festgelegt; von beidem rät die Seite
Sicherheitsvoreinstellungen ab.
Zugriff auf den Docker-Socket
Der Worker verwaltet die Container der Dienste über Docker, bindet aber /var/run/docker.sock nicht ein. Der Container cashpilot-socket-proxy hält den Socket und reicht dem Worker nur die Aufrufe durch, die er macht; privilegierte Container und Bind-Mounts von Host-Ordnern, die du nicht aufgelistet hast, lehnt er ab (was er ablehnt). Das In-App-Update ist Opt-in: Es läuft nur mit CASHPILOT_COMPOSE_DIR=<this folder> in der .env neben der Compose-Datei, und diese Einstellung erlaubt Containern, den Ordner einzubinden, was den Proxy schwächt (was das kostet). Lass sie leer und aktualisiere mit docker compose pull && docker compose up -d. Der Worker steuert trotzdem jeden Container auf dem Host, betreibe CashPilot also für die beste Sicherheit auf einem eigenen Rechner oder in einem eigenen VLAN.
Den geheimen Schlüssel aufbewahren
Zugangsdaten werden mit CASHPILOT_ENCRYPTION_KEY verschlüsselt, nicht mit CASHPILOT_SECRET_KEY, der nur Anmeldesitzungen signiert. Der Verschlüsselungsschlüssel wird beim ersten Start automatisch erzeugt und unter /data/.fernet_key gespeichert. Sichere diese Datei. Wird das Volume ohne sie neu erstellt, entsteht ein neuer Schlüssel, und alle gespeicherten Zugangsdaten werden dauerhaft unlesbar. CASHPILOT_ENCRYPTION_KEY dient dazu, diese Sicherung wiederherzustellen; die Schlüsseldatei hat immer Vorrang, daher ändert das Setzen bei einer intakten Instanz nichts.
Passwörter und Geheimnisse in der UI
Ändere dein eigenes Passwort jederzeit über das Avatar-Menü -> Change password (Passwort ändern) (für alle Rollen verfügbar); das meldet deine anderen Sitzungen ab. In Settings (Einstellungen) sind gespeicherte Geheimnisse nur beschreibbar: Gib einen Wert ein, um ihn zu ändern, oder lass das Feld leer, um den vorhandenen zu behalten. Gespeicherte Zugangsdaten werden nie an den Browser zurückgeschickt.
CashPilot aktualisieren¶
Die Compose-Datei legt eine Major.Minor-Reihe fest, etwa drumsergio/cashpilot:X.Y, daher holt pull den neuesten Patch dieser Reihe:
docker compose pull holt das neueste veröffentlichte Image, und up -d erstellt
nur die Container neu, deren Image sich geändert hat. Die mitgelieferten Compose-Dateien setzen
pull_policy: always, daher lädt selbst ein bloßes docker compose up -d zuerst
das neueste Image.
Aus dem Dashboard. Settings (Einstellungen), About and updates (Info und Updates) führt dieselben zwei
Befehle für dich in einem kurzlebigen Hilfscontainer aus. Der Hilfscontainer liest deine
Compose-Dateien und die .env daneben (oder die Dateien, die du mit
--env-file übergeben hast), nie die Shell, aus der du CashPilot gestartet hast. Angenommen, du hast es mit CASHPILOT_UI_PORT=8088 docker compose up -d gestartet.
Das Update würde das Dashboard zurück auf 8080 setzen, deshalb hält es an und sagt dir stattdessen,
warum. Trag den Wert in .env ein, dann funktioniert die Schaltfläche.
Du musst nicht neu bauen
CashPilot liefert fertig gebaute Multi-Arch-Images auf Docker Hub aus
(drumsergio/cashpilot,
drumsergio/cashpilot-worker).
docker compose build / --build ist nur relevant, wenn du absichtlich
mit docker-compose.build.yml aus dem Quellcode baust. Bei normalen Installationen
ist pull + up -d der vollständige und richtige Ablauf für ein Update.
Eine bestimmte Version festlegen¶
Um auf genau einem Release zu bleiben, ersetze in docker-compose.yml das Reihen-Tag X.Y
durch ein vollständiges Release-Tag X.Y.Z, sowohl bei
drumsergio/cashpilot als auch bei drumsergio/cashpilot-worker (immer dasselbe Tag bei
beiden), und entferne pull_policy: always. Die Tags findest du auf
Docker Hub.
Um zu einer neueren Reihe zu wechseln, ändere beide Tags: zuerst auf dem UI-Host, dann auf jedem Worker-Host. Lies vorher UPGRADING.md, denn ein Major-Release wie 3.0 hat eigene Schritte.
Updates automatisieren (optional)¶
Wenn du Updates ohne Handarbeit willst, lass einen Scheduler dieselben zwei Befehle ausführen, zum Beispiel mit einem täglichen Cron-Eintrag:
Oder lass einen Auto-Updater wie Watchtower oder Diun auf die CashPilot-Container los. Das ist optional. CashPilot bringt keinen eigenen Updater mit.
Alte Images aufräumen¶
CashPilot löscht ein Image nur, nachdem ein Update des App-Images es ersetzt hat, und nur auf einem Worker mit dem direkten Docker-Socket. Andernfalls kann jedes Update und jede Neubereitstellung das vorherige Image auf der Festplatte zurücklassen. Auf einer Testflotte mit drei Servern kamen die alten Images von CashPilot und den Verdienst-Apps zusammen auf etwa 3 GB. Das ist wenig im Vergleich zu dem, was andere Programme auf demselben Host meist zurücklassen, schau dir also den ganzen Host an:
Der Wert RECLAIMABLE in der Zeile Images ist das, was Docker freigeben könnte.
Warum CashPilot das nicht für dich erledigt. Der Worker erreicht Docker über den Socket-Proxy. Bei Images lässt der Proxy ihn eines laden und eines anhand des Namens lesen, sonst nichts. Er kann die Images des Hosts weder auflisten noch eines löschen. Ein Worker, der das könnte, würde auch die Images jedes anderen Programms auf dem Host sehen und löschen. Siehe was der Proxy ablehnt.
Schritt 1: Dangling Images entfernen. Ein Dangling Image hat kein Tag, und kein
Container verwendet es, weder laufend noch gestoppt. Ein Update über ein bewegliches Tag wie
X.Y (eine Reihe wie die, die die Compose-Dateien festlegen), latest oder einen Digest hinterlässt genau diese:
Das löscht auch das Image, das du vor einem Update über ein bewegliches Tag verwendet hast: Sobald
das neue Image dieser Reihe da ist, hat das alte kein Tag mehr. Um einen Weg zurück zu behalten, notiere
vor dem Update die genaue Version (unten in der Seitenleiste steht sie), damit
du drumsergio/cashpilot:<X.Y.Z> erneut laden kannst. Oder lege die Compose-Datei auf
ein genaues Tag X.Y.Z fest; dann behält das alte Image sein Tag, und Schritt 2 gilt.
Docker fragt nach, bevor es löscht. In einem Cron-Eintrag fügst du --force hinzu, um die
Frage zu überspringen. Sonst ändert es nichts:
Füge kein -a hinzu
docker image prune -a löscht jedes Image, das gerade kein Container
verwendet, ob dangling oder mit Tag. Dazu gehören Images von Stacks, die du absichtlich
gestoppt hast, und Images, die du lokal gebaut hast und nicht erneut laden kannst.
Schritt 2: Alte festgelegte Tags entfernen. Ein auf eine Version festgelegtes Image behält sein Tag,
nachdem du zu einer neueren gewechselt hast, daher überspringt prune es. Diese CashPilot-Images sind
festgelegt:
| Repository | Was es festlegt |
|---|---|
drumsergio/cashpilot |
Die Compose-Datei (eine alte Reihe oder eine genaue Version, die du festgelegt hast) |
drumsergio/cashpilot-worker |
Die Compose-Datei, wie oben |
drumsergio/cashpilot-tunnel |
Der Worker, ein Tag pro Worker-Version |
drumsergio/cashpilot-earnapp |
Der Katalogeintrag von EarnApp |
drumsergio/cashpilot-anyone |
Der Katalogeintrag von Anyone Protocol |
Dasselbe gilt für das Image eines Dienstes, den du entfernt hast: Sein Tag bleibt, bis du es entfernst. Ein Katalog-Image, das per Digest festgelegt ist, etwa bei MystNodes oder ProxyBase, verliert sein Tag, wenn ein neueres es ersetzt, daher deckt Schritt 1 es bereits ab.
Liste zuerst die Tags auf, die kein Container verwendet. Dieses Beispiel gilt für das Worker-Image.
Für ein anderes Repository aus der Tabelle änderst du repo:
repo=drumsergio/cashpilot-worker
used=$(docker ps -a --format '{{.Image}}')
docker image ls "$repo" --format '{{.Repository}}:{{.Tag}}' | grep -vxF "$used"
Entferne dann jedes alte Tag einzeln anhand seines Namens:
Füge kein -f hinzu. Ohne diese Option weigert sich Docker, ein Image zu entfernen, das ein
Container noch verwendet, laufend oder gestoppt, und gibt
conflict: unable to delete aus. Wenn du das siehst, behalte das Image. Behalte das Tag,
das du verwendest, und das Tag davor, damit du immer noch eine Version zurückgehen kannst.
Entferne nur Tags, die älter als diese beiden sind.
Die Spalte Host disk (Host-Speicher) im Dashboard zeigt den freien Platz auf dem Dateisystem, das
das /data des Workers enthält. Images liegen meist auf demselben Dateisystem, unter
dem Datenverzeichnis von Docker, aber nicht immer. docker info --format '{{.DockerRootDir}}'
zeigt das Datenverzeichnis von Docker. Mit dem containerd-Image-Store, dem Standard bei einer
neuen Installation von Docker Engine 29, liegen Images stattdessen unter dem Stammverzeichnis von containerd,
normalerweise /var/lib/containerd. docker info --format '{{.Driver}}' gibt
overlayfs für den containerd-Image-Store aus und overlay2 für den klassischen.
Prüfe den freien Platz auf dem Dateisystem, das das zutreffende Verzeichnis enthält.
Unterstützte Dienste¶
CashPilot unterstützt 60 Dienste, die aktiv oder in der Beta sind, in fünf Kategorien:
- Bandbreite teilen (19): Teile deine Internet-Bandbreite für passives Einkommen
- DePIN (16): dezentrale physische Infrastrukturnetzwerke
- GPU-Rechenleistung (7): Vermiete deine GPU für KI- und Rechenaufgaben
- Speicher (3): Teile Festplattenplatz in dezentralen Speichernetzwerken
- Mining (14): Stelle einen Miner bereit oder verfolge einen Pool anhand der Auszahlungsadresse (Mining)
Davon lassen sich 30 automatisch über Docker bereitstellen und verwalten. Der Katalog führt die übrigen 30 (19 Browser- oder Desktop-Apps, 7 GPU-Nodes, 4 Mining-Pools). CashPilot liest ihr Guthaben, wo ein Collector existiert.
Den vollständigen Katalog findest du im Abschnitt Dienst-Anleitungen.
Nächste Schritte¶
- So funktioniert es -- Verstehe die Aufteilung in UI und Worker
- Flottenverwaltung -- Über mehrere Server bereitstellen
- Dein Heimnetz schützen -- Halte die Container aus deinem LAN fern, und wann gVisor hilft
- Dienst-Anleitungen -- Ausführliche Einrichtungsanleitungen für jeden Dienst
- CashPilot vollständig entfernen -- Entferne alles, was es angelegt hat, um neu anzufangen oder aufzuhören