(path string, myID protocol.DeviceID, evLogger events.Logger, skipPortProbing bool)
| 68 | } |
| 69 | |
| 70 | func 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 |
no test coverage detected