AgentSkillsCN

haven-config

为 Haven 中继提供配置参考,涵盖 .env 变量、中继 JSON 文件、数据库引擎选择、备份服务提供商,以及速率限制器调优。适用于修改中继设置、新增配置变量,或排查配置问题时使用。

SKILL.md
--- frontmatter
name: haven-config
description: Configuration reference for Haven relay including .env variables, relay JSON files, database engine selection, backup providers, and rate limiter tuning. Use when modifying relay settings, adding new config variables, or debugging configuration issues.

Haven Configuration

All configuration is in .env (copy from .env.example). No config files are baked into the image.

Core Settings

VariableDefaultDescription
OWNER_NPUBOwner's Nostr public key (npub format)
RELAY_URLPublic-facing relay hostname (no wss://)
RELAY_PORT3355Port Haven listens on
RELAY_BIND_ADDRESS0.0.0.0Bind address (empty string = all interfaces)
DB_ENGINEbadgerbadger or lmdb (lmdb needs NVMe for stability)
LMDB_MAPSIZE00 = default (~273 GB), or size in bytes
BLOSSOM_PATHblossom/Media storage directory inside container
TOR_ENABLED0Set to 1 to start a Tor hidden service

Relay Sections

Haven runs four relay types, each with its own settings block:

RelayPrefixPurpose
PrivatePRIVATE_RELAY_*Owner drafts and ecash
ChatCHAT_RELAY_*Private messages, WoT-gated
OutboxOUTBOX_RELAY_*Public notes + Blossom media
InboxINBOX_RELAY_*Interactions with owner's notes

Each relay section has: NAME, NPUB, DESCRIPTION, ICON, and rate limiter vars.

Rate Limiter Variables (per relay)

SuffixDescription
EVENT_IP_LIMITER_TOKENS_PER_INTERVALTokens added per interval
EVENT_IP_LIMITER_INTERVALInterval in seconds
EVENT_IP_LIMITER_MAX_TOKENSBurst capacity
ALLOW_EMPTY_FILTERSAllow filters with no criteria
ALLOW_COMPLEX_FILTERSAllow multi-criteria filters
CONNECTION_RATE_LIMITER_TOKENS_PER_INTERVALConnection tokens per interval
CONNECTION_RATE_LIMITER_INTERVALConnection interval in seconds
CONNECTION_RATE_LIMITER_MAX_TOKENSConnection burst capacity

Chat-specific

VariableDescription
CHAT_RELAY_WOT_DEPTHWeb-of-trust traversal depth
CHAT_RELAY_WOT_REFRESH_INTERVAL_HOURSWoT graph refresh interval
CHAT_RELAY_MINIMUM_FOLLOWERSMin followers to pass WoT gate

Inbox-specific

VariableDescription
INBOX_PULL_INTERVAL_SECONDSHow often to pull from other relays

Relay JSON Files

  • relays_blastr.json — list of relay URLs to blast public notes to
  • relays_import.json — list of relay URLs to import notes from

Both are JSON arrays of relay URL strings. Copy from the .example versions.

Import & Backup

VariableDescription
IMPORT_START_DATEStart date for note import (YYYY-MM-DD)
IMPORT_QUERY_INTERVAL_SECONDSQuery interval during import
IMPORT_SEED_RELAYS_FILEPath to import relays JSON
BACKUP_PROVIDERaws, gcp, or none
BACKUP_INTERVAL_HOURSBackup frequency

AWS backup vars

AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_BUCKET_NAME

GCP backup vars

GCP_BUCKET_NAME

Blastr

VariableDescription
BLASTR_RELAYS_FILEPath to blastr relays JSON (default: relays_blastr.json)