Download the PHP package monosize/dynamic-dns-ip-updater without Composer
On this page you can find all versions of the php package monosize/dynamic-dns-ip-updater. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download monosize/dynamic-dns-ip-updater
More information about monosize/dynamic-dns-ip-updater
Files in monosize/dynamic-dns-ip-updater
Package dynamic-dns-ip-updater
Short Description Updates .htaccess with current IP addresses from dynamic DNS domains
License MIT
Informations about the package dynamic-dns-ip-updater
Dynamic DNS IP Updater for Apache
This Symfony bundle provides an automated solution for managing dynamic IP addresses in Apache's access control configurations. In environments where IP addresses change regularly, maintaining accurate access control becomes challenging. This bundle solves that problem by automatically synchronizing your Apache configuration with the current IP addresses of your dynamic DNS domains.
Understanding Dynamic DNS and Access Control
Dynamic DNS (DDNS) is a method of automatically updating DNS records in real-time. It's commonly used when your IP address might change periodically, such as with residential internet connections or cloud services that don't provide static IPs. While DDNS ensures your domain always points to the correct IP, maintaining access control based on these IPs requires additional automation.
This bundle bridges that gap by monitoring your dynamic DNS domains and automatically updating your Apache configuration whenever IP changes are detected. It supports both IPv4 and IPv6, providing comprehensive coverage for modern network environments.
Core Features
The bundle has been designed with reliability and efficiency in mind:
Monitoring and Updates:
- Tracks multiple dynamic DNS domains simultaneously
- Supports both IPv4 and IPv6 address resolution
- Implements intelligent caching to minimize unnecessary DNS queries
- Provides automatic updates when IP changes are detected
Safety and Reliability:
- Creates automatic backups before any modifications
- Implements automatic rollback on failure
- Provides comprehensive logging for all operations
- Maintains atomic operations to prevent configuration corruption
Integration:
- Seamlessly integrates with Symfony's ecosystem
- Works with Apache's .htaccess configuration
- Supports both manual and automated operation
- Provides command-line interface for easy management
System Requirements
Before installation, ensure your environment meets these prerequisites:
- PHP 8.1 or higher Required for modern language features and type safety
- Symfony 6.0 or 7.0 Provides the foundation for robust application architecture
- Apache web server with .htaccess support Necessary for implementing dynamic access control
- Write permissions for the .htaccess file Required for automated configuration updates
- DNS resolution capabilities Needed for resolving dynamic DNS entries
Installation and Setup
-
First, install the package using Composer:
-
Register the bundle in your Symfony application. Add this line to
config/bundles.php
: - Configure your dynamic DNS domains by creating or updating your
.env
file:
Configuration Management
The bundle manages a dedicated section in your .htaccess file, marked with clear delimiters:
This block is automatically maintained by the bundle. The clear delimiters ensure:
- Easy identification of managed sections
- Safe updates without affecting other configurations
- Clean integration with existing access controls
Operation Modes
The bundle can operate in two primary modes:
Manual Operation
Use the command-line interface for direct control:
Automated Operation
For continuous monitoring, you can implement automatic updates using either Symfony's Scheduler or traditional cron jobs.
Using Symfony Scheduler (Recommended):
Using Traditional Crontab:
Understanding the Update Process
Each update cycle follows a carefully designed process to ensure reliability:
-
Domain Resolution:
- Reads configured domains from environment
- Resolves current IPv4 and IPv6 addresses
- Validates resolution results
-
Change Detection:
- Compares new IPs with cached values
- Determines if updates are necessary
- Optimizes performance by avoiding unnecessary writes
-
Safe Updates:
- Creates timestamped backup of current configuration
- Validates backup creation
- Implements update using atomic operations
-
Error Handling:
- Detects any problems during update
- Automatically restores from backup if needed
- Logs detailed error information
- Cache Management:
- Updates cache with new IP addresses
- Sets appropriate cache expiration
- Maintains cache consistency
Monitoring and Logging
The bundle integrates with Symfony's logging system to provide comprehensive operational insights:
Configuration Changes:
- IP address updates
- Backup operations
- Configuration modifications
Error Conditions:
- DNS resolution failures
- File operation issues
- Permission problems
Performance Metrics:
- Cache hits and misses
- Update timing
- Resource usage
Logs are written to your Symfony application's log directory (var/log/
), following the standard Symfony logging conventions.
Development and Testing
The bundle includes a comprehensive test suite and development tools:
Running Tests:
Test Coverage Analysis: To generate detailed coverage reports, install either PCOV (recommended) or Xdebug:
Contributing
We welcome contributions that improve the bundle's functionality or documentation. To contribute:
- Fork the repository
- Create a feature branch
- Implement your changes with tests
- Submit a pull request
For significant changes, please open an issue first to discuss your proposed changes.
Support and Troubleshooting
If you encounter issues or need assistance:
- Check the logs in
var/log/
for detailed error messages - Verify your DNS domains are correctly configured
- Ensure proper file permissions for .htaccess
- Open an issue on the GitHub repository with:
- Detailed description of the problem
- Relevant log entries
- Your configuration (without sensitive data)
- Steps to reproduce the issue
License
This project is licensed under the MIT License, promoting open collaboration and reuse. See the LICENSE file for complete terms.
All versions of dynamic-dns-ip-updater with dependencies
symfony/framework-bundle Version ^6.0|^7.0
symfony/console Version ^6.0|^7.0
symfony/cache Version ^6.0|^7.0
symfony/dotenv Version ^6.0|^7.0
psr/log Version ^3.0