documentation

This commit is contained in:
cupcakearmy 2022-07-15 20:15:10 +02:00
parent 0e47dab6d4
commit a4ffde78e4
No known key found for this signature in database
GPG Key ID: 3235314B4D31232F
5 changed files with 40 additions and 47 deletions

View File

@ -71,17 +71,16 @@ Docker is the easiest way. There is the [official image here](https://hub.docker
```yaml
# docker-compose.yml
version: '3.7'
version: '3.8'
services:
memcached:
image: memcached:1-alpine
entrypoint: memcached -m 128M -I 4M # Limit to 128 MB Ram, 4M per entry, customize at free will.
redis:
image: redis:7-alpine
app:
image: cupcakearmy/cryptgeon:latest
depends_on:
- memcached
- redis
environment:
SIZE_LIMIT: 4M
ports:
@ -109,16 +108,15 @@ networks:
external: true
services:
memcached:
image: memcached:1-alpine
redis:
image: redis:7-alpine
restart: unless-stopped
entrypoint: memcached -m 128M -I 4M # Limit to 128 MB Ram, 4M per entry, customize at free will.
app:
image: cupcakearmy/cryptgeon:latest
restart: unless-stopped
depends_on:
- memcached
- redis
networks:
- default
- proxy

View File

@ -26,7 +26,7 @@ _加密鸽_ 是一个受 [_PrivNote_](https://privnote.com)项目启发的安全
## 演示示例
查看加密鸽的在线演示demo https://cryptgeon.nicco.io.
查看加密鸽的在线演示 demo https://cryptgeon.nicco.io.
## 功能
@ -39,7 +39,7 @@ _加密鸽_ 是一个受 [_PrivNote_](https://privnote.com)项目启发的安全
加密鸽会为每条笔记都生成一个独立的 <code>id (256bit)</code><code>key 256(bit)</code>
其中<code>id</code>用于保存和提取密信, 在这之后这封密信将会被客户端使用AES算法的GCM模式和`key`进行加密然后发送至服务器,数据将会保存在服务器的内存中且永远不会被持久化到硬盘上,服务端永远不会得到密钥并且无法解读密信的内容。
其中<code>id</code>用于保存和提取密信, 在这之后这封密信将会被客户端使用 AES 算法的 GCM 模式和`key`进行加密然后发送至服务器,数据将会保存在服务器的内存中且永远不会被持久化到硬盘上,服务端永远不会得到密钥并且无法解读密信的内容。
## 屏幕截图
@ -47,13 +47,13 @@ _加密鸽_ 是一个受 [_PrivNote_](https://privnote.com)项目启发的安全
## 环境变量
| 变量名称 | 默认值 | 描述 |
| ------------------ | ----------------- | ------------------------------------------------------------ |
| `MEMCACHE` | `memcached:11211` | Memcached 连接 URL |
| `SIZE_LIMIT` | `1 KiB` | 最大请求体(body)限制。有关支持的数值请查看 [字节单位](https://docs.rs/byte-unit/) |
| `MAX_VIEWS` | `100` | 密信最多查看次数限制 |
| ` MAX_EXPIRATION` | `360` | 密信最长过期时间限制(分钟) |
| `ALLOW_ADVANCED` | `true` | 是否允许自定义设置,该项如果设为`false`,则不会显示自定义设置模块 |
| 变量名称 | 默认值 | 描述 |
| ----------------- | ---------------- | --------------------------------------------------------------------------------- |
| `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`,则不会显示自定义设置模块 |
## 部署
@ -61,23 +61,22 @@ _加密鸽_ 是一个受 [_PrivNote_](https://privnote.com)项目启发的安全
### Docker
Docker是最简单的部署方式。这里是[官方镜像的地址](https://hub.docker.com/r/cupcakearmy/cryptgeon)。
Docker 是最简单的部署方式。这里是[官方镜像的地址](https://hub.docker.com/r/cupcakearmy/cryptgeon)。
附:译者的[部署笔记](https://www.hash070.top/archives/cryptgeon-docker-deploy.html)
```yaml
# docker-compose.yml
version: '3.7'
version: '3.8'
services:
memcached:
image: memcached:1-alpine
entrypoint: memcached -m 128M -I 4M # 限制到最大 128 MB 内存占用,每个密信最大 4Mb 占用, 请根据自己的服务器内存的实际情况设置。
redis:
image: redis:7-alpine
app:
image: cupcakearmy/cryptgeon:latest
depends_on:
- memcached
- redis
environment:
SIZE_LIMIT: 4M
ports:
@ -86,15 +85,15 @@ services:
### NGINX 反向代理
查看 [examples/nginx](https://github.com/cupcakearmy/cryptgeon/tree/main/examples/nginx) 目录。那里有几个示例反代配置文件模板其中一个是带https配置的反代配置模板你需要指定服务器的名称和证书才能生效。
查看 [examples/nginx](https://github.com/cupcakearmy/cryptgeon/tree/main/examples/nginx) 目录。那里有几个示例反代配置文件模板,其中一个是带 https 配置的反代配置模板,你需要指定服务器的名称和证书才能生效。
### Traefik 2
假设:
- 外部Docker代理网络 `proxy`
- 外部 Docker 代理网络 `proxy`
- 证书解析器 `le`
- 一个https入站点 `secure`
- 一个 https 入站点 `secure`
- 域名 `example.org`
```yaml
@ -105,16 +104,15 @@ networks:
external: true
services:
memcached:
image: memcached:1-alpine
redis:
image: redis:7-alpine
restart: unless-stopped
entrypoint: memcached -m 128M -I 4M # Limit to 128 MB Ram, 4M per entry, customize at free will.
app:
image: cupcakearmy/cryptgeon:latest
restart: unless-stopped
depends_on:
- memcached
- redis
networks:
- default
- proxy
@ -146,7 +144,7 @@ cargo install cargo-watch
**运行**
确保你的Docker正在运行
确保你的 Docker 正在运行
> 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
@ -155,15 +153,14 @@ cargo install cargo-watch
pnpm run dev
```
在根目录执行 `pnpm run dev` 会开启下列服务:
在根目录执行 `pnpm run dev` 会开启下列服务:
- 一个 memcache docker 容器
- 一个 redis docker 容器
- 无热重载的 rust 后端
- 可热重载的客户端
你可以通过1234端口进入该应用即 [localhost:1234](http://localhost:1234).
你可以通过 1234 端口进入该应用,即 [localhost:1234](http://localhost:1234).
###### Attributions
本项目所使用的图标由<a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com的<a href="https://www.freepik.com" title="Freepik">freepik</a>制作</a>
本项目所使用的图标由<a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com 的<a href="https://www.freepik.com" title="Freepik">freepik</a>制作</a>

View File

@ -1,7 +1,7 @@
# DEV Compose file.
# For a production file see: README.md
version: '3.7'
version: '3.8'
services:
redis:

View File

@ -1,14 +1,13 @@
version: '3.8'
services:
memcached:
image: memcached:1-alpine
entrypoint: memcached -m 256 -I 128 # Limit to 128 MB Ram, customize at free will. -m must be at least double than -I.
redis:
image: redis:7-alpine
app:
image: cupcakearmy/cryptgeon:latest
depends_on:
- memcached
- redis
proxy:
image: nginx:alpine

View File

@ -7,7 +7,7 @@ This is a tiny guide to install cryptgeon on (probably) any unix system (and may
3. Run the cryptgeon.
4. [Optional] install watchtower to keep up to date.
## Install Docker & DOcker Compose
## Install Docker & Docker Compose
- [Docker](https://docs.docker.com/engine/install/)
- [Compose](https://docs.docker.com/compose/install/)
@ -107,16 +107,15 @@ networks:
external: true
services:
memcached:
image: memcached:1-alpine
redis:
image: redis:7-alpine
restart: unless-stopped
entrypoint: memcached -m 256M -I 4M # Limit to 128 MB Ram, customize at free will.
app:
image: cupcakearmy/cryptgeon:latest
restart: unless-stopped
depends_on:
- memcached
- redis
environment:
SIZE_LIMIT: 4 MiB
networks: