# Environment

All configuration is provided via environment variables in `.env`. Use `.env.example` as the starting point.

```
APP_NAME="Image to Font Generation"
ENV=production
IMAGE_TO_FONT_API_KEY=<64 hex chars>
APP_TIMEZONE=Europe/London
RUN_CRON=true
```

Generate a secure API key and set it in `.env`, then verify it is available to the app.

```
openssl rand -hex 32
```

After updating `.env`, make sure the environment variables are loaded and the app is restarted.

## DigitalOcean Spaces

```
DO_SPACES_ENDPOINT=
DO_SPACES_REGION=LON1
DO_SPACES_BUCKET=
DO_SPACES_ACCESS_KEY=
DO_SPACES_SECRET_KEY=
```

## Slack Error Notifications

Set these in `.env` to enable Slack error reporting:

```
SLACK_ERROR_NOTIFICATIONS_ENABLED=true
SLACK_ERROR_WEBHOOK_URL=<your webhook url>
```

## Preserve URL processing artifacts (optional)

These settings only apply to the URL-based endpoint (`/api/v1/handwriting/process-url`).

```
HANDWRITING_PRESERVE_WORK_DIR=true
HANDWRITING_PRESERVE_DIR=/var/www/html/python/imageToFontGeneration/debug_runs
HANDWRITING_RETENTION_DAYS_SUCCESS=10
HANDWRITING_RETENTION_DAYS_FAILED=30
```
