Skip to main content

Monitors Windows App and enforces VPN usage.

Project description

VPN Monitor

A Windows background application that monitors specific "Windows App" processes (e.g., msrdc.exe, Windows365.exe) and enforces VPN usage by checking the current region.

Features

  • Process Monitoring: Detects if msrdc.exe or Windows365.exe has a visible window.
  • Region Check: Verifies if the current public IP is in the allowed country (default: HU).
  • Allowed IPs: Supports an optional list of allowed external IPs that bypass the country check.
  • Warning System: Displays a custom, topmost warning window if the region is incorrect while the target app is running.
  • System Tray:
    • Snooze functionality (5m, 15m, 1h, 8h).
    • Set Allowed Country.
    • Exit.
  • Startup Integration: Can register itself to run at Windows startup.

Installation

  1. Prerequisites: Python 3.8+
  2. Install Dependencies:
    pip install -r requirements.txt
    
    (Or pip install psutil requests pystray Pillow)

Usage

Running from Source

python run.py

Command Line Arguments

  • --install-startup: Registers the app to run on Windows startup.
  • --remove-startup: Removes the app from Windows startup.

Configuration

Allowed Country

The default allowed country is HU (Hungary). You can change this via the System Tray menu ("Set Country...") or by setting the ALLOWED_COUNTRY environment variable.

Allowed IPs (Bypass)

You can create a file named allowed_ips.txt in the same directory as the executable (or run.py). Add one IP address per line. If your current external IP matches any IP in this list, the warning will be suppressed regardless of your country.

Example allowed_ips.txt:

203.0.113.1
198.51.100.2

Building Executable

To build a standalone .exe:

pyinstaller --noconsole --onefile --name vpn-monitor run.py

The output will be in the dist folder.

Development

Releasing a New Version

This project uses setuptools-scm — the version is automatically derived from git tags. No version is stored in pyproject.toml.

To release a new version:

git tag v1.0.0
git push --tags

Pushing the tag triggers the release workflow, which builds the executable and creates a GitHub release. The package version is automatically set based on the tag (e.g., tag v1.0.0 → version 1.0.0).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vpn_monitor-0.6.0.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vpn_monitor-0.6.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file vpn_monitor-0.6.0.tar.gz.

File metadata

  • Download URL: vpn_monitor-0.6.0.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vpn_monitor-0.6.0.tar.gz
Algorithm Hash digest
SHA256 1067651db3137fc1b745cc4950e41624dca4be218208428ae62ab7c2752b6eee
MD5 e472a5933108f4178bd566de0a5abd74
BLAKE2b-256 d91689f6b7dc45f26478050532fd487375156eacfdb022aad00848b110512ec2

See more details on using hashes here.

Provenance

The following attestation bundles were made for vpn_monitor-0.6.0.tar.gz:

Publisher: release.yml on henrykp/vpn_status_monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vpn_monitor-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: vpn_monitor-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vpn_monitor-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d5cdff04fde37877cac04d251342dc19f63e22e64144addfcfb1cea160bb0a8
MD5 e2e252b847101dae6d42289dfc862c21
BLAKE2b-256 c241ce36a372e45edee5d342088073e245da611b3fd1b497b6b41f6ba1cb6adb

See more details on using hashes here.

Provenance

The following attestation bundles were made for vpn_monitor-0.6.0-py3-none-any.whl:

Publisher: release.yml on henrykp/vpn_status_monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page