Add web-based API key management with secure backup and validation#9
Merged
SaltProphet merged 4 commits intomainfrom Jan 14, 2026
Merged
Conversation
…ment Co-authored-by: SaltProphet <237044883+SaltProphet@users.noreply.github.com>
Co-authored-by: SaltProphet <237044883+SaltProphet@users.noreply.github.com>
Co-authored-by: SaltProphet <237044883+SaltProphet@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement web-based API key management system
Add web-based API key management with secure backup and validation
Jan 14, 2026
SaltProphet
approved these changes
Jan 14, 2026
This was referenced Jan 14, 2026
SaltProphet
pushed a commit
that referenced
this pull request
Jan 14, 2026
Resolved conflicts by keeping PR #8 implementation. Both PR #8 and PR #9 added identical config management features. Conflicts resolved: - services/config_manager.py: Kept PR #8 version - dashboard.py: Kept PR #8 version with all endpoints - templates/config.html: Kept PR #8 dark theme implementation - static/: Kept PR #8 CSS and JS files - tests/test_config_manager.py: Kept PR #8 test suite All features from PR #8 preserved: ✓ Backend ConfigManager service ✓ Dashboard API endpoints ✓ Dark theme UI ✓ Hardware monitoring ✓ Data visualization ✓ psutil dependency added
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.
Implements a configuration UI for managing API keys, service toggles, cost limits, and pipeline settings through the dashboard. All changes persist to
.envwith automatic backups, validation, and rollback.Changes
Backend (
services/config_manager.py).envupdates viapython-dotenv.set_key()API Endpoints (
dashboard.py)DASHBOARD_PASSWORD) withauto_error=Falsefor graceful degradationDASHBOARD_ALLOWED_IPS)Frontend UI (
templates/config.html,static/)/configSecurity
.envand all backupsDocumentation
README.mdwith configuration management sectionDASHBOARD_PASSWORDandDASHBOARD_ALLOWED_IPSto.env.exampleconfig_backups/to.gitignoreconfig_updated,config_test,config_backup_created,config_restoredScreenshots
Configuration Interface

Backup Management

Configuration Schema
Usage
Original prompt
🎯 Objective
Implement a comprehensive web-based API key management system that allows users to securely configure, test, and manage all API keys and service settings through the dashboard UI. All changes should persist to the
.envfile with automatic backups and robust validation.📋 Requirements
1. Backend Service:
services/config_manager.pyCreate a new
ConfigManagerclass with the following capabilities:Configuration Structure
Manage 4 categories of settings:
API Keys:
OPENAI_API_KEY- Pattern:^sk-[a-zA-Z0-9]{32,}$(required, masked)REDDIT_CLIENT_ID- Pattern:^[a-zA-Z0-9_-]{14,}$(required)REDDIT_CLIENT_SECRET- Pattern:^[a-zA-Z0-9_-]{27,}$(required, masked)REDDIT_USER_AGENT- Pattern:^.{5,}$(required)GUMROAD_ACCESS_TOKEN- Pattern:^[a-zA-Z0-9_-]{32,}$(required, masked)Service Toggles (boolean):
OPENAI_ENABLED- Enable/disable OpenAI callsREDDIT_ENABLED- Enable/disable Reddit ingestionGUMROAD_ENABLED- Enable/disable Gumroad publishingKILL_SWITCH- Emergency stop for entire pipelineCost Limits (numeric):
MAX_USD_PER_RUN- Float, range: 0.01 to 1000.0MAX_USD_LIFETIME- Float, range: 1.0 to 10000.0MAX_TOKENS_PER_RUN- Integer, range: 1000 to 1000000Pipeline Settings:
REDDIT_SUBREDDITS- Comma-separated list, pattern:^[a-zA-Z0-9_,-]+$REDDIT_MIN_SCORE- Integer, range: 0 to 100000REDDIT_POST_LIMIT- Integer, range: 1 to 100Core Methods
Error Handling
ConfigValidationErrorexceptionSecurity
./config_backups/directory2. Enhanced Dashboard API:
dashboard.pyAdd these new REST endpoints:
Security Middleware
Add optional HTTP Basic Auth: