feat: add debug flag
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"port": 8080,
|
||||
"databasePath": "./data.sqlite",
|
||||
"hostName": "lycoris.lab"
|
||||
"hostName": "lycoris.lab",
|
||||
"debug": true
|
||||
}
|
@@ -12,6 +12,7 @@ type Config struct {
|
||||
TemplateDirectoryPath string `json:"templateDirectoryPath"`
|
||||
HostKeyDirectoryPath string `json:"hostKeyDirectoryPath"`
|
||||
HostName string `json:"hostName"`
|
||||
Debug bool `json:"debug"`
|
||||
}
|
||||
|
||||
const defaultPort = 8080
|
||||
|
@@ -68,7 +68,9 @@ func Initialize(config Config) (Services, error) {
|
||||
return Services{}, err
|
||||
}
|
||||
bundb := bun.NewDB(db, sqlitedialect.New())
|
||||
bundb.AddQueryHook(bundebug.NewQueryHook(bundebug.WithVerbose(true)))
|
||||
if config.Debug {
|
||||
bundb.AddQueryHook(bundebug.NewQueryHook(bundebug.WithVerbose(true)))
|
||||
}
|
||||
|
||||
sshProxy := sshproxy.New()
|
||||
|
||||
|
@@ -27,7 +27,8 @@ sudo cat >/opt/tesseract/config.json <<EOF
|
||||
{
|
||||
"port": 80,
|
||||
"databasePath": "./data.sqlite",
|
||||
"hostName": "HOSTNAME"
|
||||
"hostName": "HOSTNAME",
|
||||
"debug": false
|
||||
}
|
||||
EOF
|
||||
|
||||
|
Reference in New Issue
Block a user