Skip to content

Commit

Permalink
docs: updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowHatpro committed Aug 30, 2024
1 parent 8d5103e commit 2380644
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ MusicBrainz database sees a lot of edits made on a daily basis. With each edit,

## Installation

Prerequisites:
Primary prerequisites:
- Rust
- Postgres
- Docker
- [musicbrainz-docker](https://github.com/metabrainz/musicbrainz-docker) local setup for musicbrainz database
- yq

Follow the instructions in [INSTALL.md](docs/INSTALL.md)

Expand Down
4 changes: 2 additions & 2 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

> - Make sure musicbrainz db and the required database tables are present.
> - Follow https://github.com/metabrainz/musicbrainz-docker to install the required containers and db dumps.
> - Rename the `.env.example` to `.env`.
> - Rename the `.env.example` to `.env`, to set the `RUN_MODE` to `development`.
> - Ensure [yq](https://github.com/mikefarah/yq) is installed, for using configs in the sql scripts.
> - After ensuring musicbrainz_db is running on port 5432, Run the script `init_db.sh` in scripts dir.
> - In `config/development.toml` file, make sure to create a sentry rust project, enter your sentry project [DSN](https://docs.sentry.io/platforms/rust/#configure) (Data Source Name) in the `url` key's value.
> - Get the Internet Archive API accesskey and secret from [here](https://archive.org/account/s3.php) (requires sign in). Paste them in `config/development.toml` file `[wayback_machine_api]`'s variables `myaccesskey` and `mysecret`.

There are 2 methods to run the program:
1. Build the project and run.
- Make sure rust is installed.
Expand Down
27 changes: 26 additions & 1 deletion docs/MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

This doc provides instructions, guidelines and references to maintain the project without running into troubles.

## Local Development

### Database

- The app depends on `musicbrainz_db` as an external database source, which one can instantiate using [musicbrainz-docker](https://github.com/metabrainz/musicbrainz-docker).
- The database runs as a separate container, in a different network.
- Depending on how we want to run the app, we need to configure the database host.
- If running this archival app as a binary, one needs to expose the port 5432 of the `musicbrainz-db` to the host computer, and then one can use the database's host as `localhost`.
- If running as a docker container, the docker container name is resolved as the hostname, so the database host becomes the database container name (`musicbrainz-docker-db-1`)
- Make sure to check the database's docker container name by running:
```shell
docker ps | grep musicbrainz-docker_db
```

### Configs
- The configs related to the application are set inside `config/` directory.
- To be able to use the app without issues, one must populate the configs correctly.
- The database's host name should also be correctly be provided in `config/development.yaml`.
- Other configs such as sentry DSN URL, Wayback API key and secret, all should be updated in `config/development.yaml`.
- To control the polling, archival, and cleanup tasks' rates, one can override the default values in `config/development.yaml`.

## Schema Guidelines

- The project depends on `musicbrainz_db`, therefore, make sure all the `CREATE TABLE musicbrainz.*` instructions, present in `scripts/sql` scripts are in sync with MusicBrainz database schema.
- Since the project depends on `musicbrainz_db`, therefore, make sure all the `CREATE TABLE musicbrainz.*` instructions, present in `scripts/sql` scripts are in sync with MusicBrainz database schema.

## Resources

- [Wayback Machine Save Page Now 2 (SPN2) Public API docs](https://docs.google.com/document/d/1Nsv52MvSjbLb2PCpHlat0gkzw0EvtSgpKHu4mk0MnrA/edit#heading=h.1gmodju1d6p0)

0 comments on commit 2380644

Please sign in to comment.