You've already forked focalboard
mirror of
https://github.com/mattermost/focalboard.git
synced 2025-07-15 23:54:29 +02:00
Linux app: set single-user token
This commit is contained in:
@ -2,16 +2,20 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/webview/webview"
|
||||
)
|
||||
|
||||
var sessionToken string = "su-" + uuid.New().String()
|
||||
|
||||
func runServer(ctx context.Context) {
|
||||
cmd := exec.CommandContext(ctx, "./focalboard-server", "--monitorpid", strconv.FormatInt(int64(os.Getpid()), 10), "--single-user")
|
||||
cmd := exec.CommandContext(ctx, "./focalboard-server", "--monitorpid", strconv.FormatInt(int64(os.Getpid()), 10), "-single-user", sessionToken)
|
||||
cmd.Stdout = os.Stdout
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
@ -29,6 +33,10 @@ func main() {
|
||||
|
||||
w.SetTitle("Focalboard")
|
||||
w.SetSize(1024, 768, webview.HintNone)
|
||||
|
||||
script := fmt.Sprintf("localStorage.setItem('sessionId', '%s');", sessionToken)
|
||||
w.Init(script)
|
||||
|
||||
w.Navigate("http://localhost:8088")
|
||||
w.Run()
|
||||
cancel()
|
||||
|
Reference in New Issue
Block a user