416 Commits

Author SHA1 Message Date
Maxi Quoß 14b9e031d5 update deps, migrate pocketbase to ganigeorgiev.com/pocketbase 2026-11-06 21:12:18 +01:00
Jerry 5018b01542 fix: wait for custom wake commands before accepting online status 2026-10-12 00:05:32 +08:00
Maxi Quoß 66ce01cb40 fix: shutdown cron not working when lazy ping is enabled, close #1773 2026-09-19 20:28:22 +02:00
Maxi Quoß 5435d914b3 remove broadcast again
https://github.com/seriousm4x/UpSnap/pull/1760#issuecomment-5720918551
2026-09-18 12:07:15 +02:00
Maxi Quoß 730873a347 goreleaser: build for riscv64 2026-09-18 11:52:38 +02:00
Maxi Quoß 2c244beaaa update deps 2026-09-17 22:25:11 +02:00
lights c5d33fdae8 fix group wake/shutdown for devices in multiple groups (#1771)
* only bulk-mark devices offline on client disconnect when lazy ping is enabled

the OnRealtimeConnectRequest hook re-stamped every shutdown-capable
device as offline whenever the last realtime client disconnected, even
with lazy ping disabled where the ping cron keeps statuses fresh. this
overwrote the records' updated autodate, which the UI surfaces as the
'offline since' time, so a dashboard close looked like every device had
just powered off. the saves were also silent, so the unified /logs page
gave no hint.

- skip the offline transition entirely when lazy ping is disabled
- leave already-offline devices untouched so their offline-since
  timestamp keeps its real meaning
- log an info event when the sweep actually marks devices offline

Fixes #1768

* fix group wake/shutdown for devices in multiple groups

the group handlers filter with groups.id = {:grpId}, which on a
multi-relation field requires every group to match. devices in more
than one group therefore never matched and were skipped by the group
wake and shutdown buttons. use ?= to match on any group.

Fixes #1770
2026-09-17 22:21:38 +02:00
invario b17b09109f feature: Support use of FQDN resolution with DNS and mDNS (#1760)
* feature: Support use of FQDN resolution with DNS and mDNS

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

* - fixed `cronjobs.go` call to `port.Set()`
- refactored lots of the new code and fixed errors
- added validation functions into `validate.go` to handle unicode FQDN and punycode
- fixed memory leak from not closing avahi server connection by establishing permanent connection
- updated regex used in on device form and PB validation pattern to accept international unicode FQDN or IPv4 addresses
- updated regex used for netmask validation on form
- timeout mDNS queries after 2 seconds

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

* fix: remove unintentional change

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

* perform FQDN/IP validation in Svelte instead of HTML form

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

* disable IP tracking if field value does not match regex for IPv4

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

* fix: port state not always saved, don't resolve deviceIP for every port

* send wol packets also to broadcast

* fix: handle lowercase string comparision

---------

Signed-off-by: invario <67800603+invario@users.noreply.github.com>
Co-authored-by: Maxi Quoß <maxi@quoss.org>
2026-09-17 22:15:03 +02:00
Maxi Quoß 0a798d6e94 prevent /api/health requests from being written into logs 2026-09-12 21:19:13 +02:00
Maxi Quoß aee5c8c3c7 improve logging, filter only upsnap logs 2026-09-10 16:46:40 +02:00
Maxi Quoß 7bbe114407 feat: add /logs page, close #1756 2026-09-09 23:50:00 +02:00
Maxi Quoß df7a577db2 remove info
This is just to de-clutter the readme and changelog. I still stand
behind this statement. Nothing changes.
2026-08-27 20:58:29 +02:00
Maxi Quoß d8eafbc123 fix: set device status for lazy ping devices, close #1762 2026-08-27 20:56:16 +02:00
Maxi Quoß 11bdb8ad36 use correct pocketbase app values 2026-08-27 20:28:19 +02:00
Maxi Quoß 9057fa710b update deps 2026-08-27 20:26:47 +02:00
Mike Pastore b5fd864320 feat: optional per-device IP address tracking via periodic ARP scan (#1763)
* feat: optional per-device ip address tracking via periodic arp scan

Adds a per-device "Track IP address" toggle (disabled by default) and a
global cron interval setting. When enabled, upsnap periodically arp-scans
the local subnets of opted-in devices with nmap and updates a device's ip
address whenever its mac address is found at a different one. Subnets are
skipped unless directly attached to the host, so routed devices are never
scanned. Uses the same nmap + CAP_NET_RAW requirements as the existing
network scan feature; no new privileges needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test: cover ip tracking subnet helpers and nmap xml parsing

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor: extract ip tracking into its own package and expand test coverage

Move the arp scan sweep out of cronjobs into a new iptracking package with
two entry points: TrackAllSubnets (the cron sweep) and TrackOneSubnet (a
single validated scan). Device lookup is now by mac address across all
tracked devices, with updates constrained to the device's own subnet.

The scannability check becomes networking.ValidateScannableSubnet, which
reports why a subnet can't be scanned and accepts any subnet overlapping a
directly attached network, so sub-blocks of an attached prefix are now
scannable. The mac-to-ip mapping moves to networking as Nmaprun.MacToIP.

Cover the subnet guard, mac normalization, skip paths, and sweep
orchestration with tests against a stubbed scanner and a real migrated
schema.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat: pause tracking sweeps while nobody is connected

With lazy_ping turned on, the periodic tracking sweep now skips its tick
while no realtime clients are connected, just like the ping cron, and owes
a catch-up sweep to the next client that connects: the realtime connect
hook runs one sweep only when a tick was actually skipped (or none has run
since boot), so page reloads during active use trigger nothing. This
extends lazy_ping's meaning from "pause pings when idle" to "pause
periodic network activity when idle"; the setting's description is updated
accordingly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ui: move lazy ping section below ip tracking in settings

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* disable toggle when tracking is disabled

* fix: load private store

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Maxi Quoß <maxi@quoss.org>
2026-08-27 20:21:51 +02:00
Maxi Quoß 297518f008 fix: only allow valid ipv4 addresses as netmask, close #1761 2026-07-26 12:20:30 +02:00
Maxi Quoß e3c7342932 fix: only allow valid ipv4 addresses as netmask, close #1761 2026-07-26 12:19:58 +02:00
Maxi Quoß 89977debc5 update deps 2026-07-23 19:15:28 +02:00
invario 391b218fe5 fix: ip and mac address regex validation (#1758)
* fix: ip and mac address regex validation

* fix quoting/escaping, add migration file

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

---------

Signed-off-by: invario <67800603+invario@users.noreply.github.com>
2026-07-23 19:07:39 +02:00
invario 3614f3654b Fix: subnet mask check (#1757) 2026-07-23 19:01:04 +02:00
Maxi Quoß c4cf006832 update deps
https://github.com/pocketbase/pocketbase/releases/tag/v0.39.7
2026-07-16 19:38:09 +02:00
Maxi Quoß b2c39ddbb1 update deps 2026-07-03 22:45:21 +02:00
Maxi Quoß 24bdf6776d update deps 2026-06-01 21:57:03 +02:00
Maxi Quoß 92f9e295d5 update deps 2026-05-26 21:08:07 +02:00
Maxi Quoß 74633e7f24 fix: use token based superuser setup
https://github.com/seriousm4x/UpSnap/security/advisories/GHSA-w4jr-728f-5jhq
2026-05-26 20:55:20 +02:00
Maxi Quoß 43f3f65d65 fix: validate ip and mac addresses to prevent RCE
https://github.com/seriousm4x/UpSnap/security/advisories/GHSA-6mc7-6948-w5h4
2026-05-26 19:08:52 +02:00
Maxi Quoß 9494c34598 update deps 2026-05-10 13:22:42 +02:00
Maxi Quoß 6df1205aff update deps 2026-04-27 14:17:06 +02:00
Mohamed Abbas cc605acc83 Added shutdown group (#1732) 2026-04-27 14:15:41 +02:00
Maxi Quoß 65d6e9fa86 update deps 2026-04-01 19:24:57 +02:00
monstercjz 6d53e9e197 fix(cron/wake): fix closure bugs, add reload hooks, and improve command robustness (#1723)
Co-authored-by: Maxi Quoß <maxi@quoss.org>
2026-04-01 19:21:47 +02:00
dependabot[bot] 314d338d08 build(deps): bump golang.org/x/image from 0.37.0 to 0.38.0 in /backend
Bumps [golang.org/x/image](https://github.com/golang/image) from 0.37.0 to 0.38.0.
- [Commits](https://github.com/golang/image/compare/v0.37.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/image
  dependency-version: 0.38.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-30 16:30:08 +00:00
Maxi Quoß 95d722ba56 fix: test udp 2026-03-23 20:54:43 +01:00
invario 59b1723b1c send additional 2 magic packets via IP address for routed WOL (#1718)
Signed-off-by: invario <67800603+invario@users.noreply.github.com>
2026-03-23 20:51:07 +01:00
Maxi Quoß d31a6ef254 update deps 2026-03-19 14:33:47 +01:00
Maxi Quoß c2bf398a69 small fixes 2026-03-19 14:30:54 +01:00
invario 9dac3e982e Add ability for device/network scan when rootless (#1700)
* Add ability for device/network scan when rootless

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

* adjust err msg

---------

Signed-off-by: invario <67800603+invario@users.noreply.github.com>
Co-authored-by: Maxi Quoß <maxi@quoss.org>
2026-03-19 12:26:26 +01:00
invario 48a8c736b2 fix: loop in shutdown code rewritten to work properly (#1695)
* FIX: loop in shutdown code rewritten to work properly

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

* remove unneeded wait()

we already wait in shutdown.go#L52

* cleanup

---------

Signed-off-by: invario <67800603+invario@users.noreply.github.com>
Co-authored-by: Maxi Quoß <maxi@quoss.org>
2026-03-19 12:10:45 +01:00
invario 1d361e3f8b update ping privileged/unprivileged logic (#1586)
* update ping privileged/unprivileged logic, add entrypoint

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

* Removed entrypoint script, code in GO instead to raise NET_RAW cap

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

* Rewritten to only split pingdevice func into separate GO files

Signed-off-by: invario <67800603+invario@users.noreply.github.com>

* remove runtime check

* readme: cap_net_raw=+p

* clear up

* readme: clearify linux only

* set `privileged = false` on darwin

---------

Signed-off-by: invario <67800603+invario@users.noreply.github.com>
Co-authored-by: Maxi Quoß <maxi@quoss.org>
2026-03-19 11:20:46 +01:00
dependabot[bot] c5613a5272 go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.36.6 to 0.36.7.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.36.6...v0.36.7)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-version: 0.36.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-17 09:33:36 +00:00
dependabot[bot] 457a17c259 go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.36.4 to 0.36.6.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.36.4...v0.36.6)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-version: 0.36.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-09 10:16:01 +00:00
dependabot[bot] 190f87d1fa go-dep: bump golang.org/x/sys from 0.41.0 to 0.42.0 in /backend
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.41.0 to 0.42.0.
- [Commits](https://github.com/golang/sys/compare/v0.41.0...v0.42.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-version: 0.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-09 10:14:52 +00:00
dependabot[bot] 20e25201d0 go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.36.3 to 0.36.4.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.36.3...v0.36.4)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-version: 0.36.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 09:32:02 +00:00
dependabot[bot] 288deda98b go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.36.2 to 0.36.3.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.36.2...v0.36.3)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-version: 0.36.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-16 10:21:48 +00:00
Maxi Quoß 9e6c2eb372 update deps 2026-02-13 00:47:48 +01:00
Joshua Higgins 5440ab3b25 fix: allow users with create permissions to scan for devices (#1611)
* fix: allow users with create permissions to scan for devices

* fix: show scan tab in frontend
2026-02-13 00:00:54 +01:00
dependabot[bot] 8ae36d61cc go-dep: bump golang.org/x/sys from 0.40.0 to 0.41.0 in /backend
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.40.0 to 0.41.0.
- [Commits](https://github.com/golang/sys/compare/v0.40.0...v0.41.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-version: 0.41.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-12 09:35:30 +00:00
dependabot[bot] 16d4b8ecb7 go-dep: bump github.com/prometheus-community/pro-bing in /backend
Bumps [github.com/prometheus-community/pro-bing](https://github.com/prometheus-community/pro-bing) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/prometheus-community/pro-bing/releases)
- [Commits](https://github.com/prometheus-community/pro-bing/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus-community/pro-bing
  dependency-version: 0.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-12 09:34:16 +00:00
dependabot[bot] 8dcb32f8cd go-dep: bump github.com/pocketbase/dbx from 1.11.0 to 1.12.0 in /backend
Bumps [github.com/pocketbase/dbx](https://github.com/pocketbase/dbx) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/pocketbase/dbx/releases)
- [Commits](https://github.com/pocketbase/dbx/compare/v1.11.0...v1.12.0)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/dbx
  dependency-version: 1.12.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-12 09:32:30 +00:00