Adding Bridges code as git subtree. (#2515)

* Add instructions.

* Squashed 'bridges/' content from commit 345e84a21

git-subtree-dir: bridges
git-subtree-split: 345e84a2146b56628e9888c9f5e129cb40e868a9

* Remove bridges workspace file to avoid confusing Cargo.

* Add some bridges primitives to Polkadot workspace.

* Improve docs.
This commit is contained in:
Tomasz Drwięga
2021-03-01 22:33:16 +01:00
committed by GitHub
parent 7a2c7aa3fe
commit 5169155f94
291 changed files with 64249 additions and 0 deletions
@@ -0,0 +1,18 @@
FROM ruby:alpine
RUN apk add --no-cache git
ENV APP_HOME /app
ENV RACK_ENV production
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
# The latest master has some changes in how the application is run. We don't
# want to update just yet so we're pinning to an old commit.
RUN git clone https://github.com/ananace/ruby-grafana-matrix.git $APP_HOME
RUN git checkout 0d662b29633d16176291d11a2d85ba5107cf7de3
RUN bundle install --without development
RUN mkdir /config && touch /config/config.yml && ln -s /config/config.yml ./config.yml
CMD ["bundle", "exec", "bin/server"]
@@ -0,0 +1,15 @@
# A disabled version of monitoring.
#
# We replace each service with a no-op container. We can't simply not include this file,
# cause the bridge-specific compose files might have overrides.
version: '3.5'
services:
prometheus-metrics:
image: alpine
grafana-dashboard:
image: alpine
grafana-matrix-notifier:
image: alpine
@@ -0,0 +1,28 @@
version: '3.5'
services:
prometheus-metrics:
image: prom/prometheus:v2.20.1
ports:
- "9090:9090"
grafana-dashboard:
image: grafana/grafana:7.1.3
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASS:-admin}
GF_SERVER_ROOT_URL: ${GRAFANA_SERVER_ROOT_URL}
GF_SERVER_DOMAIN: ${GRAFANA_SERVER_DOMAIN}
ports:
- "3000:3000"
depends_on:
- prometheus-metrics
grafana-matrix-notifier:
build:
context: .
dockerfile: ./monitoring/GrafanaMatrix.Dockerfile
volumes:
- ./monitoring/grafana-matrix:/config
ports:
- "4567:4567"
depends_on:
- grafana-dashboard
@@ -0,0 +1,49 @@
---
# Webhook server configuration
# Or use the launch options `-o '::' -p 4567`
#bind: '::'
#port: 4567
# Set up your HS connections
matrix:
- name: matrix-parity-io
url: https://matrix.parity.io
# Create a user - log that user in using a post request
# curl -XPOST -d '{"type": "m.login.password",
# "user":"grafana",
# "password":"2m4ny53cr3t5"}'
# "https://my-matrix-server/_matrix/client/r0/login"
# Fill that access token in here
access_token: "<access_token>"
#device_id: <device> # Optional
# The default message type for messages, should be either m.text or m.notice,
# defaults to m.text
msgtype: m.text
# Set up notification ingress rules
rules:
- name: bridge # Name of the rule
room: "#bridges-workers:matrix.parity.io" # Room or ID
matrix: matrix-parity-io # The Matrix HS to use - defaults to first one
msgtype: m.notice
# The following values are optional:
image: true # Attach image to the notification?
embed_image: true # Upload and embed the image into the message?
#templates:
# Templates to use when rendering the notification, available placeholders:
# %TEMPLATES% - lib/grafana_matrix/templates
# $<env> - Environment variables
#html: "%TEMPLATES%/html.erb" # Path to HTML template
#plain: "%TEMPLATES%/plain.erb" # Path to plaintext template
#auth:
#user: example
#pass: any HTTP encodable string
#- name: other-hq
# room: "#hq:private.matrix.org
# matrix: matrix-priv
# To use the webhook, you need to configure it into Grafana as:
#
# Url: http://<server address>:<port>/hook?rule=<rule name>
# Http Method: POST