jokob-sk / NetAlertX

🖧🔍 WIFI / LAN intruder detector. Scans for devices connected to your network and alerts you if new and unknown devices are found.
GNU General Public License v3.0
2.84k stars 163 forks source link

Safari support - Network overview page all switches/routers are stuck in top left corner #292

Closed sahara101 closed 1 year ago

sahara101 commented 1 year ago

Describe the issue

When submitting an issue ❗enable debug❗ and have a look at the docs

Network overview page all switches/routers are stuck in top left corner.

Paste your pialert.conf (remove personal info)

<img width="833" alt="Greenshot 2023-07-21 21 40 47" src="https://github.com/jokob-sk/Pi.Alert/assets/22507692/02aff313-effc-4cb4-83c9-5abeec5b9f73">

#-----------------AUTOGENERATED FILE-----------------#
#                                                    #
#         Generated:  2023-07-21_20-32-14            #
#                                                    #
#   Config file for the LAN intruder detection app:  #
#      https://github.com/jokob-sk/Pi.Alert          #
#                                                    #
#-----------------AUTOGENERATED FILE-----------------#

# General
#---------------------------
ENABLE_ARPSCAN=True
SCAN_SUBNETS=['192.168.1.0/24 --interface=eth3']
LOG_LEVEL='debug'
TIMEZONE='Europe/Berlin'
ENABLE_PLUGINS=True
PIALERT_WEB_PROTECTION=False
PIALERT_WEB_PASSWORD='8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'
INCLUDED_SECTIONS=['internet','new_devices','down_devices','events']
SCAN_CYCLE_MINUTES=5
DAYS_TO_KEEP_EVENTS=90
REPORT_DASHBOARD_URL='http://pi.alert'
DIG_GET_IP_ARG='-4 myip.opendns.com @resolver1.opendns.com'
UI_LANG='English'
UI_PRESENCE=['online','offline','archived']

# Email
#---------------------------
REPORT_MAIL=False
SMTP_SERVER='smtp.gmail.com'
SMTP_PORT=587
REPORT_TO='user@gmail.com'
REPORT_FROM='Pi.Alert <user@gmail.com>'
SMTP_SKIP_LOGIN=False
SMTP_USER='user@gmail.com'
SMTP_PASS='password'
SMTP_SKIP_TLS=False
SMTP_FORCE_SSL=False

# Webhooks
#---------------------------
REPORT_WEBHOOK=False
WEBHOOK_URL='http://n8n.local:5555/webhook-test/aaaaaaaa-aaaa-aaaa-aaaaa-aaaaaaaaaaaa'
WEBHOOK_PAYLOAD='json'
WEBHOOK_REQUEST_METHOD='GET'

# Apprise
#---------------------------
REPORT_APPRISE=False
APPRISE_HOST='http://localhost:8000/notify'
APPRISE_URL='mailto://smtp-relay.sendinblue.com:587?from=user@gmail.com&name=apprise&user=user@gmail.com&pass=password&to=user@gmail.com'
APPRISE_PAYLOAD='html'

# NTFY
#---------------------------
REPORT_NTFY=False
NTFY_HOST='https://ntfy.sh'
NTFY_TOPIC='replace_my_secure_topicname_91h889f28'
NTFY_USER='user'
NTFY_PASSWORD='passw0rd'

# PUSHSAFER
#---------------------------
REPORT_PUSHSAFER=False
PUSHSAFER_TOKEN='ApiKey'

# MQTT
#---------------------------
REPORT_MQTT=False
MQTT_BROKER='192.168.1.2'
MQTT_PORT=1883
MQTT_USER='mqtt'
MQTT_PASSWORD='passw0rd'
MQTT_QOS=0
MQTT_DELAY_SEC=2

# DynDNS
#---------------------------
DDNS_ACTIVE=False
DDNS_DOMAIN='your_domain.freeddns.org'
DDNS_USER='dynu_user'
DDNS_PASSWORD='A0000000B0000000C0000000D0000000'
DDNS_UPDATE_URL='https://api.dynu.com/nic/update?'

# PiHole
#---------------------------
PIHOLE_ACTIVE=False
DHCP_ACTIVE=False

# Pholus
#---------------------------
PHOLUS_ACTIVE=False
PHOLUS_TIMEOUT=120
PHOLUS_FORCE=False
PHOLUS_RUN='once'
PHOLUS_RUN_TIMEOUT=600
PHOLUS_RUN_SCHD='0 4 * * *'
PHOLUS_DAYS_DATA=7

# Nmap
#---------------------------
NMAP_ACTIVE=True
NMAP_TIMEOUT=150
NMAP_RUN='none'
NMAP_RUN_SCHD='0 2 * * *'
NMAP_ARGS='-p -10000'

# API
#---------------------------
API_CUSTOM_SQL='SELECT * FROM Devices WHERE dev_PresentLastScan = 0'

# DHCPLSS
#---------------------------
DHCPLSS_RUN='disabled'
DHCPLSS_CMD='python3 /home/pi/pialert/front/plugins/dhcp_leases/script.py paths={paths}'
DHCPLSS_paths_to_check=['/mnt/dhcp1.leases','/mnt/dhcp2.leases']
DHCPLSS_RUN_SCHD='0 2 * * *'
DHCPLSS_RUN_TIMEOUT=5
DHCPLSS_WATCH=['Watched_Value1','Watched_Value4']
DHCPLSS_REPORT_ON=['new','watched-changed']

# DHCPSRVS
#---------------------------
DHCPSRVS_RUN='disabled'
DHCPSRVS_CMD='python3 /home/pi/pialert/front/plugins/dhcp_servers/script.py'
DHCPSRVS_RUN_SCHD='0 2 * * *'
DHCPSRVS_RUN_TIMEOUT=5
DHCPSRVS_WATCH=['Watched_Value1']
DHCPSRVS_REPORT_ON=['new','watched-changed']

# NMAPSRV
#---------------------------
NMAPSRV_RUN='disabled'
NMAPSRV_CMD='SELECT  ns.MAC as Object_PrimaryID, cast({s-quote}http://{s-quote} || dv.dev_LastIP as VARCHAR(100)) || {s-quote}:{s-quote} || cast( SUBSTR(ns.Port ,0, INSTR(ns.Port , {s-quote}/{s-quote})) as VARCHAR(100)) as Object_SecondaryID,  datetime() as DateTime,  ns.Service as Watched_Value1, ns.State as Watched_Value2, dv.dev_Name as Watched_Value3,        {s-quote}null{s-quote} as Watched_Value4,        ns.Extra as Extra, ns.MAC as ForeignKey FROM (SELECT * FROM Nmap_Scan) ns left JOIN (SELECT dev_Name, dev_MAC, dev_LastIP FROM Devices) dv  ON ns.MAC = dv.dev_MAC'
NMAPSRV_RUN_SCHD='0 2 * * *'
NMAPSRV_WATCH=['Watched_Value1']
NMAPSRV_REPORT_ON=['new','watched-changed']

# SNMPDSC
#---------------------------
SNMPDSC_RUN='disabled'
SNMPDSC_CMD='python3 /home/pi/pialert/front/plugins/snmp_discovery/script.py routers={s-quote}{routers}{s-quote}'
SNMPDSC_routers=['snmpwalk -v 2c -c public -OXsq 192.168.1.1 .1.3.6.1.2.1.3.1.1.2']
SNMPDSC_RUN_SCHD='0 2 * * *'
SNMPDSC_RUN_TIMEOUT=5
SNMPDSC_WATCH=['Watched_Value1']
SNMPDSC_REPORT_ON=['new','watched-changed']

# UNDIS
#---------------------------
UNDIS_RUN='disabled'
UNDIS_CMD='python3 /home/pi/pialert/front/plugins/undiscoverables/script.py devices={devices}'
UNDIS_RUN_TIMEOUT=10
UNDIS_devices_to_import=['dummy_router']

# UNFIMP
#---------------------------
UNFIMP_RUN='disabled'
UNFIMP_CMD='python3 /home/pi/pialert/front/plugins/unifi_import/script.py username={username} password={password}  host={host} sites={sites}  protocol={protocol} port={port} version={version}'
UNFIMP_username=''
UNFIMP_password=''
UNFIMP_protocol='https://'
UNFIMP_host='192.168.1.1'
UNFIMP_port='8443'
UNFIMP_version=''
UNFIMP_sites=['default']
UNFIMP_RUN_SCHD='0 2 * * *'
UNFIMP_RUN_TIMEOUT=5
UNFIMP_WATCH=['Watched_Value1','Watched_Value4']
UNFIMP_REPORT_ON=['new','watched-changed']

# WEBMON
#---------------------------
WEBMON_RUN='disabled'
WEBMON_CMD='python3 /home/pi/pialert/front/plugins/website_monitor/script.py urls={urls}'
WEBMON_RUN_SCHD='0 2 * * *'
WEBMON_API_SQL='SELECT * FROM plugin_website_monitor'
WEBMON_RUN_TIMEOUT=5
WEBMON_WATCH=['Watched_Value1']
WEBMON_REPORT_ON=['new','watched-changed']
WEBMON_urls_to_check=['https://google.com','https://duck.com']
WEBMON_SQL_internet_ip='SELECT dev_LastIP FROM Devices WHERE dev_MAC = {s-quote}Internet{s-quote}'

#-------------------IMPORTANT INFO-------------------#
#   This file is ingested by a python script, so if  #
#        modified it needs to use python syntax      #
#-------------------IMPORTANT INFO-------------------#

Paste your docker-compose.yml and .env (remove personal info)

    pialert:
    container_name: pialert
    image: "jokobsk/pi.alert:latest"      
    network_mode: "host"        
    restart: unless-stopped
    volumes:
      - /volume1/docker/appdata/pialert/config:/home/pi/pialert/config
      - /volume1/docker/appdata/pialert/db:/home/pi/pialert/db      
      # (optional) useful for debugging if you have issues setting up the container
      - /volume1/docker/appdata/pialert/logs:/home/pi/pialert/front/log
    environment:
      - TZ=${TZ}      
      - HOST_USER_ID=1000
      - HOST_USER_GID=1000
      - PUID=${PUID}
      - PGID=${PGID}
      - PORT=20211` 

.env

## Here you edit/update your settings that will be used for your docker-compose
## This will only work if you follow exactly the path structure in the Guide !!!
COMPOSE_PROJECT_NAME=trash-guides

## Global Settings
# <change "/volume1/docker/appdata" with the path your configs will be>
DOCKERCONFDIR=/volume1/docker/appdata
# <change "/volume1/data" with the path where your library + torrent/usenet downloads both are>
DOCKERSTORAGEDIR=/volume1/data
# <you must find out your PUID/PGID through SSH, run in terminal: id $user. If needed, change $user to the user you created.>
PUID=1027
PGID=100
# <change to your timezone>
TZ=Europe/Bucharest
# Dockerlogging and max size
DOCKERLOGGING_MAXFILE=10
DOCKERLOGGING_MAXSIZE=200k

## PLEX

# Go to plex.tv/claim and login with your account,
# copy the claim code and add it "claim-xxxxxxxxxxxxxxxxxxxx".
# When starting the new plex server for the first time, the server will be added to your account.
PLEX_CLAIM=claim-xkJd4VjDd9Ufmk-UFPFJ
# If you are a Plex Pass subscriber, you can enable the install of beta builds <yes|no>
PLEX_PASS=no
# Replace http://192.168.x.x:32400 with your <lan ipv4 network>
# This is useful to aid your local clients in discovering your plex server when running in the bridge network mode.
PLEX_ADVERTISE_IP="http://192.168.1.150:32400"

## VPN Settings (Only needed if you want to run a VPN Container)
# if the torrent vpn client GUI isn't visible run "sudo insmod /lib/modules/tun.ko" and if that doesn't fix it also run "sudo insmod /lib/modules/iptable_mangle.ko"
# to make it survive boot => 'Task Scheduler', Select user 'root', event 'Boot-up' and check 'Enabled'. As script enter: "insmod /lib/modules/tun.ko"
# and if needed "insmod /lib/modules/iptable_mangle.ko"

# <lan ipv4 network>/<cidr notation>
LAN_NETWORK=192.168.1.0/24

## qbittorrent
# ENABLE VPN=<true|false>
VPN_ENABLED=false
# ENABLE PRIVOXY=<true|false>
QBITTORRENT_ENABLE_PRIVOXY=false
# qBittorrent (web ui)
QBITTORRENT_WEBUI_PORT=8080
# Privoxy Port
QBITTORRENT_PRIVOXY_PORT=8118

## Pullio - Auto update docker-compose the correct way.
# Setup instructions https://trash-guides.info/Hardlinks/How-to-setup-for/Synology/#pullio-auto-update-docker-compose-the-correct-way
# If you want your containers to be updated
PULLIO_UPDATE=true
# If you want a notification when there's a update, onyl discord webhook notifications is supported.
# Adding no discord webhook will disable the notifications!!!
# check for more info https://hotio.dev/pullio/ and how to add the webhook.
PULLIO_NOTIFY=true
PULLIO_DISCORD_WEBHOOK=

## Notifiarr
# Hostname is used to identify your host and can be set to anything you like.
HOSTNAME=arrsuite

Screenshots

[If applicable, add screenshots to help explain your problem.]

Paste last few lines from pialert.log

You can use tail -100 /home/pi/pialert/front/log/pialert.log



# paste code below 

I don't have any front log...
jokob-sk commented 1 year ago

Hi there!

Can you provide a screenshot and any debug information from the browser dev tools (usually accessible when pressing F12 > Console)?

Please also make sure you followed the docs: https://github.com/jokob-sk/Pi.Alert/blob/main/docs/NETWORK_TREE.md

I only tested the feature in Chrome/Firefox.

Thanks, j

sahara101 commented 1 year ago

I thought I added a screenshot. I just tried in Chrome and it is working. I am mainly using safari and there it does not want....

Greenshot 2023-07-21 21 40 47
jokob-sk commented 1 year ago

I see.

Regrettably, I don't have the bandwidth to support Safari as another browser. I'm happy fo you or someone else try to fix this with a PR, but I myself don't have time to test more browsers.

Thanks for understanding, j