Skip to content
Open
Show file tree
Hide file tree
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
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,22 @@ stats_y 100 # Position stats 100 pixels from top edge
- `target_interval`: Minutes between target country changes (default: 5)
- `log_level`: Logging verbosity: debug, info, warn, error (default: info)

### Privacy Settings
- `skip_isp`: Exclude your ISP's IP address ranges from connection tracking (default: false)

When enabled, IPTW auto-detects your ISP at startup using two external lookups:
1. A **DNS TXT query** to `origin.asn.cymru.com` to resolve your public IP to an ASN — your IP is never sent over HTTP, it appears only as a reversed DNS hostname component handled by your local resolver.
2. An **HTTP request** to the [RIPE Stat](https://stat.ripe.net/) API to fetch all IP prefixes registered to that ASN — only the ASN number is transmitted, not your IP address.

Set `skip_isp false` in your config file (or omit the key) to disable entirely and make no external requests:
```
skip_isp false
```
Set to `true` to activate ISP filtering:
```
skip_isp true
```

## Wallpaper Backup & Restore

IPTW automatically backs up your original desktop wallpaper before making any changes and can restore it when the application exits or on demand.
Expand Down Expand Up @@ -327,10 +343,11 @@ After installation, enable the extension and restart GNOME Shell (`Alt+F2` → `
- **Performance Optimized**: Efficient native system calls on each platform

### Privacy & Security
- **Local Processing Only**: No data sent to external servers
- **Local Processing Only**: All connection tracking and map rendering happen on your device
- **No Account Required**: Completely anonymous usage
- **No Tracking**: Your browsing patterns stay on your device
- **Open Source**: Full transparency in data handling
- **ISP Detection Requests**: When `skip_isp` is enabled, IPTW performs two lightweight online lookups at startup to identify your ISP's IP ranges: a DNS TXT query to `origin.asn.cymru.com` (your public IP appears only as a DNS hostname component, routed through your local resolver) and an HTTP request to the RIPE Stat API containing only your ISP's ASN number — your IP address is never sent over HTTP. You can disable the `skip_isp` feature entirely if you prefer no external requests at all (see [Configuration](#configuration)).


## Licenses & Attribution
Expand Down
13 changes: 13 additions & 0 deletions cmd/iptw/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"iptw/internal/config"
"iptw/internal/geoip"
"iptw/internal/gui"
"iptw/internal/ispdetect"
"iptw/internal/logging"
"iptw/internal/network"
"iptw/internal/singleton"
Expand Down Expand Up @@ -127,6 +128,18 @@ func run() error {
// Initialize network monitor
netMon := network.NewMonitor()

// If skip_isp is enabled, detect the user's ISP CIDR ranges at startup.
// This runs synchronously so the filter is active before the first tick;
// failures are non-fatal — a warning is logged and the feature is skipped.
if cfg.SkipISP {
cidrs, err := ispdetect.DetectISPCIDRsAuto()
if err != nil {
slog.Warn("skip_isp: ISP detection failed, feature disabled", "error", err)
} else {
netMon.SetISPCIDRs(cidrs)
}
}

// Create GUI application
app, err := gui.NewApp(cfg, geoipDB, netMon)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ log_coordinates true
verbose_logging false
stats_x -1
stats_y -1
# skip_isp: when true, connections to your Internet Service Provider's own IP
# ranges are excluded from the travel map. The ISP is detected automatically
# at startup by looking up your public IP via RDAP. Default: false.
skip_isp false
7 changes: 6 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Config struct {
StatsY int `config:"stats_y"` // Y position of stats rectangle (-1 for auto)
UpdateWallpaper bool `config:"update_wallpaper"` // Opt-in to update OS wallpaper
StartOnLogin bool `config:"start_on_login"` // Auto-start app on login
SkipISP bool `config:"skip_isp"` // Skip connections belonging to your ISP
}

// DefaultConfig returns the default configuration
Expand All @@ -36,6 +37,7 @@ func DefaultConfig() *Config {
StatsY: -1, // -1 means auto-position (default behavior)
UpdateWallpaper: false, // Disabled by default
StartOnLogin: false, // Disabled by default
SkipISP: true, // Enabled by default
}
}

Expand Down Expand Up @@ -124,6 +126,8 @@ func LoadConfig() (*Config, error) {
cfg.UpdateWallpaper = value == "true"
case "start_on_login":
cfg.StartOnLogin = value == "true"
case "skip_isp":
cfg.SkipISP = value == "true"
}
}

Expand All @@ -149,7 +153,8 @@ stats_x %d
stats_y %d
update_wallpaper %t
start_on_login %t
`, c.MapWidth, c.AutoDetectScreen, c.Black, c.UpdateInterval, c.TargetInterval, c.LogLevel, c.StatsX, c.StatsY, c.UpdateWallpaper, c.StartOnLogin)
skip_isp %t
`, c.MapWidth, c.AutoDetectScreen, c.Black, c.UpdateInterval, c.TargetInterval, c.LogLevel, c.StatsX, c.StatsY, c.UpdateWallpaper, c.StartOnLogin, c.SkipISP)

return err
}
Loading
Loading