Rumba is MDN's new back-end. It supersedes kuma and mainly powers MDN Plus.
Before you can start working with Rumba, you need to:
- Install git and Rust.
- Install additional dependencies:
- Mac OS
brew install libpq && brew link --force libpq
- Ubuntu:
apt install gcc libpq-dev libssl-dev pkg-config
- Mac OS
- Run a PostgreSQL instance:
- Mac OS: e.g. Postgres.app
- Docker:
docker run --name postgres -p 5432:5432 -e POSTGRES_USER=rumba -e POSTGRES_PASSWORD=rumba -e POSTGRES_DB=mdn -d postgres
).
- Run an Elastic instance:
- Docker:
docker run --name elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -d elasticsearch:8.3.3
- Docker:
- Copy
.settings.dev.toml
to.settings.toml
. - Run
cargo run
. - To create an authenticated session navigate to http://localhost:8000/users/fxa/login/authenticate/?next=%2F and login with your firefox staging account
- To check you are logged in and ready to go navigate to http://localhost:8000/api/v1/whoami you should see your logged in user information.
All changes to Rumba are required to be formatted with Rustfmt (cargo fmt --all
) and free of Clippy linting errors or warnings (cargo clippy --all --all-features -- -D warnings
).
To avoid committing unformatted or unlinted changes, we recommend setting up a pre-commit Git hook in your local repository checkout:
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
cat <<EOF >> .git/hooks/pre-commit
#!/usr/bin/env bash
echo "Running cargo fmt..."
cargo fmt --all -- --check
echo "Running cargo clippy..."
cargo clippy --all --all-features -- -D warnings
EOF
See tests