This repository has been archived by the owner. It is now read-only.

pub-relay

h3zjp pub-relay Server

pub-relay

...is a service-type ActivityPub actor that will re-broadcast anything sent to it to anyone who subscribes to it.

forked by mastodon / pub-relay · GitLab

Endpoints:

  • GET /actor
  • GET /stats
  • POST /inbox
  • GET /list
  • GET /.well-known/webfinger

Operations:

  • Send a Follow activity to the inbox to subscribe (Object: https://www.w3.org/ns/activitystreams#Public)
  • Send an Undo of Follow activity to the inbox to unsubscribe (Object of object: https://www.w3.org/ns/activitystreams#Public)
  • Send anything else to the inbox to broadcast it (Supported types: Create, Update, Delete, Announce, Undo)

Requirements:

  • All requests must be HTTP-signed with a valid actor
  • Only payloads that contain a linked-data signature will be re-broadcast
  • Only payloads addressed to https://www.w3.org/ns/activitystreams#Public will be re-broadcast

Installation

※ Require Crystal (≦0.27.2), Redis

  1. user add

    useradd pub-relay  
    sudo su - pub-relay  
    git clone https://github.com/h3zjp/pub-relay.git  
    cd pub-relay
    
  2. build

    shards update
    shards build --release
    
  3. generate key

    openssl genrsa 2024 > ~/.ssh/actor.pem
    chmod 600 ~/.ssh/actor.pem
    
  4. systemctl add

    vi /etc/systemd/system/pub-relay.service

    [Unit]
    Description=pub-relay Server
    After=network.target
    
    [Service]
    Type=simple
    User=pub-relay
    WorkingDirectory=/home/pub-relay/pub-relay
    Environment="RELAY_DOMAIN=Domain (Example: pub-relay.hama3.net)"
    Environment="RELAY_HOST=Host (Default: localhost)"
    Environment="RELAY_PORT=Port (Default: 8085)"
    Environment="RELAY_PKEY_PATH=/home/pub-relay/.ssh/actor.pem"
    Environment="REDIS_URL=redis://Server:Port/DB (Example: 127.0.0.1:6379/0)"
    ExecStart=/home/pub-relay/pub-relay/bin/pub-relay
    TimeoutSec=20
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    
  5. systemctl start

    systemctl daemon-reload
    systemctl start pub-relay
    systemctl enable pub-relay
    
  6. Enjoy!

Usage

TODO

Contributors

  • RX14 creator, maintainer
Repository

pub-relay

Owner
Statistic
  • 0
  • 1
  • 0
  • 0
  • 5
  • over 4 years ago
  • December 21, 2018
License

GNU Affero General Public License v3.0

Links
Synced at

Sun, 22 Dec 2024 22:03:04 GMT

Languages