Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.env.example
#	.travis.yml
#	Dockerfile
#	README.md
#	package-lock.json
#	package.json
#	src/background/background.service.ts
#	src/background/task/subscribe.event.bus.task.ts
#	src/utils/config.ts
#	src/utils/default.ts
#	src/utils/strings.ts
#	test/unit/utils/custom.logger.spec.ts
#	test/unit/utils/json.utils.spec.ts
  • Loading branch information
douglasrafael committed Nov 17, 2020
2 parents cc70ff0 + a5edc2d commit 1b2779b
Show file tree
Hide file tree
Showing 99 changed files with 6,882 additions and 2,419 deletions.
30 changes: 23 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
NODE_ENV=development

#################################################################################################
####################################### ACCOUNT API SETUP #######################################
####################################### NOTIFICATION API SETUP #######################################
#################################################################################################

# PORT_HTTP: Port used to listen for HTTP request
Expand Down Expand Up @@ -61,17 +61,17 @@ SMTP_PASS=YOUR_SMTP_PASS
##################################### MONGO DATABASE SETUP #####################################
#################################################################################################

# MONGODB_URI: Database connection URI used by the ACCOUNT service for connecting to
# MONGODB_URI: Database connection URI used by the NOTIFICATION service for connecting to
# a MongoDB instance if the application is running in development or
# production environment (NODE_ENV=development or NODE_ENV=production).
# default value: mongodb://localhost:27017/account-service
MONGODB_URI=mongodb://localhost:27017/account-service
# default value: mongodb://localhost:27017/notification-service
MONGODB_URI=mongodb://localhost:27017/notification-service

# MONGODB_URI_TEST: Database connection URI used by the ACCOUNT service for connecting to
# MONGODB_URI_TEST: Database connection URI used by the NOTIFICATION service for connecting to
# a MongoDB instance if the application is running test environment
# (NODE_ENV=test).
# default value: mongodb://localhost:27017/account-service-test
MONGODB_URI_TEST=mongodb://localhost:27017/account-service-test
# default value: mongodb://localhost:27017/notification-service-test
MONGODB_URI_TEST=mongodb://localhost:27017/notification-service-test

# MONGODB_ENABLE_TLS: Enables/Disables connection to TLS
# When TLS is used for connection, client certificates
Expand Down Expand Up @@ -112,3 +112,19 @@ RABBITMQ_KEY_PATH=.certs/rabbitmq/key.pem
# RABBITMQ_CA_PATH: RabbitMQ Certificate of the Authentication entity (CA)
# default value: .certs/rabbitmq/ca.pem
RABBITMQ_CA_PATH=.certs/rabbitmq/ca.pem

#################################################################################################
##################################### GOOGLE FIREBASE SETUP #####################################
#################################################################################################
# FIREBASE_ENABLE: Enables/Disables connection to Firebase admin
# When Firebase is used for notifications, your credentials
# file is required (FIREBASE_CREDENTIALS_PATH).
#
# default value: true
FIREBASE_ENABLE=true

# FIREBASE_CREDENTIALS_PATH:
# The Google Firebase Config JSON file path for use firebase admin
# features.
# default value: /path/to/firebase_credentials_file.json
FIREBASE_CREDENTIALS_PATH=/path/to/firebase_credentials_file.json
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
language: node_js
node_js:
- "12"
- "13"
- "14"
- "15"
env:
- NODE_ENV=test RABBITMQ_URI=amqp://guest:guest@localhost:5672/haniot MONGODB_ENABLE_TLS=false MONGODB_URI_TEST=mongodb://localhost:27017/notification-test
addons:
Expand All @@ -17,6 +18,7 @@ before_script:
- sudo rabbitmqctl set_permissions -p haniot guest ".*" ".*" ".*"
- npm install && npm install coveralls mocha-lcov-reporter --save-dev
script:
- npm run build
- npm test
after_success:
- nyc report --reporter=text-lcov | coveralls
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM node:12-alpine
RUN apk --no-cache add bash curl grep
FROM node:14-alpine
RUN apk --no-cache add bash curl grep tzdata

# Create app directory
RUN mkdir -p /usr/src/ns
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Service for sending messages: **email**, **sms** or **push**. In this version on
See the [documentation](https://github.com/haniot/notification/wiki) for more information.

## Prerequisites
- [Node 12.0.0+](https://nodejs.org/en/download/)
- [Node 13.0.0+](https://nodejs.org/en/download/)
- [MongoDB Server 4.0.0+](https://www.mongodb.com/download-center/community)
- [RabbitMQ 3.7.0+](https://www.rabbitmq.com/download.html)
- [RabbitMQ 3.8.0+](https://www.rabbitmq.com/download.html)

---

Expand All @@ -40,6 +40,8 @@ Application settings are defined by environment variables. To define the setting
| `RABBITMQ_CERT_PATH` | RabbitMQ Certificate | `.certs/rabbitmq/cert.pem` |
| `RABBITMQ_KEY_PATH` | RabbitMQ Key | `.certs/rabbitmq/key.pem` |
| `RABBITMQ_CA_PATH` | RabbitMQ Certificate of the Authentication entity (CA). | `.certs/rabbitmq/ca.pem` |
| `FIREBASE_ENABLE` | Enables/Disables connection to Firebase admin when Firebase is used for notifications. | `true` |
| `FIREBASE_CREDENTIALS_PATH` | The Google Firebase Config JSON file path for use firebase admin features. | `/path/to/firebase_credentials_file.json` |

## Generate Certificates
For development and testing environments the easiest and fastest way is to generate your own self-signed certificates. These certificates can be used to encrypt data as well as certificates signed by a CA, but users will receive a warning that the certificate is not trusted for their computer or browser. Therefore, self-signed certificates should only be used in non-production environments, that is, development and testing environments. To do this, run the `create-self-signed-certs.sh` script in the root of the repository.
Expand Down
39 changes: 39 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: "3.8"
services:
mongo:
image: mongo
container_name: haniot-mongo
ports:
- 27017:27017
restart: always
volumes:
- haniot-mongo-data:/data/db
networks:
- haniot-network
logging:
driver: json-file
options:
max-size: 100m

rabbitmq:
image: rabbitmq:3-management-alpine
container_name: haniot-rabbitmq
restart: always
ports:
- 15672:15672 # Management UI
- 5672:5672 # AMQP Protocol
networks:
- haniot-network
logging:
driver: json-file
options:
max-size: 100m

volumes:
haniot-mongo-data:
name: haniot-mongo

networks:
haniot-network:
name: haniot-network
driver: bridge
Loading

0 comments on commit 1b2779b

Please sign in to comment.