Skip to content

omnis-org/omnis-server

Repository files navigation

OmnIS Server

License

OmnIS Server is part of the OmnIS project. It allows the processing of client data and manages user authentication.

omnis_logo

How to build ?

cd build
make build
# That will generate a binary omnis-server

Generate keys

Omnis server needs key to communicate in HTTPS and to manage authentication. They can be generated as follows :

cd keys
./generate_rsa_keys.sh

Create Database

Omnis rest api needs to store informations in a mariadb database.

You can create table and procedures with the following commands :

sudo apt install mariadb-server
sudo mysql_secure_installation

cd sql/

# If you haven't define root password :
sudo mysql < init.sql

# Else :
mysql -u root -p < init.sql

⚠️ You should change the password of the default create users in file : sql/create_db.sql

Create configuration file

You have examples of configuration file in build/testdata/example.json :

{
    "server" : {
        "ip" : "0.0.0.0",                           # The listening IP address of the server
        "port" : 4320,                              # The port of the omnis server service
        "apiPath": "/api",                          # The api path
        "omnisRestPath" : "/rest/omnis",            # The omnis rest api endpoint path
        "adminRestPath" : "/rest/admin",            # The admin rest api endpoint path
        "adminPath" : "/admin",                     # The admin api endpoint path
        "clientPath" : "/client"                    # The client api endpoint path
    },
    "admin":{
        "expiration_token_time" : 10,               # Token validity time (minute)
        "auth_key_file" : "../keys/auth.key",       # RSA private key for authentification
        "auth_pub_file" : "../keys/auth.pub"        # RSA public key for authentification
    },
    "omnis_db" : {
        "name" : "OMNIS",                   # Name of database that store clients data
        "username" : "omnis",               # username of user that can access database (OMNIS)
        "password" : "PASSWORD",            # password of user that can access database (OMNIS)
        "host" : "127.0.0.1",               # The IP address of the database (OMNIS)
        "port" : 3306                       # The port of the database service (OMNIS)
    },
    "admin_db" : {
        "name" : "OMNIS_ADMIN",             # Name of database that store users data
        "username" : "omnis",               # username of user that can access database (OMNIS_ADMIN)
        "password" : "PASSWORD",            # password of user that can access database (OMNIS_ADMIN)
        "host" : "127.0.0.1",               # The IP address of the database (OMNIS_ADMIN)
        "port" : 3306                       # The port of the database service (OMNIS_ADMIN)
    },
    "tls": {
        "activated" : true,                         # Activate TLS ?
        "server_key_file": "../keys/server.key",    # RSA private key for TLS
        "server_crt_file" : "../keys/server.crt"    # RSA cert file for TLS
    }
}

How to launch ?

Lauch the server with the created config file :

./omnis-server testdata/example.json

Licensing

OmnIS Client is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.