MCPcopy
hub / github.com/syncthing/syncthing / DefaultConfig

Function DefaultConfig

lib/syncthing/utils.go:70–82  ·  view source on GitHub ↗
(path string, myID protocol.DeviceID, evLogger events.Logger, skipPortProbing bool)

Source from the content-addressed store, hash-verified

68}
69
70func DefaultConfig(path string, myID protocol.DeviceID, evLogger events.Logger, skipPortProbing bool) (config.Wrapper, error) {
71 newCfg := config.New(myID)
72
73 if skipPortProbing {
74 slog.Info("Using default network port numbers instead of probing for free ports")
75 // Record address override initially
76 newCfg.GUI.RawAddress = newCfg.GUI.Address()
77 } else if err := newCfg.ProbeFreePorts(); err != nil {
78 return nil, err
79 }
80
81 return config.Wrap(path, newCfg, myID, evLogger), nil
82}
83
84// LoadConfigAtStartup loads an existing config. If it doesn't yet exist, it
85// creates a default one. Otherwise it checks the version, and archives and

Callers 2

GenerateFunction · 0.92
LoadConfigAtStartupFunction · 0.85

Calls 4

NewFunction · 0.92
WrapFunction · 0.92
ProbeFreePortsMethod · 0.80
AddressMethod · 0.45

Tested by

no test coverage detected