Skip to content

wizguin/yukon-server

Repository files navigation

Yukon Server

Visit the Discord server for more support.

Yukon Discord members

Built With

Local Installation

These instructions will get you a copy of the project up and running on your local machine for development purposes.

Prerequisites

Installation

  1. Clone this repository.
git clone https://github.com/wizguin/yukon-server
  1. Install node dependencies.
npm install
  1. Copy "config_example.json" to a new file called "config.json".

  2. Generate a new crypto secret.

npm run secret-gen
  1. Import yukon.sql into your MySQL database.

  2. Update MySQL database credentials.

"database": {
    "host": "localhost",
    "user": "user",
    "password": "password",
    "database": "yukon",
    "dialect": "mysql",
    "debug": false
},

Usage

  • Running the dev server.
npm run dev
  • Building the server for production.
npm run build
  • Running the server in production mode. This will start all worlds listed in config.json.
npm run start
  • Stopping production servers.
npm run stop
  • Restarting production servers.
npm run restart
  • Listing production servers.
npm run list
  • Display live logs for production servers
npm run logs
  • PM2 monitor for production servers.
npm run monit
  • Generate a new crypto secret.
npm run secret-gen

Account creation

The easiest way to create accounts locally would be to simply enter them manually. Make sure to use a bcrypt hashed password, a tool such as this can be used to generate one.

$2a$10$nAxC5GXU0i/dacalTX.iZuRrtpmwmZ9ZzL.U3Zroh0jeSXiswFsne

Production Usage

The following is required when running the project in production.

  • The project must first be built using the build command.
npm run build
  • HTTPS can be configured as follows. Make sure your web server is also configured to use HTTPS.
"socketio": {
    "https": true,
    "ssl": {
        "cert": "/path/to/cert.crt",
        "ca": "/path/to/ca.ca-bundle",
        "key": "/path/to/key.key"
    }
},
  • The CORS origin must be set. This will likely just be your domain name, e.g "example.com".
"cors": {
    "origin": "example.com"
},
  • Run the server in production mode.
npm run start

Disclaimer

This project is a work in progress, please report any issues you find here.