11# Contributing to crates.io
22
3- * [ Attending the weekly team meetings] ( #attending-the-weekly-team-meetings )
4- * [ Finding an issue to work on] ( #finding-an-issue-to-work-on )
5- * [ Submitting a Pull Request] ( #submitting-a-pull-request )
6- * [ Reviewing Pull Requests] ( # )
7- * [ Checking Release State] ( # )
8- * [ Setting up a development environment] ( #setting-up-a-development-environment )
9- * [ Working on the Frontend] ( #working-on-the-frontend )
10- * [ Working on the Backend] ( #working-on-the-backend )
11- * [ Running crates.io with Docker] ( #running-cratesio-with-docker )
3+ - [ Attending the weekly team meetings] ( #attending-the-weekly-team-meetings )
4+ - [ Finding an issue to work on] ( #finding-an-issue-to-work-on )
5+ - [ Submitting a Pull Request] ( #submitting-a-pull-request )
6+ - [ Reviewing Pull Requests] ( #reviewing-pull-requests )
7+ - [ Checking Release State] ( #checking-release-state )
8+ - [ Setting up a development environment] ( #setting-up-a-development-environment )
9+ - [ Working on the Frontend] ( #working-on-the-frontend )
10+ - [ Working on the Backend] ( #working-on-the-backend )
11+ - [ Running crates.io with Docker] ( #running-cratesio-with-docker )
1212
1313## Attending the weekly team meetings
1414
@@ -79,7 +79,7 @@ There you will find the commits involved in the current release.
7979If you are only interested on the commit hash, you can also hit the site
8080metadata endpoint available on ` /api/v1/site_metadata ` .
8181
82- # Setting up a development environment
82+ ## Setting up a development environment
8383
8484First, you'll need git to clone the repo. [ GitHub has help pages about setting
8585up git] ( https://help.github.com/articles/set-up-git/ ) , and once you've done
@@ -268,6 +268,15 @@ postgres`). Generally, the problem is that by default the postgres server is
268268> we'll help fix the problem and will add the solution to these
269269> instructions!
270270
271+ Another option is to use a standalone Docker container for Postgres:
272+
273+ ```sh
274+ # example using postgres 16
275+ docker run -e POSTGRES_PASSWORD=password -p 5432:5432 postgres:16
276+ # database URL will be
277+ # DATABASE_URL=postgres://postgres:password@localhost:5432/cargo_registry
278+ ```
279+
271280#### OpenSSL
272281
273282- macOS: you can also install with homebrew by using ` brew install openssl `
@@ -361,6 +370,14 @@ Set up the git repo for the crate index by running:
361370./script/init-local-index.sh
362371```
363372
373+ #### Importing a database dump
374+
375+ You can then import the database with
376+
377+ ``` console
378+ ./script/import-database-dump.sh
379+ ```
380+
364381#### Starting the server and the frontend
365382
366383Build and start the server by running this command (you'll need to stop this
@@ -376,6 +393,13 @@ Then start the background worker (which will process uploaded READMEs):
376393cargo run --bin background-worker
377394```
378395
396+ Since crates.io is using the ` tracing ` crate, you can enable debug logging by
397+ setting the ` RUST_LOG ` environment variable to ` debug ` before running them, for
398+ example:
399+
400+ ``` console
401+ RUST_LOG=debug cargo run --bin background-worker
402+ ```
379403Then start a frontend that uses this backend by running this command in another
380404terminal session (the frontend picks up frontend changes using live reload
381405without a restart needed, and you can leave the frontend running while you
0 commit comments