Skip to content

Commit

Permalink
Version 1.2.0 - Tags and Commits can be followed now.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ardakilic committed May 16, 2018
1 parent 15ddccc commit 6ef162c
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 32 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2018-05-16
### Added
- You can now follow tags and commits in addition to GitHub releases! 🎉


## [1.1.0] - 2017-06-20
## [1.1.0] - 2018-05-05
### Added
- RSS feature added. You can also track the changes from RSS feed with your favourite tool or connect to a service such as IFTTT!
- RSS feature added! 🎉 You can also track the changes from RSS feed with your favourite tool or connect to a service such as IFTTT!

### Changed
- Utils are splitted more more splitted

### Fixed
### Fixed
- Readme was telling wrong file to edit. Typo fixed.
- The code is now %100 Eslint AirBNB standards compatible.

Expand Down
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,57 @@ AlertHub
\_/ \_/_|\___|_| \__\/ /_/ \__,_|_.__/
```

AlertHub is a simple tool written with NodeJS to get alerted from GitHub releases.
AlertHub is a simple tool written with NodeJS to get alerted from GitHub releases, tags and commits.

When you watch a release, you also auto watch the issues and comments etc., however if you want to only follow new releases, there isn't a way to achieve this from GitHub directly.
When you watch a release over GitHub, you also auto watch the issues and comments etc., however if you want to only follow new releases, commits or tags, there isn't a way to achieve this from GitHub directly.

There's been a service called sibbell.com, but they'll be shutting down on 15th May, 2018. That's why, I decided to make one for myself.
There's been a service called sibbell.com, but they shut down on 15th May, 2018. That's why, I decided to make one for myself.

This simple cli tool watches the releases set in config, and notifies you with E-mail or PushBullet, and provides you an aggregated RSS feed which you can usein IFTTT or your personal feed reader.
This simple cli tool watches the releases set in config, and notifies you with E-mail or PushBullet, and provides you an aggregated RSS feed which you can use in IFTTT or your personal feed reader.

## Requirements
## Requirements

* NodeJS 8.x or newer
* (Optional) PushBullet Api Key
* (Optional) SMTP credentials
* (Optional) SMTP credentials to dispatch e-mail

Either one of the PushBullet or the SMTP credentials are required to get notifications. RSS feed doesn't require neither.

## Installation
## Installation

You can install and run AlertHub with some simple steps:

1. Clone this repository or get the latest release version
2. Navigate to the folder, and run `npm install` to install dependencies
3. Run `npm run init` to copy the configuration file
1. Clone this repository or get the latest release version.
2. Navigate to the folder, and run `npm install` to install dependencies.
3. Run `npm run init` to copy the configuration file.
4. Edit `/etc/config.js`, and fill your credentials.
5. Run `npm start` or something like `pm2 start npm -- start` and run the application.

## Docker Container

You can also run alerthub through a Docker container. See [kmlucy/docker-alerthub](https://github.com/kmlucy/docker-alerthub).
You can also run AlertHub through a Docker container. See [kmlucy/docker-alerthub](https://github.com/kmlucy/docker-alerthub).


## Changelog

I'll keep track of each release in the [CHANGELOG.md](./CHANGELOG.md)
I'll keep track of each release in the [CHANGELOG.md](./CHANGELOG.md).

## Upgrading

Please refer to [UPGRADING.md](./UPGRADING.md)
Please refer to [UPGRADING.md](./UPGRADING.md).

## TODOs / Plans

* A portable storage solution such as SQLite etc.
* Multi user feature
* ~~Aggregated RSS~~
* Following commits (all or a specific branch) and tags in addition to releases.
* ~~Following commits and tags in addition to releases.~~
* Following commits from a specific branch
* [You say!](https://github.com/Ardakilic/alerthub/issues/new)

## License

MIT
[MIT](./LICENSE)

## Buy me a coffee or beer!

Expand Down
6 changes: 6 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Upgrading Guide

## 1.1.0 to 1.2.0

- Stop the application.
- Check the `repositories` section from your config, and alter your configuration file based on `/etc/config.example.js` and update for your needs.
- Re-start the application.

## 1.0.0 to 1.1.0

- Stop the application.
Expand Down
22 changes: 15 additions & 7 deletions etc/config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@ module.exports = {
site_url: 'https://github.com/Ardakilic/alerthub', // Site url shown on the feed
feed_url: null, // Fills: <atom:link href="feedurl" rel="self" type="application/rss+xml"/>
},
repositories: [
'ardakilic/alerthub', // can be resolved as https://github.com/ardakilic/alerthub
'expressjs/express',
'Unitech/pm2',
'facebook/react',
],
repositories: {
releases: [
'ardakilic/alerthub', // can be resolved as https://github.com/ardakilic/alerthub
'expressjs/express',
'Unitech/pm2',
'facebook/react',
],
tags: [

],
commits: [

],
},
extras: [
// direct rss links from other sources if you want to watch in this tool
// direct rss links from other sources if you want to watch with this tool
],
};
16 changes: 15 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,27 @@ const bootDate = new Date();
console.log(`Application booted at ${bootDate}`);

// First, let's add all the feed lists
config.repositories.forEach((feed) => {
config.repositories.releases.forEach((feed) => {
feeder.add({
url: `https://github.com/${feed}/releases.atom`,
refresh: config.interval,
});
});

config.repositories.tags.forEach((feed) => {
feeder.add({
url: `https://github.com/${feed}/tags.atom`,
refresh: config.interval,
});
});

config.repositories.commits.forEach((feed) => {
feeder.add({
url: `https://github.com/${feed}/commits.atom`,
refresh: config.interval,
});
});

config.extras.forEach((feed) => {
feeder.add({
url: feed,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/pushNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const PushBullet = require('pushbullet');
const striptags = require('striptags');

// Send the push notification.
// Todo why bother with async / await at all ?
// Todo: why bother with async / await at all ?
async function sendPushNotification(config, feedData) {
const pusher = new PushBullet(config.notifications.pushbullet.accessToken);
await pusher.link(
Expand Down
27 changes: 22 additions & 5 deletions src/utils/rss.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const RssBraider = require('rss-braider');
const rssBraider = require('rss-braider');
const path = require('path');

// Creates a RSS feed from the configuration provided
Expand All @@ -21,14 +21,30 @@ function createRSSFeed(config) {
},
};

config.repositories.forEach((feed) => {
config.repositories.releases.forEach((feed) => {
AlertHubFeeds.alertHub.sources.push({
name: feed, // this is actually user/repo string
name: `r-${feed}`, // this is actually the user/repo string
count: config.rss.includeFromEachRepository,
feed_url: `https://github.com/${feed}/releases.atom`,
});
});

config.repositories.tags.forEach((feed) => {
AlertHubFeeds.alertHub.sources.push({
name: `t-${feed}`, // this is actually the user/repo string
count: config.rss.includeFromEachRepository,
feed_url: `https://github.com/${feed}/tags.atom`,
});
});

config.repositories.commits.forEach((feed) => {
AlertHubFeeds.alertHub.sources.push({
name: `c-${feed}`, // this is actually the user/repo string
count: config.rss.includeFromEachRepository,
feed_url: `https://github.com/${feed}/commits.atom`,
});
});

config.extras.forEach((feed) => {
AlertHubFeeds.alertHub.sources.push({
name: Math.random().toString(26).slice(2), // Well, there's no name, so here goes randomness
Expand All @@ -45,7 +61,7 @@ function createRSSFeed(config) {
plugins_directories: [path.join(__dirname, '..', 'plugins', 'rss-braider')],
};

const rssClient = RssBraider.createClient(braiderOptions);
const rssClient = rssBraider.createClient(braiderOptions);

// Override logging level (debug, info, warn, err, off)
rssClient.logger.level('info');
Expand All @@ -67,7 +83,8 @@ function createRSSFeed(config) {
return process;
}

return ''; // If RSS output is disabled, empty string will be returned
// If RSS output is disabled, empty string will be returned
return Promise.resolve('');
}

module.exports = {
Expand Down

0 comments on commit 6ef162c

Please sign in to comment.