# mealie

## Overview
The mealie stack is a Docker Swarm-based service that provides a recipe manager for NetGrimoire. It consists of the mealie service, which handles user authentication, recipe management, and SSO.

---

## Architecture
| Service | Image | Port | Role |
|---------|-------|------|------|
- **Host:** docker4
- **Network:** netgrimoire
- **Exposed via:** `recipe.netgrimoire.com`
- **Homepage group:** PNCHarris Apps

---

## Build & Configuration

### Prerequisites
None specified

### Volume Setup
```bash
mkdir -p /DockerVol/mealie:/app/data
chown -R nobody:nobody /DockerVol/mealie
```

### Environment Variables
```bash
# generate: openssl rand -hex 32
PUID=1001
PGID=998
TZ=America/Chicago

MAX_WORKERS=1
WEB_CONCURRENCY=1
BASE_URL=https://recipe.netgrimoire.com

ALLOW_PASSWORD_LOGIN=false
ALLOW_SIGNUP=false

OIDC_AUTH_ENABLED=true
OIDC_PROVIDER_NAME=authentik
OIDC_CONFIGURATION_URL=https://auth.netgrimoire.com/application/o/mealie/.well-known/openid-configuration
OIDC_CLIENT_ID=tidMeWe3Ak30zRzcmC5vwoCqAIHXQsaVwJEp44Mz
OIDC_CLIENT_SECRET=OD0CLgELUEWGoZ8IUnduGbxhyhh4vgjMBxBAjyopNOkATWIEWSYeWRDdfY6ulX2Fj7zuUp9dpgzjoFatNviLD8E5Cv2815eDrZxH9gNb52Taur0LzqBPk25yLCvsnjXK
OIDC_AUTO_REDIRECT=true
OIDC_REMEMBER_ME=true

OIDC_SIGNUP_ENABLED=true
OIDC_USER_CLAIM=sub
OIDC_NAME_CLAIM=preferred_username
OIDC_GROUPS_CLAIM=groups
OIDC_SCOPES_OVERRIDE=openid profile email

OIDC_USER_GROUP=mealie-users
OIDC_ADMIN_GROUP=mealie-admins
```

### Deploy
```bash
cd services/swarm/stack/mealie
set -a && source .env && set +a
docker stack config --compose-file mealie-stack.yml > resolved.yml
docker stack deploy --compose-file resolved.yml mealie
rm resolved.yml
docker stack services mealie
```

### First Run
```bash
./deploy.sh
```

---

## User Guide

### Accessing mealie
| Service | URL | Purpose |
- **recipe.netgrimoire.com** | Internal only | Recipe Manager |

### Primary Use Cases
To use the recipe manager, access `recipe.netgrimoire.com` and log in with your NetGrimoire credentials.

### NetGrimoire Integrations
The mealie service connects to NetGrimoire through the following services:
- authentik (OIDC provider)

---

## Operations

### Monitoring
```bash
docker stack services mealie
<docker service logs commands>
```

### Backups
Critical: `/DockerVol/mealie`
Reconstructable: None

### Restore
```bash
cd services/swarm/stack/mealie
./deploy.sh
```

---

## Common Failures
- **Symptom:** Mealie service not responding.
- **Cause:** Inadequate resources or misconfigured environment variables.
- **Fix:** Increase resources or verify and correct environment variables.

- **Symptom:** Failed OIDC authentication.
- **Cause:** Incorrect OIDC configuration or client secret mismatch.
- **Fix:** Review and update OIDC configuration or regenerate client secrets.

- **Symptom:** Mealie service not logging into NetGrimoire.
- **Cause:** Incorrect credentials or authentication setup.
- **Fix:** Verify and correct credentials, or enable local auth/login.

---

## Changelog

| Date | Commit | Summary |
|------|--------|---------|
| 2026-04-14 | b7b2ae6e | Initial documentation |
| 2026-04-14 | 0520af76 | Migrated to Docker Swarm configuration |
| 2026-04-14 | 49688e1c | Updated environment variables and deploy script |
| 2026-01-20 | 061ab0c2 | Changed default port configuration |
| 2026-01-10 | 1a374911 | Introduced support for local auth/login |

---

## Notes
- Generated by Gremlin on 2026-04-15T03:29:01.105Z
- Source: swarm/mealie.yaml