Skip to content

Commit 63540f5

Browse files
merged master in
2 parents 93aed03 + a1a2fdd commit 63540f5

Some content is hidden

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

65 files changed

+1203
-226
lines changed

.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
node_modules/
22
npm-debug.log
33
Dockerfile
4-
package-lock.json
5-
yarn.lock

.travis.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,32 @@ cache:
55
yarn: true
66
directories:
77
- node_modules
8-
install:
9-
# - yarn
10-
script:
11-
- cp ./config/local.example.json ./config/local.json
12-
- npm run clear && NODE_ENV=test mocha test/ --recursive --timeout 10000 --exit
13-
- rm ./config/local.json
148
services:
9+
# we need docker for building the image and mongo for testing
1510
- docker
1611
- mongodb
17-
before_install:
18-
- docker build -t humanconnection/api-feathers:alpha .
12+
install:
13+
# nothing!
14+
15+
jobs:
16+
include:
17+
- stage: Prepare Cache
18+
script: true
19+
- stage: Build and Test
20+
script:
21+
- docker build -t humanconnection/api-feathers:alpha .
22+
- script:
23+
- cp ./config/local.example.json ./config/local.json
24+
- yarn install --frozen-lockfile --non-interactive
25+
- yarn add codacy-coverage
26+
- rm -Rf tmp
27+
- yarn eslint
28+
- NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha -- test/ --timeout=10000 --exit
29+
- cat ./coverage/lcov.info | codacy-coverage
30+
- rm ./config/local.json
31+
1932
after_success:
20-
- if [ "$TRAVIS_BRANCH" == "master" ]; then
33+
- if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_EVENT_TYPE == "push" ]; then
2134
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
2235
docker push humanconnection/api-feathers:alpha;
2336
fi
24-
# - yarn run coverage

Dockerfile

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,28 @@ LABEL Description="This image is used to start the hc-api-feathers" Vendor="Huma
55
RUN apk update && apk upgrade
66
RUN rm -rf /var/cache/apk/*
77

8-
# copy the project
9-
RUN mkdir -p /var/www/
10-
COPY . /var/www/
11-
WORKDIR /var/www/
12-
138
# expose the app port
149
EXPOSE 3030
1510

1611
# set environment variables
1712
# ENV NPM_CONFIG_PRODUCTION=false
1813
# ENV HOST=0.0.0.0
1914
ENV NODE_ENV=production
20-
21-
# install PM2 process manager and configure it for autostart
22-
RUN npm install pm2 -g
23-
#RUN pm2 startup
24-
25-
# buld application
26-
RUN npm install --production
15+
ENV API_PORT=3030
2716

2817
# start the application in a autohealing cluster
2918
#CMD NODE_ENV=production pm2 start server/index.js -n api -i 0 --attach
3019
# as we have issues with pm2 currently in conjunction with nuxt, we use the standard approach here
3120
CMD NODE_ENV=production node server/index.js
21+
22+
# create working directory
23+
RUN mkdir -p /var/www/
24+
WORKDIR /var/www/
25+
26+
# install app dependencies
27+
COPY package.json /var/www/
28+
COPY yarn.lock /var/www/
29+
RUN yarn install --frozen-lockfile --non-interactive
30+
31+
# copy the code to the docker image
32+
COPY . /var/www/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ Getting up and running is as easy as 1, 2, 3, 4 ... 5.
6464
``` bash
6565
# start mongodb, feathers and seed database
6666
$ yarn dev
67-
$ yarn dev-win if you're on windows
67+
$ yarn dev:win if you're on windows
6868
# start mongodb, feathers without seeding the database
69-
$ yarn dev-noseed
69+
$ yarn dev:noseed
7070
# start mongodb, feathers for production
7171
$ yarn start
7272
```

config/default.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@
1414
"key": ""
1515
},
1616
"apiSecret": "TE9TqAk2xK[9EFJL",
17-
"sentry": {
18-
"dns": "SENTRY_DNS",
19-
"options": {
20-
"release": "pre-alpha",
21-
"environment": "develop"
22-
}
23-
},
17+
"sentry": {},
2418
"seeder": {
2519
"runOnInit": true,
2620
"dropDatabase": true

config/production.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"host": "HOST",
3-
"port": "PORT",
4-
"baseURL": "BASE_URL",
5-
"frontURL": "FRONT_URL",
2+
"host": "API_HOST",
3+
"port": "API_PORT",
4+
"baseURL": "API_BASE_URL",
5+
"frontURL": "WEBAPP_BASE_URL",
66
"mongodb": "MONGO_DB",
77
"debug": true,
88
"smtpConfig": {
@@ -18,11 +18,17 @@
1818
"url": "THUMBOR_URL",
1919
"key": "THUMBOR_KEY"
2020
},
21+
"sentry": {
22+
"dns": "SENTRY_DNS",
23+
"options": {
24+
"environment": "production"
25+
}
26+
},
2127
"apiSecret": "API_SECRET",
2228
"authentication": {
2329
"secret": "AUTH_SECRET",
2430
"jwt": {
25-
"audience": "https://alpha.human-connection.org"
31+
"audience": "WEBAPP_BASE_URL"
2632
}
2733
},
2834
"seeder": {
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{{> header }}
2+
<tr>
3+
<td class="content-wrap">
4+
<meta itemprop="name" content="Confirm Email"/>
5+
<table width="100%" cellpadding="0" cellspacing="0">
6+
<tr>
7+
<td class="aligncenter content-block">
8+
<h1 class="aligncenter">Bestätige deine Änderungen</h1>
9+
</td>
10+
</tr>
11+
<tr>
12+
<td class="aligncenter content-block">
13+
Hallo {{ name }}, deine Profilinformationen wurden geändert, bitte überprüfe das du diese Änderungen vorgenommen hast.
14+
</td>
15+
</tr>
16+
<tr>
17+
<td class="aligncenter content-block">
18+
<ul>
19+
{{#each changes}}
20+
<li>{{ this.label }}: {{ this.value }}</li>
21+
{{/each}}
22+
</ul>
23+
</td>
24+
</tr>
25+
<tr>
26+
<td class="aligncenter content-block" itemprop="handler" itemscope itemtype="http://schema.org/HttpActionHandler">
27+
<a href="{{ link }}" class="btn-primary" itemprop="url">Ich bestätige die Änderungen</a>
28+
</td>
29+
</tr>
30+
<tr>
31+
<td class="aligncenter content-block" itemprop="handler" itemscope itemtype="http://schema.org/HttpActionHandler">
32+
Wenn nicht du diese Änderungen vorgenommen hast <a href='mailto:{{returnEmail}}?subject=I did not change my email&body=Someone unauthorized changed my email. Can you help me change it back?'>lass es uns wissen!</a>
33+
</td>
34+
</tr>
35+
<tr>
36+
<td class="aligncenter content-block">
37+
&mdash; Human Connection
38+
</td>
39+
</tr>
40+
</table>
41+
</td>
42+
</tr>
43+
{{> footer }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bestätige deine Änderungen
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Bestätige deine Änderungen
2+
3+
Hallo {{ name }}, deine Profilinformationen wurden geändert, bitte überprüfe das du diese Änderungen vorgenommen hast.
4+
5+
{{#each changes}}
6+
{{ this.label }}: {{ this.value }}
7+
{{/each}}
8+
9+
Ich bestätige die Änderungen: {{ link }}
10+
11+
Wenn nicht du diese Änderungen vorgenommen hast lass es uns wissen!
12+
13+
&mdash; Human Connection

0 commit comments

Comments
 (0)