You've already forked focalboard
mirror of
https://github.com/mattermost/focalboard.git
synced 2025-07-15 23:54:29 +02:00
linux: find server executable relative to app
this enables having config.json in a different dir than the executables
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
@ -13,9 +14,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var sessionToken string = "su-" + uuid.New().String()
|
var sessionToken string = "su-" + uuid.New().String()
|
||||||
|
var serverExecutable string = filepath.Join(filepath.Dir(os.Executable()), "focalboard-server")
|
||||||
|
|
||||||
func runServer(ctx context.Context) {
|
func runServer(ctx context.Context) {
|
||||||
cmd := exec.CommandContext(ctx, "./focalboard-server", "--monitorpid", strconv.FormatInt(int64(os.Getpid()), 10), "-single-user")
|
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.Env = []string{fmt.Sprintf("FOCALBOARD_SINGLE_USER_TOKEN=%s", sessionToken)}
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
|
Reference in New Issue
Block a user