Skip to content

feat: add allow and deny lists, allow-networks, accounts-per-ip, and a Discord webhook - #2

Merged
rayhandestian merged 32 commits into
mainfrom
feat/1.2.0
Nov 16, 2026
Merged

rayhandestian merged 32 commits into
mainfrom
feat/1.2.0

Conversation

@rayhandestian

@rayhandestian rayhandestian commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

This is OriginGate 1.2.0. It adds the controls staff reach for first. Every new feature is off until set, and unchanged config.yml and messages.yml files 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 new origingate_list table 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 add disconnects 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-networks rule: 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-ip rule, off by default: kicks a player when max players are already online from the same address.
  • Discord webhook: kicks, bypasses, and lookup alerts, combined into one post every 5 seconds (up to 10 lines, then a count). IP addresses are hidden, including inside notes, alerts, and lookup answers, unless show-ip: true, and mentions are disabled.
  • Not in this release: the developer API event and a "providers must agree" mode.

Fixes from a code review of this branch:

  • allow add no longer replaces a deny entry for the same target unless the sender also has origingate.command.deny, and the reverse.
  • Mistyped targets are refused instead of being saved as player names (203.0.113.256, 010.0.0.1). A UUID without dashes gets them added, and 1.2.3.5/24 is saved as 1.2.3.0/24.
  • A word after the target that starts with a digit but is not a duration (30min, 1y) is refused, so a typo does not save an entry that never expires.
  • On Velocity, a player without a remote address no longer breaks the accounts-per-ip count.
  • A reload that falls back to memory-only lists keeps the entries.
  • Long Discord lines are cut before the IP and the offline-mode caution.

Validation:

  • 300 core tests, the docs check, and the tools tests pass locally. CI runs on this PR.
  • Velocity loopback probe: 26 of 26 checks, including 4 new ones for the lists and accounts-per-ip.
  • Native MariaDB 11.4.13: the remote database test passes 3 of 3, including the new list table. With two local Velocity proxies sharing it, a deny add on one applied on the other after 35 seconds with no login in between, and a deny remove the same way.
  • Throwaway test servers (Paper 1.21.8, BungeeCord, Velocity 3.4.0, deleted afterwards): accounts-per-ip kicked the second player from one address, BungeeCord did not count the joining player against itself, and deny add disconnected 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.
  • The probe, the MariaDB test, and the test servers ran before the review fixes. The fixes did not change any SQL.
  • Each task had its own spec and code review, followed by a review of the whole branch. Every finding was fixed or recorded.

Known limits:

  • On Bukkit, accounts-per-ip counts only at PlayerLoginEvent on 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 add disconnects players on this server only. Servers sharing MySQL turn them away at their next login.
  • Allow beats deny, and a player entry beats an address entry. So staff with only the allow permission can still let in a denied player by allowing another target, for example their UUID when the deny is on their name.
  • The name saved with an entry was tested from the console only, not from a command run by a player in game.

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.
@rayhandestian
rayhandestian merged commit 97919c6 into main Nov 16, 2026
2 checks passed
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.

1 participant