From 9d5d9e0607d63b422ad360803023d188a18e410e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=91=D0=BE=D1=80=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Wed, 10 Jun 2026 18:10:54 +0200 Subject: [PATCH] working commit --- app/config/config.go | 5 +++-- app/config/variant.go | 8 ++++---- app/config/variant.go.in | 8 ++++---- cmd/mbaseadmin/util_test.go | 2 +- go.mod | 6 +++--- go.sum | 8 ++++---- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/app/config/config.go b/app/config/config.go index 8f6ae06..c5cab44 100644 --- a/app/config/config.go +++ b/app/config/config.go @@ -36,6 +36,7 @@ type Config struct { Hostname string `json:"hostname" yaml:"hostname"` Debug bool `json:"debug" yaml:"debug"` Build string `json:"build" yaml:"build"` + ConfPath string `json:"conffile" yaml:"conffile"` LogPath string `json:"logfile" yaml:"logfile"` RunPath string `json:"runfile" yaml:"runfile"` DataDir string `json:"datadir" yaml:"datadir"` @@ -74,6 +75,7 @@ func NewConfig() *Config { LogLimit: 1024 * 1024 * 10, // 10 Mb RunUser: "daemon", } + conf.ConfPath = filepath.Join(confdirPath, configFilename) conf.LogPath = filepath.Join(logdirPath, logFilename) conf.RunPath = filepath.Join(rundirPath, pidFilename) return conf @@ -81,8 +83,7 @@ func NewConfig() *Config { func (conf *Config) ReadFile() error { var err error - confPath := filepath.Join(confdirPath, configFilename) - confBytes, err := os.ReadFile(confPath) + confBytes, err := os.ReadFile(conf.ConfPath) if err != nil { return err } diff --git a/app/config/variant.go b/app/config/variant.go index 08e7c69..9d36cec 100644 --- a/app/config/variant.go +++ b/app/config/variant.go @@ -1,9 +1,9 @@ package config const ( - confdirPath = "/home/ziggi/Projects/gmbase/etc/mbase" - rundirPath = "/home/ziggi/Projects/gmbase/tmp/run" - logdirPath = "/home/ziggi/Projects/gmbase/tmp/log" - datadirPath = "/home/ziggi/Projects/gmbase/tmp/data" + confdirPath = "/usr/local/etc/mbase" + rundirPath = "/var/run/mbase" + logdirPath = "/var/log/mbase" + datadirPath = "/var/data/mbase" packageVersion = "0.0.1" ) diff --git a/app/config/variant.go.in b/app/config/variant.go.in index 3561ca2..3ac3ac2 100644 --- a/app/config/variant.go.in +++ b/app/config/variant.go.in @@ -1,10 +1,10 @@ package config const ( - confdirPath = "@srv_confdir@" - rundirPath = "@srv_rundir@" - logdirPath = "@srv_logdir@" - datadirPath = "@srv_datadir@" + confdirPath = "@srv_confdir@" + rundirPath = "@srv_rundir@" + logdirPath = "@srv_logdir@" + datadirPath = "@srv_datadir@" packageVersion = "@PACKAGE_VERSION@" ) diff --git a/cmd/mbaseadmin/util_test.go b/cmd/mbaseadmin/util_test.go index a0c2fe6..f29d223 100644 --- a/cmd/mbaseadmin/util_test.go +++ b/cmd/mbaseadmin/util_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestCert(t *testing.T) { +func TestSeed(t *testing.T) { var err error util := NewUtil() diff --git a/go.mod b/go.mod index 48930ff..a003358 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,16 @@ module mbase -go 1.26.2 +go 1.25.7 require ( github.com/gin-gonic/gin v1.12.0 github.com/google/uuid v1.6.0 github.com/jmoiron/sqlx v1.4.0 - github.com/mattn/go-sqlite3 v1.14.44 + github.com/mattn/go-sqlite3 v1.14.45 github.com/spf13/cobra v1.10.2 github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 - go.yaml.in/yaml/v4 v4.0.0-rc.4 + go.yaml.in/yaml/v4 v4.0.0-rc.5 google.golang.org/grpc v1.81.1 google.golang.org/protobuf v1.36.11 sigs.k8s.io/yaml v1.6.0 diff --git a/go.sum b/go.sum index fb20538..0fc6b77 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= -github.com/mattn/go-sqlite3 v1.14.44 h1:3VSe+xafpbzsLbdr2AWlAZk9yRHiBhTBakioXaCKTF8= -github.com/mattn/go-sqlite3 v1.14.44/go.mod h1:pjEuOr8IwzLJP2MfGeTb0A35jauH+C2kbHKBr7yXKVQ= +github.com/mattn/go-sqlite3 v1.14.45 h1:6KA/spDguL3KV8rnybG7ezSaE4SeMR3KC9VbUoAQaIk= +github.com/mattn/go-sqlite3 v1.14.45/go.mod h1:pjEuOr8IwzLJP2MfGeTb0A35jauH+C2kbHKBr7yXKVQ= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -140,8 +140,8 @@ go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U= -go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= +go.yaml.in/yaml/v4 v4.0.0-rc.5 h1:JVliQq9EGOYaTgMi+k8BhUJyqcGk4ZqeuiN1Cirba9c= +go.yaml.in/yaml/v4 v4.0.0-rc.5/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= golang.org/x/arch v0.22.0 h1:c/Zle32i5ttqRXjdLyyHZESLD/bB90DCU1g9l/0YBDI= golang.org/x/arch v0.22.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A= golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=