Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 2b2bfca

Browse files
committed
Merge branch 'develop' into cucumber-js
2 parents 63a0466 + b0b0274 commit 2b2bfca

File tree

106 files changed

+1983
-1227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+1983
-1227
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
1. Authenticate '...'
13+
2. Post following data to endpoint '...'
14+
3. See error
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen
18+
19+
**Additional context**
20+
Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ lib-cov
1212

1313
# Coverage directory used by tools like istanbul
1414
coverage
15+
.nyc_output
1516

1617
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
1718
.grunt
@@ -121,3 +122,4 @@ lib/
121122
rethinkdb_data
122123
.env
123124
/config/local.json
125+
package-lock.json

.travis.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,21 @@ jobs:
1818
script: true
1919
- stage: Build and Test
2020
script:
21-
- docker build -t humanconnection/api-feathers:alpha .
21+
- docker build -t humanconnection/api-feathers .
2222
- script:
23-
- cp ./config/local.example.json ./config/local.json
2423
- yarn install --frozen-lockfile --non-interactive
2524
- yarn add codacy-coverage
26-
- rm -Rf tmp
27-
- yarn eslint
2825
- yarn test
29-
- NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha -- test/ --timeout=10000 --exit
3026
- cat ./coverage/lcov.info | codacy-coverage
31-
- rm ./config/local.json
3227

3328
after_success:
3429
- if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_EVENT_TYPE == "push" ]; then
3530
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
31+
docker tag humanconnection/api-feathers humanconnection/api-feathers:alpha;
3632
docker push humanconnection/api-feathers:alpha;
3733
fi
34+
- if [ $TRAVIS_BRANCH == "develop" ] && [ $TRAVIS_EVENT_TYPE == "push" ]; then
35+
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
36+
docker tag humanconnection/api-feathers humanconnection/api-feathers:edge;
37+
docker push humanconnection/api-feathers:edge;
38+
fi

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ENV API_PORT=3030
1818
# start the application in a autohealing cluster
1919
# NOTE: quick fix for server issues, restart api when reaching max of 300 MB Memory Usage (happens in conjunction with 100% CPU Usage)
2020
# TODO: find better way of dealing with that issue
21-
CMD NODE_ENV=production pm2 start server/index.js -n api --attach --max-memory-restart 300M
21+
CMD NODE_ENV=production pm2 start server/index.js -n api --attach --max-memory-restart 1024M
2222
# CMD NODE_ENV=production pm2 start server/index.js -n api -i 2 --attach
2323
# as we have issues with pm2 currently in conjunction with nuxt, we use the standard approach here
2424
# CMD NODE_ENV=production node server/index.js

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<p align="center">
77
<a href="https://travis-ci.org/Human-Connection/API"><img src="https://img.shields.io/travis/Human-Connection/API/master.svg" alt="Build Status"></a>
88
<a href="https://github.com/Human-Connection/WebApp/blob/develop/LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-green.svg" "MIT" /></a>
9+
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2FHuman-Connection%2FAPI?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2FHuman-Connection%2FAPI.svg?type=shield"/></a>
910
</p>
1011

1112
# Human-Connection API
@@ -61,16 +62,18 @@ Getting up and running is as easy as 1, 2, 3, 4 ... 5.
6162
# start mongodb, feathers and seed database
6263
$ yarn dev
6364
$ yarn dev:win if you're on windows
65+
6466
# start mongodb, feathers without seeding the database
6567
$ yarn dev:noseed
68+
6669
# start mongodb, feathers for production
6770
$ yarn start
6871
```
6972
7073
> ##### IMPORTANT for WIN users:
7174
> - make sure you have mongo bin directory added to your PATH
7275
> - if you picked another data directory during mongodb setup make sure
73-
> to change package.json scripts section for key "dev-win" so it points to
76+
> to change package.json scripts section for key "dev:win" so it points to
7477
> the proper path. Otherwise you will get missing data path errors from mongodb.
7578
7679
If you did it right it will seed some fake data for you and downloads some images and avatar for faster development.
@@ -105,9 +108,6 @@ The seeder configuration has two properties:
105108
106109
Simply run `yarn test` and all your tests in the `test/` directory will be run.
107110
108-
> **Note:**
109-
> *At the moment there are some issues with linting while testing, but you can run the tests also with mocha run*
110-
111111
## Scaffolding
112112
113113
Feathers has a powerful command line interface. Here are a few things it can do:
@@ -129,4 +129,6 @@ The HC platform is documented in our [gitbook](https://www.gitbook.com/book/huma
129129
130130
## License
131131
132-
[MIT](https://github.com/Human-Connection/WebApp/blob/develop/LICENSE.md)
132+
Copyright (c) 2018 [Human-Connection.org](https://human-connection.org)
133+
134+
Licensed under the [MIT](https://github.com/Human-Connection/WebApp/blob/develop/LICENSE.md) license.

config/local.example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"seeder": {
1616
"runOnInit": true,
17-
"dropDatabase": true
17+
"dropDatabase": false
1818
},
1919
"defaultEmail": "[email protected]"
2020
}

config/test.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55
"runOnInit": false,
66
"dropDatabase": false
77
},
8+
"smtpConfig": {
9+
"host": "0.0.0.0",
10+
"port": 1025,
11+
"ignoreTLS": true
12+
},
813
"mongodb": "mongodb://localhost:27017/hc_api_test"
914
}

package.json

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
22
"name": "human-connection-api",
33
"description": "Human-Connection API",
4-
"version": "0.1.0",
4+
"version": "0.5.0",
55
"homepage": "https://human-connection.org",
6-
"license": "CC-BY-NC-SA-4.0",
6+
"license": "MIT",
77
"repository": {
88
"type": "git",
99
"url": "https://github.com/Human-Connection/API.git"
1010
},
11-
"main": "server",
12-
"keywords": [
13-
"human-connection",
14-
"social network",
15-
"api",
16-
"feathersjs"
17-
],
1811
"author": {
1912
"name": "Human Connection gGmbH",
2013
"email": "[email protected]"
2114
},
22-
"contributors": [],
2315
"bugs": {
2416
"url": "https://github.com/Human-Connection/API/issues",
2517
"email": "[email protected]"
2618
},
19+
"main": "server",
20+
"keywords": [
21+
"human-connection",
22+
"social network",
23+
"api",
24+
"feathersjs"
25+
],
26+
"contributors": [],
2727
"directories": {
2828
"lib": "server",
2929
"test": "test/"
@@ -34,26 +34,33 @@
3434
},
3535
"scripts": {
3636
"clear": "rm -Rf tmp",
37-
"test": "npm run eslint && npm run mocha && npm run cucumber",
37+
"test": "npm run eslint && cross-env NODE_ENV=test && nyc --reporter=lcovonly --reporter=text-summary npm run mocha && npm run cucumber",
38+
"test:mongo": "npm run eslint && cross-env NODE_ENV=test && nyc --reporter=lcovonly --reporter=text-summary npm run mocha:mongo",
3839
"eslint": "eslint server/. test/. --config .eslintrc.json",
39-
"start": "concurrently 'mongod' 'wait-on tcp:27017 && NODE_ENV=production node server/'",
40-
"start:win": "concurrently \"mongod\" \"wait-on tcp:27017 &&SET NODE_ENV=production&& node server/\"",
41-
"dev:debug": "npm run clear && concurrently '$npm_package_config_mongoDev' 'wait-on tcp:27017 && NODE_ENV=development nodemon --inspect server/'",
42-
"dev": "npm run clear && concurrently '$npm_package_config_mongoDev' 'wait-on tcp:27017 && NODE_ENV=development nodemon server/'",
40+
"start": "concurrently 'mongod' 'wait-on tcp:27017 && cross-env NODE_ENV=production node server/'",
41+
"dev:debug": "npm run clear && concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && cross-env DEBUG=feathers && cross-env NODE_ENV=development nodemon --inspect server/'",
42+
"dev": "npm run clear && concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && cross-env DEBUG=feathers && cross-env NODE_ENV=development nodemon server/'",
4343
"dev:local": "sh scripts/run-local.sh",
4444
"dev:noseed": "concurrently 'mongod --dbpath data' 'wait-on tcp:27017 && NODE_ENV=development DEBUG=feathers nodemon server/'",
4545
"dev:win": "npm run clear && concurrently \"mongod --dbpath /data/db\" \"wait-on tcp:27017&&cross-env NODE_ENV=development&&cross-env DEBUG=feathers&& nodemon --inspect server/\"",
46-
"mocha": "npm run clear && $npm_package_config_concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && NODE_ENV=test $npm_package_config_mocha'",
47-
"coverage": "npm run clear && $npm_package_config_concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && NODE_ENV=test istanbul cover $npm_package_config_mochaCoverage'",
48-
"cucumber": "npm run clear && $npm_package_config_concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && cucumber-js'"
46+
"mocha": "npm run clear && $npm_package_config_mocha",
47+
"mocha:mongo": "$npm_package_config_concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && npm run mocha'",
48+
"cucumber": "cucumber-js"
4949
},
5050
"config": {
5151
"mongoDev": "mongod --dbpath data --quiet",
52-
"mocha": "node_modules/mocha/bin/_mocha test/ --recursive --timeout 10000 --exit",
53-
"mochaCoverage": "node_modules/mocha/bin/_mocha -- test/ --recursive --timeout 10000 --exit",
52+
"mocha": "cross-env NODE_ENV=test node_modules/mocha/bin/_mocha test/ --recursive --timeout 10000 --exit",
5453
"concurrently": "concurrently --kill-others --success first"
5554
},
5655
"dependencies": {
56+
"@feathersjs/authentication": "^2.1.7",
57+
"@feathersjs/authentication-jwt": "^2.0.1",
58+
"@feathersjs/authentication-local": "^1.2.1",
59+
"@feathersjs/configuration": "^1.0.2",
60+
"@feathersjs/errors": "^3.3.0",
61+
"@feathersjs/express": "^1.2.3",
62+
"@feathersjs/feathers": "^3.1.7",
63+
"@feathersjs/socketio": "^3.2.2",
5764
"body-parser": "~1.18.3",
5865
"cheerio": "^1.0.0-rc.2",
5966
"compression": "~1.7.2",
@@ -62,27 +69,18 @@
6269
"crypto-js": "^3.1.9-1",
6370
"dauria": "~2.0.0",
6471
"email-templates": "2.6.0",
65-
"feathers": "~2.2.4",
66-
"feathers-authentication": "~1.3.1",
67-
"feathers-authentication-hooks": "~0.1.6",
68-
"feathers-authentication-jwt": "~0.3.2",
69-
"feathers-authentication-local": "~0.4.4",
70-
"feathers-authentication-management": "~1.0.3",
71-
"feathers-blob": "~1.3.1",
72-
"feathers-configuration": "~0.4.2",
73-
"feathers-errors": "~2.9.2",
74-
"feathers-hooks": "~2.1.2",
75-
"feathers-hooks-common": "~3.10.0",
76-
"feathers-logger": "0.2.3",
72+
"feathers-authentication-hooks": "~0.3.0",
73+
"feathers-authentication-management": "~2.0.0",
74+
"feathers-blob": "~2.0.1",
75+
"feathers-hooks-common": "~4.14.0",
76+
"feathers-logger": "0.3.2",
7777
"feathers-mailer": "~2.0.0",
78-
"feathers-memory": "~1.3.1",
79-
"feathers-mongodb": "~3.0.0",
78+
"feathers-memory": "~2.1.3",
79+
"feathers-mongodb": "~3.2.0",
8080
"feathers-mongodb-fuzzy-search": "~1.1.1",
81-
"feathers-mongoose": "~5.1.2",
81+
"feathers-mongoose": "~6.1.2",
8282
"feathers-profiler": "^0.1.5",
83-
"feathers-rest": "~1.8.1",
8483
"feathers-seeder": "~1.0.10",
85-
"feathers-socketio": "~2.0.1",
8684
"fs-blob-store": "~5.2.1",
8785
"fs-extra": "~4.0.2",
8886
"handlebars": "~4.0.11",
@@ -93,29 +91,32 @@
9391
"mongoose": "~4.13.2",
9492
"multer": "~1.3.0",
9593
"node-sass": "~4.7.2",
94+
"nyc": "^12.0.2",
9695
"quill-url-embeds": "^1.2.5",
9796
"raven": "~2.6.1",
98-
"request": "~2.86.0",
97+
"request": "~2.87.0",
9998
"request-promise": "~4.2.2",
10099
"sanitize-html": "^1.18.2",
101100
"serve-favicon": "~2.5.0",
102-
"shortid": "~2.2.8",
101+
"shortid": "~2.2.11",
103102
"slug": "~0.9.1",
104103
"trunc-html": "^1.1.2",
104+
"uuid": "^3.3.2",
105105
"valid-url": "^1.0.9",
106106
"winston": "~3.0.0-rc5"
107107
},
108108
"devDependencies": {
109109
"babel-eslint": "~8.2.3",
110110
"chai": "^4.1.2",
111-
"concurrently": "~3.5.1",
112-
"cross-env": "^5.1.5",
113111
"cucumber": "^4.2.1",
112+
"concurrently": "~3.6.0",
113+
"cross-env": "^5.2.0",
114114
"eslint": "~4.19.1",
115115
"istanbul": "1.1.0-alpha.1",
116116
"mocha": "~5.2.0",
117117
"node-fetch": "^2.1.2",
118118
"nodemon": "~1.17.4",
119+
"nyc": "^12.0.2",
119120
"wait-on": "~2.1.0"
120121
}
121122
}

server/app.hooks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ module.exports = {
88
find: [],
99
get: [],
1010
create: [
11-
discard('_id')
11+
discard('_id', '__v')
1212
],
1313
update: [
14-
discard('_id')
14+
discard('_id', '__v')
1515
],
1616
patch: [
17-
discard('_id')
17+
discard('_id', '__v')
1818
],
1919
remove: []
2020
},

0 commit comments

Comments
 (0)