Parent mode: API and security

yapuka-parents is a root service using only the standard library: the phone page on port 8787, a local API, a DNS filter and the time limits.


yapuka-parents serve        # the service
yapuka-parents apply        # re-apply the saved mode (boot, after reinstalls)
yapuka-parents resume       # rescue: end a pause from a root shell
yapuka-parents --self-test  # the pure logic, no root and no network

Routes. Public (anyone on the LAN): GET / (pairing help, or the page for a paired phone), GET /pair?code= (one-time code, sets a device cookie), the web manifest and icons. Paired phone (cookie + header X-Libreos: 1): GET /api/status, GET /api/messages, POST /api with an action such as safe, normal, pin, stop, resume, pause-message, message, block, unblock, alerts, forget. Laptop only (127.0.0.1): /local/*.

Security model. Pairing is one-time (the QR carries a one-time secret); a parent code unlocks on the spot and pairs a second phone; blocked apps are enforced by the system, not by the page; alerts are off by default and only the child's first name leaves the house.

Firewall. The service loads nftables rules (policy drop on input): only ports 8787 (parents' page) and 8788 (Potos) are open, from local addresses only; 8790 (shared folders) opens only while a folder is shared, 8791 (Cartable's class) only while a class has pupils. While the filter is on, the child's programs can reach only that filter on the DNS ports (53 and 853). If the service does not start, there is no firewall. More POST /api actions exist now: camera, printing, wifi-share, partage, grands, copain-ok, actus-ok, communaute-ok…

Updated on