]> git.uzoombox.com Git - uzsdk-v0.3.8.git/commitdiff
feat(uzsdk): 1. default Configuration.Service.SockDirectory to /var/run/smartsystem. master v0.3.8
authorbruce <bruce@nanzoom.com>
Tue, 20 Jan 2026 11:49:47 +0000 (11:49 +0000)
committerbruce <bruce@nanzoom.com>
Tue, 20 Jan 2026 11:49:47 +0000 (11:49 +0000)
  2. merge OS.

uzsdk/configuration.go
uzsdk/os.go [new file with mode: 0644]
version.go

index 340cdd362fa5e4f92db3b62caf5933b3b4e485d3..d8e60d4a495dc3ef9ec40b2af0f13eba8cf75ec8 100644 (file)
@@ -18,7 +18,7 @@ type Configuration struct {
                ServicePath    string   // urlpath for this service, default: /wservice
                DataDirectory  string   // server data directory, default: /data/cloud
                TrustedProxies []string // a list of proxies trusted, default: ["127.0.0.1", "192.168.8.1"]
-               SockDirectory  string   // directory name of unix socket, IP=/run/[SockDirectory]/xxx.sock, default: smartsystem
+               SockDirectory  string   // directory name of unix socket, IP=[SockDirectory]/xxx.sock, default: /var/run/smartsystem
                SockGroupName  string   // group name that access unix socket, default: null
        }
        System struct {
@@ -95,7 +95,7 @@ func (setting *Configuration) Check() {
                setting.Service.TrustedProxies = append(setting.Service.TrustedProxies, "127.0.0.1", "192.168.8.1")
        }
        if setting.Service.SockDirectory == "" {
-               setting.Service.SockDirectory = "smartsystem"
+               setting.Service.SockDirectory = "/var/run/smartsystem"
        }
 
        // Configuration.System
diff --git a/uzsdk/os.go b/uzsdk/os.go
new file mode 100644 (file)
index 0000000..99b1e99
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright 2010-2026 nanzoom.com. All Rights Reserved.
+
+package uzsdk
+
+// OS store profiles reading from OS.
+type OS struct {
+       Protocols []Protocol // profile: /etc/protocols.
+       Services  []Service  // profile: /etc/services.
+       Jaillist  []string   // profile: fail2ban jail list.
+       Loginlist []string   // profile: fail2ban onlogin list.
+}
+
+type Protocol struct {
+       Name        string
+       Id          string
+       Keyword     string
+       Description string
+}
+
+type Service struct {
+       Name     string
+       Port     string
+       Protocol string
+}
+
+func NewOS() *OS {
+       var profile OS
+
+       profile.Protocols = make([]Protocol, 0)
+       profile.Services = make([]Service, 0)
+       profile.Jaillist = make([]string, 0)
+       profile.Loginlist = make([]string, 0)
+
+       return &profile
+}
index 20ea3df7950560cbfe79e0e1d1577383385e5323..578243d7a7d1b0c7918829c53bc0b4ff052d0f14 100644 (file)
@@ -2,4 +2,4 @@
 package uzsdk
 
 // Version is the current opensdk's version.
-const Version = "0.3.7"
+const Version = "0.3.8"