first commit
This commit is contained in:
commit
aa7869eb33
386 files changed
+69375
No files matched your search
@@ -0,0 +1,148 @@
|
||||
# Configuring Gekko on a server
|
||||
|
||||
*NOTE: unfortunately configuring Gekko to run on a server is hard. Unless you are running in a completely trusted network (home network) you WILL need to get an SSL certificate, upstream Gekko through a webserver, etc. I am creating an official Gekko service called [Gekko Plus](https://gekkoplus.com/) that will NOT require any of this stuff.*
|
||||
|
||||
Gekko runs great headless (on a server, raspberry PI) but the default configuration assumes that you will be using a browser from the same machine to access the interface.
|
||||
|
||||
# Installation
|
||||
|
||||
Please see the normal [installing gekko](./installing_gekko.md) document, but before starting gekko please update the configuration as stated below:
|
||||
|
||||
# Configuring Gekko
|
||||
|
||||
In order to setup Gekko so that you can access it remotely you need to open and edit the following file: `gekko/web/vue/dist/UIconfig.js`. You need to configure this file according to your use case:
|
||||
|
||||
- You want to Gekko headless in a trusted environment (eg. on a raspberry pi or old laptop in your home network) - [see here](#configuring-gekko-to-run-headless-in-a-trusted-environment).
|
||||
- You want to run Gekko in the cloud on a server - [see here](#configuring-gekko-to-run-in-the-cloud).
|
||||
|
||||
## Configuring Gekko to run headless in a trusted environment
|
||||
|
||||
Edit the uiconfig file like so:
|
||||
|
||||
const CONFIG = {
|
||||
headless: true,
|
||||
api: {
|
||||
host: '0.0.0.0',
|
||||
port: 3000,
|
||||
},
|
||||
ui: {
|
||||
ssl: false,
|
||||
host: 'x.x.x.x', // Set this to the IP of the machine that will run Gekko
|
||||
port: 3000,
|
||||
path: '/'
|
||||
},
|
||||
adapter: 'sqlite'
|
||||
|
||||
}
|
||||
|
||||
You can now access the Gekko UI by going to `http://x.x.x.x:3000` in a browser (change `x.x.x.x` with the IP of the machine that will run Gekko).
|
||||
|
||||
|
||||
## Configuring Gekko to run in the cloud
|
||||
|
||||
Important note: if you expose Gekko to the open internet (or on any non trusted network) you are recommended to put a secure reverse proxy (for example with both [SSL](#Obtaining-a-SSL-certificate) and [BasicAuth](#Create-htpasswd-for-basic-password-authentication)) in front of it. While we believe Gekko is hard to exploit, it allows for 24/7 backtesting which will drain your machine's resources (possible DoS).
|
||||
|
||||
The following assumes you configured a reverse proxy, if you did not simply follow [these instructions](#Configuring-NGINX-as-a-reverse-proxy) to do so.
|
||||
|
||||
|
||||
const CONFIG = {
|
||||
headless: true,
|
||||
api: {
|
||||
host: '127.0.0.1',
|
||||
port: 3000,
|
||||
},
|
||||
ui: {
|
||||
ssl: true,
|
||||
host: 'gekko.example.com',
|
||||
port: 443,
|
||||
path: '/' // change this if you are serving from something like `example.com/gekko`
|
||||
},
|
||||
adapter: 'sqlite'
|
||||
}
|
||||
|
||||
|
||||
## Configuring NGINX as a reverse proxy
|
||||
|
||||
NGINX is a highly configurable, lightweight, yet easily deployed webserver allowing features such as a reverse proxying using secure sockets layer with authentication and much more.
|
||||
|
||||
Installing NGINX using your Operating Systems package manager of choice is pretty straight forward. For Debian Linux it is a simple sudo apt-get install nginx
|
||||
|
||||
Once NGINX is installed you will need to modify the configuration file. For Debian Linux the config is located at /etc/nginx/sites-enabled/default
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name gekko.example.com;
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
upstream websocket {
|
||||
server localhost:3000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
root /var/www/html;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/nginx.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/nginx.key;
|
||||
|
||||
location / {
|
||||
proxy_buffers 8 32k;
|
||||
proxy_buffer_size 64k;
|
||||
|
||||
proxy_pass http://websocket;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-NginX-Proxy true;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
proxy_read_timeout 86400s;
|
||||
proxy_send_timeout 86400s;
|
||||
|
||||
auth_basic "Restricted Content";
|
||||
auth_basic_user_file /etc/nginx/.htpasswd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
## Obtaining a SSL certificate
|
||||
|
||||
Your OS may or may not ship with openssl preinstalled. In the case it doesn't, simply install openssl using your package manager of choice. eg: `sudo apt-get install openssl`.
|
||||
|
||||
Below you can choose between creating a self signed certificate useful if you do not have a fqdn (fully qualified domain name), or if you by chance do have a fqdn you can use certbot to obtain a Let's Encrypt CA signed certificate.
|
||||
|
||||
|
||||
### To create a self signed certificate:
|
||||
|
||||
sudo mkdir /etc/nginx/ssl
|
||||
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
|
||||
|
||||
|
||||
### To obtain a Let's Encrypt CA signed certificate:
|
||||
|
||||
Install certbot, a client to obtain signed ssl certificates for your domain.
|
||||
|
||||
sudo apt-get install certbot
|
||||
|
||||
Run the following command:
|
||||
|
||||
certbot certonly --standalone -d example.com -d gekko.example.com
|
||||
|
||||
Modify your NGINX config and replace the ssl lines with the following:
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
|
||||
add_header Strict-Transport-Security "max-age=31536000";
|
||||
|
||||
|
||||
## Create htpasswd for basic password authentication
|
||||
|
||||
Change username to desired username and enter password when prompted:
|
||||
|
||||
printf "username:`openssl passwd -apr1`\n" >> /etc/nginx/.htpasswd
|
||||
@@ -0,0 +1,62 @@
|
||||
# Installing Gekko
|
||||
|
||||
*NOTE: unfortunately installing and managing Gekko is hard. You will need to touch the commandline and install a few developer tools. I am creating an official Gekko service called [Gekko Plus](https://gekkoplus.com/) that will NOT require any installation.*
|
||||
|
||||
- *Windows user? Please see the doc [installing Gekko on windows](./installing_gekko_on_windows.md) instead.*
|
||||
- *Docker user? You can run Gekko in a docker container, see [installing Gekko using Docker](./installing_gekko_using_docker.md) instead.*
|
||||
- *Server user? In order to run Gekko headless, see [configuring Gekko on a server](./configuring_gekko_on_a_server.md) instead.*
|
||||
|
||||
Here is a video of me explaining how to install Gekko the easiest way possible:
|
||||
|
||||
[](https://www.youtube.com/watch?v=R68IwVujju8)
|
||||
|
||||
|
||||
To get Gekko running you need to do the following:
|
||||
|
||||
- install nodejs
|
||||
- install git
|
||||
- download Gekko
|
||||
- install Gekko & Gekko Broker dependencies
|
||||
|
||||
## Installing nodejs
|
||||
|
||||
Gekko requires [nodejs](https://nodejs.org/en/) to be installed. Go ahead and install this if it's not already (Gekko requires at least version 8.11.2). We advice to download the current LTS.
|
||||
|
||||
## Installing git
|
||||
|
||||
As part of Gekko's installation process git is used, see [this guide](https://www.linode.com/docs/development/version-control/how-to-install-git-on-linux-mac-and-windows/) for installation instructions. If you do not already have git on your system.
|
||||
|
||||
## Downloading Gekko
|
||||
|
||||
The recommended way of downloading Gekko is by using git. This makes keeping Gekko up to date a lot easier. Run this in a terminal:
|
||||
|
||||
git clone git://github.com/askmike/gekko.git -b stable
|
||||
cd gekko
|
||||
|
||||
This will download the latest stable version of Gekko, remove the final `-b stable` part to download the current latest release (which might not be as stable).
|
||||
|
||||
Alternatively you can manually download the latest stable version of Gekko on the [releases page](https://github.com/askmike/gekko/releases).
|
||||
|
||||
## Installing Gekko's dependencies
|
||||
|
||||
Once you have Gekko downloaded you need to install the dependencies, open your terminal and navigate to the gekko folder and run:
|
||||
|
||||
npm install --only=production
|
||||
|
||||
*NOTE: You may see a vulnerability warning from NPM, if you run npm audit with --force, Gekko will break. See [here](https://github.com/askmike/gekko/issues/2585#issuecomment-428450997).*
|
||||
|
||||
You also need to install Gekko Broker's dependencies, run:
|
||||
|
||||
cd exchange
|
||||
npm install --only=production
|
||||
cd ..
|
||||
|
||||
## Starting Gekko
|
||||
|
||||
After all the above you can start Gekko by running the following in your terminal:
|
||||
|
||||
node gekko --ui
|
||||
|
||||
## Updating Gekko
|
||||
|
||||
See the [updating Gekko](./updating_gekko.md) doc.
|
||||
@@ -0,0 +1,74 @@
|
||||
# Installing Gekko on Raspberry Pi 2 or 3
|
||||
|
||||
This manual is intended for a Raspberry Pi 2 or 3 with freshly installed Raspbian Stretch (Lite).
|
||||
|
||||
To get Gekko running on your Pi you need to do the following:
|
||||
|
||||
- update your package lists
|
||||
- install nodejs
|
||||
- download Gekko
|
||||
- install Gekko's dependencies
|
||||
- (optional) Configure your Pi as a headless server in your local network
|
||||
|
||||
## Update your package lists
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
|
||||
## Installing nodejs
|
||||
|
||||
We recommend installing the latest LTS Version of Node, currently 8.x.x
|
||||
|
||||
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
|
||||
Important: Ignore the errors!
|
||||
=> It automatically builds from source instead, it can take over 10 minutes! Do not abort the process
|
||||
|
||||
## Downloading Gekko
|
||||
|
||||
The recommended way of downloading Gekko is by using git. This makes keeping Gekko up to date a lot easier. Run this in a terminal:
|
||||
|
||||
sudo apt-get install git
|
||||
git clone git://github.com/askmike/gekko.git -b stable
|
||||
cd gekko
|
||||
|
||||
This will download the latest stable version of Gekko, remove the final `-b stable` part to download the current latest release (which might not be as stable).
|
||||
|
||||
## Installing Gekko's dependencies
|
||||
|
||||
Once you have Gekko downloaded you need to install the dependencies, open your terminal and navigate to the gekko folder and run:
|
||||
|
||||
npm install --only=production
|
||||
cd exchange
|
||||
npm install --only=production
|
||||
cd ..
|
||||
|
||||
## Configure your Pi as a headless server
|
||||
|
||||
cd web/vue/dist
|
||||
nano UIconfig.js
|
||||
|
||||
Set headless to true
|
||||
|
||||
Set api.host to 0.0.0.0
|
||||
|
||||
Set ui.host to Pi's IP address (e.g. 192.168.1.74)
|
||||
|
||||
## Starting Gekko
|
||||
|
||||
After all the above you can start Gekko by running the following in your terminal:
|
||||
|
||||
node gekko --ui
|
||||
|
||||
Open your browser and type in Pi's IP:port (default port: 3000)
|
||||
|
||||
## Updating Gekko
|
||||
|
||||
See the [updating Gekko](./updating_gekko.md) doc.
|
||||
|
||||
## Run gekko in background
|
||||
If you access Pi headless via SSH, you have to use a software like tmux to run Gekko in background
|
||||
|
||||
## Installing Gekko on Raspberry Pi 1
|
||||
It is possible to run Gekko on Raspberry Pi 1, but you have to manually install Nodejs armv6 version
|
||||
@@ -0,0 +1,77 @@
|
||||
# Installing Gekko on windows
|
||||
|
||||
*NOTE: unfortunately installing and managing Gekko is hard. You will need to touch the commandline and install a few developer tools. I am creating an official Gekko service called [Gekko Plus](https://gekkoplus.com/), it will NOT require any installation.*
|
||||
|
||||
### Note:
|
||||
#### Windows does not natively support TA-lib. We are currently working on implementing the Tulip Indicators Library, which will provide similar functionality (see [#708](https://github.com/askmike/gekko/issues/708)).
|
||||
#### For advanced users only: As a temporary workaround until [#708](https://github.com/askmike/gekko/issues/708) is implemented, TA-lib can be used on Windows through Bash on Windows 10. See "Installing Gekko on Windows with bash on Windows 10"
|
||||
|
||||
Here is a youtube video I made that shows exactly how to set up Gekko:
|
||||
|
||||
[](https://www.youtube.com/watch?v=R68IwVujju8)
|
||||
|
||||
To get Gekko running on Windows you need to do the following:
|
||||
|
||||
- install nodejs
|
||||
- download Gekko
|
||||
- install Gekko's dependencies
|
||||
|
||||
## Install nodejs
|
||||
|
||||
Gekko runs on nodejs so we have to install that first. Head over the [nodejs homepage](http://nodejs.org/) and install the LTS version of nodejs.
|
||||
|
||||
## Install Gekko
|
||||
|
||||
The easiest way to download Gekko is to go to the [Github repo](https://github.com/askmike/gekko) and click on the 'zip' button at the top. Once you have downloaded the zip file it's the easiest to extract it. When you have done that we can begin with the cool stuff:
|
||||
|
||||
### Open up command line
|
||||
|
||||
* Start
|
||||
* Type in 'cmd.exe'
|
||||
* Press enter
|
||||
|
||||
### Install dependencies
|
||||
|
||||
(After every command, press enter)
|
||||
|
||||
First navigate to Gekko:
|
||||
|
||||
cd Downloads
|
||||
cd gekko-stable
|
||||
cd gekko-stable
|
||||
|
||||
Install Gekko's dependencies:
|
||||
|
||||
npm install --only=production
|
||||
|
||||
*NOTE: You may see a vulnerability warning from NPM, if you run npm audit with --force, Gekko will break. See [here](https://github.com/askmike/gekko/issues/2585#issuecomment-428450997).*
|
||||
|
||||
Install Gekko Broker's dependencies:
|
||||
|
||||
cd exchange
|
||||
npm install --only=production
|
||||
cd ..
|
||||
|
||||
### Install Tulip Indicators
|
||||
|
||||
If you are using Windows you will need to install python and the VC++ 2015 build tool, the easiest way to do this is through node as an administrator:
|
||||
|
||||
npm install windows-build-tools --global --production
|
||||
|
||||
Once your build tools are installed, or for other operating systems
|
||||
|
||||
npm install tulind --only=production
|
||||
|
||||
### Starting Gekko
|
||||
|
||||
node gekko --ui
|
||||
|
||||
Your browser should automatically open with the UI. If it doesn't, manually browse to [http://localhost:3000](http://localhost:3000).
|
||||
|
||||
### Stopping Gekko
|
||||
|
||||
In the command line hold `ctrl` + `c`.
|
||||
|
||||
### Updating Gekko
|
||||
|
||||
See the [updating Gekko](./updating_gekko.md) doc.
|
||||
@@ -0,0 +1,91 @@
|
||||
# Installing Gekko on Windows with bash on Windows 10
|
||||
|
||||
*NOTE: unfortunately installing and managing Gekko is hard. You will need to touch the commandline and install a few developer tools. I am creating an official Gekko service called [Gekko Plus](https://gekkoplus.com/), it will NOT require any installation.*
|
||||
|
||||
### Note:
|
||||
#### This guide is for advance users only! This is a temporary solution until [#708](https://github.com/askmike/gekko/issues/708) is implemented
|
||||
#### You must be running a 64-bit version of Windows 10 to use Bash on Windows 10
|
||||
#### TA-lib does not support Windows 10, but it can be used on Bash on Windows 10 by following these instructions
|
||||
|
||||
|
||||
## To get Gekko running on Bash on Windows you need to do the following:
|
||||
|
||||
- enable Bash on Windows 10
|
||||
- install nodejs
|
||||
- install git
|
||||
- download and install Gekko and its dependencies
|
||||
- edit the handle.js file
|
||||
- install the correct version of TA-lib
|
||||
|
||||
## Enable Bash on Windows 10
|
||||
|
||||
To install Bash shell on your Windows 10 PC, do the following (see [here](https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10) for more info):
|
||||
|
||||
- Open Settings.
|
||||
- Click on Update & security.
|
||||
- Click on For Developers.
|
||||
- Under "Use developer features", select the Developer mode option to setup the environment to install Bash.
|
||||
- On the message box, click Yes to turn on developer mode.
|
||||
- After the necessary components install, you'll need to restart your computer.
|
||||
- Once your computer reboots, open Control Panel.
|
||||
- Click on Programs.
|
||||
- Click on Turn Windows features on or off.
|
||||
- Check the Windows Subsystem for Linux (beta) option.
|
||||
- Click OK.
|
||||
- Once the components installed on your computer, click the Restart now button to complete the task.
|
||||
|
||||
After your computer restarts, you will notice that Bash will not appear in the "Recently added" list of apps, this is because Bash isn't actually installed yet. Now that you have setup the necessary components, use the following steps to complete the installation of Bash:
|
||||
|
||||
- Open Start, do a search for bash.exe, and press Enter.
|
||||
- On the command prompt, type y and press Enter to download and install Bash from the Windows Store.
|
||||
|
||||
Then you'll need to create a default UNIX user account. This account doesn't have to be the same as your Windows account. Enter the username in the required field and press Enter (you can't use the username "admin"). Close the "bash.exe" command prompt.
|
||||
Now that you completed the installation and setup, you can open the Bash tool from the Start menu like you would with any other app.
|
||||
|
||||
## Install nodejs
|
||||
|
||||
Gekko runs on nodejs so we have to install that first.
|
||||
|
||||
Open up bash and install node.js: (taken from [here](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions))
|
||||
|
||||
```
|
||||
sudo apt-get update
|
||||
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
sudo apt-get install -y build-essential
|
||||
```
|
||||
|
||||
## Install Gekko and its dependencies
|
||||
|
||||
The easiest way to download Gekko is to use Git:
|
||||
|
||||
- Install Git
|
||||
|
||||
`sudo apt-get install git`
|
||||
|
||||
- Download and install gekko in you home directory (/home/yourusername): (taken from [here](https://gekko.wizb.it/docs/installation/installing_gekko.html)):
|
||||
|
||||
```
|
||||
git clone git://github.com/askmike/gekko.git
|
||||
cd gekko
|
||||
npm install --only=production
|
||||
cd exchange
|
||||
npm install --only=production
|
||||
cd ..
|
||||
```
|
||||
|
||||
*NOTE: You may see a vulnerability warning from NPM, if you run npm audit with --force, Gekko will break. See [here](https://github.com/askmike/gekko/issues/2585#issuecomment-428450997).*
|
||||
|
||||
### Starting Gekko
|
||||
|
||||
`node gekko --ui`
|
||||
|
||||
Your browser should automatically open with the UI. If it doesn't, manually browse to [http://localhost:3000](http://localhost:3000).
|
||||
|
||||
### Stopping Gekko
|
||||
|
||||
In bash hold `ctrl` + `c`.
|
||||
|
||||
### Updating Gekko
|
||||
|
||||
See the [updating Gekko](./updating_gekko.md) doc.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Installing Gekko using Docker
|
||||
|
||||
Installing and running gekko in a docker container for use on the same machine is simple with the following commands:
|
||||
|
||||
```
|
||||
$ docker-compose build
|
||||
$ docker-compose up -d
|
||||
```
|
||||
|
||||
You can now find your gekko instance running on `localhost:3000`.
|
||||
|
||||
## Installing for external access
|
||||
|
||||
However if you want to run Gekko on another machine (in the cloud, on a server), you need to specify the host machine and its port like so:
|
||||
|
||||
```
|
||||
$ docker-compose build
|
||||
$ HOST=mydomain.com PORT=3001 docker-compose up -d
|
||||
```
|
||||
|
||||
You can now find your gekko instance running on `mydomain.com:3001`.
|
||||
|
||||
If running behind an SSL-terminating proxy, make sure to set `USE_SSL=1` to tell the Gekko to use the HTTPS and WSS protocols instead of the default HTTP and WS protocols.
|
||||
|
||||
To see logs: `docker logs -f gekko_gekko_1`. View which dockers are running by executing `docker ps`.
|
||||
@@ -0,0 +1,42 @@
|
||||
# Updating Gekko
|
||||
|
||||
## Prepare
|
||||
|
||||
Before updating your local version of Gekko it's good to keep a few things in mind:
|
||||
|
||||
- If you have configured a UIconfig (to run Gekko on a server for example) make a copy of the UIconfig file (stored in `gekko/web/vue/dist/`) first and call it something else (such as `my-UIconfig.js`). After that revert the file to it's original state (which can be found in `gekko/web/baseUIconfig.js/`) prior to updating (or git will complain).
|
||||
- Check the changelog (found in the [releases page](https://github.com/askmike/gekko/releases)) for breaking changes) regarding:
|
||||
- (in case you changed the UIconfig) for changes in the UIconfig.
|
||||
- (in case you were using non standard strategies) strategy API, to make sure your strategies will run in the new version.
|
||||
- any other breaking changes specified inside the release log (such as required node and or browser versions).
|
||||
|
||||
## Updating to a new stable release
|
||||
|
||||
Run the following commands inside the Gekko directory:
|
||||
|
||||
git checkout stable
|
||||
git pull
|
||||
npm install --only=production
|
||||
cd exchange
|
||||
npm install --only=production
|
||||
cd ..
|
||||
|
||||
## Updating the develop branch
|
||||
|
||||
The develop branch contains the most recent code as we are working on Gekko. In most scenarios this should considered less stable. But note that once a bug is found and fixed the fixes are applied here immediately while it takes the release of a new version to have these changes available in the stable branch.
|
||||
|
||||
git checkout develop
|
||||
git pull
|
||||
npm install --only=production
|
||||
cd exchange
|
||||
npm install --only=production
|
||||
cd ..
|
||||
|
||||
### Compiling the frontend on the develop branch
|
||||
|
||||
If you are using the UI and it changed since the latest release you need to manually recompile it since (as of v0.6.2) Gekko only ships compiled frontends with new releases.
|
||||
|
||||
cd web/vue
|
||||
npm install
|
||||
npm run build
|
||||
cd ../..
|
||||
Reference in new issue
Block a user