-
Notifications
You must be signed in to change notification settings - Fork 0
/
files.go
31 lines (28 loc) · 886 Bytes
/
files.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
package ring
import (
"os"
"path/filepath"
)
var (
CAFile = configFile("ca.pem")
ServerCertFile = configFile("server.pem")
ServerKeyFile = configFile("server-key.pem")
ClientCertFile = configFile("client.pem")
ClientKeyFile = configFile("client-key.pem")
RootClientCertFile = configFile("root-client.pem")
RootClientKeyFile = configFile("root-client-key.pem")
NobodyClientCertFile = configFile("nobody-client.pem")
NobodyClientKeyFile = configFile("nobody-client-key.pem")
ACLModelFile = configFile("model.conf")
ACLPolicyFile = configFile("policy.csv")
)
func configFile(filename string) string {
if dir := os.Getenv("CONFIG_DIR"); dir != "" {
return filepath.Join(dir, filename)
}
homeDir, err := os.UserHomeDir()
if err != nil {
panic(err)
}
return filepath.Join(homeDir, ".goutube", filename)
}