Matrix server with self build Element-Web

This instruction describes how to run Matrix server with custom Element-Web client.

Matrix - Matrix is an open standard for interoperable, decentralized, real-time communication over IP.

Element-Web - A glossy Matrix collaboration client for the web.




TL;DR

On repo development server

Clone Element-web source code:

userrepo@repo:~$ git clone https://github.com/vector-im/element-web.git

Change the code.

Build new docker image (tag 0.1):

userrepo@repo:~/element-web$ docker build -t repo:5000/myelement:0.1 .

Upload created image to local registry:

userrepo@repo:~$ docker push repo:5000/myelement:0.1

On matrix test server

Execute ansible script for automatic build and deploy:

root@matrix:~# ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start

Prepare local docker registry and git server

Configure local registry server

OS name:

Configure network interface static IP and DNS:

Restart network service:

root@repo:~# service networking restart

Add domain name to DNS (Ubuntu server)

Install Docker Engine

Full instruction: Docker

Install necessary packages:

$ apt-get install ca-certificates curl gnupg lsb-release

Get keys add docker repository:

Update and install packages:

Add current user to docker group in order to run docker without root privileges:

Enable docker to start at system boot:

Clone Element-Web source code from github to local PC (repo):

Change description name and version:

Build docker image from local source (the command contains dot “.” in the end!):

Check built images:

Run local image for testing:

$ docker run -p 80:80 myelement:0.1

Now you could open local IP url in a browser to check running element-web.

Run local registry

Reference: Docker blog

Start local registry from dockerhub image

Add new local tag to the image

Upload image to local registry

userrepo@repo:~$ docker push repo:5000/myelement:0.1

Remove image from local file system

Checking pull image from local registry

Add security exception for local registry for testing purpose only:

Pull image test

Configuring matrix server

Network interface config

Resolving configuration

Checking image pull from local registry repo

If you have this error you need to create SSL certificates for local registry:

Using not secure http is a bad idea. We add this exception for local server for testing purpose:

Restart docker service:

Test image pull from local repo server

Configuring ansible script to use self build image

Reference: matrix-docker-ansible-deploy

Configuring local git server (repo)

Reference: git-server-docker

userrepo@repo:~$ docker pull jkarlos/git-server-docker

Prepare ssh config:

Generate and copy ssh user keys

Start local git server from docker image

$ docker run -d -p 2222:22 -v ~/keys:/git-server/keys -v ~/repos:/git-server/repos jkarlos/git-server-docker

Upload git repository

Test to clone source code from local repo

$ git clone ssh://repo/git-server/repos/element-web.git

Comments

Popular posts from this blog

MX-ONE short installation and maintenance guide (Russian)

Mitel SIP-phone XML API configuration server on Python/Flask and registration on Asterisk PBX