mirror of
https://github.com/mattermost/focalboard.git
synced 2025-02-19 19:59:59 +02:00
* Fixed #269 * Fixing checkbox widht * Fix #274. Add re-login button to error page. * Fix #276. Login page title * Rev Mac build version * Update changelog for v0.6.5 * Rev Mac build number * GitHub Actions: Build with Xcode 12.4 * Fix #297: Mac keybpard handling * Rev Mac built to 12 * Update to v0.6.6 * Fix #312. Windows app images * Move db and files to Documents\Focalboard on standalone Win app * Make Win app fixupp code more robust Co-authored-by: Jesús Espino <jespinog@gmail.com>
This commit is contained in:
parent
e61ba4a7a8
commit
4a5d7c4a64
@ -159,9 +159,10 @@ func main() {
|
||||
|
||||
// StartServer starts the server
|
||||
//export StartServer
|
||||
func StartServer(webPath *C.char, port int, singleUserToken, dbConfigString *C.char) {
|
||||
func StartServer(webPath *C.char, filesPath *C.char, port int, singleUserToken, dbConfigString *C.char) {
|
||||
startServer(
|
||||
C.GoString(webPath),
|
||||
C.GoString(filesPath),
|
||||
port,
|
||||
C.GoString(singleUserToken),
|
||||
C.GoString(dbConfigString),
|
||||
@ -174,7 +175,7 @@ func StopServer() {
|
||||
stopServer()
|
||||
}
|
||||
|
||||
func startServer(webPath string, port int, singleUserToken, dbConfigString string) {
|
||||
func startServer(webPath string, filesPath string, port int, singleUserToken, dbConfigString string) {
|
||||
logInfo()
|
||||
|
||||
if pServer != nil {
|
||||
@ -189,6 +190,10 @@ func startServer(webPath string, port int, singleUserToken, dbConfigString strin
|
||||
return
|
||||
}
|
||||
|
||||
if len(filesPath) > 0 {
|
||||
config.FilesPath = filesPath
|
||||
}
|
||||
|
||||
if len(webPath) > 0 {
|
||||
config.WebPath = webPath
|
||||
}
|
||||
|
@ -83,25 +83,40 @@ namespace Focalboard {
|
||||
var appFolder = Utils.GetAppFolder();
|
||||
Directory.SetCurrentDirectory(appFolder);
|
||||
|
||||
string tempFolder;
|
||||
string appDataFolder;
|
||||
try {
|
||||
tempFolder = ApplicationData.Current.LocalFolder.Path;
|
||||
appDataFolder = ApplicationData.Current.LocalFolder.Path;
|
||||
} catch {
|
||||
var documentsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||
tempFolder = documentsFolder;
|
||||
appDataFolder = Path.Combine(documentsFolder, "Focalboard");
|
||||
Directory.CreateDirectory(appDataFolder);
|
||||
// Not a UWP app, store in Documents
|
||||
|
||||
// FIXUP code: Copy from old DB location
|
||||
var oldDBPath = Path.Combine(documentsFolder, "focalboard.db");
|
||||
var newDBPath = Path.Combine(appDataFolder, "focalboard.db");
|
||||
if (!File.Exists(newDBPath) && File.Exists(oldDBPath)) {
|
||||
Debug.WriteLine($"Moving DB file from: {oldDBPath} to {newDBPath}");
|
||||
File.Move(oldDBPath, newDBPath);
|
||||
}
|
||||
}
|
||||
var dbPath = Path.Combine(tempFolder, "focalboard.db");
|
||||
|
||||
var dbPath = Path.Combine(appDataFolder, "focalboard.db");
|
||||
Debug.WriteLine($"dbPath: {dbPath}");
|
||||
|
||||
var filesPath = Path.Combine(appDataFolder, "files");
|
||||
Debug.WriteLine($"filesPath: {filesPath}");
|
||||
|
||||
var cwd = Directory.GetCurrentDirectory();
|
||||
var webFolder = Path.Combine(cwd, @"pack");
|
||||
webFolder = webFolder.Replace(@"\", @"/");
|
||||
filesPath = filesPath.Replace(@"\", @"/");
|
||||
dbPath = dbPath.Replace(@"\", @"/");
|
||||
byte[] webFolderBytes = Encoding.UTF8.GetBytes(webFolder);
|
||||
byte[] filesPathBytes = Encoding.UTF8.GetBytes(filesPath);
|
||||
byte[] sessionTokenBytes = Encoding.UTF8.GetBytes(sessionToken);
|
||||
byte[] dbPathBytes = Encoding.UTF8.GetBytes(dbPath);
|
||||
GoFunctions.StartServer(webFolderBytes, port, sessionTokenBytes, dbPathBytes);
|
||||
GoFunctions.StartServer(webFolderBytes, filesPathBytes, port, sessionTokenBytes, dbPathBytes);
|
||||
|
||||
Debug.WriteLine("Server started");
|
||||
}
|
||||
@ -133,7 +148,7 @@ namespace Focalboard {
|
||||
|
||||
static class GoFunctions {
|
||||
[DllImport(@"focalboard-server.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern void StartServer(byte[] webPath, int port, byte[] singleUserToken, byte[] dbConfigString);
|
||||
public static extern void StartServer(byte[] webPath, byte[] filesPath, int port, byte[] singleUserToken, byte[] dbConfigString);
|
||||
|
||||
[DllImport(@"focalboard-server.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern void StopServer();
|
||||
|
Loading…
x
Reference in New Issue
Block a user