fediauth/init.lua

29 lines
781 B
Lua
Raw Normal View History

2023-09-27 10:57:15 +00:00
local MP = minetest.get_modpath("fediauth")
local http = minetest.request_http_api()
2023-01-28 11:04:14 +00:00
2023-01-29 12:49:00 +00:00
-- sanity checks
assert(type(minetest.encode_png) == "function")
2023-09-27 10:57:15 +00:00
fediauth = {
2023-01-28 11:04:14 +00:00
-- mod storage
storage = minetest.get_mod_storage(),
-- baseXX functions
2023-01-28 16:49:12 +00:00
basexx = loadfile(MP.."/basexx.lua")(),
2023-01-28 11:04:14 +00: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-01-28 18:55:46 +00:00
end
2023-09-27 10:57:15 +00:00