[juhk-stuh-pohz, juhk-stuh-pohz]
to place close together or side by side, especially for comparison or contrast
This Web App is a self-hosted Web Service glue for some of the applications I use on a daily basis. It's purpose is to notify you of events that you want to know about, without being swamped in noise, thus improving productivity.
Incoming services via Webhooks:
- Jira
- Bitbucket
- Docker Hub
- Zendesk
Outgoing services
- Slack (via Slack Bot)
- Easy to use interface to configure your services, templates and rules
- Configure multiple templates for each notification type
- Multiple users who can create and manage their own rules
- Per-rule filtering options based on incoming service
There are a few ways to run this app and most of the time you'll want to create a config file.
See config/default.json
for an example of the config file. At this time only a Mysql/Mariadb database is supported.
When first run, the app will generate private and public gpg keys for use with JsonWebTokens. For security reasons these will not be saved
in the database and are instead saved in a config file in the /config
directory.
Using Rancher?
Easily start an Juxtapose Stack by adding my template catalog.
By far the easiest way to get up and running. Create this docker-compose.yml
version: "2"
services:
app:
image: jc21/juxtapose
ports:
- 80:80
environment:
- NODE_ENV=production
volumes:
- ./default.json:/srv/app/config/default.json
depends_on:
- db
links:
- db
restart: on-failure
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: "juxtapose"
MYSQL_DATABASE: "juxtapose"
MYSQL_USER: "juxtapose"
MYSQL_PASSWORD: "juxtapose"
volumes:
- ./mysql:/var/lib/mysql
restart: on-failure
In this docker-compose file, your Juxtapose config file should be named default.json
and should exist in the same directory as docker-compose.yml
This will define a Juxtapose container and also a Mariadb container to connect to. Make sure the database credentials match your config file entries.
Now it's time to start up the containers. First we'll start with the database first, because it takes a few seconds to intialize and in this time, the Juxtapose app will crash if it can't connect to it. Hence we will initialize it on it's own first:
docker-compose up db
Check the output and make sure there were no errors.
Now start the app/whole stack:
docker-compose up
And observe the output.
Create this docker-compose.yml
version: "2"
services:
app:
image: jc21/juxtapose
ports:
- 80:80
environment:
- NODE_ENV=production
volumes:
- ./default.json:/srv/app/config/default.json
restart: on-failure
In this docker-compose file, your Juxtapose config file should be named default.json
and should exist in the same directory as docker-compose.yml
Make sure your config database settings are correct! Juxtapose only needs a new, empty database to get started.
Now start the app:
docker-compose up
And observe the output.
Run this:
docker run --name juxtapose -p 80:80 -e NODE_ENV=production -v "./default.json:/srv/app/config/default.json" jc21/juxtapose
For this example, your Juxtapose config file should be named default.json
and should exist in the current directory.
Make sure your config database settings are correct! Juxtapose only needs a new, empty database to get started.
For when you don't know Docker and don't want to know. You'll need node version 6+ and a database ready to go.
If you intend on developing and extending this app, this is how you'll want to get started. You'll need docker-compose installed.
git clone https://github.com/jc21/juxtapose.git
cd juxtapose
bin/npm install
bin/gulp build
docker-compose up
This will start a nodemon container to monitor for changes in files and restart the node app.
To start monitoring for frontend files that need to be built with gulp:
bin/gulp
Juxtapose will create an admin user when it initialises the database. The login details are:
- Email:
[email protected]
- Password:
changeme
When the credentials for a Slack bot are invalid it crashes the entire app. This is due mainly
to the slackbots
package throwing errors incorrectly imo. Make sure you specify the correct
credentials when creating a Slack bot service. If you encounter this issue, simply remove the service
from the database with:
DELETE FROM `service` WHERE `type` = "slack";
-- alternatively update the api token:
UPDATE `service` SET `data` = '{"api_token":"NEWTOKEN"}' WHERE `type` = "slack";
It's as easy as adding this to your config file:
{
"port": 1234
}
It's actually pretty easy. Create a new Template and use this code for the content:
{
"text": "```<%= prettyPrint(arguments[0]) %>```",
"unfurl_links": false,
"unfurl_media": false
}
You'll see what kind of output to expect after you've saved the template.
Should you be running behind a HTTP Proxy, just specify the HTTP_PROXY
environment variable. Note: Proxy support was added in v1.0.1
version: "2"
services:
app:
image: jc21/juxtapose
ports:
- 80:80
environment:
- NODE_ENV=production
- HTTP_PROXY=http://10.60.10.1:3128
volumes:
- ./default.json:/srv/app/config/default.json
depends_on:
- db
links:
- db
restart: on-failure
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: "juxtapose"
MYSQL_DATABASE: "juxtapose"
MYSQL_USER: "juxtapose"
MYSQL_PASSWORD: "juxtapose"
volumes:
- ./mysql:/var/lib/mysql
restart: on-failure
or
docker run --name juxtapose -p 80:80 -e NODE_ENV=production -e HTTP_PROXY=http://10.60.10.1:3128 -v "./default.json:/srv/app/config/default.json" jc21/juxtapose