Commit Graph

1628 Commits

Author SHA1 Message Date
Shane Freeder
0a090c8bb3 fix(config): keep server/forced-host defaults empty in code
Move the example servers, try order, and forced hosts out of the model's
field defaults and into default-velocity.yml only. Previously, removing a
section caused the loader to substitute the bundled examples, which reference
servers the user may not have and then fail validation. With empty code
defaults, a removed or emptied section now yields an empty collection and the
examples are seeded solely on first-start from the documented default file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 21:46:38 +01:00
Shane Freeder
cf4580f159 feat(config): load velocity.yml at startup and reload
Route VelocityServer's startup and reload paths through
ConfigurationLoader.loadConfiguration(), so the proxy now reads velocity.yml
(migrating an existing velocity.toml on first start) instead of reading
velocity.toml directly. LegacyConfigurationLoader is retained behind the
migration path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 21:31:32 +01:00
Shane Freeder
64e603c7e0 feat(config): add velocity.yml loading and velocity.toml migration
Implement the runtime entry point for the YAML config:

- ConfigurationLoader.loadConfiguration() resolves velocity.yml, migrating a
  legacy velocity.toml or writing the documented default on first start. Absent
  keys fall back to the model's field defaults (matching the old getOrElse
  behaviour), so existing files are never rewritten and their comments survive.
- Migration runs the legacy night-config migrations to normalise the TOML, then
  writes it as YAML stamped config-version=1, preserving a custom
  forwarding-secret-file location, and archives the old file as
  velocity.toml.migrated.
- Forwarding secret resolution mirrors the legacy path (env var, then the
  forwarding-secret-file, creating it if absent) and is injected via a new
  package-private setter; the secret stays out of velocity.yml.

Not yet wired into VelocityServer; that follows in the next change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 21:28:40 +01:00
Shane Freeder
d0e654d1ca feat(config): map VelocityConfiguration to YAML via Configurate ObjectMapper
Wire up the Configurate ObjectMapper path for the new velocity.yml format:

- Make VelocityConfiguration ObjectMapper-friendly: no-arg constructor,
  non-final nested fields, transient on non-config fields (forwardingSecret,
  motdAsComponent, favicon), and drop the dead gson @Expose annotations.
- Annotate Advanced/Query/Metrics @ConfigSerializable and add @Setting for the
  keys the lower-case-dashed naming scheme can't derive (kick-existing-players,
  packet-limiter, haproxy-protocol, accepts-transfers, query enabled/port/map).
- Add ConfigurationLoader with a LOWER_CASE_DASHED ObjectMapper factory, a YAML
  loader builder, load/save helpers, and custom TypeSerializers for the dynamic
  sections that don't fit object mapping: Servers (entries + try), ForcedHosts,
  and PacketLimiterConfig (renamed keys).
- Add ConfigurationLoaderTest: loads the bundled default, and round-trips a
  config with non-default values for every renamed/custom-mapped key so a wrong
  mapping can't silently fall back to an identical default.

Part of the velocity.toml -> velocity.yml Configurate migration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 21:15:33 +01:00
Shane Freeder
b157b30ac5 feat(config): add documented default-velocity.yml
1:1 YAML port of default-velocity.toml with all documentation comments
preserved verbatim. config-version becomes an integer (baseline 1) for
Configurate's versioned transformation system; the `try` list nests under
`servers` to mirror the legacy [servers] table.

Part of the velocity.toml -> velocity.yml Configurate migration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 20:58:48 +01:00
Shane Freeder
e250996d2d Seperate out night-config toml loading logic 2026-06-17 20:42:55 +01:00
Shane Freeder
a7581821fb Use a shared per-proxy session ID for 26.2 login metrics
The 26.2 login success session ID is purely a metrics identifier. Mint
one shared UUID per proxy, regenerated when the proxy empties, mirroring
the vanilla server, instead of a random UUID per connection.
2026-06-16 12:27:00 +01:00
Aaron
d7ad0522e9 Minecraft 26.2 (#1807)
* 26.2-snapshot-2

* 26.2-snapshot-3

* 26.2-snapshot-4

* 26.2-pre-1

* 26.2-pre-3

* 26.2-pre-4

* chore: set online mode and session id

* fix: checkstyle

* 26.2-pre-5

* 26.2-pre-6

* 26.2-rc-1

* 26.2-rc-2

* unregister old color argument in 26.2

* 26.2
2026-06-16 12:20:59 +01:00
Wouter Gritter
3b892899db Require non-null reason (#1823) 2026-06-15 15:47:31 +01:00
Wouter Gritter
1b64a70a00 Fix underflow and overflow error messages (#1812) 2026-06-02 16:22:33 +02:00
GoldenEdit
3b142f3099 Fix inverted PluginMessageEvent source/target in InitialConnectSessionHandler (#1811) 2026-05-28 11:02:48 +01:00
Wouter Gritter
25fbd833cd Add decompressed-bytes-per-second rate limit, update packet limiter defaults (#1786)
* Add decompressed-bytes-per-second packet limiter, update defaults
* Revert "Add compression ratio limiter"
2026-05-24 16:59:34 +01:00
Wouter Gritter
b72cf26802 Cap pre-join plugin-message queue size (prevents arbitrary growth/OOM) (#1800)
* Cap pre-join plugin-message queue size (prevents arbitrary growth/OOM)

* Clear counters once as the entire queue will have been processed
2026-05-24 16:55:07 +01:00
Wouter Gritter
7d68208e11 Always close HttpClient (#1798)
* Always close HttpClient (even on exception)

* Get rid of try/catch since we now use java 21
2026-05-22 10:25:48 -05:00
Wouter Gritter
38ff21afd7 Fix theoretical IOOBE race (#1799) 2026-05-22 15:50:48 +01:00
Aaron
9c0c9b0218 fix: outdated client message (#1763) 2026-05-09 08:27:52 +01:00
Wouter Gritter
ad8de4361c Fix wrong logs in exception(Throwable) (#1784) 2026-05-01 19:13:51 +01:00
Shane Freeder
f712997dd7 Seperate client/serverbound payload limits 2026-04-17 21:03:04 +01:00
Shane Freeder
a6d97e28ad Validate compression claim 2026-04-13 13:39:57 +01:00
booky
339a4c1887 Fix some small protocol inconsistencies (#1772) 2026-04-12 20:18:42 +01:00
Shane Freeder
e834af9cf1 Increase max ratio
Older versions of the game, and creative mode, send itemstacks to the server
when dealing with itemstacks, annoying, the compression algo used is good at
backreferencing, which means that compressed data can balloon pretty well.

64 should more than cover most cases of legit data, we could probably be more
harsh here, but this is likely a fine balance between avoiding bombs and not
erring out on legit data.
2026-04-09 19:04:02 +01:00
Shane Freeder
affc1d6e08 Extend debug logging to client play/config handlers 2026-04-09 19:03:33 +01:00
R00tB33rMan
6ce432e4ae Handle configuration/transition-phase disconnects as connection errors to prevent bricking older client versions (#1753) 2026-04-09 15:50:01 +01:00
Harold
b1a1b8bda3 use outbound only queueing when reentering configuration (#1747)
* use outbound only queueing and guard serverbound forwarding during reconfiguration
2026-04-08 23:27:02 +01:00
Shane Freeder
6f01587318 Appease checkstyle 2026-04-08 21:19:27 +01:00
Shane Freeder
308ce6d992 Merge branch 'cat/limits' into dev/3.0.0 2026-04-08 21:12:52 +01:00
Shane Freeder
9890c429c6 Add compression ratio limiter 2026-04-08 21:12:41 +01:00
Shane Freeder
0219993c8a Add basic packet limiter 2026-04-08 20:41:45 +01:00
Shane Freeder
f6d48c90f9 reduce clientbound compression limits 2026-04-08 20:41:09 +01:00
Aaron
d11511c184 Minecraft 26.1 (#1739)
* 26.1-snapshot-10

* 26.1-snapshot-11

* 26.1-pre-1

* 26.1-pre-2

* 26.1-pre-3

* 26.1-rc-1

* 26.1-rc-2

* 26.1
2026-03-21 23:14:28 -05:00
Wouter Gritter
99bd030996 Implement missing writabilityChanged() and add backlog logging with BACKPRESSURE_LOG to all writabilityChanged() implementations. (#1745) 2026-03-18 18:23:01 +00:00
booky
5017f8c9f2 Add more protocol safeguards (#1743)
* Add max length to more config phase packets

* Ensure all packets during non-play state are known

* Limit maximum size of play inbound packet queue

Co-authored-by: Dwarslooper <dwarslooper2910@gmx.de>

* Fix checkstyle

---------

Co-authored-by: Dwarslooper <dwarslooper2910@gmx.de>
2026-03-18 12:04:31 +00:00
Nassim Jahnke
e8b64aa6c0 Add two more pre-sizing checks 2026-03-15 09:04:34 +01:00
Nassim Jahnke
470cd7a9d2 checkstyle 2026-03-15 08:44:31 +01:00
Nassim Jahnke
0783b1d4e4 Add remaining pre-sizing checks 2026-03-15 08:39:32 +01:00
Riley Park
e0db25664f Revert "Add various missing jd, bump remaining deps (#1718)"
This reverts commit 7d0c002f89.
2026-03-03 07:22:59 -08:00
Wouter Gritter
c2fd3c07ac Introduce SchedulerBackend to fix VelocitySchedulerTest intermittent failure (#1728) 2026-02-11 16:21:03 -05:00
Rocco
2535751cd9 Add server-id hash to LoginEvent (#1027) 2026-02-10 19:59:34 +01:00
Nassim Jahnke
7e01491e2f Promote build channel to stable 2026-01-31 11:34:51 +01:00
R00tB33rMan
7d0c002f89 Add various missing jd, bump remaining deps (#1718) 2026-01-29 14:31:50 +01:00
Riley Park
5320aae5d9 fix #1695: add "velocity.legacyChatMaxServerboundLength" system property to allow overriding default legacy chat max length 2026-01-25 21:20:47 -08:00
Emil
fe8dc5eaa2 fix: TranslatableMapper not using fallback translation (#1716) 2026-01-25 15:56:55 -05:00
Adrian
eb2bea79ba Implement MiniMessage Velocity translations (#1108)
* Implement MiniMessage Velocity translations

* Implemented migration from old language format

* Updated year in default translations

* Fixed compilation

* Use MiniMessageTranslationStore

* Simplify MiniMessageTranslationsMigration#shouldMigrate

* Added support to named placeholders

* Updated translation arguments to MiniMessage translation placeholders
2026-01-25 14:06:03 -05:00
Adrian
75ecb64159 Update minimum Java version to 21 (#1649) 2026-01-25 19:22:54 +01:00
Nassim Jahnke
d69431a08e Update dependencies (#1717) 2026-01-25 19:13:08 +01:00
Nassim Jahnke
7e4f37b5f5 Bump version to 3.5.0-SNAPSHOT 2026-01-25 18:53:56 +01:00
mason
3022793418 Fix ByteBuf memory leak in MinecraftVarintFrameDecoder (#1715)
- Reset buffer reader index on exception to prevent memory leaks when packet decoding fails.
2026-01-21 18:56:22 +00:00
Shane Freeder
372a3b28bd Conformity 2026-01-08 17:13:08 +00:00
Shane Freeder
a03bd884aa Restrict empty packet frames from clients 2026-01-08 16:53:58 +00:00
SzymON/OFF
a046f70075 Fix exception message formatting in command invocation (#1687) 2025-11-09 19:59:06 +00:00