- Python 99.4%
- Dockerfile 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
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
|
||
| .forgejo/workflows | ||
| .vscode | ||
| jarvis_tasks | ||
| tests | ||
| .dockerignore | ||
| .flake8 | ||
| .gitattributes | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| Dockerfile | ||
| LICENSE | ||
| PRIVACY.md | ||
| pyproject.toml | ||
| README.md | ||
| requirements.precommit.txt | ||
| run.py | ||
| sample.env | ||
| TERMS.md | ||
| uv.lock | ||
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
.envas 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