Skip to content

Latest commit

 

History

History
153 lines (128 loc) · 6 KB

README.md

File metadata and controls

153 lines (128 loc) · 6 KB

Node.js CI Lint

GitHub Release GitHub Contributors Discord

Device Config Manager

To be used with RealDeviceMap macless solutions.

Central repository for macless client configurations without having to keep track of multiple remote configs and urls. Assign different configurations to different devices and different backends (RealDeviceMap, Lorgnette, Golbat, etc).

When a device connects for the first time an entry is created in the database. Otherwise, if the device does not have a config assigned and a default config is set, the default config will be auto-assigned.

Manually creating devices ahead of time is also possible, if needed. Rest endpoint tooling to get device screenshot, currently logged in account username, restart game, reboot device, view device logs, and more.

Prerequisites

Installation

  1. Clone repository: git clone https://github.com/versx/DeviceConfigManager dcm

Client

  1. Install packages: npm install
  2. Copy example config: cp src/config.example.json src/config.json
  3. Fill out config options.
  4. Build project in root folder: npm run build
  5. Run: npm run start

Server

  1. Change directories: cd server
  2. Install packages: npm install
  3. Copy example config: cp src/config.example.json src/config.json
  4. Fill out config options.
  5. Build project in root folder: npm run build
  6. Run: npm run start

Updating

Client

  1. Pull latest changes in root folder git pull
  2. Build client project in root folder: npm run build
  3. Run npm run start

Server

  1. Pull latest changes in root folder git pull
  2. Change directories: cd server
  3. Build server project: npm run build
  4. Run npm run start

Configuration

Client

{
  // Base API url address of server.
  "apiUrl": "http://127.0.0.1:9992/api/v2/"
}

Server

{
  // Host IP address to list on.
  "host": "0.0.0.0",
  // Port to listen on.
  "port": 9992,
  // Authorization options.
  "auth": {
    // Initial Administrator user account seed.
    "admin": {
      // Username for admin account.
      "username": "admin",
      // Password for admin account.
      "password": "p4ssw0rd!"
    },
    // Secret token used for creating JsonWebTokens (JWTs).
    "secret": "auth token",
    // MITM authorization bearer tokens allowed, leave blank to allow all.
    "bearerTokens": []
  },
  // Keep device IP addresses updated in database.
  "autoSyncIP": true,
  // Database options.
  "database": {
    // Database dialect to use. (i.e. mysql/mariadb)
    "dialect": "mysql",
    // Database host address.
    "host": "127.0.0.1",
    // Database listening port.
    "port": 3306,
    // Database account username.
    "username": "root",
    // Database account password.
    "password": "password",
    // Database name.
    "database": "dcmdb",
    // Timezone used for `createdAt` and `updatedAt` column values.
    "timezone": "America/Denver",
    // Whether to enable or disable Sequelize database
    // query logging.
    "logging": false
  },
  // Logging options.
  "logs": {
    // Log level to use. (none, trace, debug, info, warn, error)
    "level": "info",
    // Log color options.
    "colors": {
      "text": "#ffffff",
      "variable": "#ff624d",
      "date": "#4287f5",
      "warn": "#ffff00",
      "error": "#ff0000"
    },
    // Log rotation options.
    "rotate": {
      // How often to check if log file should be rotated
      "interval": "1h",
      // Maximum number of rotated log files to keep
      "maxFiles": 5,
      // Maximum size of log file before rotated
      "maxSize": "1M"
    }
  },
  // 
  "timezone": "America/Denver"
}

Screenshots

Dashboard
Dashboard

Configs Devices (Grid) Devices (Table) Manage Device
Configs Devices (Grid) Devices (Table) Manage Device
Schedules Settings
Schedules Settings

Admin Dashboard
Admin Dashboard

Users Settings
Users Admin Settings