Skip to content

Commit 252469f

Browse files
committed
Remove health check command-line flags and update documentation to reflect configuration changes
1 parent 3e2bc4b commit 252469f

File tree

5 files changed

+6
-46
lines changed

5 files changed

+6
-46
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ HarmonyLite is designed for simplicity with minimal configuration. Key command l
9393
- `cluster-addr` - Binding address for cluster
9494
- `cluster-peers` - Comma-separated list of NATS peers
9595
- `leaf-server` - Leaf node connection list
96-
- `health-check` - Enable/disable health check endpoint
97-
- `health-bind` - HTTP bind address for health check
98-
- `health-path` - Path for health check endpoint
9996

10097
See `config.toml` for detailed configuration options.
10198

@@ -108,7 +105,7 @@ HarmonyLite provides a health check HTTP endpoint that can be used for monitorin
108105
- CDC (Change Data Capture) hooks installation
109106
- Tables being tracked
110107

111-
Configure it in your `config.toml`:
108+
Health check configuration is only available through the `config.toml` file:
112109

113110
```toml
114111
[health_check]

cfg/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ var ClusterPeersFlag = flag.String("cluster-peers", "", "Comma separated list of
128128
var LeafServerFlag = flag.String("leaf-servers", "", "Comma separated list of leaf servers")
129129
var ProfServer = flag.String("pprof", "", "PProf listening address")
130130
var NodeIDFlag = flag.Uint64("node-id", 0, "Override node ID from config file")
131-
var HealthCheckFlag = flag.Bool("health-check", false, "Enable health check endpoint")
132-
var HealthBindFlag = flag.String("health-bind", "0.0.0.0:8090", "Health check binding address")
133-
var HealthPathFlag = flag.String("health-path", "/health", "Health check endpoint path")
134131

135132
var DataRootDir = os.TempDir()
136133
var Config = &Configuration{

docs/docs/configuration-reference.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,12 @@ In addition to the configuration file, HarmonyLite accepts several command-line
308308
| `-leaf-servers` | Comma-separated list of leaf servers |
309309
| `-cleanup` | Clean up triggers and log tables |
310310
| `-save-snapshot` | Force snapshot creation |
311-
| `-health-check` | Enable/disable health check endpoint |
312-
| `-health-bind` | Health check binding address |
313-
| `-health-path` | Health check endpoint path |
314311
| `-pprof` | Enable profiling server on specified address |
315312
| `-help` | Display help information |
316313

317314
Example usage:
318315
```bash
319316
harmonylite -config /etc/harmonylite/config.toml -cluster-addr 127.0.0.1:4222 -cluster-peers nats://127.0.0.1:4223/
320-
```
317+
```
318+
319+
> **Note**: Health check configuration is now exclusively available through the `config.toml` file and cannot be set via command-line flags.

docs/docs/health-check.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@ path = "/health"
2929
detailed = true
3030
```
3131

32-
You can also configure these settings using command-line flags:
33-
34-
```bash
35-
--health-check # Enable health check endpoint (boolean)
36-
--health-bind # HTTP bind address for health check
37-
--health-path # Path for health check endpoint
38-
```
32+
=======
3933

4034
## Usage
4135

harmonylite.go

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -69,37 +69,10 @@ func main() {
6969
log.Debug().Msg("Initializing telemetry")
7070
telemetry.InitializeTelemetry()
7171

72-
// Apply health check CLI flags if provided
72+
// Initialize default health check config if not set
7373
if cfg.Config.HealthCheck == nil {
7474
cfg.Config.HealthCheck = health.DefaultConfig()
7575
}
76-
77-
// Check if flags were provided on the command line
78-
healthCheckFlagProvided := false
79-
healthBindFlagProvided := false
80-
healthPathFlagProvided := false
81-
82-
flag.Visit(func(f *flag.Flag) {
83-
if f.Name == "health-check" {
84-
healthCheckFlagProvided = true
85-
} else if f.Name == "health-bind" {
86-
healthBindFlagProvided = true
87-
} else if f.Name == "health-path" {
88-
healthPathFlagProvided = true
89-
}
90-
})
91-
92-
if healthCheckFlagProvided {
93-
cfg.Config.HealthCheck.Enable = *cfg.HealthCheckFlag
94-
}
95-
96-
if healthBindFlagProvided {
97-
cfg.Config.HealthCheck.Bind = *cfg.HealthBindFlag
98-
}
99-
100-
if healthPathFlagProvided {
101-
cfg.Config.HealthCheck.Path = *cfg.HealthPathFlag
102-
}
10376

10477
log.Debug().Str("path", cfg.Config.DBPath).Msg("Checking if database file exists")
10578
if _, err := os.Stat(cfg.Config.DBPath); os.IsNotExist(err) {

0 commit comments

Comments
 (0)