Files and directories
The CLI follows the XDG conventions on Linux and macOS and the profile
directories on Windows. Overriding environment variables (XDG_CONFIG_HOME,
XDG_STATE_HOME) are honored. The ~/.local/state/spora/ paths below are
root’s own for a run made with sudo (see the notes).
| what | Linux and macOS | Windows |
|---|---|---|
| Share (the secret behind the share URL, and its relays) | ~/.config/spora/share.bin | %APPDATA%\spora\share.bin |
| Connection log (per share) | ~/.local/state/spora/connlog/<routing-hash>/ | %LOCALAPPDATA%\spora\connlog\<routing-hash>\ |
| Diagnostic records | ~/.local/state/spora/records/ | %LOCALAPPDATA%\spora\records\ |
| Diagnostic log and crash reports | ~/.local/state/spora/log/ | %LOCALAPPDATA%\spora\log\ |
| Device identity, relay access and telemetry state | ~/.local/state/spora/service/ | %LOCALAPPDATA%\spora\service\ |
Notes:
- The share file is the secret behind a stable share URL: mode
0600, written atomically. It works only with the device identity it was made under, kept inservice/service.json(this machine’s key pair): with another, the CLI makes a new share. Copy both to move a share; use--fresh(or delete the share file) to revoke the URL.--share-fileselects another path. A run with sudo uses root’s state directory, and so root’s device identity: a share made by one is remade (a new URL) by the other. - The connection log is SQLite; read it with
spora log, not by hand, and note that deleting the share does not delete the log. It is your record of what your connection was used for, and it outlives the URL on purpose. Its records still expire: everyspora sharealso sweeps the logs of earlier shares inconnlog/by the retention each was kept with (a log moved elsewhere with--conn-log-diris swept only while its own share runs). - Records are plain JSON Lines, one file per run;
--record-dirmoves them and--no-recorddisables them. - The diagnostic log holds what
shareanduselog, as JSON Lines, at fixed levels that are more detailed than the terminal’s default (but not their printed banner, nor the per-flow lines, one for each connection a client makes: the connection log is the only per-flow record). A new file per run and per MiB, at most 16 MiB and 14 days in all. Crash reports sit beside it.--no-diag-logkeeps a run from writing either.spora reportbundles the log, the records and the crash reports of the last few days into one zip file for a bug report. service/service.jsonholds the telemetry switch (spora telemetry) and, once uploads have been on, this machine’s device registration with each API it has uploaded to (see Another API), access tokens included (mode0600). Delete it to forget the registrations: uploads are then off untilspora telemetry on, which registers a new device. Uploads only ever send the default records and log directories above, never a--record-direlsewhere (spora report --record-dirbundles one), and never the connection log.- Runs made with sudo (
sudo spora use,sudo spora share --os-routing) are root’s: their records, log, telemetry state and connection log live in root’s home,/root/.local/state/spora/on Linux and/var/root/.local/state/spora/on macOS. That holds where sudo keeps yourHOMEas well (macOS’s sudo does, and so doessudo -E): a run with sudo never writes its state into your home, unless it is handed anXDG_STATE_HOME, which is honored.sudo spora record,sudo spora report,sudo spora telemetryandsudo spora logreach those files; the same commands without sudo do not. The identity file is not part of this: a run finds it throughXDG_CONFIG_HOMEorHOME, as sudo leaves them. On Windows an elevated console keeps your own directories. - Earlier versions of the CLI kept the records and connection log of runs
made with sudo in your own
~/.local/state/spora/wherever sudo kept yourHOME(on macOS, withsudo -E, and on Ubuntu before 19.10). Those files stay there, owned by root. Name the directory to read them:sudo spora record list --dir ~/.local/state/spora/records,sudo spora report --record-dir ~/.local/state/spora/records,sudo spora log sessions --dir ~/.local/state/spora/connlog/<routing-key>. Or give the directory back to your account withsudo chown -R "$USER" ~/.local/state/spora, which is also what a command run without sudo suggests when it cannot read its state there. It suggests that for your own state directory only: a directory elsewhere that it cannot read (root’s home, a service’s directory) is not yours to take over, and the same command with sudo reads it. spora usein VPN mode also keeps small runtime files (an instance lock, resolver backups) under/run/spora/on Linux and/var/db/spora/on macOS; they are cleaned up automatically.- On Windows,
spora useexpectswintun.dllnext tospora.exe.