Coder Social home page Coder Social logo

php-lg's Introduction

php-lg

PHP based Looking Glass script for service providers.

Demo: https://lg.otr.cx

Honestly, it's mostly ChatGPT. I wanted a looking glass script that was a bit more modern and a bit less dated. I also wanted something I could easily modify and intergrate into various website designs, for both IncogNET's main site and for AS210630.net which will get a facelift and a proper website, sometime.

Features:

  • PHP based (Only tested on PHP 8.0 and PHP 8.2, probably works on older stuff)
  • Built in rate limiting (Though nginx will do this better than PHP)
  • Doesn't allow you to enter bogons by default, but you can adjust this to blacklist other subnets (IPv4 and IPv6)
  • You can also block certain hostnames, if you so desire it. (Currently 'localhost' is the only blocked hostname)
  • It actually doesn't look too bad on mobile. That was an accident, I don't give a shit about mobile functionality.
  • It's only three files. (index.php, result.php, style.css)

System Requirements:

  • PHP

(Tested on Debian 12 w/ PHP 8.X)

To Do:

  • Make the design... better.
  • Probably going to add some test files.
  • More user defined variables to make it easier for you to use this how you want it.
  • Add speedtest features, probably.

I don't want to over complicate this. The goal is to just have a basic and easy to use looking glass script that is both easy to modify and intergrate into existing website designs.


Nginx Ratelimit

Top of Nginx config:

limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;

In server block:

# Rate limiting
location ~ ^/(result.php) {
    limit_req zone=one burst=5;
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

php-lg's People

Contributors

incognify avatar kekorder avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.