6 ms·
> 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 function
by notacoward 10y ago
> 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.
- notheguyouthink 10y ago> 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.
- notacoward 10y agoSee 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.
- n1try 10y agoYes, 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.
- tscs37 10y agoThe 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.
- mholt 10y agoOne 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=matt https://forum.caddyserver.com/t/go-1-8-plugin-model/934?u=ma...
- notacoward 10y agoGood 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.
- kmeade 10y agoNice 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.)
- mholt 10y agoGlad 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!
- mwpmaybe 10y agoThe 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 https://github.com/antoiner77/caddy-ansible