Update TODO.md with completed items

Mark as complete:
- Server.Run(), Shutdown(), SetupRoutes()
- Container logs viewing
- Container restart/stop/start controls
This commit is contained in:
Jeffrey Paul 2025-12-29 15:51:54 +07:00
parent 8403e431d2
commit c13fd8c746

30
TODO.md
View File

@ -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