A stock- and social sentiment simulator required for Cyber Ranges.
Note: We use Yarn instead of NPM so make sure you have it installed before following any of the steps below:
$ npm install -g yarn
- Install CouchDB or use Cloudant on IBM Cloud
- Create a new database called "rangefeed2"
- Create a new database called "tweets"
- Create a new DB user
- Make your new user a member of the 2 DBs you created in step 2 and 3
- Put the hostname where your DB is located into src/dbconfig.js
- Enable CORS on your DB instance
If you are running your DB instance on a different domain compared to your app instance you need to enable CORS. In the following replace 127.0.0.1 with the IP address of your CouchDB instance. For enhanced security you want to set the origins value to the domain where your Rangefeed2 app instance is running on instead of the wildcard *. Then run each curl command one by one.
If you are using Cloudant then these commands will not work. You will have to log into your IBM Cloud console and configure CORS from there via the UI.
curl -X PUT http://127.0.0.1:5984/_node/_local/_config/httpd/enable_cors -d '"true"'
curl -X PUT http://127.0.0.1:5984/_node/_local/_config/cors/origins -d '"*"'
curl -X PUT http://127.0.0.1:5984/_node/_local/_config/cors/credentials -d '"true"'
curl -X PUT http://127.0.0.1:5984/_node/_local/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT http://127.0.0.1:5984/_node/_local/_config/cors/headers -d '"accept, authorization, content-type, origin, referer, x-csrf-token"'
curl -X PUT http://127.0.0.1:5984/_node/_local/_config/httpd/enable_cors -d '"true"'
curl -X PUT http://127.0.0.1:5984/_node/_local/_config/chttpd/bind_address -d '"0.0.0.0"'
- Put in profile pictures with file names 0.jpeg, 1.jpeg, 2.jpeg etc. into the faces folder
- Rename tweets.example.json to tweets.json
- Fill tweets.json with messages according to your preference
$ yarn
$ yarn start
$ yarn run build
The build will be copied to the folder build. You can deploy the content to a web server like NGINX or Apache. Alternatively you can also use Docker.
$ yarn run dstop
$ yarn run dclear
$ yarn run dbuild
Deploy your Docker image on your Kubernetes or OpenShift cluster.
$ yarn run drun
$ yarn run tar
To load the tarball to a Docker runtime do:
$ docker load --input rangefeed2.tar