diff --git a/docs/REVERSE_DNS.md b/docs/REVERSE_DNS.md index c4f74c25..61196474 100755 --- a/docs/REVERSE_DNS.md +++ b/docs/REVERSE_DNS.md @@ -25,3 +25,39 @@ If you are running a DNS server, such as AdGuard, set up **Private reverse DNS s 4. Make sure you have **Use private reverse DNS resolvers** ticked. 5. Click **Apply** to save your settings. + +### Using a custom resolv.conf file + +You can configure a custom /etc/resolv.conf file in the docker-compose.yml and set the DNS server of your LAN DNS server (e.g.: Pi-Hole) as the nameserver. + +#### docker-compose.yml: + +```yaml +version: "3" +services: + pialert: + container_name: pialert + image: "jokobsk/pi.alert:latest" + restart: unless-stopped + volumes: + - ./config/pialert.conf:/home/pi/pialert/config/pialert.conf + - ./pialert_db:/home/pi/pialert/db + - ./log:/home/pi/pialert/front/log + - ./config/resolv.conf:/etc/resolv.conf + environment: + - TZ=Europe/Berlin + - PORT=20211 + - HOST_USER_ID=1000 + - HOST_USER_GID=1000 + ports: + - "20211:20211" + network_mode: host +``` + +#### ./config/resolv.conf: + +``` +nameserver 192.168.178.11 +options edns0 trust-ad +search example.com +``` \ No newline at end of file diff --git a/front/devices.php b/front/devices.php index 370b11d9..8994ffc3 100755 --- a/front/devices.php +++ b/front/devices.php @@ -357,35 +357,20 @@ function filterDataByStatus(data, status) { return data.filter(function(item) { switch (status) { case 'my': - to_display = getSetting('UI_MY_DEVICES') - - console.log(to_display) - - result = false; - - if (to_display.includes('online') && item.dev_PresentLastScan === 1) - { - result = true; - } + to_display = getSetting('UI_MY_DEVICES'); - if (to_display.includes('offline') && item.dev_PresentLastScan === 0) - { - result = true; - } + let result = false; - if (to_display.includes('archived') && item.dev_Archived === 1) - { - result = true; - } - - if (to_display.includes('new') && item.dev_NewDevice === 1) - { - result = true; - } - - if (to_display.includes('down') && item.dev_PresentLastScan === 0 && item.dev_AlertDeviceDown !== 0) - { - result = true; + if (to_display.includes('online') && item.dev_PresentLastScan === 1) { + result = true; + } else if (to_display.includes('offline') && item.dev_PresentLastScan === 0) { + result = true; + } else if (to_display.includes('archived') && item.dev_Archived === 1) { + result = true; + } else if (to_display.includes('new') && item.dev_NewDevice === 1) { + result = true; + } else if (to_display.includes('down') && item.dev_PresentLastScan === 0 && item.dev_AlertDeviceDown !== 0) { + result = true; } return result; // Include all items for 'my' status