Files
NetAlertX/front/plugins/dhcp_leases
sebingel 4c117db463 Fix elementOptions: rename typo 'ordeable' to 'orderable'
The key 'ordeable' in elementOptions was a long-standing typo for the
correct English word 'orderable'. Since the JS check in settings_utils.js
used the same misspelled key, the feature appeared to work — but it was
relying on the consistent propagation of a typo across the entire codebase.

Two pre-existing entries in front/plugins/ui_settings/config.json already
used the correct spelling 'orderable', but these had no effect because the
JavaScript check (option.ordeable === 'true') never matched them. As a
result, orderable behavior was silently disabled for those two settings.

Changes:
- front/js/settings_utils.js: renamed option.ordeable → option.orderable
  and isOrdeable → isOrderable (6 occurrences, lines 792/823/824/880/1079/
  1192/1228). The JS key check is the authoritative definition of the
  elementOptions property name, so this must change atomically with all
  config files.

- server/initialise.py:245: renamed "ordeable" → "orderable" in the
  hardcoded JSON string for LOADED_PLUGINS setting. This string is the
  source-of-truth for that setting's elementOptions and is not auto-
  generated from the plugin config files.

- front/plugins/*/config.json (33 files, 90 occurrences): renamed all
  "ordeable": "true" entries to "orderable": "true" via sed. All plugins
  used the typo consistently; they must be updated in the same commit to
  avoid a broken intermediate state.

The two formerly broken 'orderable' entries in ui_settings/config.json
are now matched by the corrected JS check and work as intended.

Fixes netalertx/NetAlertX#1584

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 18:28:48 +00:00
..
2025-11-22 20:43:36 +11:00

Overview

A plugin allowing for importing devices from DHCP.leases files.

Usage

  • Specify full paths of all dhcp.leases files you want to import and watch in the DHCPLSS_paths_to_checksetting.
  • Map the paths specified in the DHCPLSS_paths_to_checksetting in your docker-compose.yml file.
  • If you are using pihole or dnsmasq dhcp.leases, include pihole or dnsmasq into the mapping path respectively, check the below example for details

Example:

docker-compose.yml excerpt:

    volumes:
      ...
      # mapping different dhcp.leases files
      - /first/location/dhcp.leases:/mnt/dhcp1.leases
      - /second/location/dhcp.leases:/mnt/dhcp2.leases      
      - /third/location/dhcp.leases:/etc/pihole/dhcp.leases      # a pihole specific dhcp.leases file 
      - /fourth/location/dhcp.leases:/etc/dnsmasq/dhcp.leases    # a dnsmasq specific dhcp.leases file  
      ...

The DHCPLSS_paths_to_check setting should then contain the following:

DHCPLSS_paths_to_check = ['/mnt/dhcp1.leases','/mnt/dhcp2.leases','/etc/pihole/dhcp.leases','/etc/dnsmasq/dhcp.leases']

Notes

No specific configuration is needed. This plugin supports dhcp.leases file(s) in the following formats:

  1. PiHole
  2. Dnsmasq
  3. Generic format

pihole format

Example File Format: (not all lines are required)

TBC

dnsmasq format

[Lease expiry time] [mac address] [ip address] [hostname] [client id, if known]

Example File Format: (not all lines are required)

1715932537 01:5c:5c:5c:5c:5c:5c 192.168.1.115 ryans-laptop 01:5c:5c:5c:5c:5c:5c

Note, only [mac address] [ip address] [hostname] are captured

Generic format

dhcpd.leases(5) - Linux man page

Example File Format: (not all lines are required)

lease 192.168.79.15 {
  starts 0 2016/08/21 13:25:45;
  ends 0 2016/08/21 19:25:45;
  cltt 0 2016/08/21 13:25:45;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 8c:1a:bf:11:00:ea;
  uid "\001\214\032\277\021\000\352";
  option agent.circuit-id 0:17;
  option agent.remote-id c0:a8:9:5;
  client-hostname "android-8182e21c852776e7";
}