A lightweight, stateless application runner built with FastAPI. This service allows you to execute HTML/JS applications that are encoded directly into the URL, ensuring that the application state is contained entirely within the link itself.
- Stateless Execution: Applications are delivered via URL parameters.
- Security: URL payloads are signed with a server-side secret key to prevent tampering.
- Compression: Payloads are zlib-compressed to minimize URL length.
- Admin Interface: Built-in tool to generate signed links from HTML/JS code.
- Dockerized: Ready to deploy with Docker and Docker Compose.
- Docker
- Docker Compose
-
(Optional) Pull the latest image:
docker pull ghcr.io/montelibero/stateless_app_runner:latest
-
Clone the repository and navigate to the project root.
-
Start the service:
docker-compose up -d
-
Access the application:
- Runner:
http://localhost/(will show a default message if no payload is provided) - Admin/Generator:
http://localhost/admin
- Runner:
- Go to
http://localhost/admin. - Enter the HTML/JS code you want to run.
- Click "Generate".
- The system will provide a signed URL. Opening this URL will render and execute your code.
The application is configured via environment variables in docker-compose.yml:
APP_DOMAIN: The base domain for generated links (default:http://mtlminiapps.us).SECRET_KEY: A secret key used to sign and verify payloads.- Important: If not set, the server will generate a random key on startup and log it to the console. For production consistency, set this variable.
To run tests locally:
# Install dependencies
pip install -r app/requirements.txt
# Run tests
pytest- Compression: The HTML content is compressed using
zlib(level 9). - Encoding: The compressed data is encoded using
base64(URL-safe). - Signing: An HMAC-SHA256 signature is generated using the
SECRET_KEY. - Execution: When the link is opened, the server verifies the signature, decodes, decompresses, and serves the content.