Skip to content

Commit

Permalink
huge refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
j33f committed Feb 24, 2021
1 parent 478b480 commit 504e5a4
Show file tree
Hide file tree
Showing 140 changed files with 17,393 additions and 9,349 deletions.
1 change: 0 additions & 1 deletion ci/.gitignore

This file was deleted.

24 changes: 0 additions & 24 deletions ci/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions ci/credentials-sample.yml

This file was deleted.

129 changes: 0 additions & 129 deletions ci/pipeline.yml

This file was deleted.

8 changes: 0 additions & 8 deletions ci/set-pipeline

This file was deleted.

60 changes: 25 additions & 35 deletions defaultConfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
{
"serviceName": "Yggdrasil",
"withPuppeteer": true,
"logger": {
"level": "silly"
},
"port": 8842,
"api": {
"version": "0.1"
"version": "0.1",
"unprotectedPath": []
},
"allowOrigins": [
"localhost:8842",
"localhost:3000",
"localhost:8080"
],
"sessions": {
"duration": "3h",
"durationSeconds": 10800
},
"authorizedFrontOrigins": [
"localhost:3000"
],
"externalServerBaseURL": null,
"fileStorage": {
"type": "local",
"path": "/var/fileStorage"
"strategies": {
"local": {
"lib": "Local",
"storageRootPath": "/var/app/fileStorage"
},
"S3": {

}
},
"strategy": "local"
},
"redis": {
"port": 6379,
Expand All @@ -26,6 +37,8 @@
"db": 0
},
"mongo": {
"retries": 30,
"retryDelay": 1000,
"useSSL": false,
"host": "mongo",
"port": 27017,
Expand Down Expand Up @@ -59,41 +72,18 @@
"newAccount": 123
}
},
"sms": {
"strategy": "mailjet",
"defaultFrom": "Yggdrasil"
},
"emails": {
"strategy": "mailjet",
"strategy": "smtp",
"from": {
"name": "Yggdrasil",
"email": "[email protected]"
},
"testModeEmail": "[email protected]"
},
"proxyMesh": {
"activated": false,
"username": "yggdrasil",
"password": "ThorAllmighty",
"entryPoints": [
"fr.proxymesh.com:31280",
"de.proxymesh.com:31280",
"nl.proxymesh.com:31280",
"uk.proxymesh.com:31280",
"ch.proxymesh.com:31280",
"open.proxymesh.com:31280"
]
},
"OpenDataLaposteAPiKey": "apikey",
"geocoder": {
"defaultStrategy": "google",
"strategies": {
"google": {
"provider": "google",
"httpAdapter": "https",
"apiKey": "apikey",
"formatter": null
}
"OAuth": {
"google": {
"clientId": "YOUR CLIENT ID HERE",
"clientSecret": "YOUR CLIENT SECRET HERE"
}
}
}
2 changes: 1 addition & 1 deletion docker-compose/config/pm2-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"watch_options": {
"usePolling": true
},
"node_args" : "--inspect=0.0.0.0:9229 --max-old-space-size=4000",
"node_args" : "--inspect=0.0.0.0:9229 --max-old-space-size=4000 --trace-warnings",
"kill_timeout" : 15000,
"instances" : 1,
"env": {
Expand Down
6 changes: 3 additions & 3 deletions docker-compose/dev.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: '3'

services:
yggdrasil:
image: j33f/node-docker-container:pupeteer-unoconv
container_name: yggdrasil
backend:
image: j33f/node-docker-container
container_name: backend
command: bash -c "chmod 775 /var/startScripts/runCustom.sh && /var/startScripts/runCustom.sh"
volumes:
- ..:/var/app:cached
Expand Down
44 changes: 23 additions & 21 deletions features/rest.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,30 @@ Feature: CRM REST API funtional tests
Then I get a response with status code 401

@cleanFsAfter
Scenario: Get an existing file or asset
Given I am not authenticated
And There is a file named "testFile.txt" containing "some content"
When I send a "GET" request to "/fs/testFile.txt" awaiting for "a text file"
Then I get a response with status code 200
And The response content type is "text/plain; charset=UTF-8"
And I get "some content" as the response content
# TODO rewrite this scenario when file storage is good
# Scenario: Get an existing file or asset
# Given I am not authenticated
# And There is a file named "testFile.txt" containing "some content"
# When I send a "GET" request to "/fs/testFile.txt" awaiting for "a text file"
# Then I get a response with status code 200
# And The response content type is "text/plain; charset=UTF-8"
# And I get "some content" as the response content

Scenario: Get a missing file or asset
Given I am not authenticated
And The file named "testFile.txt" does not exist
When I send a "GET" request to "/fs/testFile.txt" awaiting for "a text file"
Then I get a response with status code 404
And The "JSON" response is
"""
{
ok: false,
cause: "route",
rawResponse: "Error 404: Not found.",
readableresponse: "Nothing to see here..."
}
"""
# TODO rewrite this scenario when file storage is good
# Scenario: Get a missing file or asset
# Given I am not authenticated
# And The file named "testFile.txt" does not exist
# When I send a "GET" request to "/fs/testFile.txt" awaiting for "a text file"
# Then I get a response with status code 404
# And The "JSON" response is
# """
# {
# ok: false,
# cause: "route",
# rawResponse: "Error 404: Not found.",
# readableresponse: "Nothing to see here..."
# }
# """

Scenario: Access to auth routes with OPTIONS method
Given I am not authenticated
Expand Down
2 changes: 1 addition & 1 deletion features/step-definitions/baseSocketIOAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Then('I receive a JWT error as a response', function (callback) {
should.exist(this.errorResponse);
should.not.exist(this.response);
should(this.errorResponse).eqls({
message: 'No Authorization header was found',
message: 'no token provided',
code: 'credentials_required',
type: 'UnauthorizedError'
});
Expand Down
6 changes: 3 additions & 3 deletions features/support/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,11 @@ class World {
*/
getFixture(path, id) {
let fixture;
get(this.fixtures, path).forEach(function(item) {
if (item._id === id) {
get(this.fixtures, path).forEach((item) => {
if (String(item._id) === String(id)) {
fixture = item;
}
});

return fixture;
}

Expand All @@ -143,6 +142,7 @@ class World {
compareTo = compareTo || this.response;

should.exist(fixture);
console.log(compareTo, this.response);
should.exist(compareTo);

if (compareTo.id) {
Expand Down
File renamed without changes.
Loading

0 comments on commit 504e5a4

Please sign in to comment.