The application is split in 2 services; the Web API and the checker-Script.
The Web API has 2 ways of communicating.
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. |
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 addexpires [date] - The date, when the certificate expiresstatus [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. |
In order to run this application properly, you need to install it on 2 servers.
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
Run the following command
sudo ./bin/install-internal-server.sh
sudo ./bin/uninstall-internal-server.sh
You can deploy this application using GIT to Heroku.
You also need to add the POSTGRESQL addon
heroku addons:create heroku-postgresql:hobby-dev
- Install POSTGRESQL
sudo apt-get install postgresql
yum install postgresql-server
- Add Database
sudo su postgres
psql -c "CREATE DATABASE sslcertificatenotifier;"
- Run
DATABASE_URL=postgresql://@localhost:5432/sslcertificatenotifier ./bin/run-server-prod.sh
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.