# Environment Variables

`rtmn` reads `RTMN_*` environment variables from the systemd EnvironmentFile.

## Variable List

| Variable | Required | Default | Description |
| --- | --- | --- | --- |
| `RTMN_TELEGRAM_TOKEN` | Yes | None | Telegram bot token |
| `RTMN_ALLOWED_CHAT_IDS` | Yes | None | Allowed chat ID list |
| `RTMN_SHELL_PATH` | No | `/bin/bash` | Shell to execute |
| `RTMN_SHELL_ARGS` | No | Empty | Shell arguments |
| `RTMN_AUDIT_LOG_PATH` | No | `/var/log/rtmn/audit.log` | Audit log path |
| `RTMN_AUDIT_MAX_BYTES` | No | `10485760` | Audit log rotation size |
| `RTMN_AUDIT_MAX_BACKUPS` | No | `5` | Number of audit log backups |
| `RTMN_DEBOUNCE_MS` | No | `200` | Output debounce time |
| `RTMN_MAX_CHUNK_SIZE` | No | `3500` | Telegram output chunk size |
| `RTMN_POLL_TIMEOUT_SEC` | No | `30` | Telegram polling timeout |
| `RTMN_INCOMING_RATE_PER_MIN` | No | `30` | Per-chat input rate limit |
| `RTMN_OUTGOING_RATE_PER_SEC` | No | `25` | Global output rate limit |
| `RTMN_OUTPUT_OVERFLOW_BYTES` | No | `262144` | Output flood cutoff threshold |
| `RTMN_BLOCKED_INTERACTIVE` | No | Built-in denylist | Interactive program denylist |

## Single-Instance Environment File

The default installer creates this environment file:

```
/etc/rtmn/env
```

Recommended permissions:

```
owner: root
group: root
mode:  0600
```

## Account-Isolated Environment Files

Account-isolated installations use one environment file per instance.

Examples:

```
/etc/rtmn/env-ops
/etc/rtmn/env-app
/etc/rtmn/env-admin
```

## Interactive Program Denylist

If `RTMN_BLOCKED_INTERACTIVE` is set, it replaces the built-in denylist.

To add entries while keeping defaults, list the default entries and additions together.

Example:

```
RTMN_BLOCKED_INTERACTIVE=nano,vim,vi,top,htop,mysql,psql,python3
```
