Code Monkey home page Code Monkey logo

synapse-nspawn's Introduction

synapse-nspawn

Run Synapse on localhost in a Debian container.

Note to self: as of Nov 30 2021, I noticed that recent versions of mkosi produce an image missing /etc/resolv.conf and without working name resolution. Unsure why. In the meantime, the following version works:

python3 -m pip install --user git+https://github.com/systemd/mkosi.git@f9b565e11a7310d69c314f12d4c8d173e3196812

Prerequisites (minimum)

To install prerequisites on Debian-based distributions, run:

sudo apt install systemd-container debootstrap debian-archive-keyring
python3 -m pip install --user git+https://github.com/systemd/mkosi.git

To install prerequisites on other systemd-based platforms:

  • If your distribution lacks systemd-nspawn and machinectl, install the package systemd-container
  • Install the packages debootstrap and debian-archive-keyring, then install mkosi from source

Quickstart

To spawn a minimal Synapse homeserver on localhost:8008, run:

git clone https://github.com/matrix-org/synapse.git
git clone https://github.com/DWeb-Deconstruction-Project/synapse-nspawn.git
cd synapse-nspawn
sudo -E python3 -m mkosi --build-sources ../synapse --minimize
sudo systemd-nspawn --machine synapse --settings trusted

Usage

mkosi uses a two-phase process to allow fast incremental builds of code in the container. Run mkosi with the --incremental flag and with --build-sources set to the root of your existing Synapse code tree. On subsequent builds, use the --force flag to install your modified code:

sudo -E python3 -m mkosi --build-sources ../synapse --incremental --force

The image synapse.raw is created in /var/lib/machines/, and can be easily booted with systemd-nspawn:

sudo systemd-nspawn --machine synapse --settings trusted

Notes

  • Ignore the btrfs error at the end of the mkosi build process
  • mkosi does not cache the Python packages installed in mkosi.prepare, so these packages are downloaded twice during the initial build process
  • The included Synapse service, sysuser, and tmpfile configs are based on those of the Arch package
  • The included systemd log config is from the official Synapse repo

synapse-nspawn's People

Contributors

smpsnr avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.