mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-11-29 13:14:12 +00:00
Compare commits
7 Commits
3.1.0-beta.1
...
3.1.3
| Author | SHA1 | Date | |
|---|---|---|---|
| 327b47c2a1 | |||
| d7c4a922e2 | |||
| 8c4c402c2c | |||
| 9351889337 | |||
| 327ac67e33 | |||
| 2764ed6ac5 | |||
| c519084e78 |
+1
-1
@@ -12,7 +12,7 @@ RUN wget https://github.com/seriousm4x/UpSnap/releases/download/${VERSION}/UpSna
|
||||
|
||||
FROM alpine:3
|
||||
RUN apk update &&\
|
||||
apk add --no-cache tzdata ca-certificates nmap samba-common-tools openssh sshpass curl &&\
|
||||
apk add --no-cache tzdata ca-certificates nmap samba samba-common-tools openssh sshpass curl &&\
|
||||
rm -rf /var/cache/apk/*
|
||||
WORKDIR /app
|
||||
COPY --from=downloader /app/upsnap upsnap
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/releases"><img src="https://img.shields.io/github/v/release/seriousm4x/upsnap?display_name=tag" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/actions"><img src="https://github.com/seriousm4x/upsnap/actions/workflows/deploy.yml/badge.svg?event=push" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/commits/master"><img src="https://img.shields.io/github/last-commit/seriousm4x/upsnap" /></a>
|
||||
<h3><a href="https://github.com/seriousm4x/UpSnap/releases/tag/3.0.0">v3 is here! 🤩 Check it out</a></h3>
|
||||
</div>
|
||||
|
||||
## ✨ Features
|
||||
@@ -43,7 +42,7 @@ If you need network discovery, make sure to have `nmap` installed and run upsnap
|
||||
|
||||
## 🐳 Run in docker
|
||||
|
||||
Alternatively use the [docker-compose](docker-compose.yml) example. See the comments in the file for customization.
|
||||
You can use the [docker-compose](docker-compose.yml) example. See the comments in the file for customization.
|
||||
|
||||
If you want to change the port, change the following (5000 in this case):
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 72 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 71 KiB |
@@ -12,7 +12,6 @@ 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:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
import { goto } from '$app/navigation';
|
||||
import { pocketbase, authorizedStore } from '@stores/pocketbase';
|
||||
|
||||
let username;
|
||||
@@ -10,7 +9,6 @@
|
||||
title: '',
|
||||
msg: ''
|
||||
};
|
||||
const welcomeMsg = import.meta.env?.UPSNAP_WELCOME_MESSAGE || '';
|
||||
|
||||
async function login() {
|
||||
if (isAdmin) {
|
||||
@@ -51,10 +49,6 @@
|
||||
</div>
|
||||
<div class="row justify-content-center align-items-center p-2">
|
||||
<div class="col-md-6 col-lg-5 p-4 login rounded-5 shadow-sm">
|
||||
{#if welcomeMsg !== ''}
|
||||
<h5 class="text-center fw-bold">{welcomeMsg}</h5>
|
||||
<hr />
|
||||
{/if}
|
||||
<form class="w-100" on:submit|preventDefault={login}>
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Username or email address</label>
|
||||
@@ -96,11 +90,7 @@
|
||||
</form>
|
||||
<p class="text-center m-0 mt-3">
|
||||
<!-- hacky way of linking a non existing route in svelte -->
|
||||
<span
|
||||
on:click={() => goto('/_/')}
|
||||
on:keydown={() => goto('/_/')}
|
||||
class="text-muted cursor-pointer">Manage users</span
|
||||
>
|
||||
<a href="/_/" rel="external" class="text-muted cursor-pointer">Manage users</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
let preferesDark;
|
||||
let isAuth = false;
|
||||
|
||||
onMount(() => {
|
||||
onMount(async () => {
|
||||
// import bootstrap js
|
||||
import('bootstrap/js/dist/dropdown');
|
||||
import('bootstrap/js/dist/collapse');
|
||||
@@ -38,9 +38,19 @@
|
||||
isAuth = state;
|
||||
});
|
||||
|
||||
// load auth from localstorage
|
||||
const pbCookie = localStorage.getItem('pocketbase_auth');
|
||||
if (pbCookie) {
|
||||
$pocketbase.authStore.loadFromCookie('pb_auth=' + pbCookie);
|
||||
|
||||
// try to refresh auth token if valid
|
||||
if ($pocketbase.authStore.isValid) {
|
||||
if ($pocketbase.authStore.model?.collectionName === 'users') {
|
||||
await $pocketbase.collection('users').authRefresh();
|
||||
} else {
|
||||
await $pocketbase.admins.authRefresh();
|
||||
}
|
||||
}
|
||||
authorizedStore.set($pocketbase.authStore.isValid);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -81,7 +81,11 @@
|
||||
buttons.scan.state = 'failed';
|
||||
});
|
||||
|
||||
fetch(`${dev ? 'http://localhost:8090' : ''}/api/upsnap/scan`)
|
||||
fetch(`${dev ? 'http://localhost:8090' : ''}/api/upsnap/scan`, {
|
||||
headers: {
|
||||
Authorization: $pocketbase.authStore.baseToken
|
||||
}
|
||||
})
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
if (data.message) {
|
||||
|
||||
Reference in New Issue
Block a user