Obscured.AptWatcher is a Sinatra app that helps you keep track of packages that needs to be updated on your servers as well as keeping you informed of what have happened with the updates over time.
JavaScript CSS Ruby HTML
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets/javascript
controllers
lib
models
public
spec
views
.codeclimate.yml
.gitattributes
.gitignore
.ruby-gemset
.ruby-version
.travis.yml
Gemfile
Gemfile.lock
LICENSE
Procfile
README.md
VERSION
app.json
config.ru

README.md

Known Vulnerabilities Build Status Test Coverage Code Climate Dependency Status

AptWatcher is a simple Sinatra app that helps you keep track of packages that need updating on your servers.

How it works

On each server you manage you set up a daily cron job that fetches the list of packages that need to be updated and sends that list to AptWatcher:

Structure

One line is interpreted as one service

{
    "name": "service_name",
    "version_installed": "1.0.0",
    "version_available": "1.0.1"
}
Example Input
{"name":"service_a","version_installed":"1.0.0","version_available":"1.0.1"}
{"name":"service_b","version_installed":"1.0.0","version_available":"1.0.1"}
{"name":"service_c","version_installed":"1.0.0","version_available":"1.0.1"}
Perl
@daily apt-get --just-print upgrade 2>&1 | perl -ne 'if (/Inst\s([\w,\-,\d,\.,~,:,\+]+)\s\[([\w,\-,\d,\.,~,:,\+]+)\]\s\(([\w,\-,\d,\.,~,:,\+]+)\)? /i) {print "{\"name\":\"$1\",\"version_installed\":\"$2\",\"version_available\":\"$3\"} \n"}' | curl -u user:pass --data-binary @- http://hostname/api/collector/upgrades/$(hostname)

If any packages are in that payload that weren't previously sent, a message is sent via a Slack incoming webhook with that list of new packages.

Installation

The easiest way to get going is deploying to Heroku:

Deploy

Otherwise, you can bundle, create your database, migrate, and run:

$ bundle

Configuration

Check the .env file for the environment variables you can use to configure the app.

License

AptWatcher is copyright © 2017 Obscured It is free software, and may be redistributed under the terms specified in the LICENSE file.

About Obscured

AptWatcher is maintained by the friendly crew at Obscured, an exception, performance, and uptime monitoring service for developers.

Printscreens

Home Statistics