Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to create a new teamserver database #517

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions teamserver/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func init() {
// server flags
CobraServer.Flags().SortFlags = false
CobraServer.Flags().StringVarP(&flags.Server.Profile, "profile", "", "", "set havoc teamserver profile")
CobraServer.Flags().StringVarP(&flags.Server.Database, "database", "", "data/teamserver.db", "set havoc teamserver database")
CobraServer.Flags().BoolVarP(&flags.Server.Debug, "debug", "", false, "enable debug mode")
CobraServer.Flags().BoolVarP(&flags.Server.DebugDev, "debug-dev", "", false, "enable debug mode for developers (compiles the agent with the debug mode/macro enabled)")
CobraServer.Flags().BoolVarP(&flags.Server.SendLogs, "send-logs", "", false, "the agent will send logs over http(s) to the teamserver")
Expand Down
5 changes: 4 additions & 1 deletion teamserver/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ var CobraServer = &cobra.Command{
}
os.Exit(0)
}


if flags.Server.Database != "" {
DatabasePath = (flags.Server.Database)
}
Server = server.NewTeamserver(DatabasePath)
Server.SetServerFlags(flags)

Expand Down
1 change: 1 addition & 0 deletions teamserver/cmd/server/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type serverFlags struct {
Host string
Port string

Database string
Profile string
Verbose bool
Debug bool
Expand Down