57 Commits

Author SHA1 Message Date
хлифи
fbc8f9d45a
APIs for login and register (#136)
* APIs for login and register

* return 403 instead of 423 if account is locked

* add login API route to ratelimiter

* APILogin remove browser token gen & return, give API token instead

* generalize login logic

* remove transient user handling

* remove APIRegisterChallenge due to unnecessary

* remove honeypot from APIRegister

* APIRegister remove browser token gen & return, give API token instead

* add register API route to ratelimiter

* add missing API godoc

* Clean up app.Login error handling

* Fix rate-limit errors for API routes

* Deduplicate APICreateUser and APIRegister

* Rate-limit all non-admin unsafe API requests

* APILogin test

* Make SetIsLocked write to the tx

* Add CORSAllowOrigins option

* Assert SetIsLocked without err variable

* Fix and test API rate limiting

---------

Co-authored-by: Evan Goode <mail@evangoo.de>
2025-02-15 21:43:02 -05:00
хлифи
c16361c6bc
Add disabling frontend (#137)
* Add disabling frontend

* fixes requested in review

* Document EnableWebFrontEnd in configuration.md
2025-02-02 22:16:32 -05:00
Evan Goode
25c0404514 config: allow unlimited max player count (-1) 2025-01-19 22:55:37 -05:00
Evan Goode
32840a628e Set default data, state, config paths via env vars
Resolves https://github.com/unmojang/drasl/issues/119.

May be useful for some containerized deployments.
2024-12-28 23:23:13 -05:00
Evan Goode
5a58d24156 Automatic pre-migration DB backups 2024-12-28 21:07:32 -05:00
Evan Goode
738d80538f Make multiple profiles usable from web front end 2024-12-28 21:07:32 -05:00
Evan Goode
1b6fdf2341 Add AllowTextureFromURL option, default false
Adds the `AllowTextureFromURL` config option and makes it false by
default. Admins can still set skins and capes by URL, via the front end
or the API, regardless of this setting. Allowing users to specify
textures via URL is a possible security concern and doesn't really
improve the UX that much, so we should make it opt-in.

For https://github.com/unmojang/drasl/issues/116.
2024-11-26 14:56:59 -05:00
Evan Goode
9ff90d3df9 Bump to 2.0.0 2024-08-15 12:33:59 -04:00
Evan Goode
140ec8bd2e Don't host swag docs 2024-08-15 12:33:59 -04:00
Evan Goode
c70e266d57 Start implementing Drasl API 2024-08-15 12:33:59 -04:00
cat
3441839905 Add ApplicationName, use generic URLs in web UI 2024-08-15 12:33:59 -04:00
cat
2adf099190 Add EnableFooter 2024-07-08 23:52:22 -04:00
Evan Goode
d017879daa Add ValidPlayerNameRegex option
By default, Drasl should check to make sure player names don't contain
special characters.

For https://github.com/unmojang/drasl/issues/73
2024-05-23 16:57:38 -04:00
Evan Goode
e8537ea54c OfflineSkins, also fix several skin issues 2023-11-10 20:19:07 -05:00
Evan Goode
240bfd353f DenyUnknownUsers 2023-11-10 00:02:51 -05:00
Evan Goode
32242f1002 Make fallback API cache configurable
Closes https://github.com/unmojang/drasl/issues/19
2023-09-16 14:00:30 -04:00
Evan Goode
5908508fdd Fix 404s for web ui 2023-09-06 23:07:30 -04:00
Evan Goode
3dbc20a6a9 Add example-config.toml 2023-09-04 16:53:51 -04:00
Evan Goode
15559209ca Create config, state directories if they don't exist
We might want to gate this behind a flag in build_config.go, the Docker
build will want this but maybe not other distributions.
2023-09-03 17:51:20 -04:00
Evan Goode
50a0b95121 Dockerfile, template config file 2023-09-02 19:12:28 -04:00
Evan Goode
d750dacdbb Config validation/cleaning, cleanup 2023-08-29 00:26:21 -04:00
Evan Goode
c5af033ca4 Fix AnonymousLogin, rename to TransientUsers 2023-08-20 02:15:04 +00:00
Evan Goode
3456e33085 Switch from 32-character hex accessTokens to JWTs 2023-08-20 02:15:04 +00:00
Evan Goode
6f621d872e style tweaks, EnableBackgroundEffect 2023-08-04 22:37:04 -04:00
Evan Goode
6405e36db7 Tests for authserver 2023-07-22 18:51:20 -04:00
Evan Goode
fad4a8498c Print initial invite link if necessary 2023-07-09 01:01:26 -04:00
Evan Goode
7665b2129d Add configurable body size limit
Closes #13
2023-07-08 23:30:30 -04:00
Evan Goode
acbd22a011 DefaultAdmins, interface fixes 2023-07-07 20:39:19 -04:00
Evan Goode
9427ab922c Add 'alpha' message to README 2023-07-07 17:24:35 -04:00
Evan Goode
1d49f367f6 Add options to disable skins, capes 2023-07-07 16:52:09 -04:00
Evan Goode
22d5f3525d initial work on invites, admin page 2023-07-06 02:38:03 +00:00
Evan Goode
ee701eac6e Cache certain responses from fallback API servers 2023-06-26 23:58:14 -04:00
Evan Goode
a8bb8832dd s/SkinForwarding/ForwardSkins/, allow setting fallback player 2023-06-25 15:32:24 -04:00
Evan Goode
bbffae71f7 configuration.md 2023-06-25 15:32:24 -04:00
Evan Goode
93127eb9d5 fix tests 2023-06-17 23:57:53 -04:00
Evan Goode
7de5d70a9a rate limiting: enable by default 2023-06-17 23:39:25 -04:00
Evan Goode
cd70c83be0 /publickeys for 1.20 2023-06-16 18:02:26 -04:00
Evan Goode
9eceefbde9 optionally disable token expiry 2023-06-14 00:13:24 -04:00
Evan Goode
ada118546f initial support for authlib-injector 2023-06-03 23:16:42 -04:00
Evan Goode
4fdb587119 Go all in on the unified server design 2023-06-03 19:39:35 -04:00
Evan Goode
360ff8edd7 SkinSizeLimit, not AllowHighResolutionSkins
Resolves https://github.com/unmojang/drasl/issues/5
2023-06-02 22:04:51 -04:00
Evan Goode
e4c4f6fb57 make unifiedserver the default 2023-05-31 21:02:36 -04:00
Evan Goode
e99bbb51d6 rate limiting 2023-05-31 01:11:19 -04:00
Evan Goode
956e34dd2e Nix flake 2023-05-21 01:02:18 -04:00
Evan Goode
955e42b1f3 Allow listening as one single server rather than five 2023-05-17 23:19:27 -04:00
Evan Goode
c9769328c6 Lots of front-end tests 2023-05-17 20:27:57 -04:00
Evan Goode
72176410e1 Name change 2023-05-16 01:39:41 -04:00
Evan Goode
1ac386f206 Skin forwarding from fallback API servers 2023-05-13 15:07:56 -04:00
Evan Goode
5690b7b40c account routes: test fallback API servers 2023-05-07 01:04:24 -04:00
Evan Goode
2dec15cff1 Account server, more tests 2023-05-06 00:36:17 -04:00