• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / dot-block / 20578332838
43%

Build:
DEFAULT BRANCH: main
Ran 29 Dec 2025 05:06PM UTC
Jobs 1
Files 17
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Dec 2025 05:05PM UTC coverage: 43.959% (-4.7%) from 48.677%
20578332838

push

github

web-flow
feat: add IP2Location support for tracking usage by country of origin (#57)

* refactor: extract generic transient downloader

Introduced a new `internal/downloader` package to handle HTTP fetches
to temporary files with automatic cleanup.

-   Moved HTTP request logic from `blocklist` to a reusable
    `TransientDownload` function.
-   Updated `internal/blocklist` to process files from disk instead of
    streaming directly from the HTTP response body.
-   Added `ip2location` and `uint128` dependencies.
-   Updated VSCode launch configuration to include `--allowed-host`.

```mermaid
sequenceDiagram
    participant B as Blocklist
    participant D as Downloader
    participant R as Remote Server
    B->>D: TransientDownload(url, handler)
    D->>R: GET url
    R-->>D: Response Body
    D->>D: Write to Temp File
    D->>B: Call handler(tempFile)
    Note over B: Scan & Parse File
    D->>D: Delete Temp File
```

* feat: add IP2Location support for request tracking

Integrate **IP2Location** to provide geolocation context for incoming
DNS requests. This allows the service to track and export metrics based
on the client's country of origin.

- Add `dns_country_count` Prometheus metric.
- Implement `Ip2LocationUpdater` for automated database updates.
- Enhance `TransientDownload` utility with URI redaction to protect
  sensitive tokens in logs.
- Rename blocklist downloader to `BlocklistUpdater` for consistency.

* refactor: abstract geo-IP lookup into interface

Introduce the `GeoIpLookup` interface to decouple the `DNSDispatcher`
from the **ip2location** library. This improves testability and
ensures the codebase is more modular.

- Add `GeoIpLookup` interface to facilitate dependency injection.
- Update unit testing using mocks for geolocation.
- Ensure blocklist file closure errors are logged rather than ignored.
- Restore production URL for GeoIP updates by removing test overrides.

* Update internal/downloader/download.go

Co-authored-by: gemini-cod... (continued)

17 of 199 new or added lines in 6 files covered. (8.54%)

473 of 1076 relevant lines covered (43.96%)

0.47 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
86.13
-0.02% internal/forwarder/dispatcher.go
9
0.0
0.0% internal/app.go
39
0.0
internal/blocklist/update.go
61
0.0
internal/downloader/download.go
71
0.0
internal/geoblock/update.go
Jobs
ID Job ID Ran Files Coverage
1 20578332838.1 29 Dec 2025 05:06PM UTC 17
43.96
GitHub Action Run
Source Files on build 20578332838
  • Tree
  • List 17
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • bb125956 on github
  • Prev Build on main (#20561705999)
  • Next Build on main (#20584249275)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc