This is the code for the IdleRPG Discord Bot.
You may submit an issue or open a pull request at any time.
The IdleRPG Project is licensed under the terms of the GNU Affero General Public License 3.0 ("AGPL"). It is a GPLv3 with extra clause for use over networks (see section 13).
-
Copy the example environment file:
cp .env.example .env
-
Generate
config.tomlwith the interactive helper. It walks through the required Discord and database credentials and writes a validated configuration file for you:python scripts/configure.py
You can re-run the helper at any time to update secrets or optional integrations.
-
Edit
.envto include your Discord bot token and any database credentials the compose stack should provision for you. Every field in the[database]block of the generatedconfig.tomlaccepts environment variables, so you can keep the file under version control and inject secrets at runtime if preferred. -
Launch the stack:
docker compose up --build
By default the compose file provisions PostgreSQL and Redis containers and shares credentials with IdleRPG through environment variables. To point IdleRPG at hosted services instead, replace or remove the local POSTGRES_*/REDIS_* entries in .env, set DATABASE_URL or provider-specific variables for a Neon or Supabase instance, and provide a REDIS_URL/UPSTASH_REDIS_URL for providers such as Upstash. Leaving those variables set to the defaults continues to use the local containers.
Once PostgreSQL is reachable you can bootstrap the schema with a single helper:
python scripts/init_db.pyUse --config and --schema to target different files if required.
IdleRPG's configuration loader automatically understands common connection strings:
- Neon / Supabase — Export
DATABASE_URL,POSTGRES_URL, or provider-specific variables (user, password, host, port) and the loader will split them into the fields IdleRPG expects. - Upstash Redis — Provide
REDIS_URLorUPSTASH_REDIS_URLand the bot will connect over TLS with the correct password and database index.
These environment variables can be placed directly in .env or in your deployment platform's secret manager without altering config.toml.
Outside Docker Compose you can still run the helper before starting the launcher:
python scripts/configure.py --config /path/to/config.tomlThe script validates connection strings, enforces the presence of required PostgreSQL and Redis credentials, and ensures IdleRPG can authenticate with Discord before you launch the bot.
The original Podman scripts remain available for contributors who prefer that toolchain. Development instances will wipe storage when stopped.
git clone https://git.travitia.xyz/Kenvyra/IdleRPG.git
cd IdleRPG
./scripts/beta.sh
podman build -t idlerpg:latest .
podman run --rm -it --name idlerpg --pod idlerpgbeta -v $(pwd)/config.py:/idlerpg/config.py:Z idlerpg:latestPermanent hosting scripts (./scripts/setup.sh) are still unsupported and may require manual adjustments.
IdleRPG uses black, flake8 and isort for code style. Please always run ./scripts/format.sh before submitting a pull request and fix any problems.
./scripts/dumpdb.sh db_name will update the database scheme from the postgres container.