Skip to content

A temporary static web host usable via cURL.

License

Notifications You must be signed in to change notification settings

Fraetor/tmpweb.net

Repository files navigation

pre-commit.ci status

A temporary website hosting service, usable programmatically.

Installation

  • Clone this git repository.
git clone https://github.com/Fraetor/tmpweb.net.git
  • Create a venv (optional, but highly recommended)
python3 -m venv venv
source venv/bin/activate
  • Install the dependencies: pip install -r requirements.txt
  • Configure NGINX to act as a proxy to the gunicorn server. See nginx.conf and tmpweb.net.conf for example configurations.
  • Configure src/config.toml.
  • Copy static files into hosting directory: python3 install.py
  • Reload NGINX
nginx -s reload

Requirements

  • Recent Python 3 (>= 3.11 due to tomllib usage)
  • gunicorn
  • NGINX web server

Usage

Once NGINX is configured correctly, simply run ./run-tmpweb.sh.

To delete all expired sites pass a DELETE request from a loopback address.

I'd recommend adding this to the crontab:

# Run tmpweb.net application server on startup.
@reboot cd /var/www/tmpweb/tmpweb.net ; ./run-tmpweb.sh

# Delete expired websites for tmpweb.net.
0 */6 * * * curl -X DELETE http://127.0.0.1:8000

Roadmap/To Do

  • Add tests.
  • Improve front page, including adding terms of use.
  • Migrate to shared infrastructure.
  • Add better installation instructions.

Licence

This software is available under the MIT Licence.

About

A temporary static web host usable via cURL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published