No description
  • Python 99.4%
  • Dockerfile 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
zevaryx 14affb9db0
All checks were successful
CI / precommit (pull_request) Successful in 37s
CI / test (3.12) (pull_request) Successful in 1m41s
CI / test (3.13) (pull_request) Successful in 1m34s
CI / test (3.14) (pull_request) Successful in 1m37s
CI / test (3.15) (pull_request) Successful in 2m54s
CI / image (pull_request) Has been skipped
CI / precommit (push) Successful in 39s
CI / test (3.12) (push) Successful in 2m44s
CI / test (3.13) (push) Successful in 2m46s
CI / test (3.14) (push) Successful in 2m57s
CI / test (3.15) (push) Successful in 2m57s
CI / image (push) Successful in 9s
style: capitalise the first word of the reminder back-off docstring (D403)
2026-11-17 20:08:03 +00:00
.forgejo/workflows ci: drop the interactions-py override now that the lock uses 6.0.0rc1 2026-11-02 21:40:44 -07:00
.vscode Add prometheus 2022-06-10 09:54:54 -06:00
jarvis_tasks style: capitalise the first word of the reminder back-off docstring (D403) 2026-11-17 20:08:03 +00:00
tests fix(util): count only valid documents against a poll's limit 2026-11-17 06:57:21 +00:00
.dockerignore build(docker): numeric USER, PYTHONUNBUFFERED, no .git in image 2026-11-17 05:46:10 +00:00
.flake8 Migrate to beanie 2023-08-27 14:13:20 -06:00
.gitattributes chore: normalise line endings to LF 2026-11-03 10:23:48 -07:00
.gitignore Add gitignore 2022-02-19 16:55:36 -07:00
.pre-commit-config.yaml build(pre-commit): update hooks to their latest releases 2026-11-02 14:13:29 -07:00
Dockerfile build(docker): numeric USER, PYTHONUNBUFFERED, no .git in image 2026-11-17 05:46:10 +00:00
LICENSE Add LICENSE, PRIVACY, TERMS 2022-03-10 22:54:47 -07:00
PRIVACY.md docs: describe scheduled announcements, the Remind Me and Save Message menus, and moderation recorded from Discord in the privacy policy 2026-11-06 20:26:42 -07:00
pyproject.toml chore: bump version to 3.2.1 and pin jarvis-core 3.2.1 (0c864d7) 2026-11-17 19:16:45 +00:00
README.md docs: describe at-most-once reminders and the hardened container, and correct the stop timeout comment 2026-11-17 11:54:18 +00:00
requirements.precommit.txt build(pre-commit): update hooks to their latest releases 2026-11-02 14:13:29 -07:00
run.py style: format with black 26 and fix the flake8 findings 2026-11-02 20:41:41 -07:00
sample.env docs: describe at-most-once reminders and the hardened container, and correct the stop timeout comment 2026-11-17 11:54:18 +00:00
TERMS.md docs: describe the website, its cookies and sessions in the privacy policy and terms 2026-11-03 07:40:30 -07:00
uv.lock chore: bump version to 3.2.1 and pin jarvis-core 3.2.1 (0c864d7) 2026-11-17 19:16:45 +00:00

JARVIS tasks

JARVIS background processes and synchronizations. Runs alongside jarvis-bot against the same MongoDB, using a REST-only Discord client.

Versions

jarvis-bot, jarvis-tasks and jarvis-core are released together and share a version number: 3.x of each work with 3.x of the others. A change that needs matching releases of the other two bumps the major version of all three.

Current Modules

🔨 Ban

Lifts temporary bans when they expire, unless the user has been banned again since

🔒 Lock and Lockdown

Restores channel and @everyone permissions when a lock or server lockdown expires

⏰ Reminder

Delivers reminders by DM, falling back to the channel they were set in

Each reminder is delivered at most once. The next run of a repeating reminder (or "inactive", for a one-time reminder) is saved before the message is sent, so a failure after that point cannot send it twice. The cost is that a hard crash (killed process, out of memory) between the save and the send loses that one reminder. A normal shutdown does not lose it: the reminder is put back and sent after the restart.

🎭 Temporary Role

Removes temporary roles when they expire

⚠️ Warning

Expires warnings after their duration

👢 Autokick

Kicks members who still have the unverified role a configured number of days after joining

Configuration

Copy sample.env to .env and fill in TOKEN and the MONGO_* values. Use the same MongoDB as the bot. If it has a user and password, also set MONGO_AUTH_SOURCE (admin for the root account the bot's compose stack creates).

Run exactly one copy of tasks. Its loops read a record and then act on it, so two copies could repeat actions.

Run with Docker

Tasks is part of the compose stack in jarvis-bot, which also sets up MongoDB and its password; start it from there. The tasks service:

  • reads the same .env as the bot;
  • waits for MongoDB to be healthy;
  • runs as user ID 10001 with a read-only root filesystem, no extra capabilities and no new privileges;
  • gets 20 seconds to stop. On a stop signal, jobs that are already running get 8 seconds to finish.

Run the same version as bot (JARVIS_VERSION).

Development

Requires Python 3.11+ and uv.

uv sync
uv run python run.py
uv run pytest

Tests that need a database run against a real MongoDB and are skipped otherwise. Every collection in the test database is dropped before and after each test:

export JARVIS_TEST_MONGO_URI="mongodb://user:pass@localhost:27017/?authSource=admin"
export JARVIS_TEST_MONGO_DB="jarvis_test"
uv run pytest