Giter Club home page Giter Club logo

xban2's Introduction

Extended Ban Mod for Minetest

This mod attempts to be an improvement to Minetest's ban system.

  • It supports normal bans and temporary bans (from 60 seconds up to the end of time, with 1 second granularity).
  • Records and joins all accounts using the same IP address and several IP addresses using the same name into a single record, and can ban/unban them as a single user.
  • Can ban offline players if you know their IP or username.
  • Holds a record of bans for each user, so moderators and administrators can consult it to know if a player is a repeat offender.
  • Does not modify the default ban database in any way (`ipban.txt').
  • Has an API to ban and check the ban database to allows other mods to manage users (for example, anticheat mods).

Chat commands

The mod provides the following chat commands. All commands require the ban privilege.

xban

Bans a player permanently.

Usage: /xban <player_or_ip> <reason>

Example: /xban 127.0.0.1 Some reason.

xtempban

Bans a player temporarily.

Usage: /xtempban <player_or_ip> <time> <reason>

The time parameter is a string in the format <count><unit> where <unit> is one of s for seconds, m for minutes, h for hours, D for days, W for weeks, M for months, or Y for years. If the unit is omitted, it is assumed to mean seconds. For example, 42s means 42 seconds, 1337m 1337 minutes, and so on. You can chain more than one such group and they will add up. For example, 1Y3M3D7h will ban for 1 year, 3 months, 3 days and 7 hours.

Example: /xtempban Joe 3600 Some reason.

xunban

Unbans a player.

Usage: /xunban <player_or_ip>

Example: /xunban Joe

xban_record

Shows the ban record on chat.

Usage: /xban_record <player_or_ip>

This prints one ban entry per line, with the time the ban came into effect, the expiration time (if applicable), the reason, and the source of the ban. The record is printed to chat with one entry per line.

Example: /xban_record Joe

xban_wl

Manages the whitelist.

Usage: /xban_wl (add|del|get) <player_or_ip>

Whitelisted players are allowed on the server even if it's otherwise marked as banned. This is useful to only allow certain users from shared computers, for example.

The add subcommand adds the player to the whitelist. The del subcommand removes the player from the whitelist. The get subcommand checks if the player is in the whitelist, and prints the status to chat.

Example: /xban_record add Jane

xban_gui

Shows a form to consult the database interactively.

Usage: /xban_gui

Administrator commands

The following commands require the server privilege, so they are only available to server administrators.

xban_dbi

Imports ban entries from other database formats.

Usage: /xban_dbi <importer>

The importer argument specifies from which database to import. These are the supported import plugins at the time of writing:

  • minetest: Import entries from Minetest's ban list (ipban.txt).
  • v1: Old format used by xban (players.iplist).
  • v2: Old format used by xban (players.iplist.v2).

Example: /xban_dbi minetest

xban_cleanup

Removes all non-banned entries from the xban db.

Usage: /xban_cleanup

xban2's People

Contributors

agaran avatar jurajvajda avatar kaeza avatar luk3yx avatar panquesito7 avatar sfan5 avatar sofar avatar thomasrudin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xban2's Issues

potential incorrect ban bug

Certain combinations of usernames and ban reasons can lead to banning the wrong person, or even multiple people who are unrelated to the person being banned. Please contact me on IRC for details.

Full logs and files available on request.

Cheers

Someone on a permaban AND temporary ban gets unbanned at expiration time

It's not the behavior you would expect.

Two people banned the same player. One forever (/xban) and one temporarily (/xtempban). When the temporary ban expired, he could play. /xban_record showed the two bans but the expiration time of the temporary one was always now, the time at which the command was run. And the permaban was ignored when the player tried to log in.

Recent GUI changes leave no way to clear a search

Hi,

Ever since the improved GUI was added last May, I am unable to "clear the search" and show all the player names (it shows a large amount). Searching for these hidden players works, but backspacing all letters does not show every player like it should/used to.

Thank you!

Default time limit

I'd like to suggest a default time limit be applied to new bans since it's difficult to remember to do so manually ๐Ÿ˜› . 2 weeks seems about right.

xban.db file wipes itself out after some 65536 limit is hit

Hi,

I recently discovered that at one point in April 2019 on one of my servers, my xban.db file was wiped out.

Around the time it happened, debug.txt turns this message up:

WARNING[Main]: [xban] Unable to load database: Deserialization failed: (load):378023: main function has more than 65536 constants

I don't know what "constants" are and wasn't paying attention to when this happened, but I don't think there were 65536 entries in xban.db at the time.

Also, I don't have the xban.db to offer you, but based the most recent server backup I have before this happened, 378023 is probably a line number in xban.db.

The most recent version of the mod was being used (February 12, 2019)

Sorry I can't offer more information on this.

Multi-server sync

A feature is desperately needed where Xban mod can coordinate between multiple servers, keeping their ban/xban lists in sync. If I ban someone on one server, I would like other servers in some configurable "network" to be signaled, and enact that ban also. The reverse should also be done (perhaps with a special command, so that it's possible to unban someone from just one server).

Maybe they could all just be configured to use some common file to pass such messages along (assuming mod security doesn't get in the way of that)

Suggestion - Allow Names and IPs to be Entered Without an Existing Record.

There are times when I received names and IPs of players who have been banned on other servers and I would like to be able to add them to xBan2 but currently, since they have not yet logged into my server, there is no record of them and xBan2 won't accept the input from "/xban ".

My previous method has been to manually enter the IP and playname in the default ipban file, then use "/xban_dbi minetest" to import the ipban file's info. That resulted in a scrambled mess of xban's file where player names and IP that should not have been banned were lumped into the "Banned from ipban.txt" section.

I've backed-up and deleted the xban file and will be sorting through the back-up to manually add the banned IPs and names to the ipban file. As a precaution, every time I banned a player I revoked all privs and added them to the future_ban mod's list.

Unclear licence

The forum thread claims a 2-clause BSD Licence but this is not specified anywhere in the repository.

xban incorrect syntax bans (unknown subset of) users

server: minetest server 0.4.15 2017-03-16 git
xban2: 2017-04-24 git
If one types
/xban mrg3 1D
accidentally instead of
/xtempban mrg3 1D
the player might see a message saying "Banned: Reason: 1D" and be permanently banned. Then many players on server (or similarly named? or recently logged in?) are banned too.

In a version of xban from about a year and a half ago (from old repo before placed in github.com/minetest-mods) also happened when several people with various names ending in numbers (or not) were logged in. In that scenario I may have banned a player who was not logged in. That seemed to ban everyone.

On both occasions I had to edit xban.db manually to resolve the issue. I'm glad this was in a human-readable text file that could be trivially edited remotely using nano or notepad++ via FTP.

	[26] = {
		["banned"] = true,
		["record"] = {
			[1] = {
				["reason"] = "1D",
				["time"] = 1496974261,
				["source"] = "mrg",
			},
		},
		["time"] = 1496974261,
		["names"] = {
			["192.212.100.47"] = true,
			["mrg2"] = true,
			["mrg3"] = true,
			["mrg"] = true,
			["192.212.100.133"] = true,
			["192.212.100.25"] = true,
		},
		["last_seen"] = 1496973703,
		["reason"] = "1D",
		["last_pos"] = {
			["y"] = -24.5,
			["x"] = 8.1890001296997,
			["z"] = 74.534004211426,
		},
	},

In addition to mrg3, it also banned me (mrg) and mrg2 as seen in the list above and in the attached log screenshot.
Could this be anything to do with having a number after a name?
If you notice above, all of their ip addresses were banned too, though neither intended nor typed.

xban.db path

Should xban.db be stored in the logfile path instead of the world path?

The file contains usernames and IP addresses which would usually be stored in the log directory and not the world directory.

xban_record displays incorrect date, GUI displays correct date

Hello

Problem description

When using /xban_record to view a user's ban information, the dates displayed are always the server's current date/time

When using /xban_gui, the actual date that the user was banned is displayed

Steps to reproduce

  • Ban player
  • Wait some time (a few dozen minutes should be enough for clarity)
  • Compare date in /xban_gui and /xban_record for the same player
  • See date discrepancy, the date in the chat will be the server's current date

System info

  • Platform: Linux
  • Minetest server version: 0.4.17.1
  • xban2 version: master (3270942)

Thanks

Ban an IP

Hello, sorry for my bad english,
I have a (big) problem on my server: a player usurps accounts that have no password. I need to ban his/her IP, because the names that he/she uses are others players names.

I tried to use the /xban command with the IP, as written on the forum topic, but it didn't work... How can I do that ?

Here are some logging messages:

2016-06-25 12:23:07: ACTION[Server]: [xban] palige bans 91.86.249.35 until the end of time for reason: Usurpation de comptes
2016-06-25 12:23:07: ACTION[Server]: [xban] Banned Names/IPs:    <== no names !
2016-06-25 15:38:04: ACTION[Server]: paul [91.86.249.35] joins game.
2016-06-25 15:38:04: ACTION[Server]: paul joins game. List of players: elprincipiante paul
2016-06-25 15:38:16: ACTION[Server]: paul changes password   <== Then I cleared the password to allow paul to connect again...

Here is the output of /xban_record 91.86.249.35:

[xban] [mar. 05 juil. 2016 10:18:37 CEST]: Usurpation de comptes, Source: palige

EDIT: I tested to ban my own IP, it worked (then I unbanned it from IRC and it also worked ๐Ÿ˜‰) ! Could "91.86.249.35" have hacked his/her client to make it insensible to ban ?

xban seems to have no effect

Hi there, my server is on 9bff154cba14686f5a3b56f4cba405824b88c402 (Fix horizontal/vertical merging bug of hardware-colored framed glass (#10417)), Thu Sep 24 00:10:50 2020 +0100, banning or temp banning a user seems to have no effect. The user is able to rejoin with and without alt-accounts.

Temporary ban does not work

2015-06-24 20:47:47: ACTION[ServerThread]: Server: Player with the name "Player" tried to connect from [removed] but it was disallowed for the following reason: Banned: Expires: Wed 24 Jun 2015 08:39:35 PM BST, Reason: Testing a one minute ban

You can see clearly from the log above that the time is 20:47:47 and the ban expires at 08:39:35 PM, yet the player in unable to join.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.