# igorkha/mikrotik-adlist architecture

> Architecture diagram of the GitHub repository igorkha/mikrotik-adlist, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/igorkha/mikrotik-adlist
- Repository: https://github.com/igorkha/mikrotik-adlist

## Overview

#### Purpose and Consumers
This repository publishes curated DNS blocklists formatted for MikroTik RouterOS DNS AdList. It is a data-generation repository, not an application: MikroTik routers consume static list URLs from the repository’s `hosts/` directory.

#### Entry Points and Automation
The transformation entry point is `transform.sh`. Scheduled/regenerative publishing is driven by GitHub Actions in `.github/workflows/update-filters.yaml`; supporting maintenance checks run through `.github/workflows/pre-commit-check.yaml` and `.github/workflows/pre-commit-update.yaml`.

#### Upstream Ingestion Boundary
The authoritative source catalog is the external AdGuard Host Lists Registry (`filters.json`), which identifies community-maintained upstream blocklists. The workflow/script boundary fetches upstream content and converts it into repository-owned artifacts rather than requiring routers to contact each original source.

Relevant output naming reflects upstream categories and publishers, for example:
- `hosts/adguard_dns_filter.txt`
- `hosts/hagezi_pro.txt`
- `hosts/oisd_full.txt`

#### Transformation Stage
`transform.sh` is the central processing component. Per the repository contract, it produces MikroTik-compatible DNS filtering lists, removes duplicates and invalid entries, and maintains stable structure/naming. Its output boundary is plain-text, version-controlled files; no runtime database, service API, or application server is present.

#### Published List Catalog
`hosts/` is the release surface and primary product. Lists are independently consumable, allowing operators to select scope and resource cost rather than install a monolithic feed. Major variants include:
- Tiered general-purpose lists: `hosts/1hosts_lite.txt`, `hosts/1hosts_pro.txt`, `hosts/1hosts_xtra.txt`
- Broad security/privacy lists: `hosts/hagezi_ultimate.txt`, `hosts/steven_blacks_list.txt`, `hosts/phishing_army.txt`
- Specialized regional or policy feeds: `hosts/CHN_adrules.txt`, `hosts/IRN_unwanted_iranian_domains.txt`, `hosts/hagezi_gambling_blocklist.txt`

#### Delivery and Runtime Boundary
GitHub hosts the generated static artifacts and GitHub Actions provides the weekly update runtime. MikroTik RouterOS is the downstream runtime: its DNS AdList feature fetches selected text files and applies domain blocking at network DNS resolution. Router memory/DNS cache sizing is an operational constraint for large lists.

#### Governance and Provenance
Repository automation and documentation are MIT-licensed, while transformed source data remains governed by its upstream licenses. Ownership and contribution controls are defined through `.github/CODEOWNERS`, `.github/pull_request_template.md`, and `LICENSE`.

Main entry points: [`.github/workflows/update-filters.yaml`](https://github.com/igorkha/mikrotik-adlist/blob/main/.github/workflows/update-filters.yaml) (Weekly update workflow), [`transform.sh`](https://github.com/igorkha/mikrotik-adlist/blob/main/transform.sh) (List transformer), [`.github/workflows/pre-commit-check.yaml`](https://github.com/igorkha/mikrotik-adlist/blob/main/.github/workflows/pre-commit-check.yaml) (Pre-commit checks), [`.github/workflows/pre-commit-update.yaml`](https://github.com/igorkha/mikrotik-adlist/blob/main/.github/workflows/pre-commit-update.yaml) (Pre-commit updates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_upstream["Upstream Sources"]
  node_registry[("AdGuard Host Lists Registry<br/>external catalog")]
  node_upstream_lists["Community blocklists<br/>external data"]
end

subgraph group_automation["Repository Automation"]
  node_update_workflow{{"Weekly update workflow<br/>GitHub Actions workflow"}}
  node_transform["List transformer<br/>shell pipeline<br/>[transform.sh]"]
  node_precommit_check{{"Pre-commit checks<br/>GitHub Actions workflow"}}
  node_precommit_update{{"Pre-commit updates<br/>GitHub Actions workflow"}}
  node_normalization["Validation &amp; deduplication<br/>processing stage"]
end

subgraph group_published["Published Artifacts"]
  node_hosts_catalog["Published hosts catalog<br/>versioned text artifacts"]
  node_tiered_lists["Tiered general lists<br/>DNS lists<br/>[1hosts_lite.txt]"]
  node_broad_lists["Broad security/privacy lists<br/>DNS lists"]
  node_specialized_lists["Regional &amp; policy lists<br/>DNS lists<br/>[CHN_adrules.txt]"]
end

subgraph group_consumer["Delivery &amp; Consumer"]
  node_github_hosting["GitHub static hosting<br/>artifact delivery"]
  node_routeros["MikroTik RouterOS DNS AdList<br/>downstream runtime"]
  node_network_dns(("Network DNS resolution<br/>enforcement point"))
end

subgraph group_governance["Governance"]
  node_codeowners["Ownership rules<br/>repository policy<br/>[CODEOWNERS]"]
  node_pr_template["Contribution template<br/>repository policy"]
  node_license["MIT license"]
end

node_registry -->|"catalogs"| node_upstream_lists
node_upstream_lists -->|"fetched by"| node_update_workflow
node_update_workflow -->|"runs"| node_transform
node_transform -->|"processes"| node_normalization
node_normalization -->|"writes"| node_hosts_catalog
node_precommit_update -.->|"maintains"| node_transform
node_precommit_check -.->|"checks"| node_hosts_catalog
node_hosts_catalog -->|"includes"| node_tiered_lists
node_hosts_catalog -->|"includes"| node_broad_lists
node_hosts_catalog -->|"includes"| node_specialized_lists
node_hosts_catalog -->|"published through"| node_github_hosting
node_github_hosting -->|"list URLs fetched by"| node_routeros
node_routeros -->|"applies blocking to"| node_network_dns
node_codeowners -.->|"governs changes to"| node_update_workflow
node_pr_template -.->|"guides contributions to"| node_update_workflow
node_license -.->|"covers repository automation"| node_transform

click node_update_workflow "https://github.com/igorkha/mikrotik-adlist/blob/main/.github/workflows/update-filters.yaml"
click node_transform "https://github.com/igorkha/mikrotik-adlist/blob/main/transform.sh"
click node_precommit_check "https://github.com/igorkha/mikrotik-adlist/blob/main/.github/workflows/pre-commit-check.yaml"
click node_precommit_update "https://github.com/igorkha/mikrotik-adlist/blob/main/.github/workflows/pre-commit-update.yaml"
click node_tiered_lists "https://github.com/igorkha/mikrotik-adlist/blob/main/hosts/1hosts_lite.txt"
click node_broad_lists "https://github.com/igorkha/mikrotik-adlist/blob/main/hosts/hagezi_ultimate.txt"
click node_specialized_lists "https://github.com/igorkha/mikrotik-adlist/blob/main/hosts/CHN_adrules.txt"
click node_codeowners "https://github.com/igorkha/mikrotik-adlist/blob/main/.github/CODEOWNERS"
click node_pr_template "https://github.com/igorkha/mikrotik-adlist/blob/main/.github/pull_request_template.md"
click node_license "https://github.com/igorkha/mikrotik-adlist/tree/main/LICENSE"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_registry,node_upstream_lists toneBlue
class node_update_workflow,node_transform,node_precommit_check,node_precommit_update,node_normalization toneAmber
class node_hosts_catalog,node_tiered_lists,node_broad_lists,node_specialized_lists toneMint
class node_github_hosting,node_routeros,node_network_dns toneRose
class node_codeowners,node_pr_template,node_license toneIndigo
```

## Components

### Upstream Sources

- **AdGuard Host Lists Registry**: external catalog · filters.json catalogs community-maintained source lists.
- **Community blocklists**: external data

### Repository Automation

- [Weekly update workflow](https://github.com/igorkha/mikrotik-adlist/blob/main/.github/workflows/update-filters.yaml): GitHub Actions workflow · Schedules regeneration and publishing. · `.github/workflows/update-filters.yaml`
- [List transformer](https://github.com/igorkha/mikrotik-adlist/blob/main/transform.sh): shell pipeline · Converts upstream lists into MikroTik-compatible domain lists. · `transform.sh`
- [Pre-commit checks](https://github.com/igorkha/mikrotik-adlist/blob/main/.github/workflows/pre-commit-check.yaml): GitHub Actions workflow · `.github/workflows/pre-commit-check.yaml`
- [Pre-commit updates](https://github.com/igorkha/mikrotik-adlist/blob/main/.github/workflows/pre-commit-update.yaml): GitHub Actions workflow · `.github/workflows/pre-commit-update.yaml`
- **Validation & deduplication**: processing stage · Removes invalid and duplicate entries while preserving stable naming.

### Published Artifacts

- **Published hosts catalog**: versioned text artifacts · Independently consumable RouterOS DNS AdList files.
- [Tiered general lists](https://github.com/igorkha/mikrotik-adlist/blob/main/hosts/1hosts_lite.txt): DNS lists · Lite, Pro, and Xtra variants. · `hosts/1hosts_lite.txt`
- [Broad security/privacy lists](https://github.com/igorkha/mikrotik-adlist/blob/main/hosts/hagezi_ultimate.txt): DNS lists · Includes HaGeZi Ultimate, StevenBlack, and Phishing Army feeds. · `hosts/hagezi_ultimate.txt`
- [Regional & policy lists](https://github.com/igorkha/mikrotik-adlist/blob/main/hosts/CHN_adrules.txt): DNS lists · Includes China, Iranian, and gambling-focused feeds. · `hosts/CHN_adrules.txt`

### Delivery & Consumer

- **GitHub static hosting**: artifact delivery · Serves committed list files by URL.
- **MikroTik RouterOS DNS AdList**: downstream runtime · Fetches selected lists and blocks domains during DNS resolution.
- **Network DNS resolution**: enforcement point

### Governance

- [Ownership rules](https://github.com/igorkha/mikrotik-adlist/blob/main/.github/CODEOWNERS): repository policy · `.github/CODEOWNERS`
- [Contribution template](https://github.com/igorkha/mikrotik-adlist/blob/main/.github/pull_request_template.md): repository policy · `.github/pull_request_template.md`
- [MIT license](https://github.com/igorkha/mikrotik-adlist/tree/main/LICENSE): license · Applies to repository automation and documentation; source data retains upstream licenses. · `LICENSE`

## Connections

- AdGuard Host Lists Registry → Community blocklists: catalogs
- Community blocklists → Weekly update workflow: fetched by
- Weekly update workflow → List transformer: runs
- List transformer → Validation & deduplication: processes
- Validation & deduplication → Published hosts catalog: writes
- Pre-commit updates → List transformer: maintains
- Pre-commit checks → Published hosts catalog: checks
- Published hosts catalog → Tiered general lists: includes
- Published hosts catalog → Broad security/privacy lists: includes
- Published hosts catalog → Regional & policy lists: includes
- Published hosts catalog → GitHub static hosting: published through
- GitHub static hosting → MikroTik RouterOS DNS AdList: list URLs fetched by
- MikroTik RouterOS DNS AdList → Network DNS resolution: applies blocking to
- Ownership rules → Weekly update workflow: governs changes to
- Contribution template → Weekly update workflow: guides contributions to
- MIT license → List transformer: covers repository automation
