Skip to main content

The morio git repository

The source code for Morio is available as a git repository, hosted at:

It is a so-called meaning that it includes code for all the various components that make up Morio.

Quickstart

First clone the repository, then run the kickstart :

Terminal
git clone git@codeberg.org:certeu/morio.git
cd morio
npm run kickstart

This will setup dependencies, and get your repository in a state that is ready to go.

Development environment setup

Supported development platforms

While the notes below are for Debian based systems, any Linux system with the required dependencies should make for an excellent development environment.

While we do welcome contributions from people who use MacOS or Windows as their development platform of choice, we do not provide support for these platforms as a development environment.

Install dependencies

Docker & git

To develop Morio, we’ll need docker and git, so let’s install those.

Terminal
sudo apt install git docker.io
note

If you are on a different flavor of Linux, the docker package might have a different name. Alternatively, you can install from docker.com

Install NodeJS

While you can get away with minimal changes without NodeJS, any non-trivial development work will require you to have NodeJS on your system, since we rely on run-scripts to automate tasks within the repository.

We recommend using nvm to install NodeJS: https://github.com/nvm-sh/nvm

We will be using NodeJS 22, specifically the LTS release known as jod. So install it:

Terminal
nvm install lts/jod

Optional: Install Go

If you want to contribute to, or work on, the Morio client, you will also need Go on your system.

To install Go, please follow the instructions on go.dev.

Clone repository

Via SSH:

Terminal
git clone git@codeberg.org:certeu/morio.git

Or via HTTPS:

Terminal
git clone https://codeberg.org/centeu/morio.git

Run kickstart

Enter the root of the repository and run:

Terminal
npm run kickstart

This will install all (node) dependencies, and setup some repository specific things.

Rights to the docker socket

To run the development environment, we’ll be starting containers. This requires access to the docker socket. Typically, you can grant yourself access by adding your user to the docker group:

Terminal
sudo usermod -aG docker $USER

You will need to log out and back in for this change to take effect. Alternatively, newgrp docker will work too.

Build the containers

The development environment will start (the development version of) a couple of containers. Before we can do that, we need to build them:

Terminal
npm run build:dev

Permissions

For now, NextJS needs access to ui/.next

The morio-ui container will need write access to the ui/.next folder. For a quick fix you can run mkdir ui/.next && chmod 777 ui/.next in the repository root.

We are planning to migrate away from NextJS, but for now, please make this manual change.

Start the development environment

In the repository root run:

Terminal
npm run dev

You probably want to keep an eye on the docker logs of core to see what’s going on:

Terminal
docker logs -f core

Or, to format the logs nicely, install pino-pretty:

Terminal
npm i -G pino-pretty

Then pipe the logs into it, stripping some of the fields we don’t care about:

Terminal
docker logs -f core | pino-pretty --ignore pid,time,hostname

That’s a lot of typing, so we have a for that:

Terminal
npm run logs:code

And the equivalent for the morio-api container:

Terminal
npm run logs:api

Structure

The repository has the following top-level folders:

  • ansible: Holds Ansible playbook for deployments, building artifacts, and testing
  • api: Holds the source code for the api service
  • client: Holds the source code for the Morio client
  • config: Holds configuration for various services
  • core: Holds the source code for the core service
  • docs: Holds the Morio documentation
  • infra: Holds infrastructure data, such as the scripts to install Morio
  • media: Holds images and branding material
  • pkgs: Holds configuration and source code for the various packages we provide
  • scripts: Holds scripts to automate various tasks
  • shared: Holds code shared between the api service and the core service
  • tap: Holds source code for the tap service
  • tests: Holds various tests
  • ui: Holds source code for the ui service