story-game-engine Code
Brought to you by:
davidhandy
Story Game Engine ================= Overview -------- This is a web application for creating simple text-adventure style games in a web browser using a wiki-style user interface. Setting up for Development -------------------------- - Clone the repository and cd to its directory. hg clone ssh://hg@bitbucket.org/dhandy2013/story-game-engine cd story-game-engine - Create a Python virtual environment. python3 -m venv env - Upgrade packaging tools. env/bin/pip install --upgrade pip setuptools env/bin/pip install wheel - Install the project in editable mode with its testing requirements. env/bin/pip install -e ".[testing]" - Configure the database. env/bin/initialize_story_game_engine_db development.ini - Run the project's tests. env/bin/pytest - Run the project. env/bin/pserve development.ini - Open a web browser to: http://localhost:6543/story-game-engine/ Deployment to Production ------------------------ Install Ansible (using Python 3.x):: $ pip3 install --user ansible Make sure ``~/.local/bin`` is in your ``PATH`` so you can run ansible. Create ``/etc/ansible/hosts`` with these contents, replacing ``<your-server-hostname>`` with the real server host, and setting ``ansible_connection`` as needed:: [story-game-engine] <your-server-hostname> ansible_connection=local Create ``/etc/ansible/group_vars/story-game-engine`` with these variable settings:: --- # Settings used by production.ini template and deploy.yaml http_port: <http-port-number> auth_secret: <random-secret-string-of-hex-characters> session_secret: <another-random-secret-string-of-hex-characters> app_url_prefix: /story-game-engine Change permissions on this file so that only you and root can read it. Hint: To generate 64 random hex digits:: python -c "import random; r = random.SystemRandom(); print(''.join(r.choice('0123456789abcdef') for i in range(64)))" To deploy the latest code and restart the services:: $ ansible-playbook -K deploy.yaml The starting admin password will be printed (among many other messages) if a database doesn't already exist and therefore a new database is created.