10K+
Either set up environment variables or copy/symlink following files from osu!web project to this project's root directory:
oauth-public.key (if not using environment variable; located in storage in osu!web).envConfigurations:
WEBSOCKET_BASEDIR: set if you need to explicitly specify path to the files above.APP_ENV: defaults to development. The .env.${APP_ENV} file will be loaded first before .env..env files:
src/config.ts.Lastly, osu!web needs to be configured to use redis-based session.
yarnyarn buildyarn serveWatch and rebuild automatically with yarn watch. The server doesn't auto-restart though.
Run yarn lint --fix and additionally do manual fixes if needed.
To be added.
To build:
# repository should be username/repository when using docker hub for convenient push
docker build --tag <repository>:<tag> .
To run, the following items need to be passed to the container:
/app/.env/app/oauth-public.keyMake sure the files are globally readable as the container process runs as limited privilege user
Example:
docker run \
--rm \
--publish 2345:2345 \
-v /path/to/.env:/app/.env \
-v /path/to/oauth-public.key:/app/oauth-public.key \
-e NOTIFICATION_REDIS_HOST=redis \
ppy/osu-notification-server:latest
The process is single-threaded. Launch multiple containers to handle more connections.
Each process is known to be able to handle over 3000 connections. Make sure to increase file descriptor limit for the container process (--ulimit nofile=10000 option in docker) otherwise it won't be able to accept enough connections.
There's currently no error handling. Any errors will stop the process. Make sure to always restart on exit.
The server is supposed to be deployed behind a reverse proxy like nginx. Following is the proxying setting usually used for nginx:
proxy_pass http://notification-server;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_buffering off;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
tcp_nodelay on;
Especially make sure to not forward X-Forwarded-For from external source because it's used for identifying connecting IP address.
Content type
Image
Digest
sha256:7ed720788…
Size
88.6 MB
Last updated
over 1 year ago
docker pull pppy/osu-notification-server:fe3ee888c176185852c0fdc60479fe22e7eefb36