1. Architecture
Cloudflare Pages serves the public website, login, customer dashboard, owner panel and documentation. Cloudflare Workers expose the API and private owner operations. D1 stores workspace accounts, sessions, licenses, configuration and audit events.
Each customer hosts their own bot. ObsidianBot does not run Discord Gateway or Minecraft connections on Cloudflare. The customer bot makes outbound HTTPS requests to the Worker API, so no ngrok tunnel or inbound customer port is needed.
/api/* routes on Pages. A Pages Function forwards those requests over a private Cloudflare Service Binding to the API Worker. Customer bots call the Worker API directly with their unique instance API key.2. Customer bot setup
- Copy the
bot/folder to your own always-on machine or server. - Install Node.js 20 or newer.
- Open a terminal in the bot folder and run
npm ci. - Keep your existing local
.envcredentials on that machine. Do not upload the bot token or Minecraft credentials to the website. - Ask the platform owner to create your workspace. They will provide the instance ID and one-time API key.
- Add the central platform variables shown below to your own environment. The sample
.env.examplecontains these names; add the real values to your private local.envor service environment. - Set
OBSIDIAN_GUILD_IDto the Discord server that this bot instance is intended to manage, and set bothOBSIDIAN_LICENSE_OWNERandOBSIDIAN_MINECRAFT_USERNAMEto the customer's own identity. Managed instances refuse to start if these values are missing, preventing fallback to demo identities inconfig.js. Then runnpm start.
When the bot connects, its heartbeat reports the bot identity and that server's channel/role names. The dashboard dropdowns become available after the first heartbeat.
3. Central platform environment variables
Use the instance values supplied by the owner. Keep them secret and do not commit them.
The existing bot variables are still required for the bot's own Discord, Minecraft and license behavior. The new variables above only connect the bot to the ObsidianBot web dashboard.
4. Using the customer dashboard
- Open the website and sign in using your workspace/server name, username and password.
- Open Overview to check bot status, connected Discord server, last heartbeat and resource counts.
- Open Welcome, Moderation, Roles, Leveling, Logging, Minecraft bridge or General settings.
- Select channels and roles by their names in the dropdowns. The API validates selected IDs against resources reported by your own bot.
- Save changes. Your bot polls the Worker for the new config version and applies the changes locally.
If a dropdown is empty, check that the bot is online, that OBSIDIAN_GUILD_ID matches its target guild and that the bot has joined that server.
5. Owner access
The login server dropdown lists enabled workspace names and the reserved owner account. It exposes no usernames, workspace IDs or internal notes. The platform owner signs in with the server/workspace name owner, plus the owner username and password configured as Worker secrets. The owner panel can create and edit workspaces, see every bot's heartbeat, open any customer's dashboard, enable or disable accounts, reset passwords, rotate API keys, create/edit/extend/delete licenses and inspect audit events.
API keys are displayed once when created or rotated. Save the value immediately. Rotating a key revokes the previous key, so the customer must update their host environment before its bot can reconnect.
6. Security and operational notes
- Customer passwords are stored as PBKDF2-SHA256 hashes. Session cookies are HTTP-only, Secure and SameSite=Strict.
- Each workspace has a separate random bot API key. The Worker stores only an HMAC hash of the key.
- Discord bot tokens and Minecraft account credentials stay on the customer's machine; the dashboard never asks for them.
- The owner can manage every ObsidianBot workspace, but the platform does not grant access to the customer's operating system or VPS.
- Keep Worker secrets private. Do not put owner passwords, API keys or session secrets in static Pages files or Git.
- Cloudflare Free usage quotas apply to Pages, Workers and D1. If traffic exceeds free limits, requests may be rate-limited or fail until quotas reset.
- The bot must remain running on the customer's machine for Discord and Minecraft features to be online.