Skip to content

Commit 67253ff

Browse files
committed
chore: clean up
Signed-off-by: chohee <cc5281@126.com>
1 parent 3ba0e57 commit 67253ff

File tree

7 files changed

+6
-27
lines changed

7 files changed

+6
-27
lines changed

cmd/manager/cmd/root.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ func init() {
101101
// initDfpath initializes dfpath.
102102
func initDfpath(cfg *config.ServerConfig) (dfpath.Dfpath, error) {
103103
var options []dfpath.Option
104-
if cfg.WorkHome != "" {
105-
options = append(options, dfpath.WithWorkHome(cfg.WorkHome))
106-
}
107-
108104
if cfg.LogDir != "" {
109105
options = append(options, dfpath.WithLogDir(cfg.LogDir))
110106
}
@@ -117,10 +113,6 @@ func initDfpath(cfg *config.ServerConfig) (dfpath.Dfpath, error) {
117113
options = append(options, dfpath.WithPluginDir(cfg.PluginDir))
118114
}
119115

120-
if cfg.DataDir != "" {
121-
options = append(options, dfpath.WithDataDir(cfg.DataDir))
122-
}
123-
124116
return dfpath.New(options...)
125117
}
126118

cmd/scheduler/cmd/root.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ func init() {
100100

101101
func initDfpath(cfg *config.ServerConfig) (dfpath.Dfpath, error) {
102102
var options []dfpath.Option
103-
if cfg.WorkHome != "" {
104-
options = append(options, dfpath.WithWorkHome(cfg.WorkHome))
105-
}
106-
107103
if cfg.LogDir != "" {
108104
options = append(options, dfpath.WithLogDir(cfg.LogDir))
109105
}

go.mod

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,3 @@ require (
280280
gorm.io/driver/sqlserver v1.4.1 // indirect
281281
gorm.io/plugin/dbresolver v1.3.0 // indirect
282282
)
283-
284-
// use local api repo
285-
replace d7y.io/api/v2 => ../api_fork

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ cloud.google.com/go/storage v1.50.0 h1:3TbVkzTooBvnZsk7WaAQfOsNrdoM8QHusXA1cpk6Q
6363
cloud.google.com/go/storage v1.50.0/go.mod h1:l7XeiD//vx5lfqE3RavfmU9yvk5Pp0Zhcv482poyafY=
6464
cloud.google.com/go/trace v1.11.6 h1:2O2zjPzqPYAHrn3OKl029qlqG6W8ZdYaOWRyr8NgMT4=
6565
cloud.google.com/go/trace v1.11.6/go.mod h1:GA855OeDEBiBMzcckLPE2kDunIpC72N+Pq8WFieFjnI=
66+
d7y.io/api/v2 v2.1.60 h1:Imk1mw30wmTJNdqKFF5VO/eqI/t1H5PfIPPK4ryKX2U=
67+
d7y.io/api/v2 v2.1.60/go.mod h1:WzakPywEgs27gr/TwrlRarPRRK2o5nN0YrTzHDdFii8=
6668
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
6769
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
6870
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=

manager/config/config.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ type ServerConfig struct {
6767
// Server name.
6868
Name string `yaml:"name" mapstructure:"name"`
6969

70-
// Server work home directory.
71-
WorkHome string `yaml:"workHome" mapstructure:"workHome"`
72-
7370
// Server dynamic config cache directory.
7471
CacheDir string `yaml:"cacheDir" mapstructure:"cacheDir"`
7572

@@ -91,9 +88,6 @@ type ServerConfig struct {
9188
// Server plugin directory.
9289
PluginDir string `yaml:"pluginDir" mapstructure:"pluginDir"`
9390

94-
// Server data directory.
95-
DataDir string `yaml:"dataDir" mapstructure:"dataDir"`
96-
9791
// GRPC server configuration.
9892
GRPC GRPCConfig `yaml:"grpc" mapstructure:"grpc"`
9993

@@ -409,17 +403,18 @@ type NetworkConfig struct {
409403
EnableIPv6 bool `mapstructure:"enableIPv6" yaml:"enableIPv6"`
410404
}
411405

406+
// AES256 base64 key is 32 bytes.
412407
type EncryptionKey [32]byte
413408
type EncryptionConfig struct {
409+
// Enable encryption.
414410
Enable bool `mapstructure:"enable" yaml:"enable"`
415411
// AES256 base64, optional
416412
Key *EncryptionKey `mapstructure:"key" yaml:"key"`
417413
}
418414

419415
// UnmarshalText Base64
420416
func (e *EncryptionKey) UnmarshalText(text []byte) error {
421-
// TODO: avoid printing key
422-
logger.Infof("base64 key str: %s", string(text))
417+
logger.Debugf("base64 key str: %s", string(text))
423418
keyBytes, err := base64.StdEncoding.DecodeString(string(text))
424419
if err != nil {
425420
return fmt.Errorf("invalid base64 key: %v", err)

manager/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func registerGCTasks(gc pkggc.GC, db *gorm.DB) error {
265265
return nil
266266
}
267267

268-
// initializeEncryptionKey
268+
// Initialize encryption key
269269
func initializeEncryptionKey(cfg *config.Config, db *gorm.DB) error {
270270
// 1. try get key from db
271271
var existingKey models.EncryptionKey

scheduler/config/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ type ServerConfig struct {
8585
// TLS server configuration.
8686
TLS *GRPCTLSServerConfig `yaml:"tls" mapstructure:"tls"`
8787

88-
// Server work home directory.
89-
WorkHome string `yaml:"workHome" mapstructure:"workHome"`
90-
9188
// Server dynamic config cache directory.
9289
CacheDir string `yaml:"cacheDir" mapstructure:"cacheDir"`
9390

0 commit comments

Comments
 (0)