This WSGI app provides bounce URLs to HTML-driven webrings.
- Random site:
/random?ring=...&from=...
- Next site:
/next?ring=...&from=...
- Previous site:
/prev?ring=...&from=...
See the bounce URLs? The ring
argument should be a URL to a webpage. The app will scan that webpage for <a>
elements with their rel
attribute set to "webring-member"
. Example:
<p>Welcome to my Grand Canyon webring!!! The members of this ring are:</p>
<ul>
<li><a rel="webring-member" href="https://example.org/">Best picture spots in the Grand Canyon</a></li>
<li><a rel="webring-member" href="https://example.net/">History: The Grand Canyon</a></li>
</ul>
Additionally, a second argument from
should contain the member site you're
originating from, i.e. the user's current location. With both arguments, ring
and from
, the
app can now shuttle the user to the correct next website.
And that's how it works.
Invoking webring_bounce.py
will start Python's built-in WSGI server.
$ export WEBRING_WHITELIST="https://chillycider.github.io/webring/"
$ export CACHE_SPEC=sqlite://webring_cache.db
$ export HOST=127.0.0.1
$ export PORT=3000
$ python3 webring_bounce.py
webring_bounce v0.1
===================
Listening on 127.0.0.1 port 3000.
* Note: You are using the built-in Python WSGI server. If this service
* is intended to be accessible from the public Internet, then please
* use a more secure server such as gunicorn (Green Unicorn).
Here's a workable example for gunicorn.
$ gunicorn -k gevent -b 0.0.0.0:3000 -w 3 \
-e WEBRING_WHITELIST="https://chillycider.github.io/webring/" \
-e CACHE_SPEC=sqlite:///tmp/webring_cache.db \
webring_bounce:app
It's a security measure to stop bots from flooding the SQLite cache with URLs. It's also a first line of defense against abuse such as that described in issues #1 and #3.
Consider also that a strict whitelist makes it tough for instances to get too widely used, discouraging a single point of failure.
To increase the capabilities of HTML-only websites such as those hosted on Neocities.
© 2022 Charlie Murphy. This software is released under the terms of the Unlicense.
This project is open to new ideas and pull requests. Also, if you find a bug, feel free to tell us on the issue tracker.
If you want to submit a PR, I require that you include this disclaimer with your PR:
I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
Attaching that to your PR will keep the project unquestionably in the public domain.