Skip to content

Commit

Permalink
Fix linux app compile
Browse files Browse the repository at this point in the history
  • Loading branch information
chenilim committed Apr 13, 2021
1 parent bc5787f commit 13e0884
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions linux/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@ import (
)

var sessionToken string = "su-" + uuid.New().String()
var serverExecutable string = filepath.Join(filepath.Dir(os.Executable()), "focalboard-server")

func runServer(ctx context.Context) {
executable, err := os.Executable()
if err != nil {
log.Println("Failed to get os.Executable()")
log.Fatal(err)
}

serverExecutable := filepath.Join(filepath.Dir(executable), "focalboard-server")

cmd := exec.CommandContext(ctx, serverExecutable, "--monitorpid", strconv.FormatInt(int64(os.Getpid()), 10), "-single-user")
cmd.Env = []string{fmt.Sprintf("FOCALBOARD_SINGLE_USER_TOKEN=%s", sessionToken)}
cmd.Stdout = os.Stdout
err := cmd.Run()
err = cmd.Run()
if err != nil {
log.Println("Failed to start server")
log.Fatal(err)
Expand Down

0 comments on commit 13e0884

Please sign in to comment.