This installation guide covers installing Insight and the required packages from source. Binary versions and a Docker image of Insight are available. See hosting Insight for alternative methods of hosting Insight. Please consider using the Docker image of Insight if you are unfamiliar with installing packages or running applications on the Python Interpreter in Linux. Please be aware that running Insight from source specifically requires a Python 3.6 interpreter.
I highly recommend running Insight with Docker. Source installs are subject to configuration and package difference issues.
This guide will step you through setting up Insight on a Debian/Ubuntu operating system.
Note: A recent version of Ubuntu 18.04+ is recommended as Python 3.6 is included in the default repositories. You will need to build Python 3.6 from source if your Linux distribution only includes an earlier version of python in the repositories. It is generally not recommended to mix multiple Python 3 versions on a system as things can break.
Let's start by making sure we have all of the required packages needed to run Insight:
sudo apt-get update
sudo apt-get install git python3 python3-dev python3-pip python3-venv wget unzip
When you run the command
python3 -V
You should see:
Python 3.6.x
Note: Insight requires Python 3.6 specifically. Earlier versions lack support for some of the asyncio features and syntax used in Insight. Python 3.7 causes issues with the third-party swagger-client which will eventually be replaced.
Navigate to where you wish to keep the Insight project and make a new project directory. In this example we will create a directory in the current user's home directory to store files.
mkdir ~/InsightProjectFiles
cd ~/InsightProjectFiles
Clone the project from Github:
git clone https://github.com/Nathan-LS/Insight.git
Let's create a python virtual environment in the Insight project directory and activate it. A virtual environment allows the user to install python packages to a virtual environment on a per-project basis without installing them to the global Python environment.
cd Insight
python3 -m venv venv
source venv/bin/activate
We are now ready to start installing required packages to our activated virtual environment. First, we need to install the Swagger python-client. This is an automatically generated library using the Swagger code generator for the EVE Online API. This library is now generated and provided under Insight releases. If you wish to generate the library yourself, see CCP Codegen Blog. The following steps assume you are downloading the swagger-client from Insight releases.
Download the latest swagger-client release. Replace the version number with the latest Insight release version.
wget https://github.com/Nathan-LS/Insight/releases/download/v1.4.0/swagger-client-python.zip
unzip swagger-client-python.zip -d swagger-client-python
cd swagger-client-python
Now we will install the python-client to the venv.
python3 setup.py install
cd ..
Now we will install the remaining packages specified in Insight's requirements.txt file with the following command.
pip3 install -r requirements.txt
Download and extract the latest SDE sqlite database archive from Fuzzwork.
wget https://www.fuzzwork.co.uk/dump/sqlite-latest.sqlite.bz2
bunzip2 sqlite-latest.sqlite.bz2
We now need to create Discord and CCP Developer applications.
Open the file default-config.ini in a text editor or run this command if using the command line interface:
nano default-config.ini
Navigate to Discord Applications in a web browser, click My Apps and then New App.
Name your app and provide a description. No redirect URL is required. After clicking Create App, select Create a Bot User.
Check Public Bot and uncheck Require OAuth2 Code Grant
Click click to reveal next to Token under the Bot settings. Copy this token down and paste it into the correct section in your config file as seen below:
[discord]
token = YourDiscordAppTokenGoesHere
;required - Create a new Discord app at https://discordapp.com/developers/applications/me and set token to your App's token
Insight requires an EVE Application to access user contacts for use in cap radar feeds. Navigate to Create New App.
Provide a name and description for your app and select Authentication & API Access for Connection Type
In the Permissions pane make sure the following scopes are listed under Requested Scopes List:
Specify https://localhost/InsightCallback
as your Callback URL. After authenticating, Discord users will be redirected to your callback URL. You can modify the URL to point to your website if you host a custom landing page, otherwise the user will simply be directed to a blank page on localhost after which they paste the given callback URL into the Discord direct message.
Click Create Application and then view your newly created application. Copy the Client ID:, Secret Key, and Callback URL: into the appropriate sections in your open configuration file like so:
[ccp_developer]
client_id = ExampleClientIDGoesHere
secret_key = ExampleSecretKeyGoesHere
callback_url = ExampleCallbackURLGoesHere
;required - Create a new CCP Application at https://developers.eveonline.com/applications/create with the following scopes:
;esi-characters.read_contacts.v1
;esi-corporations.read_contacts.v1
;esi-alliances.read_contacts.v1
Save and rename your configuration file to config.ini, moving it to the current directory. If you are using nano and the CLI, use the following shortcuts: 'CRTL-X', 'Y', 'ENTER' and run the command:
mv default-config.ini config.ini
Congratulations! You are now ready to run Insight! To start Insight using your virtual environment run:
python3 Insight
Insight will start and begin importing data from the SDE. On the first initial run it can take up to 10 minutes to import everything from the SDE. On subsequent runs Insight will only import missing static data which takes little time.
You need your Discord application's client ID found here to invite your newly created bot. Select your Discord application and copy down the Client ID.
Edit the following URL to include your Client ID. Navigating to this URL will allow users to invite the bot to their server.
https://discordapp.com/api/oauth2/authorize?client_id=ClientIDGoesHere&permissions=0&scope=bot
Insight includes startup and stop shell scripts in the /scripts directory.
Ensure you have screen:
sudo apt-get update
sudo apt-get install screen
Allow the files to have execute permissions:
cd scripts
chmod +x insight_start.sh
chmod +x insight_stop.sh
Execute the script, assuming you have a python virtual environment named venv in the Git root directory.
./insight_start.sh
Will start insight in a screen session accessible by running:
screen -r eveInsight
You can use the keyboard shortcut CRTL-A-D to minimize the screen session into the background. To terminate Insight, run:
screen -S eveInsight -X quit
or execute the provided insight_stop.sh
script.
You can edit crontab to start Insight on startup using the provided shell scripts.
crontab -e
Add the following entry at the end of the file:
@reboot ~/YourPathToInsightGitFolder/scripts/insight_start.sh
Save this file with the shortcuts: 'CRTL-X', 'Y', 'ENTER' if you are using nano. Now when Ubuntu starts the Insight startup script will be called, creating a screen session named eveInsight.