README for outbound
This project is a small Flask app that merely redirects to the link farther down the URL. The purpose is to enable my web server to record visits to outbound links. This is not a URL shortener or obfuscator. It's a cheap way for me to see what links my site vistors use, without using javascript.
Upstream
The original project is at https://bgstack15.ddns.net/cgit/outbound/.
Features/design goals
- redirect only if referer is in whitelist
- simple web config
- simple app config
- send to web server logs the redirects, or else 404s for invalid link requests
Alternatives
Probably some "proper" web analytics suite or javascript garbage that I do not want to learn or use.
Reason for existence
To show what links on my site are used.
Using
Web app
Run a simple dev environment.
FLASK_APP=outbound.py FLASK_DEBUG=True flask run --host=0.0.0.0 --extra-files outbound.conf
Testing the web app with curl
$ curl --header "Referer: http://d2-03a:5000/" --header 'Debug: true' http://d2-03a:5000/http://server3/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="http://server3/">http://server3/</a>. If not click the link.
Improvements
- Provide an apache wsgi config?
- Provide an nginx wsgi config?
Dependencies
For the web app:
- apache with
mod_wsgi
- python3-flask
References
- fuss.conf.example
- fuss.py
- coupons_web.py
- https://werkzeug.palletsprojects.com/en/2.2.x/serving/#werkzeug.serving.run_simple
- various fifconfig files
Internal documents
- ports.txt: outbound 4682/tcp