update readme with auth #42 #55

This commit is contained in:
Maxi Quoß
2023-03-05 07:11:54 +01:00
parent 5ed25bb06b
commit 12689b19f9
5 changed files with 34 additions and 5 deletions

View File

@@ -20,6 +20,7 @@
- Set timed wake and shutdown events via cron
- Add custom ports to devices which will be pinged
- Discover devices by scanning network
- User/Password protected login
- Dark/light or system prefered color scheme
- [Docker images](https://github.com/seriousm4x/UpSnap/pkgs/container/upsnap) for amd64, arm64, arm/v7
@@ -27,6 +28,7 @@
| Dark | Light |
| ------------------------------ | ------------------------------- |
| ![](/assets/login_dark.png) | ![](/assets/login_light.png) |
| ![](/assets/home_dark.png) | ![](/assets/home_light.png) |
| ![](/assets/device_dark.png) | ![](/assets/device_light.png) |
| ![](/assets/settings_dark.png) | ![](/assets/settings_light.png) |
@@ -70,6 +72,36 @@ upsnap.example.com {
}
```
## 🔒 Authentification
**Since version 3.1 authentification is enabled by default.**
User management is done through the PocketBase webinterface at [http://localhost:8090/\_/](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 authentification, 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.

BIN
assets/login_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
assets/login_light.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View File

@@ -12,6 +12,7 @@ services:
# - UPSNAP_INTERVAL=@every 10s # Sets the interval in which the devices are pinged
# - UPSNAP_SCAN_RANGE=192.168.1.0/24 # Scan range is used for device discovery on local network
# - UPSNAP_WEBSITE_TITLE=Custom name # Custom website title
# - UPSNAP_WELCOME_MESSAGE="Welcome to my wake on lan dashboard" # Show this message on the login form
# you can change the listen ip:port inside the container like this:
# entrypoint: /bin/sh -c "./upsnap serve --http 0.0.0.0:5000"
# healthcheck:

View File

@@ -2,11 +2,7 @@ import { writable } from 'svelte/store';
import PocketBase from 'pocketbase';
// set backend url based on environment
let backend_url = '/';
let isDevMode = import.meta.env.DEV;
if (isDevMode) {
backend_url = 'http://127.0.0.1:8090';
}
let backend_url = import.meta.env.DEV ? 'http://127.0.0.1:8090' : '/';
// get default values for stores
const pb = new PocketBase(backend_url);