Code Monkey home page Code Monkey logo

pub-relay's Introduction

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

pub-relay's People

Contributors

rx14 avatar gargron avatar h3zjp avatar noellabo avatar

Watchers

 avatar

Forkers

mashirozx

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.