mirror of
https://github.com/kepler155c/opus
synced 2025-10-16 00:07:39 +00:00
security cleanup
This commit is contained in:
@@ -61,10 +61,18 @@ function os.verifyPassword(password)
|
||||
end
|
||||
|
||||
function os.getSecretKey()
|
||||
if not fs.exists('.secret') then
|
||||
Util.writeFile('.secret', math.random(100000, 999999))
|
||||
Config.load('os', config)
|
||||
if not os.secretKey then
|
||||
os.secretKey = math.random(100000, 999999)
|
||||
Config.update('os', config)
|
||||
end
|
||||
return Util.readFile('.secret')
|
||||
return os.secretKey
|
||||
end
|
||||
|
||||
function os.updatePassword(password)
|
||||
Config.load('os', config)
|
||||
config.password = password
|
||||
Config.update('os', config)
|
||||
end
|
||||
|
||||
function os.getPassword()
|
||||
|
@@ -24,7 +24,7 @@ process:newThread('trust_server', function()
|
||||
|
||||
socket:write('Trust accepted')
|
||||
else
|
||||
socket:write('Invalid password or password is not set')
|
||||
socket:write('Invalid password')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user