# Environment Configuration

Credentials and configuration for the team.

---

## Required Environment Variables

All environment variables must be set in `~/.bashrc` or container environment. Do not hardcode values in scripts or configuration files.

### Core Variables

| Variable | Description | Required |
|----------|-------------|----------|
| `AI_CONFIG_REPO` | Path to data-service-infra-ai-configurations repo | Yes |
| `MINIMAX_API_KEY` | MiniMax API key for AI model | Yes |
| `JIRA_API_TOKEN` | Jira API token | Yes |
| `GRAFANA_API_TOKEN` | Grafana API token | Yes |
| `FEISHU_DAILY_INSPECTION_SPACE_ID`| Wiki space ID for daily inspection docs | Yes |
| `FEISHU_ALERT_CHAT_ID` | Feishu group ID for alerts | Yes |

### AWS Bedrock (Optional)

| Variable | Description | Default |
|----------|-------------|---------|
| `AWS_BEARER_TOKEN_BEDROCK` | AWS Bedrock credentials | - |
| `AWS_REGION` | AWS region | us-east-1 |
| `ANTHROPIC_MODEL` | Bedrock model ARN | - |
| `CLAUDE_CODE_USE_BEDROCK` | Enable Bedrock for Claude Code | 1 |

### GitHub App

| Variable | Description |
|----------|-------------|
| `GITHUB_APP_ID` | App ID: 3002333 |
| `GITHUB_APP_INSTALLATION_ID` | Installation ID: 113867057 |
| `GITHUB_APP_PRIVATE_KEY_PATH` | Path to PEM file |
| `GITHUB_REPO_LOC` | Path to GitHub repos (~/github) |

---

## API Credentials

| Service | Account/ID | Environment Variable | File |
|---------|------------|---------------------|------|
| MiniMax | API Key | `MINIMAX_API_KEY` | - |
| Jira | - | `JIRA_API_TOKEN` | - |
| Grafana | - | `GRAFANA_API_TOKEN` | - |
| GitHub | App ID: 3002333 | - | `~/.github/data-service-code-assist.pem` |
| GitHub | Installation: 113867057 | - | - |

---

## Feishu Configuration

### App Credentials
| Account | App ID | App Secret | Container |
|---------|--------|------------|-----------|
| assistant | cli_xxx | - | openclaw-xxx |
| shared | cli_xxx | xxx | openclaw-shared |

### Bitable
- **Oncall Records Table**:
  - App Token: `xxx`
  - Table ID: `xxx`

### Group IDs
- Alert Group: `oc_xxx`
- PR Sync Group: `oc_xxx`

---

## Docker Containers

### Container List
| Container | Role | Config Path |
|-----------|------|-------------|
| openclaw-member1 | Member | ~/openclaw-config/openclaw-member1/ |
| openclaw-member2 | Member | ~/openclaw-config/openclaw-member2/ |
| openclaw-member3 | Member | ~/openclaw-config/openclaw-member3/ |
| openclaw-shared | System | ~/openclaw-config/openclaw-shared/ |

### Deployment Files
- Compose: `~/openclaw-team/docker-compose.yml`
- Deploy Script: `~/openclaw-team/deploy.sh`
- Image: `openclaw-agent:latest`

---

## Backup Locations

| Type | Location |
|------|----------|
| Config Backup | `~/.openclaw/backups/` |
| Token Usage | `~/.openclaw/token-usage/YYYY-MM-DD.txt` |
| Memory Backup | `~/.openclaw/memory-backup/YYYY-MM/` |
| TiDB Backup | `~/.openclaw/tidb-backup/` |

---

## GitHub Token Script

Location: `~/.github-app/github-app-token.sh`

```bash
#!/bin/bash
APP_ID=3002333
INSTALLATION_ID=113867057
PRIVATE_KEY=~/.github/data-service-code-assist.pem

# Generate JWT using your preferred method
# Then call GitHub API to get access token
```

---

## Wiki Documents

| Document | URL |
|----------|-----|
| Architecture | https://pingcap.feishu.cn/wiki/xxx |
| Daily Inspection | https://pingcap.feishu.cn/wiki/xxx |
| Weekly Report Template | https://pingcap.feishu.cn/wiki/xxx |
