~gsthnz/satellite

ref: 08c1a5a59b68a33880f45218cdfad85b6e1b7c65 satellite/main.go -rw-r--r-- 532 bytes
08c1a5a5Paper Set minimum TLS version to TLS 1.2 1 year, 7 months ago
                                                                                
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 main

import (
	"flag"
	"fmt"
	"os"
)

var config *Config

func main() {
	var err error
	var configFile = flag.String("c", "/etc/satellite.toml", "Config file")
	flag.Parse()

	config, err = LoadConfig(*configFile)
	if err != nil {
		fmt.Printf("Error loading configuration: %+v\n", err)
		os.Exit(1)
	}
	if config.TLS.Directory == "" {
		fmt.Println("TLS certificate directory not set")
		os.Exit(1)
	}
	if len(config.Domain) == 0 {
		fmt.Printf("No domains defined on %s\n", *configFile)
		os.Exit(1)
	}

	startServer()
}