# Hawser | a dockhand agent (engl.)

Connect your dockhand...

#### Install:

```bash
curl -fsSL https://raw.githubusercontent.com/Finsys/hawser/main/scripts/install.sh | bash
```

Token: Use at least 24 characters. Tokens are hashed with Argon2id on the Dockhand side, so length and randomness matter more than character set.

```bash
openssl rand -hex 32
```

Self signed certificate:

```bash
cd /etc/hawser

openssl genrsa -out server.key 2048

openssl req -new -key server.key -out cert.csr

openssl x509 -req -days 3650 -in cert.csr -signkey server.key -out server.crt
```

##### /etc/hawser/config

```bash
# Hawser Configuration
# See https://github.com/Finsys/hawser for documentation

# Docker socket path
DOCKER_SOCKET=/var/run/docker.sock

#################### Standard Mode (comment out for Edge mode) ####################
PORT=2376

# TLS configuration (optional, Standard mode only)
TLS_CERT=/etc/hawser/server.crt
TLS_KEY=/etc/hawser/server.key

# Token authentication (optional)
TOKEN=e39183a873beb[....]17feda7046a3c401

################# Edge Mode (uncomment and configure for Edge mode) ###############
# DOCKHAND_SERVER_URL=wss://your-dockhand.example.com/api/hawser/connect
# TOKEN=your-agent-token-taken-from-dockhand

# TLS configuration for self-signed Dockhand (optional, Edge mode only)
# CA_CERT=/etc/hawser/dockhand-ca.crt
# TLS_SKIP_VERIFY=false

# Agent identification (optional)
# AGENT_NAME=my-server

# Edge mode only needs port 2376 open for Docker's HEALTHCHECK directive.
# Restrict it to localhost so the host has no externally-reachable surface:
# BIND_ADDRESS=127.0.0.1
```

#### Start hawser

```bash
systemctl enable hawser.service

systemctl start hawser.service

systemctl status hawser.service

journalctl -u hawser.service -f
```