【FireFox Send】自建文件加密分享传输网站
本文最后更新于:2022年11月30日 下午
Firefox Send
服务于2019年3月上线,提供了安全、私密的文件托管和文件共享服务。无需注册。但因为这种安全特性,被黑客滥用传播黑客工具。2020 年 7 月,Mozilla
宣布暂时中止 Firefox Send
服务。虽然官方网站很可惜不能用了,但 Firefox
慷慨地开源了网站,我们可以自建来使用。
文件分享服务
可能大家听得比较多的是奶牛快传、sendAnywhere
这些。但其实文件分享服务还有很多,不过基本上我都没用过,所以只是分享一下:
- https://transfer.sh/
- https://uguu.se/ 单次上限100MB
- https://anonfiles.com/
- https://letsupload.co/
- https://secufiles.com/
- https://wetransfer.com/
- https://wormhole.app/
- https://filedoge.com/
- https://demo.jirafeau.net/ 也能自建 https://gitlab.com/mojo42/Jirafeau
- https://plik.root.gg 也能自建 https://github.com/root-gg/plik
- https://oshi.at/
- https://anonfiles.com/ https://filechan.org/
- https://ttm.sh/
- https://send.internxt.com/
- https://bashupload.com/ 有效期3天,只能下载一次
- https://airportal.cn/
- https://musetransfer.com/
- https://snapdrop.net/ 无需APP,仅局域网
- https://termbin.com/
- https://temp.sh/
其他可自建:
项目地址
- 原版项目地址:https://github.com/mozilla/send
- 民间维护版项目地址:https://github.com/timvisee/send
- 实例列表(不保证没改过代码,不保证安全性):https://github.com/timvisee/send-instances
下面会分别介绍原版和维护版的安装,建议用维护版,兼容 ffsend 。
Requirements
- Node.js 12.x (原版)
- Node.js 16.x (维护版)
- Redis server (可选)
- AWS S3 or compatible service (可选)
- git
本文教程假设
- 你有一个服务器
- 你懂基本的 Linux 命令行操作
本文基于 Ubuntu 20.04 系统,其他 Linux 系统类似,但不保证可行性。
安装依赖
1 |
|
安装 redis【可选】
docker-compose 安装
1 |
|
输入:
1 |
|
启动
1 |
|
开始安装
注意,不能使用 root 用户来编译!所以我们需要新建用户并切换至新用户。
下载
原版:
1 |
|
维护版
1 |
|
新建用户
1 |
|
原版依赖问题【可跳过不看】
由于原版 FireFox Send
已经不再维护,它的依赖 webcrypto-core
是旧版本的。
参考:(谈firefox-send安装与new Error(“Cannot find module ‘webcrypto-core’”);错误)[https://fudaoyuan.icu/2022/02/25/%E8%B0%88firefox-send%E5%AE%89%E8%A3%85%E4%B8%8Enew-errorcannot-find-module-webcrypto-core%E9%94%99%E8%AF%AF/]
所以这个仓库是在原来代码上进行了修改,在 package.json
中增加一行
1 |
|
编译安装
输入下面命令:
1 |
|
运行
根据官方文档,是使用 su www-data -c
,但会出现提示 This account is currently not available.
因为 www-data
是 no-login
的。所以换别的。
维护版的运行
维护版还需要额外添加环境变量,可选的变量有:
Name | Description |
---|---|
BASE_URL | The HTTPS URL where traffic will be served (e.g. https://send.firefox.com ) |
DETECT_BASE_URL | Autodetect the base URL using browser if BASE_URL is unset (defaults to false ) |
PORT | Port the server will listen on (defaults to 1443 ) |
NODE_ENV | Run in development mode (unsafe) or production mode (the default) |
SEND_FOOTER_DMCA_URL | A URL to a contact page for DMCA requests (empty / not shown by default) |
SENTRY_CLIENT , SENTRY_DSN | Sentry Client ID and DNS for error tracking (optional, disabled by default) |
Note: more options can be found here: https://github.com/timvisee/send/blob/master/server/config.js
Name | Description |
---|---|
MAX_FILE_SIZE | Maximum upload file size in bytes (defaults to 2147483648 aka 2GB) |
MAX_FILES_PER_ARCHIVE | Maximum number of files per archive (defaults to 64 ) |
MAX_EXPIRE_SECONDS | Maximum upload expiry time in seconds (defaults to 604800 aka 7 days) |
MAX_DOWNLOADS | Maximum number of downloads (defaults to 100 ) |
DOWNLOAD_COUNTS | Download limit options to show in UI dropdown, e.g. 10,1,2,5,10,15,25,50,100,1000 |
EXPIRE_TIMES_SECONDS | Expire time options to show in UI dropdown, e.g. 3600,86400,604800,2592000,31536000 |
DEFAULT_DOWNLOADS | Default download limit in UI (defaults to 1 ) |
DEFAULT_EXPIRE_SECONDS | Default expire time in UI (defaults to 86400 ) |
新建 .env
文件:
1 |
|
如果使用了 redis 就加入第二行,没有的话就删除
用 root 用户创建脚本,先退出回到root用户
1 |
|
再使用root用户:
1 |
|
输入脚本内容:
1 |
|
运行:
1 |
|
原版的运行
用 nohup
运行就行,运行脚本
1 |
|
输入:
1 |
|
之后
1 |
|
Nginx 反代
记得修改 send.example.com
成你的:
1 |
|