Commit graph

71 commits

Author SHA1 Message Date
59e4114434 fix(nix): Apply package overlay to node configurations
- Add self.overlays.default to node01/02/03 configurations
- Makes service packages (chainfire-server, flaredb-server, etc.) available to NixOS modules
- Fixes "chainfire-server package not found" error during nixos-anywhere deployment

Root cause: NixOS modules reference pkgs.chainfire-server but packages were not in pkgs scope
Solution: Apply overlay that injects flake packages into nixpkgs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 08:39:19 +09:00
4547dacc7e feat(nix): Add creditservice module for NixOS deployment
- Add creditservice.nix module for credit service deployment
- Update default.nix to import creditservice module
- Required for T039.S3 NixOS provisioning

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 08:35:20 +09:00
bbc7282b33 feat(T039): Complete S2 Bootstrap Infrastructure
Deployed 3-node QEMU VM cluster for production validation:
- VDE switch started for L2 networking (/tmp/vde.sock)
- 3 VMs launched with custom netboot (SSH key baked in)
- Zero-touch SSH access verified on all nodes (ports 2201/2202/2203)
- Direct kernel boot eliminates PXE/ISO requirements

Next: S3 NixOS Provisioning via nixos-anywhere

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 06:55:32 +09:00
1f55724d5d chore: Mark T058 as complete, unblock T039
T058 LightningSTOR S3 Auth Hardening - ALL STEPS COMPLETE:
- S1: SigV4 canonicalization fixed (RFC 3986 compliant)
- S2: Multi-credential env var support implemented
- S3: Comprehensive security tests added (19/19 passing)

T039 Production Deployment now unblocked and ready to proceed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 06:49:14 +09:00
5c1cd9f9fc test(lightningstor): Add comprehensive S3 auth security tests
Added 9 security tests to verify SigV4 authentication hardening:
- Invalid/malformed auth header rejection
- Signature changes with different secret keys
- Signature changes with different request components (body, URI, headers, query params)
- Credential lookup for unknown keys
- Empty credentials fallback
- Malformed S3_CREDENTIALS handling

Result: 19/19 auth tests passing (10 original + 9 new security tests)

Task: T058.S3 Complete
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 06:48:15 +09:00
07b3320436 feat(lightningstor): Add multi-credential S3 auth support
Implement Option B (enhanced env var) for T058.S2:
- Support multiple S3 credentials via S3_CREDENTIALS env var
- Format: "key1:secret1,key2:secret2,..."
- Backward compatible with S3_ACCESS_KEY_ID/S3_SECRET_KEY
- Add tests for both multi and single credential formats

This unblocks T039 production deployment while proper IAM
credential service (T060) is implemented separately.

Tests: 10/10 auth tests pass (added 2 new credential tests)

Refs: T058.S2 Option B (approved), T060 (proper IAM integration)
2025-12-12 06:41:09 +09:00
48e2b33b8a fix(chainfire): Implement DELETE deleted count workaround
Pre-check key existence before delete to return accurate deleted count.
This unblocks integration tests while proper RaftResponse propagation
is deferred to T053.

- Single key: check exists via state_machine.kv().get()
- Range: count keys via state_machine.kv().range()
- Returns deleted=1 if key existed, deleted=0 otherwise

Integration tests now pass: 3/3 ✓

Refs: T059.S2 Option A (approved by PeerA)
2025-12-12 06:35:45 +09:00
eaee9aad08 fix(creditservice): Replace non-existent txn() with compare_and_swap()
- Remove chainfire_client.txn() calls (method doesn't exist)
- Use compare_and_swap(key, 0, value) for atomic wallet creation
- Use put() for wallet updates (CAS on version deferred to later)
- Remove unused proto imports (TxnRequest, TxnResponse, etc.)
- Simplify error handling using CasOutcome.success

This fixes compilation errors found in audit. CreditService now
compiles successfully.

Refs: Audit Fix 1/3
2025-12-12 06:31:19 +09:00
d2149b6249 fix(lightningstor): Fix SigV4 canonicalization for AWS S3 auth
- Replace form_urlencoded with RFC 3986 compliant URI encoding
- Implement aws_uri_encode() matching AWS SigV4 spec exactly
- Unreserved chars (A-Z,a-z,0-9,-,_,.,~) not encoded
- All other chars percent-encoded with uppercase hex
- Preserve slashes in paths, encode in query params
- Normalize empty paths to '/' per AWS spec
- Fix test expectations (body hash, HMAC values)
- Add comprehensive SigV4 signature determinism test

This fixes the canonicalization mismatch that caused signature
validation failures in T047. Auth can now be enabled for production.

Refs: T058.S1
2025-12-12 06:23:46 +09:00
b008d9154a Update FOREMAN_TASK.md to reflect T033 completion and 12/12 deliverables 2025-12-12 04:13:57 +09:00
0174ebf4f1 fix: Correct nix modules import path in node configs (4 levels up to repo root) 2025-12-11 10:01:02 +09:00
5c6eb04a46 T036: Add VM cluster deployment configs for nixos-anywhere
- netboot-base.nix with SSH key auth
- Launch scripts for node01/02/03
- Node configuration.nix and disko.nix
- Nix modules for first-boot automation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 09:59:19 +09:00
954f23a0be chore: Restore .cccc/ entry in .gitignore 2025-12-10 08:35:23 +09:00
df80d00696 feat(T027): Unify configuration for flaredb-server and plasmavmc-server
Refactored flaredb-server and plasmavmc-server to use a unified configuration
approach, supporting TOML files, environment variables, and CLI overrides.

This completes T027.S0 Config Unification.

Changes include:
- Created dedicated  modules for both flaredb-server and plasmavmc-server
  to define  structs.
- Implemented  for  in both components.
- Modified  in flaredb-server to use  instead of .
- Modified  in plasmavmc-server to add  dependency.
- Refactored  in both components to load config from TOML/env and apply
  CLI overrides.
- Extended  in plasmavmc-server/src/config.rs to include all
  relevant Firecracker backend parameters.
- Implemented  in
  plasmavmc/crates/plasmavmc-firecracker/src/lib.rs to construct backend
  from the unified configuration.
- Updated docs/por/T027-production-hardening/task.yaml to mark S0 as complete
  and the overall task status as active.
2025-12-10 05:11:04 +09:00
baa3e038f9 Add NixOS service modules to git tracking
The nix/modules directory was untracked, causing flake evaluation to fail
when referencing ./nix/modules. This adds 9 service module definitions
created during T024 NixOS packaging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 17:34:41 +09:00
519da1d3d5 Add Cargo.lock files for nix build
- Add chainfire/Cargo.lock, flaredb/Cargo.lock, iam/Cargo.lock
- Remove Cargo.lock from chainfire/.gitignore
- Required for nix buildRustPackage cargoLock

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 16:52:21 +09:00
8f94aee1fa Fix R8: Convert submodule gitlinks to regular directories
- Remove gitlinks (160000 mode) for chainfire, flaredb, iam
- Add workspace contents as regular tracked files
- Update flake.nix to use simple paths instead of builtins.fetchGit

This resolves the nix build failure where submodule directories
appeared empty in the nix store.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 16:51:20 +09:00
e4de4e8c66 Fix R8: Use builtins.fetchGit for submodule workspaces
- Added chainfireSrc, flaredbSrc, iamSrc with submodules=true
- Updated chainfire-server, flaredb-server, iam-server to use fetched sources
- Resolves T026.S1 blocker (nix build failures on submodule paths)

Implements fix suggested by Foreman 000313 and PeerA 000314
2025-12-09 06:33:08 +09:00
84032b8182 Remove .gitmodules and update docs 2025-12-09 06:28:22 +09:00
a7ec7e2158 Add T026 practical test + k8shost to flake + workspace files
- Created T026-practical-test task.yaml for MVP smoke testing
- Added k8shost-server to flake.nix (packages, apps, overlays)
- Staged all workspace directories for nix flake build
- Updated flake.nix shellHook to include k8shost

Resolves: T026.S1 blocker (R8 - nix submodule visibility)
2025-12-09 06:07:50 +09:00
736e034c42 Add submodules (flaredb, chainfire, iam) and gitignore
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 23:50:32 +09:00