Authentication Server
The Authenticator is the login server of DroneEngage. It keeps the accounts and the access codes. It checks each login and tells the client which Communication Server to use.
Program: andruavauth (Rust) · Source code:
droneengage_authenticator
What It Does
Registers users and makes access codes.
Checks the logins of WebClients and units.
Keeps a list of the Communication Servers that are connected.
Has an admin web page for users and servers.
Accepts the Communication Servers on an S2S link.
The Authenticator does not redirect the client. It sends a JSON reply with the address and the port of the Communication Server and a temporary login key. The client then uses them to open a WebSocket to the Communication Server.
The accounts can be in one of three places: one account in
server.config, a JSON file, or a SQLite database.
Components
The Authenticator runs three services at the same time:
Service |
Port |
What it does |
|---|---|---|
API server |
|
Login, register and the unit routes (HTTPS). |
Admin web page |
|
Users, teams and the status of the servers. See Admin Web Interface. |
S2S server |
|
The Communication Servers connect here and register. |
Settings
The settings are in server.config. Put your changes in
server.config.local (see Air-Gap Server: The Four Rust Servers).
Server and accounts
Setting |
Default |
What it does |
|---|---|---|
|
|
The name of this server. |
|
|
The IP that the API server listens on. |
|
|
The port of the API server. Units and the WebClient use this port. |
|
|
Where the accounts are: |
|
|
The account email for |
|
|
The access code for |
|
|
The JSON file for |
|
|
The SQLite file for |
|
|
Do not send the access code by email. Keep |
S2S link
Setting |
Default |
What it does |
|---|---|---|
|
|
The IP of the S2S server. Keep |
|
|
The port of the S2S server. |
|
|
|
|
one key |
The public key of each Communication Server, by |
Admin web page and security
Setting |
Default |
What it does |
|---|---|---|
|
|
Show the admin web page. |
|
|
The port of the admin web page. |
|
|
The admin login. Write |
|
— |
A long random text that protects the admin sessions. Change it. |
|
empty |
A secret word. When set, the admin page is only at
|
|
|
A shell terminal on the admin page. Set |
|
|
A small proof-of-work check on the public “create access code” form.
You can set |
|
|
Use HTTPS. The key and the certificate are in |
Example — server.config for an air-gap Pi:
{
"server_id" : "AndruavAuth",
"server_ip" : "0.0.0.0",
"server_port" : 19408,
"account_storage_type" : "single", // single, file or db
"single_account_user_name" : "single@airgap.droneengage.com",
"single_account_access_code": "my-new-code",
"file_db" : "./file_db.json",
"dbdatabase" : "database/andruav_DB.db",
"ignoreEmail" : true,
"s2s_ws_listening_ip" : "127.0.0.1",
"s2s_ws_listening_port" : "19001",
"s2s_auth_enabled" : false,
"enable_SSL" : true,
"ssl_key_file" : "./ssl_local/ssl_airgap/domain.key",
"ssl_cert_file" : "./ssl_local/ssl_airgap/domain.crt",
"webadmin_enable" : true,
"webadmin_port" : 8089,
"webadmin_listening_ip" : "0.0.0.0",
"admin_username" : "admin",
"admin_password" : "$$HASH$$('my-admin-password')",
"session_secret" : "write-a-long-random-text-here",
"webadmin_terminal_enabled" : false,
"enableLog" : false,
"log_directory" : "./logs/"
}
Warning
The file is JSON, but you can write comments with // and /* */.
Account Modes
Mode |
Use it when |
|---|---|
|
You need only one account. All units and WebClients share it. This is the easiest mode for an air-gap Pi. |
|
You need a few accounts. The server keeps them in |
|
You need many accounts and teams. The server keeps them in a SQLite file. Manage them on the admin web page (Teams & Logins). |
Logins in the same team share the same units. Logins in different teams do not see the units of each other.
Important
The IP and the port of the Authenticator are in the config of each DroneEngage unit and in the WebClient, because they connect to it first.
Tools
Two helper programs are built with the server:
# reset the access code of an account (in file mode, stop the server first)
./target/release/reset_access <account-name>
# make a SQLite account database from a file-mode JSON file
./target/release/migrate_file_db ./file_db.json --output database/andruav_DB.db
For Developers
Language: Rust (tokio).
Build:
cargo build --release. The program istarget/release/andruavauth.Configuration:
server.configplusserver.config.local, or--config=<file>.Database: SQLite, with migrations in
database/migrations/.
See Server Technicals for the authentication flow, database schema, and API details.