Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

trollogyadherent/vintageauth

Repository files navigation

VintageAuth

Vintage Story auth mod for offline servers. Early alpha phase, expect shit to break. From version 0.0.11, this mod probably does not work on game versions older than 1.18.0 stable.

Nothing has been tested on Windows.

Current features:

  • Blocking players in spectator mode at spawn until they log in or get kicked after a configurable amount of time
  • Possibility to disable/enable the creation of accounts in the config
  • Possibility to restrict account creation to single use tokens, generated by any allowed role
  • If installed on the client, the mod saves valid credentials and auto-logins next time a cached server is joined
  • After login, if no user specific role was set using changerole, the user is granted the default role and its default gamemode

The config is in VintagestoryData/ModConfig/vintageauth.json. By default, the server database is located in VintagestoryData/vintageauth_db.db.

Things of note:

  • A configurable administrator account is always generated if missing at server startup, available in the config. The password is randomly generated to prevent funny default password incidents.
  • Passwords are le salted and le hashed in a sqlite db. Note to players: for validation, the server sees them anyways, so you should assume your serverop knows your password. Modifying this mod to log your credentials, IP, whatever is TRIVIAL.

Commands (, [optional]):

  • vahelp [command] - help command. You can use vahelp command to get more details about a command
  • register <password> - registers new account
  • login <password> - logs in
  • delaccount <password> - deletes account
  • changepw <oldpw> <newpw> - changes password
  • logout - removes current server credentials from cache, will prevent next auto-login
  • gentoken - generates a single use registration token
  • deactivate <username> - suspends account
  • reactivate <username> - reinstates account
  • vaban <username> - removes user from database
  • changerole <username> <role> - VintageAuth will give this role to the specified username on next login

Building

  • Use buildmod.sh. Can't be bothered to add a script for Winbloat. Just import into vscode, hit run and it should spit out a dll.

Contact

Buy me a coffee

License

LGPLv3+SNEED

license