An open API service indexing awesome lists of open source software.

https://github.com/ppy/osu-server-beatmap-submission


https://github.com/ppy/osu-server-beatmap-submission

Last synced: 10 months ago
JSON representation

Awesome Lists containing this project

README

          

# osu-server-beatmap-submission

Handles submitting new and updating existing beatmaps to the [osu! website.](https://osu.ppy.sh/)

## Running

### Development

This configuration permits full-stack integration testing with other local osu! services.
To run the project in this configuration, you must have a configured [`osu-web` instance](https://github.com/ppy/osu-web/blob/master/SETUP.md).
Additionally, to test beatmap downloads, you may want to set up a local beatmap mirror; see [`osu-beatmap-mirror-docker-runtime`](https://github.com/ThePooN/osu-beatmap-mirror-docker-runtime) for more information.

1. [Set up a client key](https://github.com/ppy/osu-web/blob/master/SETUP.md#use-the-api-from-osu) that will be used to identify users. It should be the same client key that the osu!(lazer) client uses to communicate with `osu-web`.
2. In [`launchSettings.json`](osu.Server.BeatmapSubmission/Properties/launchSettings.json), in the `fullstack` configuration, set the following environment variables:
- Set `JWT_VALID_AUDIENCE` to the client ID assigned to the key created in step (1).
- Set `LOCAL_BEATMAP_STORAGE_PATH` to a directory where submitted beatmaps should be placed.
3. Copy the `osu-web` OAuth public key to the `osu.Server.BeatmapSubmission` project root:
```
$ cp osu-web/storage/oauth-public.key osu-server-beatmap-submission/osu.Server.BeatmapSubmission/oauth-public.key
```
4. Start the project in the `fullstack` configuration.
5. The application will start at http://localhost:5089.
- When interacting with endpoints which require authorisation, every request must include an `Authorization: Bearer ` header. That token must be a token issued by `osu-web` for the client key set up in step (1).

## Environment variables

For advanced testing purposes.

This project supports three environment setups.
The choice of the environment is steered by the `ASPNETCORE_ENVIRONMENT` environment variable.
Depending on environment, the configuration & config requirements change slightly.

- `ASPNETCORE_ENVIRONMENT=Development`:
- Developer exception pages & API docs (`/api-docs`) are enabled.
- Sentry & Datadog integrations are optional.
- `ASPNETCORE_ENVIRONMENT=Staging`:
- Developer exception pages & API docs are disabled.
- Sentry integration is mandatory.
- Datadog integration is optional.
- `ASPNETCORE_ENVIRONMENT=Production`:
- Developer exception pages & API docs are disabled.
- Sentry & Datadog integrations are mandatory.

| Envvar name | Description | Mandatory? | Default value |
|:------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------:|:--------------|
| `DB_HOST` | Hostname under which the `osu-web` MySQL instance can be found. | ❌ No | `localhost` |
| `DB_PORT` | Port under which the `osu-web` MySQL instance can be found. | ❌ No | `3306` |
| `DB_USER` | Username to use when logging into the `osu-web` MySQL instance. | ❌ No | `root` |
| `DB_PASS` | Password to use when logging into the `osu-web` MySQL instance. | ❌ No | `""` |
| `DB_NAME` | Name of database to use on the indicated MySQL instance. | ❌ No | `osu` |
| `JWT_VALID_AUDIENCE` | The value of the `aud` claim to use when validating incoming JWTs. Should be set to the client ID assigned to osu! in the `osu-web` target deploy. | ✔️ Yes | None |
| `BEATMAP_STORAGE_TYPE` | Which type of beatmap storage to use. Valid values are `local` and `s3`. | ✔️ Yes | None |
| `LOCAL_BEATMAP_STORAGE_PATH` | The path of a directory where the submitted beatmaps should reside. | ⚠️ If `BEATMAP_STORAGE_TYPE=local` | None |
| `S3_ACCESS_KEY` | A valid Amazon S3 access key ID. | ⚠ If `BEATMAP_STORAGE_TYPE=s3` | None |
| `S3_SECRET_KEY` | The secret key corresponding to the `S3_ACCESS_KEY`. | ⚠ If `BEATMAP_STORAGE_TYPE=s3` | None |
| `S3_CENTRAL_BUCKET_NAME` | The name of the S3 bucket to use for storing beatmap packages and versioned files. | ⚠ If `BEATMAP_STORAGE_TYPE=s3` | None |
| `S3_CENTRAL_BUCKET_REGION` | The name of the region for the `S3_CENTRAL_BUCKET_NAME` bucket. | ⚠ If `BEATMAP_STORAGE_TYPE=s3` | None |
| `S3_BEATMAPS_BUCKET_NAME` | The name of the S3 bucket to use for storing .osu beatmap files. | ⚠ If `BEATMAP_STORAGE_TYPE=s3` | None |
| `S3_BEATMAPS_BUCKET_REGION` | The name of the region for the `S3_BEATMAPS_BUCKET_NAME` bucket. | ⚠ If `BEATMAP_STORAGE_TYPE=s3` | None |
| `SHARED_INTEROP_DOMAIN` | The root domain to which shared interop IO requests should be directed to. | ✔️ Yes | None |
| `SHARED_INTEROP_SECRET` | The interop secret used for shared interop IO requests. Value should match same environment variable in target `osu-web` instance. | ✔️ Yes | None |
| `PURGE_BEATMAP_MIRROR_CACHES` | Whether to request that beatmap mirror caches should be purged when a beatmap is updated. Set to `0` to disable. Turning this off is useful in configurations where the beatmap mirror cache is the same directory as `LOCAL_BEATMAP_STORAGE_PATH`. | ❌ No | `1` |
| `SENTRY_DSN` | A valid Sentry DSN to use for logging application events. | ⚠ In staging & production environment | None |
| `DD_AGENT_HOST` | A hostname pointing to a Datadog agent instance to which metrics should be reported. | ⚠ In production environment | None |
| `USER_ALLOW_LIST` | A comma-delimited list of IDs of users who are allowed access to the service. If completely omitted, all users are allowed access. | ❌ No | None |