Compare commits
8 Commits
v0.1.1
...
36f2999cc9
| Author | SHA1 | Date | |
|---|---|---|---|
| 36f2999cc9 | |||
|
7ea8e26660
|
|||
| 5ba2ea1233 | |||
|
573fcf0e65
|
|||
| 0dc8764cc5 | |||
|
787bcdc1a2
|
|||
| 19088219cb | |||
|
ec18f7b4e3
|
15
CHANGELOG.md
15
CHANGELOG.md
@@ -2,6 +2,21 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [unreleased]
|
||||
|
||||
### 🚜 Refactor
|
||||
|
||||
- *(dockerfile)* Update runtime base image to alpine:latest - ([ec18f7b](https://git.0xmax42.io/maxp/lt-auth-proxy/commit/ec18f7b4e39bbfa88ba23ef3fdf825917ac5303b))
|
||||
|
||||
### 📚 Documentation
|
||||
|
||||
- *(readme)* Enhance documentation with usage and features - ([573fcf0](https://git.0xmax42.io/maxp/lt-auth-proxy/commit/573fcf0e65b3446b7efdce6b1695722c9d757410))
|
||||
|
||||
### ⚙️ Miscellaneous Tasks
|
||||
|
||||
- *(readme)* Update image repository URL - ([7ea8e26](https://git.0xmax42.io/maxp/lt-auth-proxy/commit/7ea8e26660b9c29ead8f5597647a96c27cc9dcb5))
|
||||
- *(workflows)* Rename build-docker.yml to build-nightly.yml - ([787bcdc](https://git.0xmax42.io/maxp/lt-auth-proxy/commit/787bcdc1a20e85699b810082895d2a461216c9cf))
|
||||
|
||||
## [0.1.1](https://git.0xmax42.io/maxp/lt-auth-proxy/compare/v0.1.0..v0.1.1) - 2025-05-10
|
||||
|
||||
### ⚙️ Miscellaneous Tasks
|
||||
|
||||
@@ -14,7 +14,7 @@ COPY import_map.json ./import_map.json
|
||||
RUN deno task compile
|
||||
|
||||
# -------- Stage 2: Minimal runtime environment --------
|
||||
FROM denoland/deno:alpine
|
||||
FROM alpine:latest
|
||||
|
||||
# Optional: Install curl for container-level health checks (not needed for production-only binaries)
|
||||
RUN apk add --no-cache curl
|
||||
|
||||
81
README.md
81
README.md
@@ -1,3 +1,82 @@
|
||||
# lt-auth-proxy
|
||||
|
||||
Language Tool authentication proxy
|
||||
A lightweight, production-ready reverse proxy for [LanguageTool](https://languagetool.org) with API key authentication.
|
||||
|
||||
This service acts as a transparent gateway that verifies an `apiKey` before forwarding requests to a running LanguageTool server instance. It is fully self-contained, built in Deno, and distributed as a minimal multi-architecture Docker image.
|
||||
|
||||
---
|
||||
|
||||
## ✨ Features
|
||||
|
||||
* 🔐 **API key authentication** via query or form body
|
||||
* 📡 **Transparent proxying** to any LanguageTool backend
|
||||
* 🐳 **Minimal Docker image (\~93 MB)**
|
||||
* 🧱 **Statically compiled** Deno binary
|
||||
* 🧪 **Unit tested** middleware and proxy logic
|
||||
* 🛠️ Compatible with regular LT clients
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Usage
|
||||
|
||||
You can run the proxy via Docker:
|
||||
|
||||
```bash
|
||||
docker run -p 8011:8011 \
|
||||
-e API_KEYS="demo-key,another-key" \
|
||||
-e LT_SERVER_HOST=lt-server \
|
||||
-e LT_SERVER_PORT=8010 \
|
||||
git.0xmax42.io/simdev/lt-auth-proxy:latest
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Supported Environment Variables
|
||||
|
||||
| Variable | Required | Default | Description |
|
||||
| ---------------- | -------- | ----------- | ---------------------------------------- |
|
||||
| `API_KEYS` | ✅ yes | – | Comma-separated list of valid API tokens |
|
||||
| `PROXY_HOST` | ❌ no | `0.0.0.0` | Host/IP address to bind the proxy to |
|
||||
| `PROXY_PORT` | ❌ no | `8011` | Port the proxy listens on |
|
||||
| `LT_SERVER_HOST` | ❌ no | `localhost` | Hostname of the LanguageTool backend |
|
||||
| `LT_SERVER_PORT` | ❌ no | `8010` | Port of the LanguageTool backend |
|
||||
|
||||
---
|
||||
|
||||
## 📁 File Structure
|
||||
|
||||
```
|
||||
src/
|
||||
├── main.ts # Entry point, sets up the HTTP kernel
|
||||
├── env.ts # Lazy-loaded environment access
|
||||
├── ltProxyAuth.ts # Middleware to check the apiKey
|
||||
├── ltProxyHandler.ts# Handler to forward the request to LT
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🐳 Docker Compose Example
|
||||
|
||||
```yaml
|
||||
services:
|
||||
lt-server:
|
||||
image: languagetool/languagetool:latest
|
||||
ports:
|
||||
- "8010:8010"
|
||||
|
||||
proxy:
|
||||
image: git.0xmax42.io/maxp/lt-auth-proxy:latest
|
||||
ports:
|
||||
- "8011:8011"
|
||||
environment:
|
||||
- API_KEYS=demo-key
|
||||
- LT_SERVER_HOST=lt-server
|
||||
- LT_SERVER_PORT=8010
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📖 License
|
||||
|
||||
MIT © 0xMax42
|
||||
[https://git.0xmax42.io/maxp/lt-auth-proxy](https://git.0xmax42.io/maxp/lt-auth-proxy)
|
||||
|
||||
Reference in New Issue
Block a user