Giter VIP home page Giter VIP logo

go-matrix's Introduction

go-matrix is a library and commandline tool that implements interacting with a Matrix home server and sending encrypted and non-encrypted messages. It also includes a slack2matrix gateway for rewriting slack webhooks to matrix messages.

Installation

Docker

Use the Docker image justinbarrick/matrixctl:v0.0.10

Download binary

Download the binary: curl https://github.com/justinbarrick/go-matrix/releases/download/v0.0.10/matrixctl -O && chmod +x matrixctl.

Build from source

Build the command with go get github.com/justinbarrick/go-matrix/cmd/matrixctl.

Usage

Register an account:

matrixctl register matrix.org user password

Login to an existing account:

matrixctl login matrix.org user password

Logout of an account:

matrixctl logout

Logout all sessions for an account:

matrixctl logout -a

Join a channel:

matrixctl join !asnetahoesnuth:matrix.org

Send a plaintext message to a channel:

matrixctl msg '!asnetahoesnuth:matrix.org' 'hi!'

Send an encrypted message to a channel:

matrixctl msg -e '!asnetahoesnuth:matrix.org' 'hi!'

Start an slack webhooks service on port 8000:

matrixctl slack2webhook '!asnetahoesnuth:matrix.org'

You can then send a message through the gateway:

docker run --env SLACK_WEBHOOK_URL=http://172.17.0.1:8000 suhlig/slack-message hi

Deploying webhook service to Kubernetes

To deploy the slack2webhook service to Kubernetes, login or register:

matrixctl login matrix.org user password

Now add the file as a secret to your deployment YAML file:

kubectl create secret generic slack2matrix --from-file=$HOME/.matrix/config.json -o yaml --dry-run >> deploy/kubernetes.yaml

Now deploy the configuration: kubectl apply -f deploy/kubernetes.yaml.

It should now be reachable at slack2matrix.default.svc.cluster.local:8000.

Tracing

Slack2matrix can export traces to Jaeger by setting the JAEGER_ENDPOINT environment variable.

Versioning

Matrixctl follows semver for versioning, but also publishes development images tagged with $BRANCH-$COMMIT.

If you use flux, to track release images:

fluxctl policy -c default:deployment/slack2matrix --tag-all='v0*'

To track the latest pre-release images:

fluxctl policy -c default:deployment/slack2matrix --tag-all='master-*'

And then you can automate it:

fluxctl automate -c default:deployment/slack2matrix

go-matrix's People

Stargazers

Zeigren avatar  avatar

Watchers

James Cloos avatar

Forkers

venatiodecorus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.