Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ func setupServices(db *database.Database, cfg *config.Config) *Services {
calorieService := services.NewCalorieService(calorieRepo)

var exerciseService services.ExerciseService
if cfg.ExerciseDB.Enabled {
exerciseDBClient := clients.NewExerciseDBClient(&cfg.ExerciseDB, logger.New(cfg.Log.Level, cfg.Log.Format))
cacheService := services.NewExerciseCacheService(exerciseRepo, exerciseDBClient, logger.New(cfg.Log.Level, cfg.Log.Format), 24*time.Hour)
if cfg.Wger.Enabled {
wgerClient := clients.NewWgerClient(&cfg.Wger, logger.New(cfg.Log.Level, cfg.Log.Format))
cacheService := services.NewExerciseCacheService(exerciseRepo, wgerClient, logger.New(cfg.Log.Level, cfg.Log.Format), 24*time.Hour)
exerciseService = services.NewExerciseService(exerciseRepo, cacheService, logger.New(cfg.Log.Level, cfg.Log.Format))
} else {
exerciseService = nil
Expand Down
9 changes: 5 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ services:
- RATE_LIMIT_AUTH_PER_MINUTE=20
- RATE_LIMIT_GENERAL_PER_MINUTE=60
- RATE_LIMIT_BURST_SIZE=10
- EXERCISEDB_ENABLED=true
- EXERCISEDB_BASE_URL=https://exercise.hellogym.io
- EXERCISEDB_TIMEOUT=30s
- EXERCISEDB_RETRY_COUNT=3
- WGER_API_ENABLED=true
- WGER_API_BASE_URL=https://wger.de/api/v2
- WGER_API_KEY=
- WGER_API_TIMEOUT=30s
- WGER_API_RETRY_COUNT=3
- SECURITY_HSTS_MAX_AGE=31536000
- SECURITY_HSTS_INCLUDE_SUBDOMAINS=true
- SECURITY_X_FRAME_OPTIONS=DENY
Expand Down
18 changes: 10 additions & 8 deletions env.example
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,17 @@ SECURITY_REFERRER_POLICY=strict-origin-when-cross-origin
# X-XSS-Protection (0, 1, 1; mode=block)
SECURITY_XSS_PROTECTION=1; mode=block

# ExerciseDB Configuration
# Base URL for ExerciseDB API
EXERCISEDB_BASE_URL=https://exercise.hellogym.io
# Request timeout for ExerciseDB API
EXERCISEDB_TIMEOUT=30s
# wger API Configuration
# Base URL for wger API
WGER_API_BASE_URL=https://wger.de/api/v2
# API key for wger API (optional, but recommended for higher rate limits)
WGER_API_KEY=
# Request timeout for wger API
WGER_API_TIMEOUT=30s
# Number of retry attempts for failed requests
EXERCISEDB_RETRY_COUNT=3
# Enable/disable ExerciseDB integration
EXERCISEDB_ENABLED=true
WGER_API_RETRY_COUNT=3
# Enable/disable wger API integration
WGER_API_ENABLED=true

# Security Requirements:
# - JWT_SECRET must be at least 32 characters
Expand Down
218 changes: 0 additions & 218 deletions internal/clients/exercisedb_client.go

This file was deleted.

Loading