implement auth and a simple admin-follows whitelist
Some checks failed
Go / build (push) Has been cancelled

This commit is contained in:
2025-09-07 19:08:29 +01:00
parent f5a8c094e4
commit 5edb7a3b09
27 changed files with 458 additions and 117 deletions

View File

@@ -2,10 +2,12 @@ package app
import (
"context"
"crypto/rand"
"net/http"
"strings"
"time"
"encoders.orly/hex"
"github.com/coder/websocket"
"lol.mleku.dev/chk"
"lol.mleku.dev/log"
@@ -63,7 +65,11 @@ whitelist:
Server: s,
conn: conn,
remote: remote,
req: r,
}
chal := make([]byte, 32)
rand.Read(chal)
listener.challenge.Store([]byte(hex.Enc(chal)))
ticker := time.NewTicker(DefaultPingWait)
go s.Pinger(ctx, conn, ticker, cancel)
defer func() {