a633fb55b9
- Improve directory writeability test in CLI interface - Test actual /var/lib/ddns-updater directory instead of creating test directory - Add proper Unix permissions checking with detailed error messages - Fix Debian postinst script permissions (755 instead of 750) - Change ownership to root:root for storage directory - Add verbose logging for storage directory selection - Include release documentation for v1.2.2 This fixes the 'Cannot access /var/lib/ddns-updater' error by properly testing the actual directory and setting correct permissions during package installation.
5.2 KiB
5.2 KiB
🚀 Release v1.2.2: Persistent Storage Enforcement
📅 Release Information
- Version: 1.2.2
- Release Date: October 3, 2025
- Package:
ddns-updater_1.2.2-1_amd64.deb(2.0 MB) - GitHub Tag:
v1.2.2
🎯 Key Improvements
🔧 Persistent Storage Enforcement
- Removed
/tmp/ddns-updaterfallback - ensures complete data persistence - Application now only uses
/var/lib/ddns-updaterfor JSON storage - Clear error messages when persistent storage is unavailable
- Eliminates data loss from temporary directory cleanup
🛠️ Enhanced Installation
- Automatic directory creation in installation script
- Proper permissions setup (755, root:root)
- No manual setup required for storage directory
- Systemd service files updated to enforce persistent storage only
📚 Comprehensive Documentation
- Added
PERSISTENT_STORAGE.md- complete storage configuration guide - Troubleshooting instructions for storage accessibility issues
- Migration guide for existing installations
- Clear directory structure explanation
🏗️ Technical Changes
Modified Files:
-
src/interface/cli_interface.rs- Removed
/tmp/ddns-updaterfallback logic - Added graceful error handling with instructions
- Clear exit with helpful error messages
- Removed
-
systemd/ddns-updater.service- Removed
/tmp/ddns-updaterfromReadWritePaths - Service restricted to persistent storage only
- Removed
-
systemd/ddns-updater@.service- Removed
/tmp/ddns-updaterfromReadWritePaths - Template service also enforces persistent storage
- Removed
-
systemd/install-systemd.sh- Added automatic
/var/lib/ddns-updatercreation - Proper ownership and permissions setup
- Eliminates manual directory setup
- Added automatic
📁 Storage Structure
Production Environment
/var/lib/ddns-updater/ # Persistent storage directory
├── hostname1.json # IP data for hostname1
├── hostname2.json # IP data for hostname2
└── ... # Additional hostname files
Test Environment
./test_storage/ # Local test directory (DDNS_TEST_MODE=1)
├── hostname1.json # Test IP data
└── ... # Additional test files
✅ Benefits
- Data Persistence: IP data survives reboots and system maintenance
- Predictable Behavior: Service always uses the same storage location
- Better Error Handling: Clear error messages when storage unavailable
- Security: No reliance on world-writable temporary directories
- Standards Compliance: Follows Linux filesystem hierarchy standards
- Automated Setup: Installation script handles all directory creation
🔄 Migration Guide
For Existing Installations:
-
Using Installation Script (Recommended):
sudo ./systemd/install-systemd.sh -
Manual Setup:
sudo mkdir -p /var/lib/ddns-updater sudo chmod 755 /var/lib/ddns-updater sudo chown root:root /var/lib/ddns-updater -
Copy Existing Data (if any):
sudo cp /tmp/ddns-updater/*.json /var/lib/ddns-updater/ 2>/dev/null || true
🛠️ Installation Options
1. Debian Package (Recommended)
# Download from GitHub Releases
sudo apt install ./ddns-updater_1.2.2-1_amd64.deb
2. Systemd Installation Script
git clone https://github.com/koenieee/ddns_local_server.git
cd ddns_local_server
cargo build --release
sudo ./systemd/install-systemd.sh
🔍 Troubleshooting
Error: "Cannot access /var/lib/ddns-updater"
- Check directory exists:
ls -la /var/lib/ddns-updater - Create if missing:
sudo mkdir -p /var/lib/ddns-updater - Set permissions:
sudo chmod 755 /var/lib/ddns-updater - Set ownership:
sudo chown root:root /var/lib/ddns-updater
Service Fails to Start
- Check logs:
journalctl -u ddns-updater.service - Verify directory permissions
- Ensure service has write access to storage directory
🧪 Testing
- ✅ All 25 unit tests passing
- ✅ All 6 integration tests passing
- ✅ Cargo fmt/clippy clean
- ✅ Debian package builds successfully
- ✅ Systemd service files validated
📋 Version History
| Version | Date | Key Features |
|---|---|---|
| v1.2.2 | 2025-10-03 | Persistent storage enforcement, enhanced installation |
| v1.2.1 | 2025-10-03 | Absolute path logging, backup optimization |
| v1.2.0 | 2025-10-03 | Smart JSON storage, intelligent config checking |
| v1.0.0 | 2025-09-XX | Initial release |
📖 Documentation
- Installation: INTERACTIVE_INSTALLATION.md
- Systemd Setup: systemd/SYSTEMD.md
- Storage Configuration: PERSISTENT_STORAGE.md
- Debian Packaging: DEBIAN_PACKAGE.md
- Testing: TESTING.md
🤝 Contributing
See README.md for development setup and contribution guidelines.
This release ensures your DDNS IP data is always preserved and accessible, providing the reliability your infrastructure depends on! 🎉