All Projects → devture → matrix-corporal

devture / matrix-corporal

Licence: AGPL-3.0 License
Matrix Corporal: reconciliator and gateway for a managed Matrix server

Programming Languages

go
31211 projects - #10 most used programming language
python
139335 projects - #7 most used programming language
PHP
23972 projects - #3 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to matrix-corporal

server
Server/API for Vela (Target's official Pipeline Automation Framework)
Stars: ✭ 74 (-26%)
Mutual labels:  golang-application
pigger
A cross-platform note taking and static blog writing system in golang
Stars: ✭ 16 (-84%)
Mutual labels:  golang-application
smtp-dkim-signer
SMTP-proxy that DKIM-signs e-mails before submission to an upstream SMTP-server.
Stars: ✭ 28 (-72%)
Mutual labels:  golang-application
Morpheus
A Matrix client written in Go-QT
Stars: ✭ 20 (-80%)
Mutual labels:  golang-application
rss2email
Convert RSS feeds to emails
Stars: ✭ 72 (-28%)
Mutual labels:  golang-application
go-mux-jwt-boilerplate
Golang REST API using MUX, GORM, and JWT for authentication
Stars: ✭ 41 (-59%)
Mutual labels:  golang-application
matrix-registration
a token based matrix registration api
Stars: ✭ 182 (+82%)
Mutual labels:  matrix-org
rust-synapse-compress-state
A tool to compress some state in a Synapse instance's database
Stars: ✭ 69 (-31%)
Mutual labels:  matrix-org
go-evepraisal
the code that powers evepraisal.com
Stars: ✭ 61 (-39%)
Mutual labels:  golang-application
jump-jump
开箱即用,Golang 开发的一个功能完善的短链接系统。URL shortener service developed with golang.
Stars: ✭ 110 (+10%)
Mutual labels:  golang-application
AgentSmith
🕴 An IRC server that is actually a Matrix client. Use your favourite IRC client to communicate with the Matrix.
Stars: ✭ 35 (-65%)
Mutual labels:  matrix-org
go
A Golang Matrix framework.
Stars: ✭ 192 (+92%)
Mutual labels:  matrix-org
authz0
🔑 Authz0 is an automated authorization test tool. Unauthorized access can be identified based on URLs and Roles & Credentials.
Stars: ✭ 248 (+148%)
Mutual labels:  golang-application
AutoSpotting
Saves up to 90% of AWS EC2 costs by automating the use of spot instances on existing AutoScaling groups. Installs in minutes using CloudFormation or Terraform. Convenient to deploy at scale using StackSets. Uses tagging to avoid launch configuration changes. Automated spot termination handling. Reliable fallback to on-demand instances.
Stars: ✭ 2,058 (+1958%)
Mutual labels:  golang-application
toggler
toggler is a feature flag service to decouple deployment, feature enrollment and experiments
Stars: ✭ 27 (-73%)
Mutual labels:  golang-application
urlredir
Educational URL redirector service in Go
Stars: ✭ 26 (-74%)
Mutual labels:  golang-application
breakglass
A command line tool to provide login credentials from Hashicorp Vault
Stars: ✭ 33 (-67%)
Mutual labels:  golang-application
GOCSP-responder
OCSP responder written in Go meant to be used with easy-rsa
Stars: ✭ 24 (-76%)
Mutual labels:  golang-application
gino-keva
A simple Git Notes Key Value store
Stars: ✭ 23 (-77%)
Mutual labels:  golang-application
gin-rest-api
Example golang using gin framework everything you need, i create this tutorial special for beginner.
Stars: ✭ 56 (-44%)
Mutual labels:  golang-application

Support room on Matrix donate

Matrix Corporal: reconciliator and gateway for a managed Matrix server

matrix-corporal manages your Matrix server according to a configuration policy.

The point is to have a single source of truth about users/rooms/communities somewhere (say in an external system, like your intranet), and have something (matrix-corporal) continually reconfigure your Matrix server in accordance with it.

In a way, it can be thought of as "Kubernetes for Matrix", in that it takes such a JSON policy as an input, and performs reconciliation with the Matrix server -- creating, activating, disabling user accounts, making them (automatically) join/leave rooms and communities, etc.

Besides reconciliation, matrix-policy also does firewalling (acts as a gateway). You can put matrix-corporal in front of your Matrix Synapse server, and have it capture all Matrix API requests and allow/deny them in accordance with the policy.

With reconciliation and firewalling both working together, matrix-corporal ensures that your Matrix server's state always matches what the policy says, and that no user is allowed to perform actions which take the server out of that equilibrium.

For more information, read below or jump to the FAQ.

Features

You give matrix-corporal a policy document by some means (some policy provider, and it takes care of the following things for you:

  • creating user accounts according to the policy or disabling user accounts and revoking access

  • authenticating users according to the policy (plain-text passwords, hashed passwords, REST auth)

  • changing user profile data (names and avatars), to keep them in sync with the policy

  • changing user room/community memberships, to keep them in sync with the policy

  • allowing or denying Matrix API requests, to prevent the server state deviating from the policy

Example

It's probably best explained with an example. Here's a policy that matrix-corporal can work with:

{
	"schemaVersion": 1,

	"flags": {
		"allowCustomUserDisplayNames": false,
		"allowCustomUserAvatars": false
	},

	"managedRoomIds": [
		"!roomA:example.com",
		"!roomB:example.com",
	],

	"managedCommunityIds": [
		"+a:example.com",
		"+b:example.com"
	],

	"hooks": [
		{
			"id": "custom-hook-to-prevent-banning",
			"eventType": "beforeAnyRequest",
			"routeMatchesRegex": "^/_matrix/client/r0/rooms/([^/]+)/ban",
			"methodMatchesRegex": "POST",
			"action": "reject",
			"responseStatusCode": 403,
			"rejectionErrorCode": "M_FORBIDDEN",
			"rejectionErrorMessage": "Banning is forbidden on this server. We're nice like that!"
		},

		{
			"id": "custom-hook-to-reject-room-creation-once-in-a-while",
			"eventType": "beforeAuthenticatedPolicyCheckedRequest",
			"routeMatchesRegex": "^/_matrix/client/r0/createRoom",
			"action": "consult.RESTServiceURL",
			"RESTServiceURL": "http://hook-rest-service:8080/reject/with-33-percent-chance",
			"RESTServiceRequestHeaders": {
				"Authorization": "Bearer SOME_TOKEN"
			}
		}
	],

	"users": [
		{
			"id": "@john:example.com",
			"active": true,
			"authType": "plain",
			"authCredential": "PaSSw0rD",
			"displayName": "John",
			"avatarUri": "https://example.com/john.jpg",
			"joinedCommunityIds": ["+a:example.com"],
			"joinedRoomIds": ["!roomA:example.com", "!roomB:example.com"]
		},
		{
			"id": "@peter:example.com",
			"active": true,
			"authType": "sha1",
			"authCredential": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
			"displayName": "Just Peter",
			"avatarUri": "",
			"joinedCommunityIds": ["+b:example.com"],
			"joinedRoomIds": ["!roomB:example.com"]
		},
		{
			"id": "@george:example.com",
			"active": true,
			"authType": "rest",
			"authCredential": "https://intranet.example.com/_matrix-internal/identity/v1/check_credentials",
			"displayName": "Georgey",
			"avatarUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
			"joinedCommunityIds": ["+a:example.com", "+b:example.com"],
			"joinedRoomIds": ["!roomA:example.com", "!roomB:example.com"]
		}
	]
}

The JSON policy above, describes the state that your server should have:

  • managed communities - a list of communities that you want matrix-corporal to manage for you. Any other communities are untouched.

  • managed rooms - a list of rooms that you want matrix-corporal to manage for you. Any other rooms are untouched.

  • managed users (including their profile details and authentication data). Any other users are untouched.

  • membership information (which users need to be in which communities/rooms). Any other memberships are untouched.

As a result, matrix-corporal will perform a sequence of actions, ensuring that:

  • all users are created and that their corresponding credentials are made to work

  • all user details are made to match the policy (names, avatars, etc.)

  • inactive users will be disabled and prevented from logging in

  • users are automatically joined to or kicked out of the specified communities and rooms

Any time you change the policy in the future, matrix-corporal acts upon the Matrix server, so that its state is made to match the policy.

Installation

To configure and install matrix-corporal on your own server, follow the README in the docs/ directory.

Development / Experimenting

To give matrix-corporal a try (without actually installing it anywhere) or to do development on it, refer to the development introduction.

Support

Matrix room: #matrix-corporal:devture.com

Github issues: devture/matrix-corporal/issues

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].