Code Monkey home page Code Monkey logo

velocityguard's Introduction

VelocityGuard

VelocityGuard CI with Maven + Spigot

VelocityGuard is a port of the amazing plugin BungeeGuard and functions the same way. VelocityGuard is a pair of plugins that uses the GameProfile of a player to verify whether a player is connected from a trusted Velocity instance or not.

  • On Velocity, VelocityGuard inserts a special authentication token into GameProfile data which, when sent to a backend server will be verified when a player attempts to connect.
  • On the backend instance, VelocityGuard listens for players logging in and retrieves GameProfile data and verifies the token is not only present but is on the list of authorized tokens allowed to connect.

What all of this does is it allows absolutely no one to join (even through a proxy server) without knowing a correct, authorized token.

Common issues (read this before continuing)

  • Please don't confuse VelocityGuard with Velocity's built in modern forwarding, VelocityGuard is meant to solve a completely different problem

  • The best way to have VelocityGuard set up is to have your Velocity instance have it's forwarding mode set to legacy and have your backend server's bungeecord mode enabled.

  • If you're using PaperSpigot please do NOT use the paper.yml velocity-support configuration entry as it's not the same thing as VelocityGuard.

Download

Download the latest release of VelocityGuard through the releases tab in GitHub!

Installation

On your Velocity proxies

  1. Copy the velocityguard-proxy.jar file to the Velocity plugins folder and then proceed to restart the proxy.

  2. Inside the plugins folder there should be a new folder called velocityguard. Open the file called token.json inside the velocityguard folder and copy down the value of token (Your token should be 64 characters long).

On each of your servers

  1. Copy the velocityguard-backend.jar file into your plugins folder and restart the server.

  2. Inside the plugins folder (or the config directory for the Sponge users) there should be a new folder called velocityguard. Open the file config.yml inside the velocityguard folder.

  3. Add the token(s) generated by your proxy(-ies) to the allowed-tokens list.

    e.g.

    # Put the allowed authentication tokens in the list below
    
    allowed-tokens:
      - "gpZCEOe9u0p4KKV8Tgf1TxDrE5ZzcOCfs3JunDi82CvRuHQgeCoxKUladkYDTyBb"
  4. Restart the server.

Please don’t ask the Velocity Discord for help, this is not an official velocity-made plugin so they cannot offer the same level of support

velocityguard's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

velocityguard's Issues

java.lang.ClassNotFoundException: net.minecraft.server.v1_17_R1.EntityHuman

Airplane #55 (1.17.1) on Java 16
This warning is displayed in console upon booting the server:

[18:56:39 INFO]: [VelocityGuard] Enabling VelocityGuard v1.0*
[18:56:39 WARN]: java.lang.ClassNotFoundException: net.minecraft.server.v1_17_R1.EntityHuman
[18:56:39 WARN]: at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:148)
[18:56:39 WARN]: at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:105)
[18:56:39 WARN]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
[18:56:39 WARN]: at java.base/java.lang.Class.forName0(Native Method)
[18:56:39 WARN]: at java.base/java.lang.Class.forName(Class.java:375)
[18:56:39 WARN]: at us.kunet.velocityguard.backend.PreLoginListener.getEntityHumanClass(VelocityGuardBackendPlugin.java:121)
[18:56:39 WARN]: at us.kunet.velocityguard.backend.PreLoginListener.(VelocityGuardBackendPlugin.java:61)
[18:56:39 WARN]: at us.kunet.velocityguard.backend.VelocityGuardBackendPlugin.onEnable(VelocityGuardBackendPlugin.java:35)
[18:56:39 WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263)
[18:56:39 WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370)
[18:56:39 WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500)
[18:56:39 WARN]: at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:527)
[18:56:39 WARN]: at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:441)
[18:56:39 WARN]: at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:710)
[18:56:39 WARN]: at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:309)
[18:56:39 WARN]: at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1197)
[18:56:39 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317)
[18:56:39 WARN]: at java.base/java.lang.Thread.run(Thread.java:831)

Could not pass event PlayerLoginEvent to VelocityGuard v1.0

Airplane #55 (1.17.1) on Java 16
This error is displayed in console upon a player joining in-game:

[18:38:59 ERROR]: Could not pass event PlayerLoginEvent to VelocityGuard v1.0
java.lang.NullPointerException: Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because "us.kunet.velocityguard.backend.PreLoginListener.getProfile" is null
at us.kunet.velocityguard.backend.PreLoginListener.onPreLogin(VelocityGuardBackendPlugin.java:86) ~[?:?]
at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:37) ~[patched_1.17.1.jar:git-Airplane-57]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[patched_1.17.1.jar:git-Airplane-57]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.1.jar:git-Airplane-57]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.17.1.jar:git-Airplane-57]
at net.minecraft.server.players.PlayerList.attemptLogin(PlayerList.java:770) ~[patched_1.17.1.jar:git-Airplane-57]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.handleAcceptedLogin(ServerLoginPacketListenerImpl.java:176) ~[?:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.tick(ServerLoginPacketListenerImpl.java:87) ~[?:?]
at net.minecraft.network.Connection.tick(Connection.java:546) ~[?:?]
at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:196) ~[?:?]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1643) ~[patched_1.17.1.jar:git-Airplane-57]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:482) ~[patched_1.17.1.jar:git-Airplane-57]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1465) ~[patched_1.17.1.jar:git-Airplane-57]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1261) ~[patched_1.17.1.jar:git-Airplane-57]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[patched_1.17.1.jar:git-Airplane-57]
at java.lang.Thread.run(Thread.java:831) [?:?]

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.