-
Notifications
You must be signed in to change notification settings - Fork 976
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[documentation] Adjust NodeJS version & Grakn version
- Loading branch information
Samuel Hassine
committed
Dec 7, 2019
1 parent
565dcda
commit eb1da22
Showing
9 changed files
with
270 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...i-documentation/website/versioned_docs/version-2.1.1/clients/python/overview.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
id: version-2.1.1-overview | ||
title: OpenCTI Python client | ||
sidebar_label: Overview | ||
original_id: overview | ||
--- | ||
|
||
The `pycti` library is designed to help OpenCTI users and developers to programatically interact with the GraphQL API. It has been architectured to be easy to use and easy to maintain. The Python library requires Python >= 3. Let's get started. | ||
|
||
## Installation | ||
|
||
```bash | ||
$ pip install pycti | ||
``` | ||
|
||
## Getting started | ||
|
||
### Initialization | ||
|
||
The main class contains all what you need to interact with the platform, you just have to initialize it: | ||
|
||
```python | ||
# coding: utf-8 | ||
|
||
from pycti import OpenCTIApiClient | ||
|
||
# OpenCTI initialization | ||
opencti_api_client = OpenCTIApiClient(api_url, api_token, log_level, ssl_verify) | ||
``` | ||
|
||
| Argument | Type | Description | | ||
| -------------------------- | ------------------ | --------------------------------------------------------------------| | ||
| api_url (*required*) | String | The URL of the OpenCTI instance | | ||
| api_token (*required*) | String | The OpenCTI token | | ||
| log_level (*optional*) | String | Log level, could be 'debug', 'info', 'warning' or 'error' | | ||
| ssl_verify (*optional*) | Boolean | Enable or disable the SSL certificate verification | |
137 changes: 137 additions & 0 deletions
137
...-documentation/website/versioned_docs/version-2.1.1/development/installation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
--- | ||
id: version-2.1.1-installation | ||
title: Development environment installation | ||
sidebar_label: Development environment | ||
original_id: installation | ||
--- | ||
|
||
## Prerequisites | ||
|
||
- Docker | ||
- Node.JS (>= 12.* < 13.0.0) | ||
- Python (>= 3) | ||
- Yarn (>= 1.16) | ||
|
||
### Installation of dependencies (Ubuntu 18.04) | ||
|
||
```bash | ||
$ sudo apt-get install nodejs python3 python3-pip | ||
$ sudo curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | ||
$ sudo echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | ||
$ sudo apt-get update && sudo apt-get install yarn | ||
``` | ||
|
||
### Docker stack | ||
|
||
As OpenCTI has a dependency to ElasticSearch, you have to set the *vm.max_map_count* before running the containers, as mentioned in the [ElasticSearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run-prod-mode). | ||
|
||
```bash | ||
$ sysctl -w vm.max_map_count=262144 | ||
``` | ||
|
||
Clone the latest version of the dev docker compose and start | ||
|
||
```bash | ||
$ git clone https://github.com/OpenCTI-Platform/docker.git | ||
$ cd docker | ||
$ docker-compose -f ./docker-compose-dev.yml up -d | ||
``` | ||
|
||
## Clone the project | ||
|
||
```bash | ||
$ git clone https://github.com/OpenCTI-Platform/opencti.git | ||
$ cd opencti | ||
``` | ||
|
||
## Application dependencies | ||
|
||
### Install the API dependencies | ||
|
||
```bash | ||
$ cd opencti-platform/sopencti-graphql | ||
$ yarn install | ||
``` | ||
|
||
### Install the frontend dependencies | ||
```bash | ||
$ cd ../opencti-front | ||
$ yarn install | ||
``` | ||
|
||
### Install the worker dependencies | ||
|
||
```bash | ||
$ cd ../../opencti-worker | ||
$ pip3 install -r requirements.txt | ||
``` | ||
|
||
## Config and run | ||
|
||
### GraphQL API | ||
|
||
#### Configure | ||
|
||
```bash | ||
$ cp config/default.json config/development.json | ||
``` | ||
By default the configuration match the docker stack configuration. | ||
You just need to change the user part: | ||
```bash | ||
"admin": { | ||
"email": "[email protected]", | ||
"password": "ChangeMe", | ||
"token": "ChangeMe" | ||
} | ||
``` | ||
|
||
#### Start | ||
|
||
```bash | ||
$ cd opencti-graphql | ||
$ yarn start | ||
``` | ||
|
||
The first execution will create and migrate the schema. | ||
|
||
### Worker | ||
|
||
#### Configure | ||
|
||
```bash | ||
$ cd opencti-worker | ||
$ cp config.yml.sample config.yml | ||
``` | ||
Change the *config.yml* file according to your <admin token> | ||
|
||
#### Start | ||
|
||
```bash | ||
$ python3 worker.py & | ||
``` | ||
|
||
### Frontend | ||
|
||
#### Start | ||
|
||
```bash | ||
$ cd opencti-frontend | ||
$ yarn start | ||
``` | ||
|
||
## Build for production use | ||
|
||
### Build the application | ||
|
||
```bash | ||
$ cd opencti-frontend | ||
$ yarn build | ||
$ cd ../opencti-graphql | ||
$ yarn build | ||
``` | ||
|
||
### Start the production package | ||
|
||
```bash | ||
$ yarn serv | ||
``` |
89 changes: 89 additions & 0 deletions
89
opencti-documentation/website/versioned_docs/version-2.1.1/installation/manual.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
id: version-2.1.1-manual | ||
title: Manual installation | ||
sidebar_label: Manual deployment | ||
original_id: manual | ||
--- | ||
|
||
## Prerequisites | ||
|
||
- Node.JS (>= 12.* < 13.0.0) | ||
- Grakn (== 1.5.9) | ||
- Redis (>= 3.0) | ||
- ElasticSearch (>= 7.5) | ||
- Minio (>= 20191012) | ||
- RabbitMQ (>= 3.7) | ||
|
||
## Prepare the installation | ||
|
||
### Installation of dependencies | ||
|
||
You have to install all the needed dependencies for the main application and the workers. The example below if for Ubuntu: | ||
|
||
```bash | ||
$ sudo apt-get install nodejs npm python3 python3-pip | ||
``` | ||
|
||
### Download the application files | ||
|
||
Download and extract the latest release file. | ||
|
||
```bash | ||
$ mkdir /path/to/your/app && cd /path/to/your/app | ||
$ wget https://github.com/OpenCTI-Platform/opencti/releases/download/{RELEASE_VERSION}/opencti-release-{RELEASE_VERSION}.tar.gz | ||
$ tar xvfz opencti-release-{RELEASE_VERSION}.tar.gz | ||
``` | ||
|
||
## Install the main platform | ||
|
||
### Configure the application | ||
|
||
The main application has just one JSON configuration file to change. | ||
|
||
```bash | ||
$ cd opencti | ||
$ cp config/default.json config/production.json | ||
``` | ||
|
||
Change the *config/production.json* file according to your configuration of Grakn, Redis, ElasticSearch, RabbitMQ and default credentials (the `ADMIN_TOKEN` must be a [valid UUID](https://www.uuidgenerator.net/)). | ||
|
||
### Start the application | ||
|
||
The application is just a NodeJS process, the creation of the database schema and the migration will be done at starting. | ||
|
||
```bash | ||
$ node dist/server.js & | ||
``` | ||
|
||
The default username and password are those you put in the `config/production.json` file. | ||
|
||
## Install the worker | ||
|
||
The OpenCTI worker is used to write the data coming from the RabbitMQ messages broker. | ||
|
||
#### Configure the worker | ||
|
||
```bash | ||
$ cd worker | ||
$ pip3 install -r requirements.txt | ||
$ cp config.yml.sample config.yml | ||
``` | ||
|
||
Change the *config.yml* file according to your OpenCTI token. | ||
|
||
#### Start as many workers as you need | ||
```bash | ||
$ python3 worker.py & | ||
$ python3 worker.py & | ||
``` | ||
|
||
## Upgrade the platform | ||
|
||
When upgrading the platform, you have to replace all files and run the migrations and the schema commands to get updates: | ||
|
||
```bash | ||
$ npm run schema | ||
$ npm run migrate | ||
``` | ||
|
||
Then start the platform. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[ | ||
"2.1.1", | ||
"2.1.0", | ||
"2.0.0", | ||
"1.1.2", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters