Skip to content

Commit

Permalink
#116 No more install in Docker entrypoint, #114 Correct volumes config,
Browse files Browse the repository at this point in the history
#109 Use workers to import, #113 Fix, #85 More Observables types
  • Loading branch information
Samuel Hassine committed Jul 5, 2019
1 parent a932d0b commit 8854c25
Show file tree
Hide file tree
Showing 36 changed files with 807 additions and 196 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<a href="https://www.opencti.io" alt="Website"><img src="https://img.shields.io/badge/website-opencti.io-blue.svg" /></a>
<a href="https://circleci.com/gh/OpenCTI-Platform/opencti" alt="CICD"><img src="https://circleci.com/gh/OpenCTI-Platform/opencti.svg?style=shield" /></a>
<a href="https://github.com/OpenCTI-Platform/opencti/releases/latest" alt="Releases"><img src="https://img.shields.io/github/release/OpenCTI-Platform/opencti.svg" /></a>
<a href="https://slack.luatix.org" alt="Releases"><img src="https://slack.luatix.org/badge.svg" /></a>
<a href="https://slack.luatix.org" alt="Slack"><img src="https://slack.luatix.org/badge.svg" /></a>
</p>


Expand Down
Empty file removed opencti-docker/config/.config
Empty file.
35 changes: 22 additions & 13 deletions opencti-docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,30 @@ services:
ports:
- 48555:48555
volumes:
- ./volumes/grakndata:/grakn-core-all-linux/server/db
- grakndata:/grakn-core-all-linux/server/db
restart: always
redis:
image: redis
restart: always
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.7.1
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- ./volumes/esdata:/usr/share/elasticsearch/data
- esdata:/usr/share/elasticsearch/data
restart: always
rabbitmq:
image: rabbitmq
image: rabbitmq:management
restart: always
worker:
image: opencti/worker
environment:
- OPENCTI_HOSTNAME=opencti
- OPENCTI_PORT=8080
- RABBITMQ_HOSTNAME=rabbitmq
- RABBITMQ_PORT=5672
- RABBITMQ_USERNAME=guest
- RABBITMQ_PASSWORD=guest
volumes:
- "./config:/opt/opencti/shared_config:rw"
- config:/opt/opencti/shared_config:rw
depends_on:
- opencti
restart: always
Expand All @@ -41,8 +37,12 @@ services:
environment:
- OPENCTI_HOSTNAME=opencti
- OPENCTI_PORT=8080
- RABBITMQ_HOSTNAME=rabbitmq
- RABBITMQ_PORT=5672
- RABBITMQ_USERNAME=guest
- RABBITMQ_PASSWORD=guest
volumes:
- "./config:/opt/opencti/shared_config:rw"
- config:/opt/opencti/shared_config:rw
depends_on:
- opencti
restart: always
Expand All @@ -64,13 +64,22 @@ services:
- ELASTICSEARCH__PORT=9200
- RABBITMQ__HOSTNAME=rabbitmq
- RABBITMQ__PORT=5672
- RABBITMQ__PORT_MANAGEMENT=15672
- RABBITMQ__MANAGEMENT_SSL=false
- RABBITMQ__USERNAME=guest
- RABBITMQ__PASSWORD=guest
ports:
- "8080:8080"
volumes:
- "./config:/opt/opencti/shared_config:rw"
- config:/opt/opencti/shared_config:rw
depends_on:
- grakn
- redis
- elasticsearch
- rabbitmq
restart: always

volumes:
grakndata:
esdata:
config:
10 changes: 8 additions & 2 deletions opencti-docker/integration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade && apt-g
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python3 python3-pip curl rsyslog wget netcat locales

# Download archive
RUN wget -O /opt/opencti.tar.gz https://releases.opencti.io/opencti-20190702.tar.gz
RUN wget -O /opt/opencti.tar.gz https://releases.opencti.io/opencti-20190704.tar.gz
RUN cd /opt && tar xvfz opencti.tar.gz

# Set the locale
Expand All @@ -20,7 +20,13 @@ ENV LC_ALL en_US.UTF-8
# Prepare configuration
RUN cd /opt/opencti/integration && rm -f config.yml && ln -s /opt/opencti/shared_config/config_integration.yml config.yml

# Install Python modules
RUN cd /opt/opencti/integration && pip3 install -r requirements.txt

# Install Python modules of each connectors
RUN cd /opt/opencti/integration && find connectors -name requirements.txt -exec pip3 install -r {} \;

# Expose and entrypoint
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]
11 changes: 4 additions & 7 deletions opencti-docker/integration/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
# Start log
/etc/init.d/rsyslog start

# Install Python modules
cd /opt/opencti/integration
pip3 install -r requirements.txt

# Install Python modules of each connectors
find connectors -name requirements.txt -exec pip3 install -r {} \;

# Check configuration
while [ ! -f /opt/opencti/shared_config/token ]
do
Expand All @@ -28,6 +21,10 @@ cp config.yml.docker.sample config.yml.sample
sed -i -e "s/REPLACE_API_KEY/$(cat /opt/opencti/shared_config/token)/g" config.yml.sample
sed -i -e "s/OPENCTI_HOSTNAME/${OPENCTI_HOSTNAME}/g" config.yml.sample
sed -i -e "s/OPENCTI_PORT/${OPENCTI_PORT}/g" config.yml.sample
sed -i -e "s/RABBITMQ_HOSTNAME/${RABBITMQ_HOSTNAME}/g" config.yml.sample
sed -i -e "s/RABBITMQ_PORT/${RABBITMQ_PORT}/g" config.yml.sample
sed -i -e "s/RABBITMQ_USERNAME/${RABBITMQ_USERNAME}/g" config.yml.sample
sed -i -e "s/RABBITMQ_PASSWORD/${RABBITMQ_PASSWORD}/g" config.yml.sample
cp config.yml.sample /opt/opencti/shared_config/config_integration.yml

# Start
Expand Down
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions opencti-docker/worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ ENV LC_ALL en_US.UTF-8
# Prepare configuration
RUN cd /opt/opencti/worker && rm -f config.yml && ln -s /opt/opencti/shared_config/config_worker.yml config.yml

# Install Python modules
RUN cd /opt/opencti/worker && pip3 install -r requirements.txt

# Expose and entrypoint
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
Expand Down
12 changes: 8 additions & 4 deletions opencti-docker/worker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
# Start log
/etc/init.d/rsyslog start

# Install Python modules
cd /opt/opencti/worker
pip3 install -r requirements.txt

# Check configuration
while [ ! -f /opt/opencti/shared_config/token ]
do
Expand All @@ -26,9 +22,17 @@ sed -i -e "s/REPLACE_API_KEY/$(cat /opt/opencti/shared_config/token)/g" config.y
sed -i -e "s/OPENCTI_HOSTNAME/${OPENCTI_HOSTNAME}/g" config.yml.sample
sed -i -e "s/OPENCTI_PORT/${OPENCTI_PORT}/g" config.yml.sample
sed -i -e "s/RABBITMQ_HOSTNAME/${RABBITMQ_HOSTNAME}/g" config.yml.sample
sed -i -e "s/RABBITMQ_PORT/${RABBITMQ_PORT}/g" config.yml.sample
sed -i -e "s/RABBITMQ_USERNAME/${RABBITMQ_USERNAME}/g" config.yml.sample
sed -i -e "s/RABBITMQ_PASSWORD/${RABBITMQ_PASSWORD}/g" config.yml.sample
cp config.yml.sample /opt/opencti/shared_config/config_worker.yml

# Start
cd /opt/opencti/worker
python3 worker_import.py &
python3 worker_import.py &
python3 worker_import.py &
python3 worker_import.py &
python3 worker_import.py &
python3 worker_export.py &
python3 worker_export.py
6 changes: 3 additions & 3 deletions opencti-documentation/website/core/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ class Footer extends React.Component {
</a>
<div>
<h5>Docs</h5>
<a href={this.docUrl('installation/installation-docker')}>
<a href={this.docUrl('installation/docker')}>
Install using Docker
</a>
<a href={this.docUrl('usage/usage-introduction')}>
<a href={this.docUrl('usage/overview')}>
Usage introduction
</a>
<a href={this.docUrl('development/development-docker')}>
<a href={this.docUrl('development/installation')}>
Development environment
</a>
</div>
Expand Down
26 changes: 13 additions & 13 deletions opencti-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"author": "Luatix",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@date-io/moment": "^1.3.6",
"@material-ui/core": "^4.1.1",
"@material-ui/icons": "^4.2.0",
"@material-ui/lab": "^4.0.0-alpha.16",
"@date-io/moment": "^1.3.8",
"@material-ui/core": "^4.1.3",
"@material-ui/icons": "^4.2.1",
"@material-ui/lab": "^4.0.0-alpha.18",
"@material-ui/pickers": "^3.1.2",
"apollo-link": "^1.2.12",
"apollo-link-ws": "^1.0.18",
Expand All @@ -16,14 +16,14 @@
"countdown": "^2.6.0",
"dagre": "^0.8.4",
"formik": "^1.5.7",
"formik-material-ui": "^0.0.18",
"graphql": "^14.3.1",
"formik-material-ui": "^0.0.19",
"graphql": "^14.4.1",
"http-proxy-middleware": "^0.19.1",
"js-cookie": "^2.2.0",
"js-file-download": "^0.4.7",
"jsonwebtoken": "^8.5.1",
"lodash": "^4.17.11",
"mdi-material-ui": "^6.0.0",
"mdi-material-ui": "^6.1.0",
"moment": "^2.24.0",
"moment-timezone": "^0.5.25",
"object-hash": "^1.3.1",
Expand All @@ -35,18 +35,18 @@
"react-dom": "^16.8.6",
"react-grid-layout": "^0.16.6",
"react-intl": "^2.9.0",
"react-markdown": "^4.0.8",
"react-markdown": "^4.1.0",
"react-particles-js": "^2.6.0",
"react-relay": "^4.0.0",
"react-relay-network-modern": "^3.0.3",
"react-router-dom": "^5.0.0",
"react-relay": "^5.0.0",
"react-relay-network-modern": "^4.0.2",
"react-router-dom": "^5.0.1",
"react-scripts": "^3.0.1",
"react-select": "^3.0.4",
"react-virtualized": "^9.21.1",
"react-window-dimensions": "^1.0.2",
"recharts": "^1.6.2",
"relay-compiler": "^4.0.0",
"relay-runtime": "^4.0.0",
"relay-compiler": "^5.0.0",
"relay-runtime": "^5.0.0",
"rxjs": "^6.5.2",
"storm-react-diagrams": "^5.2.1",
"subscriptions-transport-ws": "^0.9.16",
Expand Down
Loading

0 comments on commit 8854c25

Please sign in to comment.