Skip to content

Repository files navigation

Purdue Hackers webring

GitHub Actions Workflow Status badge Codecov badge License badge

A webring for the members and friends of the Purdue Hackers club.

This project is a Rust web server which provides the functionality for our webring. It allows members to link from their sites to the webring, and upon a user clicking such a link, the webring server will figure out the next member in the ring and redirect the user there. It has some extra niceties which are described below.

Features

  • Fast & lightweight
  • Easy configuration using a TOML file
  • Customizable index & error pages using templates
  • Beautiful error handling (even for crashes — try it!)
  • Automatically skips sites that are down or broken
  • Notifies members on Discord when an issue is detected with their site
  • High test coverage to ensure program correctness

Design

The server is written in Rust using the Tokio asynchronous runtime. This allows single threads to process possibly many requests at once, giving us incredible performance. We make heavy use of caching and lock-free atomics where possible to ensure each request is processed as quickly as it can be.

In a not-very-academically-rigorous benchmark, we were able to serve ~15,000 requests per second from one instance of the webring running on an AWS EC2 t2.micro VM.

Running in a container

Build the image with Docker from the repository root:

docker build --tag ghcr.io/purduehackers/webring:local --file Containerfile .

The image includes the static assets, listens on container port 80, and expects its configuration at /etc/webring/webring.toml. Start it with:

docker run --rm -it \
  --name webring \
  -p 8080:80 \
  -v ./webring.toml:/etc/webring/webring.toml:ro \
  --shm-size=1G \
  --cap-drop=ALL \
  --cap-add=NET_BIND_SERVICE \
  --security-opt no-new-privileges:true \
  --security-opt seccomp=./ci/deploy/seccomp_profile.json \
  ghcr.io/purduehackers/webring

You can mount volumes/directories on the following paths:

  • /usr/share/webring/static: the default static web content directory

Production images are published to GitHub Container Registry with the short Git commit as their tag. The newest image built from master is also tagged latest.

The Docker Compose specification used for the production deployment is provided at ci/compose.yml.

License

Copyright (C) 2025 members of Purdue Hackers

The Purdue Hackers webring is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Want to join?

  1. Be a member of Purdue Hackers.

  2. Add the following links to your site:

    <a href="https://ring.purduehackers.com/previous">Previous</a>
    <a href="https://ring.purduehackers.com/">Purdue Hackers webring</a>
    <a href="https://ring.purduehackers.com/next">Next</a>

    You can style them how you'd like, e.g. by replacing the text of each link with whatever you want. However, they must be visible on your site's homepage, not hidden away somewhere. The next and previous links must not have a target attribute, to ensure consistent behavior when traversing the ring.

  3. Click the next or previous link on your site. It should return a "400 Bad Request" error with the reason being that you're not a member of the webring.

    If it instead says that the request doesn't indicate which site it comes from, try the following (in this order):

    1. Remove the rel="noreferrer" attribute from the links in your HTML.
    2. Add the referrerpolicy="origin" attribute to the links in your HTML.
    3. Add ?host=<your-domain> to the /next and /previous URLs.
    4. Ping Kian in #webring after trying the two steps above.
  4. Send a message in #webring with your desired name (for the index page) and your site URL.

About

Purdue Hackers webring

Topics

Resources

Stars

8 stars

Watchers

18 watching

Forks

Packages

Used by

Contributors

Languages