A secure, multi-user code editor with GitHub OAuth authentication, built with React, Monaco Editor, and designed for self-hosting on Kubernetes or Docker.
- Multi-tab Editing: Open and edit multiple files simultaneously.
- Syntax Highlighting: Auto-detection for 20+ languages (JS, TS, Python, YAML, Markdown, etc.).
- Per-User Encryption: Files are encrypted with AES-256-GCM using unique per-user keys.
- Persistent Storage: Changes are automatically saved and stored securely.
- Dark Mode: VSCode-inspired dark theme for comfortable coding.
- GitHub OAuth 2.0: Secure authentication via GitHub (requires
oauth2-proxy). - End-to-End Encryption: Data is encrypted at rest. The server cannot read files without the user's derived key.
- Isolated Enironments: Each user gets their own sandboxed file directory.
- Rate Limiting: Built-in protection against abuse.
The easiest way to run HostNote is using Docker Compose.
-
Clone the repository:
git clone https://github.com/gitfeber/hostnote.git cd hostnote/deploy -
Configure OAuth:
- Create a GitHub OAuth App (Settings -> Developer Settings -> OAuth Apps).
- callback URL:
http://localhost:4180/oauth2/callback
-
Edit
docker-compose.yml:- Replace
your_github_client_idandyour_github_client_secret. - Set a strong
COOKIE_SECRET(generate withpython3 -c 'import os,base64; print(base64.urlsafe_b64encode(os.urandom(16)).decode())'). - Set a strong
ENCRYPTION_KEY(32 bytes hex).
- Replace
-
Run:
docker-compose up -d
-
Access: Open http://localhost:4180 and sign in with GitHub.
For production deployments on Kubernetes:
-
Navigate to manifests:
cd deploy/kubernetes -
Configure Secrets: Copy the secrets template and add your credentials:
cp secrets.yaml.example secrets.yaml # Edit secrets.yaml with your keys kubectl apply -f secrets.yaml -
Configure Ingress: Edit
ingress.yamlto match your domain and TLS issuer. -
Deploy:
kubectl apply -f namespace.yaml kubectl apply -f pvc.yaml kubectl apply -f configmap.yaml kubectl apply -f deployment.yaml kubectl apply -f oauth2-proxy.yaml kubectl apply -f ingress.yaml
| Environment Variable | Description |
|---|---|
ENCRYPTION_KEY |
Required. 32-byte hex string used as master key for encryption. |
PORT |
Server port (default: 8080). |
DATA_DIR |
Path to store user data (default: /data). |
- Frontend: React, Vite, Monaco Editor.
- Backend: Node.js Express server.
- Auth: Relies on
X-Auth-Request-Userheaders provided by an authenticating proxy (like OAuth2-Proxy).
Contributions are welcome!
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
