安装配置Activity-Relay

分享
1824 0
AI摘要:本文介绍了如何安装和配置Activity-Relay。首先需要安装git、openssl、nginx、docker和docker-compose。然后从仓库中拉取代码,并复制编辑config.yml文件。接下来生成actor RSA证书,并构建镜像并运行服务。最后可以通过docker-compose ps命令查看容器的运行状态。文章还提供了相关参考的docker-compose配置和Nginx设置。最后给出了一个演示和订阅中转站的链接。

Powered by AISummary.

准备工作

  • git
  • openssl
  • nginx
  • docker
  • docker-compose

从仓库Pull a repository

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

注意: 这里可以选择latest version

复制编辑config.yml

进入Activity-Relay目录

cd Activity-Relay
cp config.yml.example config.yml
 vim config.yml

生成actor RSA 证书 ./actor.pem

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

构建镜像与运行服务

docker-compose build
docker-compose up -d

查看容器运行状态

docker-compose ps

停止服务

docker-compose down

相关参考

docker-compose配置

version: "2.3"
services:
  redis:
    restart: always
    image: redis:alpine
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
    volumes:
      - "./redisdata:/data"

  worker:
    container_name: worker
    build: .
    image: yukimochi/activity-relay
    working_dir: /var/lib/relay
    restart: always
    init: true
    command: relay worker
    volumes:
      - "./actor.pem:/var/lib/relay/actor.pem"
      - "./config.yml:/var/lib/relay/config.yml"
    depends_on:
      - redis

  server:
    container_name: relay
    build: .
    image: yukimochi/activity-relay
    working_dir: /var/lib/relay
    restart: always
    init: true
    ports:
      - "8080:8080"
    command: relay server
    volumes:
      - "./actor.pem:/var/lib/relay/actor.pem"
      - "./config.yml:/var/lib/relay/config.yml"
    depends_on:
      - redis

Nginx设置

upstream relay {
    server 127.0.0.1:8080;
  }
  server {
    server_name relay.example.com;

    location / {
      root /var/lib/relay;
      try_files $uri $uri/index.html =404;
    }

    location /inbox {
      rewrite ^/inbox(.*) /$1 break;
      proxy_pass http://relay/;
      proxy_pass_request_headers on;
      proxy_set_header Host $http_host;
    }

    location /actor {
      rewrite ^/inbox(.*) /$1 break;
      proxy_pass http://relay/;
      proxy_pass_request_headers on;
      proxy_set_header Host $http_host;
    }

  }

演示

https://relay.ima.cm

订阅我的中转站

https://relay.ima.cm/inbox

最后更新 2024-01-12
评论 ( 0 )
OωO
隐私评论