π Overview
TrackingDomainPipeline manages a pipeline of tracking domains used in Voluum campaigns.
It stores one active domain plus an ordered list of backups and automates failover:
- monitoring via Google Safe Browsing / DNS / Google Search Console safety checks
- blocking the active domain and switching to the next backup domain
- optionally updating Voluum campaigns to use the new tracking domain
- optionally creating an Affise switch request when switching
- keeping an audit trail in
pipe_log
Optionally, the pipeline can maintain a redirect mapping in a Redis βdomain bridgeβ when proxy mode is enabled.
π Fields
| Field | Type | Description |
|---|---|---|
active_domain | str | Current active tracking domain. |
backup_domains | JSON list[str] | Ordered list of backup domains. |
blocked_domains | JSON list[str] | Domains blocked by monitoring (auto-managed). |
unblocked_domains | JSON list[str] | Domains unblocked later (auto-managed). |
is_active | bool | Whether this pipeline participates in monitoring/switching. |
with_update_voluum | bool | If enabled, switching also updates Voluum campaigns. |
with_update_affise | bool | If enabled, switching creates an Affise switch request. |
return_to_work | bool | If enabled, unblocked domains are returned back into the pipeline. |
with_proxy | bool | Enables redis-domain-bridge mapping behavior. |
redirect_from | str | Domain that should redirect to active_domain (proxy use case). |
owner | Foreign Key User | Optional owner of the pipeline. |
created_at | datetime | Creation timestamp. |
updated_at | datetime | Last update timestamp. |
last_switched_at | datetime | When the active domain was last switched. |
changed_by | str | Actor identifier (system/user). |
pipe_log | JSON list[str] | Human-readable pipeline log entries. |
π Properties
| Property | Type | Description |
|---|---|---|
active_root_domain | str (optional) | Root domain derived from active_domain. |
next_domain | str (optional) | First item of backup_domains (the next candidate). |
last_blocked_domain | str (optional) | Last item of blocked_domains. |
π§© Methods
| Method | Description |
|---|---|
get_blocked_domains_map() | Returns {root_domain -> [owners...]} for blocked domains across active pipelines. |
add_backup_domain(domain, action_by="system") | Appends a backup domain and writes to the pipeline log. |
block_active_domain(reason, action_by="system", with_switch=True) | Blocks the current active domain (moves it to blocked_domains) and optionally switches. |
switch_domain(action_by="system") | Promotes next_domain to active_domain, updates Voluum if enabled, and can enqueue an Affise switch request. |
unblock_domain(domain, action_by="system") | Moves a domain from blocked_domains to unblocked_domains and optionally returns it to work. |
return_to_work_domain(domain, action_by="system") | Moves a domain back into active_domain or backup_domains. |
activate_pipeline(action_by="system") | Sets is_active=True and sends a Telegram notification. |
deactivate_pipeline(action_by="system") | Sets is_active=False and sends a Telegram notification. |
enable_update_voluum(...) / disable_update_voluum(...) | Toggles Voluum campaign updates. |
enable_return_to_work(...) / disable_return_to_work(...) | Toggles automatic βreturn to workβ behavior. |
π‘ Notes
- When
with_proxy=True,redirect_fromis set, and the pipeline is active, the mappingredirect_from β active_domainis synced to Redis on save/delete. - When
with_update_affise=True,switch_domain()creates an AffiseSwitchRequest with fieldstrafficback_urlandurlto update. - When
return_to_workis switched fromFalsetoTrue, a signal attempts to return existingunblocked_domainsback into the pipeline (only if they are not used elsewhere).