.
This commit is contained in:
parent
2038a32aa0
commit
5252961fd7
@ -6,7 +6,9 @@ os.loadAPI("brulijam/lib/aes.lua")
|
|||||||
function createKeyfile()
|
function createKeyfile()
|
||||||
basic.clearDisplay()
|
basic.clearDisplay()
|
||||||
print("[Networking]")
|
print("[Networking]")
|
||||||
write("Please enter shared secret for networking: ")
|
print("Please enter shared secret for networking.")
|
||||||
|
print("This will be used to communicate with other Devices and should be the same on different Turtles and Computers.")
|
||||||
|
write("Input: ")
|
||||||
local pwHash = hash.digestStr(read("*") .. "salty salt")
|
local pwHash = hash.digestStr(read("*") .. "salty salt")
|
||||||
basic.writeToFile("brulijam/files/networking-key.txt", pwHash)
|
basic.writeToFile("brulijam/files/networking-key.txt", pwHash)
|
||||||
basic.clearDisplay()
|
basic.clearDisplay()
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
labelPrefix = "SPHEAL"
|
local basic = require("lib.basic")
|
||||||
|
|
||||||
local hash = require("lib.hash")
|
local hash = require("lib.hash")
|
||||||
|
|
||||||
|
local systemConfig = basic.readFileAll("/brulijam/config/systemConfig.txt")
|
||||||
|
systemConfig = textutils.unserialize(systemConfig)
|
||||||
|
|
||||||
if os.getComputerLabel() == nil then
|
if os.getComputerLabel() == nil then
|
||||||
local labelMainPart = string.sub(hash.digestStr(string.format(os.getComputerID())), 1, 6)
|
local labelMainPart = string.sub(hash.digestStr(string.format(os.getComputerID())), 1, 6)
|
||||||
os.setComputerLabel(labelPrefix .. "-" .. labelMainPart)
|
os.setComputerLabel(systemConfig["labelPrefix"] .. "-" .. labelMainPart)
|
||||||
end
|
end
|
@ -13,7 +13,9 @@ local function createPwHash()
|
|||||||
while not inputConfirmed do
|
while not inputConfirmed do
|
||||||
basic.clearDisplay()
|
basic.clearDisplay()
|
||||||
print("[Systemlock]")
|
print("[Systemlock]")
|
||||||
write("Create a new password: ")
|
print("Create a new password.")
|
||||||
|
print("This will be used to unlock this device.")
|
||||||
|
write("Input: ")
|
||||||
local input = read("*")
|
local input = read("*")
|
||||||
pwHash = hash.digestStr(input .. os.getComputerID())
|
pwHash = hash.digestStr(input .. os.getComputerID())
|
||||||
|
|
||||||
|
@ -1,9 +1,22 @@
|
|||||||
--you may change these values
|
--you may change these values
|
||||||
local repo = "https://git.brulijam.com/brulijam/Computercraft/raw/branch/main/src"
|
local repo = "https://git.brulijam.com/brulijam/Computercraft/raw/branch/main/src"
|
||||||
|
local labelPrefix = "SPHEAL"
|
||||||
|
|
||||||
print("[Booting]")
|
print("[Booting]")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if not (fs.exists("brulijam/config/system.txt")) then
|
||||||
|
local systemConfig = {}
|
||||||
|
systemConfig["labelPrefix"] = labelPrefix
|
||||||
|
file = fs.open("brulijam/config/system.txt", "w")
|
||||||
|
file.write(systemConfig)
|
||||||
|
file.close()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local motd = settings.get("motd.enable")
|
local motd = settings.get("motd.enable")
|
||||||
if motd then
|
if motd then
|
||||||
shell.run("set motd.enable false")
|
shell.run("set motd.enable false")
|
||||||
|
Loading…
Reference in New Issue
Block a user