Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/operations/systemd.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@ the value never reaches git. For the PDU that is `hardware.username_env` and
variables. Inline `hardware.username` / `hardware.password` still work for a
bench test, but the daemon logs a warning against committing them.

Any top-level config key can also be replaced by a `LIBBY_<KEY>` variable,
which suits a value that is itself a secret. `HispecDaemon` names the broker
but holds no password, so every host supplies one:

```bash
sudo tee -a /etc/hispec/secrets.env <<'EOF'
LIBBY_RABBITMQ_URL=amqp://<user>:<password>@131.215.200.214
EOF
```

Without it a daemon is refused with `ACCESS_REFUSED ... mechanism PLAIN`.

## Troubleshooting

Start here:
Expand Down
14 changes: 14 additions & 0 deletions src/hispec/daemon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
"""Common base for the HISPEC daemons: transport, broker and config sources."""

from typing import Optional

from libby.daemon import LibbyDaemon

# The shared broker, on hispec-new; credentials come from LIBBY_RABBITMQ_URL
BROKER_URL = "amqp://131.215.200.214"


class HispecDaemon(LibbyDaemon):
"""Instantiates the HispecDaemon base using LibbyDaemon.
Expand All @@ -8,3 +15,10 @@ class HispecDaemon(LibbyDaemon):

transport = "rabbitmq"
discovery_enabled = False
rabbitmq_url = BROKER_URL

@classmethod
def from_config_file(cls, path: str, daemon_id: Optional[str] = None, *,
env_prefix: Optional[str] = "LIBBY_") -> "HispecDaemon":
"""Build a daemon, applying LIBBY_* environment overrides by default."""
return super().from_config_file(path, daemon_id, env_prefix=env_prefix)
Loading