自建SnapDrop类似Airdrop

date
May 12, 2022
slug
newservice-snapdrop-airdrop
status
Published
summary
新服务 Airdrop
tags
service
type
Post
URL
notion image

Summary

步骤

docker compose

mkdir -p /data/snapdrop_airdrop && cd /data/snapdrop_airdrop

cat > docker-compose.yml <<EOF
version: "2.1"
services:
  snapdrop_airdrop:
    image: lscr.io/linuxserver/snapdrop
    container_name: snapdrop_airdrop
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Hong_Kong
    volumes:
      - ./config:/config
    #ports:
      #- 18480:80
      #- 18443:443
    restart: unless-stopped
networks:
  default:
    name: npm_nginx_proxy_manager-network
    external: true
EOF

docker-compose down; docker-compose up -d; sleep 1s; docker-compose logs -f

在nginx的反代当中要加上

  • 正常网页访问80端口
  • ws upgrade 到3000

# inside npm npm_nginx_proxy_manager

location /server {
        proxy_connect_timeout 3000;
        proxy_pass http://snapdrop_airdrop:3000;
        proxy_set_header Connection "upgrade";
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header X-Forwarded-for $remote_addr;

    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #proxy_set_header X-NginX-Proxy true;
    # enables WS support
    proxy_http_version 1.1;
#    proxy_set_header Upgrade $http_upgrade;
#    proxy_set_header Connection "upgrade";
    proxy_read_timeout 999999999;
    }
notion image
notion image
notion image

原作者的nginx config

    notion image

    WebRtc一定要打开,我的用了这个插件后就无法用了,需要临时禁用

      notion image
      notion image
      notion image

      验证

       

      © Ying Bun 2021 - 2024