Merge pull request #226 from ziprandom/server-executable-relative-to-webapp

linux: find server executable relative to app
This commit is contained in:
Jesús Espino 2021-04-06 12:03:53 +02:00 committed by GitHub
commit a73070e682
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,7 @@ import (
"log"
"os"
"os/exec"
"path/filepath"
"strconv"
"github.com/google/uuid"
@ -13,9 +14,10 @@ import (
)
var sessionToken string = "su-" + uuid.New().String()
var serverExecutable string = filepath.Join(filepath.Dir(os.Executable()), "focalboard-server")
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.Stdout = os.Stdout
err := cmd.Run()