Ardakilic / alerthub

AlertHub is a simple tool written with NodeJS to get alerted from new GitHub and GitLab repository events.
MIT License
200 stars 12 forks source link

improved docker documentation for first time users #89

Closed bryanpedini closed 2 months ago

bryanpedini commented 2 months ago

as per the title, I improved a bit the documentation for docker user, explaining how to get the config file to avoid the following error at startup if launched with an empty config file

Application booted at Thu, 05 Sep 2024 14:16:09 GMT
file:///usr/src/app/src/index.mjs:22
Object.keys(config.repositories.github).forEach((type) => {
                                ^

TypeError: Cannot read properties of undefined (reading 'github')
    at file:///usr/src/app/src/index.mjs:22:33
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:527:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)

Node.js v18.9.1

or the following if launched without a file present at /usr/src/app/etc/config.js at all

Application booted at Thu, 05 Sep 2024 14:16:36 GMT
file:///usr/src/app/src/index.mjs:22
Object.keys(config.repositories.github).forEach((type) => {
                                ^

TypeError: Cannot read properties of undefined (reading 'github')
    at file:///usr/src/app/src/index.mjs:22:33
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:527:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)

Node.js v18.9.1
Ardakilic commented 2 months ago

Hello, highly appreciate your contribution on this.

bryanpedini commented 2 months ago

wym fixing my mistake I noticed in the example? it would be ... cat /usr/src/app/etc/config.example.js > ... instead, I forgot the .example part

Ardakilic commented 2 months ago

Thanks, no worries, this commit should address it: https://github.com/Ardakilic/alerthub/commit/1e4fa91fffabccd3c886b813d0feb70734629ee9

Apologies nowadays I'm bloated with work stuff, so I cannot focus on my hobby projects much.