Send是非常好用的端到端加密的文件传送服务,界面简洁,非常好用。是Firefox Send停止维护后另有人接手开发的软件。
官方提供了docker-compose的配置文件和详细的教程。但是我本人部署过程中遇到了nginx-proxy和ssl证书配置出错的问题,所以自行配置了nginx相关的配置。
官方源码:[https://github.com/timvisee/send-docker-compose
我部署的过程:
- 1 克隆到服务器
git clone https://github.com/timvisee/send-docker-compose && cd send-docker-compose
2 运行
cp .env.example .env
和然后编辑.env
文件#Host to expose Send on HOST=你的域名 #Base URL for Send SEND_BASE_URL=你的域名 #Optional: for LetsEncrypt SSL, same as HOST LETSENCRYPT_HOST= #Optional: for LetsEncrypt SSL, your email address LETSENCRYPT_EMAIL=
3 编辑
docker-compose.yaml
文件,此处我没有使用nginx-proxy和ssl证书相关的配置。services: send: image: '${DOCKER_SEND_IMAGE}' restart: always ports: - '1234:1234' volumes: - ./uploads:/uploads environment: - VIRTUAL_HOST=${HOST} - VIRTUAL_PORT=1234 - DHPARAM_GENERATION=false - LETSENCRYPT_HOST - LETSENCRYPT_EMAIL - NODE_ENV=production - BASE_URL=${SEND_BASE_URL} - PORT=1234 - REDIS_HOST=redis #For local uploads storage - FILE_DIR=/uploads #For S3 object storage (disable volume and FILE_DIR variable) #- AWS_ACCESS_KEY_ID= #- AWS_SECRET_ACCESS_KEY= #- S3_BUCKET= #- S3_ENDPOINT= #To customize upload limits #- EXPIRE_TIMES_SECONDS=3600,86400,604800,2592000,31536000 #- DEFAULT_EXPIRE_SECONDS=3600 #- MAX_EXPIRE_SECONDS=31536000 - DOWNLOAD_COUNTS=1,2,5,10,15,25,50,100 - MAX_DOWNLOADS=100 - MAX_FILE_SIZE=268435456 redis: image: 'redis:alpine' restart: always volumes: - send-redis:/data volumes: send-redis: proxy-certs: proxy-vhost: proxy-html:
- 4 自行配置nginx和ssl证书,我的nginx反代配置
server {
listen 0.0.0.0:80;
listen 0.0.0.0:443;
server_name 你的域名;
client_max_body_size 0;
location /
{
proxy_pass http://127.0.0.1:1234;
proxy_set_header Host $host;
# set headers to support websocket
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
set $upstream_app send;
set $upstream_port 1234;
set $upstream_proto http;
}
ssl_certificate /etc/letsencrypt/live/你的域名/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/你的域名/privkey.pem;
}
- 5 运行
docker-compose up -d
等会打开你的域名就在运行了。