News for hackers. Stuff that matters.
Re:Caddy – a modern web server (vs. Nginx) by notacoward on Monday January 09, 2017 @12:35PM (#13358012)
> every middleware you want to use needs to be included into the binary and if it’s not, you need to re-compile the program

Having to recompile to add functionality that alternatives provide as dynamically loaded plugins is insane. This is 2017. Linux has had loadable kernel modules since 1995, and I worked on them for other versions of UNIX as far back as 1991. I understand that it's hard for a Go program to support plugins written in other languages using a more conventional runtime. No problem there. However, there's just no excuse for relying on recompilation instead of dynamically loading modules also written in Go and thus using the same runtime. I really want to like Go, but as long as the Go community clings to long-discredited ideas regarding things like packaging and distribution and symbol versioning I just don't feel like I can depend on it to build infrastructure that will remain robust over time.

Re:Caddy – a modern web server (vs. Nginx) by mholt on Monday January 09, 2017 @01:28PM (#13358501)
One of the advantages of Caddy is its purely static binaries. You don't even need libc to run Caddy, and that goes for any platform. The dynamic loading of plugins is at odds against this advantage.

> However, there's just no excuse for relying on recompilation instead of dynamically loading modules also written in Go and thus using the same runtime.

Actually there is.

Go plugins are something we're looking at, but it's complicated and the technology is currently immature. Please read this forum thread in full: https://forum.caddyserver.com/t/go-1-8-plugin-model/934?u=ma...

Re:Caddy – a modern web server (vs. Nginx) by kmeade on Monday January 09, 2017 @01:57PM (#13358751)
Nice to see you on here, Mr Holt. Thank-you for the great work you've done with Caddy.

Like the rest of Caddy, I find the plug-in system to be simple and solid. Some people just seem to like complexity. (smile)

Is there any way to query what plug-ins are bound into a Caddy exe? (given that I'm a non-Go-programming, Windows guy)

An idea I had for the website was to allow us to sign in and have accounts. Downloads and plug-in preferences could be tracked. (It might even lead to a way to pry some money out of cheapskates like me with premium plug-ins and whatnot.)

Re:Caddy – a modern web server (vs. Nginx) by mholt on Monday January 09, 2017 @02:22PM (#13358959)
Glad you like Caddy!

> Is there any way to query what plug-ins are bound into a Caddy exe?

Run `caddy -plugins`.

The new Caddy website -- coming out hopefully later this month -- will allow developers to create accounts and release their plugins themselves, without me having to do it manually. I have given some thought to allow anyone to create an account but I need to work out some details for monetization first, if that's the route it takes. Thank you!

Re:Caddy – a modern web server (vs. Nginx) by notacoward on Monday January 09, 2017 @01:51PM (#13358707)
Good to hear that Caddy might support real plugins, either optionally or by default. Please note that my criticism was not targeted at the Caddy developers. It's not your fault that the Go core developers have dragged their feet so long on making such basic functionality available, or that the Go community in general has enabled such dereliction. Writing Go code seems like it might be quite pleasant. Integrating Go code into the rest of that ecosystem is what gives me a huge "this isn't a safe way to do things" vibe.
Re:Caddy – a modern web server (vs. Nginx) by xiaoma on Tuesday January 10, 2017 @02:00AM (#13363215)
Hmm... I don't think I've ever in my life worked on a platform where I couldn't get libc.

It sound like a neat project where there are some good defaults and where most weaknesses (performance, flexibility, etc) come from golang. It would be interesting to see a rewrite in another language.

Re:Caddy – a modern web server (vs. Nginx) by lokedhs on Tuesday January 10, 2017 @07:08AM (#13364250)
Why is this seen as a benefit? If a severe security issue is found in libc, I have to recompile all software to take advantage of it? Who thought that was a good idea?
Re:Caddy – a modern web server (vs. Nginx) by tmpxkdks on Tuesday January 10, 2017 @11:39AM (#13366142)
AFAIK, Go doesn't use libc.

Anyway, it is still a problem if you encounter a bug in any dependencie: you have to recompile every application using it.

Re:Caddy – a modern web server (vs. Nginx) by mholt on Wednesday January 11, 2017 @12:12AM (#13371927)
Bare containers don't have libc, for instance.
Re:Caddy – a modern web server (vs. Nginx) by notheguyouthink on Monday January 09, 2017 @12:41PM (#13358052)
> I really want to like Go, but as long as the Go community clings to long-discredited ideas regarding

I'm confused, aren't Go plugins exactly the feature you want? And on that note, it was just introduced as of 1.8, wasn't it?

Seems a bit harsh to criticize a project for not using (during it's development time) unfinished and not production ready features.

Re:Caddy – a modern web server (vs. Nginx) by notacoward on Monday January 09, 2017 @01:56PM (#13358741)
See my response to mholt in this thread. I wasn't criticizing Caddy so much as Go itself. Go has been around for about seven years now. While it's nice that such an obvious and serious shortcoming has been addressed recently, it has still taken way too long IMO. Plus, we're still stuck with "vendoring" and other community-embraced practices that are bad for long-term maintainability. People have been led in a bad direction, and I'm not about to let the leaders off the hook for that.
Re:Caddy – a modern web server (vs. Nginx) by mwpmaybe on Monday January 09, 2017 @07:41PM (#13361476)
The Caddy web site provides a helpful download link where you can select your architecture and addons/features and receive a binary. You can easily point a script at it, like in this Ansible role[0], for instance.

0. https://github.com/antoiner77/caddy-ansible

Re:Caddy – a modern web server (vs. Nginx) by n1try on Monday January 09, 2017 @12:43PM (#13358063)
Yes, I agree with you that this is not very helpful, especially for larger production environments. I don't know if they might refactor the middleware system to a more dynamic way some time.
Re:Caddy – a modern web server (vs. Nginx) by tscs37 on Monday January 09, 2017 @01:22PM (#13358442)
The next Go version will provide dynamic plugins to be loaded on runtime (not unloaded though).

Caddy dev's are probably going to be all over that.