Server code for OCW
  • Go 95.3%
  • Python 3.7%
  • Shell 0.8%
  • Dockerfile 0.2%
Find a file
jneen 9c632968c8
Some checks failed
Docker / build (push) Has been cancelled
fix links in the readme
2026-07-11 01:11:01 -04:00
.github/workflows Upgrade github actions 2024-04-10 23:20:05 -07:00
api api: update tags on course PUT 2025-05-30 21:44:55 -04:00
config use sql files for db configs 2024-10-30 11:34:27 -04:00
data use /data for all persistent dev data 2024-10-30 11:34:27 -04:00
db factor out bannedAndReadOnly and apply to SyncUser as well 2025-03-17 14:33:37 -04:00
examples add back kramer's dockerfiles 2024-10-05 18:58:35 -04:00
nex add logging to course tag update errors 2025-11-05 14:51:40 -05:00
orm ignore CommentCount in gorm 2024-11-02 17:14:48 -04:00
ryujinx set up the new local dev system 2024-10-05 00:22:22 -04:00
scripts enable tags by default 2025-05-30 21:48:16 -04:00
third_party Remove installer from server repo 2023-05-06 17:24:35 +02:00
util fix course import GetData logic 2024-04-29 19:54:39 +02:00
.dockerignore Environment variables, update Dockerfile, deploy scripts 2023-02-26 22:10:17 -08:00
.gitignore use /data for all persistent dev data 2024-10-30 11:34:27 -04:00
.gitmodules Add experimental installer for romfs patch support 2023-05-06 17:24:35 +02:00
docker-compose.yml inherit and default DISCORD_REPORT_TOKEN 2024-11-04 00:50:49 -05:00
Dockerfile add psql back to the prod image, see if we can get a working console 2024-11-02 17:20:06 -04:00
go.mod Revert "go get -u && go mod tidy" 2025-11-05 14:30:16 -05:00
go.sum Revert "go get -u && go mod tidy" 2025-11-05 14:30:16 -05:00
main.go prevent banned users from updating username in-game as well 2025-03-14 15:10:57 -04:00
README.md fix links in the readme 2026-07-11 01:11:01 -04:00

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.