Skip to content

Installation

Austen McDonald edited this page Oct 3, 2017 · 3 revisions

WARNING: this Daenerys edition of Legend of the Green Dragon is not ready for a production release. If you're looking for code that will support real users, you'll have to download the legacy core (v1.1.2) from DragonPrime.net.

Prepping Your Host

The Daenerys edition requires PHP 7.1 or higher and Composer to manage PHP dependencies.

Note: these instructions, as written, only support UNIX-style hosts.

Note: much of this can be simplified if someone creates a DigitalOcean droplet: #105.

Getting a Github Token

To use Composer, PHP's defacto package manager, you need a Github token to avoid the download limits imposed by github.com:

  1. If you don't have a Github account, create one at https://github.com.
  2. Go to https://github.com/settings/tokens and login if needed.
  3. Click on Personal Access Tokens in the menu on the left.
  4. Click Generate New Token, name your token something you'll remember and click Generate token at the bottom. No need to check any boxes, in fact it's better you don't.
  5. Take the resulting hex string and run composer config -g github-oauth.github.com <authtoken>

Installing the Core and the GraphQL Crate

At this point, the best version of Daenerys to install is the core+crate+graphql version. This will provide you

composer init -n --name vendor/site-name --repository=https://code.lot.gd

What does this do?

  • composer is PHP's defacto package manager, and LotGD uses it to manage core/crate/module installations and dependencies.
  • init tells Composer to create a new project in the current directory. This will produce a composer.json file with the configuration parameters provided by the rest of the command line.
  • -n tells Composer to use default settings and not ask the user for any responses.
  • --name vendor/site-name specifies the name of the project you're creating. In Composer, all projects have a name that takes this /-delimited form. Think about vendor being your company or username, and site-name being some name for this project, like the name of the site you're creating. If you plan to store this project on github (recommended) then use your github username as the vendor.
  • --repository=https://code.lot.gd tells Composer to find LotGD related code at our web repository.

Now you're ready to install the core and the crate code, again using composer:

composer require lotgd/core v0.3.2-alpha
composer require lotgd/crate-graphql v0.3.1-alpha

Start up the test server

Configuration

For current development purposes, we've just been using a plan sqlite database in a file, instead of a real database service. You can change the database connection configuration in config/lotgd.yml under the database section.

Troubleshooting

Composer asks for a token. What do I do?

See the section on generating and setting a Github token.