Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ npm install

### Configure service

- As to configure the service copy the json.example files from config folder into new ones. Open a console on projects folder a copy the following codes :

```console
cp config/common.json.example config/common.json
cp config/service.report.json.example config/service.report.json
cp config/schedule.json.example config/schedule.json
cp config/facs/grc.config.json.example config/facs/grc.config.json
```bash
bash setup-config.sh
```

- To set grenache client for express, edit common.json. If running locally, leave actual values skipping this step.
Expand Down
7 changes: 7 additions & 0 deletions config/facs/redis.config.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sk0": {
"host": "127.0.0.1",
"port": 6379,
"auth": ""
}
}
3 changes: 2 additions & 1 deletion config/service.report.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"isAddedUniqueEndingToReportFileName": false,
"isCompress": true,
"isLoggerDisabled": false,
"isHosted": true
"isHosted": true,
"mailQueue": "core.mail"
}
100 changes: 100 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"bfx-facs-grc-slack": "git+https://github.com/bitfinexcom/bfx-facs-grc-slack.git",
"bfx-facs-interval": "git+https://github.com/bitfinexcom/bfx-facs-interval.git",
"bfx-facs-lokue": "git+https://github.com:bitfinexcom/bfx-facs-lokue.git",
"bfx-svc-boot-js": "https://github.com/bitfinexcom/bfx-svc-boot-js.git",
"bfx-facs-redis": "git+https://github.com/bitfinexcom/bfx-facs-redis.git",
"bfx-svc-boot-js": "git+https://github.com/bitfinexcom/bfx-svc-boot-js.git",
"bfx-wrk-api": "git+https://github.com/bitfinexcom/bfx-wrk-api.git",
"bitfinex-api-node": "7.0.0",
"colors": "1.4.0",
Expand Down Expand Up @@ -70,8 +71,7 @@
".idea/",
".vscode/",
"csv/",
"workers/loc.api/queue/temp/",
"workers/loc.api/queue/views/"
"workers/loc.api/queue/temp/"
]
},
"betterScripts": {
Expand Down
25 changes: 25 additions & 0 deletions setup-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e

include_test=false
while [ $# -ne 0 ]; do
arg="$1"
case "$arg" in
-t | --test ) include_test=true; break ;;
esac
shift
done

for file in $(find config -type f -name "*.example"); do
new_name=$(echo "$file" | sed -E -e 's/.example//')
echo "$file -> $new_name"
cp "$file" "$new_name"

if [ "$include_test" = true ]; then
dir_name=$(dirname $new_name)
base_name=$(basename $new_name)
test_name="$dir_name/test.$base_name"
echo "$file -> $test_name"
cp "$file" "$test_name"
fi
done
5 changes: 4 additions & 1 deletion workers/api.service.report.wrk.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ class WrkReportServiceApi extends WrkApi {
's0',
's0',
{}
]
],
['fac', 'bfx-facs-redis', 'sk0', 'sk0', {}]
]

this.setInitFacs(facs)
Expand All @@ -205,6 +206,8 @@ class WrkReportServiceApi extends WrkApi {
link: this.grc_bfx.link,
deflateFac: this.deflate_gzip,
grcSlackFac,
redisSk0: this.redis_sk0,
conf: this.conf.report,
i18next,
...deps
})
Expand Down
7 changes: 5 additions & 2 deletions workers/loc.api/di/app.deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ module.exports = ({
deflateFac,
grcSlackFac,
link,
redisSk0,
conf,
i18next
}) => {
return new ContainerModule((bind) => {
bind(TYPES.RService).toConstantValue(rService)
bind(TYPES.RootPath).toConstantValue(rService.ctx.rootPath)
bind(TYPES.I18next).toConstantValue(i18next)
bind(TYPES.RedisSk0).toConstantValue(redisSk0)
bind(TYPES.RServiceDepsSchema).toConstantValue([
['_responder', TYPES.Responder],
['_getREST', TYPES.GetREST],
Expand Down Expand Up @@ -173,8 +176,8 @@ module.exports = ({
bindDepsToFn(
sendMail,
[
TYPES.GrcBfxReq,
TYPES.I18next
TYPES.CONF,
TYPES.RedisSk0
]
)
)
Expand Down
3 changes: 2 additions & 1 deletion workers/loc.api/di/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ module.exports = {
WeightedAveragesReport: Symbol.for('WeightedAveragesReport'),
WeightedAveragesReportCsvWriter: Symbol.for('WeightedAveragesReportCsvWriter'),
BfxApiRouter: Symbol.for('BfxApiRouter'),
PdfWriter: Symbol.for('PdfWriter')
PdfWriter: Symbol.for('PdfWriter'),
RedisSk0: Symbol.for('RedisSk0')
}
1 change: 0 additions & 1 deletion workers/loc.api/queue/aggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ module.exports = (
await sendMail(
emailConf,
email,
'email.pug',
s3Data.map((item, i) => ({
...item,
isUnauth,
Expand Down
Loading