This is a tool to make local services served in a community network available to the outside internet. The intention is to
- lower the bar to create internet services
- increase accessibility from inside and outside the community network and thus make services in the network more attractive
You create an HTTP service in the local community network. Then, you go to this service installation for your community.
You put in your IP address, your server name and your port. When you submit, your website should be available under the hostname you entered.
The server is available as a docker image from niccokunzmann/dynamic-website-reverse-proxy.
docker pull niccokunzmann/dynamic-website-reverse-proxy
You can setup the server for your community in case the server is not there.
- Install docker.
You will need a 64 bit computer.
wget -O- https://get.docker.com | sh - Start the server replacing the configuration variables accordingly.
Now, the server should be available at http://localhost.
docker run -p "80:80" -e "DOMAIN=MY-DOMAIN" -d --rm niccokunzmann/dynamic-website-reverse-proxy - Once the server is available, you need to configure the router of yours to forward the traffic.
I.e. this could be your internet gateway available at http://192.168.0.1.
Somewhere you can find the "Port Forwarding" (DE: Portfreigabe/Portweiterleitung)
Here, you can configure the gateway to forward traffic
- from port 80 to your IP on port 80 (HTTP)
- from port 80 to your IP on port 443 (HTTPS)
- Setup a domain name. In case you have just a home router, you can use e.g. http://selfhost.eu to get a free of charge dynamic domain name.
- In order for other people to reach not only your domain name but also other services on this domain,
you need to setup a cname record.
- Example:
You registered
quelltext.selfhost.eufree of charge. Now, you pay 2€/year and you buyquelltext.eu. Then, you setup the CNAME record*.quelltext.euto point toquelltext.selfhost.eu. - You can also contact @niccokunzmann in an issue if you like to use a domain named
my-community.quelltext.eu. - Your community has a website e.g.
freifunk-potsdam.de. They can setupservice.freifunk-potsdam.deand*.service.freifunk-potsdam.deto point to your domain.
- Example:
You registered
- Configure your gateway (the router at your home) to update the IP address behind the domain name. Your gateway usually has a dyndns configuration which you can configure. This will update the registered dynamic domain name once your provider switches your IP address.
Once these steps are undergone, you should be able to access your server from the internet using your domain and be able to register new clients. Note that this looks like a lot bot this would be necessary for many more people to provide their services. Once this is done, they have a much easier process to share their site.
The configuration of the service is done via environment variables. This is the configuration you should touch:
DOMAINdefaultlocalhost
This is the domain your servers serves from. If DOMAIN is "test.freifunk.net", new a hostname "chocolate" is prepended so the website is served under "chocolate.test.freifunk.net".NETWORKdefault10.0.0.0/8
This is the network address of the accepted services. I.e. Freifunk in Potsdam covers10.22.0.0/16.MAXIMUM_HOST_NAME_LENGTHdefault50
This is the maximum length of a host name.DEFAULT_SERVERdefaultlocalhost:$PORT
The website served for each hostname that is not registered. By default, this will be the overview page of the web app.DEFAULT_DOMAINSdefault ``
This is a comma separated list of domain forwards for the nginx proxy. Examples:service.example.com->http://localhost:9001serves the page when the domainservice.example.comis requested.service.example.com->http://172.16.0.21serves172.16.0.21when the domainservice.example.comis requested.test1.example.com->http://172.16.0.21,test2.example.com->http://172.16.0.21serveshttp://172.16.0.21for the domainstest1.example.comandtest2.example.com.
PORTdefault9001
This is the port on which the app listens for connections.HTTP_PORTdefault80
This is the port on which nginx listens for connections.DEBUGdefaulttrue
Can betrueorfalse. A flag to make the app output more details when a crash happens.
This is configuration you can touch:
DATABASE
This is the place the data is stored when the service restarts.- default for the Python app is `` and nothing will be saved to a file.
- default for the docker container is
/data/db.picklewhich holds the state of the proxy.
SOURCE_CODE
This is the directory the currently running source code can be obtained from.- default for the Python app is the module directory.
- default for the docker container is
/app
NGINX_CONFThis is the path to the file with the replacednginxconfiguration in it.- default is
/tmp/nginx.conf. - if set to `` (empty),
nginxwill not be configured. `nginx` will only be configured if installed on the system.`
- default is
PERMISSIONSdefaults to./dynamic_website_reverse_proxy/permissions.txt
This is a list of actions for users on this system.
Run the server
python3 -m dynamic_website_reverse_proxy
Build the server and run it
docker build --tag niccokunzmann/dynamic-website-reverse-proxy . && docker run -p "9000:80" -e "DOMAIN=localhost:9000" -it --rm niccokunzmann/dynamic-website-reverse-proxy
Now, you can reach your server under http://localhost:9000.
Run the tests
tox
Run the tests for the website only:
tox -e web
- Nginx Proxy Manager
- Diskussion im FreiFunk-Forum
- Freifunk-Website-Proxy - this project's base
