Skip to content

LUKS Unlock API

Send your LUKS passphrase to the server’s dropbear SSH for disk decryption.

POST /api/unlock

Requires bearer token in Authorization header.

Authorization: Bearer <token>
Content-Type: application/json
Authorization: Bearer <token>
{
"passphrase": "your-luks-passphrase"
}
FieldTypeRequiredDescription
passphrasestringYesLUKS disk encryption passphrase
{
"success": true,
"message": "Passphrase sent successfully"
}
{
"error": "Passphrase cannot be empty"
}

Or:

{
"error": "Passphrase too long"
}

Or:

{
"error": "Passphrase contains invalid characters"
}
{
"error": "Invalid or expired token"
}
{
"error": "Failed to unlock: Connection refused"
}
RuleLimit
Minimum length1 character
Maximum length1024 characters
Forbidden charactersControl characters (null, newline, tab, etc.)

Valid characters include letters, numbers, spaces, and special characters like !@#$%^&*().

  1. articwake connects via SSH to the dropbear server running in initrd
  2. Authenticates using the configured Ed25519 private key
  3. Requests a PTY and shell
  4. Sends the passphrase to stdin (consumed by cryptsetup-askpass)
  5. Closes the connection

The server’s LUKS container unlocks and the system continues booting.

Terminal window
ARTICWAKE_HOMELAB_IP="100.x.y.z"
ARTICWAKE_SSH_PORT="2222"
ARTICWAKE_SSH_KEY_PATH="/etc/secrets/articwake-key"
Terminal window
curl -X POST http://localhost/api/unlock \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"passphrase": "my-secret-passphrase"}'
const response = await fetch('http://localhost/api/unlock', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ passphrase: 'my-secret-passphrase' })
});
const result = await response.json();
  • The passphrase is never stored by articwake
  • It’s transmitted over SSH (encrypted) to your server
  • The connection uses public key authentication
  • articwake accepts any host key (dropbear regenerates keys on each boot)
  1. The LUKS container unlocks and the system continues booting
  2. Wait ~30-60 seconds for the full system boot
  3. Poll /api/status until system_ssh_open becomes true
  4. Your server is now fully accessible
  • Server hasn’t finished booting to initrd yet
  • Check /api/status - initrd_ssh_open should be true
  • Wait and retry
  • SSH key not authorized in server’s initrd
  • Wrong key configured in ARTICWAKE_SSH_KEY_PATH
  • See SSH Key Setup
  • Dropbear might be on a different port
  • Check ARTICWAKE_SSH_PORT configuration
  • Common ports: 22, 2222, 4748
  • Wrong LUKS passphrase
  • Try unlocking manually to verify:
    Terminal window
    ssh -p 2222 -i /path/to/key root@server-ip
    # Then enter passphrase at prompt