Home
Softono
Sunrise

Sunrise

Open source MIT C#
47
Stars
7
Forks
0
Issues
3
Watchers
1 week
Last Commit

About Sunrise

Sunrise is a private server for the rhythm game osu! written in C. It provides both game-client and website endpoints, supporting login and registration, score submission, leaderboards, chat with a bot, multiplayer with !mp commands, osu!Direct, spectating, achievements (medals), rank snapshots, custom beatmap statuses, beatmap hype system, non-standard gamemodes like Relax and Autopilot, custom server backgrounds, and client version enforcement. Additional features include automated unit and integration tests, telemetry via Prometheus, Loki, and Tempo, rate limiting, Redis caching, Docker support, database migrations, and database backups. Sunrise is currently in development and not ready for public use. Hosting is recommended through the Solar System orchestrator, a Docker-based setup that bundles Sunrise with all required services along with a companion website and Discord bot. Standalone installation is also supported using self-signed certificates for local development. Documentation is available at docs

Platforms

Web Self-hosted Windows

Languages

C#

๐ŸŒ… Sunrise - osu! private server

Artwork made by torekka. We don't own the rights to this image.

License GitHub stars

Sunrise is a private server for osu! written in C#. This repository has both endpoints for game-client and for the website. The server is currently in development and is not yet ready for public use.

[!NOTE] Want to help? Have a question? :shipit: Feel free then to join our Discord server, there you can ask any question to maintainers of this project!

๐Ÿ–ผ๏ธ Preview

Features ๐ŸŒŸ

Core features

  • [x] Login and registration system
  • [x] Score submission and leaderboards
  • [x] Chat implementation
  • [x] Chat Bot (as a replacement for Bancho Bot)
  • [x] Multiplayer
  • [x] !mp commands (mostly)
  • [x] Server website (located at Sunset)
  • [x] Support for non-standard gamemodes (e.g. Relax, Autopilot, ScoreV2)
  • [x] Custom beatmap status system
  • [x] osu!Direct
  • [x] Spectating
  • [x] Beatmap hype system
  • [x] Achievements (Medals)
  • [x] Rank snapshots
  • [x] Ability to upload custom server backgrounds
  • [x] Version enforcement for the osu! clients

Additional features

  • [x] Automated tests (unit and integration)
  • [x] Telemetry system with Prometheus, Loki and Tempo
  • [x] Rate limiter for both internal and external requests
  • [x] Redis caching for faster response times
  • [x] Docker support
  • [x] Database migrations
  • [x] Database backups

[!IMPORTANT] The list of features is in priority order. The higher the feature is, the more important it is.

Installation Using Solar System Orchestrator (Recommended, Docker) ๐Ÿš€

If you are planning to host your own instance of Sunrise, please highly consider using the Solar System orchestrator.

Solar System

It includes Sunrise and other all required services for a fully functional Sunrise server. As a bonus, it also includes a website and a Discord bot!

This is the recommended way to set up your Sunrise server without the need to manually set up each service.

If you are looking for the official documentation, please refer to docs.sunrize.uk.

Standalone installation with self-signed certificate (Docker) ๐Ÿณ

  1. Clone the repository

  2. Open the project's folder in any CLI environment.

  3. Set up production environment

    • Create the file Sunrise.Server/appsettings.Production.json and fill it following the Sunrise.Server/appsettings.Production.json.example example.

      cp Sunrise.Server/appsettings.Production.json.example Sunrise.Server/appsettings.Production.json
    • Set the environment variables in the .env file.

      cp .env.example .env

[!WARNING] Make sure to update WEB_DOMAIN and API_TOKEN_SECRET values!

  1. Set up the beatmap manager by following the instructions in the Observatory repository. After setting up the beatmap manager, you need to set the General:ObservatoryUrl in the Sunrise.Server/appsettings.Production.json file to the address of the beatmap manager.
    • NB: Make sure that the PORT is defined properly (sunrise checks port 3333 by default) and POSTGRES_PORT value doesn't conflict with other PC ports.
  2. โš ๏ธ Please create sunrise.pfx file and move it to Sunrise/sunrise.pfx folder, for more instructions follow Local connection โš™๏ธ.
  3. Start server by running:
    docker compose -f docker-compose.yml up -d
  4. (Optional) If you want to connect to the server locally, please refer to the Local connection โš™๏ธ section.

[!TIP] Your final docker setup should look like this:

image (3)

Development installation โš’๏ธ

  1. Clone the repository
  2. Open the project's folder in any CLI environment.
  3. Set up development environment by running:
    docker compose -f docker-compose.dev.yml up -d
  4. Set up the beatmap manager by following the instructions in the Observatory repository. After setting up the beatmap manager, you need to set the General:ObservatoryUrl in the Sunrise.Server/appsettings.{Your Environment}.json file to the address of the beatmap manager.
    • NB: Make sure that the PORT is defined properly (sunrise checks port 3333 by default) and POSTGRES_PORT value doesn't conflict with other PC ports.
  5. โš ๏ธ Please create sunrise.pfx file and move it to Sunrise/sunrise.pfx folder, for more instructions follow Local connection โš™๏ธ.
  6. Run the project
  7. (Optional) If you want to connect to the server locally, please refer to the Local connection โš™๏ธ section.

Local connection โš™๏ธ

If you want to connect to the server locally, follow these steps:

  1. Add a launch argument -devserver sunrise.local to your osu! shortcut.

  2. Open the hosts file located in C:\Windows\System32\drivers\etc\hosts (C:\ is your system drive) with a text editor and add the following line:

    ... (rest of the file)
    
    # Sunrise Web Section
    127.0.0.1 sunrise.local
    127.0.0.1 api.sunrise.local
    # Sunrise osu! Section
    127.0.0.1 osu.sunrise.local
    127.0.0.1 a.sunrise.local
    127.0.0.1 c.sunrise.local
    127.0.0.1 assets.sunrise.local
    127.0.0.1 cho.sunrise.local
    127.0.0.1 c4.sunrise.local
    127.0.0.1 b.sunrise.local

[!WARNING] Don't forget to save the file after editing.

  1. Generate a self-signed certificate for the domain sunrise.local by running the following commands in the terminal:

    openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout sunrise.local.key -out sunrise.local.crt -subj "/CN=sunrise.local" -addext "subjectAltName=DNS:sunrise.local,DNS:*.sunrise.local,IP:10.0.0.1"
  2. Convert the certificate to the PKCS12 format (for ASP.Net) by running the following command in the terminal:

    openssl pkcs12 -export -out sunrise.pfx -inkey sunrise.local.key -in sunrise.local.crt -password pass:password
  3. Import the certificate to the Trusted Root Certification Authorities store by running the following command in the terminal:

    certutil -addstore -f "ROOT" sunrise.local.crt
  4. Move the generated sunrise.pfx file to the Sunrise directory.

  5. Run the server and navigate to https://api.sunrise.local/docs to check if the server is running.

Dependencies ๐Ÿ“ฆ

Contributing ๐Ÿ’–

If you want to contribute to the project, feel free to fork the repository and submit a pull request. We are open to any suggestions and improvements.