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

Commit

Permalink
chore: config structure updated (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
MostPow3rful authored Oct 25, 2023
1 parent 529b548 commit 24609c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 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",
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
5 changes: 3 additions & 2 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ 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
# pass_word: super_secret_password
# password: super_secret_password
# cmd:
# - * # all commands.
# - name: developer
Expand Down

0 comments on commit 24609c3

Please sign in to comment.