{"id":15140988,"url":"https://github.com/shivajiva101/sban","last_synced_at":"2025-10-23T18:30:29.227Z","repository":{"id":25749256,"uuid":"105141635","full_name":"shivajiva101/sban","owner":"shivajiva101","description":"player ban mod for minetest","archived":false,"fork":false,"pushed_at":"2022-10-23T19:31:52.000Z","size":203,"stargazers_count":11,"open_issues_count":0,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-30T20:05:42.235Z","etag":null,"topics":["ban","ban-management","ban-records","lsqlite3","minetest","minetest-mod"],"latest_commit_sha":null,"homepage":"https://forum.minetest.net/viewtopic.php?f=9\u0026t=18603","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/shivajiva101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-28T11:45:52.000Z","updated_at":"2024-10-20T21:58:57.000Z","dependencies_parsed_at":"2023-01-14T03:20:30.899Z","dependency_job_id":null,"html_url":"https://github.com/shivajiva101/sban","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivajiva101%2Fsban","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivajiva101%2Fsban/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivajiva101%2Fsban/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivajiva101%2Fsban/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shivajiva101","download_url":"https://codeload.github.com/shivajiva101/sban/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237869148,"owners_count":19379275,"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","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":["ban","ban-management","ban-records","lsqlite3","minetest","minetest-mod"],"created_at":"2024-09-26T08:43:05.470Z","updated_at":"2025-10-23T18:30:29.222Z","avatar_url":"https://github.com/shivajiva101.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sban\n[![Build status](https://github.com/shivajiva101/sban/workflows/Check%20\u0026%20Release/badge.svg)](https://github.com/shivajiva101/sban/actions)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThis mod is based on the concepts introduced by xban2, and expands on them\nby using an sql database instead of a serialised table file. This approach to\nban management:\n\n* Offers API access to core functions that can be disabled if reqd\n* Improves the robustness of the data.\n* Grants an enhanced view of player accounts and ban records.\n* Provides tiered access to player record information.\n* Provides optional automatic ban expiration.\n* Provides the capability to pre-emptively ban players.\n* Offers increased accessibility via SSH connections to the database with your\nfavourite database management gui.\n* Can preserve existing bans by importing records from Minetest or xban2.\n\nTransactions are coded without locks so it's not recommended to write to\nthe database whilst Minetest is using it. Reading the database shouldn't be an issue.\n\n\u003cb\u003eExisting users please note:\u003c/b\u003e sban will not allow minetest to run if your db version doesn't match the current version required, if that happens and \u003cb\u003eonly\u003c/b\u003e if, you need to apply \u003cb\u003e\u003ci\u003esban/tools/sban_update.sql\u003c/b\u003e\u003c/i\u003e to the database by copying the file into the world folder, then you can use sqlite3 in a terminal, after navigating to the world folder, using the commands:\n\n\tsqlite3 sban.sqlite\n\t.read sban_update.sql\n\t.exit\n\nIt's a good idea to make a backup prior to running the update just in case and the update should \u003cb\u003enot\u003c/b\u003e be applied more than once!\n\n#### INSTALLATION\n\nsban requires lsqlite3 (https://github.com/LuaDist/lsqlite3).\n\nIf you have luarocks (https://luarocks.org/) installed on the target server,\nyou can easily install lsqlite3 in a terminal:\n\n    sudo luarocks install lsqlite3\n\nIf the target server runs mods in secure mode[recommended], you must add sban\nto the list of trusted mods in minetest.conf:\n\n\tsecure.trusted_mods = sban\n\n#### COMMANDS\n\nThe mod provides the following chat console commands. These commands require\nthe ban privilege. The ban_admin and server privileges extend the functionality\nof some commands.\n\n\u003cb\u003ebang\u003c/b\u003e\n\nLaunches a GUI. Comprehensive management of bans via a user interface for in-game convenience.\nOn launch the interface shows a hotlist containing the last 10 players to join. Use search\nto find a player if they are not currently in the list. Multiple records are shown if available,\naccessible via the arrows.\n\n``` Usage: /bang ```\n\nPlease note any client accessing this form without the required privilege i.e. a hacked client, will be logged and banned automatically!\n\n\u003cb\u003eban\u003c/b\u003e\n\nBans a player permanently.\n\n``` Usage: /ban \u003cname_or_ip\u003e \u003creason\u003e ```\n\nExample: /ban Steve Some reason.\n\nThe server privilege enables the pre-emptive banning of player names or\nIP addresses for which the server has no current record.\n\n\u003cb\u003etempban\u003c/b\u003e\n\nBans a player temporarily.\n\n```Usage: /tempban \u003cname_or_ip\u003e \u003ctime\u003e \u003creason\u003e```\n\nExample: /tempban Steve 2D Some reason.\n\nThe time parameter is a string in the format \\\u003ccount\u003e \\\u003cunit\u003e,\nwhere \\\u003cunit\u003e  is either s for seconds, m for minutes, h for hours, D for days,\nW for weeks, M for months, or Y for years. If the unit is omitted, it is\nassumed to mean seconds. For example, 42 means 42 seconds, 1337m means 1337 minutes,\nand so on. You can chain more than one such group and they will add up.\nFor example, 1Y3M3D7h will ban for 1 year, 3 months, 3 days and 7 hours.\n\n\u003cb\u003eunban\u003c/b\u003e\n\nUnbans a player.\n\n```Usage: /unban \u003cname_or_ip\u003e \u003creason\u003e```\n\nExample: /unban Steve Some reason.\n\nNote that this command requires a reason.\n\n\u003cb\u003eban_record\u003c/b\u003e\n\nDisplays player record and ban record.\n\n```Usage: /ban_record \u003cname_or_ip\u003e```\n\nExample: /ban_record Steve\n\nThis prints the player record and ban record for a player. The records are\nprinted to the chat console with one entry per line.\n\nThe player record includes names and, if sufficient privileges,\nIP addresses used by the player. The number of records displayed is limited\nto 10 by default to prevent chat console spam, and can be adjusted through\nthe setting sban.display_max in minetest.conf.\n\nThe ban record includes a list of all ban related actions performed on the player\nunder any known name or IP address. This includes the time a ban came into effect,\nthe expiration time (if applicable), the reason, and the source of the ban.\n\nNote that the records of players with the server privilege can only be viewed\nby other players with the server privilege.\n\n\u003cb\u003eban_wl\u003c/b\u003e\n\nManages the whitelist.\n\n```Usage: /ban_wl (add|del|list) \u003cname_or_ip\u003e```\n\nExample: /ban_wl add Steve\n\nWhitelisted players are allowed on the server even if they are marked\nas banned. This is useful to ensure moderators cannot ban each other.\n\nThe add subcommand adds a player to the whitelist.\nThe del subcommand removes a player from the whitelist.\nThe list subcommand lists the players on the whitelist.\n\n#### ADMINISTRATION COMMANDS\n\nThese commands are for administering the server and require the server privilege.\nYou can import a server's previous ban history from xban2's xban.db file or from\nMinetest's ipban.txt file.\n\nThis is an intensive process that will cause lag, so it's recommended\nyou perform this on a local instance and copy the database to the server\nbefore starting with the sban mod installed.\n\n\u003cb\u003eban_dbi\u003c/b\u003e\n\nImports bans from xban.db or ipban.txt files into an existing\nsban.sqlite file.\n\n```Usage: /ban_dbi \u003cfilename\u003e```\n\nExample: /ban_dbi xban.db or /ban_dbi ipban.txt\n\nIt's possible to place multiple files in the world folder and execute the\ncommand on each file. For example:\n\n    /ban_dbi xban_1.db\n    /ban_dbi xban_2.db\n\nEach record is checked against the database by player name to prevent duplicate\nentries.\n\n\u003cb\u003eban_dbe\u003c/b\u003e\n\nExtracts all valid player records from an xban.db file and saves them in xban.sql.\n\n```Usage: /ban_dbe \u003cinput_filename\u003e```\n\nExample: /ban_dbe xban.db\n\nThis creates a file called xban.sql in the world folder. Import the file\nfrom the sqlite prompt using:\n\n    .open sban.sqlite\n    .read xban.sql\n    .exit\n\nThe time of the import operation is dependant on the size of the .sql file.\n\n\u003cb\u003eban_dbx\u003c/b\u003e\n\nDumps the database back to xban2 file format. Use it before you uninstall this mod\nif you intend using xban2 and wish to retain the data.\n\n```Usage: /ban_dbx```\n\nDo this before enabling xban2 mod otherwise it will be overwritten by the currently loaded data.\n\n\u003cb\u003ewhois\u003c/b\u003e\n\n```Usage: //whois \u003cname\u003e```\n\nExample: //whois sadie\n\nReturns all known accounts and ip addresses associated with a player name.\n\n#### CONFIG SETTINGS\n\nYou can add these optional settings to minetest.conf to adjust the sban mod's\nbehaviour. Deleting them removes the modification and sban will revert back to\nthe default behaviour. Minetest config file can only be changed when the server\nisn't running!\n\n\u003cb\u003esban.api\u003c/b\u003e\n\nControls loading of the API functions. \u003cb\u003eDefault: true\u003c/b\u003e\n\n\tsban.api = false\n\nThis would disable the API functions and prevent other mods access via the global sban table.\n\n\u003cb\u003esban.display_max\u003c/b\u003e\n\nChanges the maximum number of player records displayed when using the /ban_record\ncommand.\n\n\tsban.display_max = 12\n\nThis would increase the number of records shown from the \u003cb\u003edefault: 10\u003c/b\u003e records to 12.\n\n\u003cb\u003esban.ban_max\u003c/b\u003e\n\nAllows server owners to set an expiry date for bans. It uses the same format for\ndurations as the /tempban command.\n\n\tsban.ban_max = 90D\n\nIn this example all permanent player bans created after the setting has been added\nto minetest.conf, and after a server restart, will expire 90 days after the ban was\nset. If required, longer ban durations can still be set with the tempban command.\n\n\u003cb\u003ePlease note:\u003c/b\u003e existing ban expiry dates are not affected by changing this setting,\n including permanent bans but they will be applied to any subsequent new bans.\n\n\u003cb\u003esban.accounts_per_id\u003c/b\u003e\n\nRestricts how many accounts an id can have.\n\n\tsban.accounts_per_id = 5\n\nPlease note this setting is optional and the default behaviour is unrestricted.\n\n\u003cb\u003esban.ip_limit\u003c/b\u003e\n\nRestricts how many ip addresses a single id can have.\n\n\tsban.ip_limit = 10\n\t\nPlease note this setting is optional and the default behaviour is unrestricted.\n\n\u003cb\u003esban.import_enabled\u003c/b\u003e\n\nDisables the import/export sections of code.\n\n\tsban.import_enabled = false\n\nThe default is true, this setting allows you to disable the code and commands associated with\nimporting \u0026 exporting data and should only be set to false once you have imported your ban sources.\n\n\u003cb\u003esban.cache.max\u003c/b\u003e\n\nMaximum cached name records.\n\n\tsban.cache.max = 1000\n\nIf you don't add this setting sban will use the value above as the default.\n\n\u003cb\u003esban.cache.ttl\u003c/b\u003e\n\nTime in seconds to deduct from the last player to login as the cutoff point for pre caching names.\n\n\tsban.cache.max = 86400\n\nIf you don't add this setting sban will use the value above as the default. Disable name caching by setting to -2\n\n\n#### CREDITS\n\nThanks to:\n\nShara for suggesting improvements and editing documentation.    \nrubenwardy for suggesting improvements to the interface layout.    \nsofar for requesting a gui and suggesting the hotlist concept.    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivajiva101%2Fsban","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshivajiva101%2Fsban","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivajiva101%2Fsban/lists"}