Admin Panel

Website & Discord Bot

Run the panel in a browser with Discord login, and use the panel from Discord slash commands.

View in store

Website

The website runs inside lg_admin - nothing else to install. Staff log in with Discord and get exactly the permissions they have in game, plus they need web.panel. Everything they do shows up in game right away, and the other way around. Actions that need you in the game (go to, bring, spectate, noclip ...) are greyed out.

Without a domain

  1. Set Config.Web.Enabled = true and restart lg_admin. The console prints the address, e.g. http://1.2.3.4:40125.
  2. Open the port (40125, TCP) in your firewall / hosting panel.
  3. Fill ServerConfig.DiscordClientId and ServerConfig.DiscordClientSecret (discord.com/developers > your application > OAuth2).
  4. Add the redirect under OAuth2 > Redirects: http://YOUR-SERVER-IP:40125/auth/callback.

Write it in Config.Web.Domain, e.g. admin.myserver.com. lg_admin downloads Caddy by itself (once, from Caddy's official GitHub, checksum checked), gets a free HTTPS certificate and serves the panel on ports 80 and 443. Add a DNS A record for the domain pointing to your server (Cloudflare: DNS only / grey cloud), open ports 80 and 443, and use https://admin.myserver.com/auth/callback as the Discord redirect.

Before the Discord login is set up you can still log in: type lgadmin_weblink <discord id> in the server console for a one-time link (5 minutes, staff with web.panel only).

Security

  • Sessions are random tokens stored hashed; cookies are HttpOnly and SameSite (and Secure with a domain).
  • Every request needs a valid session and a custom header (no cross-site requests), logins are rate limited, the Discord login checks its state value.
  • Settings > Website logins shows every browser logged in with your Discord (device, IP, last seen) with "log out" and "log out everywhere". Staff with web.sessions can end the logins of lower-ranked staff.

Discord bot commands

Set Config.Bot.Enabled = true and restart. The commands appear in your Discord within a minute (if not, invite the bot again with the applications.commands scope). Staff need discord.commands plus the permission of each action.

Pick the commands per role

In the role editor, the gear next to discord.commands opens Discord bot access. Automatic (default): every command and action the role has a permission for. Manual: pick the commands, and inside each one every action on its own - for example /vehicles can see vehicles but not delete them. An action works only when it is picked there and the role has its permission. This only limits the bot - the same role works as usual in the game and on the website.

CommandWhat it does
/playerProfile card: online state, playtime, warnings, bans, characters and quick actions
/inventory · /giveitemA picture of the inventory, give / remove items, clear
/vehicles · /givevehicle · /spawncarEvery vehicle: garage, plate, max performance, transfer, delete, add; spawn a car next to a player
/housesHouses of a character: owner, keys, door codes, storages (open and edit)
/character · /money · /setjob · /setgangCharacter details and edits
/revive · /heal · /armor · /feed · /kill · /freeze · /disarmPlayer actions
/kick · /warn · /ban · /unbanModeration (offline bans take every identifier and hardware token the player ever used)
/dm · /troll · /announceMessage on the player's screen, troll actions, announcements
/players · /staff · /reports · /versionWho is online, online staff, read / reply / claim / close reports, your version and what changed since then

Rename any command or set it to false in Config.Bot.Commands. Config.Bot.Private = true shows answers only to the staff member who used the command.

Last updated