From c13fd8c7460846f7184c192b67340748d7f16f2e Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 29 Dec 2025 15:51:54 +0700 Subject: [PATCH] Update TODO.md with completed items Mark as complete: - Server.Run(), Shutdown(), SetupRoutes() - Container logs viewing - Container restart/stop/start controls --- TODO.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/TODO.md b/TODO.md index 3f96ec9..4efa4f6 100644 --- a/TODO.md +++ b/TODO.md @@ -10,9 +10,9 @@ - [x] SQLite database with embedded migrations - [x] Embedded templates (html/template) - [x] Embedded static assets (Tailwind CSS, JS) -- [ ] Server startup (`Server.Run()`) -- [ ] Graceful shutdown (`Server.Shutdown()`) -- [ ] Route wiring (`SetupRoutes()`) +- [x] Server startup (`Server.Run()`) +- [x] Graceful shutdown (`Server.Shutdown()`) +- [x] Route wiring (`SetupRoutes()`) ### Authentication & Authorization - [x] Single admin user model @@ -52,14 +52,14 @@ - [x] Deployment status tracking (building, deploying, success, failed) - [x] Deployment logs storage - [x] View deployment history per app -- [ ] Container logs viewing +- [x] Container logs viewing - [ ] Deployment rollback to previous image - [ ] Deployment cancellation ### Manual Container Controls -- [ ] Restart container -- [ ] Stop container -- [ ] Start stopped container +- [x] Restart container +- [x] Stop container +- [x] Start stopped container ### Webhook Integration - [x] Gitea webhook endpoint (`/webhook/:secret`) @@ -132,15 +132,15 @@ ## Phase 1: Critical (Application Cannot Start) ### 1.1 Server Startup Infrastructure -- [ ] Implement `Server.Run()` in `internal/server/server.go` +- [x] Implement `Server.Run()` in `internal/server/server.go` - Start HTTP server with configured address/port - Handle TLS if configured - Block until shutdown signal received -- [ ] Implement `Server.Shutdown()` in `internal/server/server.go` +- [x] Implement `Server.Shutdown()` in `internal/server/server.go` - Graceful shutdown with context timeout - Close database connections - Stop running containers gracefully (optional) -- [ ] Implement `SetupRoutes()` in `internal/server/routes.go` +- [x] Implement `SetupRoutes()` in `internal/server/routes.go` - Wire up chi router with all handlers - Apply middleware (logging, auth, CORS, metrics) - Define public vs protected route groups @@ -171,20 +171,20 @@ Protected Routes (require auth): ## Phase 2: High Priority (Core Functionality Gaps) ### 2.1 Container Logs -- [ ] Implement `HandleAppLogs()` in `internal/handlers/app.go` +- [x] Implement `HandleAppLogs()` in `internal/handlers/app.go` - Fetch logs via Docker API (`ContainerLogs`) - Support tail parameter (last N lines) - Stream logs with SSE or chunked response -- [ ] Add Docker client method `GetContainerLogs(containerID, tail int) (io.Reader, error)` +- [x] Add Docker client method `GetContainerLogs(containerID, tail int) (io.Reader, error)` ### 2.2 Manual Container Controls -- [ ] Add `POST /apps/:id/restart` endpoint +- [x] Add `POST /apps/:id/restart` endpoint - Stop and start container - Record restart in deployment log -- [ ] Add `POST /apps/:id/stop` endpoint +- [x] Add `POST /apps/:id/stop` endpoint - Stop container without deleting - Update app status -- [ ] Add `POST /apps/:id/start` endpoint +- [x] Add `POST /apps/:id/start` endpoint - Start stopped container - Run health check