]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
radhttpcheck: Allow config path to be specified
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 May 2023 01:21:26 +0000 (21:21 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 May 2023 01:21:26 +0000 (21:21 -0400)
scripts/health/radhttpcheck/radhttpcheck.py
scripts/health/radhttpcheck/radhttpcheck.service
scripts/health/radhttpcheck/radhttpcheck.yml

index 57658671ab0d795c535b203167632229824700dc..5fe76f69fca0859380b233859f566baa45335df7 100755 (executable)
@@ -26,6 +26,7 @@ from pyrad.client import Client, Timeout
 from pyrad.dictionary import Dictionary
 import pyrad.packet
 
+import argparse
 import json
 import yaml
 
@@ -234,8 +235,12 @@ def main():
     global config
     global raddict
 
+    parser = argparse.ArgumentParser(description='HTTP to RADIUS healthcheck')
+    parser.add_argument('-c', '--conf', default='radhttpcheck.yml', help='path to configuration file')
+    args = parser.parse_args()
+
     # Parse our configuration, setting defaults
-    config = Configuration()
+    config = Configuration(args.conf)
 
     # Start the HTTP server
     with ThreadedHTTPServer((config.listen['ipaddr'], config.listen['port']), RadiusHealthCheckHandler) as httpd:
index 20450d5312bc8f22c16a3d6e74830a37f3bd4edb..bdfc1a27595bfb08271152fed632f458ec32405b 100644 (file)
@@ -5,7 +5,7 @@ Documentation=raddhtpcheck/README.md
 
 [Service]
 Type=exec
-ExecStart=/usr/local/radhttpcheck/radhttpcheck.py
+ExecStart=/usr/local/radhttpcheck/radhttpcheck.py --conf /usr/local/radhttpcheck/radhttpcheck.yml
 Restart=on-failure
 RestartSec=5
 
index 0a5de4597eb2d2c925267e4a34535c30499067f5..12d06114dd1c1095af5a4cc68717da41dac92c5d 100644 (file)
@@ -1,7 +1,7 @@
 # Address listened on for HTTP traffic
 listen:
   address: '*'
-  port: 8000
+  port: 8080
 # URLs the healthcheck script will respond on, and the various types of requests they create
 endpoints:
   '/acct':