The execution environment
An executable page runs with almost nothing in its environment. There is no HOME, no USER, no shell profile. What you get is:
PATH link_id the Reticulum link the request arrived on remote_identity the requester's identity hash, if they identified var_* link data, from the fields segment of a link field_* form field values submitted with the request
Because HOME is unset, anything that resolves paths relative to it will fail. Resolve from the script instead:
import os HERE = os.path.dirname(os.path.realpath(__file__))
To debug a page the way the node runs it, strip the environment yourself:
docker compose exec nomadnet env -i PATH=/usr/local/bin:/usr/bin:/bin \ /config/.nomadnetwork/storage/pages/yourpage.mu
Running it from an interactive shell will not reproduce a failure caused by a missing variable, because your shell has all of them.
One more trap: RNS.log() writes to stdout, which is the page body. If a page attaches to Reticulum for any reason, redirect that output first:
import contextlib, sys with contextlib.redirect_stdout(sys.stderr): import RNS