chore: consolidate DBURL into DATA_DIR, codebase audit for 1.0.0
All checks were successful
check / check (push) Successful in 56s

DBURL → DATA_DIR consolidation:
- Remove DBURL env var entirely; main DB now lives at {DATA_DIR}/webhooker.db
- database.go constructs DB path from config.DataDir, ensures dir exists
- Update DATA_DIR prod default from /data/events to /data
- Update all tests to use DataDir instead of DBURL
- Update Dockerfile: /data (not /data/events) for all SQLite databases
- Update README configuration table, Docker examples, architecture docs

Dead code removal:
- Remove unused IndexResponse struct (handlers/index.go)
- Remove unused TemplateData struct (handlers/handlers.go)

Stale comment cleanup:
- Remove TODO in server.go (DB cleanup handled by fx lifecycle)
- Fix nolint:golint → nolint:revive on ServerParams for consistency
- Clean up verbose middleware/routing comments in routes.go
- Fix TODO fan-out description (worker pool, not goroutine-per-target)

.gitignore fixes:
- Add data/ directory to gitignore
- Remove stale config.yaml entry (env-only config since rework)
This commit is contained in:
clawbot
2026-03-01 23:33:20 -08:00
parent 536e5682d6
commit 4dd4dfa5eb
13 changed files with 51 additions and 105 deletions

View File

@@ -21,8 +21,7 @@ import (
"github.com/go-chi/chi"
)
// ServerParams is a standard fx naming convention for dependency injection
// nolint:golint
// nolint:revive // ServerParams is a standard fx naming convention
type ServerParams struct {
fx.In
Logger *logger.Logger
@@ -124,7 +123,6 @@ func (s *Server) serve() int {
func (s *Server) cleanupForExit() {
s.log.Info("cleaning up")
// TODO: close database connections, flush buffers, etc.
}
func (s *Server) cleanShutdown() {