Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions applications/luci-app-ha-cluster/Makefile
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
134 changes: 134 additions & 0 deletions applications/luci-app-ha-cluster/README.md
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)
Comment on lines +11 to +13

Copy link
Copy Markdown
Collaborator

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 main instance (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.

Suggested change
- 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)
- Virtual IP (VIP) configuration per interface (single shared failover group)

Generated by Claude Code

- 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>
Loading