Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
Config Structure Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
MostPow3rful committed Oct 25, 2023
1 parent 529b548 commit d7ed6bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
19 changes: 12 additions & 7 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Log struct {

type User struct {
Name string `yaml:"name"`
PassWord string `yaml:"pass_word"`
Password string `yaml:"password"`
Cmds []string `yaml:"cmds"`
}

Expand All @@ -42,14 +42,19 @@ func (conf *Config) BasicCheck() error {
}

func DefaultConfig() *Config {
config := &Config{}
config.Log.Path = "ttrace.log"
config.Name = "time_trace"
config.Server.IP = "localhost"
config.Server.Port = "7070"
config := &Config{
Server: Server{
IP: "localhost",

Check failure on line 47 in config/config.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofmt`-ed with `-s` (gofmt)
Port: "7070",
},
Log: Log{
Path: "ttrace.log",
},
Name: "time_trace",
}
rootUser := User{
Name: "root",
PassWord: "super_secret_password",
Password: "super_secret_password",
Cmds: []string{"*"},
}
config.Users = append(config.Users, rootUser)
Expand Down
3 changes: 2 additions & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ log:

users:
- name: root
pass_word: super_secret_password
password: super_secret_password
cmds:
- '*'

# Also you can use this for multiple users and limited commands
# users:
# - name: root
Expand Down

0 comments on commit d7ed6bf

Please sign in to comment.