server/report-receiver/test_security.py sends the receiver what anyone on the internet could, and the Redaction tests in tests/report.bats feed report logs full of secrets. Each test was checked to fail before its fix. The receiver now refuses a negative Content-Length (read without limit), parts nested thousands deep (a RecursionError dropped the connection) and more than 20 parts (thousands took seconds of CPU to parse). It counts an IPv6 address's /64 for the rate limit, since a home has a whole /64 to send from. Report fields go into the Gitea issue as inline code, and titles keep only the characters of step names and versions, so a report can't @mention the team, link issues, or show a tracking image. It refuses reports while its disk has less than 2 GB free. report now also takes out passwords in URLs, Bearer and Basic tokens, password= and token: values, API keys by their prefixes, Nextcloud app passwords, private keys, IPv6 and MAC addresses, the Cores' domains and the user's name. It reads the Core settings rather than sourcing them, and escapes extended regex characters in names, which it didn't before. The plan for the checks still to do, in the smoketest VM (the agent sandbox, network exposure, what root runs, the install path), is a Claude Code skill: /coredesktop-security-checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Report receiver
Takes the error reports CoreDesktop machines send with report (see the top of
../../report for the request format) at https://federated.sh/report, and
files each as an issue in the private Gitea repository
Federated_Computer/coredesktop-reports, with the full log attached.
receiver.pylistens on 127.0.0.1:8650, behind Caddy. Standard library only.- It saves each report in
/var/lib/coredesktop-reports/<ID>/before replying, so a report isn't lost if Gitea is down, and tries again every 10 minutes. Saved reports are deleted after 90 days; the Gitea issues stay. - It turns away more than 5 reports an hour or 20 a day from one address, and more than 500 a day in all. It keeps addresses for that in memory only, for at most a day, and doesn't write them to its log. An IPv6 address counts as its /64, which a single home or server has to itself. It also turns away logs bigger than 10 MB compressed or 64 MB uncompressed, requests of more than 20 parts, and every report while its disk has less than 2 GB free.
- What a report says goes into the issue as inline code (the log in a code block), and its title keeps only the characters of step names and versions, so a report can't @mention anyone, link to issues, or show links, images or HTML in Gitea.
make testin the repository runstest_receiver.py, which sends reports with the realreportclient to the receiver and a fake Gitea, andtest_security.py, which sends it what an attacker could.
Deploying on federated.sh
-
A Gitea user that can only file issues there. Gitea tokens can't be limited to one repository, so make a separate user (say
coredesktop-reports-bot), add it toFederated_Computer/coredesktop-reportsas a collaborator with write access, and make it a token with only thewrite:issuepermission. Nothing else should be shared with that user. -
Install the receiver (as root):
install -d -m 755 /opt/coredesktop-reports install -m 644 receiver.py /opt/coredesktop-reports/receiver.py install -m 644 coredesktop-reports.service /etc/systemd/system/coredesktop-reports.service install -m 600 /dev/null /etc/coredesktop-reports.envThen put the settings in
/etc/coredesktop-reports.env:GITEA_URL=https://gitea.federated.computer GITEA_REPO=Federated_Computer/coredesktop-reports GITEA_TOKEN=<the bot's token>systemctl daemon-reload systemctl enable --now coredesktop-reports curl -s http://127.0.0.1:8650/report/health # prints ok -
Route /report to it in Caddy. See
Caddyfile.example:/reportgoes in its ownhandleblock, and the site's existing directives go in a catch-allhandle, so the installer redirect keeps working. Check withcaddy validate, thensystemctl reload caddy. -
Check it end to end.
curl -s https://federated.sh/report/healthprints ok,wget -qO- https://federated.sh | head -3still shows install.sh, and from a CoreDesktop machinereportsends its newest log and prints an ID, which appears as a new issue in the repository.
To update it later, install the new receiver.py the same way and run
systemctl restart coredesktop-reports. journalctl -u coredesktop-reports
shows each report it receives and files.