feat: check automatically if uc can connect via Unix socket when running on cluster machine (#296)

* Check autom if we can connect via Unix socket

When there is no config, but a unix socket does exist, connect via the
unix socket. Prohibit saving the config if this is the case.

Fixes: #148

Use the new CutPrefix to shorten some code.

Signed-off-by: Miek Gieben <miek@miek.nl>

* remove error checking; it can not be hit

Signed-off-by: Miek Gieben <miek@miek.nl>

* Extra error text when logged in locally

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2026-04-13 16:37:48 +10:00
committed by GitHub
parent f60a9ff293
commit dd989a281e
3 changed files with 27 additions and 12 deletions
+5
View File
@@ -71,3 +71,8 @@ func Chown(path, username, group string) error {
}
return nil
}
func Exists(path string) bool {
_, err := os.Stat(path)
return err == nil
}