• Stars
    star
    1,562
  • Rank 29,019 (Top 0.6 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple wake on lan web app written with SvelteKit, Go and PocketBase.

UpSnap

A simple wake on lan web app written with SvelteKit, Go, PocketBase and nmap.

✨ Features

  • Dashboard to wake up devices with one click
  • Set timed wake and shutdown events via cron
  • Add custom ports to devices which will be pinged
  • Discover devices by scanning network
  • User/Password or OIDC protected login
  • Dark/light or system prefered color scheme
  • Docker images for amd64, arm64, arm/v7, arm/v6

πŸ“Έ Screenshots

Dark Light

πŸš€ Run the binary

Just download the latest binary from the release page and run it ./upsnap serve --http=0.0.0.0:8090.

For more options check ./upsnap --help or visit PocketBase documentation.

If you need network discovery, make sure to have nmap installed and run upsnap as root/admin.

🐳 Run in docker

You can use the docker-compose example. See the comments in the file for customization.

If you want to change the port, change the following (5000 in this case):

entrypoint: /bin/sh -c "./upsnap serve --http 0.0.0.0:5000"
healthcheck:
    test: curl -fs "http://localhost:5000/api/health" || exit 1
    interval: 10s

And if you need additional packages inside the container, do this:

entrypoint: /bin/sh -c "apk update && apk add --no-cache <YOUR_PACKAGE> && rm -rf /var/cache/apk/* && ./upsnap serve --http 0.0.0.0:8090"

You can search for your needed package here.

Reverse Proxy

Caddy example

upsnap.example.com {
    reverse_proxy localhost:8090
}

πŸ”’ Authorisation

Since version 3.1 authorisation is enabled by default.

User management is done through the PocketBase webinterface at http://localhost:8090/_/. This is mainly for internal use, such as within a home or corporate network. For external use please see below.

  • To manage users, click the "Collections" icon on the left and select "users".
  • To manage admins, click the "Settings" icon on the left and select "Admin".

Api permissions listed by user role:

Api Unauthorized Users Admins
List/Search Rule ❌ βœ… βœ…
View Rule ❌ βœ… βœ…
Create Rule ❌ ❌ βœ…
Delete Rule ❌ ❌ βœ…
Manage Rule ❌ ❌ βœ…
Wake devices ❌ βœ… βœ…
Shutdown devices ❌ βœ… βœ…
Scan network ❌ ❌ βœ…

🌍 Exposing to the open web

Although UpSnap has user authorisation, it is not recommended to expose it to the open web and make it accessible by everyone!

Reason: The shutdown device command is basically a command piped to #sh (root if you run docker). If anyone gains unauthorized access and can abuse this api route in any way, the attacker has access to a (root) shell on your local network.

Recommended: If you need access from outside your network, please use a vpn. Wireguard or OpenVPN is your way to go.

πŸ”§ Help developing

Fork this branch and clone it.

  1. Start backend
cd backend
go mod tidy
go run main.go serve
  1. Start frontend
cd frontend
pnpm i
pnpm run dev

Open up http://localhost:5173/, create an admin user and add some devices.

🌟 Star History

Star History Chart