Welcome to Eve W-Space 0.2!¶
NOTE: Eve W-Space is currently in alpha. Most features outside of Mapping are not yet implemented past some prototype data models.
What is it?¶
Eve W-Space is, at its core, a wormhole mapping and intel tool for the MMORPG Eve Online. If you wish, it can be much more. It can be customized to fill roles from simple mapping applicaiton (with all extra features disabled) to the centerpiece of an entire alliance services infrastructure.
Eve W-Space is designed to be a single-tenant soulution hosted by a single corp or alliance. A fleixble permissions system allows for easily restricting data where needed.
Contents:¶
Tutorials¶
These pages contain the various tutorials that have been written for Eve W-Space.
Install: Ubuntu 12.04 LTS with MySQL and Nginx¶
This guide will walk you through installing Eve W-Space on Ubuntu 12.04 LTS using a local MySQL server and serving requests with Nginx and Gunicorn. It assumes a clean install and root shell access.
Requirements¶
764MB RAM with 1GB preferred for high-traffic instances. This may be flexible depending on your specific load.
The following packages in addition to the normal core install:
- git-core
- build-essential
- python-dev
- python-pip
- nginx
- bzip2
- memcached
- libmysqlclient-dev
- mysql-server
- libxml2-dev
- libxslt-dev
- rabbitmq-server
- supervisor
You can install all required packages with the following. You will be prompted for a mysql root password. You may leave this blank if you wish, but it is recommended that you set a secure password and remember it for later.:
$ sudo apt-get install git-core build-essential python-dev python-pip \
nginx bzip2 memcached libmysqlclient-dev mysql-server libxml2-dev \
libxslt-dev rabbitmq-server supervisor
Note: if you want to use PostgreSQL, replace libmysqlclient-dev and mysql-server with libpq-dev and postgresql.
You will also be needing to edit text, so make sure to install your favorite text editor if nano or vi (not vim) aren’t your cup of tea:
- Next, you will need to upgrade distribute and install virtualenv:::
- $ sudo easy_install -U distribute $ sudo pip install virtualenv
Finally, you must create the MySQL database for Eve-Wspace to use::
$ mysql -u root -p
Password:
Enter the root password you set when installing MySQL before:
Then, create the database and grant access to it to a new mysql user called maptool with a password you should remember for later. If you want to simply use the root MySQL user, simply ignore the GRANT PRIVILEGES command.:
mysql> CREATE DATABASE evewspace CHARACTER SET utf8;
mysql> GRANT ALL PRIVILEGES ON evewspace.* TO 'maptool'@'localhost' IDENTIFIED BY '<insert a password>';
mysql> quit
Create a User¶
You should not run Eve W-Space as root for security. You should create a dedicated account called maptool with a home directory of /home/maptool. You can name this user whatever you want, just replace all instances of /home/maptool with your user’s home directory.:
$ sudo useradd -m -s /bin/bash maptool
$ sudo passwd maptool
Set Up the Home Directory¶
Let’s become our user for this part to ensure permissions are proper and switch to the install location::
$ sudo su maptool
$ cd /home/maptool
Now, let’s create a directory to be used for serving static files later:
$ mkdir /home/maptool/static
Next, you need to get the Eve W-Space files. You can either clone the latest revision from git or you can download a packaged release and unpack it.
To clone from Github::
$ git clone https://github.com/marbindrakon/eve-wspace.git
To use a packaged release:
You need to download eve-wspace from http://marbindrakon.github.com/eve-wspace/ to get latest zip or tarball package (0.2.2 at time of writing)::
$ wget https://github.com/marbindrakon/eve-wspace/archive/v0.2.2.tar.gz
Then you can unpack the file and rename the directory to eve-wspace to match the clone method::
$ tar xvzf v0.1.1.tar.gz && mv eve-wspace-0.1.1 eve-wspace
Install Eve-Wspace Environment¶
Next, you should create and activate a virtual Python environment for Eve W-Space so that it cannot conflict with any system Python packages::
$ virtualenv --no-site-packages /home/maptool/eve-wspace
$ source /home/maptool/eve-wspace/bin/activate
You will notice that your shell changes to include (eve-wspace) when the virtual environment is active.
Now you can install the required Python packages::
(eve-wspace)$ pip install -r /home/maptool/eve-wspace/requirements-mysql.txt
Use requirements-postgresql.txt if you are using PostgreSQL.
Configuring local_settings.py¶
Now for the fun part, copy the local_settings.py.example file to local_settings.py in the same directory, open it up, and edit it to suit your enviornment::
(eve-wspace)$ cd /home/maptool/eve-wspace/evewspace/evewspace
(eve-wspace)$ cp local_settings.py.example local_settings.py
(eve-wspace)$ nano local_settings.py
While editing, you should pay particular attention to the top part of th efile, ensuring that the database statement matches the database, user, and password you created in MySQL earlier and that you add a SECRET_KEY and set the STATIC_ROOT value::
#Example:
# Set this to False for production or you'll leak memory
DEBUG = False
#DEBUG = True
# Set this to a secret value, google "django secret key" will give you
# plenty of generators to choose from
SECRET_KEY = 'sadf98709283j7r098j09a8fd7sdfj89j7f9a8sdf09a8fd'
# Set this to the directory you are service static files out of so that
# manage.py collectstatic can put them in the right place
STATIC_ROOT = "/home/maptool/static/"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'evewspace', # Or path to database file if using sqlite3.
'USER': 'maptool', # Not used with sqlite3.
'PASSWORD': 'really_secure_password', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
Look at the rest of the local_settings.py file and see if there is anything you want to change. The default values for memcached and amqp work for the Ubuntu memcached and rabbitmq defaults.
Initializing the Database¶
Initializing the database falls into two parts: Loading the Eve static data and initializing the Eve W-Space instance.
Static Data¶
CCP releases a Static Data Export for each major patch in MS SQL format. Steve Ronuken makes MySQL conversions available shortly thereafter. These conversions can be downloaded from http://www.fuzzwork.co.uk/dump/ if you are going to be installing multiple instances, you should download the dump once and re-use it if at all possible.:
(eve-wspace)$ cd /home/maptool
(eve-wspace)$ curl -O https://www.fuzzwork.co.uk/dump/mysql55-odyssey-1.0.12-89967.tgz
(eve-wspace)$ gunzip mysql55-odyssey-1.0.12-89967.tgz
(eve-wspace)$ tar xvf mysql55-odyssey-1.0.12-89967.tgz
(eve-wspace)$ mysql -u maptool -p evewspace < odyssey-1.0.12-89967/mysql55-odyssey-1.0.12-89967.sql
The sql import will take a few minutes to run. When it completes, your MySQL database will have all of the Static Data Export tables available.
Initializing Eve W-Space¶
Next you will need to run several commands to set up the Eve W-Space tables and preload them with data. If you encounter errors here, they are most likely caused by bad settings in local_settings.py, not having the virtual environment activated, or permissions.:
(eve-wspace)$ cd /home/maptool/eve-wspace/evewspace
(eve-wspace)$ ./manage.py syncdb --all --noinput
(eve-wspace)$ ./manage.py migrate --fake
(eve-wspace)$ ./manage.py buildsystemdata
Note:This will take a while (~5-10min)
(eve-wspace)$ ./manage.py loaddata */fixtures/*.json
(eve-wspace)$ ./manage.py defaultsettings
(eve-wspace)$ ./manage.py resetadmin
(eve-wspace)$ ./manage.py syncrss
(eve-wspace)$ ./manage.py collectstatic --noinput
Using the Development Server¶
If you’ve made it this far, congratulations! Eve W-Space is set up. From here, you can run the console development server directly or continue with setting up the rest of a production environment (Nginx, Gunicorn, Supervisor).
To start the development server::
(eve-wspace)$ cd /home/maptool/eve-wspace/evewspace
(eve-wspace$ ./manage.py runserver 0.0.0.0:8000
Now you can navigate to your server on port 8000 and see your instance. However, you need to have celery running as well for many tasks to work properly. In another shell::
(eve-wspace)$ cd /home/maptool/eve-wspace/evewspace
(eve-wspace)$ ./manage.py celery worker -B --loglevel=info
When both are running at the same time, you should be able to use all functions. If you want things to run a bit more permanently, continue reading.
Setting Up a Production Stack¶
To serve Eve W-Space in production, you should use a dedicated http daemon to serve static files and either serve the Eve W-Space application itself either through the http daemon itself (as with Apache’s mod_wsgi setup) or through a seperate tool which the http daemon will proxy requests to. This guide follows the latter route.
Installing Gunicorn¶
This guide uses Gunicorn, a lightweight wsgi server written in Python to serve the Django app itself.
To install::
(eve-wspace)$ pip install gunicorn
Configuring Supervisor¶
Unless you want to run celery and gunicorn through the console in screen or tmux, you will want to daemonize them in some way. This guide uses supervisor, but there are many other options available.
At this point, you can log out of the maptool user and go back to your normal account::
(eve-wspace)$ deactivate
$ exit
You need to tell supervisor about the tools you want it to run, to do that, you need to create a config file in /etc/supervisor/conf.d for gunicorn and celeryd::
$ sudo nano /etc/supervisor/conf.d/celeryd.conf
[program:celeryd]
command=python manage.py celery worker -B --loglevel=info
directory=/home/maptool/eve-wspace/evewspace
environment=PATH="/home/maptool/eve-wspace/bin"
user=maptool
autostart=true
autorestart=true
redirect_stderr=True
$ sudo nano /etc/supervisor/conf.d/gunicorn.conf
[program:gunicorn]
command=/home/maptool/eve-wspace/bin/gunicorn_django --workers=4 -b 127.0.0.1:8000 settings.py
directory=/home/maptool/eve-wspace/evewspace/evewspace
environment=PATH="/home/maptool/eve-wspace/bin"
user=maptool
autostart=true
autorestart=true
redirect_stderr=True
To finish it off, you need to stop and then start supervisor to reload the config and start the services::
$ sudo service supervisor stop
$ sudo service supervisor start
And confirm that both started successfully::
$ sudo supervisorctl status
celeryd RUNNING pid 4335, uptime 33 days, 19:16:02
gunicorn RUNNING pid 4302, uptime 33 days, 19:16:03
If either are not in the RUNNING state, either examine the log files in /var/log/supervisor/celeryd-stdout-xxxxxxxxxx.log and /var/log/supervisor/gunicorn-stdout-xxxxxxxx.log or try running them interactively as discussed previously.
Configuring Nginx¶
Now that Eve W-Space itself is running, you need to get people to it. That’s where Nginx comes into play. Configuring Nginx is as simple as filling in one config file, creatng a symlink, and reloading the daemon.:
$ sudo nano /etc/nginx/sites-available/evewspace
#Example - replace x.x.x.x with your IP or host name if doing name-based vhosts
server {
listen 80;
server_name x.x.x.x;
underscores_in_headers on;
location /static {
alias /home/maptool/static;
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 10;
proxy_read_timeout 30;
proxy_pass http://127.0.0.1:8000;
}
}
$ sudo rm /etc/nginx/sites-enabled/default
$ sudo ln -s /etc/nginx/sites-available/evewspace /etc/nginx/sites-enabled/evewspace
$ sudo service nginx reload
Note: if you have multiple virtual domains on your nginx server, put “underscores_in_headers on;” in nginx.conf instead.
Congratulations! Your Eve W-Space instance should now be available at whatever your ip or host name was from the Nginx config. Please see the Getting Started page for your next steps. Keep in mind that your instance will have a default administrator registration code until you change it, so do that ASAP.
Install: Ubuntu 12.04 LTS with MySQL and Apache¶
This guide will walk you through installing Eve W-Space on Ubuntu 12.04 LTS using a local MySQL server and serving requests with Apache and gunicorn through mod_proxy. It assumes a clean install and root shell access.
Note: Ubuntu 13.10 untilizes Apache 2.4, it is recommended that you use Nginx instead.
Requirements¶
764MB RAM with 1GB preferred for high-traffic instances. This may be flexible depending on your specific load.
The following packages in addition to the normal core install:
- git-core
- build-essential
- python-dev
- python-pip
- apache2
- libapache2-mod-wsgi
- bzip2
- memcached
- libmysqlclient-dev
- mysql-server
- libxml2-dev
- libxslt-dev
- rabbitmq-server
- supervisor
You can install all required packages with the following. You will be prompted for a mysql root password. You may leave this blank if you wish, but it is recommended that you set a secure password and remember it for later.:
$ sudo apt-get install git-core build-essential python-dev python-pip \
apache2 bzip2 memcached libmysqlclient-dev mysql-server libxml2-dev libxslt-dev \
rabbitmq-server supervisor libapache2-mod-wsgi
Note: if you want to use PostgreSQL, replace libmysqlclient-dev and mysql-server with libpq-dev and postgresql.
You will also be needing to edit text, so make sure to install your favorite text editor if nano or vi (not vim) aren’t your cup of tea:
Next, you will need to upgrade distribute and install virtualenv::
$ sudo easy_install -U distribute
$ sudo pip install virtualenv
Finally, you must create the MySQL database for Eve-Wspace to use::
$ mysql -u root -p
Enter the root password you set when installing MySQL before::
Password:
Then, create the database and grant access to it to a new mysql user called maptool with a password you should remember for later. If you want to simply use the root MySQL user, simply ignore the GRANT PRIVILEGES command.:
mysql> CREATE DATABASE evewspace CHARACTER SET utf8;
mysql> GRANT ALL PRIVILEGES ON evewspace.* TO 'maptool'@'localhost' IDENTIFIED BY '<insert a password>';
mysql> quit
Create a User¶
You should not run Eve W-Space as root for security. We will create a dedicated account called maptool with a home directory of /home/maptool. You can name this user whatever you want, just replace all instances of /home/maptool with your user’s home directory.:
$ sudo useradd -m -s /bin/bash maptool
$ sudo passwd maptool
Set Up the Home Directory¶
Let’s become our user for this part to ensure permissions are proper and switch to the install location::
$ sudo su maptool
$ cd /home/maptool
Now, let’s create a directory to be used for serving static files later::
$ mkdir /home/maptool/static
Next, you need to get the Eve W-Space files. We can either clone the latest revision from git or you can download a packaged release and unpack it.
To clone from Github::
$ git clone https://github.com/marbindrakon/eve-wspace.git
To use a packaged release:
You need to download eve-wspace from http://marbindrakon.github.com/eve-wspace/ to get latest zip or tarball package (0.1.1 at time of writing)::
$ wget https://github.com/marbindrakon/eve-wspace/archive/v0.1.1.tar.gz
Then you can unpack the file and rename the directory to eve-wspace to match the clone method::
$ tar xvzf v0.1.1.tar.gz && mv eve-wspace-0.1.1 eve-wspace
Install Eve-Wspace Environment¶
Next, you should create and activate a virtual Python environment for Eve W-Space so that it cannot conflict with any system Python packages::
$ virtualenv --no-site-packages /home/maptool/eve-wspace
$ source /home/maptool/eve-wspace/bin/activate
You will notice that your shell changes to include (eve-wspace) when the virtual environment is active.
Now you can install the required Python packages::
(eve-wspace)$ pip install -r /home/maptool/eve-wspace/requirements-mysql.txt
Use requirements-postgresql.txt if you are using PostgreSQL.
Configuring local_settings.py¶
Now for the fun part, copy the local_settings.py.example file to local_settings.py in the same directory, open it up, and edit it to suit your enviornment::
(eve-wspace)$ cd /home/maptool/eve-wspace/evewspace/evewspace
(eve-wspace)$ cp local_settings.py.example local_settings.py
(eve-wspace)$ nano local_settings.py
While editing, you should pay particular attention to the top part of the file, ensuring that the database statement matches the database, user, and password you created in MySQL earlier and that you add a SECRET_KEY and set the STATIC_ROOT value::
#Example:
# Set this to False for production or you'll leak memory
DEBUG = False
#DEBUG = True
# Set this to a secret value, google "django secret key" will give you
# plenty of generators to choose from
SECRET_KEY = 'sadf98709283j7r098j09a8fd7sdfj89j7f9a8sdf09a8fd'
# Set this to the directory you are service static files out of so that
# manage.py collectstatic can put them in the right place
STATIC_ROOT = "/home/maptool/static/"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'evewspace', # Or path to database file if using sqlite3.
'USER': 'maptool', # Not used with sqlite3.
'PASSWORD': 'really_secure_password', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
Look at the rest of the local_settings.py file and see if there is anything you want to change. The default values for memcached and amqp work for the Ubuntu memcached and rabbitmq defaults.
Initializing the Database¶
Initializing the database falls into two parts: Loading the Eve static data and initializing the Eve W-Space instance.
Static Data¶
CCP releases a Static Data Export for each major patch in MS SQL format. Steve Ronuken makes MySQL conversions available shortly thereafter. These conversions can be downloaded from http://www.fuzzwork.co.uk/dump/ if you are going to be installing multiple instances, you should download the dump once and re-use it if at all possible.:
(eve-wspace)$ cd /home/maptool
(eve-wspace)$ curl -O https://www.fuzzwork.co.uk/dump/mysql55-odyssey-1.0.12-89967.tgz
(eve-wspace)$ gunzip mysql55-odyssey-1.0.12-89967.tgz
(eve-wspace)$ tar xvf mysql55-odyssey-1.0.12-89967.tgz
(eve-wspace)$ mysql -u maptool -p evewspace < odyssey-1.0.12-89967/mysql55-odyssey-1.0.12-89967.sql
The sql import will take a few minutes to run. When it completes, your MySQL database will have all of the Static Data Export tables available.
Initializing Eve W-Space¶
Next you will need to run several commands to set up the Eve W-Space tables and preload them with data. If you encounter errors here, they are most likely caused by bad settings in local_settings.py, not having the virtual environment activated, or permissions.:
(eve-wspace)$ cd /home/maptool/eve-wspace/evewspace
(eve-wspace)$ ./manage.py syncdb --all --noinput
(eve-wspace)$ ./manage.py migrate --fake
(eve-wspace)$ ./manage.py buildsystemdata
Note:This will take a while (~5-10min)
(eve-wspace)$ ./manage.py loaddata */fixtures/*.json
(eve-wspace)$ ./manage.py defaultsettings
(eve-wspace)$ ./manage.py resetadmin
(eve-wspace)$ ./manage.py syncrss
(eve-wspace)$ ./manage.py collectstatic --noinput
Using the Development Server¶
If you’ve made it this far, congratulations! Eve W-Space is set up. From here, you can run the console development server directly or continue with setting up the rest of a production environment.
To start the development server::
(eve-wspace)$ cd /home/maptool/eve-wspace/evewspace
(eve-wspace$ ./manage.py runserver 0.0.0.0:8000
Now you can navigate to your server on port 8000 and see your instance. However, you need to have celery running as well for many tasks to work properly. In another shell::
(eve-wspace)$ cd /home/maptool/eve-wspace/evewspace
(eve-wspace)$ ./manage.py celery worker -B --loglevel=info
When both are running at the same time, you should be able to use all functions. If you want things to run a bit more permanently, continue reading.
Setting Up a Production Stack¶
To serve Eve W-Space in production, you should use a dedicated http daemon to serve static files and either serve the Eve W-Space application itself either through the http daemon itself (as with Apache’s mod_wsgi setup) or through a seperate tool which the http daemon will proxy requests to. This guide follows the Apache route.
Installing Gunicorn¶
This guide uses Gunicorn, a lightweight wsgi server written in Python to serve the Django app itself.
To install::
$ (eve-wspace)$ pip install gunicorn
Configuring Supervisor¶
Unless you want to run celery and gunicorn through the console in screen or tmux, you will want to daemonize them in some way. This guide uses supervisor, but there are many other options available.
At this point, you can log out of the maptool user and go back to our normal account::
(eve-wspace)$ deactivate
$ exit
You need to tell supervisor about the tools you want it to run, to do that, you need to create a config file in /etc/supervisor/conf.d for gunicorn and celeryd::
$ sudo nano /etc/supervisor/conf.d/celeryd.conf
[program:celeryd]
command=python manage.py celery worker -B --loglevel=info
directory=/home/maptool/eve-wspace/evewspace
environment=PATH="/home/maptool/eve-wspace/bin"
user=maptool
autostart=true
autorestart=true
redirect_stderr=True
$ sudo nano /etc/supervisor/conf.d/gunicorn.conf
[program:gunicorn]
command=/home/maptool/eve-wspace/bin/gunicorn_django --workers=4 -b 0.0.0.0:8000 settings.py
directory=/home/maptool/eve-wspace/evewspace/evewspace
environment=PATH="/home/maptool/eve-wspace/bin"
user=maptool
autostart=true
autorestart=true
redirect_stderr=True
To finish it off, you need to stop and then start supervisor to reload the config and start the services::
$ sudo service supervisor stop
$ sudo service supervisor start
And confirm that celeryd started successfully::
$ sudo supervisorctl status
celeryd RUNNING pid 4335, uptime 33 days, 19:16:02
gunicorn RUNNING pid 4330, uptime 33 days, 19:16:00
If either are not in the RUNNING state, either examine the log files in /var/log/supervisor/celeryd-stdout-xxxxxxxxxx.log and /var/log/supervisor/gunicorn-stdout-xxxxxxxx.log or try running them interactively as discussed previously.
Configuring Apache (mod_proxy)¶
NOTE: Apache 2.4 removes underscores in headers and is not compatible with IGB functions
Before configuring the Apache VirtualHost, ensure that mod_proxy is enabled::
$ sudo a2enmod proxy
$ sudo a2enmod proxy_http
To make Apache serve Eve W-Space on a subdomain (e.g. http://map.foo.bar), you can set up a VirtualHost by placing the following text (adapted for your environment) in /etc/apache2/sites-available/evewspace::
<VirtualHost *:80>
ServerName map.foo.bar
DocumentRoot /home/maptool/static
ProxyPass /static !
ProxyPassReverse /static !
Alias /static /home/maptool/static
<Directory /home/maptool/static>
Order allow,deny
Allow from all
</Directory>
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
</VirtualHost>
Activate the new VirtualHost by::
$ sudo ln -s /etc/apache2/sites-available/evewspace /etc/apache2/sites-enabled/evewspace
$ sudo service apache2 restart
Congratulations! Your Eve W-Space instance should now be available at whatever your ip or host name was from the Apache config. Please see the Getting Started page for your next steps. Keep in mind that your instance will have a default administrator registration code until you change it, so do that ASAP.
Getting Started¶
Now that you have Eve W-Space installed and running, there are a few additional steps you should take to getting it fully up and running. These tasks will also introduce you to administering Eve W-Space from the server console. This guide assumes you have installed Eve W-Space in a virtual Python environment.
Starting the Django Shell¶
The rest of this guide, and much of the overall administrative work of using Eve W-Space in its current state, is done from the Django shell, a Python interpreter with the Django enviornment pre-loaded.
Load the Virtual Environment¶
If you installed Eve W-Space into a virtual Python environment, you need to have that environment active.
$ source /home/maptool/eve-wspace/bin/activate
Result: (eve-wspace) $
Start the Shell¶
Now that the virtual enviornment is active, you can start the Django shell using the manage.py program.
(eve-wspace) $ /home/maptool/eve-wspace/evewspace/manage.py shell
That should initialize the Django shell leaving you with:
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>
For the rest of this guide, >>> will indicate something to be typed in the Python interpreter.
Change the Admin Registration Code¶
The first thing you should do after installing Eve W-Space is changing the registration code for the Admins group. By default, this is set to evewspace.
To do this from the Django shell::
>>>from django.contrib.auth.models import Group
>>>adm_group = Group.objects.get(name="Admins")
>>>adm_group.profile.regcode = 'my_super_sekrit_regcode'
>>>adm_group.profile.save()
To do it from the UI::
> Log in as an administrator
> Go to Settings and click the Groups tab
> Click on the Admins group to bring up the edit dialog
> Either enter a registration code or hit the Randomize button to generate one
> Click Save
Now the registration code for the Admins group is whatever you put in place of my_super_sekrit_regcode. An account created with this registration code will have all permissions.
Create a Group for Normal Users¶
You probably don’t want all users to have all permissions in any production install, so you should create another group for normal users.
From the Django shell (Note: You can skip the first line if you are using the same shell as the last section.):
>>>from django.contrib.auth.models import Group
>>>group = Group(name="Awesome Users")
>>>group.save()
>>>group.profile.regcode = 'sekrit_code'
>>>group.profile.save()
From the UI::
> Log in as an administrator
> Go to the Settings page and click the Groups tab
> Click the 'Add Group' button
> Fill in the pop-up form and submit
You can give this group basic map permissions from the Map Admin panel under the “Global Permissions” section.
Upgrading EWS¶
Here are the general instructions for upgrading your Eve W-Space instance to a new release.
Upgrade Files¶
If you are tracking the Github repository (release verisons are in the master branch), you can simply use git to update your files:
As a user that can write to your instance directory:
$ git pull
If you installed from the tarball, then simply overwrite the old files with the new version.
Upgrade Requirements¶
A new version may introduce new requirements. As root if you installed without a virtualenv, or with your virtualenv active:
(eve-wspace) $ pip install –upgrade -r requirements.txt
Note: requirements.txt is located in the repository root
Upgrade Database¶
Eve W-Space uses South for database schema and data migrations. To migrate to the new version, simply run:
(eve-wspace) $ ./manage.py migrate
Simply say ‘yes’ to any tables being removed unless they are yours.
Note: manage.py is located in the evewspace directory from the repository root
Note: If you installed into a virtualenv, it should be active
Upgrade Static Files¶
With your virtualenv active (if applicable):
(eve-wspace) $ ./manage.py collectstatic —noinput
Reset Settings¶
A new version may introduce new settings that need to be initialized, to do so, reset your settings to defaults.
With your virtualenv active (if applicable):
(eve-wspace) $ ./manage.py defaultsettings
Reset Services¶
Now that the instance is up to the new version, you will need to restart celery and your application server for the changes to fully take effect:
How this works will vary based on your enviornment. The instructions below are for the environments set up with the install guides.
As root:
# supervisorctl restart celeryd
For Nginx / gunicorn based installs:
# supervisorctl restart gunicorn
For Apache installs on Ubuntu / Debian:
# service apache2 reload
Done!¶
If everything went okay, you should now be upgraded to the new version. You may need to refresh some pages to get updated javascript if your browser has cached the old data.
If you have trouble or questions, please join us on Coldfront IRC in #eve-wspace, in game at Eve W-Space, or via e-mail at marbin@evewspace.com.
Administration Guide¶
These pages have guides for accomplishing various administrative tasks from the django console.
Development Documentation¶
These pages contain auto-generated module and funciton definitions for the current codebase.
Setting Up a Vagrant Development Environment¶
A common question for those wishing to hack on Eve W-Space is “How do I quickly set up a test server on $OPERATING_SYSTEM?”
Eve W-Space provides a Vagrantfile and associated puppet manifests to quiclkly create standardized testing environments based on Ubuntu 12.04 LTS while still allowing you to work with your favorite coding tools.
Installing Vagrant and VirtualBox on Windows¶
First, you will need to have Oracle VirtualBox installed since Vagrant uses it to run VMs.
To install VirtualBox, download the installer form https://www.virtualbox.org/wiki/Downloads and install it.
Vagrant may be downloaded from http://downloads.vagrantup.com/ as an MSI installer package. Once installed, you may be asked to reboot.
Installing Vagrant and VirtualBox on GNU / Linux¶
This will vary based on your distribution. Many already have VirtualBox and Vagrant packaged in their package manager of choice, so check there first.
Vagrant can be downloaded as a Debian or RPM package from http://downloads.vagrantup.com/ or installed via Ruby Gems using :command: $ gem install vagrant.
VirtualBox is also packaged with many distributions, or can be downloaded in many binary formats at https://www.virtualbox.org/wiki/Linux_Downloads. You should also use dkms if offered to easily upgrade the VirtualBox kernel modules when you upgrade your kernel.
Creating an Eve W-Space Vagrant VM¶
Like any Vagrant-enabled applicaiton, the steps to run a test environment begin with (*nix shown, but the same commands should work in Windows):
$ cd /path/to/code
$ vagrant up
At this point, Vagrant will download the base VM from the internet and start it up. Then it will automatically provision the Eve W-Space database and requirements via Puppet. It will not install a web server like Nginx or Apache since it is presumed you will use Django’s test server for development.
Once provisioning is complete, you will need to access the VM via SSH by connecting to localhost on port 2222 (which is forwarded to the VM’s port 22).
On *nix Vagrant provides a shortcut:
$ vagrant ssh
On Windows, you will need to use the SSH client of your choice, such as PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html).
How you connect will depend on your client, but the information is:
- Host: localhost (or 127.0.0.1)
- User: vagrant
- Password: vagrant
Once you have connected ot the VM, you can administer it as you would any other server running Ubuntu 12.04 LTS. Your working directory will be mounted on the VM as /vagrant To simply start the test server, run:
$ cd /vagrant/evewspace
$ ./manage.py runserver 0.0.0.0:8000
Now you should be able to connect to your test server in a web browser on your host at http://localhost:8080 .
You may also want to run Celery to handle background tasks. Open a second ssh shell and run:
$ /vagrant/evewspace/manage.py celery worker -B –loglevel=info
Debugging output from background tasks will appear in this shell.
Developing with the Vagrant Test Environment¶
Since any changes to your working directory appear in the vagrant VM, simply use your favorite editor or IDE as you normally would. You may need to restart the Django test server if you cause a crash.
Please remember to only commit Unix style line endings or configure your git client to automatically convert on push.
Data Models¶
Below are the various data models in Eve W-Space.
core¶
- class core.models.ConfigEntry(*args, **kwargs)[source]¶
A configuration setting that may be changed at runtime.
- class core.models.Constellation(*args, **kwargs)[source]¶
Core model for static constellation data, references Region
- class core.models.Corporation(*args, **kwargs)[source]¶
Represents a corporation, data pulled from api
- class core.models.Location(*args, **kwargs)[source]¶
Core model for SDD mapDenormalize table that generic locations map to.
- class core.models.LocationWormholeClass(*args, **kwargs)[source]¶
Core model for SDD mapLocationWormholeClasses used to generate system tables.
- class core.models.NewsFeed(*args, **kwargs)[source]¶
Contains information about an RSS feed. If user is None, the feed is global.
- class core.models.StarbaseResource(*args, **kwargs)[source]¶
Core model for SDD invStarbaseResources table. Maps tower types to their fuel
- class core.models.StarbaseResourcePurpose(*args, **kwargs)[source]¶
Core model for SDD invControlTowerResourcePurpose table.
- class core.models.SystemData(*args, **kwargs)[source]¶
Core model for static system data from the SDD, references Region and Constellation
Map¶
- class Map.models.Destination(*args, **kwargs)[source]¶
Represents a corp-wide destination whose range should be shown in the map.
- class Map.models.KSystem(*args, **kwargs)[source]¶
KSystem(id, name, constellation_id, region_id, x, y, z, security, systemdata_ptr_id, sysclass, importance, occupied, info, lastscanned, npckills, podkills, shipkills, updated, first_visited, last_visited, system_ptr_id, sov, jumps)
- class Map.models.Map(*args, **kwargs)[source]¶
Stores the maps available in the map tool. root relates to System model.
- add_system(user, system, friendlyname, parent=None)[source]¶
Adds the provided system to the map with the provided friendly name. Returns the new MapSystem object.
- class Map.models.MapLog(*args, **kwargs)[source]¶
Represents an action that has taken place on a map (e.g. adding a signature). This is used for pushing updates since last page load to clients.
- class Map.models.MapPermission(*args, **kwargs)[source]¶
Relates a user group to it’s map permissions. Non-restricted groups will have change access to all maps.
- class Map.models.MapSystem(*args, **kwargs)[source]¶
Stores information regarding which systems are active in which maps at the present time.
- class Map.models.Signature(*args, **kwargs)[source]¶
Stores the signatures active in all systems. Relates to System model.
- class Map.models.SignatureForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None)[source]¶
This form should only be used with commit=False since it does not set the system or updated fields.
- class Map.models.SignatureType(*args, **kwargs)[source]¶
Stores the list of possible signature types for the map tool. Custom signature types may be added at will.
- class Map.models.SiteSpawn(*args, **kwargs)[source]¶
Contains the site spawn list for a site as HTML.
- class Map.models.Snapshot(*args, **kwargs)[source]¶
Represents a snapshot of the JSON strings that are used to draw a map.
- class Map.models.System(*args, **kwargs)[source]¶
Stores the permanent record of a solar system. This table should not have rows added or removed through Django.
- class Map.models.WSystem(*args, **kwargs)[source]¶
WSystem(id, name, constellation_id, region_id, x, y, z, security, systemdata_ptr_id, sysclass, importance, occupied, info, lastscanned, npckills, podkills, shipkills, updated, first_visited, last_visited, system_ptr_id, static1_id, static2_id, effect)
POS¶
- class POS.models.CorpPOS(*args, **kwargs)[source]¶
A corp-controlled POS with manager and password data.
account¶
- class account.models.EWSUser(*args, **kwargs)[source]¶
An abstract base class implementing a fully featured User model with admin-compliant permissions.
Username, password and email are required. Other fields are optional.
- class account.models.GroupProfile(*args, **kwargs)[source]¶
GroupProfile defines custom fields tied to each Group record.
Alerts¶
- class Alerts.models.Subscription(*args, **kwargs)[source]¶
Mapping table that relates Users to their subscriped SubscriptionGroups.
API¶
- class API.models.APIAccessGroup(*args, **kwargs)[source]¶
Stores the access mask access groups from the CallList call.
- class API.models.APIAccessRequirement(*args, **kwargs)[source]¶
Stores the required access for member API keys for a corp.
- class API.models.APIAccessType(*args, **kwargs)[source]¶
Stores the access masks and types pulled from the CallList call.
- class API.models.APICharacter(*args, **kwargs)[source]¶
API Character contains the API security information of a single character.
- class API.models.APIGroupMapping(*args, **kwargs)[source]¶
Maps API-obtained corps and titles to Django groups.
- class API.models.APIKey(*args, **kwargs)[source]¶
API Key object relates to User and contains key id, vcode, and validation information.
- class API.models.APIShipLog(*args, **kwargs)[source]¶
API Ship Log contains a timestamped record of a ship being flown by a character.
SiteTracker¶
- class SiteTracker.models.Claim(*args, **kwargs)[source]¶
Represents a User’s claim for a claim period.
- class SiteTracker.models.ClaimPeriod(*args, **kwargs)[source]¶
Represents a claim period that Users can claim against.
- class SiteTracker.models.PayoutEntry(*args, **kwargs)[source]¶
Represents an entry in the payout report.
- class SiteTracker.models.PayoutReport(*args, **kwargs)[source]¶
Represents a payout report and contains general information about the payout period.
- class SiteTracker.models.SiteRole(*args, **kwargs)[source]¶
Represents a role for a sitetracker fleet.
- class SiteTracker.models.SiteType(*args, **kwargs)[source]¶
Represents a type of site that can be credited.
- class SiteTracker.models.SiteWeight(*args, **kwargs)[source]¶
Represents the raw points available for a site type / system class combo
- class SiteTracker.models.SystemWeight(*args, **kwargs)[source]¶
Respresents a multiplier for site credit for a system.
Recruitment¶
- class Recruitment.models.Action(*args, **kwargs)[source]¶
Represents an action that can be taken on an application e.g Intel Ran
- class Recruitment.models.AppAction(*args, **kwargs)[source]¶
Represents an action taken on an application.
- class Recruitment.models.AppQuestion(*args, **kwargs)[source]¶
Represents a question to be asked on the application.
- class Recruitment.models.AppResponse(*args, **kwargs)[source]¶
Represents a response to a custom application question.
- class Recruitment.models.Application(*args, **kwargs)[source]¶
Represents a recruitment application.
- class Recruitment.models.Interest(*args, **kwargs)[source]¶
Represents an option for the ‘What are you interests? question’
Teamspeak¶
Jabber¶
- class Jabber.models.JabberAccount(*args, **kwargs)[source]¶
A jabber account to send messages to. JID is in user@host.tld format
Cart¶
- class Cart.models.Request(*args, **kwargs)[source]¶
Request(id, originuser_id, totalcost, itemcount, corprequest, daterequested, datefilled, fillcost, deliveredto, datepaid, filluser_id)
View Functions¶
Below are the various view functions in Eve W-Space.
core¶
Map¶
- Map.views.add_system(request, *args, **kwargs)[source]¶
- AJAX view to add a system to a current_map. Requires POST containing:
- topMsID: map_system ID of the parent map_system bottomSystem: Name of the new system topType: WormholeType name of the parent side bottomType: WormholeType name of the new side timeStatus: Wormhole time status integer value massStatus: Wormhole mass status integer value topBubbled: 1 if Parent side bubbled bottomBubbled: 1 if new side bubbled friendlyName: Friendly name for the new map_system
- Map.views.bulk_sig_import(request, *args, **kwargs)[source]¶
GET gets a bulk signature import form. POST processes it, creating sigs with blank info and type for each sig ID detected.
- Map.views.create_map(request, *args, **kwargs)[source]¶
This function creates a map and then redirects to the new map.
- Map.views.destination_list(request, map_id, *args, **kwargs)[source]¶
Returns the destinations of interest tuple for K-space systems and a blank response for w-space systems.
- Map.views.edit_signature(request, *args, **kwargs)[source]¶
GET gets a pre-filled edit signature form. POST updates the signature with the new information and returns a blank add form.
- Map.views.edit_system(request, *args, **kwargs)[source]¶
A GET request gets the edit system dialog pre-filled with current information. A POST request saves the posted data as the new information.
POST values are friendlyName, info, and occupied.
- Map.views.edit_wormhole(request, *args, **kwargs)[source]¶
A GET request gets the edit wormhole dialog pre-filled with current info. A POST request saves the posted data as the new info. POST values are topType, bottomType, massStatus, timeStatus, topBubbled, and bottomBubbled.
- Map.views.general_settings(request, *args, **kwargs)[source]¶
Returns and processes the general settings section.
- Map.views.get_map(request, *args, **kwargs)[source]¶
Get the map and determine if we have permissions to see it. If we do, then return a TemplateResponse for the map. If map does not exist, return 404. If we don’t have permission, return PermissionDenied.
- Map.views.get_signature_list(request, *args, **kwargs)[source]¶
Determines the proper escalationThreshold time and renders system_signatures.html
- Map.views.global_permissions(request, *args, **kwargs)[source]¶
Returns and processes the global permissions section.
- Map.views.manual_add_system(request, *args, **kwargs)[source]¶
A GET request gets a blank add system form with the provided MapSystem as top system. The form is then POSTed to the add_system view.
- Map.views.manual_location(request, *args, **kwargs)[source]¶
Takes a POST request form AJAX with a System ID and marks the user as being active in that system.
- Map.views.map_refresh(request, *args, **kwargs)[source]¶
Returns an HttpResponse with the updated systemJSON for an asynchronous map refresh.
- Map.views.map_settings(request, *args, **kwargs)[source]¶
Returns and processes the settings section for a map.
- Map.views.mark_scanned(request, *args, **kwargs)[source]¶
Takes a POST request from AJAX with a system ID and marks that system as scanned.
- Map.views.mark_signature_cleared(request, *args, **kwargs)[source]¶
Marks a signature as having its NPCs cleared.
- Map.views.remove_system(request, *args, **kwargs)[source]¶
Removes the supplied map_system from a map.
- Map.views.set_interest(request, *args, **kwargs)[source]¶
Takes a POST request from AJAX with an action and marks that system as having either utcnow or None as interesttime. The action can be either “set” or “remove”.
- Map.views.site_spawns(request, map_id, ms_id, sig_id)[source]¶
Returns the spawns for a given signature and system.
- Map.views.system_details(request, *args, **kwargs)[source]¶
Returns a html div representing details of the System given by ms_id in map map_id
Returns the html for system menu
POS¶
- POS.views.add_pos(request, *args, **kwargs)[source]¶
GET gets the add POS dialog, POST processes it.
- POS.views.edit_pos(request, *args, **kwargs)[source]¶
GET gets the edit POS dialog, POST processes it.
account¶
Alerts¶
API¶
SiteTracker¶
- SiteTracker.views.approve_fleet_site(request, fleetID, *args, **kwargs)[source]¶
Approve a pending site while the fleet is active.
- SiteTracker.views.boss_panel(request, fleetID, *args, **kwargs)[source]¶
Return the HTML for the boss control panel popup.
- SiteTracker.views.claim_site(request, fleetID, siteID, memberID)[source]¶
Claims the site (making it pending) if called by member. Fully grants credit for the site if called by current boss.
- SiteTracker.views.create_fleet(request, *args, **kwargs)[source]¶
Takes a system ID via POST and makes a sitetracker fleet with the requesting user as initial and current boss. Then adds the requestor to the fleet as a member.
- SiteTracker.views.credit_site(request, fleetID, *args, **kwargs)[source]¶
- Credit a site to the given fleet. Takes POST input:
- type = short_name of site type
- SiteTracker.views.kick_member(request, fleetID, *args, **kwargs)[source]¶
Removes a member from the fleet.
- SiteTracker.views.leave_fleet(request, *args, **kwargs)[source]¶
Leaves the given fleet. If fleetID is not provided, leave all fleets.
- SiteTracker.views.promote_member(request, *args, **kwargs)[source]¶
Promote the given member to boss. Boss permisison not required since we allow for siezure from an AFK boss.
- SiteTracker.views.refresh_boss_member(request, fleetID, *args, **kwargs)[source]¶
Returns an updated details view for a boss panel member.
- SiteTracker.views.refresh_fleets(request, *args, **kwargs)[source]¶
Return a template with tags for the myfleets and availfleets lists.
- SiteTracker.views.remove_site(request, fleetID, *args, **kwargs)[source]¶
Uncredit a site to the given fleet.
Recruitment¶
Teamspeak¶
Jabber¶
Cart¶
Utility Functions¶
Below are the various utility functions and classes in Eve W-Space.
core¶
Map¶
- class Map.utils.MapJSONGenerator(map, user)[source]¶
A MapJSONGenerator is instantiated with a map and user. It provides a method that returns the JSON representation of the map.
- get_path_to_map_system(system)[source]¶
Returns a list of MapSystems on the route between the map root and the provided MapSystem.
- get_system_background(system)[source]¶
Takes a MapSystem and returns the appropriate background icon as a relative URL or None.
- get_system_icon(system)[source]¶
Takes a MapSystem and returns the appropriate icon to display on the map as a realative URL.
- class Map.utils.RouteFinder[source]¶
A RouteFinder object is created with two system objects and has methods for getting the shortest stargate jump route length, the light-year distance, and the shortest stargate route as a list of KSystem objects.
- Map.utils.convert_signature_id(sigid)[source]¶
Standardize the signature ID to XXX-XXX if info is available.
- Map.utils.get_possible_wh_types(system1, system2)[source]¶
Takes two systems and gets the possible wormhole types between them. For example, given system1 as highsec and system2 as C2, it should return R943 and B274. system1 is the source and system2 is the destination. Results are returned as lists because some combinations have multiple possibilities. Returns a dict in the format {system1: [R943,], system2: [B274,]}.
POS¶
account¶
Alerts¶
API¶
SiteTracker¶
Recruitment¶
Teamspeak¶
Jabber¶
Cart¶
Alert Method Sample¶
This is the base class that must be used when defining a custom alert_method.
AlertMethodBase¶
Base class for alert method interface.
- class Alerts.method_base.AlertMethodBase[source]¶
- This is a skeleton AlertMethod. It should handle the following:
- send_alert(to_users, message, from_user, sub_group)
- -Send alert to given to_users. Should handle an unregistered user
- gracefully.
- per_user_method()
- -Return True if this method requires per-user signup (i.e. Jabber)
- Return False if no per-user registration is required (i.e. Slack)
- register_user(user, sub_group)
- -Register the provided user and subscription group as being handled
- by this method.
- unregister_user(user, sub_group)
- -Unregister the given user and subscription group combo
- is_registered(user, sub_group)
- -Return True if the user and subscripiton group are registered
- description()
- -Return a text description of the method
- description(user, sub_group)[source]¶
Return a one-sentence descritpion of the method for the user to see.
- register_user(user, sub_group)[source]¶
Register a user / subscription group combo to recieve alerts.
Release Notes¶
v0.2.2 (23 June 2013)¶
Version 0.2.2 brings bug fixes and minor features. Special thanks to Joshua Blake for extensive contributions on this release.
Core¶
- Added ability for users who have set an e-mail address to reset forgotten passwords (requries SMTP setup)
- Added experimental signals in Map that are precursors to the full logging system
- Updated example local_settings.py file to include e-mail settings
Map¶
- Extend destinations list to allow setting waypoints as well as destinations when run in a tursted IGB session
- Destinations list is now sorted by number of jumps
- Add logging signal for signature additions and updates
- Fix regression introduced in v0.2 which caused Sov and WH Effect to not display on system tooltips
- Performance enhancements for map refreshes
- Added system name to Signatures, Active Pilots, and Starbases tabs in System Details view
- Added GATE wormhole type to fixtures. Run ./manage.py loaddata Map/fixtures/wormholetypes.json to add it to your installation.
SiteTracker¶
- Full site list for each member is no longer loaded automatically for the boss control panel for performance reasons. Select “Sites” under a member to load their site list.
v0.2 (4 June 2013)¶
Version 0.2 brings basic Alerts functionality, an improved Map UI, and lots of bug fixes.
Core¶
- Added ability for users to change their own passwords
- An optional e-mail field has been added to the registration form and the user profile
- Registries have been added for Navigation entries, Admin sections, and Profile sections
- The default wsgi.py module has been updated to work with Apache out of the box
- Added icons to indicate collapsable UI components
- Added a handler for default settings in Apps (‘manage.py defaultsettings’)
Map¶
- The default signature types have been renamed in accordance with CCP changes in Odyssey
- The bulk signature importer will now attempt to import signature types and names
- The bulk signature importer will no longer attempt to import POSes as signatures
- The System Details UI has been converted to a single tab pane to conserve space on small browser windows
- Systems in the chain which are not the root and which have active pilots are now highligted with a yellow border ring
- The system actions menu has been changed to a toolbar above the System Details tab pane
- Clicking a system now opens System Details directly
- Destinations have been broken into global and user scopes. Global destinations appear for everyone and user destinations appear for only the user who set it.
- Users may set user destinations from the Settings page.
- Wormholes that are End of Life now display how long they have been set EOL in the tooltip
- Systems may now be “collapsed” from the chain, sperating their children into a sub-chain
- Collapsed systems may be “Resurrected”, re-adding them to the main chain with the same wormhole status as the time of collapsing
- The k-space route finder has been significantly optimized
- The map legend is now spaced evenly
- Regions are now shown in the tooltip for K-Space systems
- The info and occupied boxes in System Details are now only shown if those fields have data
- Adding or importing a signature with the exact same ID as one already on the map will cause the existing signature to be updated
- Signatures entered as “AAA-123”, “AAA - 123”, or “AAA123” will be standardized to “AAA-123” automtically
- Removed 8 character limitation for friendly names. Only 8 characters are displayed in the system ellipse.
- The Map is now automatically refreshed every 15 seconds by default
- Combined per-system wormhole and system tooltip requests into a single request each for system and wormhole tooltips
- Attempting to add a POS for an unknown corp that is in an alliance is now more graceful
- Fixed bug preventing the Cancel button on the Add POS dialog from functioning
- Removed the ability to set “Explicit permissions” for users who are not Map Admins
- Granted Map Admins the ability to see all maps regardless of permissions
- The cursor will now give an indication that the Reload Map button is clickable
Alerts¶
- Added the Alerts framework
- Added a sample alert method class to the documentation
- Added an alert method plugin for Jabber
- Added an external authentication bridge for ejabberd
- Fixed errors in the Jabber message template
SiteTracker¶
- Added a first iteration of the SiteTracker status, fleet management, and fleet UIs
- Added ability to weight site credit by system