From 8a8a1ca7cd8ebdaefae305db909468d320c342c3 Mon Sep 17 00:00:00 2001 From: Kumi Date: Wed, 27 Nov 2024 12:43:40 +0100 Subject: [PATCH] feat: Add README and make port configurable via env Introduces a README file with setup and usage instructions for TypeNot, highlighting its privacy benefits and configuration options. Updates the application to allow port configuration with an environment variable, enhancing deployment flexibility. --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ app.py | 3 ++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5375d87 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# TypeNot - a privacy-friendly Typekit proxy + +TypeNot is a Flask app that acts as a proxy for Typekit fonts. It allows you to use Typekit fonts without disclosing your website visitors' IP addresses to Adobe. + +## How it works + +TypeNot works by fetching the font files from Typekit and serving them to the client. This way, the client's IP address is never disclosed to Adobe. It does not store any data about the client. + +## Setup + +1. Clone the repository + +```bash +git clone https://git.private.coffee/PrivateCoffee/typenot.git +cd typenot +``` + +2. Create a virtual environment and install the dependencies + +```bash +python3 -m venv venv +source venv/bin/activate +pip install -r requirements.txt +``` + +3. Use the flask command or a WSGI server to run the app + +```bash +flask run +``` + +In production, you should use a WSGI server like uWSGI, and a reverse proxy like Caddy. Ensure that your server does not log the client's IP address! + +## Configuration + +TypeNot does not require any configuration. However, if you use `flask run`, you can set the `PORT` environment variable to change the port the app listens on. By default, it listens on port 5690. + +## License + +TypeNot is licensed under the MIT License. See [LICENSE](LICENSE) for more information. diff --git a/app.py b/app.py index 5f22087..d32e941 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,7 @@ from flask import Flask, request, Response, render_template import requests import re +import os app = Flask(__name__) @@ -72,4 +73,4 @@ def proxy_fonts(path): if __name__ == "__main__": - app.run(host="0.0.0.0", port=5690) + app.run(host="0.0.0.0", port=os.environ.get("PORT", 5690))