The OSIRIS project is a comprehensive suite of tools designed for advanced network management on OPNsense firewalls. It simplifies DNS forward rule administration, provides seamless browser integration, and automates the setup of transparent proxies.
This project consists of three main components that work together to provide a complete solution:
| Component | Description |
|---|---|
| 🚀 [OSIRIS API Server] | A powerful FastAPI backend that serves as the core for managing Unbound DNS forward rules on OPNsense, complete with a detailed web UI. |
| 🧩 [Chrome Extension] | A browser extension that integrates directly with the OSIRIS API, allowing users to add domains to DNS forward rules on the fly. |
| 🔧 [tun2socks Installer] | A set of automation scripts for installing and configuring tun2socks and XRay on OPNsense, enabling transparent proxying of traffic. |
The OSIRIS API Server is the central component of the project. It's a Python-based application built with FastAPI that provides a robust API and a user-friendly web interface for managing Unbound DNS forward rules on an OPNsense firewall.
- 🔀 Professional DNS forward rule management
- 🐳 Docker-optimized with environment variable configuration
- 🎨 Modern, responsive web interface
- ⚡ Real-time API health monitoring
- 📊 Statistics and charts
- 🔍 Search and filter functionality
- 🔒 Secure non-root container execution
- 💾 Modal-based Add Forward interface
-
Copy environment configuration:
cp .env.example .env
-
Edit environment variables:
# Set your OPNsense credentials in .env OPNSENSE_API_KEY=your_api_key_here OPNSENSE_API_SECRET=your_api_secret_here OPNSENSE_BASE_URL=https://192.168.1.1 -
Start the application:
docker-compose up -d
-
Access the interface:
- Open http://localhost:8000
- API docs: http://localhost:8000/api/docs
# Build the image
docker build -t osiris-dns-manager .
# Run with environment variables
docker run -d \
--name osiris \
-p 8000:8000 \
-e OPNSENSE_API_KEY=your_key \
-e OPNSENSE_API_SECRET=your_secret \
-e OPNSENSE_BASE_URL=https://192.168.1.1 \
osiris-dns-manager| Variable | Description | Example |
|---|---|---|
OPNSENSE_API_KEY |
OPNsense API key | your_api_key |
OPNSENSE_API_SECRET |
OPNsense API secret | your_api_secret |
OPNSENSE_BASE_URL |
OPNsense base URL | https://192.168.1.1 |
| Variable | Default | Description |
|---|---|---|
APP_TITLE |
OSIRIS |
Application title |
HOST |
0.0.0.0 |
Server bind address |
PORT |
8000 |
Server port |
LOG_LEVEL |
INFO |
Logging level |
WORKERS |
1 |
Uvicorn workers |
CORS_ORIGINS |
* |
CORS allowed origins |
API_KEY_FILE |
secrets/apikey.txt |
API key file path |
Set these environment variables:
OPNSENSE_API_KEY=your_api_key_here
OPNSENSE_API_SECRET=your_api_secret_here
OPNSENSE_BASE_URL=https://192.168.1.1Create secrets/apikey.txt:
key=your_api_key_here
secret=your_api_secret_here
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export OPNSENSE_API_KEY=your_key
export OPNSENSE_API_SECRET=your_secret
export OPNSENSE_BASE_URL=https://192.168.1.1
# Run the application
python main.pyThe application includes endpoints and configurations for robust monitoring.
- Health Endpoint:
GET /health - API Documentation:
/api/docsand/api/redoc - Container Health Check: Integrated into the Dockerfile for automatic checks.
The OSIRIS Chrome Extension provides a seamless bridge between your browser and the OSIRIS API server, allowing for quick and efficient management of DNS forwarding rules.
- One-Click Domain Addition: Add the domain of the current tab to your OPNsense forward rules instantly.
- Real-time Status: Always know if your OSIRIS API is connected and available.
- Manual Control: Add custom domains through a clean and simple interface.
- For more details, see the Chrome Extension README.
This component provides a set of powerful automation scripts to simplify the deployment of a transparent proxy on OPNsense using tun2socks and the XRay-core.
- Automated Setup: Drastically reduces the manual effort required to configure a transparent proxy.
- Interactive Installation: Guides you through the process, prompting for necessary configuration details.
- Graceful Uninstall: A dedicated script to safely remove all components and revert system changes.
- For more details, see the tun2socks Installer README.
This project is open source and available under the MIT License.