Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Fix for 1 vulnerabilities #53

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e8a5285
Add license scan report and status
fossabot Jan 15, 2020
a62de7b
Add .whitesource configuration file
mend-bolt-for-github[bot] Sep 16, 2020
a885c33
fix: package.json to reduce vulnerabilities
snyk-bot Aug 16, 2020
c075d10
fix: package.json to reduce vulnerabilities
snyk-bot Jul 1, 2020
4922479
fix: package.json to reduce vulnerabilities
snyk-bot Nov 12, 2020
c23e786
fix: package.json to reduce vulnerabilities
snyk-bot Nov 24, 2020
7fdea3c
fix: upgrade request from 2.16.6 to 2.88.2
snyk-bot Nov 24, 2020
84829fc
fix: upgrade moment from 2.3.1 to 2.29.1
snyk-bot Nov 24, 2020
aa6a56d
fix: upgrade cron from 1.0.3 to 1.8.2
snyk-bot Nov 24, 2020
d746fb5
fix: package.json to reduce vulnerabilities
snyk-bot Nov 25, 2020
d61bcce
Merge pull request #8 from cniweb/snyk-fix-378ca0a13172bd74ba37e3d031…
cniweb Dec 8, 2020
34b397c
Merge pull request #9 from cniweb/snyk-fix-b28a15ffb8f95edc6111824a59…
cniweb Dec 8, 2020
b40f7c7
Merge pull request #10 from cniweb/snyk-upgrade-80b6ea54231c93cd05a8f…
cniweb Dec 8, 2020
3abf427
Merge pull request #11 from cniweb/snyk-upgrade-d573437009db2881bf714…
cniweb Dec 8, 2020
cb6c551
Merge pull request #13 from cniweb/snyk-upgrade-77174b86645c3b6832834…
cniweb Dec 8, 2020
046f2b2
fix: package.json to reduce vulnerabilities
snyk-bot Dec 8, 2020
ed81aff
Merge pull request #14 from cniweb/snyk-fix-55f36a84378e24cf11d803ef6…
cniweb Dec 8, 2020
0c9bf2b
fix: package.json to reduce vulnerabilities
snyk-bot Dec 8, 2020
08ad07d
fix: package.json to reduce vulnerabilities
snyk-bot Dec 8, 2020
53774b2
Merge pull request #16 from cniweb/snyk-fix-ae0e1fe77fa5caf412b2b5c0f…
cniweb Dec 8, 2020
51bb577
Merge pull request #15 from cniweb/snyk-fix-6def5b1ddb994175a01243f9c…
cniweb Dec 8, 2020
329c22c
fix: package.json to reduce vulnerabilities
snyk-bot Dec 8, 2020
0528a9d
fix: package.json to reduce vulnerabilities
snyk-bot Dec 8, 2020
addc9e9
Merge pull request #23 from cniweb/snyk-fix-ff802582e3a52742b26659df2…
cniweb Dec 8, 2020
41c0978
Merge pull request #18 from cniweb/snyk-fix-a1ce1c7f6175af74cb5296a01…
cniweb Dec 8, 2020
2aaafd2
Merge pull request #22 from cniweb/snyk-fix-de7eeb28df32c777d7edcded8…
cniweb Dec 8, 2020
8aee489
fix: package.json to reduce vulnerabilities
snyk-bot Dec 8, 2020
dfe6bd4
Merge pull request #24 from cniweb/snyk-fix-f79ced84b7d181264636d1ff2…
cniweb Dec 8, 2020
4870269
fix: package.json to reduce vulnerabilities
snyk-bot Dec 8, 2020
cff45b0
Merge pull request #25 from cniweb/snyk-fix-aba4ada06f24ab22fcdb7bcc3…
cniweb Dec 8, 2020
d67ee94
fix: upgrade jquery from 1.8.3 to 1.12.4
snyk-bot Dec 9, 2020
7a971e0
Merge pull request #26 from cniweb/snyk-upgrade-e3abd5ca341a36f423002…
cniweb Dec 9, 2020
5081b35
fix: upgrade cron from 1.0.3 to 1.8.2
snyk-bot Dec 10, 2020
a4152f1
fix: upgrade timezone from 0.0.23 to 0.0.48
snyk-bot Dec 10, 2020
90cc3b2
fix: upgrade socket.io from 1.3.7 to 1.7.4
snyk-bot Dec 10, 2020
86621ad
fix: upgrade oauth2orize from 1.0.1 to 1.11.0
snyk-bot Dec 10, 2020
2c1a199
fix: upgrade express-form from 0.8.1 to 0.12.6
snyk-bot Dec 10, 2020
85f1170
fix: package.json to reduce vulnerabilities
snyk-bot Dec 13, 2020
b0dd039
Merge pull request #27 from cniweb/snyk-upgrade-d473a40f8610bb2688307…
cniweb Dec 14, 2020
ca8bf29
Merge pull request #28 from cniweb/snyk-upgrade-24c0f6676e4553645e168…
cniweb Dec 14, 2020
e44e07e
Merge pull request #29 from cniweb/snyk-upgrade-4c2bde8f6dd32d47da460…
cniweb Dec 14, 2020
1a7e03e
Merge pull request #30 from cniweb/snyk-upgrade-169a26a2631be66816d21…
cniweb Dec 14, 2020
dc042d8
Merge pull request #31 from cniweb/snyk-upgrade-78c2fb680795a3d9e4093…
cniweb Dec 14, 2020
5123eda
Merge pull request #32 from cniweb/snyk-fix-6633aeb9ba12bc1f4dceeac12…
cniweb Dec 14, 2020
b481a1b
fix: package.json to reduce vulnerabilities
snyk-bot Apr 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scanSettings": {
"baseBranches": []
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure",
"displayMode": "diff"
},
"issueSettings": {
"minSeverityLevel": "LOW"
}
}
148 changes: 21 additions & 127 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ provides an OAuth2 application enablement.


![FunctionalArchitecture](/docs/FunctionalArchitecture_openHAB-cloud_v1.0.png)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fcniweb%2Fopenhab-cloud.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fcniweb%2Fopenhab-cloud?ref=badge_shield)



Expand All @@ -24,12 +25,14 @@ openHAB Cloud is mainly based on the following frameworks and technologies:


* [Node.js](https://nodejs.org/en/) - Server-side Javascript-framework
* [Express.js](http://expressjs.com/) - Web application framework for Node.js
* [Express.js](http://redis.io) - Web application framework for Node.js
* [Nginx](https://www.nginx.com/resources/wiki/) - Web server & reverse proxy
* [MongoDB](https://www.mongodb.com/) - NoSQL database
* [redis](http://redis.io) - Session Manager & data structure server
* [Socket.IO](http://socket.io/) - Bi-directional communication between web clients and servers

Note:
At the moment openHAB Cloud needs a specific version (0.10.48) of Node.js installed. You can install [Node Version Manager](https://github.com/creationix/nvm) locally to manage the needed Node.js version.

### <a name="quickStart"></a> Quick start ###

Expand All @@ -44,10 +47,10 @@ sudo apt-get update
sudo apt-get upgrade
```

We need to install redis, mongoDB, Nginx and Python:
We need to install redis, mongoDB and Nginx:

```
sudo apt-get install build-essential redis-server mongodb nginx python
sudo apt-get install build-essential redis-server mongodb nginx
```

Now you need install git and clone the openHAB Cloud repository to your
Expand All @@ -60,7 +63,7 @@ git clone https://github.com/openhab/openhab-cloud.git
```


Clone the openhab-cloud repository and after the completed checkout you should have the directory in your chosen folder:
Clone the openhabcloud repository and after the completed checkout you should have the directory in your chosen folder:
```
ls -al
total 32
Expand All @@ -69,25 +72,16 @@ drwxr-xr-x 3 root root 4096 Jun 4 12:34 ..
-rw-r--r-- 1 ubuntu ubuntu 220 Apr 9 2014 .bash_logout
-rw-r--r-- 1 ubuntu ubuntu 3637 Apr 9 2014 .bashrc
drwx------ 2 ubuntu ubuntu 4096 Jun 4 16:30 .cache
drwxr-xr-x 13 root root 4096 Jun 4 17:06 openhab-cloud
drwxr-xr-x 13 root root 4096 Jun 4 17:06 openhabcloud
-rw-r--r-- 1 ubuntu ubuntu 675 Apr 9 2014 .profile
drwx------ 2 ubuntu ubuntu 4096 Jun 4 12:34 .ssh
```


Now we need to change into the openhab-cloud directory and check if node is installed:

```
node --version
```


If you see the node version, you are fine to continue (Note: openHAB Cloud is based on Node.js version 7.10.1).

To run openHAB Cloud you need to install the required software bundles/stacks:

```
cd openhab-cloud
cd openhabcloud
```
```
npm install
Expand All @@ -97,6 +91,15 @@ and all the module dependencies from **package.json** will be resolved and neede



Now we need to change into the openhabcloud directory and check if node is installed:

```
ls -al
node --version
```


If you see the node version, you are fine to continue.



Expand All @@ -110,12 +113,6 @@ redis-cli ping
```
Redis will answer with PONG if all is fine.

In the next step you have to rename the system configuration file:
```
config-production.json -> config.json
```
Adjust the config parameters according your setup
(Note: MongoDB username and password fields should be deleted, if there is no authentication activated).

Now you can run openHAB Cloud by the following command:
```
Expand Down Expand Up @@ -189,9 +186,6 @@ location /fonts {
location /js-plugin {
alias /home/ubuntu/openhabcloud/public/js-plugin;
}
location /staff/js-plugin {
alias /home/ubuntu/openhabcloud/public/js-plugin;
}
location /downloads {
alias /home/ubuntu/openhabcloud/public/downloads;
}
Expand Down Expand Up @@ -224,99 +218,6 @@ You need to restart nginx:
sudo service nginx restart
```

## <a name="docker"></a> Docker ###

The section describes how the openHAB-cloud docker images can be used with docker-compose
to spin up the dockerized openhab-cloud backend.


#### Architecture
The dockerized openhab-cloud uses a separate docker image and container for each part of the overall system
according to the following stack:
* app-1: node.js and express.js (openhab/openhab-cloud/app-1:latest)
* mongodb: MongoDB database (bitnami/mongodb:latest)
* nginx: nginx proxy (openhab/openhab-cloud/nginx:latest)
* redis: redis session manager (bitnami/redis:latest)

#### Prerequisites
To run openhab-cloud make sure docker, docker-machine and docker-compose are installed on your machine.
More information at [Docker's website](https://docs.docker.com/)

#### Configuration
You need to modify the ```config.json``` and adjust the hosts of mongodb and redis to match to the corresponding
container services of docker-compose:
```
"mongodb": {
"hosts": ["mongodb"],
"db": "openhab",
"user": "",
"password": ""
},
"redis": {
"host": "redis",
"port": "6379",
"password": "password"
},
```

To change the server IP/DNS matching your installation, please refer to [Setting up Nginx](#setupNginx)

#### Customization

If you want to customize the openhab-cloud app or change e.g. configurations within ```config.json```,
you need to switch to the local build of the node app. Adjust the build stratgy in the ```docker-compose.yml```
and replace the ```image``` section of ```docker-compose.yml``` with the following lines, to not use the official docker hub images anymore and switch to your local sources as base for the app-1 image:

```build:
context: ./
dockerfile: ./docker/node/Dockerfile
```

#### Run
To create and run the composed application, use the following command:
```
docker-compose up -d
```
or with forced recreate:
```
docker-compose up -d --force-recreate
```

#### Logs

To make sure openhab-cloud is running, check the openhab-cloud app logs:
```
docker-compose logs app-1
```

#### Stop & Cleanup

To stop and remove the openhab-cloud containers, use the following commands of docker-compose:
```
docker-compose stop
docker-compose rm
```

To perform a reset of the complete setup you can additionally stop all docker containers and remove
the related images and volumes by the following commands:
```
docker stop $(docker ps -a -q)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls |awk '{print $2}')
```
You can also use this command to delete all:
```
docker system prune
```

#### Access

Navigate your browser to ```http://<your-openhab-cloud-host>:<port>``` and log in (e.g. http://localhost:80)

#### Limitations
* Lets Encrypt SSL is missing in the images and will be added soon
* The nginx configuration at /etc/nginx_openhabcloud.conf will be reused



## Installing openHAB Cloud on Amazon Web Services (AWS) ##
Expand Down Expand Up @@ -478,13 +379,6 @@ http://YOUR-AWS-EC2-PUBLIC-DNS

You should be ready with your openHAB Cloud installation!

# Release-Notes
## 1.0.5
* When upgrading from older versions, please run the `./scripts/deleteDuplicateUserDevices.js`
script, start openhab-cloud once (and shut it down again) and then execute the following
statement in your MongoDB collection:
```
use <YOUR_DB>
db.userdevices.reIndex()
```
This is necessary to ensure a unique index on the collection.

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fcniweb%2Fopenhab-cloud.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fcniweb%2Fopenhab-cloud?ref=badge_large)
133 changes: 50 additions & 83 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,85 +1,52 @@
{
"name": "openhabcloud",
"description": "openHAB cloud service",
"version": "1.0.10",
"private": true,
"scripts": {
"start": "node app.js",
"test": "nyc --reporter=html mocha tests/mocha/unit/**/*.js --recursive",
"integration_tests": "node tests/ohc_simulator_docker.js & mocha tests/mocha/integration/*.js"
},
"dependencies": {
"apn": "1.7.6",
"bcrypt-cache": "^1.0.2",
"bcrypt": "1.0.2",
"body-parser": "^1.17.2",
"chokidar": "0.6.2",
"connect-flash": "0.1.1",
"connect-mongodb": "1.1.5",
"connect-redis": "3.1.0",
"cookie-parser": "^1.4.3",
"cron": "1.0.3",
"csurf": "^1.9.0",
"ejs": "2.5.5",
"ejs-locals": "1.0.2",
"email-templates": "3.3.2",
"errorhandler": "^1.5.0",
"express": "^4.16.4",
"express-form": "0.12.6",
"express-session": "^1.15.3",
"firebase-messaging": "^1.0.6",
"heapdump": "0.3.7",
"hiredis": "0.5.0",
"less-middleware": "2.2.0",
"memwatch-next": "0.3.0",
"method-override": "^2.3.9",
"moment": "2.20.1",
"mongoose": "5.7.6",
"mongoose-cache": "0.1.4",
"mongoose-types": "1.0.3",
"morgan": "^1.8.2",
"node-gcm": "0.14.4",
"node-xmpp-client": "3.2.0",
"nodemailer": "4.0.1",
"oauth2orize": "^1.11.0",
"passport": "0.1.18",
"passport-http": "0.2.2",
"passport-http-bearer": "1.0.1",
"passport-local": "1.0.0",
"passport-oauth2-client-password": "0.1.2",
"ratelimiter": "2.1.3",
"redis": "2.6.2",
"request": "^2.88.0",
"serve-favicon": "^2.4.3",
"serve-static": "^1.12.3",
"socket.io": "1.3.7",
"socket.io-client": "1.1.0",
"socket.io-redis": "0.1.4",
"time": "0.11.4",
"timezone": "0.0.23",
"uuid": "3.0.1",
"winston": "3.0.0",
"winston-daily-rotate-file": "^3.5.1"
},
"devDependencies": {
"chai": "^4.2.0",
"cheerio": "^1.0.0-rc.2",
"docker-compose": "^0.9.2",
"grunt": "^1.0.1",
"grunt-express-server": "^0.5.3",
"grunt-mocha-test": "^0.13.2",
"grunt-qunit-node": "^0.1.0",
"istanbul": "^0.4.5",
"mocha": "^3.5.3",
"node-gyp": "^3.8.0",
"nyc": "^13.1.0",
"qunit": "^2.5.0",
"should": "^11.2.1",
"sinon": "^7.1.1",
"sinon-express-mock": "^2.1.0",
"sinon-mock-server": "^0.4.1",
"sinon-mongoose": "^2.2.1",
"supertest": "^3.0.0",
"supertest-session": "^3.3.0"
}
"name": "openhabcloud",
"description": "openHAB cloud service main package",
"version": "0.0.2",
"private": true,
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "4.16.0",
"ejs": "0.8.4",
"less-middleware": "0.1.11",
"socket.io": "1.7.4",
"socket.io-client": "1.1.0",
"request": "2.88.0",
"mongoose": "5.11.7",
"mongoose-types": "1.0.3",
"passport": "0.1.18",
"passport-local": "1.0.0",
"bcrypt": "5.0.0",
"connect-mongodb": "1.1.5",
"redis": "2.6.2",
"hiredis": "0.4",
"ejs-locals": "1.0.2",
"express-form": "0.12.6",
"connect-flash": "0.1.1",
"chokidar": "0.6.2",
"uuid": "1.4.1",
"node-gcm": "1.0.0",
"winston": "3.3.0",
"nodemailer": "6.4.16",
"connect-redis": "3.1.0",
"email-templates": "2.6.0",
"moment": "2.29.1",
"timezone": "0.0.48",
"time": "0.11.3",
"node-xmpp": "0.8.0",
"cron": "1.8.2",
"apn": "1.7.6",
"oauth2orize": "1.11.0",
"passport-http": "0.2.2",
"passport-oauth2-client-password": "0.1.2",
"passport-http-bearer": "1.0.1",
"socket.io-redis": "5.0.0",
"memwatch": "0.2.2",
"heapdump": "0.3.7",
"socket.io-redis": "1.0.0",
"mongoose-cache": "0.1.4",
"ratelimiter":"2.1.3",
"express-session":"1.14.1"
}
}
2 changes: 1 addition & 1 deletion public/js-plugin/bootstrap-select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
],
"dependencies": {
"jquery": "1.8"
"jquery": "1.12.4"
},
"keywords": []
}