Remove unused DB_TYPE configuration variable

This commit is contained in:
2025-11-26 17:49:08 +01:00
parent a71c5a6d76
commit 0019a4a095
3 changed files with 2 additions and 9 deletions
-1
View File
@@ -1,4 +1,3 @@
DB_TYPE=sqlite
DB_PATH=./data/apocapoc.db DB_PATH=./data/apocapoc.db
PORT=8080 PORT=8080
+2 -3
View File
@@ -9,7 +9,7 @@ Self-hosted habit tracking service with a clean, hexagonal architecture.
- **Carry-over support**: Choose if incomplete habits persist or expire - **Carry-over support**: Choose if incomplete habits persist or expire
- **Full history tracking**: Complete audit trail of all interactions - **Full history tracking**: Complete audit trail of all interactions
- **Charts & Analytics**: Heatmaps, line charts, and statistics - **Charts & Analytics**: Heatmaps, line charts, and statistics
- **Self-hosted first**: Easy deployment with SQLite or PostgreSQL - **Self-hosted first**: Easy deployment with SQLite
## Quick Start ## Quick Start
@@ -24,7 +24,6 @@ services:
ports: ports:
- "8080:8080" - "8080:8080"
environment: environment:
- DB_TYPE=sqlite
- DB_PATH=/data/apocapoc.db - DB_PATH=/data/apocapoc.db
- JWT_SECRET=YOUR_SECRET_HERE - JWT_SECRET=YOUR_SECRET_HERE
- JWT_EXPIRY=24h - JWT_EXPIRY=24h
@@ -69,7 +68,7 @@ The API will be available at `http://localhost:8080`
### Prerequisites ### Prerequisites
- Go 1.23+ - Go 1.23+
- SQLite (or PostgreSQL) - SQLite
### Running locally ### Running locally
-5
View File
@@ -8,7 +8,6 @@ import (
) )
type Config struct { type Config struct {
DBType string
DBPath string DBPath string
Port string Port string
Host string Host string
@@ -23,7 +22,6 @@ func Load() (*Config, error) {
godotenv.Load() godotenv.Load()
cfg := &Config{ cfg := &Config{
DBType: os.Getenv("DB_TYPE"),
DBPath: os.Getenv("DB_PATH"), DBPath: os.Getenv("DB_PATH"),
Port: getEnvOrDefault("PORT", "8080"), Port: getEnvOrDefault("PORT", "8080"),
Host: getEnvOrDefault("HOST", "0.0.0.0"), Host: getEnvOrDefault("HOST", "0.0.0.0"),
@@ -34,9 +32,6 @@ func Load() (*Config, error) {
DefaultTimezone: os.Getenv("DEFAULT_TIMEZONE"), DefaultTimezone: os.Getenv("DEFAULT_TIMEZONE"),
} }
if cfg.DBType == "" {
return nil, fmt.Errorf("DB_TYPE is required")
}
if cfg.DBPath == "" { if cfg.DBPath == "" {
return nil, fmt.Errorf("DB_PATH is required") return nil, fmt.Errorf("DB_PATH is required")
} }