static-server: an HTTP server in Go for static content
eli.thegreenplace.net
static-server: an HTTP server in Go for static content
1–10 of 67 posts
Re: static-server: an HTTP server in Go for static content
#2[0] https://github.com/eliben/static-server/blob/3ce83524ed54298...
Re: static-server: an HTTP server in Go for static content
#3While I love Go, have we gotten this lazy that we need a package for this? Go does this in 3 lines minimum, like you describe in your blogpost. However, in your package you expose the ability to kill your server [0] without any security. That’s a huge vulnerability. I know you’ll say “It’s just a static server, meant for serving static stuff” but it will be indexed by pkg.go.dev, people will use this outside your int…
Re: static-server: an HTTP server in Go for static content
#4While I love Go, have we gotten this lazy that we need a package for this? Go does this in 3 lines minimum, like you describe in your blogpost. However, in your package you expose the ability to kill your server [0] without any security. That’s a huge vulnerability. I know you’ll say “It’s just a static server, meant for serving static stuff” but it will be indexed by pkg.go.dev, people will use this outside your int…
The shutdown endpoint is used for robust testing; I suppose I can hide it a bit more, like using an environment variable or something.
Re: static-server: an HTTP server in Go for static content
#5While I love Go, have we gotten this lazy that we need a package for this? Go does this in 3 lines minimum, like you describe in your blogpost. However, in your package you expose the ability to kill your server [0] without any security. That’s a huge vulnerability. I know you’ll say “It’s just a static server, meant for serving static stuff” but it will be indexed by pkg.go.dev, people will use this outside your int…
While true, I don't think the author should refrain from making code available based on the potential negatives from others using code they didn't even bother to read the documentation for.
Re: static-server: an HTTP server in Go for static content
#6While I love Go, have we gotten this lazy that we need a package for this? Go does this in 3 lines minimum, like you describe in your blogpost. However, in your package you expose the ability to kill your server [0] without any security. That’s a huge vulnerability. I know you’ll say “It’s just a static server, meant for serving static stuff” but it will be indexed by pkg.go.dev, people will use this outside your int…
These kind of servers are useful for quickly serving a folder of files locally. Security isn't a primary concern for these kind of use cases.
Re: static-server: an HTTP server in Go for static content
#7Re: static-server: an HTTP server in Go for static content
#8Re: static-server: an HTTP server in Go for static content
#9 $ caddy file-server
It does templates, TLS, and other production things really easily from the command line too, including automatically getting certificates: $ caddy file-server --domain example.com
Done!I think projects like static-server are wonderful learning examples of how to get Useful Things done in Go.