| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "flag" |
| 5 | "strings" |
| 6 | ) |
| 7 | |
| 8 | var port = flag.Int("port", 8080, "Port to listen on") |
| 9 | var rootDir = flag.String("root-dir", "", "Path to generate DNS sec keys") |
| 10 | var config = flag.String("config", "", "Coredns config file name") |
| 11 | var db = flag.String("db", "", "DNS records db file name") |
| 12 | var zone = flag.String("zone", "", "Zone domain") |
| 13 | var publicIPs = flag.String("public-ip", "", "Comma separated list of public IPs of the pcloud environment") |
| 14 | var privateIP = flag.String("private-ip", "", "Private IP of the pcloud environment") |
| 15 | var nameserverIPs = flag.String("nameserver-ip", "", "Comma separated list of nameserver IPs") |
| 16 | |
| 17 | func main() { |
| 18 | flag.Parse() |
| 19 | publicIP := strings.Split(*publicIPs, ",") |
| 20 | nameserverIP := strings.Split(*nameserverIPs, ",") |
| 21 | fs := osFS{*rootDir} |
| 22 | store, ds, err := NewStore(fs, *config, *db, *zone, publicIP, *privateIP, nameserverIP) |
| 23 | if err != nil { |
| 24 | panic(err) |
| 25 | } |
| 26 | server := NewServer(*port, *zone, ds, store, nameserverIP) |
| 27 | server.Start() |
| 28 | } |