Enjoy your games and forget the hassle of managing tournaments


Skirmish logo

CircleCI dependencies Using Amber framework

Getting Started

These instructions will get a copy of this project running on your machine for development and testing purposes.


This project requires Crystal The version of Crystal used is defined inside .crystal-version. I'd recommend using crenv to install the current version of Crystal, which is as simple as the following command inside the project folder.

crenv install

There are also some other dependencies required for some extensions of Crystal and Amber, as well as PostgresQL.

For Ubuntu
sudo apt install -y postgresql libssl-dev libxml2-dev libyaml-dev libgmp-dev libreadline-dev libevent-dev libsqlite3-dev
brew tap amberframework/amber
brew install amber
brew install postgresql


Unless you've used Postgres before, or know your way around configuring it already, you'll probably want to follow this quick guide to setting up users for development.

Postgres Quickstart

User creation

For Ubuntu
# start a session as the postgres user
sudo su - postgres;

# create a user named postgres if it doesn't already exist
create user skirmish;

# then grant it super user access
alter user skirmish with superuser;

# optionally create a user to login to postgres yourself
create user <username> --pwprompt;

# exit the session as postgres
# start a session as the postgres user
psql postgres

# create a user named postgres if it doesn't already exist
create user skirmish;

# then grant it super user access
alter user skirmish with superuser;

# exit the session as postgres

Authentication configuration

To change the authentication with postgres to use a simple password 'trust' authentication method, we'll need to edit the pg_hba.conf file.

For Ubuntu
sudo vim /etc/postgresql/9.5/main/pg_hba.conf
vim /usr/local/var/postgres/pg_hba.conf

Replace md5 with trust on the lines for local connections

# IPv4 local connections:
host    all             all               trust
# IPv6 local connections:
host    all             all             ::1/128                 trust

Restarting the Postgres service

And finally, ensure the settings for postgres have been applied by restarting the service

For Ubuntu
sudo service postgresql restart
brew services restart postgresql


To start your Amber server (Both Linux and Mac):

# update the development environment settings to your liking
cp config/environments/development.yml.example config/environments/development.yml

shards install                    # install dependencies
shards build                      # build executable binaries
crystal ./src/ -- db:setup  # create the database and bring it up to speed
bin/amber db seed                 # optionally seed the database with some mock data
bin/amber watch                   # start the server and watch for file changes

Now you can visit http://localhost:3000/ from your browser.


To run the test suite:

crystal spec

Possible Installation Issues

Amber server.bind_ssl

Some setups are hitting undefined bind_ssl method errors within Amber itself. The good news is that we don't actually need it.

Error in src/ instantiating 'Amber::Server:Class#start()'


in lib/amber/src/amber/server/ instantiating 'Amber::Server#run()'

in lib/amber/src/amber/server/ instantiating 'start()'


in lib/amber/src/amber/server/ undefined method 'bind_ssl' for HTTP::Server

        server.bind_ssl, Amber.settings.port, ssl_config, settings.port_reuse

Rerun with --error-trace to show a complete error trace.


Open the breaking file /skirmish/lib/amber/src/amber/server/

And comment out lines 60-63 and 65

#  if ssl_enabled?
#    ssl_config =!, settings.ssl_cert_file.not_nil!).generate_tls
#    server.bind_ssl, Amber.settings.port, ssl_config, settings.port_reuse
#  else
    server.bind_tcp, Amber.settings.port, settings.port_reuse
#  end


  1. Fork it
  2. Create your feature branch ( git checkout -b my-new-feature )
  3. Commit your changes ( git commit -am 'Add some feature' )
  4. Push to the branch ( git push origin my-new-feature )
  5. Create a new Pull Request


Github statistic:
  • 0
  • 0
  • 0
  • 5
  • 16
  • 2 months ago