2022-07-08 08:18:12 +00:00
|
|
|
|
<p align="center">
|
|
|
|
|
<img src="./design/Github_zh-CN.png" alt="logo">
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<a href="https://discord.gg/nuby6RnxZt">
|
|
|
|
|
<img alt="discord" src="https://img.shields.io/discord/252403122348097536?style=for-the-badge" />
|
|
|
|
|
<img alt="docker pulls" src="https://img.shields.io/docker/pulls/cupcakearmy/cryptgeon?style=for-the-badge" />
|
|
|
|
|
<img alt="Docker image size badge" src="https://img.shields.io/docker/image-size/cupcakearmy/cryptgeon?style=for-the-badge" />
|
|
|
|
|
<img alt="Latest version" src="https://img.shields.io/github/v/release/cupcakearmy/cryptgeon?style=for-the-badge" />
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
<a href="https://www.producthunt.com/posts/cryptgeon?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cryptgeon" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=295189&theme=light" alt="Cryptgeon - Securely share self-destructing notes | Product Hunt" height="50" /></a>
|
|
|
|
|
<a href=""><img src="./.github/lokalise.png" height="50">
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
[EN](README.md) | 简体中文
|
|
|
|
|
|
|
|
|
|
## 关于本项目
|
|
|
|
|
|
|
|
|
|
_加密鸽_ 是一个受 [_PrivNote_](https://privnote.com)项目启发的安全、开源共享密信和文件共享服务器
|
|
|
|
|
|
|
|
|
|
> 🌍 如果你想翻译此项目请随时与我联系.
|
|
|
|
|
>
|
|
|
|
|
> 感谢 [Lokalise](https://lokalise.com/) 提供免费的平台服务支持
|
|
|
|
|
|
|
|
|
|
## 演示示例
|
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
查看加密鸽的在线演示 demo: https://cryptgeon.nicco.io.
|
2022-07-08 08:18:12 +00:00
|
|
|
|
|
|
|
|
|
## 功能
|
|
|
|
|
|
|
|
|
|
- 服务端无法解密和查看客户端加密的内容
|
|
|
|
|
- 查看次数或时间限制,阅后即焚
|
|
|
|
|
- 您发送的数据将存放于内存中,不会写入到磁盘中
|
|
|
|
|
- 黑暗模式支持
|
|
|
|
|
|
|
|
|
|
## 加密鸽是如何工作的?
|
|
|
|
|
|
|
|
|
|
加密鸽会为每条笔记都生成一个独立的 <code>id (256bit)</code> 和 <code>key 256(bit)</code>。
|
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
其中<code>id</code>用于保存和提取密信, 在这之后这封密信将会被客户端使用 AES 算法的 GCM 模式和`key`进行加密然后发送至服务器,数据将会保存在服务器的内存中且永远不会被持久化到硬盘上,服务端永远不会得到密钥并且无法解读密信的内容。
|
2022-07-08 08:18:12 +00:00
|
|
|
|
|
|
|
|
|
## 屏幕截图
|
|
|
|
|
|
|
|
|
|
![screenshot](./design/Screens.png)
|
|
|
|
|
|
|
|
|
|
## 环境变量
|
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
| 变量名称 | 默认值 | 描述 |
|
|
|
|
|
| ----------------- | ---------------- | --------------------------------------------------------------------------------- |
|
|
|
|
|
| `REDIS` | `redis://redis/` | Redis URL to connect to. |
|
|
|
|
|
| `SIZE_LIMIT` | `1 KiB` | 最大请求体(body)限制。有关支持的数值请查看 [字节单位](https://docs.rs/byte-unit/) |
|
|
|
|
|
| `MAX_VIEWS` | `100` | 密信最多查看次数限制 |
|
|
|
|
|
| ` MAX_EXPIRATION` | `360` | 密信最长过期时间限制(分钟) |
|
|
|
|
|
| `ALLOW_ADVANCED` | `true` | 是否允许自定义设置,该项如果设为`false`,则不会显示自定义设置模块 |
|
2022-07-08 08:18:12 +00:00
|
|
|
|
|
|
|
|
|
## 部署
|
|
|
|
|
|
|
|
|
|
ℹ️ 加密鸽必须使用`https`,否则浏览器可能将不会支援加密鸽的加密算法。
|
|
|
|
|
|
|
|
|
|
### Docker
|
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
Docker 是最简单的部署方式。这里是[官方镜像的地址](https://hub.docker.com/r/cupcakearmy/cryptgeon)。
|
2022-07-08 08:18:12 +00:00
|
|
|
|
|
|
|
|
|
附:译者的[部署笔记](https://www.hash070.top/archives/cryptgeon-docker-deploy.html)
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
# docker-compose.yml
|
2022-07-16 12:16:54 +00:00
|
|
|
|
version: '3.8'
|
2022-07-08 08:18:12 +00:00
|
|
|
|
|
|
|
|
|
services:
|
2022-07-16 12:16:54 +00:00
|
|
|
|
redis:
|
|
|
|
|
image: redis:7-alpine
|
2022-07-08 08:18:12 +00:00
|
|
|
|
|
|
|
|
|
app:
|
|
|
|
|
image: cupcakearmy/cryptgeon:latest
|
|
|
|
|
depends_on:
|
2022-07-16 12:16:54 +00:00
|
|
|
|
- redis
|
2022-07-08 08:18:12 +00:00
|
|
|
|
environment:
|
2022-07-16 12:16:54 +00:00
|
|
|
|
SIZE_LIMIT: 4 MiB
|
2022-07-08 08:18:12 +00:00
|
|
|
|
ports:
|
|
|
|
|
- 80:5000
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### NGINX 反向代理
|
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
查看 [examples/nginx](https://github.com/cupcakearmy/cryptgeon/tree/main/examples/nginx) 目录。那里有几个示例反代配置文件模板,其中一个是带 https 配置的反代配置模板,你需要指定服务器的名称和证书才能生效。
|
2022-07-08 08:18:12 +00:00
|
|
|
|
|
|
|
|
|
### Traefik 2
|
|
|
|
|
|
|
|
|
|
假设:
|
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
- 外部 Docker 代理网络 `proxy`
|
2022-07-08 08:18:12 +00:00
|
|
|
|
- 证书解析器 `le`
|
2022-07-16 12:16:54 +00:00
|
|
|
|
- 一个 https 入站点 `secure`
|
2022-07-08 08:18:12 +00:00
|
|
|
|
- 域名 `example.org`
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
version: '3.8'
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
proxy:
|
|
|
|
|
external: true
|
|
|
|
|
|
|
|
|
|
services:
|
2022-07-16 12:16:54 +00:00
|
|
|
|
redis:
|
|
|
|
|
image: redis:7-alpine
|
2022-07-08 08:18:12 +00:00
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
app:
|
|
|
|
|
image: cupcakearmy/cryptgeon:latest
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
depends_on:
|
2022-07-16 12:16:54 +00:00
|
|
|
|
- redis
|
2022-07-08 08:18:12 +00:00
|
|
|
|
networks:
|
|
|
|
|
- default
|
|
|
|
|
- proxy
|
|
|
|
|
labels:
|
|
|
|
|
- traefik.enable=true
|
|
|
|
|
- traefik.http.routers.cryptgeon.rule=Host(`example.org`)
|
|
|
|
|
- traefik.http.routers.cryptgeon.entrypoints=secure
|
|
|
|
|
- traefik.http.routers.cryptgeon.tls.certresolver=le
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 开发
|
|
|
|
|
|
|
|
|
|
**环境要求**
|
|
|
|
|
|
|
|
|
|
- `pnpm`: `>=6`
|
|
|
|
|
- `node`: `>=14`
|
|
|
|
|
- `rust`: edition `2021`
|
|
|
|
|
|
|
|
|
|
**安装**
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
pnpm install
|
|
|
|
|
pnpm --prefix frontend install
|
|
|
|
|
|
|
|
|
|
# Also you need cargo watch if you don't already have it installed.
|
|
|
|
|
# https://lib.rs/crates/cargo-watch
|
|
|
|
|
cargo install cargo-watch
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**运行**
|
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
确保你的 Docker 正在运行
|
2022-07-08 08:18:12 +00:00
|
|
|
|
|
|
|
|
|
> If you are on `macOS` you might need to disable AirPlay Receiver as it uses port 5000 (So stupid...)
|
|
|
|
|
> https://developer.apple.com/forums/thread/682332
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
pnpm run dev
|
|
|
|
|
```
|
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
在根目录执行 `pnpm run dev` 会开启下列服务:
|
2022-07-08 08:18:12 +00:00
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
- 一个 redis docker 容器
|
2022-07-08 08:18:12 +00:00
|
|
|
|
- 无热重载的 rust 后端
|
|
|
|
|
- 可热重载的客户端
|
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
你可以通过 1234 端口进入该应用,即 [localhost:1234](http://localhost:1234).
|
2022-07-08 08:18:12 +00:00
|
|
|
|
|
|
|
|
|
###### Attributions
|
|
|
|
|
|
2022-07-16 12:16:54 +00:00
|
|
|
|
本项目所使用的图标由<a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com 的<a href="https://www.freepik.com" title="Freepik">freepik</a>制作</a>
|