Files
chronorunner/docs/README.md
DaanSelen 86ad71f913
Some checks failed
CodeQL Advanced / Analyze (go) (push) Failing after 13s
CodeQL Advanced / Analyze (actions) (push) Failing after 16s
CodeQL Advanced / Analyze (python) (push) Failing after 12s
Update README.md
2025-06-04 23:42:03 +02:00

2.2 KiB

GhostRunner

CodeQL Advanced

This project aims to create a way to schedule commands to be run as soon as possible when they offline initialy.
The way to accomplish this is to create a tracked task list, and keep track of it has been successfully done.

Technical details.

Go(lang) backend server which exposes an HTTP API which can be used to add tasks to the process.
Python executor/runner which actually executes the commands, Python was chosen because of the availability of: LibMeshCtrl Python Library.

Create a python virtual environment inside the runner folder.

JSON Templates:

Following is mock data.

InfoResponse

{
  "status": 200,
  "message": "Request successful",
  "data": {
    "example": "This is some mock data"
  }
}

TokenCreateDetails

{
  "name": "DeploymentToken123"
}

TokenCreateBody

{
  "authtoken": "abc123securetoken",
  "details": {
    "name": "DeploymentToken123"
  }
}

TokenListBody

{
  "authtoken": "abc123securetoken"
}

TaskData

{
  "name": "UpdateScript",
  "command": "sudo apt update && sudo apt upgrade -y",
  "nodeids": ["node-001", "node-002", "node-003"],
  "creation": "2025-05-27T10:15:30Z",
  "status": "pending"
}

TaskBody

{
  "authtoken": "abc123securetoken",
  "details": {
    "name": "UpdateScript",
    "command": "sudo apt update && sudo apt upgrade -y",
    "nodeids": ["node-001", "node-002", "node-003"],
    "creation": "2025-05-27T10:15:30Z",
    "status": "pending"
  }
}

Device

{
  "name": "RaspberryPi-01",
  "nodeid": "node-001"
}

PyOnlineDevices

{
  "online_devices": [
    {
      "name": "RaspberryPi-01",
      "nodeid": "node-001"
    },
    {
      "name": "Server-02",
      "nodeid": "node-005"
    }
  ],
  "offline_devices": [
    {
      "name": "IoT-Gateway",
      "nodeid": "node-003"
    }
  ],
  "total_devices": 3
}