Repository navigation
Security
Roi Horowitz edited this page Dec 2, 2026
·
2 revisions
Foundry serves every file inside a module folder over HTTP. If the bot runs from Data/modules/squire/bot, its .env (your Discord bot token and FOUNDRY_TOKEN) and data/store.json can be downloaded by anyone who can reach your Foundry.
The bot refuses to start inside a Foundry module folder. Copy it elsewhere (Installation). ALLOW_INSIDE_FOUNDRY=1 overrides the check; don't use it on a Foundry server anyone else can reach.
-
DISCORD_TOKENcontrols your bot. Never share or commit it. If it leaks, click Reset Token in the Discord developer portal. -
FOUNDRY_TOKENis the shared secret between the module and the bot. Use a long random string. In Foundry it's stored only in the GM's browser, not in the world, so players can't read it. -
.envanddata/are git-ignored. Keep them that way.
- Only users in
GM_DISCORD_IDScan set DCs, reveal, request, target, roll as PCs or creatures, apply results, or give Hero Points. - Players can roll only as their own linked character, and only in linked channels.
ALLOWED_CHANNEL_IDSnarrows that further. - The bot's HTTP API requires
FOUNDRY_TOKENfor everything except/api/health, and only accepts browser requests fromFOUNDRY_ORIGIN.
The bot needs only View Channel, Send Messages, Send Messages in Threads and Read Message History (permissions integer 274877975552). Avoid giving it Administrator.
Getting started
- Installation
- Bot Setup
- Hosting (Forge, cloud, VPS)
- Foundry Setup
Using it
Systems
Reference