syncthing/lib
André Colomb b9c6d3ae09
fix(config): skip GUI port probing for UNIX sockets (fixes #9855) (#9858)
When creating an initial default config, we usually probe for a free
TCP port.  But when a UNIX socket is specified via the `STGUIADDRESS=`
override or the `--gui-address=unix:///...` command line syntax, parsing
that option will fail during port probing.

The solution is to just skip the port probing when the address is
determined to specify something other than a TCP socket.

### Testing

Start with a fresh home directory each time.
1. Specify a UNIX socket for the GUI (works with this PR):

TMPHOME=$(mktemp -d); ./syncthing --home=$TMPHOME
--gui-address=unix://$TMPHOME/socket

2. Specify no GUI address (probes for a free port if default is taken,
   as before):

       TMPHOME=$(mktemp -d); ./syncthing --home=$TMPHOME

3. Specify a TCP GUI address (probes whether the given port is taken,
   as before):

TMPHOME=$(mktemp -d); ./syncthing --home=$TMPHOME
--gui-address=127.0.0.1:8385
2024-12-09 07:24:42 +00:00
..
api refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
assets lib/assets: MIME types, time formats (#8351) 2022-05-22 22:10:18 +02:00
automaxprocs all: Use own automaxprocs package that doesn't log (ref #9436) (#9437) 2024-02-27 13:05:19 +01:00
beacon style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00
build lib/sha256: Remove it (#9643) 2024-08-10 12:58:20 +01:00
config fix(config): skip GUI port probing for UNIX sockets (fixes #9855) (#9858) 2024-12-09 07:24:42 +00:00
connections refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
db refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
dialer style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00
discover refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
events style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00
fs refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
geoip lib/geoip, cmd/relaypoolsrv, cmd/ursrv: Automatically manage GeoIP updates (#9342) 2024-05-18 20:31:49 +03:00
httpcache cmd/stupgrades: Cache should apply to HEAD as well as GET 2023-02-22 12:22:52 +01:00
ignore fix(ignore): ensure normalization of patterns and paths match (fixes #9597) (#9717) 2024-09-28 17:16:44 +02:00
locations all: minimal set of changes for iOS app (#9619) 2024-07-31 07:31:14 +02:00
logger all: Use some Go 1.21 features (#9409) 2024-02-10 21:02:42 +01:00
model refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
nat style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00
netutil all: Remove lib/util package (#9049) 2023-08-21 19:44:33 +02:00
osutil refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
pmp style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00
protocol refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
rand all: Remove unused method receivers (#8462) 2022-07-28 17:32:45 +02:00
rc style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00
relay refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
s3 feat(ursrv): new metrics based approach 2024-09-30 14:16:27 -05:00
scanner refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
semaphore all: Remove lib/util package (#9049) 2023-08-21 19:44:33 +02:00
signature lib/sha256: Remove it (#9643) 2024-08-10 12:58:20 +01:00
sliceutil refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
stats style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00
stringutil all: Remove lib/util package (#9049) 2023-08-21 19:44:33 +02:00
structutil all: Remove lib/util package (#9049) 2023-08-21 19:44:33 +02:00
stun style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00
svcutil all: Remove lib/util package (#9049) 2023-08-21 19:44:33 +02:00
sync lib/model: Use a single lock (phase two: cleanup) (#9276) 2023-12-11 22:06:45 +01:00
syncthing refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
testutil all: Remove lib/util package (#9049) 2023-08-21 19:44:33 +02:00
tlsutil chore: enable TLS client cache for HTTPS where appropriate (#9721) 2024-09-24 08:55:04 +02:00
upgrade style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00
upnp style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00
ur refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
versioner refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
watchaggregator refactor: use modern Protobuf encoder (#9817) 2024-12-01 16:50:17 +01:00
weakhash style: gofumpt all the things (#9829) 2024-11-19 11:32:56 +01:00