Maybe I should implement IP bans on Glix?
yep, just add stuff that glitch wont/dont have time to add, lol
How do you plan on getting around cloudflare? There is a way in PHP but I have no idea in Express or any other languages.
There are drivers, pretty sure you need Apache for them to work.
@m4sugar There’s a Node.js package aswell
Can you explain the concept or method how it is done using PHP? Might be able to figure out a way for Express…
This is what I do on my website:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
$_SERVER['HTTP_CF_CONNECTING_IP'] is the IP.
Can you explain what that piece of code does?
It checks is the server variable
$_SERVER['HTTP_CF_CONNECTING_IP'] is set, if it is, it sets the
$_SERVER['REMOTE_ADDR'] variable to
Thats what it looks like to me, correct me if I’m wrong.
I’ll most likely use something called iptables to block out specific IPs from my VPS, however that would be strictly prohibited to only run on port 80 and 443, and only deny access when the IP is banned on a specific pointer.
You can pretty much write it yourself. Apache or NGINX has the tools needed to implement IP bans, however, I doubt they can deny access on specific hosts, I don’t know.
If I’m going to implement this for Glix I’ll have to write a caddy plugin in Go
This would be a rather deprecated choice. The connecting remote might be a reverse-proxy, which therefore will ban the proxy instead of the user. You should look out for trusted proxies and make sure to use the
X-Forwarded-For header as the IP. However don’t trust the header until you’ve validated that the remote is trusted!
why not ip bans on the reverse proxy? Also this as a feature for glix would be nice
The reason I use this is because this is the method that Cloudflare says to do.
If I’m going to implement this I’ll write a plugin for Caddy
P.S. Caddy is the reverse proxy I’m using
Not Nginx? Nginx has more documentation online.
Caddy is as well very documented and more fit for my use.
NGINX is an extremey good web server, reverse proxy etc, but is rather an overkill for what I need.
Caddy also comes with a built-in admin API, which Glix takes use of. With NGINX you have to do a bunch of things to get all of the stuff caddy does automatic.
Caddy in my opinion is just easier and better to use.
I love it when things have built in admin