This script is used to gather data on Applied Energistics 2 networks. This data will be sent over a point-to-point connection, and encrypted for extra security.
To install, ensure your computer has an Internet Card
, then run the command: wget https://raw.githubusercontent.com/ReallySecureShell/OC-DataAcquisitionSystem/main/FacilityMasterControlUnit.lua
while in /etc/rc.d.
After downloading the script, you may remove the Internet Card
.
Then, review the example in this repository: examples/rc.cfg
, in-order to properly configure the script. Note the key in the FacilityMasterControlUnit table named publicKey
, this will be used later.
Your computer needs the following components installed:
Data Card (Tier 3)
Linked Card
[optional] Graphics Card (Tier 2)
[optional] Component Bus (any tier)
It is recommended that you use a Server (Tier 3)
, along with a Terminal Server
for wireless keyboard.
The receiving computer will also require the same components, and should also be a tier 3 server.
On the receiving computer (the one without the FacilityMasterControlUnit.lua script), run wget https://raw.githubusercontent.com/ReallySecureShell/OpenComputers-genkey/main/genkey
. Then run ./genkey --bits=384
. This will generate a keypair named ec-key, and ec-key.pub.
Transfer ec-key.pub
to the sender computer (the one which has the FacilityMasterControlUnit.lua script). Preferably, transfer ec-key.pub to /home/ec-key.pub on said computer. Then, configure the publicKey key in the FacilityMasterControlUnit table inside /etc/rc.cfg. The value of said table key will need to be changed to the path where ec-key.pub exists on the system.
The format of the message is as follows:
HEADER
ComputerID:string - The UUID of *this* computer.
sessionPublicKey:string - Serialized public key generated by *this* computer.
The receiver will use it to decrypt the message.
iv:string - Initialization Vector is generated everytime a
message is sent. This is used for encryption.
DATA
timestamp:string - day/month/year hour:minute:second (24-hour)
cUUID:string - Full UUID of ME Controller
energy:number - The REAL amount of FE the subnet is using.
itemsInNetwork:table - Amount of items stored within the subnet.
fluidsInNetwork:table - Amount of liquid stored within the subnet.
The data contained within HEADER
is unencrypted. However, all data within
DATA
is encrypted.
The following is the code which defines the structure of the message:
local __packet =
{
header =
{
computerID = computer.address(), -- A constant, so it's generated once per execution.
sessionPublicKey = nil,
iv = nil
},
data = nil
}
This script was designed and tested on Direwolf20+1.12-2.8.0
, using the following mods:
MOD | VERSION |
---|---|
Applied Energistics 2 | rv6-stable-7 |
OpenComputers | MC1.12.2-1.7.5.192 |