Skip to content

Latest commit

Β 

History

106 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Contributors Forks Stargazers Issues


Logo

OPNsense Manager

❀️ Support the Project

If you find this project useful, consider supporting its development:

πŸ’° Crypto Donations

USDT / USDC (BEP20, BSC, ERC20, BASE, POL, ARBITRUM, AVAXC) :

0xe0b9015117a4a69131481c2e9c1553dde839df18

USDT QR Code

Also Binance Gift cards can work by sending it to the email etreginwow@gmail.com

πŸ“± Get the App

Get it on Google Play Download on the App Store Get it on F-Droid

Table of Contents
  1. πŸ“– About The Project
  2. πŸš€ Getting Started
  3. ✨ Features
  4. πŸ›‘οΈ Security Considerations
  5. πŸ—οΈ Architecture
  6. πŸ—ΊοΈ Roadmap
  7. 🀝 Contributing
  8. πŸ› Troubleshooting
  9. πŸ“„ License
  10. πŸ’¬ Getting Help
  11. πŸ™ Acknowledgments

πŸ“– About The Project

OPNsense is a professional Flutter mobile application for managing OPNsense firewall routers. Monitor system status, manage firewall rules, view logs, control services, and manage your network security from your mobile device.

I could not find an mobile application that can do what I needed so I decided to create my own and share it with the community.

Flutter Dart License Platform

(back to top)

πŸš€ Getting Started

πŸ“‹ Requirements

  • Android: API 21 (Android 5.0) or higher
  • iOS: iOS 12.0 or higher
  • OPNsense: Version 20.7 or higher with API access enabled

πŸ”§ Configure OPNsense API

On your OPNsense firewall:

  1. Go to System β†’ Access β†’ Users
  2. Create a new user or edit existing
  3. Generate API credentials (Key + Secret)
  4. Configure user permissions using one of these methods:

Option 1: Admin Group (Recommended - Simplest)

  • Add the API user to the "admins" group under Group Membership
  • This grants full access to all features in both the OPNsense web interface and the mobile app
  • βœ… Best for users who want complete management capabilities
  • βœ… No permission configuration needed
  • βœ… Works across all OPNsense versions

Option 2: Custom Permissions (Advanced)

Configure individual permissions based on what you want to access. The app requires the same permissions as the OPNsense web interface:

Important: If you can access a feature in the OPNsense web GUI with your API user, the mobile app will also be able to access it. If you cannot access it in the web GUI, the app won't be able to access it either.

πŸ’‘ Tip: To verify permissions are working, log in to the OPNsense web interface with your API user credentials. Any page you can access in the web GUI will also work in the mobile app. Any page you cannot access will return a 403 error in the app.

⚠️ Note: After changing permissions, you must log out and log back in to OPNsense for changes to take effect. Also restart the mobile app completely.

πŸ“₯ Installation

Option 1: Download Pre-built APK (Android)

  1. Go to the Releases page
  2. Download the latest APK file
  3. Install on your Android device
  4. Grant necessary permissions when prompted

Option 2: Build from Source

See CONTRIBUTING.md for detailed build instructions.

(back to top)

✨ Features

πŸ” Authentication & Security

  • Secure API Authentication: API key/secret based authentication with encrypted storage
  • Multiple Profile Management: Manage multiple OPNsense instances seamlessly
  • PIN Lock: Secure app access with 4-6 digit PIN code
  • Biometric Authentication: Face ID, Touch ID, or Fingerprint support
  • Auto-Lock: Configurable session timeout with automatic locking
  • Secure Storage: Platform-specific encrypted credential storage (Keychain/Keystore)

πŸ“Š Dashboard

  • System Overview: Real-time display of hostname, version, and platform information
  • Resource Monitoring: Live CPU and memory usage with visual indicators
  • Service Management: View, start, stop, and restart system services with confirmation dialogs
  • Gateway Status: Monitor gateway health and connectivity
  • System Uptime: Formatted uptime display
  • Quick Navigation: Easy access to all features from the main screen
  • Pull-to-Refresh: Update data with a simple swipe gesture
  • Auto-Refresh: Configurable automatic data updates

Dashboard

πŸ”₯ Firewall Management (Currently only works with "Firewall > Automation > Filter" rules)

  • View Rules: List all firewall rules with detailed information and status
  • Create Rules: Add new firewall rules with comprehensive configuration options
  • Edit Rules: Modify existing rules with full parameter control
  • Delete Rules: Remove unwanted rules with confirmation dialogs
  • Toggle Rules: Enable/disable rules with a single tap
  • Rule Details: View complete rule configuration including:
    • Action (Pass/Block/Reject)
    • Interface (WAN/LAN/OPT, etc.)
    • Protocol (TCP/UDP/ICMP/Any)
    • Source and destination addresses with CIDR notation
    • Port specifications and ranges
    • Rule descriptions and labels
    • Creation and modification timestamps
    Firewall Rules

πŸ“‹ Firewall Logs

  • Real-time Logs: View firewall activity as it happens
  • Filter by Action: Show only Pass, Block, or Reject events
  • Search Functionality: Find specific log entries quickly
  • Detailed Information: View packet details including:
    • Source and destination IP addresses
    • Source and destination ports
    • Protocol information
    • Timestamps with timezone
    • Rule IDs and actions
    • Interface information
  • Auto-Refresh: Configurable automatic log updates (5-60 seconds)
  • Log Limit: Adjustable number of log entries displayed

Firewall Logs

### 🌐 Live Network Monitoring - **Real-time Network Activity**: Monitor active connections and network traffic in real-time - **Device Discovery**: View all devices currently connected to your network - **Connection Details**: See detailed information about each connection including: - Source and destination IP addresses - Ports and protocols - Connection state and duration - Data transfer rates - **Device Blocking**: Quickly block devices directly from the network monitor - **Auto-Refresh**: Configurable automatic updates to track network changes - **Search & Filter**: Find specific devices or connections quickly

Live Network Monitor

πŸ“‘ DHCP Lease Management

  • Active Leases: View all current DHCP leases on your network
  • Lease Details: Complete information for each lease including:
    • IP address assignments
    • MAC addresses
    • Hostnames
    • Lease start and end times
    • Interface information
  • Device Blocking: Block devices directly from the DHCP leases view
  • Search Functionality: Quickly find specific devices by IP, MAC, or hostname
  • Pull-to-Refresh: Update lease information on demand

DHCP Leases

ℹ️ System Information

  • Firmware Details:
    • System type (OPNsense)
    • Version number
    • Architecture (amd64, etc.)
    • Git commit hash
    • Package mirror URL
    • Repository information with priority
    • Last update timestamp
  • System Status:
    • Hostname
    • Platform (FreeBSD version)
    • System uptime
  • Pull-to-Refresh: Update system information on demand

System Information

πŸ”§ Service Management

  • Service Control: Start, stop, and restart system services
  • Service Status: Real-time service status indicators
  • Confirmation Dialogs: Prevent accidental service disruptions
  • Visual Feedback: Color-coded status indicators (running/stopped)
  • Service List: View all available system services

Service Management

βš™οΈ Settings

  • Theme Control: Toggle between light and dark modes
  • PIN Lock Configuration: Set up and change PIN code
  • Biometric Setup: Enable/disable biometric authentication
  • Session Timeout: Configure auto-lock duration (1-60 minutes)
  • Profile Management:
    • Add new OPNsense profiles
    • Edit existing profiles
    • Delete profiles with confirmation
    • Switch between profiles instantly
    • Profile-specific credentials
  • App Lock: Manually lock the app for security
  • About Screen: View app information, version, and licenses

Settings

πŸ”„ Additional Features

  • Firewall Reboot: Remotely reboot your OPNsense firewall with confirmation
  • Profile Switching: Quickly change between different OPNsense instances
  • Connection Testing: Verify API connectivity before saving profiles
  • Error Handling: Comprehensive error messages and recovery options
  • Offline Support: Graceful handling of network issues
  • Material Design 3: Modern, beautiful UI following Material Design guidelines
  • Responsive Layout: Optimized for various screen sizes

Menu

(back to top)

πŸ›‘οΈ Security Considerations

  • βœ… API credentials stored using platform-specific secure storage (Keychain/Keystore)
  • βœ… HTTPS enforced for all API communications
  • βœ… Self-signed certificate support (configurable per profile)
  • βœ… PIN lock with biometric authentication
  • βœ… Auto-lock on app background
  • βœ… No credentials logged or exposed in production
  • βœ… Confirmation dialogs for destructive actions
  • βœ… Session timeout for automatic security
  • ⚠️ Certificate pinning not implemented (consider for production environments)

(back to top)

πŸ—ΊοΈ Roadmap

  • Get Firewall rules to work with ALL rules
  • VPN connection management (OpenVPN, Tailscale, WireGuard)
  • Push notifications for system alerts
  • Backup/restore configuration functionality
  • Package management interface
  • Multi-language support (i18n) - Supports English, Arabic, Spanish, French, and German with easy extensibility for more languages
  • Tablet-optimized layouts
  • Traffic monitoring with detailed charts
  • Bandwidth quota management
  • Interface statistics and graphs
  • DHCP lease management - View active leases and block devices
  • Live network monitoring - Real-time network activity monitoring with device blocking capability
  • DNS configuration
  • Certificate management
  • User management interface
  • Scheduled tasks/cron jobs
  • Plugin management
  • Export/import profiles - Export and import connection profiles as JSON files

See the open issues for a full list of proposed features (and known issues).

(back to top)

πŸ—οΈ Architecture

This project follows modern Flutter best practices with a clean, maintainable architecture:

MVVM Pattern

  • Models: Data classes with JSON serialization (lib/models/)
  • Views: UI components and screens (lib/screens/, lib/widgets/)
  • ViewModels: Business logic and state management (lib/viewmodels/)

Key Features

  • βœ… Modular Design: Reusable components and services
  • βœ… Separation of Concerns: Clear boundaries between UI and business logic
  • βœ… Base Classes: BaseFormViewModel and BaseListViewModel for consistency
  • βœ… Service Layer: Organized services following Single Responsibility Principle
  • βœ… Widget Components: 42+ reusable UI components
  • βœ… Type Safety: Full Dart null-safety support

Project Structure

lib/
β”œβ”€β”€ models/           # Data models with JSON serialization
β”œβ”€β”€ screens/          # Main screen widgets
β”œβ”€β”€ viewmodels/       # Business logic and state management
β”‚   └── base/        # Base ViewModel classes
β”œβ”€β”€ widgets/          # Reusable UI components
β”‚   β”œβ”€β”€ common/      # Shared widgets
β”‚   β”œβ”€β”€ login/       # Login-specific widgets
β”‚   β”œβ”€β”€ dashboard/   # Dashboard widgets
β”‚   β”œβ”€β”€ firewall/    # Firewall management widgets
β”‚   β”œβ”€β”€ settings/    # Settings widgets
β”‚   β”œβ”€β”€ tailscale/   # Tailscale widgets
β”‚   β”œβ”€β”€ vpn/         # VPN widgets
β”‚   └── wireguard/   # WireGuard widgets
β”œβ”€β”€ services/         # API and business services
β”‚   β”œβ”€β”€ base/        # Base service classes
β”‚   β”œβ”€β”€ demo/        # Demo mode services
β”‚   β”œβ”€β”€ firewall/    # Firewall services
β”‚   β”œβ”€β”€ network/     # Network services
β”‚   β”œβ”€β”€ profile/     # Profile management
β”‚   β”œβ”€β”€ settings/    # Settings services
β”‚   β”œβ”€β”€ system/      # System services
β”‚   └── vpn/         # VPN services
└── utils/           # Utility functions and validators

Code Quality

  • Static Analysis: 0 issues with flutter analyze
  • Code Reduction: ~2,827 lines reduced through refactoring
  • Maintainability: Average file size reduced from ~350 to ~250 lines
  • Documentation: Comprehensive inline documentation

For detailed information about the architecture and refactoring process, see REFACTORING_SUMMARY.md.

(back to top)

🀝 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

Review CONTRIBUTING.md for ways to get started.

Don't forget to give the project a star! Thanks again!

βž• Adding a Feature

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Follow the code style: Use flutter analyze and fix any issues
  4. Write meaningful commit messages
  5. Test your changes thoroughly on both Android and iOS if possible
  6. Update documentation if needed
  7. Submit a pull request with a clear description of changes

🐞 Reporting a Bug

Check existing issues to avoid duplicates, Use the issue template when creating new issues and Provide detailed information:

  • App version
  • Device and OS version
  • OPNsense version
  • Steps to reproduce
  • Expected vs actual behavior
  • Screenshots if applicable
  • Error messages or logs

(back to top)

πŸ› Troubleshooting

API Connection Issues

  • Verify OPNsense API is enabled in System β†’ Settings β†’ Administration
  • Check firewall rules allow connections from mobile device IP
  • Confirm API key/secret are correct and not expired
  • Test HTTPS certificate (allow self-signed certificates in profile settings)
  • Verify API user has required permissions

Biometric Authentication Not Working

  • Ensure device has biometric hardware (fingerprint sensor, Face ID, etc.)
  • Check app permissions are granted in device settings
  • Verify biometric is enrolled on device
  • Try disabling and re-enabling biometric in app settings

Service Control Not Working

  • Verify API user has System: Status permissions
  • Check service names match OPNsense service IDs
  • Ensure services are installed and available on your OPNsense instance

(back to top)

πŸ“„ License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

❓ Why GPLv3?

We chose GPLv3 to ensure that:

  • The software remains free and open source
  • Any modifications or derivatives must also be open source
  • Users have the freedom to use, study, share, and modify the software
  • The community benefits from improvements and contributions

(back to top)

πŸ’¬ Getting Help

πŸ”’ Reporting Security Issues

If you discover a security vulnerability, please email Etreginwow@gmail.com instead of using the issue tracker.

(back to top)

πŸ™ Acknowledgments

  • OPNsense team for the excellent firewall platform

(back to top)

About

An opensource mobile app that can be used to manage OPNsense routers

Resources

Contributing

Stars

164 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages