{"id":18991364,"url":"https://github.com/mt-mods/geoip","last_synced_at":"2025-10-05T13:54:19.007Z","repository":{"id":44324729,"uuid":"184300156","full_name":"mt-mods/geoip","owner":"mt-mods","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-16T01:23:50.000Z","size":61,"stargazers_count":0,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-05T13:54:18.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mt-mods.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-30T16:59:24.000Z","updated_at":"2022-01-01T18:29:11.000Z","dependencies_parsed_at":"2022-08-12T11:01:43.818Z","dependency_job_id":null,"html_url":"https://github.com/mt-mods/geoip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mt-mods/geoip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mt-mods%2Fgeoip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mt-mods%2Fgeoip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mt-mods%2Fgeoip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mt-mods%2Fgeoip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mt-mods","download_url":"https://codeload.github.com/mt-mods/geoip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mt-mods%2Fgeoip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278464272,"owners_count":25991177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T17:13:39.187Z","updated_at":"2025-10-05T13:54:18.977Z","avatar_url":"https://github.com/mt-mods.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"\ngeoip mod for minetest\n\n[![luacheck](https://github.com/mt-mods/geoip/actions/workflows/luacheck.yml/badge.svg)](https://github.com/mt-mods/geoip/actions/workflows/luacheck.yml)\n[![mineunit](https://github.com/mt-mods/geoip/actions/workflows/mineunit.yml/badge.svg)](https://github.com/mt-mods/geoip/actions/workflows/mineunit.yml)\n\n# Overview\n\nLets you resolve geoip requests on a player\n\npowered by [IP Location Finder by KeyCDN](https://tools.keycdn.com/geo)\n\n### minetest.conf\n```\n# enable curl/http on that mod, required for geoip mod\nsecure.http_mods = geoip\n\n# geoip result cache time-to-live value, default is 3 hours\ngeoip.cache.ttl = 10800\n```\n\n### Commands\n```\n/geoip \u003cplayername\u003e\n```\n\n### privs\n\n* `geoip` can make a geoip query\n\n# Api\n\n```lua\n-- Geoip lookup command\ngeoip.lookup(\"213.152.186.35\", function(result)\n\t-- See \"Geoip result data\"\nend)\n\n-- Event handler registration\ngeoip.register_on_joinplayer(function(playername, result, last_login)\n  -- See \"Geoip result data\" for example result.\n  if result.asn == 65535 then\n    minetest.after(0, function()\n      minetest.kick_player(playername, \"No joining from reserved unused ASN\")\n    end)\n    -- Return `true` to stop event handler propagation, should be used if player will be forcibly disconnected\n    return true\n  end\nend)\n\n-- Event handler registration\ngeoip.register_on_prejoinplayer(function(playername, result, last_login, auth_data)\n  -- Only called if data is alre4ady cached.\n  -- See \"Geoip result data\" for example result.\n  if result.asn == 65535 then\n    -- Return string to disconnect player with that string as a reason.\n    return \"No joining from reserved unused ASN\"\n  end\nend)\n```\n\n## Geoip result data\n```lua\n{\n  success = true,\n  status = \"success\",\n  description = \"Data successfully received.\",\n  host = \"213.152.186.35\",\n  ip = \"213.152.186.35\",\n  rdns = \"213.152.186.35\",\n  asn = 49453,\n  isp = \"Global Layer B.V.\",\n  country_name = \"Netherlands\",\n  country_code = \"NL\",\n  region_name = null,\n  region_code = null,\n  city = null,\n  postal_code = null,\n  continent_name = \"Europe\",\n  continent_code = \"EU\",\n  latitude = 52.3824,\n  longitude = 4.8995,\n  metro_code = null,\n  timezone = \"Europe/Amsterdam\",\n  datetime = \"2021-05-20 08:45:56\"\n}\n```\n\n# License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmt-mods%2Fgeoip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmt-mods%2Fgeoip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmt-mods%2Fgeoip/lists"}