No description
Find a file
Evan Goode 1c421743f8
Some checks failed
nix build / nix-build (push) Failing after 4s
Fix mutation bug in FallbackAPIServer batch lookups
Resolves https://github.com/unmojang/drasl/issues/301
2026-08-17 16:43:50 -04:00
.github/workflows Add major version tag to docker hub image 2025-03-29 17:41:33 -04:00
assets Config refactoring cleanup 2026-08-16 23:22:01 -04:00
doc doc: Remove stale refs to AllowAddingDeletingPlayers, ImportExistingPlayer.Allow 2026-08-17 09:14:30 -04:00
example Config refactoring cleanup 2026-08-16 23:22:01 -04:00
locales Restructure registration config 2026-08-16 23:22:01 -04:00
public Smoother background across page transitions 2026-08-17 01:29:50 -04:00
sql Invalidate access tokens when credentials change 2026-08-16 23:22:01 -04:00
ts Smoother background across page transitions 2026-08-17 01:29:50 -04:00
view Smoother background across page transitions 2026-08-17 01:29:50 -04:00
.gitignore Fix prek 2026-07-11 22:23:45 -04:00
.prettierignore Don't host swag docs 2024-08-15 12:33:59 -04:00
.prettierrc Linting, formatting 2023-09-18 21:46:53 -04:00
account.go Fix mutation bug in FallbackAPIServer batch lookups 2026-08-17 16:43:50 -04:00
account_test.go Fix mutation bug in FallbackAPIServer batch lookups 2026-08-17 16:43:50 -04:00
api.go Config refactoring cleanup 2026-08-16 23:22:01 -04:00
api_test.go Config refactoring cleanup 2026-08-16 23:22:01 -04:00
auth.go Invalidate access tokens when credentials change 2026-08-16 23:22:01 -04:00
auth_test.go Invalidate access tokens when credentials change 2026-08-16 23:22:01 -04:00
authlib_injector.go Configure FallbackAPIServer by ALI URL or discovery URL 2026-08-16 23:22:01 -04:00
authlib_injector_test.go Cleanup, FallbackAPIServer tests 2026-08-16 23:22:01 -04:00
build_config.go Drop legacy routes 2026-05-12 14:37:53 +00:00
common.go Fetch OIDC UserInfo 2026-08-16 23:22:01 -04:00
common_test.go Implement Classic protocol support 2026-03-18 00:11:58 -04:00
config.go OIDC: If PKCE option unset, use PKCE iff advertised by IDP 2026-08-16 23:22:01 -04:00
config_test.go Cleanup, FallbackAPIServer tests 2026-08-16 23:22:01 -04:00
CONTRIBUTING.md CONTRIBUTING.md: update for prek 2026-07-11 21:59:57 -04:00
db.go Invalidate access tokens when credentials change 2026-08-16 23:22:01 -04:00
db_test.go Invalidate access tokens when credentials change 2026-08-16 23:22:01 -04:00
discovery.go Configure FallbackAPIServer by ALI URL or discovery URL 2026-08-16 23:22:01 -04:00
discovery_test.go Cleanup, FallbackAPIServer tests 2026-08-16 23:22:01 -04:00
esbuild.config.js Smoother background across page transitions 2026-08-17 01:29:50 -04:00
fallback_api_server_test.go Cleanup, FallbackAPIServer tests 2026-08-16 23:22:01 -04:00
flake.lock flake: clean up, switch to git-hooks.nix 2026-07-11 21:30:51 -04:00
flake.nix Bump dependencies 2026-07-11 23:10:37 -04:00
front.go Add OIDC sign-in/link routes that redirect to AuthURLs 2026-08-16 23:22:01 -04:00
front_test.go Use SHA256 checksums for texture filenames 2026-08-16 23:22:01 -04:00
go.mod Bump dependencies 2026-07-11 23:10:37 -04:00
go.sum Bump dependencies 2026-07-11 23:10:37 -04:00
LICENSE Create LICENSE 2022-08-19 04:11:11 +00:00
main.go Add OIDC sign-in/link routes that redirect to AuthURLs 2026-08-16 23:22:01 -04:00
Makefile Fix prek 2026-07-11 22:23:45 -04:00
model.go Invalidate access tokens when credentials change 2026-08-16 23:22:01 -04:00
package-lock.json Smoother background across page transitions 2026-08-17 01:29:50 -04:00
package.json Smoother background across page transitions 2026-08-17 01:29:50 -04:00
player.go Configure FallbackAPIServer by ALI URL or discovery URL 2026-08-16 23:22:01 -04:00
README.md Add OIDC sign-in/link routes that redirect to AuthURLs 2026-08-16 23:22:01 -04:00
services.go Configure FallbackAPIServer by ALI URL or discovery URL 2026-08-16 23:22:01 -04:00
services_test.go Cleanup, FallbackAPIServer tests 2026-08-16 23:22:01 -04:00
session.go Configure FallbackAPIServer by ALI URL or discovery URL 2026-08-16 23:22:01 -04:00
session_test.go Implement blockedservers 2026-07-25 14:55:21 -04:00
test_suite_test.go Use SHA256 checksums for texture filenames 2026-08-16 23:22:01 -04:00
user.go Invalidate access tokens when credentials change 2026-08-16 23:22:01 -04:00
util.go Move LogInfo, LogError to utils 2026-08-16 23:22:01 -04:00

Drasl icon Drasl

Important

Release notes for Drasl 4.0.0

Drasl is an alternative API server for Minecraft that handles authentication, skins, and capes. You can use it to host Minecraft servers that are completely independent from Mojang's infrastructure. It's designed to be easy to host yourself, but a "reference instance" is hosted at https://drasl.unmojang.org which currently requires a Minecraft account to register.

It's compatible with both authlib-injector and the vanilla Yggdrasil protocol, which means it supports:

  • Minecraft launchers that support authlib-injector, such as Fjord Launcher or HMCL
    • Fjord Launcher supports authlib-injector accounts on nearly all versions of Minecraft, from Late Classic onward.
  • Vanilla Minecraft servers running version 1.16 or later, via JVM arguments
  • Minecraft servers from Late Classic, Alpha, Beta, full release, and onward using Loki
  • Minecraft servers running version 1.7.2 or later with authlib-injector

It includes a minimalist web front end for registering and managing accounts.

Background

You've always been able to host your own Minecraft server, but unless you run the server in offline mode, authentication and skins are usually still handled by Mojang's API servers. There are many reasons to host your own API server instead of using Mojang's. Your community might want to:

  • Experience the benefits of offline servers without losing skins, encrypted connections, or account security
  • Create additional accounts to allow users to have multiple players logged in to a server simultaneously
    • Have a "camera account" spectate your character for content creation
    • Program bots to automate tedious tasks like AFKing, crafting, or even building map art.
  • Have skins with transparency, or high-resolution skins (this would require a modded client as well)
  • Play Minecraft on a network where Mojang's servers are inaccessible
  • Keep your activity private from Mojang. Mojang knows which servers you are active on, when you log on, who else is on those servers, etc. If telemetry is enabled (since 1.18, it cannot be disabled without a mod), they are also notified whenever you load a singleplayer world.
  • Serve access tokens that last longer, so you don't run into "Invalid session" errors as often. These errors can be annoying with modpacks that take a long time to restart.
  • Opt out of chat reporting
  • Have a backup authentication system in case Mojang's servers go down

Features

Installation

Quick Setup (for Docker on Linux)

  1. git clone https://github.com/unmojang/drasl.git
  2. sudo cp -RTi ./drasl/example/docker /srv/drasl
  3. cd /srv/drasl
  4. Fill out config/config.toml according to one of the examples in doc/recipes.md
  5. docker compose up -d
  6. Set up an HTTPS reverse proxy (using e.g. Caddy or nginx) to localhost:25585.

See doc/installation.md for other setups, including instructions for setting up a reverse proxy.

Configuration

See doc/configuration.md for documentation of the configuration options and doc/recipes.md for common configuration patterns.

Usage

See doc/usage.md for post-installation instructions and guidance on setting up Minecraft clients and servers.

Troubleshooting

doc/troubleshooting.md has some helpful tips, but it's not complete. Feel free to ask for help in our Matrix channel.

API

Drasl has its own API for managing users, players, and invitations. Documentation is here.

Drasl implements the Mojang API, documented here on The Minecraft Wiki:

If you find that an API route behaves substantively different than the Mojang API, please file an issue.

Drasl also implements (almost all of) the authlib-injector API at /authlib-injector, to the extent that it differs from Mojang's. The authlib-injector API is documented here (Google Translated to English).

Building

If using Nix (with flakes), simply run nix build.

Otherwise, install build dependencies. Go 1.24 or later is required:

sudo apt install make golang gcc nodejs npm    # Debian
sudo dnf install make golang gcc nodejs npm    # Fedora
sudo pacman -S make go gcc nodejs npm          # Arch Linux

Then build the program with:

make

Run the tests with:

make test

Alternatives

FAQ

Why GPL and not AGPL? Isn't this a web application?

Drasl is intended to be self-hosted, customized, and hacked on. If it were licensed under the GNU Affero GPL, any user who tweaks their instance even slightly would be required to publish the changes, or else they would be violating the AGPL. While I'm a strong believer in copyleft, I don't want to place such a burden on the users in this particular case.

Is this legal? Does this break the Minecraft EULA?

See https://github.com/unmojang/drasl/issues/106. enforcement@mojang.com wrote:

The use of a Custom Authentication Server may or may not violate the Minecraft End User License Agreement (EULA), depending on several factors. As long as you ensure that players are using legitimate Microsoft accounts and a valid copy of Minecraft, the use of a Custom Authentication Server may not be problematic.

If you are using Drasl for something beyond personal use (e.g. setting up a large for-profit server), you may want to reach out to enforcement@mojang.com to make sure your use complies with the Minecraft EULA.

Translations

Translating Drasl from English to other languages happens on Hosted Weblate. All contributions are welcome, including translations to new languages and suggestions to improve existing translations.

translation status

License

GPLv3