Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,33 @@ https://controld.com/dashboard/profiles/741861frakbm/filters
```bash
git clone https://github.com/YOUR_USERNAME/ctrld-sync.git
cd ctrld-sync
```

2. **Install dependencies**

Choose one of the following methods:

**Using pip (recommended for CI/production):**
```bash
pip install -r requirements.txt
```

**Using uv (faster for local development):**
```bash
uv sync
```

Both methods are fully supported. Our main sync CI workflow uses `pip` for consistency with caching, while other workflows use `uv`; `uv` is generally faster for local development.

2. **Configure secrets**
3. **Configure secrets**
Create a `.env` file (or set GitHub secrets) with:
```py
TOKEN=your_control_d_api_token
PROFILE=your_profile_id # or comma-separated list of profile ids (e.g. your_id_1,your_id_2)
```
For GitHub Actions, set `TOKEN` and `PROFILE` secrets to the raw values (not the full `TOKEN=...` / `PROFILE=...` lines).

3. **Configure Folders**
4. **Configure Folders**
Edit the `DEFAULT_FOLDER_URLS` list in `main.py` to include the URLs of the JSON block-lists you want to sync.

**Example configuration:**
Expand All @@ -77,20 +92,20 @@ https://controld.com/dashboard/profiles/741861frakbm/filters

You can add your own JSON block-list URLs or use command-line arguments:
```bash
uv run python main.py --folder-url https://example.com/my-blocklist.json
python main.py --folder-url https://example.com/my-blocklist.json
```

> [!NOTE]
> Currently only Folders with one action are supported.
> Either "Block" or "Allow" actions are supported.

4. **Run locally**
5. **Run locally**
```bash
uv run python main.py --dry-run # plan only, no API calls
uv run python main.py --profiles your_id # live run (requires TOKEN)
python main.py --dry-run # plan only, no API calls
python main.py --profiles your_id # live run (requires TOKEN)
```

5. **Run in CI**
6. **Run in CI**
The included GitHub Actions workflow (`.github/workflows/sync.yml`) runs a dry-run daily at 02:00 UTC and on PRs, writes `plan.json`, and uploads it as an artifact for review.

### Configure GitHub Actions
Expand All @@ -104,7 +119,7 @@ https://controld.com/dashboard/profiles/741861frakbm/filters

## Requirements
- Python 3.13+
- `uv` (for dependency management)
- Runtime dependencies (install with `pip install -r requirements.txt` or `uv sync`)

## Testing

Expand Down
Loading