]> git.frustrated-labs.net Git - squad-rotation-bot.git/commitdiff
chore: remove database related configuration
authorAlexander Goussas <[email protected]>
Sun, 26 Apr 2026 03:55:11 +0000 (22:55 -0500)
committerAlexander Goussas <[email protected]>
Sun, 26 Apr 2026 03:55:11 +0000 (22:55 -0500)
config/config.go
docker-compose.yaml
main.go

index 79fd24872a54850c7073036b211bcde7838c7303..c8066aa2192de51a0be39dad957e5b0ed800235f 100644 (file)
@@ -6,13 +6,11 @@ import (
 )
 
 type Config struct {
-       WebHookUrl  string
-       DatabaseUrl string
+       WebHookUrl string
 }
 
 const (
        WEB_HOOK_URL = "WEB_HOOK_URL"
-       DATABASE_URL = "DATABASE_URL"
 )
 
 func ReadConfig() (*Config, error) {
@@ -21,13 +19,7 @@ func ReadConfig() (*Config, error) {
                return nil, fmt.Errorf("%s is not set", WEB_HOOK_URL)
        }
 
-       databaseUrl := os.Getenv(DATABASE_URL)
-       if databaseUrl == "" {
-               return nil, fmt.Errorf("%s is not set", DATABASE_URL)
-       }
-
        return &Config{
-               WebHookUrl:  webHookUrl,
-               DatabaseUrl: databaseUrl,
+               WebHookUrl: webHookUrl,
        }, nil
 }
index 970bbbdb47348e7979c4a773577f30649ae8efd5..bbb18fc117c4f27313eb9709240da7dcb8e04fc7 100644 (file)
@@ -7,11 +7,8 @@ services:
       context: .
     environment:
       WEB_HOOK_URL: "${WEB_HOOK_URL:-https://example.com}"
-      DATABASE_URL: "${DB_URL:-postgresql://postgres:postgres@db:5432/postgres?application_name=squad_rotation_bot}"
     ports:
       - "3000:8080"
-    depends_on:
-      - db
 
   cron:
     image: "ubuntu:22.04"
@@ -31,19 +28,3 @@ services:
       - "./scripts/crontab:/apps/crontab"
     depends_on:
       - bot
-      - db
-
-  db:
-    image: "postgres:17"
-    container_name: postgres_db
-    restart: unless-stopped
-    environment:
-      POSTGRES_USER: "${DB_USER:-postgres}"
-      POSTGRES_PASSWORD: "${DB_PASSWORD:-postgres}"
-      POSTGRES_DB: "${DB_NAME:-postgres}"
-    ports:
-      - "5432:5432"
-    volumes:
-      - ./db_data:/var/lib/postgresql/data
-      - ./database/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
-      - ./database/seed.sql:/docker-entrypoint-initdb.d/seed.sql:ro
diff --git a/main.go b/main.go
index 4c4db6b6da3f4e8e68ec1c1707f012f75255fa1e..d6a771127271a9a56506e084f5e0b056cbce9caa 100644 (file)
--- a/main.go
+++ b/main.go
@@ -20,6 +20,7 @@ func main() {
        messagingService := services.CreateMessagingService(config)
 
        http.HandleFunc("/api/v1/rotation/trigger", api.TriggerBot(memberService, rotationService, messagingService))
+
        http.HandleFunc("/api/v1/rotation/members", func(w http.ResponseWriter, r *http.Request) {
                switch r.Method {
                case http.MethodGet: