Add setup-auth mod

This commit is contained in:
Brice Copy 2019-01-26 17:39:00 +01:00
parent c25470acdd
commit 4a49c16e9a
3 changed files with 14 additions and 0 deletions

View File

11
mods/setup-auth/init.lua Normal file
View File

@ -0,0 +1,11 @@
print("setup-path initialization")
ENV_CTW_ADMIN_PASSWORD="CTW_ADMIN_PASSWORD"
if(os.getenv(ENV_CTW_ADMIN_PASSWORD ~= nil)) then
minetest.set_player_password("player1",minetest.get_password_hash("player1","playon1"))
minetest.set_player_password("admin",minetest.get_password_hash("admin",os.getenv(ENV_CTW_ADMIN_PASSWORD)))
print("setup-path initialized !")
else
print("Authentication not initialized, please define "..ENV_CTW_ADMIN_PASSWORD.." !!")
end

3
mods/setup-auth/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = setup-auth
descriptions = Initializes to a default list of users and privileges
depends =