feat: added TCP healthcheck with nc, better clipboard support, fixed docker deployments and minor changes#971
Conversation
Author
|
(I am gonna lose it) |
…docker deployments and minor changes
Author
|
(fixed it) |
Owner
|
AWESOME looks good!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, I love croc and I've been reading through the codebase today!
This PR should solve #967, provides a possible solution to #968 and allows wider and better clipboard support without additional dependencies. @schollz
The previous implementation worked fine but only covered Windows, macOS, and Linux (running Xorg with
xclipor Wayland withwl-copy). Now the clipboard will work as expected on less popular systems such as the BSDs and Solaris, also falling back toxselifxclipis unavailable!I manually ran golangci-lint on the codebase and improved things here and there.
Please review my other changes, these are minor and include some formatting improvements.
Using
gsa(go size analyzer) on this I get an 11MB executable from:CGO_ENABLED=0 go build -ldflags '-s -w -extldflags "-static"' -o crocwhich might be a bit bloated. The whole codebase is pretty big.
Here are some additional notes and observations.
The README is telling Alpine Linux users to install both bash and GNU coreutils to run this natively which is a big ask IMO. Maybe rewrite the installer in POSIX sh so Busybox ash can run it.
That said, using the Docker image works great both as a client and relay!
The installer checks
$EUIDand then tries to usesudoif that's not0. This won't work for anyone usingdoasoversudoor something else. Might be worth to tell doas users to installdoas-sudo-shim!There are other tools with similar to
croc, such aswormhole-williamthat's also made in Go.Why -git over the expected standard --git and use a personal fork of
urfave/cliinstead of the upstream v3?While there aren't many environment variables used, you could use
godotenvand a -e/--environment flag to point to a specific .env type file.A flag to specify the number of processors to use could be beneficial for performance tuning.
There's more!
#943 (on goroutines) may be worth investigating.
#946 is a significant bug that should be addressed.
The codebase generally lacks comments and has a deeply nested structure(e.g., making changes requires updates in multiple places).
This was my attempt at contributing to croc.
I have a long way ahead in programming and hope I've been useful.
Thank you for the work you all put in!