Repository navigation
feat: add allow and deny lists, allow-networks, accounts-per-ip, and a Discord webhook - #2
Merged
Merged
Conversation
Also skips dry-run bypasses and turns off link previews.
…s reloads Also skips the second blocking connection at startup when MySQL is down.
An allow add used to overwrite a deny entry for the same target, so staff with only origingate.command.allow could lift a deny, and the reverse.
… per IP A null remote address threw for every later login, which then followed on-lookup-failure without a lookup.
…k address 203.0.113.256 or 010.0.0.1 was saved as a player name that never matched. A UUID without dashes now gets them, and 1.2.3.5/24 is saved as 1.2.3.0/24 so removing the usual form works.
… note deny add Steve 30min griefing saved an entry that never expired. A word after the target that starts with a digit must now be a duration.
…lists When SQLite could not open on reload, the new memory table was read empty and every allow and deny entry stopped applying.
…tion on long lines Provider, organisation, and country text skipped address hiding. A line over 190 characters was cut from the end, which dropped the IP and the offline-mode caution first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is OriginGate 1.2.0. It adds the controls staff reach for first. Every new feature is off until set, and unchanged
config.ymlandmessages.ymlfiles from 1.0.0 and 1.1.x keep loading and behaving as before. Upgrade notes are in the changelog.origingate allow|deny add|remove|list: allow and deny entries for a player name, UUID, IP address, or CIDR range, with an optional expiry (1h,7d,never) and a note. Entries live in a neworigingate_listtable in the same SQLite or MySQL/MariaDB storage, so servers sharing MySQL share them, and each server re-reads them every 30 seconds. Logins read them from memory only.deny adddisconnects players online on this server whom the login check would now turn away. Adding a target that is on the other list needs that list's permission too.allow-networksrule: lets in networks listed by AS number when the vpn, proxy, or hosting rule would kick them. AS numbers only, because matching names in an allow rule would let in any VPN whose name contains the listed text.accounts-per-iprule, off by default: kicks a player whenmaxplayers are already online from the same address.show-ip: true, and mentions are disabled.Fixes from a code review of this branch:
allow addno longer replaces a deny entry for the same target unless the sender also hasorigingate.command.deny, and the reverse.203.0.113.256,010.0.0.1). A UUID without dashes gets them added, and1.2.3.5/24is saved as1.2.3.0/24.30min,1y) is refused, so a typo does not save an entry that never expires.Validation:
deny addon one applied on the other after 35 seconds with no login in between, and adeny removethe same way.deny adddisconnected an online player. The webhook posted every event type, and a 25-kick flood as a summary, to a private channel with every IP hidden.Known limits:
PlayerLoginEventon the main thread. Logins at the same moment from one address can both get in on Velocity and Bukkit, or both be kicked on BungeeCord. The platforms' own repeat-login limits make this rare.deny adddisconnects players on this server only. Servers sharing MySQL turn them away at their next login.