Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent IP-bans #97

Merged
merged 4 commits into from
Jan 19, 2020
Merged

Persistent IP-bans #97

merged 4 commits into from
Jan 19, 2020

Conversation

ohlidalp
Copy link
Member

@ohlidalp ohlidalp commented Sep 25, 2019

This is hopefully simple enough to just work.

Related to #93 but only persists existing bans, no extensions were added yet.

UPDATE: Tested and ready.

@CuriousMike56
Copy link
Collaborator

Some testing:

Created an empty official.blacklist file, added blacklistfile = official.blacklist to the server config, server reports:

25-09-2019 14:15:52|t01| WARN|Couldn't parse blacklist file, messages:
�,�U

I banned a client running a fresh config, blacklist now contains:


{
	"bans" : 
	[
		
		{
			"banned_by_nickname" : "CuriousMike",
			"ip" : "",
			"message" : "test",
			"nickname" : "Player"
		}
	]
}

No IP is written & the user is still able to join. A default blacklist (with name server.blacklist) should always be created if it doesn't exist.

@Zentro
Copy link
Member

Zentro commented Jan 12, 2020

Add strncpy(b->ip, ip_addr.c_str(), 16); to the sequencer RecordBan. Without it, no IP is written to the blacklist file.

The blacklist file not being able to be parsed is due to an empty blacklist file.

Loaded on startup, updated on every ban (including silent ban from server script).

New commandline option: "-blacklist-file".
New config file option: "blacklistfile".
@RigsOfRods RigsOfRods deleted a comment from RoRBot Jan 12, 2020
@RigsOfRods RigsOfRods deleted a comment from RoRBot Jan 12, 2020
@ohlidalp
Copy link
Member Author

@CuriousMike56 thanks for testing, fixed.

@ohlidalp ohlidalp merged commit 5c875eb into RigsOfRods:master Jan 19, 2020
@ohlidalp ohlidalp deleted the bans branch January 19, 2020 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants