Skip to content

Sally, the Slack Bot, reminds you, when your SSL certificates in your internal network are expiring.

License

Notifications You must be signed in to change notification settings

BrunnerLivio/ssl-certificate-notifier

Repository files navigation

Sally The SSL Alpaca - A Slack Bot

Build Status

Sally reminds you, when your SSL certificates in your internal network are expiring.

Sally

Deploy Greenkeeper badge

Table of Contents

Under The Hood

Diagram

The application is split in 2 services; the Web API and the checker-Script.

Web API

Web API

The Web API has 2 ways of communicating.

/api/command/*

is meant for operations between Slack and the database. It will respons with human readable plain text.

URL Arguments Description
POST /api/command/add text [string] - The url of the certificate to add Adds the given certificate URL to the database.
POST /api/command/remove text [string] - The url of the certificate to remove Removes the given certificate URL to the database.
POST /api/command/list - Lists all stored certificates and their expiration date, if available.
POST /api/command/help - Help command when you are stuck. Lists all commands and how to use them. Also displays meta information about this bot.

/api/certificate/*

is meant for the checker-Script or third party services. It will respond with JSON-results

URL Arguments Description
GET /api/certificate - Returns a list of all stored certificates
GET /api/certificate/{CERTIFICATE_URL}/ics - Downloads the ICS file for the certificate expiry date
POST /api/certificate
url [string] - The url of the certificate to add
expires [date] - The date, when the certificate expires
status [integer] - The status of the certificate. 0 = Not checked yet, 1 = Found expire-date, 2 = Got an error, while checking
Adds the certificate to the database
DELETE /api/certificate
url [string] - The url of the certificate to remove
Removes the given certificate from the database.

Installation

In order to run this application properly, you need to install it on 2 servers.

Configuration

In the file src/app.config.json.template, you can find the configuration options for this application. Note: Some of these options can be overwritten using environment variables.

After you changed your settings run

mv src/app.config.json.template src/app.config.json

Internal Server

Run the following command

Install

sudo ./bin/install-internal-server.sh

Uninstall

sudo ./bin/uninstall-internal-server.sh

Public Server

Heroku Installation

You can deploy this application using GIT to Heroku.

You also need to add the POSTGRESQL addon

heroku addons:create heroku-postgresql:hobby-dev

Local Installation

  1. Install POSTGRESQL

Linux

Debian
sudo apt-get install postgresql
Redhat
yum install postgresql-server

Windows

Download for Windows

  1. Add Database
sudo su postgres
psql -c "CREATE DATABASE sslcertificatenotifier;"
  1. Run
DATABASE_URL=postgresql://@localhost:5432/sslcertificatenotifier ./bin/run-server-prod.sh

Documentation

Generate

Generate the HTML-documentation using:

npm run docs

The documentation is generated in the ./docs-Folder, which can be visited using a simple http server.

About

Sally, the Slack Bot, reminds you, when your SSL certificates in your internal network are expiring.

Resources

License

Stars

Watchers

Forks

Packages

No packages published