News for hackers. Stuff that matters.
Re:Caddy 0.9 Released with All New Core by aexaey on Tuesday July 19, 2016 @04:37AM (#12120587)
There are some features in Caddy that are simply outstanding - HTTP/2 and Let's Encrypt integration, to name a few - both pretty much work out-of-the-box with zero-configuration.

On the other hand, there are still some gaping holes - for example, to block (or allow) a 192.168.0.0/17 IPv4 subnet in Caddy, one needs to do all of below:

- Install an addon [1];

- Which used to require recompilation, with 0.9 release you can just click an option during download, yay!;

- Add 128 ranges to cover this single subnet: 192.168.0.0-255, 192.168.1.0-255, ...192.168.127.0-255. Configuration doesn't support subnets, only ranges. And only ranges in last octet, i.e. 192.168.1.0-255 (meaning 192.168.1.0/24), or implied ranges by trailing octet(s) omission, i.e. 192.168 (meaning 192.168.0.0/16) [2].

Oh, and ipv6 filtering doesn't exist at all.

[1] https://caddyserver.com/docs/ipfilter

[2] Which is mildly confusing notation too, since traditional UNIX inet_aton() call would interpret this as 192.0.0.168. Try typing "ping 192.168" on Linux.

Re:Caddy 0.9 Released with All New Core by SEJeff on Tuesday July 19, 2016 @10:43AM (#12122068)
So in reality, you'd be much better served with an iptables rule or two instead of blocking at the Caddy server level. Sad
Re:Caddy 0.9 Released with All New Core by drdaeman on Tuesday July 19, 2016 @12:14PM (#12122577)
Except for iptables doesn't work on per-host or per-URL level (well, technically one could try with a string-matching, but that would be just a crude hack).
Re:Caddy 0.9 Released with All New Core by justinsaccount on Tuesday July 19, 2016 @04:59AM (#12120656)
go stdlib has functions for parsing cidr blocks (both v4 and v6) so adding support for subnets should not be that hard.
Re:Caddy 0.9 Released with All New Core by StavrosK on Tuesday July 19, 2016 @08:37AM (#12121339)
I love the super-simple configuration, but it comes with some tradeoffs. For example, last I checked, I couldn't forward some requests to a hostname to another machine, while serving certain URLs (e.g. /static) from the local machine.
Re:Caddy 0.9 Released with All New Core by mholt on Tuesday July 19, 2016 @10:10AM (#12121853)
You can do that now. There's 'except' in the proxy directive for that. And you can also define sites with paths in the address as another possibility.
Re:Caddy 0.9 Released with All New Core by StavrosK on Tuesday July 19, 2016 @11:14AM (#12122232)
Ah, fantastic. I'll download 0.9 and replace 0.8 with it, hopefully I won't need to change my existing Caddyfile too much.
Re:Caddy 0.9 Released with All New Core by newman314 on Tuesday July 19, 2016 @01:32PM (#12123249)
On a related note, I haven't used Caddy but have used lego (which Caddy uses under the hood) and lego makes amazingly easy to get certs via commandline and DNS challenge.

Literally, one line (without needing root). Happy user.

Re:Caddy 0.9 Released with All New Core by toupeira on Tuesday July 19, 2016 @02:47PM (#12123840)
I use letsencrypt.sh which also works well.
Re:Caddy 0.9 Released with All New Core by vesak on Tuesday July 19, 2016 @04:57AM (#12120646)
Wouldn't you normally want to do ip filtering on a lower level?
Re:Caddy 0.9 Released with All New Core by aexaey on Tuesday July 19, 2016 @05:07AM (#12120688)
Sure, if you want to serve TCP reset / ICMP port-unreachable to blocked users, then yes - iptables or external firewall is a more natural way to do it.

But what if you want to serve different content to "blocked" users? i.e. login page, "we're sorry" page, redirect to read-only version of the site, reminder to connect to office VPN, anything like that...

Another example - more than one site on the same (server) IP, and only part of them are (client) IP-restricted.

Re:Caddy 0.9 Released with All New Core by pritambaral on Tuesday July 19, 2016 @10:36AM (#12122020)
Considering that firewalls are the best tools to "filter" by IP ranges, I'd suggest this "hack": Reroute the "blocked" packets (my favourite method is DNAT with iptables) to a different webserver which only serves the special pages.
Re:Caddy 0.9 Released with All New Core by tychuz on Tuesday July 19, 2016 @10:03AM (#12121808)
>simply outstanding - HTTP/2 and Let's Encrypt integration

Simply simple de facto features basically are called outstanding now?

Re:Caddy 0.9 Released with All New Core by spdustin on Tuesday July 19, 2016 @10:23AM (#12121934)
Which other web server software intended to replace nginx or apache has HTTP/2 or Let's Encrypt as built-in functions?
Re:Caddy 0.9 Released with All New Core by moosingin3space on Tuesday July 19, 2016 @07:24PM (#12125715)
It's called "outstanding" because all of this functionality is incredibly easy to configure.