Skip to content

01. Install

Naoki Kosaka edited this page Mar 2, 2023 · 6 revisions

Install Activity-Relay

Docker Compose

Requirements

  • git
  • openssl
  • docker
  • docker-compose
  1. Pull a repository

    $ git clone https://github.com/yukimochi/Activity-Relay.git -b v2.0.0

    Note: Check for yourself the latest version here

  2. Copy and write config.yml

    config.yml format should be followed this

    $ cp config.yml.example config.yml
    $ vim config.yml
  3. Generate actor RSA certificate to ./actor.pem

    $ openssl genrsa -traditional | tee actor.pem
    $ chmod 600 actor.pem

    Note: If you use OpenSSL version <3, type openssl genrsa instead of openssl genrsa -traditional

  4. Build image and run services

    $ docker-compose build
    $ docker-compose up -d

    Verify that it is running

    $ docker-compose ps

    Stop services

    $ docker-compose down

Linux service

Requirements

  • openssl
  • relay binary that you build from source
  • systemctl --version 232 or newer
  • sudo privileges
  1. Move the relay binary into your $PATH

    $ sudo mv relay /usr/bin
  2. Test that it worked

    $ relay    
  3. Create a group named relay

    $ sudo groupadd --system relay
  4. Create a user named relay, with a writeable home folder

    $ sudo useradd --system \
    --gid relay \
    --create-home \
    --home-dir /var/lib/relay \
    --shell /usr/sbin/nologin \
    --comment "YUKIMOCHI Activity-Relay" \
    relay
  5. Place config.yml to /var/lib/relay/config.yml

    config.yml format should be followed this

    $ sudo mv config.yml /var/lib/relay
  6. Generate actor RSA certificate to /var/lib/relay/actor.pem

    $ openssl genrsa -traditional | sudo tee /var/lib/relay/actor.pem
    $ sudo chmod 600 /var/lib/relay/actor.pem
    $ sudo chown relay:relay /var/lib/relay/actor.pem

    Note: If you use OpenSSL version <3, type openssl genrsa instead of openssl genrsa -traditional

  7. Place systemd service files and start services

    Download from here a systemd service files and check the ExecStart directive. Make sure the binary's location are correct for your installation.

    $ sudo mv relay-api.service /etc/systemd/system
    $ sudo mv relay-worker.service /etc/systemd/system

    After saving your service file, you can start the service for the first time with the usual systemctl command

    $ sudo systemctl daemon-reload
    $ sudo systemctl enable relay-api
    $ sudo systemctl enable relay-worker
    $ sudo systemctl start relay-api
    $ sudo systemctl start relay-worker

    Verify that it is running

    $ systemctl status relay-api
    $ systemctl status relay-worker

    Stop services

    $ sudo systemctl stop relay-api
    $ sudo systemctl stop relay-worker