The server for Open Course World
Go 95.3%
Python 3.7%
Shell 0.8%
Dockerfile 0.2%
Other 0.1%
541 2 0

Clone this repository

https://tangled.org/opencourse.world/ocw-server https://tangled.org/did:plc:kiu5zep7dicd3ekjsz3dlyqk/ocw-server
git@git.msvcrt.zip:opencourse.world/ocw-server git@git.msvcrt.zip:did:plc:kiu5zep7dicd3ekjsz3dlyqk/ocw-server

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

OCW Game Server#

Open Course World#

Open Course world is a Course World server that is compatible with Super Mario Maker 2. To play levels, you can connect through the Ryujinx emulator or a Switch modded with Atmosphère. Alternatively, you can use the website to set up a maker account, browse makers and courses, or import and manage your own courses with our import tool.

Game Server#

Code that makes up the Super Mario Maker 2 compatible server.

Set up a dev environment#

Documentation of the configuration options can be found in scripts/defaults.sh. Each of these can be overridden using the syntax VAR=value in a .env file, or overridden in your environment by other means, such as direnv.

The Database#

We use CockroachDB for our database, which should be run through Docker. Once you have set up docker, run:

./scripts/db-start.sh

to start the docker container for the database.

To restore a backup from production to your local database, you will need an AWS access key and secret. Put these in your .env:

export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...

and run ./scripts/db-restore-aws.sh from the project root.

Auth#

In order to log in via Twitch and/or Discord, you will need to obtain client secrets from the team. Add them to your .env:

export DISCORD_CLIENT_SECRET=...
export TWITCH_CLIENT_SECRET=...

The App#

Once the database is running, run the app with ./scripts/app.sh:

$ ./scripts/app.sh

Once you have your server running, you can point your frontend to the http url configured in your env - by default, http://localhost:6001.

Connecting Ryujinx#

In order to connect Ryujinx to your local server, you must build a version yourself with SSL verification patched out. This is available on our Ryujinx fork, which we try to keep reasonably up to date. Alternatively, the patch can be found in this repository at ryujinx/ryujinx_disable_ssl_verify_for_local_testing.patch.

Game Client Mod#

client-mod and releases

Setup#

Before we get running with docker, you will need to:

  • Install Docker.
  • Create a file in the project called .env - you can place config overrides here.
  • Open a terminal and cd or dir into the project root.

Running#

  • Build the containers with docker compose build.
  • Run docker compose up and all the services will start.
  • To restart, quit the server using Ctrl-C and run both the above commands again.
  • For faster restarts, it's recommended to run the db in a separate terminal with docker compose up db. You can then run the app with docker compose build app and docker compose run app. Run both commands to restart when you've made code changes.

Scripts#

  • To run scripts, use docker compose exec app bash, or docker compose exec app ./scripts/some-script.sh.
    • For example, to run a database console, use docker compose exec app ./scripts/db-console.sh
    • To print ocw-config.json for the dev user, use docker compose exec app ./scripts/ocw-api.sh ocw-config.json
    • You can do similar for other scripts documented above.
  • If the app isn't running, use docker compose run --rm in place of docker compose exec. This will create a temporary container for running scripts in.