-
Notifications
You must be signed in to change notification settings - Fork 0
/
flags.go
74 lines (65 loc) · 1.66 KB
/
flags.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package main
import (
"github.com/urfave/cli/v2"
)
func newOdooURLFlag() *cli.StringFlag {
return &cli.StringFlag{
Name: "odoo-url",
Usage: "Odoo Base URL",
Required: true,
EnvVars: []string{"ODOO_URL"},
}
}
func newOdooDBFlag() *cli.StringFlag {
return &cli.StringFlag{
Name: "odoo-db",
Usage: "Odoo Database name",
Required: true,
EnvVars: []string{"ODOO_DB"},
}
}
func newLogLevelFlag() *cli.IntFlag {
return &cli.IntFlag{
Name: "log-level",
Usage: "Log verbosity level",
EnvVars: []string{"LOG_LEVEL"},
}
}
func newSecretKeyFlag() *cli.StringFlag {
return &cli.StringFlag{
Name: "secret-key",
Usage: "Secret Key (e.g. to encrypt cookies). Create a new key with 'openssl rand -base64 32'",
Required: true,
EnvVars: []string{"SECRET_KEY"},
}
}
func newListenAddress() *cli.StringFlag {
return &cli.StringFlag{
Name: "listen-address",
Usage: "The interface address where the web server should listen on",
EnvVars: []string{"LISTEN_ADDRESS"},
Value: ":4200",
}
}
func newTLSCertFlag() *cli.StringFlag {
return &cli.StringFlag{
Name: "tls-cert",
Usage: "The path to a certificate file to serve",
EnvVars: []string{"TLS_CERT"},
}
}
func newTLSKeyFlag() *cli.StringFlag {
return &cli.StringFlag{
Name: "tls-key",
Usage: "The path to a certificate private key file to serve",
EnvVars: []string{"TLS_KEY"},
}
}
func newDefaultTimezoneFlag() *cli.StringFlag {
return &cli.StringFlag{
Name: "default-timezone",
Usage: "Default timezone to use in report calculations if unspecified in employee's records",
EnvVars: []string{"DEFAULT_TZ"},
Value: "Europe/Zurich",
}
}