Skip to content

About

OpenSolari is a modern cross-platform solution designed for interacting with Solari Udine devices. The system enables managing device outputs via secure HTTP methods, offering a flexible interface for server environments as well as desktop and mobile clients.

Topics

Resources

Stars

1 star

Watchers

2 watching

Forks

Repository files navigation

OpenSolari

.NET Platform License Status

OpenSolari is a modern cross-platform solution designed for interacting with Solari Udine devices. The system enables managing device outputs via secure HTTP methods, offering a flexible interface for server environments as well as desktop and mobile clients.

Important

Legal Disclaimer This project is an independent, open-source initiative and is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Solari di Udine S.p.A. (now SOLARI S.p.A.) or any of its subsidiaries or affiliates. All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.


🚀 Key Features

  • Device Control: Manage output activation (doors, gates, barriers) via the Solari protocol.
  • Mixed Terminal Fleets: Works with both older Solari terminals and newer ones running the fs22 firmware (2.3.x), whose web interface requires session-bound CSRF tokens. The firmware is detected automatically for each terminal, so no extra configuration is needed.
  • Cross-Platform: Full support for Windows, Linux, and Android.
  • Advanced Security:
    • Authentication via API Token (X-Auth-Token header).
    • User codes stored only as salted hashes (PBKDF2), never in a decryptable form. Codes must be at least 16 characters; the GUI and CLI can generate random ones.
    • Brute-force protection: an IP address that sends 5 wrong tokens within a minute is blocked for 15 minutes.
    • On Linux, configuration and log files are readable only by the user running the server.
    • Clients keep their token in the operating system's protected storage (DPAPI on Windows, Android Keystore) or, on Linux, in a config file readable only by the current user.
    • HTTPS support (Beta) for secure communications.
    • Geofencing (Geolock): Restrict commands to a specific geographical radius around the server's target location. The position is sent by the client, so geolock is a deterrent, not a strong control.
  • Flexible Management: Dynamic configuration via JSON files and intuitive graphical interfaces.
  • Professional Logging: Integrated logging system with automatic rotation and configurable retention.

🏗️ Project Architecture

The project is divided into modular components:

  • OpenSol.Core: Base logic, configuration management, and device communication.
  • OpenSolWinServer / OpenSolLinuxServer: Centralized servers for handling requests and users.
  • OpenSolWin / OpenSolariLinux: Desktop clients for quick command execution.
  • OpenSolAndroid: Native mobile client for on-the-go control.

🛠️ Installation and Setup

🪟 Windows (Server & Client)

  • OS: Windows 10 (version 1809 or later) or Windows 11.
  • Runtime: .NET Desktop Runtime 10.0.
  • Installation: No special installation required. Unzip the release and run OpenSolWinServer.exe (Server) or OpenSolWin.exe (Client).
  • User Management: The server includes a "User Management" interface to:
    • Add authenticated users with specific access schedules (Days & Time ranges).
    • Edit User: Select a user, click "Edit Selected" to modify details or existing schedules, then "Save User".
    • Geolock Bypass: Administrators can enable "Ignore Geolock" for specific users to allow them to operate regardless of their GPS position.
    • Allowed Devices: Restrict a user to specific device IDs (comma separated). Leave empty to allow all devices.
    • Remove users.
    • Set specific start/end times per day (HH:mm format).

🐧 Linux Server (OpenSolLinuxServer)

  • OS: Any modern Linux distribution (Ubuntu 20.04+, Debian 11+, etc.).
  • Runtime: .NET Runtime 10.0.
  • CLI Parameters:
    • --port <number>: The port the server will listen on (default: 9999).
    • --add-user <name> --auth <code|auto> [--schedule <schedule_str>] [--ignore-geolock] [--devices <device_ids>]: Adds or updates a user.
      • The code must be at least 16 characters. --auth auto generates a random code and prints it once: give it to the user, it cannot be shown again.
      • Schedule Format: "Mon:08:00-18:00,Tue:08:00-12:00".
      • If no schedule is provided, the user gets Full Access (24/7).
      • Use --ignore-geolock to exempt the user from geofence checks.
      • Use --devices "1,turnstile_in" to restrict the user to those device IDs ("*" = all). New users without --devices can open all devices; existing users keep their current list.
    • --remove-user <name>: Removes the user with the specified name.
    • --list-users: Lists all registered users and their access types (Full/Schedule, Geolock bypass, allowed devices).
  • Installation:
    1. Install .NET Runtime: sudo apt-get install -y dotnet-runtime-10.0 (on Ubuntu/Debian).
    2. Run the server: dotnet OpenSolLinuxServer.dll [params] or ./OpenSolLinuxServer [params].
  • Note: Parameters passed via CLI override those in the server.config file and are automatically saved for subsequent restarts. User codes are stored in access_control.json as salted hashes. Legacy users found in server.config are migrated there automatically.

🐧 Linux Client (OpenSolariLinux)

  • OS: Linux with a Desktop Environment (GNOME, plasma, XFCE, etc.) supporting X11 or Wayland.
  • Runtime: .NET Desktop Runtime 10.0.
  • Dependencies: Requires standard graphical libraries: libice6, libsm6, libfontconfig1.
  • Installation:
    1. Install dependencies: sudo apt-get install libice6 libsm6 libfontconfig1 (on Ubuntu/Debian).
    2. Run the client: ./OpenSolariLinux.

📱 Android Client (OpenSolAndroid)

  • OS: Android 5.0 (API Level 21) or higher (Built on .NET 10.0).
  • Attributes:
    • Dynamic Configuration: Configure buttons directly within the app via the "Config" page.
    • Customizable Interface: Set descriptions and colors for each button.
    • Geolock Integration: The app captures GPS coordinates automatically for command validation.
    • Scrollable UI: All screens are scrollable for better usability on different screen sizes.
  • Installation: Install the .apk file provided in the releases. You may need to enable "Install unknown apps" in your settings.
  • Geofence Setup: In the Config page, use the 📍 Set Current Location as Target button to define the allowed operation center. Valid distances are controlled by the server.

🛠️ Configuration

Main Server Configuration (server.config)

The server.config file contains the main operational settings for the server. It is automatically created on the first run if it doesn't exist.

Example server.config:

Port=9999
UseHttps=false
logs=yes
logsretention=30
Admin=T3N0cnlwdGVkRGF0YQ==
EnableGeolock=true
GeoLatitude=-16.497250
GeoLongitude=-151.739960
MaxDistance=300
  • Port: The TCP port the server listens on. (Integer)
  • UseHttps: Set to true to enable HTTPS (requires OS certificate binding on Windows). (Boolean)
  • logs: Set to yes to enable file logging in the logs directory. (Boolean)
  • logsretention: Number of days to keep log files. (Integer)
  • EnableGeolock: Set to true to enable geofencing. While it is on, every request must carry the client's GPS position: Windows and Linux clients send none, so their users need Ignore Geolock (--ignore-geolock). (Boolean)
  • GeoLatitude: Target latitude for the geofence. (Double)
  • GeoLongitude: Target longitude for the geofence. (Double)

    [!TIP] Don't know how to get coordinates? See the Google Maps coordinates guide.

  • MaxDistance: Maximum allowed distance in meters from the target location. (Integer)
  • Authentication: Users are stored as UserName=EncryptedToken. New users should be added via the GUI (Windows) or CLI (Linux). (String)

Access Control Configuration (access_control.json)

This file stores the user database, including the hashes of their codes and access schedules. It replaces the legacy authentication method in server.config.

Example access_control.json:

{
  "Users": [
    {
      "Username": "Admin",
      "Token": "pbkdf2$20000$q2Jx0p6FZr1rS8m1yQh8Zw==$3n0fGQ2bq0n7mJ1pZr7cJmY4e2y6m5h2kW0Q6x9vT1E=",
      "IgnoreSchedule": true,
      "IgnoreGeolock": true,
      "Schedule": {},
      "AllowedDevices": ["*"]
    },
    {
      "Username": "OfficeStaff",
      "Token": "pbkdf2$20000$Zp8xQ1n2bW3c4d5e6f7g8A==$Yk9wR3hTdEZ1VnFqN2J6cE1hS0x4QnZ3Y1dzRGZnSGo=",
      "IgnoreSchedule": false,
      "AllowedDevices": ["1", "turnstile_in"],
      "Schedule": {
        "Monday": "08:00-18:00",
        "Tuesday": "08:00-18:00",
        "Wednesday": "08:00-18:00",
        "Thursday": "08:00-18:00",
        "Friday": "08:00-18:00"
      }
    }
  ]
}
  • Username: The name of the user.
  • Token: Salted PBKDF2 hash of the user's secret code, written by the server. The code itself cannot be recovered from it: to change it, set a new one from the GUI or CLI. Tokens in the old encrypted format are converted automatically the first time the server loads the file.
  • IgnoreSchedule: If true, the user has full 24/7 access (Admin).
  • IgnoreGeolock: If true, the user bypasses geofencing checks (Admin/Special).
  • Schedule: A dictionary of days and time ranges (e.g., "Monday": "08:00-18:00"). Times are in HH:mm format. Missing days imply NO access for that day.
  • AllowedDevices: The device IDs (from devices_config.json) the user may open. ["*"], null or a missing field allows all devices; [] allows none. Requests for any other device are rejected by the server and logged as Command failed (Device not allowed: <id>), whatever buttons the client has configured.

Device Mapping Configuration (devices_config.json)

The server requires a devices_config.json file in the same directory as the executable to map IDs to physical Solari devices.

Example devices_config.json:

{
    "devices": [
        {
            "id": "1",
            "ip": "192.168.1.12",
            "outputNum": "1",
            "duration": "0",
            "username": "webterm",
            "password": "webterm"
        },
        {
            "id": "2",
            "ip": "192.168.1.13",
            "outputNum": "1",
            "duration": "0",
            "username": "webterm",
            "password": "webterm"
        }
    ]
}
  • id: Internal client-server ID for the single Solari device (String or Integer).
  • ip: IP address of the Solari device.
  • outputNum: Output to be activated on the device. e.g., in Solari CCN 7290/7210, LBR 2803/2806, LBA 2803, and LBM 2745, where concentrators support up to 24 outputs (Integer).
  • duration: Duration in seconds for which the output remains active (e.g., 3 for doors, 0 for gates/barriers) (Integer).
  • secondi: ⚠️ [DEPRECATED] Legacy parameter name for duration. Use duration instead. This parameter will be removed by the end of 2026 (Integer).
  • username: Device access username (default: webterm) (String).
  • password: Device access password (default: webterm) (String). Change the default password on the terminals: the server prints a warning for every device that still uses it.

Important

The terminals' web interface uses plain HTTP and this file holds their passwords. Keep the terminals reachable only from the local network (ideally a separate VLAN), never forward ports to them, and run the server under a dedicated user.

Windows/Linux Client Configuration (buttons_config.json)

Desktop clients use buttons_config.json to define the layout of the UI buttons. The id must match the id configured on the Server.

Example buttons_config.json:

{
    "buttons": [
        {
            "id": "1",
            "description": "Gate (Main Entrance)",
            "textColor": "#FFFFFF",
            "backgroundColor": "#4CAF50"
        },
        {
            "id": "2",
            "description": "Barrier",
            "textColor": "#000000",
            "backgroundColor": "#FFC107"
        }
    ]
}

Android Configuration

The Android client does not use a JSON file. Instead, configuration is managed via the App UI:

  1. Go to Config page.
  2. Enter Server IP, Port, and Token.
  3. Tap "Manage Home Screen Buttons".
  4. Add buttons defining ID, Description, and Colors directly from the interface.
  5. Configuration is persisted securely using Android Shared Preferences.

HTTPS Configuration (Security)

Warning

SSL/HTTPS configuration is currently in BETA. Its use in production environments is NOT recommended at this time.

Optionally, the server can run on HTTPS for secure communication.

Enabling HTTPS

  1. In server.config, add or set the line: UseHttps=true. (If the file doesn't exist, it is created on first run. You can edit it manually).
  2. Configure your clients to use HTTPS by checking the "Use HTTPS" box in their configuration settings.

Certificate Setup

Windows Server

On Windows, HttpListener requires a certificate to be bound to the port via the OS.

  1. Obtain/Create an SSL certificate (e.g., self-signed or from a CA) and install it in the "Personal" store of the "Local Computer".
  2. Note the "Thumbprint" (Hash) of the certificate.
  3. Open an Administrator terminal (PowerShell/CMD) and run:
    netsh http add sslcert ipport=0.0.0.0:9999 certhash=<THUMBPRINT> appid={<GUID>}
    Replace <THUMBPRINT> with your cert hash and 9999 with your configured port. Generate a random <GUID> or use one like {00000000-0000-0000-0000-000000000000}.

Linux Server

For production on Linux, and always when the server is reachable from the Internet, run it behind a reverse proxy that handles HTTPS. Caddy obtains and renews a Let's Encrypt certificate by itself:

  1. Point a domain name (yours or a dynamic DNS) to your public IP.
  2. Keep OpenSolServer on HTTP (UseHttps=false, e.g. port 9999).
  3. In /etc/caddy/Caddyfile:
    gate.example.com {
        reverse_proxy 127.0.0.1:9999
    }
    
  4. Forward only port 443 on the router to the server, and block port 9999 from other machines (e.g. ufw allow 443/tcp and ufw deny 9999/tcp).
  5. In the clients, use the domain name, port 443 and "Use HTTPS".

Behind a proxy on the same machine, the server reads the client's address from the X-Forwarded-For header (only for requests coming from localhost), so logs and the brute-force protection see the real IP. Nginx works the same way with proxy_pass http://127.0.0.1:9999; and proxy_set_header X-Forwarded-For $remote_addr;.

If you must run the .NET app directly with HTTPS:

  • You may need to configure Kestrel or HttpListener with appropriate permissions/certificates, but the Reverse Proxy approach is standard for Linux deployments.

Logging Configuration

To enable file logging, add the following lines to server.config:

  • logs=yes (Enables logging to file)
  • logsretention=30 (Sets the number of days to keep logs, default is 30)

Logs are stored in the logs directory within the application folder.

How to Contribute

If you would like to contribute to the project, feel free to open an issue or submit a pull request. All contributions are welcome!

License

This project is distributed under the GNU/GPL3 license.

About

OpenSolari is a modern cross-platform solution designed for interacting with Solari Udine devices. The system enables managing device outputs via secure HTTP methods, offering a flexible interface for server environments as well as desktop and mobile clients.

Topics

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages