2023-09-27 10:57:15 +00:00
|
|
|
local MP = minetest.get_modpath("fediauth")
|
|
|
|
local http = minetest.request_http_api()
|
2023-01-28 12:04:14 +01:00
|
|
|
|
2023-01-29 13:49:00 +01:00
|
|
|
-- sanity checks
|
|
|
|
assert(type(minetest.encode_png) == "function")
|
|
|
|
|
2023-09-27 10:57:15 +00:00
|
|
|
fediauth = {
|
2023-01-28 12:04:14 +01:00
|
|
|
-- mod storage
|
|
|
|
storage = minetest.get_mod_storage(),
|
|
|
|
|
|
|
|
-- baseXX functions
|
2023-01-28 17:49:12 +01:00
|
|
|
basexx = loadfile(MP.."/basexx.lua")(),
|
2023-01-28 12:04:14 +01:00
|
|
|
}
|
|
|
|
|
2023-09-27 10:57:15 +00:00
|
|
|
dofile(MP.."/mastoapi.lua")
|
|
|
|
local instance = minetest.settings:get("fediauth.instance")
|
|
|
|
local key = minetest.settings:get("fediauth.api_token")
|
|
|
|
if not instance or not key then
|
|
|
|
minetest.log("warning", "[fediauth] For working fediauth you should specify fediauth.instance and fediauth.api_token")
|
|
|
|
else
|
|
|
|
mastoapi_init(http, instance, key)
|
|
|
|
dofile(MP.."/functions.lua")
|
|
|
|
dofile(MP.."/onboard.lua")
|
|
|
|
dofile(MP.."/join.lua")
|
|
|
|
dofile(MP.."/privs.lua")
|
|
|
|
dofile(MP.."/priv_revoke.lua")
|
2023-10-03 13:23:33 +03:00
|
|
|
dofile(MP.."/password_save.lua")
|
2023-01-28 19:55:46 +01:00
|
|
|
end
|
2023-09-27 10:57:15 +00:00
|
|
|
|