6.4 KiB
KidTime
What this add-on does
KidTime is a parental control server for your home network. It stores the time
limits and usage of your children's Windows devices, tells the KidTime client on
each device when to warn, lock or log off, and serves the admin web page. The
add-on runs on the host network so the devices find it as kidtime.local
(mDNS) without any extra setup. The add-on takes its timezone from Home
Assistant, and the server runs as the container's main process, so a crash or a
failed port makes the add-on stop with a clear line in its log.
Ports
| Port | Used for |
|---|---|
| 8080 | Admin web page and its API (plain HTTP, "Open Web UI") |
| 8443 | Connection from the kids' devices (gRPC over TLS) |
| 8444 | Admin web page and API over HTTPS (used by the mobile app) |
The add-on uses the host network, so these ports are open on the Home Assistant
machine itself. Do not run another KidTime server on the same network at the
same time: both would claim kidtime.local.
Automatic client updates
The server checks for a new KidTime client every 6 hours (the first check about
a minute after start) in the public release repository
https://git.nc.kreapptivo.de/KidTime/client. A newer release is
downloaded, checked against the KidTime release key and then offered to the
kids' devices. Each device checks the signature again before it installs
anything, so neither this server nor its admin account can make a device run
an installer that KidTime did not sign. Settings > Client Update shows the
last check, the latest release seen, the last error and a "Check now" button.
Turning the checks off is the server setting clientUpdates.pollInterval: 0.
The add-on keeps its server settings inside its image (/kidtime-addon.yaml),
so in the add-on the checks are always on. The status in Settings shows "Off"
with the reason only when automatic checks are turned off, not between checks.
You can still upload a client by hand under Settings > Client Update, for
example to get a release out before the next check. Only the official signed
release file (kidtime-client-<version>-setup.exe from the release
repository) is accepted; an unsigned or modified file is refused, and so is a
version that is not newer than the current one.
A server without internet access keeps working as before: time limits, accounts and device updates from an uploaded file all keep working. The failed check is shown in Settings and retried at the next regular check. To update the clients of such a server, download the release file on another computer and upload it by hand.
Your data and the certificate
The add-on keeps everything in its config folder (the folder ending in
_kidtime in the app_configs share, older versions: addon_configs):
| Folder | Holds |
|---|---|
db |
the database (db.sqlite) |
certs |
the TLS certificate and key |
secrets |
the JWT secret |
client |
the client installers used for updates |
On its first start the add-on creates a new server with its own certificate.
Every provisioned device remembers that certificate and rejects a server that
shows a different one. Losing certs therefore means setting up every device
again, so keep a backup of the config folder.
Backups contain secrets
Home Assistant backups of this add-on contain the TLS private key
(certs/server.key) and the JWT secret (secrets/jwt.secret), together with the
database. Anyone who holds a backup can impersonate your server to the kids'
devices and sign in as an admin session. Store backups privately and do not share
them. The add-on is stopped while a backup runs (cold backup), so the database is
copied consistently.
Do not change the repository URL
In Home Assistant, add the repository
https://git.nc.kreapptivo.de/KidTime/home-assistant-addon. It is
public, and so is the add-on's image
(git.nc.kreapptivo.de/kidtime/kidtime-addon-aarch64): neither needs a token,
an account or a registry login.
The repository URL you entered in Home Assistant, including any #branch, is
the add-on's identity. Supervisor's repository id is the first 8 hex characters
of the SHA-1 of the lowercased URL as entered, and the slug is <id>_kidtime.
Changing the URL or adding #branch gives a different add-on with an empty
config folder, which would generate a new certificate when started. So do not
change the URL.
If you must change it, move the data over by hand (see "Copying the data into
a new install" below) from the old <old-id>_kidtime folder, and remove the
old entry only after the new one runs.
Uninstalling deletes the certificate
When you uninstall the add-on, Home Assistant asks whether to delete its data. If you let it, the certificate, key and database are gone, and a new certificate would be generated on the next start. Every device would then reject the server. Keep an up-to-date copy of the four folders, or a Home Assistant backup, before uninstalling. To recover, restore the add-on from the Home Assistant backup, or reinstall it and copy the folders back in by hand.
Copying the data into a new install
Home Assistant may create the config folder only on the add-on's first start, and that start generates a new certificate. Copy the data in afterwards:
- Stop the old add-on (or keep it uninstalled) and leave it stopped, so that
only one server claims
kidtime.local. - Install the new add-on, turn off "Start on boot" and the watchdog, start it once and stop it again. The kids' devices reject its new certificate for that moment; they keep the one they know.
- Delete everything inside its config folder:
db,certs,secretsandclient, including any-waland-shmfiles indb. - Copy the four folders in from the old folder or your copy. Include the
-waland-shmfiles next todb.sqlite. - Check that
certs/server.pem,certs/server.keyandsecrets/jwt.secrethave the same SHA-256 hashes as the source (for example withsha256sumin the Home Assistant terminal). - Start the add-on. Its log must say "Certificates loaded"; if it says "Certificates not found, generating new ones", stop it and copy again.
- Turn "Start on boot" and the watchdog back on.