Giter Club home page Giter Club logo

ippls's Introduction

ippls

ippls is a super basic API to get the remote IP address of your current machine. Written in Python using Flask.

Installation & running (development)

First, clone or download the ippls repository. Then execute the following commands to run ippls using Flask's built-in server:

cd ippls
python3 -m venv ipplsvenv
source ipplsvenv/bin/activate
pip install flask
python src/ippls.py

This will run the application using Flask's built-in test server. This is however not a solution suitable for in a production environment.

Production installation

To run ippls in a production environment, separate application and HTTP servers are needed. For this, I use gunicorn as the WSGI application server and nginx as HTTP server.

First, clone or download ippls and move everything to /opt/ippls. Then:

cd /opt/ippls

python3 -m venv ipplsvenv
source ipplsvenv/bin/activate
pip install flask gunicorn

Now you should have a working installation of all the dependencies in your python virtual environment. You can now either directly run ippls using gunicorn like this:

cd /opt/ippls
source ipplsvenv/bin/activate
cd src
gunicorn --bind 127.0.0.1:5000 wsgi:app

Or, for a more automated setup, you can create a systemd service. With some minor modifications based on where you installed ippls on your system, you can copy the ippls.service file to /etc/systemd/system/.

Sample nginx configuration

If you're starting gunicorn manually or you're using a systemd service, gunicorn still needs a reverse proxy server. For this, you can use nginx.

To use nginx as a reverse proxy for ippls, add the following four lines to the server block in your nginx configuration:

location /ippls/ {
    proxy_pass http://127.0.0.1:5000/;
    proxy_set_header X-Real-IP $remote_addr;
}

To do

  • .deb package
  • Configuration file

License

GNU AGPLv3 image

Copyright (c) 2018, 2019, 2020 Martijn

ippls is available under the terms of GNU Affero General Public License, either version 3
of the License or (at your option) any later version.

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.