-
Notifications
You must be signed in to change notification settings - Fork 2.9k
luci-app-ha-cluster: add LuCI interface #8549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pgaufillet
wants to merge
1
commit into
openwrt:master
Choose a base branch
from
pgaufillet:add-luci-app-ha-cluster
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| include $(TOPDIR)/rules.mk | ||
|
|
||
| PKG_LICENSE:=Apache-2.0 | ||
| PKG_MAINTAINER:=Pierre Gaufillet <pierre.gaufillet@bergamote.eu> | ||
|
|
||
| LUCI_TITLE:=LuCI support for HA Cluster | ||
| LUCI_DEPENDS:=+ha-cluster +luci-base +rpcd | ||
|
|
||
| include ../../luci.mk | ||
|
|
||
| # call BuildPackage - OpenWrt buildroot signature |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| # LuCI Application for HA Cluster | ||
|
|
||
| Web interface for managing High Availability clusters on OpenWrt. | ||
|
|
||
| ## Features | ||
|
|
||
| ### General Tab | ||
| - Simple multi-router HA configuration (2 or more nodes) | ||
| - Priority configuration | ||
| - Peer router management | ||
| - VRRP instance management (VIPs grouped by instance fail over atomically) | ||
| - Virtual IP (VIP) configuration per interface with instance selector | ||
| - Inline VRRP instance creation from VIP modal ("Add new..." option) | ||
| - Service synchronization selection | ||
| - One-click enable/disable | ||
|
|
||
| ### Status Tab | ||
| - Real-time cluster state (MASTER/BACKUP/FAULT) | ||
| - Peer connectivity status | ||
| - Service health monitoring (keepalived, owsync, lease-sync) | ||
| - DHCP lease sync statistics | ||
| - Config sync statistics | ||
| - Auto-refresh every 5 seconds | ||
|
|
||
| ### Advanced Pages | ||
| - **Keepalived (Advanced)**: VRRP instance tuning (timing/auth/tracking/unicast) and health checks | ||
| - **owsync (Advanced)**: Custom sync groups, exclusions, poll interval | ||
| - **DHCP Sync (Advanced)**: lease-sync tuning and logging | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| apk update | ||
| apk add luci-app-ha-cluster | ||
| ``` | ||
|
|
||
| ## Dependencies | ||
|
|
||
| - `ha-cluster` - HA cluster management package | ||
| - `luci-base` - LuCI base system | ||
| - `rpcd` - RPC daemon | ||
|
|
||
| ## Files | ||
|
|
||
| ``` | ||
| /www/luci-static/resources/ | ||
| └── view/ha-cluster/ | ||
| ├── simple.js # General interface | ||
| ├── status.js # Status dashboard | ||
| ├── keepalived-advanced.js # Advanced VRRP settings | ||
| ├── owsync-advanced.js # Advanced config sync settings | ||
| └── lease-sync-advanced.js # Advanced DHCP sync settings | ||
|
|
||
| /usr/share/luci/menu.d/ | ||
| └── luci-app-ha-cluster.json # Menu definition | ||
|
|
||
| /usr/share/rpcd/acl.d/ | ||
| └── luci-app-ha-cluster.json # Access control | ||
|
|
||
| /usr/libexec/rpcd/ | ||
| └── ha-cluster # RPC backend (shell script) | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| 1. Navigate to **Services → High Availability** in LuCI | ||
| 2. Go to **General** tab | ||
| 3. Configure: | ||
| - Enable HA Cluster | ||
| - Set priority | ||
| - Add peer router IP | ||
| - Configure Virtual IPs for each interface | ||
| - Select services to synchronize | ||
| 4. Save & Apply | ||
|
|
||
| ## Screenshots | ||
|
|
||
| ### General | ||
| Simple form-based configuration for typical multi-router setups: | ||
| - Cluster settings (priority, VRRP transport) | ||
| - Peer configuration | ||
| - Virtual IP addresses | ||
| - Service sync options | ||
|
|
||
| ### Status Dashboard | ||
| Real-time monitoring with: | ||
| - Cluster state indicator (color-coded) | ||
| - Peer health status | ||
| - Service status table | ||
| - Sync statistics | ||
|
|
||
| ## Development | ||
|
|
||
| ### Testing Locally | ||
|
|
||
| ```bash | ||
| # Build the package | ||
| make package/luci-app-ha-cluster/compile | ||
|
|
||
| # Install on router | ||
| scp bin/packages/*/luci/luci-app-ha-cluster_*.apk root@router:/tmp/ | ||
| ssh root@router apk add /tmp/luci-app-ha-cluster_*.apk | ||
|
|
||
| # Clear LuCI cache | ||
| ssh root@router rm -rf /tmp/luci-* | ||
| ``` | ||
|
|
||
| ### Debugging | ||
|
|
||
| Enable debug mode in browser console: | ||
| ```javascript | ||
| L.env.sessionid | ||
| ``` | ||
|
|
||
| Check RPC calls: | ||
| ```bash | ||
| ubus call ha-cluster status | ||
| ``` | ||
|
|
||
| View logs: | ||
| ```bash | ||
| logread | grep luci | ||
| logread | grep ha-cluster | ||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
| Apache-2.0 | ||
|
|
||
| luci-app-ha-cluster has been developed using Claude Code from Anthropic. | ||
|
|
||
| ## Maintainer | ||
|
|
||
| Pierre Gaufillet <pierre.gaufillet@bergamote.eu> | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: these three bullets describe a General tab that no longer exists — the VIP section hardcodes a single
maininstance (simple.js:401-422)`` and its own description tells users to go to the Advanced page for independent failover groups; there is no instance selector and no "Add new..." option.Generated by Claude Code