mirror of
https://github.com/octoleo/syncthing.git
synced 2025-03-21 10:12:21 +00:00
Set name of first node to the local hostname (fixes #121)
This commit is contained in:
parent
a98d75edaa
commit
f72ee7a69e
@ -126,6 +126,7 @@ func main() {
|
|||||||
|
|
||||||
if len(cfg.Repositories) == 0 {
|
if len(cfg.Repositories) == 0 {
|
||||||
infoln("No config file; starting with empty defaults")
|
infoln("No config file; starting with empty defaults")
|
||||||
|
name, _ := os.Hostname()
|
||||||
|
|
||||||
cfg, err = readConfigXML(nil)
|
cfg, err = readConfigXML(nil)
|
||||||
cfg.Repositories = []RepositoryConfiguration{
|
cfg.Repositories = []RepositoryConfiguration{
|
||||||
@ -136,7 +137,11 @@ func main() {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
cfg.Nodes = []NodeConfiguration{
|
cfg.Nodes = []NodeConfiguration{
|
||||||
{NodeID: myID, Addresses: []string{"dynamic"}},
|
{
|
||||||
|
NodeID: myID,
|
||||||
|
Addresses: []string{"dynamic"},
|
||||||
|
Name: name,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
saveConfig()
|
saveConfig()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user