ExVenture

Build Status

A MUD written in Elixir

Requirements

  • PostgreSQL 9.6
  • Elixir 1.6
  • Erlang 20
  • node.js 8.6

Setup

mix deps.get
mix compile
cd assets && npm install && node node_modules/brunch/bin/brunch build && cd ..
mix ecto.reset
mix run --no-halt

This will start a server on port 5555 that you can connect with using the local.tin tintin++ config. Ecto reset will include a sample area, classes, skills, and a login. You can also load http://localhost:4000/ in your browser for the admin panel and web client.

Running Tests

MIX_ENV=test mix ecto.create
MIX_ENV=test mix ecto.migrate

Admin Panel

There is an admin panel located at http://locahost:4000/admin that you can build out the game in. Create zones, rooms, npcs, items, etc. in the panel. They will become live instantly on creating or updating.

Admin Dashboard

Deployment

Distillery is used to generate releases. Once a release is generated you can copy the tar file to the server and start it up.

cd assets && node node_modules/brunch/bin/brunch build && cd ..
MIX_ENV=prod mix compile
MIX_ENV=prod mix phx.digest
MIX_ENV=prod mix release

The release.sh script will also do the same.

TLS

The game does not support TLS natively, but you can get nginx to serve as a termination point and forward locally to the app. Nginx needs to be built with two modules, stream_core and stream_ssl. You will also need to set the ssl_port option in networking. By default it will load from the SSL_PORT ENV variable.

stream {
  upstream exventure {
    server 127.0.0.1:5555;
  }

  server {
    listen 5443 ssl;

    # Copy in your main site's settings here
    ssl_certificate /path/to/file.pem
    ssl_certificate_key /path/to/file.key

    proxy_pass exventure;
  }
}

Metrics

Prometheus metrics are set up and will be reported on /metrics. You may want to have nginx deny requests to this endpoint or whitelist it for IPs, etc.

Documentation

You can get elixir docs by running mix docs and open doc/index.html. The code base has a lot of doctests to help give examples of how to use the functions.