Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom calc docs and other cleanup to prepare to release #6

Merged
merged 5 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine3.19 AS base

LABEL org.opencontainers.image.source https://github.com/Syriiin/difficalcy

USER app

WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80
ENV ASPNETCORE_ENVIRONMENT=Production
ENV BEATMAP_DIRECTORY=/home/app/beatmaps
ENV BEATMAP_DIRECTORY=/beatmaps

VOLUME ${BEATMAP_DIRECTORY}
RUN mkdir ${BEATMAP_DIRECTORY}
RUN mkdir ${BEATMAP_DIRECTORY} && chown -R app:app ${BEATMAP_DIRECTORY}

USER app

FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
WORKDIR /src
Expand Down
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,18 @@ services:
ports:
- 5000:80
volumes:
- beatmaps:/home/app/beatmaps
- beatmaps:/beatmaps
depends_on:
- cache

cache:
image: redis:latest
volumes:
- redis-data:/data

volumes:
beatmaps:
redis-data:
```

## Development Setup
Expand Down
13 changes: 8 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
environment:
- REDIS_CONFIGURATION=cache:6379
volumes:
- beatmaps:/home/app/beatmaps
- beatmaps:/beatmaps
depends_on:
- cache

Expand All @@ -17,7 +17,7 @@ services:
environment:
- REDIS_CONFIGURATION=cache:6379
volumes:
- beatmaps:/home/app/beatmaps
- beatmaps:/beatmaps
depends_on:
- cache

Expand All @@ -28,7 +28,7 @@ services:
environment:
- REDIS_CONFIGURATION=cache:6379
volumes:
- beatmaps:/home/app/beatmaps
- beatmaps:/beatmaps
depends_on:
- cache

Expand All @@ -39,12 +39,14 @@ services:
environment:
- REDIS_CONFIGURATION=cache:6379
volumes:
- beatmaps:/home/app/beatmaps
- beatmaps:/beatmaps
depends_on:
- cache

cache:
image: redis:6
image: redis:7
volumes:
- redis-data:/data

docs:
build: ./docs
Expand All @@ -53,3 +55,4 @@ services:

volumes:
beatmaps:
redis-data:
5 changes: 5 additions & 0 deletions docs/docs/custom-calculators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Custom Calculators

It's possible to create your own calculators using the difficalcy framework, either for other rulesets or alternate difficulty calculation algorithms of one of the official rulesets.

Here is an example of a [PP+ difficalcy calculator](https://github.com/Syriiin/difficalcy-performanceplus).
16 changes: 10 additions & 6 deletions docs/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ services:
ports:
- 5000:80
volumes:
- beatmaps:/home/app/beatmaps
- beatmaps:/beatmaps
depends_on:
- cache

cache:
image: redis:latest
volumes:
- redis-data:/data

volumes:
beatmaps:
redis-data:
```

See [API Reference](./api-reference/index.md) for available endpoints.
Expand Down Expand Up @@ -65,14 +68,15 @@ services:

difficalcy is designed to be simple to get up and running, so there are no _required_ configurations.

By default, the beatmap cache will be lost when the container is restarted, and there will be no caching for calculations.
By default, the beatmap cache will be on an anonymous volume, and there will be no caching for calculations.

### Environment Variables

| Environment variable | Default | Description |
| --------------------- | -------------------- | ----------------------------------------------------------------------------------------------- |
| `BEATMAP_DIRECTORY` | `/home/app/beatmaps` | The directory difficalcy uses for storing beatmap files. |
| `REDIS_CONFIGURATION` | | The address of the redis server to use for beatmap caching. By default, there will be no cache. |
| Environment variable | Default | Description |
| --------------------- | ------- | ----------------------------------------------------------------------------------------------- |
| `REDIS_CONFIGURATION` | | The address of the redis server to use for beatmap caching. By default, there will be no cache. |

## Recommended setup

## How to run a calculation

Expand Down
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ nav:
- difficalcy-taiko: api-reference/difficalcy-taiko.md
- difficalcy-catch: api-reference/difficalcy-catch.md
- difficalcy-mania: api-reference/difficalcy-mania.md
- custom-calculators.md

theme:
name: material
Expand Down
Loading