diff --git a/README.md b/README.md index c98ef54..09bc4b6 100644 --- a/README.md +++ b/README.md @@ -68,26 +68,26 @@ of the notes even if it tried to. ## Environment Variables -| Variable | Default | Description | -| ----------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `CACHE` | `redis://cache/` | Cache URL (valkey or redis) to connect to. [According to format](https://docs.rs/redis/latest/redis/#connection-parameters) | +| Variable | Default | Description | +| ----------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CACHE` | `redis://cache/` | Cache URL (valkey or redis) to connect to. [According to format](https://docs.rs/redis/latest/redis/#connection-parameters) | | `SIZE_LIMIT` | `1 KiB` | Max size for body. Accepted values according to [byte-unit](https://docs.rs/byte-unit/).
`512 MiB` is the maximum allowed.
Payloads are raw bytes (msgpack + cipher), so the frontend shows the full limit. | -| `MAX_VIEWS` | `100` | Maximal number of views. | -| `MAX_EXPIRATION` | `360` | Maximal expiration in minutes. | -| `ALLOW_ADVANCED` | `true` | Allow custom configuration. If set to `false` all notes will be one view only. | -| `ALLOW_FILES` | `true` | Allow uploading files. If set to `false`, users will only be allowed to create text notes. | -| `ID_LENGTH` | `32` | Set the size of the note `id` in bytes. By default this is `32` bytes. This is useful for reducing link size. _This setting does not affect encryption strength_. | -| `CACHE_PREFIX` | `""` | Optional prefix for all cache keys. Useful when sharing a cache instance with other apps via ACL namespaces. | -| `EXTRA_SIZE_LIMIT` | `512` | Maximum size in bytes of the opaque `extra` payload (e.g. key derivation params) stored on the note metadata. | -| `VERBOSITY` | `warn` | Verbosity level for the backend. [Possible values](https://docs.rs/env_logger/latest/env_logger/#enabling-logging) are: `error`, `warn`, `info`, `debug`, `trace` | -| `THEME_IMAGE` | `""` | Custom image for replacing the logo. Must be publicly reachable | -| `THEME_TEXT` | `""` | Custom text for replacing the description below the logo | -| `THEME_PAGE_TITLE` | `""` | Custom text the page title | -| `THEME_FAVICON` | `""` | Custom url for the favicon. Must be publicly reachable | -| `THEME_NEW_NOTE_NOTICE` | `true` | Show the message about how notes are stored in the memory and may be evicted after creating a new note. Defaults to `true`. | -| `THEME_HOME_LINK` | `true` | Show the `/home` link in the footer. Defaults to `true`. | -| `IMPRINT_URL` | `""` | Custom url for an Imprint hosted somewhere else. Must be publicly reachable. Takes precedence above `IMPRINT_HTML`. | -| `IMPRINT_HTML` | `""` | Alternative to `IMPRINT_URL`, this can be used to specify the HTML code to show on `/imprint`. Only `IMPRINT_HTML` or `IMPRINT_URL` should be specified, not both. | +| `MAX_VIEWS` | `100` | Maximal number of views. | +| `MAX_EXPIRATION` | `360` | Maximal expiration in minutes. | +| `ALLOW_ADVANCED` | `true` | Allow custom configuration. If set to `false` all notes will be one view only. | +| `ALLOW_FILES` | `true` | Allow uploading files. If set to `false`, users will only be allowed to create text notes. | +| `ID_LENGTH` | `32` | Set the size of the note `id` in bytes. By default this is `32` bytes. This is useful for reducing link size. _This setting does not affect encryption strength_. | +| `CACHE_PREFIX` | `""` | Optional prefix for all cache keys. Useful when sharing a cache instance with other apps via ACL namespaces. | +| `EXTRA_SIZE_LIMIT` | `512` | Maximum size in bytes of the opaque `extra` payload (e.g. key derivation params) stored on the note metadata. | +| `VERBOSITY` | `warn` | Verbosity level for the backend. [Possible values](https://docs.rs/env_logger/latest/env_logger/#enabling-logging) are: `error`, `warn`, `info`, `debug`, `trace` | +| `THEME_IMAGE` | `""` | Custom image for replacing the logo. Must be publicly reachable | +| `THEME_TEXT` | `""` | Custom text for replacing the description below the logo | +| `THEME_PAGE_TITLE` | `""` | Custom text the page title | +| `THEME_FAVICON` | `""` | Custom url for the favicon. Must be publicly reachable | +| `THEME_NEW_NOTE_NOTICE` | `true` | Show the message about how notes are stored in the memory and may be evicted after creating a new note. Defaults to `true`. | +| `THEME_HOME_LINK` | `true` | Show the `/home` link in the footer. Defaults to `true`. | +| `IMPRINT_URL` | `""` | Custom url for an Imprint hosted somewhere else. Must be publicly reachable. Takes precedence above `IMPRINT_HTML`. | +| `IMPRINT_HTML` | `""` | Alternative to `IMPRINT_URL`, this can be used to specify the HTML code to show on `/imprint`. Only `IMPRINT_HTML` or `IMPRINT_URL` should be specified, not both. | ## Deployment diff --git a/README_ES.md b/README_ES.md index 9dd1412..2035ef2 100644 --- a/README_ES.md +++ b/README_ES.md @@ -48,7 +48,7 @@ Puedes revisar la documentación sobre el CLI en este [readme](./packages/cli/RE Se genera una id (256bit) y una llave 256(bit) para cada nota. La id -se usa para guardar y recuperar la nota. Después la nota es encriptada con la llave y con aes en modo gcm del lado del cliente y por último se envía al servidor. La información es almacenada en memoria y nunca persiste en el disco. El servidor nunca ve la llave de encriptación por lo que no puede desencriptar el contenido de las notas aunque lo intentara. +se usa para guardar y recuperar la nota. Después la nota es encriptada con XChaCha20-Poly1305 del lado del cliente y por último se envía al servidor. La información es almacenada en memoria y nunca persiste en el disco. El servidor nunca ve la llave de encriptación por lo que no puede desencriptar el contenido de las notas aunque lo intentara. ## Capturas de pantalla @@ -58,24 +58,30 @@ se usa para guardar y recuperar la nota. Después la nota es encriptada con la < | Variable | Default | Descripción | | ------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `REDIS` | `redis://redis/` | Redis URL a la que conectarse. [Según el formato](https://docs.rs/redis/latest/redis/#connection-parameters) | -| `SIZE_LIMIT` | `1 KiB` | Tamaño máximo. Valores aceptados según la [unidad byte](https://docs.rs/byte-unit/).
`512 MiB` es el máximo permitido.
El frontend mostrará ese número, incluyendo el ~35% de sobrecarga de codificación. | -| `MAX_VIEWS` | `100` | Número máximo de vistas. | -| `MAX_EXPIRATION` | `360` | Tiempo máximo de expiración en minutos. | -| `ALLOW_ADVANCED` | `true` | Permitir configuración personalizada. Si se establece en `false` todas las notas serán de una sola vista. | -| `ID_LENGTH` | `32` | Establece el tamaño en bytes de la `id` de la nota. Por defecto es de `32` bytes. Esto es útil para reducir el tamaño del link. _Esta configuración no afecta el nivel de encriptación_. | -| `VERBOSITY` | `warn` | Nivel de verbosidad del backend. [Posibles valores](https://docs.rs/env_logger/latest/env_logger/#enabling-logging): `error`, `warn`, `info`, `debug`, `trace` | -| `THEME_IMAGE` | `""` | Imagen personalizada para reemplazar el logo. Debe ser accesible públicamente. | -| `THEME_TEXT` | `""` | Texto personalizado para reemplazar la descripción bajo el logo. | -| `THEME_PAGE_TITLE` | `""` | Texto personalizado para el título | -| `THEME_FAVICON` | `""` | Url personalizada para el favicon. Debe ser accesible públicamente. | -| `THEME_HOME_LINK` | `true` | Mostrar el enlace `/home` en el pie de página. El valor predeterminado es `true`. | +| `CACHE` | `redis://cache/` | URL de caché (valkey o redis) a la que conectarse. [Según el formato](https://docs.rs/redis/latest/redis/#connection-parameters) | +| `SIZE_LIMIT` | `1 KiB` | Tamaño máximo del cuerpo. Valores aceptados según [byte-unit](https://docs.rs/byte-unit/).
`512 MiB` es el máximo permitido.
Los payloads son bytes crudos (msgpack + cifrado), por lo que el frontend muestra el límite completo. | +| `MAX_VIEWS` | `100` | Número máximo de vistas. | +| `MAX_EXPIRATION` | `360` | Tiempo máximo de expiración en minutos. | +| `ALLOW_ADVANCED` | `true` | Permitir configuración personalizada. Si se establece en `false` todas las notas serán de una sola vista. | +| `ALLOW_FILES` | `true` | Permitir subir archivos. Si es `false`, los usuarios solo podrán crear notas de texto. | +| `ID_LENGTH` | `32` | Establece el tamaño en bytes de la `id` de la nota. Por defecto es de `32` bytes. Útil para reducir el tamaño del link. _No afecta el nivel de encriptación_. | +| `CACHE_PREFIX` | `""` | Prefijo opcional para las claves de caché. Útil al compartir una instancia con otras apps vía namespaces ACL. | +| `EXTRA_SIZE_LIMIT` | `512` | Tamaño máximo en bytes del payload `extra` opaco (p. ej. parámetros de derivación de clave) guardado en los metadatos de la nota. | +| `VERBOSITY` | `warn` | Nivel de verbosidad del backend. [Posibles valores](https://docs.rs/env_logger/latest/env_logger/#enabling-logging): `error`, `warn`, `info`, `debug`, `trace` | +| `THEME_IMAGE` | `""` | Imagen personalizada para reemplazar el logo. Debe ser accesible públicamente. | +| `THEME_TEXT` | `""` | Texto personalizado para reemplazar la descripción bajo el logo. | +| `THEME_PAGE_TITLE` | `""` | Texto personalizado para el título. | +| `THEME_FAVICON` | `""` | Url personalizada para el favicon. Debe ser accesible públicamente. | +| `THEME_NEW_NOTE_NOTICE` | `true` | Mostrar el mensaje sobre cómo se almacenan las notas en memoria (pueden ser expulsadas) al crear una nueva nota. | +| `THEME_HOME_LINK` | `true` | Mostrar el enlace `/home` en el pie de página. El valor predeterminado es `true`. | +| `IMPRINT_URL` | `""` | URL personalizada para un imprint alojado en otro sitio. Debe ser accesible públicamente. Tiene prioridad sobre `IMPRINT_HTML`. | +| `IMPRINT_HTML` | `""` | Alternativa a `IMPRINT_URL` para especificar el HTML a mostrar en `/imprint`. Usa solo `IMPRINT_HTML` o `IMPRINT_URL`, no ambos. | ## Despliegue > ℹ️ Se requiere `https` de lo contrario el navegador no soportará las funciones de encriptación. -> ℹ️ Hay un endpoint para verificar el estado, lo encontramos en `/api/health/`. Regresa un código 200 o 503. +> ℹ️ Hay un endpoint para verificar el estado, lo encontramos en `/healthz`. Regresa un código 200 o 503. ### Docker @@ -87,13 +93,13 @@ Docker es la manera más fácil. Aquí encontramos [la imagen oficial](https://h version: "3.8" services: - redis: - image: redis:7-alpine + cache: + image: valkey/valkey:7-alpine # This is required to stay in RAM only. - command: redis-server --save "" --appendonly no + command: valkey-server --save "" --appendonly no # Set a size limit. See link below on how to customise. - # https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/ - # --maxmemory 1gb --maxmemory-policy allkeys-lrulpine + # https://valkey.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/ + # --maxmemory 1g --maxmemory-policy allkeys-lrulpine # This prevents the creation of an anonymous volume. tmpfs: - /data @@ -101,7 +107,7 @@ services: app: image: cupcakearmy/cryptgeon:latest depends_on: - - redis + - cache environment: # Size limit for a single note. SIZE_LIMIT: 4 MiB @@ -110,7 +116,7 @@ services: # Optional health checks # healthcheck: - # test: ["CMD", "curl", "--fail", "http://127.0.0.1:8000/api/live/"] + # test: ["CMD", "curl", "--fail", "http://127.0.0.1:8000/healthz"] # interval: 1m # timeout: 3s # retries: 2 diff --git a/README_zh-CN.md b/README_zh-CN.md index 12fd6c1..71cf389 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -36,7 +36,7 @@ _加密鸽_ 是一个受 [_PrivNote_](https://privnote.com)项目启发的安全 加密鸽会为每条笔记都生成一个独立的 id (256bit) 和 key 256(bit)。 -其中id用于保存和提取密信, 在这之后这封密信将会被客户端使用 AES 算法的 GCM 模式和`key`进行加密然后发送至服务器,数据将会保存在服务器的内存中且永远不会被持久化到硬盘上,服务端永远不会得到密钥并且无法解读密信的内容。 +其中id用于保存和提取密信, 在这之后这封密信将会被客户端使用 XChaCha20-Poly1305 加密算法和`key`进行加密然后发送至服务器,数据将会保存在服务器的内存中且永远不会被持久化到硬盘上,服务端永远不会得到密钥并且无法解读密信的内容。 ## 屏幕截图 @@ -44,16 +44,26 @@ _加密鸽_ 是一个受 [_PrivNote_](https://privnote.com)项目启发的安全 ## 环境变量 -| 变量名称 | 默认值 | 描述 | -| ---------------- | ---------------- | --------------------------------------------------------------------------------- | -| `REDIS` | `redis://redis/` | Redis 连接 URL。 | -| `SIZE_LIMIT` | `1 KiB` | 最大请求体(body)限制。有关支持的数值请查看 [字节单位](https://docs.rs/byte-unit/) | -| `MAX_VIEWS` | `100` | 密信最多查看次数限制 | -| `MAX_EXPIRATION` | `360` | 密信最长过期时间限制(分钟) | -| `ALLOW_ADVANCED` | `true` | 是否允许自定义设置,该项如果设为`false`,则不会显示自定义设置模块 | -| `THEME_IMAGE` | `""` | 自定义 Logo 图片,你在这里填写的的图片链接必须是可以公开访问的。 | -| `THEME_TEXT` | `""` | 自定义在 Logo 下方的文本。 | -| `THEME_HOME_LINK` | `true` | 是否在页脚显示 `/home` 链接。默认为 `true`。 | +| 变量名称 | 默认值 | 描述 | +| ---------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `CACHE` | `redis://cache/` | 缓存(valkey 或 redis)连接 URL。[连接参数](https://docs.rs/redis/latest/redis/#connection-parameters) | +| `SIZE_LIMIT` | `1 KiB` | 最大请求体(body)限制。可通过 [字节单位](https://docs.rs/byte-unit/) 查看支持的值。负载是原始字节(msgpack + 加密),因此前端显示完整限制。| +| `MAX_VIEWS` | `100` | 密信最多查看次数限制。 | +| `MAX_EXPIRATION` | `360` | 密信最长过期时间限制(分钟)。 | +| `ALLOW_ADVANCED` | `true` | 是否允许自定义设置,该项如果设为`false`,则不会显示自定义设置模块。 | +| `ALLOW_FILES` | `true` | 是否允许上传文件。为 `false` 时用户只能创建文本密信。 | +| `ID_LENGTH` | `32` | 设置密信 `id` 的字节大小。默认 `32` 字节,可用于缩短链接长度。_不影响加密强度_。 | +| `CACHE_PREFIX` | `""` | 缓存键可选前缀。与其它应用通过 ACL namespace 共享缓存实例时有用。 | +| `EXTRA_SIZE_LIMIT` | `512` | 不透明 `extra` 负载(如密钥派生参数)的最大字节数,存于密信元数据。 | +| `VERBOSITY` | `warn` | 后端日志级别。可能值见 [env_logger](https://docs.rs/env_logger/latest/env_logger/#enabling-logging)。 | +| `THEME_IMAGE` | `""` | 自定义 Logo 图片,需可公开访问。 | +| `THEME_TEXT` | `""` | 自定义在 Logo 下方的文本。 | +| `THEME_PAGE_TITLE` | `""` | 自定义页面标题。 | +| `THEME_FAVICON` | `""` | 自定义 favicon 地址,需可公开访问。 | +| `THEME_NEW_NOTE_NOTICE` | `true` | 创建新笔记后显示“笔记存于内存可能被清除”的提示。 | +| `THEME_HOME_LINK` | `true` | 是否在页脚显示 `/home` 链接。默认为 `true`。 | +| `IMPRINT_URL` | `""` | 托管在其它位置的印页 URL,需可公开访问。优先于 `IMPRINT_HTML`。 | +| `IMPRINT_HTML` | `""` | `IMPRINT_URL` 的替代:指定 `/imprint` 展示的 HTML。`IMPRINT_HTML` 与 `IMPRINT_URL` 只应指定其一。 | | ## 部署 @@ -70,12 +80,12 @@ Docker 是最简单的部署方式。这里是[官方镜像的地址](https://hu version: "3.8" services: - redis: - image: redis:7-alpine + cache: + image: valkey/valkey:7-alpine # This is required to stay in RAM only. - command: redis-server --save "" --appendonly no + command: valkey-server --save "" --appendonly no # Set a size limit. See link below on how to customise. - # https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/ + # https://valkey.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/ # --maxmemory 1gb --maxmemory-policy allkeys-lrulpine # This prevents the creation of an anonymous volume. tmpfs: @@ -84,7 +94,7 @@ services: app: image: cupcakearmy/cryptgeon:latest depends_on: - - redis + - cache environment: SIZE_LIMIT: 4 MiB ports: @@ -112,12 +122,12 @@ networks: external: true services: - redis: - image: redis:7-alpine + cache: + image: valkey/valkey:7-alpine # This is required to stay in RAM only. - command: redis-server --save "" --appendonly no + command: valkey-server --save "" --appendonly no # Set a size limit. See link below on how to customise. - # https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/ + # https://valkey.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/ # --maxmemory 1gb --maxmemory-policy allkeys-lrulpine # This prevents the creation of an anonymous volume. tmpfs: @@ -127,7 +137,7 @@ services: image: cupcakearmy/cryptgeon:latest restart: unless-stopped depends_on: - - redis + - cache networks: - default - proxy