I use the ligolo-ng library packages in my own application, and noticed when attempting to listen on a port that was already in use, instead of returning an error the whole program would exit due to a call to logrus.Fatal. According to Go best practices, libraries should avoid exposing panics and prefer to log/return errors when possible (and I would say this extends to functions like logrus.Fatal), so that's what this PR attempts to do. It also adds a check to make sure port 80 is available before starting a web server for Let's Encrypt cert generation.
Thanks for all your work on ligolo-ng, it is a fantastic tool!
I use the ligolo-ng library packages in my own application, and noticed when attempting to listen on a port that was already in use, instead of returning an error the whole program would exit due to a call to
logrus.Fatal
. According to Go best practices, libraries should avoid exposing panics and prefer to log/return errors when possible (and I would say this extends to functions like logrus.Fatal), so that's what this PR attempts to do. It also adds a check to make sure port 80 is available before starting a web server for Let's Encrypt cert generation.Thanks for all your work on ligolo-ng, it is a fantastic tool!