A production-ready web server for qwerty.sh with minimal dependencies.
Redirect HTTP requests to HTTPS.
curl qwerty.sh # Show a meaningful error and exit non-zero.
curl -sSL qwerty.sh # Redirect to https://qwerty.sh.
By default, serve the latest release of the qwerty.sh shell script.
curl -sSL qwerty.sh
Support downloading a specific version or git reference:
curl -sSL qwerty.sh/v0.6.3
curl -sSL qwerty.sh/605ccd5
- Python 3.4+
- git
- Serve a portable shell script at the qwerty.sh domain via HTTPS.
- Serve a specific VERSION of the shell script at qwerty.sh/VERSION.
- Each published version shall be published forever.
- Published versions shall guarantee that they have no changes over time.
- All HTTP responses shall redirect to the HTTPS location of the same path.
- HTTPS shall be terminated by a proxying httpd.
- HTTPS shall support TLSv1.2.
- All HTTP and HTTPS responses shall have a shell body:
- 200 OK -- Only when serving the qwerty.sh file itself.
- 301 MOVED PERMANENTLY
- 400 BAD REQUEST
- 404 NOT FOUND
- 500 INTERNAL SERVER ERROR
- 502 BAD GATEWAY -- Loaded separately as a static file in proxying httpd.
- Each non-200 shell body shall be meaningful with error and exit code.
- Each shell body shall expect the user to pipe it into
sh
. - Minimize overhead and response time of web services.
- Minimize dependencies as to allow for simple self-hosting of web services.
- Expose configuration variables.
- It is okay to hardcode "qwerty.sh" as to have shell code be self-documenting.
Run:
make run
Test:
curl -sSL localhost:8001 | sh -s - --help
curl -sSL localhost:8001/v0.6.3 | sh -s - --version
See: Configuration files for qwerty.sh deployment on a single server.
Clone the qwerty.sh repository and checkout the default version to serve. Prepare:
make install
Use a process manager to run these, and set WORKERS based on number of CPUs:
WORKERS=4 PORT=8001 make http-proxied
WORKERS=4 PORT=8002 make https-proxied
Use an industrial httpd to proxy:
- port 80 to 8001
- port 443 to 8002
The strength of qwerty.sh depends on the HTTPS implementation.