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
78 changes: 78 additions & 0 deletions pmoves/bootstrap/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,84 @@
}
}
]
},
{
"id": "wger",
"name": "Wger Workout Manager",
"description": "Self-hosted fitness tracker with workout logging, weight tracking, and nutrition planning. Integration with PMOVES.AI event-driven architecture for health metrics.",
"variables": [
{
"key": "WGER_ADMIN_PASSWORD",
"file": "pmoves/env.shared",
"prompt": "Wger Django admin password",
"help": "Password for the Django superuser account at http://localhost:8000/admin/. Auto-generated as base64-encoded 16-byte random value.",
"required": true,
"sensitive": true,
"generate": {
"type": "random_bytes_base64",
"length": 16
}
},
{
"key": "WGER_API_TOKEN",
"file": "pmoves/env.shared",
"prompt": "Wger REST API token",
"help": "Django REST Framework token for API access. Must be generated from the Wger admin UI at http://localhost:8000/api/v2/token/. Set to GENERATE_FROM_WGER_UI as placeholder.",
"required": true,
"sensitive": true
},
{
"key": "WGER_DB_PASSWORD",
"file": "pmoves/env.shared",
"prompt": "Wger PostgreSQL database password",
"help": "Password for the wger PostgreSQL user.",
"required": true,
"sensitive": true,
"generate": {
"type": "random_urlsafe",
"length": 32
}
},
{
"key": "WGER_SECRET_KEY",
"file": "pmoves/env.shared",
"prompt": "Wger Django secret key",
"help": "Django SECRET_KEY for cryptographic signing. Generate: openssl rand -base64 48",
"required": true,
"sensitive": true,
"generate": {
"type": "random_urlsafe",
"length": 64
}
},
{
"key": "WGER_ENABLE_REGISTRATION",
"file": "pmoves/env.shared",
"prompt": "Allow public user registration",
"help": "Set to 'true' to allow public user registration, 'false' to disable.",
"required": false,
"default": "false",
"type": "boolean"
},
{
"key": "WGER_ENABLE_NATS",
"file": "pmoves/env.shared",
"prompt": "Enable NATS event publishing",
"help": "Set to 'true' to enable NATS event publishing for health metrics and workouts.",
"required": false,
"default": "true",
"type": "boolean"
},
{
"key": "NATS_URL",
"file": "pmoves/env.shared",
"prompt": "NATS connection URL",
"default": "nats://nats:pmoves@nats:4222",
"help": "NATS server URL with authentication for event publishing.",
"required": true,
"type": "url"
}
]
}
]
}
70 changes: 70 additions & 0 deletions pmoves/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2869,6 +2869,71 @@ services:
retries: 3
start_period: 15s

# Wger - Fitness tracker with health metrics and workout logging
wger:
<<: *tier-api-hardened
image: ${WGER_IMAGE:-ghcr.io/powerfulmoves/pmoves-health-wger:pmoves-latest}
restart: unless-stopped
environment:
# Database configuration
- DATABASE_URL=postgres://wger:${WGER_DB_PASSWORD:-changeme}@wger-db:5432/wger
# Django configuration
- DJANGO_ALLOWED_HOSTS=*
- DJANGO_SECRET_KEY=${WGER_SECRET_KEY:-changeme}
- WGER_ENABLE_REGISTRATION=${WGER_ENABLE_REGISTRATION:-true}
# NATS configuration for event publishing
- NATS_URL=${NATS_URL:-nats://nats:pmoves@nats:4222}
- WGER_ENABLE_NATS=${WGER_ENABLE_NATS:-true}
# Admin credentials
- WGER_ADMIN_PASSWORD=${WGER_ADMIN_PASSWORD:-changeme}
# PMOVES integration
- ENABLE_OBSERVABILITY=${WGER_OBSERVABILITY:-true}
- PROMETHEUS_MULTIPROC_DIR=/tmp/prometheus
ports:
- "${WGER_PORT:-8000}:8000"
Comment on lines +2877 to +2893

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Flag hardcoded default secrets in environment block.

Per coding guidelines, hardcoded credentials/default secrets should be flagged. The following environment variables use changeme as default values which could lead to insecure deployments if not overridden:

  • WGER_DB_PASSWORD:-changeme (line 2879)
  • WGER_SECRET_KEY:-changeme (line 2882)
  • WGER_ADMIN_PASSWORD:-changeme (line 2888)

Consider using the required variable syntax (:?) to enforce setting these secrets, similar to how other services in this file handle sensitive credentials (e.g., MEILI_MASTER_KEY:?Set MEILI_MASTER_KEY).

🔒 Proposed fix to enforce secret configuration
 environment:
   # Database configuration
-  - DATABASE_URL=postgres://wger:${WGER_DB_PASSWORD:-changeme}@wger-db:5432/wger
+  - DATABASE_URL=postgres://wger:${WGER_DB_PASSWORD:?Set WGER_DB_PASSWORD in env.tier-data}@wger-db:5432/wger
   # Django configuration
   - DJANGO_ALLOWED_HOSTS=*
-  - DJANGO_SECRET_KEY=${WGER_SECRET_KEY:-changeme}
+  - DJANGO_SECRET_KEY=${WGER_SECRET_KEY:?Set WGER_SECRET_KEY in env.tier-api}
   - WGER_ENABLE_REGISTRATION=${WGER_ENABLE_REGISTRATION:-true}
   # NATS configuration for event publishing
   - NATS_URL=${NATS_URL:-nats://nats:pmoves@nats:4222}
   - WGER_ENABLE_NATS=${WGER_ENABLE_NATS:-true}
   # Admin credentials
-  - WGER_ADMIN_PASSWORD=${WGER_ADMIN_PASSWORD:-changeme}
+  - WGER_ADMIN_PASSWORD=${WGER_ADMIN_PASSWORD:?Set WGER_ADMIN_PASSWORD in env.tier-api}

As per coding guidelines: "Flag hardcoded credentials/default secrets in environment blocks."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
environment:
# Database configuration
- DATABASE_URL=postgres://wger:${WGER_DB_PASSWORD:-changeme}@wger-db:5432/wger
# Django configuration
- DJANGO_ALLOWED_HOSTS=*
- DJANGO_SECRET_KEY=${WGER_SECRET_KEY:-changeme}
- WGER_ENABLE_REGISTRATION=${WGER_ENABLE_REGISTRATION:-true}
# NATS configuration for event publishing
- NATS_URL=${NATS_URL:-nats://nats:pmoves@nats:4222}
- WGER_ENABLE_NATS=${WGER_ENABLE_NATS:-true}
# Admin credentials
- WGER_ADMIN_PASSWORD=${WGER_ADMIN_PASSWORD:-changeme}
# PMOVES integration
- ENABLE_OBSERVABILITY=${WGER_OBSERVABILITY:-true}
- PROMETHEUS_MULTIPROC_DIR=/tmp/prometheus
ports:
- "${WGER_PORT:-8000}:8000"
environment:
# Database configuration
- DATABASE_URL=postgres://wger:${WGER_DB_PASSWORD:?Set WGER_DB_PASSWORD in env.tier-data}@wger-db:5432/wger
# Django configuration
- DJANGO_ALLOWED_HOSTS=*
- DJANGO_SECRET_KEY=${WGER_SECRET_KEY:?Set WGER_SECRET_KEY in env.tier-api}
- WGER_ENABLE_REGISTRATION=${WGER_ENABLE_REGISTRATION:-true}
# NATS configuration for event publishing
- NATS_URL=${NATS_URL:-nats://nats:pmoves@nats:4222}
- WGER_ENABLE_NATS=${WGER_ENABLE_NATS:-true}
# Admin credentials
- WGER_ADMIN_PASSWORD=${WGER_ADMIN_PASSWORD:?Set WGER_ADMIN_PASSWORD in env.tier-api}
# PMOVES integration
- ENABLE_OBSERVABILITY=${WGER_OBSERVABILITY:-true}
- PROMETHEUS_MULTIPROC_DIR=/tmp/prometheus
ports:
- "${WGER_PORT:-8000}:8000"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pmoves/docker-compose.yml` around lines 2877 - 2893, Replace the insecure
":-changeme" defaults for the secrets with required-variable syntax so
deployments fail fast when secrets are not provided: update the DATABASE_URL's
WGER_DB_PASSWORD to use ${WGER_DB_PASSWORD:?Set WGER_DB_PASSWORD}, change
DJANGO_SECRET_KEY to ${WGER_SECRET_KEY:?Set WGER_SECRET_KEY}, and change
WGER_ADMIN_PASSWORD to ${WGER_ADMIN_PASSWORD:?Set WGER_ADMIN_PASSWORD}; locate
these by the environment variable names (WGER_DB_PASSWORD, WGER_SECRET_KEY,
WGER_ADMIN_PASSWORD) in the environment block and ensure the error messages
clearly instruct operators to set the variables.

profiles: ["health", "wger"]
networks:
- pmoves_api
- pmoves_bus
- pmoves_data
depends_on:
wger-db:
condition: service_healthy
nats:
condition: service_healthy
volumes:
- wger-static:/home/wger/static
- wger-media:/home/wger/media
- wger-prometheus:/tmp/prometheus
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/v2/health/', timeout=5)"]
interval: 30s
timeout: 10s
retries: 5
start_period: 40s

# Wger database - PostgreSQL backend for fitness data
wger-db:
<<: *tier-data-hardened
image: postgres:15-alpine
restart: unless-stopped
environment:
- POSTGRES_DB=wger
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=${WGER_DB_PASSWORD:-changeme}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- wger-db:/var/lib/postgresql/data
profiles: ["health", "wger"]
networks:
- pmoves_data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U wger -d wger"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s

# Comfy Watcher - ComfyUI output watcher for NATS integration
comfy-watcher:
build:
Expand Down Expand Up @@ -3335,6 +3400,11 @@ volumes:
comfy-watcher-output: {}
comfy-watcher-state: {}
llama-results: {}
# Wger fitness tracker volumes
wger-db: {}
wger-static: {}
wger-media: {}
wger-prometheus: {}
networks:
pmoves_data:
name: pmoves_data
Expand Down
Loading
Loading