mirror of
https://github.com/mattermost/focalboard.git
synced 2025-02-01 19:14:35 +02:00
[GH 483] Linux-app: discover executable folder and use it in config instead of ./ (#1613)
* Discover executable folder and use it in config instead of ./ * Use camel case.
This commit is contained in:
parent
14cb523f8f
commit
9335166836
@ -4,7 +4,10 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@ -34,16 +37,19 @@ func getFreePort() (int, error) {
|
||||
func runServer(port int) (*server.Server, error) {
|
||||
logger, _ := mlog.NewLogger()
|
||||
|
||||
executable, _ := os.Executable()
|
||||
executableDir, _ := filepath.EvalSymlinks(filepath.Dir(executable))
|
||||
|
||||
config := &config.Configuration{
|
||||
ServerRoot: fmt.Sprintf("http://localhost:%d", port),
|
||||
Port: port,
|
||||
DBType: "sqlite3",
|
||||
DBConfigString: "./focalboard.db",
|
||||
DBConfigString: path.Join(executableDir, "focalboard.db"),
|
||||
UseSSL: false,
|
||||
SecureCookie: true,
|
||||
WebPath: "./pack",
|
||||
WebPath: path.Join(executableDir, "pack"),
|
||||
FilesDriver: "local",
|
||||
FilesPath: "./focalboard_files",
|
||||
FilesPath: path.Join(executableDir, "focalboard_files"),
|
||||
Telemetry: true,
|
||||
WebhookUpdate: []string{},
|
||||
SessionExpireTime: 259200000000,
|
||||
|
Loading…
x
Reference in New Issue
Block a user