Status API
Check if your homelab server is reachable and which SSH ports are open.
Endpoint
Section titled “Endpoint”GET /api/statusAuthentication
Section titled “Authentication”Requires bearer token in Authorization header.
Authorization: Bearer <token>Response
Section titled “Response”Success (200 OK)
Section titled “Success (200 OK)”{ "homelab_ip": "100.x.y.z", "reachable": true, "initrd_ssh_open": false, "system_ssh_open": true, "initrd_ssh_port": 2222}| Field | Type | Description |
|---|---|---|
homelab_ip | string | Configured target server IP |
reachable | boolean | Server responds to ping |
initrd_ssh_open | boolean | Dropbear SSH port is open |
system_ssh_open | boolean | Main SSH port (22) is open |
initrd_ssh_port | number | Configured dropbear port |
Unauthorized (401)
Section titled “Unauthorized (401)”{ "error": "Invalid or expired token"}Status Interpretation
Section titled “Status Interpretation”| reachable | initrd_ssh | system_ssh | Server State |
|---|---|---|---|
false | false | false | Powered off |
true | true | false | Waiting for LUKS unlock |
true | false | true | Fully booted |
true | false | false | Booting (between stages) |
Timeouts
Section titled “Timeouts”- Ping check: 3 seconds
- SSH port check: 3 seconds per port
If the server is unreachable, the endpoint may take up to 6+ seconds to respond.
Example
Section titled “Example”curl http://localhost/api/status \ -H "Authorization: Bearer $TOKEN"Response interpretation
Section titled “Response interpretation”# Server is off{"reachable": false, "initrd_ssh_open": false, "system_ssh_open": false, ...}
# Server waiting for unlock (time to send passphrase!){"reachable": true, "initrd_ssh_open": true, "system_ssh_open": false, ...}
# Server fully booted{"reachable": true, "initrd_ssh_open": false, "system_ssh_open": true, ...}Polling
Section titled “Polling”For automation, you can poll this endpoint to wait for state changes:
# Wait for server to reach initrdwhile true; do STATUS=$(curl -s http://localhost/api/status -H "Authorization: Bearer $TOKEN") INITRD=$(echo $STATUS | jq -r '.initrd_ssh_open')
if [ "$INITRD" = "true" ]; then echo "Ready for unlock" break fi
sleep 5done