Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e88ea9107 | |||
| b0ac7426b7 | |||
| 941761ad83 | |||
| c21ed699ec | |||
| f77582fdcd | |||
| 654becfd86 | |||
| dcc3f692f3 | |||
| 1d22f1e85e | |||
| b87b1eceae |
@@ -1,3 +1,3 @@
|
||||
833504
|
||||
833505
|
||||
833519
|
||||
836417
|
||||
836418
|
||||
836432
|
||||
|
||||
@@ -17,7 +17,15 @@ https://:8919 {
|
||||
}
|
||||
|
||||
# Next.js HMR Support (WebSocket)
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
handle /_next/webpack-hmr {
|
||||
reverse_proxy http://localhost:8917 {
|
||||
header_up Upgrade {>Upgrade}
|
||||
header_up Connection {>Connection}
|
||||
}
|
||||
}
|
||||
|
||||
reverse_proxy http://localhost:8917 {
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
header_up X-Forwarded-Proto https
|
||||
header_up X-Forwarded-Host {host}
|
||||
}
|
||||
@@ -37,7 +45,7 @@ https://:8918 {
|
||||
}
|
||||
|
||||
reverse_proxy http://localhost:8916 {
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
header_up X-Forwarded-Proto https
|
||||
header_up X-Forwarded-Host {host}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,10 @@ A unified system for inventory management featuring web administration, offline
|
||||
|
||||
### 2.3 Operations & Tooling
|
||||
- **PWA**: `next-pwa` (Service Workers + Manifest)
|
||||
- **HTTPS Proxy**: Caddy (Port 8909)
|
||||
- **HTTPS Proxy**: Caddy (Ports 8918/8919)
|
||||
- **Containerization**: Docker & Docker Compose
|
||||
- **Deployment**: `deploy.sh` (Docker) or `start_server.sh` (Standalone)
|
||||
- **Deployment**: `deploy.py` (Docker) or `run_standalone.py` (Standalone)
|
||||
- **Configuration**: Domain-specific YAML (`config/`) with `network.yaml` as SSOT.
|
||||
|
||||
---
|
||||
|
||||
@@ -73,9 +74,9 @@ A unified system for inventory management featuring web administration, offline
|
||||
- **JWT**: Stateless tokens for API auth.
|
||||
- **LDAP**: Primary source of truth for users in enterprise mode.
|
||||
- **Password Caching**: Encrypted local cache for offline authentication.
|
||||
- **CORS**: Restricted origins in production via `config/backend.yaml`.
|
||||
- **CORS**: Restricted origins in production via `config/network.yaml` (SSOT).
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: 2026-04-23
|
||||
**Version**: 1.14.7
|
||||
**Version**: 1.14.19
|
||||
|
||||
@@ -61,7 +61,7 @@ async def export_inventory_snapshot(
|
||||
# Log export action
|
||||
from backend.models import AuditLog
|
||||
audit_entry = AuditLog(
|
||||
user_id=admin_user.id,
|
||||
user_id=admin_user.sub,
|
||||
action="EXPORT_INVENTORY_SNAPSHOT",
|
||||
details=f"Exported in {format_type} format",
|
||||
)
|
||||
@@ -113,7 +113,7 @@ async def export_audit_trail(
|
||||
|
||||
# Log export action
|
||||
audit_entry = AuditLog(
|
||||
user_id=admin_user.id,
|
||||
user_id=admin_user.sub,
|
||||
action="EXPORT_AUDIT_TRAIL",
|
||||
details=f"Exported in {format_type} format",
|
||||
)
|
||||
@@ -211,7 +211,7 @@ async def export_db(
|
||||
|
||||
# Log export action
|
||||
audit_entry = AuditLog(
|
||||
user_id=admin_user.id,
|
||||
user_id=admin_user.sub,
|
||||
action="EXPORT_DB",
|
||||
details=f"Exported {type} in {format_type} format",
|
||||
)
|
||||
|
||||
BIN
backups/ainventory_2026-04-23_15-15-00.tar.gz
Normal file
BIN
backups/ainventory_2026-04-23_15-15-00.tar.gz
Normal file
Binary file not shown.
BIN
backups/ainventory_2026-04-23_15-18-15.tar.gz
Normal file
BIN
backups/ainventory_2026-04-23_15-18-15.tar.gz
Normal file
Binary file not shown.
BIN
backups/ainventory_2026-04-23_15-19-55.tar.gz
Normal file
BIN
backups/ainventory_2026-04-23_15-19-55.tar.gz
Normal file
Binary file not shown.
BIN
backups/ainventory_2026-04-23_15-24-28.tar.gz
Normal file
BIN
backups/ainventory_2026-04-23_15-24-28.tar.gz
Normal file
Binary file not shown.
BIN
backups/ainventory_2026-04-23_15-27-27.tar.gz
Normal file
BIN
backups/ainventory_2026-04-23_15-27-27.tar.gz
Normal file
Binary file not shown.
@@ -41,9 +41,10 @@ A unified inventory management system that eliminates manual data entry through
|
||||
### Phase 7: Config Consolidation (COMPLETED ✓)
|
||||
- **Centralization**: All config in `config/` folder (YAML format).
|
||||
- **Automation**: Bash scripts converted to Python (`scripts/`).
|
||||
- **Structure**: Clear separation of `backend.yaml`, `frontend.yaml`, `network.yaml`, `docker.yaml`, `secrets.yaml`.
|
||||
- **SSOT Architecture**: `network.yaml` established as Master IP/Port authority.
|
||||
- **Dynamic Injection**: Automatic API URL and CORS calculation from master config.
|
||||
- **D-06 Load Order**: Env Vars > YAML > Defaults.
|
||||
- **Deprecation**: `inventory.env` completely removed.
|
||||
- **Deprecation**: `inventory.env` and legacy `.sh` scripts completely removed.
|
||||
|
||||
### Phase 8: Hardening & Release (PLANNED)
|
||||
- Stability monitoring, final UX refinements, production-ready runbook.
|
||||
|
||||
@@ -2,53 +2,53 @@
|
||||
|
||||
**Active AI:** Claude Haiku 4.5 (Claude Code)
|
||||
**Last Updated:** 2026-04-23
|
||||
**Current Version:** v1.14.7
|
||||
**Status**: ✅ PHASE 7 COMPLETE
|
||||
**Current Version:** v1.14.19
|
||||
**Status**: ✅ PHASE 7 COMPLETE | 🟢 READY FOR PHASE 8
|
||||
|
||||
---
|
||||
|
||||
## SESSION 41 EXECUTION — Phase 7 Execution & Consolidation
|
||||
## SESSION 41 EXECUTION SUMMARY — Infrastructure & Export Fixes
|
||||
|
||||
### Work Completed This Session
|
||||
### 1. Phase 7: Config Consolidation (COMPLETE)
|
||||
- **Centralized YAML**: Migrated all configuration to `config/*.yaml`.
|
||||
- **SSOT Architecture**: Established `network.yaml` as the Master Source of Truth for Server IP and Port management.
|
||||
- **Dynamic Injection**: Frontend API URLs and Backend CORS are now dynamically calculated from master network settings.
|
||||
- **Python Tooling**: All legacy `.sh` scripts converted to robust, secure Python scripts in `scripts/`.
|
||||
- **Enhanced Launcher**: `run_standalone.py` now supports `start`, `stop`, `restart`, `status`, and Caddy SSL proxying.
|
||||
|
||||
**1. Phase 7 Execution (Config Consolidation):**
|
||||
- ✅ Wave 1: Created `config/` structure, 5 schema examples, 4 actual config files, and 155-line `config/README.md`.
|
||||
- ✅ Wave 2 (Backend): Refactored `backend/config_loader.py` for YAML and D-06 load order. Updated `config_manager.py`, `main.py`, and `entrypoint.sh`.
|
||||
- ✅ Wave 2 (Scripts): Converted `deploy.sh`, `run_standalone.sh`, `install_service.sh`, and `export_prod.sh` to secure Python scripts with YAML parsing.
|
||||
- ✅ Wave 3 (Docker & Docs): Updated `docker-compose.yml` (volume mounts), `Dockerfile`, `.gitignore`, `DEPLOYMENT.md`, and `README.md`.
|
||||
- ✅ Post-Wave: Refactored legacy `load_dotenv()` in `ai_vision.py`, `check_models.py`, `gemini.py`, and `claude.py`.
|
||||
- ✅ Cleanup: Deleted all deprecated bash scripts and legacy `.env` files. Updated `scripts/save_version.py` for new infrastructure.
|
||||
### 2. Admin & Security Improvements
|
||||
- **AI Key Detection**: Fixed backend logic to correctly report AI key status from YAML/Secrets.
|
||||
- **Secure Saving**: Implemented `ConfigManager.update_keys()` to route sensitive data correctly to `secrets.yaml`.
|
||||
- **Recursion Fix**: Resolved a critical infinite recursion loop in the configuration manager.
|
||||
|
||||
**2. Versioning & State Sync:**
|
||||
- ✅ Incremented version to `v1.14.7` across all SSOT files (`VERSION.json`, `frontend/VERSION.json`, `PROJECT_ARCHITECTURE.md`, `dev_docs/PLAN.md`).
|
||||
- ✅ Updated roadmap in `dev_docs/PLAN.md` marking Phase 7 as COMPLETED.
|
||||
- ✅ Verified all files pass syntax checks (Python/Bash).
|
||||
### 3. Export System Overhaul
|
||||
- **Data Integrity**: Fixed a routing collision that caused binary SQLite downloads instead of CSV data.
|
||||
- **FastAPI Streaming**: Refactored exports to use `StreamingResponse` for memory efficiency.
|
||||
- **Premium UI**: Integrated the `ExportPanel` into the dark-mode aesthetic with standard premium button styles.
|
||||
- **WebSocket Fix**: Improved Caddy configuration for Next.js HMR stability.
|
||||
|
||||
### Phase 7 Artifact Status
|
||||
- **Plans**: `.planning/phases/07-config-consolidation/07-01-PLAN.md` ✓ COMPLETED
|
||||
- **Plans**: `.planning/phases/07-config-consolidation/07-02-PLAN.md` ✓ COMPLETED
|
||||
- **Plans**: `.planning/phases/07-config-consolidation/07-03-PLAN.md` ✓ COMPLETED
|
||||
- **Plans**: `.planning/phases/07-config-consolidation/07-04-PLAN.md` ✓ COMPLETED
|
||||
- **Summaries**: `.planning/phases/07-config-consolidation/07-01,02,03,04-SUMMARY.md` ✓ Created
|
||||
- **Context**: `.planning/phases/07-config-consolidation/07-CONTEXT.md` ✓ Archived
|
||||
### 4. Cleanup & Preparation
|
||||
- ✅ Deleted all deprecated `.sh` and `.env` files.
|
||||
- ✅ Rebuilt virtual environment (`venv/`) and verified dependencies (added `openpyxl`).
|
||||
- ✅ Incremented system version to **v1.14.19**.
|
||||
|
||||
---
|
||||
|
||||
## NEXT STEPS
|
||||
## NEXT STEPS (Phase 8: Hardening & Release)
|
||||
|
||||
1. **Start Phase 8 (Hardening & Release)**:
|
||||
- Perform end-to-end testing of the new Python deployment scripts.
|
||||
- Verify Docker deployment with `python3 scripts/deploy.py production`.
|
||||
- Perform final UX refinements and accessibility audits.
|
||||
- Prepare production-ready runbook for v1.15.0 stable release.
|
||||
1. **End-to-End Testing**:
|
||||
- Verify data consistency in multi-page Excel exports.
|
||||
- Stress test the new Python-based deployment scripts.
|
||||
|
||||
2. **Stability Monitoring**:
|
||||
- Check logs for any configuration parsing warnings.
|
||||
- Ensure all environment variable overrides work as expected (D-06).
|
||||
2. **UX Refinement**:
|
||||
- Perform a final accessibility audit on the new Admin UI components.
|
||||
- Ensure consistent loading states across all Admin panels.
|
||||
|
||||
3. **Cleanup**:
|
||||
- Archive Phase 7 planning artifacts to `dev_docs/ARCHIVE_LOGS.md` or similar.
|
||||
3. **Production Preparation**:
|
||||
- Finalize the production runbook.
|
||||
- Prepare for the v1.15.0 "Stable" release milestone.
|
||||
|
||||
---
|
||||
|
||||
✓ Phase 7 fully implemented, verified, and cleaned up. Ready for the next phase.
|
||||
✓ All tasks for this session are implemented, verified, and committed.
|
||||
✓ Services are currently RUNNING in the background.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "1.14.15",
|
||||
"last_build": "2026-04-23-1514",
|
||||
"version": "1.14.20",
|
||||
"last_build": "2026-04-23-1536",
|
||||
"codename": "ConfigCore",
|
||||
"commit": "76f0e83a"
|
||||
"commit": "b0ac7426"
|
||||
}
|
||||
@@ -29,26 +29,27 @@ export function ExportPanel() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div data-testid="admin-tab-exports" className="p-4 md:p-6 bg-surface border border-slate-800 rounded-3xl space-y-4 md:space-y-6">
|
||||
<header className="flex items-center gap-3">
|
||||
<div className="p-3 md:p-4 bg-indigo-500/10 rounded-2xl text-indigo-400 border border-indigo-500/20 shadow-xl shadow-indigo-500/5">
|
||||
<FileDown size={28} className="md:w-8 md:h-8" />
|
||||
<div data-testid="admin-tab-exports" className="bg-surface/50 border border-slate-800/50 rounded-[2.5rem] p-4 md:p-6 flex flex-col shadow-2xl transition-all h-full">
|
||||
<div className="flex items-center gap-3 mb-4 md:mb-6">
|
||||
<div className="w-10 h-10 rounded-xl bg-indigo-500/10 flex items-center justify-center text-indigo-400 border border-indigo-500/20">
|
||||
<FileDown size={20} />
|
||||
</div>
|
||||
<div>
|
||||
<h2 className="text-xl md:text-2xl font-normal text-white">Export & Reports</h2>
|
||||
<p className="text-[10px] md:text-xs text-muted font-normal tracking-tight mt-0.5">
|
||||
Download inventory snapshots and audit trails
|
||||
</p>
|
||||
<h2 className="text-xl font-normal text-white tracking-tight">Export & Reports</h2>
|
||||
<p className="text-[10px] md:text-xs text-muted font-normal tracking-tight">Download system snapshots and action logs</p>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<div className="grid md:grid-cols-2 gap-4">
|
||||
{/* Inventory Snapshot Section */}
|
||||
<div className="p-4 bg-slate-800/40 border border-slate-800 rounded-2xl space-y-4">
|
||||
<div>
|
||||
<h3 className="text-sm font-normal text-secondary">Inventory Snapshot</h3>
|
||||
<p className="text-xs text-muted mt-0.5">
|
||||
Export current inventory state with all item details
|
||||
<div className="p-4 bg-background/40 border border-slate-800/40 rounded-2xl hover:border-primary/20 transition-all group flex flex-col justify-between">
|
||||
<div className="mb-4">
|
||||
<h3 className="text-sm font-normal text-secondary flex items-center gap-2">
|
||||
<FileSpreadsheet size={14} className="text-primary" />
|
||||
Inventory Snapshot
|
||||
</h3>
|
||||
<p className="text-xs text-muted mt-1 leading-relaxed">
|
||||
Export current inventory state with all item details and locations.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -56,76 +57,62 @@ export function ExportPanel() {
|
||||
<button
|
||||
onClick={() => handleExportSnapshot("csv")}
|
||||
disabled={isLoading}
|
||||
className="bg-surface border border-slate-800 hover:border-primary/50 hover:bg-slate-800/50 text-white font-normal py-2.5 px-3 rounded-xl transition-all active:scale-[0.98] disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center gap-2 text-xs focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none group"
|
||||
className="px-5 py-1.5 bg-primary hover:bg-primary/90 text-white rounded-xl text-sm font-normal transition-all active:scale-95 shadow-xl shadow-primary/10 tracking-tight border border-primary/30 flex items-center justify-center gap-2 disabled:opacity-50"
|
||||
aria-label="Export inventory snapshot as CSV"
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader2 size={16} className="animate-spin text-primary" />
|
||||
) : (
|
||||
<FileText size={16} className="text-blue-400 group-hover:text-blue-300 transition-colors" />
|
||||
)}
|
||||
<span>CSV</span>
|
||||
{isLoading ? <Loader2 size={14} className="animate-spin" /> : <FileText size={14} />}
|
||||
CSV
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleExportSnapshot("xlsx")}
|
||||
disabled={isLoading}
|
||||
className="bg-surface border border-slate-800 hover:border-primary/50 hover:bg-slate-800/50 text-white font-normal py-2.5 px-3 rounded-xl transition-all active:scale-[0.98] disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center gap-2 text-xs focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none group"
|
||||
className="px-5 py-1.5 bg-primary hover:bg-primary/90 text-white rounded-xl text-sm font-normal transition-all active:scale-95 shadow-xl shadow-primary/10 tracking-tight border border-primary/30 flex items-center justify-center gap-2 disabled:opacity-50"
|
||||
aria-label="Export inventory snapshot as Excel"
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader2 size={16} className="animate-spin text-primary" />
|
||||
) : (
|
||||
<FileSpreadsheet size={16} className="text-emerald-400 group-hover:text-emerald-300 transition-colors" />
|
||||
)}
|
||||
<span>Excel</span>
|
||||
{isLoading ? <Loader2 size={14} className="animate-spin" /> : <FileSpreadsheet size={14} />}
|
||||
Excel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Audit Trail Section */}
|
||||
<div className="p-4 bg-slate-800/40 border border-slate-800 rounded-2xl space-y-4">
|
||||
<div>
|
||||
<h3 className="text-sm font-normal text-secondary">Audit Trail</h3>
|
||||
<p className="text-xs text-muted mt-0.5">
|
||||
Complete log of system actions and changes
|
||||
<div className="p-4 bg-background/40 border border-slate-800/40 rounded-2xl hover:border-primary/20 transition-all group flex flex-col justify-between">
|
||||
<div className="mb-4">
|
||||
<h3 className="text-sm font-normal text-secondary flex items-center gap-2">
|
||||
<FileText size={14} className="text-indigo-400" />
|
||||
Audit Trail
|
||||
</h3>
|
||||
<p className="text-xs text-muted mt-1 leading-relaxed">
|
||||
Complete history of system actions, changes, and user operations.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
<button
|
||||
onClick={() => handleExportAuditTrail("csv")}
|
||||
disabled={isLoading}
|
||||
className="bg-surface border border-slate-800 hover:border-primary/50 hover:bg-slate-800/50 text-white font-normal py-2.5 px-3 rounded-xl transition-all active:scale-[0.98] disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center gap-2 text-xs focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none group"
|
||||
className="px-5 py-1.5 bg-primary hover:bg-primary/90 text-white rounded-xl text-sm font-normal transition-all active:scale-95 shadow-xl shadow-primary/10 tracking-tight border border-primary/30 flex items-center justify-center gap-2 disabled:opacity-50"
|
||||
aria-label="Export audit trail as CSV"
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader2 size={16} className="animate-spin text-primary" />
|
||||
) : (
|
||||
<FileText size={16} className="text-blue-400 group-hover:text-blue-300 transition-colors" />
|
||||
)}
|
||||
<span>CSV</span>
|
||||
{isLoading ? <Loader2 size={14} className="animate-spin" /> : <FileText size={14} />}
|
||||
CSV
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleExportAuditTrail("xlsx")}
|
||||
disabled={isLoading}
|
||||
className="bg-surface border border-slate-800 hover:border-primary/50 hover:bg-slate-800/50 text-white font-normal py-2.5 px-3 rounded-xl transition-all active:scale-[0.98] disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center gap-2 text-xs focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none group"
|
||||
className="px-5 py-1.5 bg-primary hover:bg-primary/90 text-white rounded-xl text-sm font-normal transition-all active:scale-95 shadow-xl shadow-primary/10 tracking-tight border border-primary/30 flex items-center justify-center gap-2 disabled:opacity-50"
|
||||
aria-label="Export audit trail as Excel"
|
||||
>
|
||||
{isLoading ? (
|
||||
<Loader2 size={16} className="animate-spin text-primary" />
|
||||
) : (
|
||||
<FileSpreadsheet size={16} className="text-emerald-400 group-hover:text-emerald-300 transition-colors" />
|
||||
)}
|
||||
<span>Excel</span>
|
||||
{isLoading ? <Loader2 size={14} className="animate-spin" /> : <FileSpreadsheet size={14} />}
|
||||
Excel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{error && (
|
||||
<div className="p-3 bg-rose-500/10 border border-rose-500/20 rounded-xl text-rose-500 text-[10px] flex items-center gap-2 animate-in fade-in zoom-in duration-300">
|
||||
<div className="mt-4 p-3 bg-rose-500/10 border border-rose-500/20 rounded-xl text-rose-500 text-[10px] flex items-center gap-2 animate-in slide-in-from-top-2 duration-300">
|
||||
<div className="w-1.5 h-1.5 bg-rose-500 rounded-full animate-pulse" />
|
||||
<span className="font-normal">Error: {error}</span>
|
||||
<span className="font-normal truncate">Error: {error}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user