Skip to content

CLI Commands

articwake provides a simple CLI with two main commands.

Terminal window
articwake

Starts the HTTP server with configuration from environment variables.

Terminal window
export ARTICWAKE_HOMELAB_MAC="aa:bb:cc:dd:ee:ff"
export ARTICWAKE_HOMELAB_IP="192.168.1.100"
./articwake

Output:

2024-01-15T10:30:00.000Z INFO articwake: Starting articwake server
2024-01-15T10:30:00.001Z INFO articwake: Listening on 127.0.0.1:80

See Environment Variables for all configuration options.

Terminal window
echo -n "your-pin" | articwake hash-pin

Reads a PIN from stdin and outputs an Argon2id hash suitable for the pin.hash file.

Terminal window
echo -n "1234" | ./articwake hash-pin

Output:

$argon2id$v=19$m=19456,t=2,p=1$randomsalthere$hashedoutputhere
Terminal window
echo -n "your-pin" | ./articwake hash-pin > pin.hash

For more secure input (no PIN in shell history):

Terminal window
read -s -p "Enter PIN: " PIN && echo -n "$PIN" | ./articwake hash-pin > pin.hash
CodeMeaning
0Success
1Configuration error (missing required env vars)
1File access error (can’t read key or PIN hash)

articwake uses structured logging via tracing. Log level is controlled by the RUST_LOG environment variable:

Terminal window
# Default (info level)
./articwake
# Debug logging
RUST_LOG=debug ./articwake
# Trace logging (very verbose)
RUST_LOG=trace ./articwake
# Specific module
RUST_LOG=articwake::auth=debug ./articwake
2024-01-15T10:30:00.000Z INFO articwake::api::auth: Authentication attempt ip=192.168.1.100
2024-01-15T10:30:00.001Z INFO articwake::api::auth: Authentication successful

articwake handles standard Unix signals:

SignalBehavior
SIGTERMGraceful shutdown
SIGINT (Ctrl+C)Graceful shutdown

Create /etc/systemd/system/articwake.service:

[Unit]
Description=articwake Wake-on-LAN and LUKS unlock service
After=network.target
[Service]
Type=simple
User=root
EnvironmentFile=/etc/articwake/config.env
ExecStart=/usr/local/bin/articwake
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target

Enable and start:

Terminal window
sudo systemctl enable articwake
sudo systemctl start articwake

The SD card image includes an OpenRC init script. To manage manually:

Terminal window
# Start
rc-service articwake start
# Stop
rc-service articwake stop
# Status
rc-service articwake status
# Enable on boot
rc-update add articwake default