Ardakilic / alerthub

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

Got error on RSS feed creation #58

Closed AlbertCaro closed 2 years ago

AlbertCaro commented 2 years ago

Recently, after updated my AlertHub to the last release, and make my config.js a ES6 module, I got this error at trying to access to the RSS feed.

Application booted at Sun, 25 Sep 2022 06:12:44 GMT
AlertHub RSS Feed server running at port 3444
file:///usr/src/app/src/index.js:144
    rssUtils.createRSSFeed(config).then((rssFeed) => {
             ^

TypeError: rssUtils.createRSSFeed is not a function
    at Server.<anonymous> (file:///usr/src/app/src/index.js:144:14)
    at Server.emit (node:events:513:28)
    at parserOnIncoming (node:_http_server:1034:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)

After that, container dies. There's my docker-compose service configuration:

alerthub:
    container_name: alerthub
    image: ghcr.io/ardakilic/alerthub:latest
    volumes:
      - ${DOCKERCONFDIR}/alerthub/config.js:/usr/src/app/etc/config.js
    network_mode: host

If that helps, there's my config.js file:

const config = {
   interval: 60000, // Feed check interval, in miliseconds
   userAgent: 'Mozilla/5.0 (Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0', // Experimental: User agent string to bypass possible fetching limits on GitHub
   /**
    * Provide your GitHub token below to bypass the rate limit
    * and to get notified from private repositories
    */
   githubToken: null,
   notifications: {
     pushbullet: {
       enabled: false,
       accessToken: 'PUSHBULLET_TOKEN',
     },
     pushover: {
       enabled: false,
       config: {
         user: 'PUSHOVER_USER',
         token: 'PUSHOVER_TOKEN',
       },
     },
     email: {
       enabled: false,
       config: { // Nodemailer configuration
         host: 'smtp.office365.com',
         port: 587,
         secure: true,
         auth: {
           user: 'somemail',
           pass: 'somepass',
         },
       },
       mailOptions: {
         from: '"AlertHub" mail', // from field, can be pure e-mail or "Name" <e-mail> format
         to: 'somemail', // Your e-mail, can add more e-mails by commas
         subjectPrefix: 'Nuevo lanzamiento en GitHub', // Subject prefix
       },
     },
   },
   rss: {
     enabled: true,
     port: 3444,
     title: 'CaroNavarro AlertHub RSS', // Feed Title
     description: 'Seguimiento de releases de los servicios utilizados en el home server', // Feed Description
     includeFromEachRepository: 10, // How many releases/items will be fetched from each repository
     count: 50, // How many elements will be there in the feed
     siteUrl: 'https://caronavarro:8080/', // Site url shown on the feed
     feedUrl: 'https://caronavarro:8080/', // Fills: <atom:link href="feedurl" rel="self" type="application/rss+xml"/>
     logLevel: 'info', // debug, info, warn, err, off
   },
   repositories: {
     github: {
       releases: [
         'Ardakilic/alerthub', // can be resolved as https://github.com/Ardakilic/alerthub
         'pi-hole/pi-hole',
         'pi-hole/docker-pi-hole',
         'jokob-sk/Pi.Alert',
         'netdata/netdata',
         'prometheus/prometheus',
         'henrywhitaker3/Speedtest-Tracker',
         'louislam/uptime-kuma',
         'jellyfin/jellyfin',
         'gotson/komga',
         'duplicati/duplicati',
         'syncthing/syncthing',
         'transmission/transmission',
         'portainer/portainer',
         'hay-kot/mealie',
         'jaymoulin/docker-jdownloader',
         'grafana/grafana',
         'FreshRSS/FreshRSS',
         'jmshrv/finamp',
         'pmmp/PocketMine-MP',
         'termux/termux-app',
         'tachiyomiorg/tachiyomi',
         'bancika/diy-layout-creator',
         'tailscale/tailscale',
         'tailscale/tailscale-android',
         'obsidianmd/obsidian-releases',
         'keepassxreboot/keepassxc',
         'vmorganp/Lazytainer',
         'n8n-io/n8n',
       ],
       tags: [

       ],
       commits: {
         'jokob-sk/Pi.Alert': ['main'],
         'GhostWriters/DockSTARTer': ['master'],
       },
       issues: {
       },
     },
     gitlab: {
       // releases: [], // Gitlab doesn't support this yet. Use tags instead for the time being
       tags: [
         'Bockiii/deemix-docker',
       ],
       commits: {
       },
     },
   },
   extras: [
     // direct rss links from other sources if you want to watch with this tool
   ],
 };

export { config };

I thank you in advance for your help.

reconman commented 2 years ago

Sorry, I messed up some imports. Should be fixed in 2.2.1, which is available in a few minutes.

AlbertCaro commented 2 years ago

Thank you so much 😄