feat(ovpnrw): connections history from storage if available#1566
Open
m-dilorenzi wants to merge 1 commit intomainfrom
Open
feat(ovpnrw): connections history from storage if available#1566m-dilorenzi wants to merge 1 commit intomainfrom
m-dilorenzi wants to merge 1 commit intomainfrom
Conversation
… storage integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and enhancements to the OpenVPN connections history section, primarily focused on supporting persistent storage for connection history databases, improving API functionality, and adding mechanisms to synchronize connection records when storage is mounted.
The changes ensure that connection history is preserved across reboots, provide more flexible API filtering and sorting, and add scripts to automate database migration.
Persistent storage and database path handling:
/mnt/data/openvpnand uses it as the preferred location forconnections.db, falling back to/var/openvpnif storage is not available. Helper functions likeget_connections_db_pathandget_ovpnrw_db_pathwere introduced to centralize this logic.README.md) was updated to clarify that connection history is stored in either/var/openvpn/<instance>/connections.dbor/mnt/data/openvpn/<instance>/connections.dbdepending on storage configuration.Database migration and archiving:
20-openvpn-merge-connections-db) and migration utility (openvpn-merge-connections-db) were added to synchronize connection records from/varto/mnt/datawhen storage is mounted, ensuring persistence across reboots.API enhancements and reporting improvements:
connection_historyAPI was refactored to support filtering (by time range, accounts, and search query), sorting (including manual sorting for IP addresses), and pagination, returning richer metadata for frontend use.These changes collectively improve reliability, flexibility, and maintainability of the OpenVPN connections history section.
Closes: #1404