feat: add dockerized 3proxy control plane backend

This commit is contained in:
2026-04-02 00:06:26 +03:00
parent ff2bc8711b
commit 25f6beedd8
20 changed files with 3076 additions and 174 deletions

View File

@@ -4,13 +4,13 @@ Updated: 2026-04-01
## Active
1. Present the UI-first slice for approval, then replace mocks with runtime-backed 3proxy control flows.
1. Harden the new backend/runtime layer, expand system configuration flows, and keep wiring the UI to real panel state instead of fallbacks.
## Next
1. Replace mocks with a backend control plane for config generation, process management, counters, and health checks.
2. Add Docker runtime with 3proxy, panel server, health checks, and reload/start/restart operations.
3. Extend tests to cover config rendering, unsafe input handling, and runtime failure scenarios.
1. Extend the backend to support system-tab editing for services, ports, and runtime configuration.
2. Add stronger validation and tests for unsafe credentials, conflicting ports, and invalid service assignment.
3. Refine Docker/runtime behavior and document real host-access expectations and deployment constraints.
## Done
@@ -25,3 +25,6 @@ Updated: 2026-04-01
9. Stabilized the Users table copy action so the column no longer shifts when the button label changes to `Copied`.
10. Added operator actions in the Users table for pause/resume and delete with confirmation modal coverage.
11. Added a root quick-start prompt file so a new agent can resume implementation or fixes with minimal onboarding.
12. Added a backend control plane with persisted state, 3proxy config generation, runtime actions, and API-backed frontend wiring.
13. Added Docker build/compose runtime that compiles 3proxy in-container and starts the panel with a managed 3proxy process.
14. Added backend tests for config rendering and user-management API edge cases.

View File

@@ -5,9 +5,13 @@ Updated: 2026-04-01
## Root
- `000_START_HERE.md`: copy-ready continuation prompt for the next agent session
- `.dockerignore`: trims Docker build context to runtime-relevant files only
- `AGENTS.md`: repository workflow rules for autonomous contributors
- `compose.yaml`: Docker Compose entrypoint for the bundled panel + 3proxy runtime
- `Dockerfile`: multi-stage image that builds the panel and compiles 3proxy
- `README.md`: quick start and current project scope
- `package.json`: frontend scripts and dependencies
- `tsconfig.server.json`: server type-check configuration
- `vite.config.ts`: Vite + Vitest configuration
## Documentation
@@ -19,14 +23,25 @@ Updated: 2026-04-01
## Frontend
- `src/main.tsx`: application bootstrap
- `src/App.tsx`: authenticated panel shell rebuilt around a topbar/tab layout, plus modal user creation, pause/resume, and delete-confirm flows
- `src/App.tsx`: authenticated panel shell wired to backend APIs with local fallback behavior
- `src/App.test.tsx`: login-gate, modal interaction, pause/resume, and delete-confirm tests
- `src/app.css`: full panel styling
- `src/data/mockDashboard.ts`: realistic mock state shaped for future API responses, including service-bound users
- `src/data/mockDashboard.ts`: default panel state and frontend fallback snapshot
- `src/lib/3proxy.ts`: formatting and status helpers
- `src/lib/3proxy.test.ts`: paranoia-oriented tests for core domain rules
- `src/shared/contracts.ts`: shared panel, service, user, and API data contracts
- `src/test/setup.ts`: Testing Library matchers
## Server
- `server/index.ts`: backend entrypoint and runtime bootstrap
- `server/app.ts`: Express app with panel state and runtime routes
- `server/app.test.ts`: API tests for user management edge cases
- `server/lib/config.ts`: 3proxy config renderer, validation, and dashboard derivation
- `server/lib/config.test.ts`: config-generation regression tests
- `server/lib/runtime.ts`: managed 3proxy process controller
- `server/lib/store.ts`: JSON-backed persistent state store
## Static
- `public/favicon.svg`: Vite default icon placeholder, to replace later