Skip to content

danteblank/OSIRIS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OSIRIS Project

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.

πŸ›οΈ Core Components

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.

πŸš€ OSIRIS API Server

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.

Key Features

  • πŸ”€ 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

Docker Quick Start

Method 1: Using Docker Compose (Recommended)

  1. Copy environment configuration:

    cp .env.example .env
  2. 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
  3. Start the application:

    docker-compose up -d
  4. Access the interface:

Method 2: Docker Build & Run

# 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

Environment Variables

Required Configuration

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

Optional Configuration

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

API Configuration Methods

Method 1: Environment Variables (Recommended for Docker)

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.1

Method 2: API Key File

Create secrets/apikey.txt:

key=your_api_key_here
secret=your_api_secret_here

Development

Local Development

# 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.py

Monitoring & Health Checks

The application includes endpoints and configurations for robust monitoring.

  • Health Endpoint: GET /health
  • API Documentation: /api/docs and /api/redoc
  • Container Health Check: Integrated into the Dockerfile for automatic checks.

🧩 Chrome Extension

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.

πŸ”§ tun2socks & XRay Installer for OPNsense

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.

License

This project is open source and available under the MIT License.

About

Complex app for using xray on OPNSENSE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published