Use interface name instead of cluster name

The cluster name option is not required anymore and
removed, the interface name is used to name the cluster
directly. For backward compatibility, the old path for storing
cluster state is tried as a fallback when loading.
This commit is contained in:
kaiyou
2020-05-17 12:18:55 +02:00
committed by Leo Antunes
parent ca3064f6a7
commit 129291e848
6 changed files with 31 additions and 13 deletions

View File

@ -35,7 +35,7 @@ func main() {
logrus.SetLevel(logLevel)
// Create the wireguard and cluster configuration
cluster, err := cluster.New(config.ClusterName, config.Init, config.ClusterKey, config.BindAddr, config.ClusterPort, config.UseIPAsName)
cluster, err := cluster.New(config.Interface, config.Init, config.ClusterKey, config.BindAddr, config.ClusterPort, config.UseIPAsName)
if err != nil {
logrus.WithError(err).Fatal("could not create cluster")
}
@ -46,7 +46,7 @@ func main() {
// Prepare the /etc/hosts writer
hostsFile := &etchosts.EtcHosts{
Banner: "# ! managed automatically by wesher " + config.ClusterName,
Banner: "# ! managed automatically by wesher interface " + config.Interface,
Logger: logrus.StandardLogger(),
}