1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-15 07:47:40 +00:00

security cleanup

This commit is contained in:
kepler155c@gmail.com
2017-05-13 21:05:05 -04:00
parent 6f62d59108
commit 4cbb2b2257
4 changed files with 17 additions and 16 deletions

View File

@@ -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()