1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-02-19 19:59:59 +02:00

Fix #312. Release 0.6.6 (#313)

* 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:
Chen-I Lim 2021-04-21 18:25:26 -07:00 committed by GitHub
parent e61ba4a7a8
commit 4a5d7c4a64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 8 deletions

View File

@ -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
}

View File

@ -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();