├── .gitignore ├── LICENSE ├── LoFloccus ├── Info.plist ├── LoFloccus.pro ├── LoFloccus.pro.user ├── assets │ ├── icon.icns │ ├── icon.ico │ └── logo.png ├── libs │ ├── libLoFloccusDav.go │ ├── libLoFloccusDavDarwin.a │ ├── libLoFloccusDavDarwin.h │ ├── libLoFloccusDavWin64.a │ └── libLoFloccusDavWin64.h ├── lofloccus.cpp ├── lofloccus.h ├── lofloccus.ui ├── main.cpp ├── platformdarwin.h ├── platformdarwin.mm └── resources.qrc ├── README.md ├── generate-icns-from-svg.sh └── icon.svg /.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | *.dat 3 | *.dir 4 | .idea 5 | deploy 6 | windows 7 | deploy 8 | rcc* 9 | *.syso 10 | *.ini 11 | 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) TCB13 (Tadeu Bento) 2019 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LoFloccus/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleExecutable 6 | @EXECUTABLE@ 7 | CFBundleShortVersionString 8 | @SHORT_VERSION@ 9 | CFBundleVersion 10 | @FULL_VERSION@ 11 | CFBundleIconFile 12 | icon.icns 13 | CFBundleIdentifier 14 | @BUNDLEIDENTIFIER@ 15 | NSHumanReadableCopyright 16 | Copyright © 2019-2022 TCB13 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | LSMinimumSystemVersion 22 | 10.12 23 | NSPrincipalClass 24 | NSApplication 25 | NSSupportsAutomaticGraphicsSwitching 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /LoFloccus/LoFloccus.pro: -------------------------------------------------------------------------------- 1 | QT += core gui network 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++11 6 | 7 | # The following define makes your compiler emit warnings if you use 8 | # any Qt feature that has been marked deprecated (the exact warnings 9 | # depend on your compiler). Please consult the documentation of the 10 | # deprecated API in order to know how to port your code away from it. 11 | DEFINES += QT_DEPRECATED_WARNINGS 12 | 13 | # You can also make your code fail to compile if it uses deprecated APIs. 14 | # In order to do so, uncomment the following line. 15 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 16 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 17 | 18 | SOURCES += \ 19 | main.cpp \ 20 | lofloccus.cpp 21 | 22 | HEADERS += \ 23 | lofloccus.h 24 | 25 | FORMS += \ 26 | lofloccus.ui 27 | 28 | # Generic for all builds 29 | VERSION = 1.2.4 30 | DEFINES += APP_VERSION=\\\"$$VERSION\\\" 31 | INCLUDEPATH += $${PWD}/libs 32 | 33 | # Windows Build 34 | win32 { 35 | RC_ICONS = assets/icon.ico 36 | QMAKE_TARGET_PRODUCT = LoFloccus 37 | QMAKE_TARGET_DESCRIPTION = LoFloccus 38 | QMAKE_TARGET_COPYRIGHT = Copyright © 2019-2022 TCB13 39 | LIBS += -L$${PWD}/libs -lLoFloccusDavWin64 40 | } 41 | 42 | # macOS Build 43 | mac { 44 | ICON = assets/icon.icns 45 | QMAKE_TARGET_BUNDLE_PREFIX = "com.tcb13" 46 | QMAKE_INFO_PLIST = Info.plist 47 | LIBS += -L$${PWD}/libs -lLoFloccusDavDarwin 48 | SOURCES += platformdarwin.mm 49 | HEADERS += platformdarwin.h 50 | LIBS += -framework Foundation 51 | LIBS += -framework AppKit 52 | } 53 | 54 | 55 | # Default rules for deployment. 56 | qnx: target.path = /tmp/$${TARGET}/bin 57 | else: unix:!android: target.path = /opt/$${TARGET}/bin 58 | !isEmpty(target.path): INSTALLS += target 59 | 60 | DISTFILES += 61 | 62 | RESOURCES += \ 63 | resources.qrc 64 | 65 | # Static Builds 66 | QTPREFIX=$$[QT_INSTALL_PREFIX] 67 | equals(QTPREFIX, "C:/Qt-Static/Qt-5.14.2") || equals(QTPREFIX, "/Users/tcb13/Qt-Static/Qt-5.12.12") { 68 | message("--STATIC BUILD--") 69 | CONFIG += qt static 70 | win32 { 71 | QMAKE_LFLAGS += -static-libgcc -static-libstdc++ 72 | } 73 | 74 | } else { 75 | message("--NON-STATIC BUILD--") 76 | } 77 | -------------------------------------------------------------------------------- /LoFloccus/LoFloccus.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {99ba8855-f117-4381-b2f4-4f86b3f0cc3a} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | -fno-delayed-template-parsing 60 | 61 | true 62 | 63 | 64 | 65 | ProjectExplorer.Project.Target.0 66 | 67 | Desktop Static 68 | Desktop Static 69 | {6ade0079-14a6-434a-872a-bd67ebf6cbea} 70 | 1 71 | 0 72 | 0 73 | 74 | C:/Users/Tadeu Bento/Projetos/LoFloccus/build-LoFloccus-Desktop_Static-Debug 75 | 76 | 77 | true 78 | QtProjectManager.QMakeBuildStep 79 | true 80 | 81 | false 82 | false 83 | false 84 | 85 | 86 | true 87 | Qt4ProjectManager.MakeStep 88 | 89 | false 90 | 91 | 92 | false 93 | 94 | 2 95 | Build 96 | Build 97 | ProjectExplorer.BuildSteps.Build 98 | 99 | 100 | 101 | true 102 | Qt4ProjectManager.MakeStep 103 | 104 | true 105 | clean 106 | 107 | false 108 | 109 | 1 110 | Clean 111 | Clean 112 | ProjectExplorer.BuildSteps.Clean 113 | 114 | 2 115 | false 116 | 117 | Debug 118 | Qt4ProjectManager.Qt4BuildConfiguration 119 | 2 120 | 121 | 122 | C:/Users/Tadeu Bento/Projetos/LoFloccus/build-LoFloccus-Desktop_Static-Release 123 | 124 | 125 | true 126 | QtProjectManager.QMakeBuildStep 127 | false 128 | 129 | false 130 | false 131 | false 132 | 133 | 134 | true 135 | Qt4ProjectManager.MakeStep 136 | 137 | false 138 | 139 | 140 | false 141 | 142 | 2 143 | Build 144 | Build 145 | ProjectExplorer.BuildSteps.Build 146 | 147 | 148 | 149 | true 150 | Qt4ProjectManager.MakeStep 151 | 152 | true 153 | clean 154 | 155 | false 156 | 157 | 1 158 | Clean 159 | Clean 160 | ProjectExplorer.BuildSteps.Clean 161 | 162 | 2 163 | false 164 | 165 | Release 166 | Qt4ProjectManager.Qt4BuildConfiguration 167 | 0 168 | 169 | 170 | C:/Users/Tadeu Bento/Projetos/LoFloccus/build-LoFloccus-Desktop_Static-Profile 171 | 172 | 173 | true 174 | QtProjectManager.QMakeBuildStep 175 | true 176 | 177 | false 178 | true 179 | false 180 | 181 | 182 | true 183 | Qt4ProjectManager.MakeStep 184 | 185 | false 186 | 187 | 188 | false 189 | 190 | 2 191 | Build 192 | Build 193 | ProjectExplorer.BuildSteps.Build 194 | 195 | 196 | 197 | true 198 | Qt4ProjectManager.MakeStep 199 | 200 | true 201 | clean 202 | 203 | false 204 | 205 | 1 206 | Clean 207 | Clean 208 | ProjectExplorer.BuildSteps.Clean 209 | 210 | 2 211 | false 212 | 213 | Profile 214 | Qt4ProjectManager.Qt4BuildConfiguration 215 | 0 216 | 217 | 3 218 | 219 | 220 | 0 221 | Deploy 222 | Deploy 223 | ProjectExplorer.BuildSteps.Deploy 224 | 225 | 1 226 | ProjectExplorer.DefaultDeployConfiguration 227 | 228 | 1 229 | 230 | 231 | dwarf 232 | 233 | cpu-cycles 234 | 235 | 236 | 250 237 | 238 | -e 239 | cpu-cycles 240 | --call-graph 241 | dwarf,4096 242 | -F 243 | 250 244 | 245 | -F 246 | true 247 | 4096 248 | false 249 | false 250 | 1000 251 | 252 | true 253 | 254 | false 255 | false 256 | false 257 | false 258 | true 259 | 0.01 260 | 10 261 | true 262 | kcachegrind 263 | 1 264 | 25 265 | 266 | 1 267 | true 268 | false 269 | true 270 | valgrind 271 | 272 | 0 273 | 1 274 | 2 275 | 3 276 | 4 277 | 5 278 | 6 279 | 7 280 | 8 281 | 9 282 | 10 283 | 11 284 | 12 285 | 13 286 | 14 287 | 288 | 2 289 | 290 | LoFloccus2 291 | Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Tadeu Bento/Source/GitHub/LoFloccus/LoFloccus/LoFloccus.pro 292 | C:/Users/Tadeu Bento/Source/GitHub/LoFloccus/LoFloccus/LoFloccus.pro 293 | 294 | false 295 | 296 | false 297 | true 298 | true 299 | false 300 | false 301 | true 302 | 303 | C:/Users/Tadeu Bento/Projetos/LoFloccus/build-LoFloccus-Desktop_Static-Release 304 | 305 | 1 306 | 307 | 308 | 309 | ProjectExplorer.Project.Target.1 310 | 311 | Desktop Qt 5.14.2 MinGW 64-bit 312 | Desktop Qt 5.14.2 MinGW 64-bit 313 | qt.qt5.5142.win64_mingw73_kit 314 | 1 315 | 0 316 | 0 317 | 318 | C:/Users/Tadeu Bento/Projetos/LoFloccus/build-LoFloccus-Desktop_Qt_5_14_2_MinGW_64_bit-Debug 319 | 320 | 321 | true 322 | QtProjectManager.QMakeBuildStep 323 | true 324 | 325 | false 326 | false 327 | false 328 | 329 | 330 | true 331 | Qt4ProjectManager.MakeStep 332 | 333 | false 334 | 335 | 336 | false 337 | 338 | 2 339 | Build 340 | Build 341 | ProjectExplorer.BuildSteps.Build 342 | 343 | 344 | 345 | true 346 | Qt4ProjectManager.MakeStep 347 | 348 | true 349 | clean 350 | 351 | false 352 | 353 | 1 354 | Clean 355 | Clean 356 | ProjectExplorer.BuildSteps.Clean 357 | 358 | 2 359 | false 360 | 361 | Debug 362 | Qt4ProjectManager.Qt4BuildConfiguration 363 | 2 364 | 365 | 366 | C:/Users/Tadeu Bento/Projetos/LoFloccus/build-LoFloccus-Desktop_Qt_5_14_2_MinGW_64_bit-Release 367 | 368 | 369 | true 370 | QtProjectManager.QMakeBuildStep 371 | false 372 | 373 | false 374 | false 375 | true 376 | 377 | 378 | true 379 | Qt4ProjectManager.MakeStep 380 | 381 | false 382 | 383 | 384 | false 385 | 386 | 2 387 | Build 388 | Build 389 | ProjectExplorer.BuildSteps.Build 390 | 391 | 392 | 393 | true 394 | Qt4ProjectManager.MakeStep 395 | 396 | true 397 | clean 398 | 399 | false 400 | 401 | 1 402 | Clean 403 | Clean 404 | ProjectExplorer.BuildSteps.Clean 405 | 406 | 2 407 | false 408 | 409 | Release 410 | Qt4ProjectManager.Qt4BuildConfiguration 411 | 0 412 | 413 | 414 | C:/Users/Tadeu Bento/Projetos/LoFloccus/build-LoFloccus-Desktop_Qt_5_14_2_MinGW_64_bit-Profile 415 | 416 | 417 | true 418 | QtProjectManager.QMakeBuildStep 419 | true 420 | 421 | false 422 | true 423 | true 424 | 425 | 426 | true 427 | Qt4ProjectManager.MakeStep 428 | 429 | false 430 | 431 | 432 | false 433 | 434 | 2 435 | Build 436 | Build 437 | ProjectExplorer.BuildSteps.Build 438 | 439 | 440 | 441 | true 442 | Qt4ProjectManager.MakeStep 443 | 444 | true 445 | clean 446 | 447 | false 448 | 449 | 1 450 | Clean 451 | Clean 452 | ProjectExplorer.BuildSteps.Clean 453 | 454 | 2 455 | false 456 | 457 | Profile 458 | Qt4ProjectManager.Qt4BuildConfiguration 459 | 0 460 | 461 | 3 462 | 463 | 464 | 0 465 | Deploy 466 | Deploy 467 | ProjectExplorer.BuildSteps.Deploy 468 | 469 | 1 470 | ProjectExplorer.DefaultDeployConfiguration 471 | 472 | 1 473 | 474 | 475 | dwarf 476 | 477 | cpu-cycles 478 | 479 | 480 | 250 481 | 482 | -e 483 | cpu-cycles 484 | --call-graph 485 | dwarf,4096 486 | -F 487 | 250 488 | 489 | -F 490 | true 491 | 4096 492 | false 493 | false 494 | 1000 495 | 496 | true 497 | 498 | false 499 | false 500 | false 501 | false 502 | true 503 | 0.01 504 | 10 505 | true 506 | kcachegrind 507 | 1 508 | 25 509 | 510 | 1 511 | true 512 | false 513 | true 514 | valgrind 515 | 516 | 0 517 | 1 518 | 2 519 | 3 520 | 4 521 | 5 522 | 6 523 | 7 524 | 8 525 | 9 526 | 10 527 | 11 528 | 12 529 | 13 530 | 14 531 | 532 | 2 533 | 534 | Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Tadeu Bento/Projetos/LoFloccus/LoFloccus/LoFloccus.pro 535 | C:/Users/Tadeu Bento/Projetos/LoFloccus/LoFloccus/LoFloccus.pro 536 | 537 | false 538 | 539 | false 540 | true 541 | true 542 | false 543 | false 544 | true 545 | 546 | 547 | 548 | 1 549 | 550 | 551 | 552 | ProjectExplorer.Project.TargetCount 553 | 2 554 | 555 | 556 | ProjectExplorer.Project.Updater.FileVersion 557 | 22 558 | 559 | 560 | Version 561 | 22 562 | 563 | 564 | -------------------------------------------------------------------------------- /LoFloccus/assets/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TCB13/LoFloccus/44a05b5d68fa6b034234a100e711ec6119a32b9f/LoFloccus/assets/icon.icns -------------------------------------------------------------------------------- /LoFloccus/assets/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TCB13/LoFloccus/44a05b5d68fa6b034234a100e711ec6119a32b9f/LoFloccus/assets/icon.ico -------------------------------------------------------------------------------- /LoFloccus/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TCB13/LoFloccus/44a05b5d68fa6b034234a100e711ec6119a32b9f/LoFloccus/assets/logo.png -------------------------------------------------------------------------------- /LoFloccus/libs/libLoFloccusDav.go: -------------------------------------------------------------------------------- 1 | /* 2 | libLoFloccusDav - LoFloccus WebDav Server 3 | 4 | Complied with: 5 | - go version go1.14.2 windows/amd64 6 | - go version go1.14.2 darwin/amd64 7 | 8 | How to install/compile this as a static library: 9 | 1. go get "golang.org/x/net/webdav" 10 | 2. Build ir for your architecture: 11 | 2.1. Windows (dev/release): go build -buildmode c-archive -o libLoFloccusDavWin64.a libLoFloccusDav.go 12 | 2.2. macOS (dev): go build -buildmode c-shared -o libLoFloccusDavDarwin.a libLoFloccusDav.go 13 | 2.3. macOS (release): go build -buildmode c-archive -o libLoFloccusDavDarwin.a libLoFloccusDav.go 14 | */ 15 | 16 | package main 17 | 18 | import ( 19 | "C" 20 | "context" 21 | "golang.org/x/net/webdav" 22 | "log" 23 | "net/http" 24 | "strings" 25 | ) 26 | 27 | type ServerConfig struct { 28 | address string 29 | port string 30 | dir string 31 | user string 32 | passwd string 33 | } 34 | 35 | var ( 36 | serverHandle *http.Server 37 | ) 38 | 39 | //export serverStart 40 | func serverStart(configAddress *C.char, configPort *C.char, configDir *C.char, configUser *C.char, configPassword *C.char) { 41 | 42 | serverConfig := ServerConfig{ 43 | address: C.GoString(configAddress), 44 | port: C.GoString(configPort), 45 | dir: C.GoString(configDir), 46 | user: C.GoString(configUser), 47 | passwd: C.GoString(configPassword), 48 | } 49 | 50 | 51 | log.Printf("WEBDAV: Starting server at " + serverConfig.address + ":" + serverConfig.port + "...") 52 | 53 | mux := http.NewServeMux() 54 | srvWebdav := &webdav.Handler{ 55 | FileSystem: webdav.Dir(serverConfig.dir), 56 | LockSystem: webdav.NewMemLS(), 57 | Logger: func(request *http.Request, err error) { 58 | if err != nil { 59 | log.Printf("WEBDAV [%s]: %s, ERROR: %s\n", request.Method, request.URL, err) 60 | } else { 61 | log.Printf("WEBDAV [%s]: %s \n", request.Method, request.URL) 62 | } 63 | }, 64 | } 65 | 66 | serverHandle = &http.Server{ 67 | Addr: serverConfig.address + ":" + serverConfig.port, 68 | Handler: mux, 69 | } 70 | 71 | mux.HandleFunc("/", func(response http.ResponseWriter, request *http.Request) { 72 | 73 | // Authentication 74 | username, password, ok := request.BasicAuth() 75 | if !ok { 76 | response.Header().Set("WWW-Authenticate", `Basic realm="Restricted"`) 77 | response.WriteHeader(http.StatusUnauthorized) 78 | return 79 | } 80 | if username != serverConfig.user || password != serverConfig.passwd { 81 | http.Error(response, "WebDAV: need authorized!", http.StatusUnauthorized) 82 | return 83 | } 84 | 85 | // Restrict WebDav to the current folder & read/writes to .xbel files 86 | if (!strings.HasSuffix(request.RequestURI, ".xbel") && !strings.HasSuffix(request.RequestURI, ".xbel.lock") && !strings.HasSuffix(request.RequestURI, ".html") && !strings.HasSuffix(request.RequestURI, ".htm") && request.RequestURI != "/" ) || (request.RequestURI == "/" && (request.Method != "HEAD" && request.Method != "PROPFIND")) { 87 | errorFsAccessMsg := "LoFloccus: unauthorized filesystem access detected. LoFloccus WebDAV server is restricted to '*.xbel' and '*.xbel.lock' files." 88 | log.Printf(request.RequestURI) 89 | log.Printf(request.Method) 90 | log.Printf(errorFsAccessMsg) 91 | http.Error(response, errorFsAccessMsg, http.StatusUnauthorized) 92 | return 93 | } 94 | 95 | srvWebdav.ServeHTTP(response, request) 96 | }) 97 | 98 | go func() { 99 | if err := serverHandle.ListenAndServe(); err != http.ErrServerClosed { 100 | log.Fatalf("Error with WebDAV server: %s", err) 101 | } 102 | }() 103 | 104 | } 105 | 106 | //export serverStop 107 | func serverStop() { 108 | log.Printf("WEBDAV: Shutting down...") 109 | if err := serverHandle.Shutdown(context.TODO()); err != nil { 110 | log.Fatalf("WEBDAV: error shutting down - %s", err) 111 | } 112 | serverHandle = nil 113 | log.Printf("WEBDAV: Server is down.") 114 | } 115 | 116 | func main() { 117 | // Need a main function to make CGO compile package as C shared library 118 | } 119 | -------------------------------------------------------------------------------- /LoFloccus/libs/libLoFloccusDavDarwin.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TCB13/LoFloccus/44a05b5d68fa6b034234a100e711ec6119a32b9f/LoFloccus/libs/libLoFloccusDavDarwin.a -------------------------------------------------------------------------------- /LoFloccus/libs/libLoFloccusDavDarwin.h: -------------------------------------------------------------------------------- 1 | /* Code generated by cmd/cgo; DO NOT EDIT. */ 2 | 3 | /* package command-line-arguments */ 4 | 5 | 6 | #line 1 "cgo-builtin-export-prolog" 7 | 8 | #include /* for ptrdiff_t below */ 9 | 10 | #ifndef GO_CGO_EXPORT_PROLOGUE_H 11 | #define GO_CGO_EXPORT_PROLOGUE_H 12 | 13 | #ifndef GO_CGO_GOSTRING_TYPEDEF 14 | typedef struct { const char *p; ptrdiff_t n; } _GoString_; 15 | #endif 16 | 17 | #endif 18 | 19 | /* Start of preamble from import "C" comments. */ 20 | 21 | 22 | 23 | 24 | /* End of preamble from import "C" comments. */ 25 | 26 | 27 | /* Start of boilerplate cgo prologue. */ 28 | #line 1 "cgo-gcc-export-header-prolog" 29 | 30 | #ifndef GO_CGO_PROLOGUE_H 31 | #define GO_CGO_PROLOGUE_H 32 | 33 | typedef signed char GoInt8; 34 | typedef unsigned char GoUint8; 35 | typedef short GoInt16; 36 | typedef unsigned short GoUint16; 37 | typedef int GoInt32; 38 | typedef unsigned int GoUint32; 39 | typedef long long GoInt64; 40 | typedef unsigned long long GoUint64; 41 | typedef GoInt64 GoInt; 42 | typedef GoUint64 GoUint; 43 | typedef __SIZE_TYPE__ GoUintptr; 44 | typedef float GoFloat32; 45 | typedef double GoFloat64; 46 | typedef float _Complex GoComplex64; 47 | typedef double _Complex GoComplex128; 48 | 49 | /* 50 | static assertion to make sure the file is being used on architecture 51 | at least with matching size of GoInt. 52 | */ 53 | typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1]; 54 | 55 | #ifndef GO_CGO_GOSTRING_TYPEDEF 56 | typedef _GoString_ GoString; 57 | #endif 58 | typedef void *GoMap; 59 | typedef void *GoChan; 60 | typedef struct { void *t; void *v; } GoInterface; 61 | typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; 62 | 63 | #endif 64 | 65 | /* End of boilerplate cgo prologue. */ 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | 71 | 72 | extern void serverStart(char* p0, char* p1, char* p2, char* p3, char* p4); 73 | 74 | extern void serverStop(); 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | -------------------------------------------------------------------------------- /LoFloccus/libs/libLoFloccusDavWin64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TCB13/LoFloccus/44a05b5d68fa6b034234a100e711ec6119a32b9f/LoFloccus/libs/libLoFloccusDavWin64.a -------------------------------------------------------------------------------- /LoFloccus/libs/libLoFloccusDavWin64.h: -------------------------------------------------------------------------------- 1 | /* Code generated by cmd/cgo; DO NOT EDIT. */ 2 | 3 | /* package command-line-arguments */ 4 | 5 | 6 | #line 1 "cgo-builtin-export-prolog" 7 | 8 | #include /* for ptrdiff_t below */ 9 | 10 | #ifndef GO_CGO_EXPORT_PROLOGUE_H 11 | #define GO_CGO_EXPORT_PROLOGUE_H 12 | 13 | #ifndef GO_CGO_GOSTRING_TYPEDEF 14 | typedef struct { const char *p; ptrdiff_t n; } _GoString_; 15 | #endif 16 | 17 | #endif 18 | 19 | /* Start of preamble from import "C" comments. */ 20 | 21 | 22 | 23 | 24 | /* End of preamble from import "C" comments. */ 25 | 26 | 27 | /* Start of boilerplate cgo prologue. */ 28 | #line 1 "cgo-gcc-export-header-prolog" 29 | 30 | #ifndef GO_CGO_PROLOGUE_H 31 | #define GO_CGO_PROLOGUE_H 32 | 33 | typedef signed char GoInt8; 34 | typedef unsigned char GoUint8; 35 | typedef short GoInt16; 36 | typedef unsigned short GoUint16; 37 | typedef int GoInt32; 38 | typedef unsigned int GoUint32; 39 | typedef long long GoInt64; 40 | typedef unsigned long long GoUint64; 41 | typedef GoInt64 GoInt; 42 | typedef GoUint64 GoUint; 43 | typedef __SIZE_TYPE__ GoUintptr; 44 | typedef float GoFloat32; 45 | typedef double GoFloat64; 46 | typedef float _Complex GoComplex64; 47 | typedef double _Complex GoComplex128; 48 | 49 | /* 50 | static assertion to make sure the file is being used on architecture 51 | at least with matching size of GoInt. 52 | */ 53 | typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1]; 54 | 55 | #ifndef GO_CGO_GOSTRING_TYPEDEF 56 | typedef _GoString_ GoString; 57 | #endif 58 | typedef void *GoMap; 59 | typedef void *GoChan; 60 | typedef struct { void *t; void *v; } GoInterface; 61 | typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; 62 | 63 | #endif 64 | 65 | /* End of boilerplate cgo prologue. */ 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | 71 | 72 | extern void serverStart(char* p0, char* p1, char* p2, char* p3, char* p4); 73 | 74 | extern void serverStop(); 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | -------------------------------------------------------------------------------- /LoFloccus/lofloccus.cpp: -------------------------------------------------------------------------------- 1 | #include "lofloccus.h" 2 | #include "ui_lofloccus.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #ifdef Q_OS_WIN 17 | #include "libLoFloccusDavWin64.h" 18 | #endif 19 | #ifdef Q_OS_DARWIN 20 | #include "libLoFloccusDavDarwin.h" 21 | #endif 22 | 23 | LoFloccus::LoFloccus(QWidget *parent) 24 | : QMainWindow(parent) 25 | , ui(new Ui::LoFloccus) 26 | { 27 | ui->setupUi(this); 28 | appIcon = QIcon(":/assets/icon.ico"); 29 | running = false; 30 | 31 | #ifdef Q_OS_DARWIN 32 | darwinBridge = new PlatformDarwin(); 33 | #endif 34 | 35 | // Make sure nobody can resize the app under any platform 36 | this->setFixedSize(this->width(), this->height()); 37 | this->setWindowTitle(this->windowTitle() + " - v" + APP_VERSION); 38 | 39 | // Fetch settings from storage and/or write defaults 40 | this->initSettings(false, false); 41 | 42 | // Populate UI with the loaded settings 43 | this->reloadUiState(); 44 | 45 | // Build the systray menu 46 | this->initSystray(); 47 | 48 | // Deal with previously saved settings 49 | if (!settings->value("startminimized").toBool()) { 50 | show(); 51 | } 52 | if (settings->value("startminimized").toBool() && !settings->value("hidetosystray").toBool()) { 53 | showMinimized(); 54 | } 55 | if (settings->value("startminimized").toBool() && settings->value("hidetosystray").toBool()) { 56 | #ifdef Q_OS_DARWIN 57 | darwinBridge->makeAppAccessory(); 58 | #endif 59 | sysTray->showMessage("LoFloccus", "LoFloccus is running in the background. Click the menu for more options.", appIcon); 60 | } 61 | 62 | // Start the server with the app 63 | this->startServer(); 64 | } 65 | 66 | void LoFloccus::closeEvent(QCloseEvent *event) 67 | { 68 | if (minimizeAndCloseToTray) { 69 | hide(); 70 | event->ignore(); 71 | } else { 72 | event->accept(); 73 | } 74 | } 75 | 76 | void LoFloccus::hideEvent(QHideEvent *event) 77 | { 78 | event->accept(); 79 | if (minimizeAndCloseToTray) { 80 | hide(); 81 | #ifdef Q_OS_DARWIN 82 | darwinBridge->makeAppAccessory(); 83 | #endif 84 | sysTray->showMessage("LoFloccus", "LoFloccus is running in the background. Click the menu for more options.", appIcon); 85 | } 86 | } 87 | 88 | LoFloccus::~LoFloccus() 89 | { 90 | // Stop the server on close 91 | if (running) { 92 | this->stopServer(); 93 | } 94 | 95 | delete ui; 96 | } 97 | 98 | void LoFloccus::initSettings(bool makeExistingSettingsPortable = false, bool makeExistingSettingsLocal = false) 99 | { 100 | QString localSettingsFile = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/settings.ini"; 101 | QString portableSettingsFile = "lofloccus-settings.ini"; 102 | 103 | // Deal with settings location move 104 | if (makeExistingSettingsPortable) { 105 | if (QFile::exists(portableSettingsFile)) { 106 | QFile::remove(portableSettingsFile); 107 | } 108 | QFile::copy(localSettingsFile, portableSettingsFile); 109 | QFile::remove(localSettingsFile); 110 | } 111 | if (makeExistingSettingsLocal) { 112 | if (QFile::exists(localSettingsFile)) { 113 | QFile::remove(localSettingsFile); 114 | } 115 | QFile::copy(portableSettingsFile, localSettingsFile); 116 | QFile::remove(portableSettingsFile); 117 | } 118 | 119 | // Initialize a shared settings object with the appropriate path 120 | settings = new QSettings(QFile::exists(portableSettingsFile) ? portableSettingsFile : localSettingsFile, QSettings::IniFormat); 121 | 122 | // Generate random defaults for port and password 123 | QString defaultPort = QString::number(QRandomGenerator::global()->bounded(40000, 65535)); 124 | QString defaultPasswd = "fpass-" + QString::number(QRandomGenerator::global()->bounded(100000, 999999)); 125 | 126 | // Set default values for each setting. This will write default values or 127 | // keep existing ones making sure our settings on disk are always complete 128 | settings->setValue("serveraddr", settings->value("serveraddr", "127.0.0.1")); 129 | settings->setValue("serverport", settings->value("serverport", defaultPort)); 130 | settings->setValue("serverpath", settings->value("serverpath", QCoreApplication::applicationDirPath())); 131 | settings->setValue("serveruser", settings->value("serveruser", "floccus")); 132 | settings->setValue("serverpasswd", settings->value("serverpasswd", defaultPasswd)); 133 | 134 | settings->setValue("startminimized", settings->value("startminimized", false)); 135 | settings->setValue("hidetosystray", settings->value("hidetosystray", false)); 136 | settings->setValue("sharednetwork", settings->value("sharednetwork", false)); 137 | settings->setValue("portablemode", settings->value("portablemode", false)); 138 | } 139 | 140 | void LoFloccus::reloadUiState() 141 | { 142 | ui->xbel_path->setText(settings->value("serverpath").toString()); 143 | 144 | // Take care of the server addresses, might be just local or all IPs of the machine 145 | QString serverPort = settings->value("serverport").toString(); 146 | QList ips = { "127.0.0.1" }; 147 | if (settings->value("sharednetwork").toBool()) { 148 | ips << getSystemIPAddresses(false, true, false); 149 | } 150 | ui->srv_addr->setText("http://" + ips.mid(0,2).join(":" + serverPort + " or http://") + ":" + serverPort + (ips.length() > 2 ? " (...)" : "")); 151 | ui->srv_addr->setToolTip("LoFloccus server is running at:\r\nhttp://" + ips.join(":" + serverPort + "\r\nhttp://") + ":" + serverPort); 152 | 153 | ui->srv_user->setText(settings->value("serveruser").toString()); 154 | ui->srv_passwd->setText(settings->value("serverpasswd").toString()); 155 | 156 | ui->startminimized->setChecked(settings->value("startminimized").toBool()); 157 | ui->hidetosystray->setChecked(settings->value("hidetosystray").toBool()); 158 | ui->sharednetwork->setChecked(settings->value("sharednetwork").toBool()); 159 | ui->portablemode->setChecked(settings->value("portablemode").toBool()); 160 | } 161 | 162 | void LoFloccus::initSystray() 163 | { 164 | minimizeAndCloseToTray = settings->value("hidetosystray").toBool(); 165 | QAction *exitAction = new QAction("Quit", this); 166 | connect(exitAction, &QAction::triggered, [this]() { 167 | minimizeAndCloseToTray = false; 168 | close(); 169 | }); 170 | 171 | QAction *openAction = new QAction("Open LoFloccus", this); 172 | connect(openAction, &QAction::triggered, [this]() { 173 | #ifdef Q_OS_DARWIN 174 | darwinBridge->makeAppRegular(); 175 | #endif 176 | showNormal(); 177 | activateWindow(); 178 | }); 179 | 180 | QMenu *trayIconMenu = new QMenu(this); 181 | trayIconMenu->addAction(openAction); 182 | trayIconMenu->addAction(exitAction); 183 | 184 | sysTray = new QSystemTrayIcon(this); 185 | sysTray->setContextMenu(trayIconMenu); 186 | sysTray->setIcon(appIcon); 187 | sysTray->show(); 188 | 189 | // Force opening the context menu on icon click under Windows 190 | #ifdef Q_OS_WIN 191 | connect(sysTray, &QSystemTrayIcon::activated, [this]() { 192 | /* QSystemTrayIcon::ActivationReason reason 193 | * if (reason == QSystemTrayIcon::DoubleClick) { 194 | showNormal(); 195 | activateWindow(); 196 | return; 197 | }*/ 198 | sysTray->contextMenu()->popup(QCursor::pos()); 199 | }); 200 | #endif 201 | } 202 | 203 | void LoFloccus::restartServer() 204 | { 205 | if (running) { 206 | this->stopServer(); 207 | this->startServer(); 208 | } 209 | } 210 | 211 | void LoFloccus::startServer() 212 | { 213 | serverStart(settings->value("serveraddr").toString().toUtf8().data(), 214 | settings->value("serverport").toString().toUtf8().data(), 215 | settings->value("serverpath").toString().toUtf8().data(), 216 | settings->value("serveruser").toString().toUtf8().data(), 217 | settings->value("serverpasswd").toString().toUtf8().data() 218 | ); 219 | running = true; 220 | this->reloadUiState(); 221 | } 222 | 223 | void LoFloccus::stopServer() 224 | { 225 | serverStop(); 226 | running = false; 227 | this->reloadUiState(); 228 | } 229 | 230 | QList LoFloccus::getSystemIPAddresses(bool locals = true, bool v4 = true, bool v6 = true) 231 | { 232 | QList returnList; 233 | QList addresses = QNetworkInterface::allAddresses(); 234 | for (int i=0; i < addresses.count(); i++) { 235 | if(!locals && addresses[i].isLoopback()) { 236 | continue; 237 | } 238 | if (v4 && addresses[i].protocol() == QAbstractSocket::IPv4Protocol) { 239 | returnList.append(addresses[i].toString()); 240 | } 241 | if (v6 && addresses[i].protocol() == QAbstractSocket::IPv6Protocol) { 242 | returnList.append(addresses[i].toString()); 243 | } 244 | } 245 | return returnList; 246 | } 247 | 248 | void LoFloccus::on_btn_xbel_localtion_clicked() 249 | { 250 | QString dir = QFileDialog::getExistingDirectory(this, 251 | "Pick a Directory", 252 | settings->value("serverpath").toString(), 253 | QFileDialog::ShowDirsOnly); 254 | if (dir.isEmpty()) { 255 | return; 256 | } 257 | settings->setValue("serverpath", dir); 258 | this->restartServer(); 259 | } 260 | 261 | 262 | 263 | void LoFloccus::on_portablemode_clicked() 264 | { 265 | if (ui->portablemode->isChecked()) { 266 | this->initSettings(true, false); 267 | } else { 268 | this->initSettings(false, true); 269 | } 270 | settings->setValue("portablemode", ui->portablemode->isChecked()); 271 | } 272 | 273 | void LoFloccus::on_startminimized_clicked() 274 | { 275 | settings->setValue("startminimized", ui->startminimized->isChecked()); 276 | } 277 | 278 | void LoFloccus::on_hidetosystray_clicked() 279 | { 280 | settings->setValue("hidetosystray", ui->hidetosystray->isChecked()); 281 | minimizeAndCloseToTray = ui->hidetosystray->isChecked(); 282 | } 283 | 284 | void LoFloccus::on_sharednetwork_clicked() 285 | { 286 | settings->setValue("sharednetwork", ui->sharednetwork->isChecked()); 287 | settings->setValue("serveraddr", ui->sharednetwork->isChecked() ? "0.0.0.0" : "127.0.0.1"); 288 | this->restartServer(); 289 | } 290 | 291 | -------------------------------------------------------------------------------- /LoFloccus/lofloccus.h: -------------------------------------------------------------------------------- 1 | #ifndef LOFLOCCUS_H 2 | #define LOFLOCCUS_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #ifdef Q_OS_DARWIN 10 | #include "platformdarwin.h" 11 | #endif 12 | 13 | QT_BEGIN_NAMESPACE 14 | namespace Ui { class LoFloccus; } 15 | QT_END_NAMESPACE 16 | 17 | class LoFloccus : public QMainWindow 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | LoFloccus(QWidget *parent = nullptr); 23 | ~LoFloccus(); 24 | QIcon appIcon; 25 | 26 | private slots: 27 | void on_btn_xbel_localtion_clicked(); 28 | void on_startminimized_clicked(); 29 | void on_hidetosystray_clicked(); 30 | void on_sharednetwork_clicked(); 31 | void on_portablemode_clicked(); 32 | 33 | protected: 34 | void closeEvent(QCloseEvent *event) override; 35 | void hideEvent(QHideEvent *event) override; 36 | 37 | private: 38 | bool minimizeAndCloseToTray; 39 | bool running; 40 | 41 | QSettings *settings; 42 | QSystemTrayIcon *sysTray; 43 | 44 | #ifdef Q_OS_DARWIN 45 | PlatformDarwin *darwinBridge; 46 | #endif 47 | 48 | Ui::LoFloccus *ui; 49 | 50 | void initSettings(bool makeExistingSettingsPortable, bool makeExistingSettingsLocal); 51 | void reloadUiState(); 52 | void startServer(); 53 | void stopServer(); 54 | void restartServer(); 55 | void initSystray(); 56 | QList getSystemIPAddresses(bool locals, bool v4, bool v6); 57 | }; 58 | #endif // LOFLOCCUS_H 59 | -------------------------------------------------------------------------------- /LoFloccus/lofloccus.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | LoFloccus 4 | 5 | 6 | 7 | 0 8 | 0 9 | 462 10 | 441 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | LoFloccus 21 | 22 | 23 | 24 | :/assets/icon.ico:/assets/icon.ico 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 20 34 | 260 35 | 431 36 | 16 37 | 38 | 39 | 40 | 41 | 75 42 | true 43 | 44 | 45 | 46 | Connect your Floccus Browser Extension 47 | 48 | 49 | 50 | 51 | 52 | 10 53 | 90 54 | 441 55 | 16 56 | 57 | 58 | 59 | Qt::Horizontal 60 | 61 | 62 | 63 | 64 | 65 | 20 66 | 140 67 | 421 68 | 91 69 | 70 | 71 | 72 | 73 | 4 74 | 75 | 76 | 77 | 78 | Start minimized 79 | 80 | 81 | 82 | 83 | 84 | 85 | Close / minimize to system tray or top menu bar 86 | 87 | 88 | 89 | 90 | 91 | 92 | Allow other devices to sync with this instance (dangerous) 93 | 94 | 95 | 96 | 97 | 98 | 99 | Run in portable mode (settings are saved on the app directory) 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 30 109 | 290 110 | 411 111 | 36 112 | 113 | 114 | 115 | 116 | 4 117 | 118 | 119 | 120 | 121 | 1. Open Floccus and click "+ New Account" 122 | 123 | 124 | 125 | 126 | 127 | 128 | 2. Choose "XBEL file in WebDAV share" and fill in the following details: 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 40 138 | 340 139 | 401 140 | 51 141 | 142 | 143 | 144 | 145 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 146 | 147 | 148 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 149 | 150 | 151 | 20 152 | 153 | 154 | 4 155 | 156 | 157 | 158 | 159 | Server: 160 | 161 | 162 | 163 | 164 | 165 | 166 | IBeamCursor 167 | 168 | 169 | false 170 | 171 | 172 | false 173 | 174 | 175 | srv_addr 176 | 177 | 178 | Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse 179 | 180 | 181 | 182 | 183 | 184 | 185 | Username: 186 | 187 | 188 | 189 | 190 | 191 | 192 | IBeamCursor 193 | 194 | 195 | false 196 | 197 | 198 | false 199 | 200 | 201 | srv_user 202 | 203 | 204 | Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse 205 | 206 | 207 | 208 | 209 | 210 | 211 | Password: 212 | 213 | 214 | 215 | 216 | 217 | 218 | IBeamCursor 219 | 220 | 221 | false 222 | 223 | 224 | false 225 | 226 | 227 | srv_passwd 228 | 229 | 230 | Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 20 240 | 110 241 | 421 242 | 27 243 | 244 | 245 | 246 | 247 | QLayout::SetFixedSize 248 | 249 | 250 | 251 | 252 | 253 | 75 254 | true 255 | 256 | 257 | 258 | Sync Location: 259 | 260 | 261 | 262 | 263 | 264 | 265 | QLayout::SetFixedSize 266 | 267 | 268 | 269 | 270 | 271 | 0 272 | 0 273 | 274 | 275 | 276 | 277 | 250 278 | 0 279 | 280 | 281 | 282 | 283 | 250 284 | 16777215 285 | 286 | 287 | 288 | 289 | 20 290 | 0 291 | 292 | 293 | 294 | xbel_path 295 | 296 | 297 | false 298 | 299 | 300 | false 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 0 309 | 0 310 | 311 | 312 | 313 | 314 | 70 315 | 0 316 | 317 | 318 | 319 | 320 | 70 321 | 16777215 322 | 323 | 324 | 325 | Change 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 10 337 | 240 338 | 441 339 | 16 340 | 341 | 342 | 343 | Qt::Horizontal 344 | 345 | 346 | 347 | 348 | 349 | 0 350 | 10 351 | 461 352 | 71 353 | 354 | 355 | 356 | 357 | 0 358 | 359 | 360 | 361 | 362 | 10 363 | 364 | 365 | 366 | 367 | Qt::Horizontal 368 | 369 | 370 | 371 | 20 372 | 20 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 48 382 | 48 383 | 384 | 385 | 386 | 387 | Arial 388 | 389 | 390 | 391 | 392 | 393 | 394 | :/assets/logo.png 395 | 396 | 397 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 398 | 399 | 400 | 0 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 17 409 | 75 410 | true 411 | 412 | 413 | 414 | LoFloccus 415 | 416 | 417 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 418 | 419 | 420 | 421 | 422 | 423 | 424 | Qt::Horizontal 425 | 426 | 427 | 428 | 40 429 | 20 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 10 441 | 75 442 | true 443 | 444 | 445 | 446 | Sync Floccus to a Local Folder! 447 | 448 | 449 | Qt::AlignCenter 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 30 459 | 400 460 | 411 461 | 21 462 | 463 | 464 | 465 | 466 | 4 467 | 468 | 469 | 470 | 471 | 3. Recommended: Set a passphrase for encrypting your bookmarks files! 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 0 482 | 0 483 | 462 484 | 21 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | -------------------------------------------------------------------------------- /LoFloccus/main.cpp: -------------------------------------------------------------------------------- 1 | #include "lofloccus.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | LoFloccus w; 9 | //w.show(); 10 | //QApplication::setQuitOnLastWindowClosed(false); 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /LoFloccus/platformdarwin.h: -------------------------------------------------------------------------------- 1 | #ifndef __PlatformDarwin_h_ 2 | #define __PlatformDarwin_h_ 3 | 4 | class PlatformDarwin 5 | { 6 | public: 7 | static void makeAppAccessory(); 8 | static void makeAppRegular(); 9 | }; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /LoFloccus/platformdarwin.mm: -------------------------------------------------------------------------------- 1 | #include "platformdarwin.h" 2 | #import 3 | #import 4 | 5 | void PlatformDarwin::makeAppAccessory() 6 | { 7 | NSApp.activationPolicy = NSApplicationActivationPolicyAccessory; 8 | } 9 | 10 | void PlatformDarwin::makeAppRegular() 11 | { 12 | NSApp.activationPolicy = NSApplicationActivationPolicyRegular; 13 | } 14 | -------------------------------------------------------------------------------- /LoFloccus/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | assets/icon.ico 4 | assets/logo.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LoFloccus 2 | Sync Floccus to a Local Folder! 3 | 4 | **LoFloccus** is a small companion app for Floccus that empowers you to sync your bookmarks with whatever service or tool you would like to! 5 | 6 | ![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white) 7 | ![Mac OS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge&logo=apple&logoColor=white) 8 | 9 | ![LoFloccus](https://cdn.iklive.eu/tcb13/2021/lofloccus-1-2-2.png) 10 | 11 | ## Download LoFloccus 12 | 13 | - **Windows**: https://github.com/TCB13/LoFloccus/releases/download/1.2.4/LoFloccus-1-2-4-Win.zip 14 | - **macOS**: https://github.com/TCB13/LoFloccus/releases/download/1.2.4/LoFloccus-1-2-4-macOS.zip 15 | 16 | ## Why and How 17 | 18 | **Floccus** (https://github.com/marcelklehr/floccus) is a great browser extensions that allows you to sync your browser bookmarks with your selfhosted server (e.g. Nextcloud or a WebDAV server). 19 | 20 | Due to browser restrictions, you can't store your browser bookmarks in a local file and then sync it with Dropbox, Syncthing, rsync etc. **LoFloccus** aims to make this possible by introducing a small companion app that is a secure, self-contained WebDAV server. 21 | 22 | This tool was designed to: 23 | 1) Accept WebDAV connections from the Floccus; 24 | 2) Restrict Floccus access to a single directory and read/write access limited to `*.xbel` and `*.html` bookmarks files; 25 | 3) Generate a random port, username and password for each setup; 26 | 4) Store your XBEL/HTML bookmarks location and other settings across sessions; 27 | 5) Minimize to Windows tray / macOS top menu bar. 28 | 29 | Enjoy the best of Floccus and combine it with favourite sync tool! 30 | 31 | ## Compile from Source / Dev Information 32 | LoFloccus was developed with Qt Creator 4.11.1, Qt 5.14.1 and Golang 1.14.2. 33 | 34 | 1. Install Qt 35 | 2. Install Golang 36 | 3. (Optionally) compile libs/libLoFloccusDav.go as described on the file 37 | 4. Open the project in Qt Creator and run it. 38 | -------------------------------------------------------------------------------- /generate-icns-from-svg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir icon.iconset 4 | convert -background none -size 16x16 -gravity center -extent 16x16 icon.svg icon.iconset/icon_16x16.png 5 | convert -background none -size 32x32 -gravity center -extent 32x32 icon.svg icon.iconset/icon_16x16@2x.png 6 | convert -background none -size 32x32 -gravity center -extent 32x32 icon.svg icon.iconset/icon_32x32.png 7 | convert -background none -size 64x64 -gravity center -extent 64x64 icon.svg icon.iconset/icon_32x32@2x.png 8 | convert -background none -size 64x64 -gravity center -extent 64x64 icon.svg icon.iconset/icon_64x64.png 9 | convert -background none -size 128x128 -gravity center -extent 128x128 icon.svg icon.iconset/icon_64x64@2x.png 10 | convert -background none -size 128x128 -gravity center -extent 128x128 icon.svg icon.iconset/icon_128x128.png 11 | convert -background none -size 256x256 -gravity center -extent 256x256 icon.svg icon.iconset/icon_128x128@2x.png 12 | convert -background none -size 256x256 -gravity center -extent 256x256 icon.svg icon.iconset/icon_256x256.png 13 | convert -background none -size 512x512 -gravity center -extent 512x512 icon.svg icon.iconset/icon_256x256@2x.png 14 | convert -background none -size 512x512 -gravity center -extent 512x512 icon.svg icon.iconset/icon_512x512.png 15 | convert -background none -size 1024x1024 -gravity center -extent 1024x1024 icon.svg icon.iconset/icon_512x512@2x.png 16 | iconutil --convert icns icon.iconset 17 | rm -R icon.iconset 18 | 19 | -------------------------------------------------------------------------------- /icon.svg: -------------------------------------------------------------------------------- 1 | icon --------------------------------------------------------------------------------