# Configuration

This page lists every environment variable the CLI and the API server read, and how `.env` is loaded.

## Loading Rules

Both the CLI and the API server call `godotenv.Load()` on startup to read `.env` from the **current working directory**. A missing file only logs a warning, and system environment variables still apply.

```bash
cp .env.expample .env
```

## CLI Variables

| Variable | Required | Description |
|---|---|---|
| `PODRUN_SERVER` | Yes | Remote hostname or IP |
| `PODRUN_USERNAME` | Yes | Remote SSH user |
| `PODRUN_PASSWORD` | Yes | Remote SSH password, passed to `sshpass -p` |

If any is missing, `CheckENV()` returns `missing required environment: <variables>` and the CLI aborts. The SSH address is `$PODRUN_USERNAME@$PODRUN_SERVER`.

## API Server Variables

| Variable | Required | Default | Description |
|---|---|---|---|
| `DB_PATH` | No | Inside a container: `/data/database.db`; otherwise `~/.podrun/database.db` | SQLite file path |
| `ALLOW_EMAILS` | No | — | Listed in `.env.expample`; the matching user-management code is currently disabled |

## Fixed Values

These values are hard-coded and cannot be configured:

| Item | Value |
|---|---|
| Remote root folder | `/home/podrun` |
| API server listen address | `:8080` |
| CLI report address | `http://localhost:8080` |
| Schema file | `sql/create.sql` (relative to the working directory) |
| SSH connection test timeout | `ConnectTimeout=3` |

## Example

```dotenv
PODRUN_SERVER=192.168.1.100
PODRUN_USERNAME=podrun
PODRUN_PASSWORD=yourpassword

DB_PATH=/var/lib/podrun/database.db
```
