A tiny Python script that keeps your Control D Folders in sync with a set of remote block-lists.
- Downloads the current JSON block-lists.
- Deletes any existing folders with the same names.
- Re-creates the folders and pushes all rules in batches.
- Log in to your Control D account.
- Navigate to the "Preferences > API" section.
- Click the "+" button to create a new API token.
- Copy the token value.
- Log in to your Control D account.
- Open the Profile you want to sync.
- Copy the profile ID from the URL.
https://controld.com/dashboard/profiles/741861frakbm/filters
^^^^^^^^^^^^
-
Clone & install
git clone https://github.com/your-username/ctrld-sync.git cd ctrld-sync uv sync
-
Configure secrets
Create a.env
file (or set GitHub secrets) with: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)
-
Configure Folders
Edit theFOLDER_URLS
list inmain.py
to include the URLs of the JSON block-lists you want to sync.
Note
Currently only Folders with one action are supported. Either "Block" or "Allow" actions are supported.
-
Run locally
uv run python main.py
-
Run in CI
The included GitHub Actions workflow runs daily at 02:00 UTC and on demand.
- Fork this repo.
- Go to the "Actions" Tab and enable actions.
- Go to the Repo Settings.
- Under "Secrets and variables > Actions" create the following secrets like above, under "Repository secrets":
TOKEN
: your Control D API tokenPROFILE
: your Control D profile ID(s)
- Python 3.12+
uv
(for dependency management)