Giter Site home page Giter Site logo

aceberg / watchyourlan Goto Github PK

View Code? Open in Web Editor NEW
1.1K 10.0 46.0 8.48 MB

Lightweight network IP scanner with web GUI

Home Page: https://hub.docker.com/r/aceberg/watchyourlan

License: MIT License

Makefile 1.06% Go 68.64% HTML 29.83% Dockerfile 0.33% Shell 0.13%
arp-scan golang gui docker self-hosted selfhosted

watchyourlan's Introduction

Hi there 👋

My name is Andrew, I am Linux admin and Self-Hosted apps developer.
I'm open for freelance work as sysadmin or developer.

What can I do?

Work Price
Ansible playbook, Bash script, Dockerfile starts at $10
Configure Linux server: Docker, Firewall, Monitoring, Backups and anything else $10 per hour or fixed price for fixed amount of work
Golang app with web GUI starts at $100
Add feature to an existing app starts at $50

All prices can be negotiated. Please, contact me [email protected]

I will continue working on Open Source projects no matter what, but I need to pay the bills, so if you can donate or want to order your personal selfhosted app, be my guest ✨

My Open Source projects

Name Description Badges
WatchYourLAN Lightweight network IP scanner with web GUI GitHub Repo stars Docker Pulls
ExerciseDiary Workout diary with GitHub-style year visualization GitHub Repo stars Docker Pulls
miniboard Lightweight dashboard with tabs, uptime monitoring and notifications GitHub Repo stars Docker Pulls
rediary Emotional resource diary GitHub Repo stars Docker Pulls
HomeLists Count consumable supplies GitHub Repo stars Docker Pulls
git-syr Sync Your Repos - pull or push git repos regularly. For dotfiles backups or note taking in git repo GitHub Repo stars
LinuxExecBot Telegram bot to execute a command from a configurable list GitHub Repo stars
ClickAHabit Daily habit tracker and counter GitHub Repo stars Docker Pulls

Donate

If you find my Open Source work helpful, here are ways you can support it:

  • Bank Card ($USD or RUB): boosty
  • BTC: bc1qj59rxmfvanvqqltq9t73qls4su3xrvwuv3sxhr
  • ETH: 0x276124c218aa8110F96989AA1f6f2Bb960C234B7
  • USDT (ETH Network): 0x276124c218aa8110F96989AA1f6f2Bb960C234B7

watchyourlan's People

Contributors

aceberg avatar adamadavidson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

watchyourlan's Issues

Feature Request: add VLAN support

I am sure this has been asked many times already, but I couldn't see it here. Is VLAN support able to be added this would be amazing to sit across multiple VLANs, that and or ability to integrate with Unifi API and pull the data from there.

Improvements & Fixes

Hello there,

I have some ideas for improving & fixing few things. So here they are:

[Updated: 2022-09-24]

Improvements:

  • Device Type Colunm, just like you the Name, where we can set device type (Desktop, Laptop, Phone Android, Phone iOS, Printer, Router, Switch, Server etc. Should be custom text input with pre-defined types as well.
  • Device Group, to add certain devices that belong to a group.
  • Status Column, like the Known, here it should show device status i.e., Green = Online or Red = Offline.
  • Always-On tick box for devices which should always show as Online.
  • Logs Section, move it a separate page. Here it should show info like New Device detected, went online/offline etc.
  • Devices Page, here is where we should be able to edit devices' info i.e., Name Type, Group, Known, MAC Address etc.
  • Custom theming option, so we can set background, colours etc. Environment variable to /data/themes or custom.css. Even better if you can get support from Theme-Park.dev.

Fixes:

  • Fix the IP Column sorting, right now it is sorting with a very weird order e.g, xx.xx.xx.1 then xx.xx.xx.100 comes.
  • Increase the width of the Table. There is a lot of wasted space on both sides.

I hope that you'll look into these ideas & fixes.

Regards~

Shoutrrr is not working with my telegram chat

I get the URL using "docker run --rm -it containrrr/shoutrrr generate telegram", and I put it in the container configuration, but I do not receive any message from telegram.

Any ideas?

Clickable IP's

I made something similar a long time ago (though it was manual) but the big time saver for me was being able to click on the IP's and have it open in a new tab.. Would this be possible?

Edit : looking at your index.html... would just changing line 25 to the below achieve this?

<td><a href="http://{{ .Ip }}" target="new">{{ .Ip }}</a></td>

Online / offline timeseries record for each device

Use case:

  • As a network admin, I want to know, when each device was connected to LAN, and when it was off (disconnected)

Proposal:

  • for each device have TimeSeries data for last 24h or 7d, which shows when devices was online / offline

That TimeSeries data should be trimmed daily of old data.

Using docker, the host is not founded

Using docker image on my Raspberry with "host" network mode, all devices are founded except the raspberry itself.

I am using "eth0" as interface to scan.

no CSS without internet

Hi,

our internet went offline this morning and i checked all my containers for function without internet.

All of them seemed fine until i came around WatchYourLAN.
The CSS is pulled from the web.
Is there any chance to include them in the containers webserver?

Thanks!

Feature Request: Scan VLAN subnets

Looking for alternative to PiAlert. This looks like much simpler version of it with simillar features. But one is missing that I need so I can capture all my subnets. Arp-scan can also scan VLAN subnets with syntax:

arp-scan --ignoredups --retry=6 10.0.107.0/24 -vlan=107 --interface=eth0

Can this vlan parameter be added as well as option to scan multiple subnets?

Thank you.

Use with reverse proxy?

Hi,

I don't know if this is possible, but does anyone know if I'm able to use WYL with reverse proxy running in docker? I understand that I need to attach this to the host network to use it, and doing so will prevent Traefik from being able to pick it up on the bridge network. Is there any way that anyone knows that I can eat my cake and have it too?

Thank you

Webhook not working ...

Or, I am doing it wrong.

I am trying to webhook into HomeAssistant when a new device is on the network for notification to my phone.

I have fought for days to get the webhook working thinking it was a Home Assistant setup issue.

But, I just tried sending to webhook.site and nothing appears when using the Config|Settings Notification Button.

I am pasting the link into the Shoutrrr URL settings box and pressing the button after saving settings and restarting. Any recommendations?

Feature request : log management / rotate or compress

Hello,

I am running watchyourlan for a while now. It's so handy when you have too many devices running :)
But I just noticed that the logfile of this container is now 1.2Gb large. (running since sept. 19th)
Could there be an option to free some space ? Or can I just wipe the log file without loosing any data ?

Thanks !

Mobile CSS

Hello,

Thanks for the amazing project!

I was wondering if it would be possible to add a Mobile CSS so that is easier to browse WatchYourLan from a smartphone.

Thank you very much

Feature request: track changes by MAC address

Every time a device with the same MAC address is receiving a new ip address through DHCP, it shows up as an unknown entry. A configurable option would be nice which would set the status of new entries having a known MAC address in a different entry to be known.

Even better would be if the MAC address was used as a primary identifier (meaning there would only be one entry per MAC address, not per IP and MAC combination), and clicking on one would show the history of previous IP's and dates.

near "l": syntax error

Hello! I tried running the docker command like this:

docker run --name wyl
-e "IFACE=enp4s0"
-e "TZ=America/Tijuana"
--network="host"
-v /home/jaime/docker/wyl:/data
aceberg/watchyourlan

I created the directory previously.

And for some reason, the moment I run it, gives me a list of devices and shows me this: https://pastebin.com/5Bd5iwLt

At the end the " near "l": syntax error " and the container stops. I don't know what I did wrong. Can you help me? Thanks in advance!

Please support more push notifications!

Great app! really appreciate it.

However i dont personally use shouterrr, i use pushover instead.

Kindly support more notifications ranging from email to telegram/discord.

Or allow custom notification actions using scripts etc.

Thanks!

Apostrophe Not Allowed

Naming a device with an apostrophe in the name causes page to refresh and fail to load/save

Refresh of the page returns the page but name field is empty.

Example: Peter's Device

Add ability to give device custom description

Currently, some device have cryptic have "Hardware" name, such as

  • (Unknown: locally administered)
  • CHONGQING FUGUI ELECTRONICS CO.,LTD.

It would much better, if I can use my own description instead, such as "David's computer".

So, my proposal:

  • Instead of "Hardware", use field "Description"
  • Original value should be generated same way, as it is now - from manufactures DB
  • The field should be editable by user, tied to MAC

Entering and leaving promiscuous mode with every scan

Checking the system logs I noticed a lot of entries where WatchYourLAN container causes eth0 to enter and leave promiscuous mode with every scan, though I have promiscuous mode enabled for eth0 by default.

Here is a sample of what happens when I start the WatchYourLAN container from bottom to top
First I get a msg that eth0: renamed from vethxxxxxxx
Then an error about failing to add inotify watch
Followed by endless entries of eth0 entering and leaving promiscuous mode with every scan

[ 897.568886] device eth0 left promiscuous mode
[ 894.716647] device eth0 entered promiscuous mode
[ 834.382786] device eth0 left promiscuous mode
[ 831.534944] device eth0 entered promiscuous mode
[ 771.234860] device eth0 left promiscuous mode
[ 768.377606] device eth0 entered promiscuous mode
[ 708.058400] device eth0 left promiscuous mode
[ 705.203652] device eth0 entered promiscuous mode
[ 644.888788] device eth0 left promiscuous mode
[ 642.021651] device eth0 entered promiscuous mode
[ 581.619700] device eth0 left promiscuous mode
[ 578.722085] device eth0 entered promiscuous mode
[ 518.361540] device eth0 left promiscuous mode
[ 515.476176] device eth0 entered promiscuous mode
[ 455.013587] device eth0 left promiscuous mode
[ 452.153885] device eth0 entered promiscuous mode
[ 391.714720] device eth0 left promiscuous mode
[ 388.844361] device eth0 entered promiscuous mode
time="2023-08-05T11:08:05.835710358" level=warning msg="error from *cgroupsv2.Manager.EventChan" error="failed to add inotify watch for "/sys/fs/cgroup/system.slice/docker-62be058eefbda8eb3cef63911c4a0f9f4238b4cf35d5e2f038b17a39011c18e2.scope/memory.events": no such file or directory"
[ 388.160864] eth0: renamed from vethdd71689

Design not showing

Hey there,
first of all thanks for the great project.
i´m running into an issue and i can´t get my head around ;-)
using the local docker-compose file but i only see this web-ui:
what am i doing wrong?

version: "3"
services:
  node-bootstrap:
    image: aceberg/node-bootstrap:latest
    restart: unless-stopped
    ports:
    - 8850:8850
  wyl:
    image: aceberg/watchyourlan:latest
    network_mode: "host"      
    restart: unless-stopped
    command: "-n http://127.0.0.1:8850"
    depends_on:
      - node-bootstrap
    volumes:
    - ./data:/data
    environment:
      TZ: Europe/Berlin              # required: needs your TZ for correct time
      IFACE: "ens18"                   # required: 1 or more interface
      DBPATH: "/data/db.sqlite"         # optional, default: /data/db.sqlite
      GUIIP: "0.0.0.0"                  # optional, default: localhost
      GUIPORT: "8840"                   # optional, default: 8840
      TIMEOUT: "120"                    # optional, time in seconds, default: 60
      SHOUTRRR_URL: ""                  # optional, set url to notify
      THEME: "darkly"                   # optional
      IGNOREIP: "no"                    # optional
Screenshot 2023-08-07 at 19 33 41

Feature Request: Export / Import List of Devices

Something as simple as exporting a CSV and being able to import the same CSV would go miles towards migrating to this server from another one (PIAlert for example). The fields could be as simple as Device Name, Device MAC.

Issue deploying

I am deploying with docker via the command line and the config file. Here is my line:
docker run --name watchyourlan \ -e "TZ=Etc/UTC" \ --network="host" \ -v /root/docker/WatchYourLan:/data \ -v /root/docker/WatchYourLan/config:/data/config \ aceberg/watchyourlan
Here is the output from that command:
2023/06/15 14:18:27 ERROR: unable to open database file: out of memory (14) 2023/06/15 14:18:27 INFO: Table created! 2023/06/15 14:18:27 ERROR: db_select: unable to open database file: out of memory (14)

Notification not sending JSON to generic+ to shoutrrr

From my previous issue:

I now have it sending to Home Assistant using generic+URL:port/api/webhook/-WebHookID

But, the payload is not JSON formatted even though it does go with the Content-Type: application/json.

The payload looks like:
UNKNOWN HOST IP: '192.168.0.4', MAC: '18:56:80:c7:dd:1e', Hw: 'Intel Corporate'

And, I believe it needs to be like:
{"Title":"UNKNOWN HOST","IP":"192.168.0.4","MAC":"18:56:80:c7:dd:1e","Hw":"Intel Corporate"}

When I send it this way to Home Assistant using curl, the notification works fine. Using the top payload, Home Assistant throws a JSONDecodeError.

I can't find a way to get Home Assistant to just put out the payload directly. It seems to need it JSON formatted.

Numbered Lines

Hey there,

Thought it would be nice to have numbered lines so you could quickly see how many devices were on the home page and online offline pages. I was able to add it pretty easily using a few lines of javascript and an additional td tag.

I'm super unfamiliar with GitHub (on my long list of things to learn!) but I wanted to give you these changes, it's all within the templates, not sure if it could be merged with the application.

Thanks!
html.zip

Feature Request: Less log output

Does it really need to log message about found IPs that already exist in the database after each scan?
I would say this pollutes log too much.
Perhaps a switch or config variable would be fine

Feature Request: Different Types of notification events

Hi,

as a homelab admin i would like to be able to configure different types of notifications per device, e.g.:

  • device with ip/mac/name XY comes up
  • device with ip/mac/name XY goes down
  • device with ip/mac/name XY is online/offline in a defined time range
  • new unknown device has been found (that's the standard/only notification type which is already implemented, isn't it?)

Kind regards

make the name column editable in the top table

When setting devices as known, it's a little annoying having to scroll down to do it in a separate table.. Would it be possible to just have the name column editable in the top table instead?

Question: Home Assistant addon

First of all thank for creating.

I would like to use this as addon in Home Assistant but I don't have the knowledge.

https://developers.home-assistant.io/docs/add-ons/

I've created a Dockerfile with:
FROM ghcr.io/aceberg/watchyourlan:0.7.5@sha256:867914e2e9595f07dca92f36c7cb9541dcb39bf21aba9ae78dc85c01c55fa381

But I don't know where to store the config

2022/10/23 07:46:19 INFO: DB exists 2022/10/23 07:46:19 =================================== 2022/10/23 07:46:19 Web GUI at http://localhost:8840 2022/10/23 07:46:19 =================================== 2022/10/23 07:46:19 INFO: scanning interface enp1s0 2022/10/23 07:46:19 INFO: found IPs: 2022/10/23 07:47:19 INFO: scanning interface enp1s0 2022/10/23 07:47:19 INFO: found IPs: 2022/10/23 07:48:19 INFO: scanning interface enp1s0

Hope someone could learn me the last part.

Dont work on ARM (raspberrypi)

Hello, my docker runs on a raspberrypi for my localnetwork, i tried to install it but i found that is not working on arm devices :(

Cant reach Web-gui

After installing via portainer, i can't reach localhost:8840 nor via the server's IP 192.168.X.X:8840

Feature Request: Universal notification by just giving ability to feed it a bash script?

Some use gotify, some use ntfy, some use telegram, some use matrix, some use pushbulet, some use signal(me).

I think most of these use just curl. So maybe to either through config and text area. With test button.
Or also bind mount a script with specific name and at specific location..

This might solve some issues with people wanting their kind of notifications?

WSL2 subnet configuration

Hi there. I'm trying this under WSL2 in Windows 10. The iface name under WSL2 is "eth0" but if i scan the "eth0" i get only that subnet. Is there any way to scan the original Windows subnet? Thank you

Feature Request: add password protection to web UI

Thanks for a great tool — really love it. It's fast, simple and does what it's supposed to.

It would be great to have a bit of extra security and have an ability to password-protect the WebUI.

Thanks!

Add device type column

Please consider adding an additional column where the Device Type can be specified.

Here's a list for insparation

Device Types

Mobile

  • Generic
  • Mobile
  • Tablet
  • Portable music player
  • eBook reader
  • Smart Watch
  • Wearable
  • Car

Audio & Video

  • Media Player
  • Television
  • Game console
  • Streaming Dongle
  • Speaker/Amp
  • AV Receiver
  • Cable box
  • Disc player
  • Sattelite
  • Audio Player
  • Remote control
  • Radio
  • Photo camera
  • Photo Display
  • Mic
  • Projector

Home & Office

  • Computer
  • Laptop
  • Desktop
  • Printer
  • IP Phone
  • VoIP Device
  • Conferencing
  • Scanner
  • Point of Sale
  • Clock
  • Barcode scanner

Smart Home

  • IP Camera
  • Smart Device
  • Smart Plug Light
  • Voice Assistant
  • Thermostat
  • Power System
  • Solar Panel Smart Meter
  • HVAC
  • Smart Appliance
  • Smart Washer
  • Smart Fridge
  • Smart Cleaner
  • Sleep Tech Fitness
  • Garage Door
  • Pool
  • Sprinkler
  • Doorbell
  • Smart Lock
  • Sensor
  • Baby Monitor
  • Pet Monitor
  • Alarm
  • Motion Detector
  • Security System
  • Smoke Detector
  • Water Sensor
  • Touch Panel
  • Controller
  • Scale
  • Toy
  • Robot
  • Weather Station
  • Health Monitor

Network

  • Router
  • Wi-Fi
  • Wi-Fi Extender
  • NAS
  • Modem
  • Switch
  • Gateway
  • Firewall
  • VPN
  • PoE Switch
  • USB
  • Small Cell
  • Cloud
  • UPS
  • Network Appliance

Server

  • Virtual Machine
  • Server
  • Terminal
  • Mail Server
  • File Server
  • Proxy Server
  • Domain Server
  • Communication
  • Database
  • Web Server

Engineering

  • Raspberry
  • Arduino
  • Processing Unit
  • Circuit Board
  • RFID Tag

Industrial

  • Industrial Device
  • Medical Device
  • Automotive
  • Energy

The UI does not show the exact current situation

Hi and thanks for this service.

I have a docker container executing WYL.
When starts the container all works fine during a several minutes, but, when the minutes pass and you add devices, they are not reflected in the UI. Not even refreshing. I think it works well internally, but the UI does not correctly show the status of the devices (offline/online) and the new ones detected.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.