瀏覽代碼

Updated build version to v1.121

tobychui 3 年之前
父節點
當前提交
9989067336
共有 4 個文件被更改,包括 11 次插入5 次删除
  1. 1 0
      go.mod
  2. 2 0
      go.sum
  3. 1 1
      main.flags.go
  4. 7 4
      mod/filesystem/filesystem.go

+ 1 - 0
go.mod

@@ -34,6 +34,7 @@ require (
 	github.com/satori/go.uuid v1.2.0
 	github.com/spf13/afero v1.6.0
 	github.com/stretchr/testify v1.7.0 // indirect
+	github.com/syndtr/goleveldb v1.0.0 // indirect
 	github.com/tidwall/pretty v1.0.2
 	github.com/ulikunitz/xz v0.5.10 // indirect
 	github.com/valyala/fasttemplate v1.1.0

+ 2 - 0
go.sum

@@ -494,6 +494,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
 github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
+github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE=
+github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
 github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
 github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=

+ 1 - 1
main.flags.go

@@ -28,7 +28,7 @@ var subserviceBasePort = 12810            //Next subservice port
 
 // =========== SYSTEM BUILD INFORMATION ==============
 var build_version = "development"                      //System build flag, this can be either {development / production / stable}
-var internal_version = "0.1.120"                       //Internal build version, [fork_id].[major_release_no].[minor_release_no]
+var internal_version = "0.1.121"                       //Internal build version, [fork_id].[major_release_no].[minor_release_no]
 var deviceUUID string                                  //The device uuid of this host
 var deviceVendor = "IMUSLAB.INC"                       //Vendor of the system
 var deviceVendorURL = "http://imuslab.com"             //Vendor contact information

+ 7 - 4
mod/filesystem/filesystem.go

@@ -123,11 +123,14 @@ func NewFileSystemHandler(option FileSystemOption) (*FileSystemHandler, error) {
 
 		//Create the fsdb for this handler
 		var fsdb *db.Database = nil
-		if option.Access != "readonly" {
-			dbp, err := db.NewDatabase(filepath.ToSlash(filepath.Join(filepath.Clean(option.Path), "aofs.db")), false)
-			if err != nil {
-				return &FileSystemHandler{}, errors.New("Unable to create fsdb inside the target path. Is the directory read only?")
+
+		dbp, err := db.NewDatabase(filepath.ToSlash(filepath.Join(filepath.Clean(option.Path), "aofs.db")), false)
+		if err != nil {
+			if option.Access != "readonly" {
+				log.Println("[Filesystem] Invalid config: Trying to mount a read only path as read-write mount point. Changing " + option.Name + " mount point to READONLY.")
+				option.Access = "readonly"
 			}
+		} else {
 			fsdb = dbp
 		}