Skip to content

About

DuckDNS Connector is a lightweight, modern, and easy-to-use desktop application for Windows that automatically keeps your DuckDNS domains updated with your public IP address.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

DuckDNS Connector 🦆

DuckDNS Connector is a production-ready, enterprise-grade desktop application for Windows that automatically keeps your DuckDNS domains updated with your public IP address. Built with modern Python and featuring a beautiful dark-themed UI, it runs silently in the system tray with comprehensive monitoring and fault tolerance.

Developed by thirawat27.


✨ Features

Core Functionality

  • 🔄 Automatic IP Updates: Background monitoring with configurable intervals (1-1440 minutes)
  • 🧠 Smart Updates: Only updates when IP actually changes, preventing unnecessary API calls
  • 📌 System Tray Integration: Lightweight, stays out of your way
  • 🎨 Modern Dark UI: Beautiful interface using CustomTkinter
  • 🔔 Desktop Notifications: Optional alerts for updates and errors

Tools & Utilities

  • 🔌 Port Checker: Test if ports are accessible from the internet
  • 📖 Help Guide: Integrated firewall and port forwarding documentation
  • 🌐 IP Display: Quick view of your current public IP
  • 📊 System Status: Real-time performance metrics and health monitoring
  • 🔄 Auto-Updater: Automatic version checking and updates

Production Features

  • ⚡ High Performance:

    • JIT compilation support (Numba/PyPy)
    • Lazy loading for instant startup
    • Connection pooling and caching
    • Module pre-loading
    • Icon caching
  • 🏥 Reliability:

    • Circuit breaker pattern
    • Exponential backoff retry logic
    • Rate limiting (30s minimum)
    • Consecutive failure tracking
    • Graceful error recovery
  • 📊 Monitoring:

    • Real-time performance metrics
    • System resource tracking (CPU, Memory)
    • Health status indicators
    • Success rate monitoring
    • Comprehensive logging
  • 🔒 Enterprise Grade:

    • Thread-safe operations
    • Config backup & recovery
    • Atomic file writes
    • Structured logging (JSON support)
    • Graceful shutdown
    • Input validation

📁 Project Structure

DuckDNS-Connector/
├── main.py                      # Application entry point
├── requirements.txt             # Python dependencies
├── build.spec                   # PyInstaller configuration
├── installer_script.iss         # Inno Setup installer script
├── README.md                    # Documentation
├── LICENSE                      # MIT License
├── PRODUCTION_READY.md          # Production features guide
├── assets/
│   └── logo.ico                 # Application icon
├── src/
│   ├── core/                    # Core modules
│   │   ├── constants.py         # App constants & theme
│   │   ├── config.py            # Thread-safe config manager
│   │   └── exceptions.py        # Custom exceptions
│   ├── services/                # Business logic
│   │   ├── duckdns_client.py    # DuckDNS API with circuit breaker
│   │   ├── network.py           # Network utilities with caching
│   │   └── updater.py           # Auto-update service
│   ├── ui/                      # User interface
│   │   ├── app.py               # Main application controller
│   │   ├── components.py        # Reusable UI components
│   │   ├── theme.py             # CustomTkinter theme
│   │   ├── icon_utils.py        # Icon caching system
│   │   └── windows/             # Window dialogs
│   │       ├── settings.py      # Settings configuration
│   │       ├── port_checker.py  # Port testing utility
│   │       ├── help.py          # Help & guide
│   │       ├── about.py         # About dialog
│   │       ├── public_ip.py     # IP display
│   │       ├── status.py        # System status & monitoring
│   │       └── update_dialog.py # Update notifications
│   └── utils/                   # Utilities
│       ├── logger.py            # Production logging system
│       ├── paths.py             # Path management
│       ├── validators.py        # Input validation
│       ├── performance.py       # Performance optimizations
│       ├── monitoring.py        # Health & metrics monitoring
│       ├── shutdown.py          # Graceful shutdown handler
│       └── retry.py             # Retry logic & circuit breaker
├── config/                      # User configuration
└── logs/                        # Application logs

🚀 Installation

Option 1: Download Pre-built Installer

  1. Go to the Releases page.
  2. Download the latest DuckDNS-Connector-vX.X.X-Setup.exe file.
  3. Run the installer and follow the instructions.

Option 2: Build from Source

Prerequisites

Steps

  1. Clone the Repository:

    git clone https://github.com/thirawat27/DuckDNS-Connector.git
    cd DuckDNS-Connector
  2. Create Virtual Environment:

    python -m venv venv
    venv\Scripts\activate  # Windows
    # source venv/bin/activate  # macOS/Linux
  3. Install Dependencies:

    pip install -r requirements.txt
  4. Run the Application:

    python main.py
  5. Build Executable (Optional):

    pip install pyinstaller
    pyinstaller build.spec

    The executable will be in the dist folder.


📖 How to Use

First-Time Setup

  1. Launch Application:

    • Find the DuckDNS Connector icon in your system tray (near the clock)
    • Right-click the icon to open the menu
  2. Configure Settings:

    • Select "Settings" from the menu
    • Enter your Domain (subdomain only, e.g., my-home for my-home.duckdns.org)
    • Paste your Token from DuckDNS
    • Set Update Interval (1-1440 minutes, default: 5)
    • Enable/disable Notifications
    • Click "Save Changes"
  3. Verify Operation:

    • The app will immediately check and update your IP
    • Check the tray icon tooltip for status updates

Tray Menu Options

Right-click the tray icon to access:

  • Settings - Configure domain, token, and preferences
  • Force Update - Immediately check and update IP
  • Show My Public IP - Display current public IP address
  • System Status - View performance metrics and health
  • Check Service Port - Test port accessibility
  • Help - Firewall and port forwarding guide
  • Check for Updates - Check for new versions
  • About - Application information
  • Exit - Close application

System Status Window

Access real-time monitoring:

  • Performance Metrics: Uptime, success rate, update times
  • System Resources: CPU and memory usage
  • Network Status: Cache statistics
  • Health Indicator: Overall system health
  • Auto-refreshes every 5 seconds

🏗️ Architecture & Technical Details

Design Patterns

  • Singleton Pattern: Configuration manager
  • Circuit Breaker: Fault tolerance for API calls
  • Observer Pattern: Event-driven updates
  • Factory Pattern: Window creation
  • Strategy Pattern: Retry logic

Performance Features

  • JIT Compilation: Numba/PyPy auto-detection
  • Lazy Loading: On-demand module imports
  • Connection Pooling: HTTP adapter (10 connections, 20 max)
  • Caching: IP (60s), connection status (10s), icons (permanent)
  • Concurrent Operations: Parallel IP provider checks

Reliability Features

  • Circuit Breaker: Opens after 3 failures, recovers after 60s
  • Retry Logic: 3 attempts with exponential backoff
  • Rate Limiting: 30s minimum between updates
  • Failure Tracking: Alerts after 5 consecutive failures
  • Graceful Degradation: Continues on non-critical errors

Monitoring & Observability

  • Performance Metrics: Uptime, success rate, operation times
  • System Metrics: CPU, memory, thread count
  • Health Checks: Overall status with issue detection
  • Structured Logging: JSON format, rotating files (5MB, 5 backups)
  • Error Tracking: Separate error log file

Security & Data Integrity

  • Thread-Safe: RLock protection for shared resources
  • Atomic Writes: Temp file + rename for config
  • Config Backup: Automatic backup before save
  • Input Validation: All user inputs validated
  • No Sensitive Data: Tokens not logged

Resource Management

  • Graceful Shutdown: Signal handlers (SIGINT, SIGTERM, SIGBREAK)
  • Proper Cleanup: All resources released on exit
  • Memory Efficient: <50MB typical usage
  • Low CPU: <1% idle, <5% active

📊 Performance Metrics

  • Startup Time: ~2 seconds (with optimizations)
  • Update Cycle: <5 seconds (with caching)
  • Memory Usage: <50MB typical, <100MB peak
  • CPU Usage: <1% idle, <5% during updates
  • Success Rate: >99% with proper configuration

🔧 Configuration

Config File Location

  • Windows: %APPDATA%\DuckDNS-Connector\config.ini
  • Backup: config.ini.backup (automatic)

Log Files

  • Main log: DuckDNS-Connector.log (5MB, 5 backups)
  • Error log: DuckDNS-Connector_errors.log (5MB, 3 backups)
  • JSON log: DuckDNS-Connector_structured.json (optional)

Supported Intervals

  • Minimum: 1 minute
  • Maximum: 1440 minutes (24 hours)
  • Default: 5 minutes
  • Recommended: 5-15 minutes

🐛 Troubleshooting

Common Issues

Icon not showing in title bar:

  • Fixed in latest version with proper timing

Update fails:

  • Check domain and token in Settings
  • Verify internet connection
  • Check System Status for details

High memory usage:

  • Normal: <50MB
  • Check System Status window
  • Restart if >100MB

Port check fails:

  • Verify port forwarding on router
  • Check Windows Firewall settings
  • Ensure service is running

Getting Help

  1. Check System Status window for diagnostics
  2. Review log files in %APPDATA%\DuckDNS-Connector\logs
  3. Open an issue on GitHub with logs

🔄 Updates

The application includes an auto-updater that:

  • Checks for updates on startup (after 5s delay)
  • Can be manually triggered from tray menu
  • Downloads and installs updates automatically
  • Requires restart to apply updates

📦 Dependencies

Core

  • Python 3.10+
  • customtkinter - Modern UI framework
  • requests - HTTP client
  • Pillow - Image processing
  • pystray - System tray integration

Production

  • psutil - System monitoring
  • urllib3 - Connection pooling
  • filelock - File locking

Development

  • pyinstaller - Executable building

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


🙏 Acknowledgments

  • DuckDNS for providing free dynamic DNS service
  • CustomTkinter for the modern UI framework
  • All contributors and users

📞 Contact


Version: 2.0.0 Last Updated: 2024

About

DuckDNS Connector is a lightweight, modern, and easy-to-use desktop application for Windows that automatically keeps your DuckDNS domains updated with your public IP address.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages