feat: initial project structure

This commit is contained in:
Olivier 2026-04-14 13:29:24 +00:00
commit cf4957010f
10 changed files with 621 additions and 0 deletions

84
config.example.yaml Normal file
View file

@ -0,0 +1,84 @@
# claude-failover — example configuration
#
# Copy to config.yaml and adjust. Do NOT commit the real config: it is
# gitignored because it contains account identifiers and may reference
# local paths holding Claude Code session tokens.
# ---------------------------------------------------------------------------
# accounts
# ---------------------------------------------------------------------------
# Declare every Anthropic account the daemon is allowed to use. Ordering
# matters: the first active account is the default primary, subsequent ones
# are tried in order during failover.
accounts:
- name: compte1
# Directory holding this account's ~/.claude profile. The daemon
# swaps HOME-like state by rotating symlinks pointing at these dirs.
home: /home/ubuntu/.claude-compte1
# Soft limits at which failover is preferred (not a hard cap —
# Anthropic enforces the real ceiling).
limits:
hourly_msgs: 0 # 0 disables local limit
weekly_msgs: 0
priority: 1 # lower = preferred
- name: compte2
home: /home/ubuntu/.claude-compte2
limits:
hourly_msgs: 0
weekly_msgs: 0
priority: 2
# ---------------------------------------------------------------------------
# pool
# ---------------------------------------------------------------------------
# Session pool configuration. Sessions are named ccl-<N> and live in tmux.
pool:
# Persistent sessions dedicated to named projects.
dedicated:
- name: ccl-0
project: /home/ubuntu/projects/dev-management
- name: ccl-1-conformvault
project: /home/ubuntu/projects/filesecure
# Autoscaling sessions for the inbox dispatcher.
autonomous:
prefix: ccl-auto-
min: 2
max: 10
# Shared Claude Code project tree (symlinked from every account home).
shared_projects_dir: /home/ubuntu/.claude-projects-shared
# ---------------------------------------------------------------------------
# quota
# ---------------------------------------------------------------------------
# Thresholds at which the quota-monitor triggers a graceful swap.
quota:
# Poll interval for usage scraping.
poll_interval: 30s
# Trigger failover when 5h window consumption exceeds this ratio.
window_5h_threshold: 0.85
# Trigger failover when weekly window exceeds this ratio.
window_week_threshold: 0.90
# Cooldown before the same account can be re-activated.
reactivate_cooldown: 1h
# ---------------------------------------------------------------------------
# checkpoint
# ---------------------------------------------------------------------------
# The checkpoint goroutine snapshots per-session context so a failover can
# resume on a different account.
checkpoint:
dir: /var/lib/claude-failover/checkpoints
interval: 60s
keep: 20 # per-session retention
# ---------------------------------------------------------------------------
# mcp_http
# ---------------------------------------------------------------------------
# HTTP control plane consumed by the SecuAAS MCP gateway.
mcp_http:
listen: 127.0.0.1:7777
# Bearer required on every request. Rotate via systemd drop-in.
bearer_token_env: CLAUDE_FAILOVER_BEARER
# Paths exposed (all read-only except explicitly listed mutating routes).
enable_trigger: true # allow /trigger/dispatch, /trigger/swap