feat(moni): add post-install and API key rotation operations#40
Merged
CodeMonkeyCybersecurity merged 1 commit intomainfrom Nov 6, 2025
Conversation
Implemented two new operations for Moni (BionicGPT) management: 1. Post-Installation Configuration (eos update moni --post-install): - Waits for PostgreSQL and LiteLLM to be ready - Upserts database models (safe UPSERT pattern) - Regenerates API keys automatically - Follows Assess → Intervene → Evaluate pattern 2. API Key Rotation (eos update moni --rotate-api-keys): - Loads environment configuration from .env - Verifies database and LiteLLM health - Deletes old virtual key from LiteLLM - Generates new virtual key with all models - Updates .env file and database - Restarts application container - Verifies authentication and database state Package Structure: - pkg/bionicgpt/postinstall/: Post-installation business logic - pkg/bionicgpt/apikeys/: API key rotation business logic - cmd/update/moni.go: Command orchestration (flags and handlers) Implementation Details: - Uses INSERT ... ON CONFLICT for safe model upserts - LiteLLM key generation via curl to localhost:4000 - Environment file backup before updates - Docker exec for PostgreSQL operations - Structured logging with otelzap for observability Testing: - gofmt validation passed - Code follows CLAUDE.md patterns (Assess → Intervene → Evaluate) - Architecture compliance (cmd/ orchestration, pkg/ business logic) Examples: eos update moni --post-install eos update moni --rotate-api-keys eos update moni --post-install --install-dir /opt/moni
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented two new operations for Moni (BionicGPT) management:
Post-Installation Configuration (eos update moni --post-install):
API Key Rotation (eos update moni --rotate-api-keys):
Package Structure:
Implementation Details:
Testing:
Examples:
eos update moni --post-install eos update moni --rotate-api-keys eos update moni --post-install --install-dir /opt/moni