docs: add README
This commit is contained in:
30
README.md
30
README.md
@@ -257,6 +257,36 @@ Default: `TRUE`
|
||||
|
||||
|
||||
|
||||
## Use `.env` file
|
||||
|
||||
If you prefer to use env file instead of environment variables, you can map the env file containing the environment variables to the `/.env` file in the container.
|
||||
|
||||
```shell
|
||||
docker run -d \
|
||||
--mount type=bind,source=/path/to/env,target=/.env \
|
||||
ttionya/bitwardenrs-backup:latest
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Docker Secrets
|
||||
|
||||
As an alternative to passing sensitive information via environment variables, `_FILE` may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in `/run/secrets/<secret_name>` files.
|
||||
|
||||
```shell
|
||||
docker run -d \
|
||||
-e ZIP_PASSWORD_FILE=/run/secrets/zip-password \
|
||||
ttionya/bitwardenrs-backup:latest
|
||||
```
|
||||
|
||||
|
||||
|
||||
## About Priority
|
||||
|
||||
We will use the environment variables first, then the contents of the file ending in `_FILE` as defined by the environment variables, followed by the contents of the file ending in `_FILE` as defined in the `.env` file, and finally the `.env` file values.
|
||||
|
||||
|
||||
|
||||
## Mail Test
|
||||
|
||||
You can use the following command to test the mail sending. Remember to replace your smtp variables.
|
||||
|
||||
30
README_zh.md
30
README_zh.md
@@ -258,6 +258,36 @@ Rclone 远程名称,你可以自己修改命名。
|
||||
|
||||
|
||||
|
||||
## Use `.env` file
|
||||
|
||||
如果你喜欢使用 env 文件而不是环境变量,可以将包含环境变量的 env 文件映射到容器中的 `/.env` 文件。
|
||||
|
||||
```shell
|
||||
docker run -d \
|
||||
--mount type=bind,source=/path/to/env,target=/.env \
|
||||
ttionya/bitwardenrs-backup:latest
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Docker Secrets
|
||||
|
||||
作为通过环境变量传递敏感信息的替代方法,`_FILE` 可以追加到前面列出的环境变量后面,使初始化脚本从容器中存在的文件加载这些变量的值。特别是这可以用来从存储在 `/run/secrets/<secret_name>` 文件中的 Docker Secrets 中加载密码。
|
||||
|
||||
```shell
|
||||
docker run -d \
|
||||
-e ZIP_PASSWORD_FILE=/run/secrets/zip-password \
|
||||
ttionya/bitwardenrs-backup:latest
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 关于优先级
|
||||
|
||||
我们会优先使用环境变量,然后是环境变量定义的 `_FILE` 结尾的文件内容,之后是 `.env` 文件中定义的 `_FILE` 结尾的文件内容,最后才是 `.env` 文件的值。
|
||||
|
||||
|
||||
|
||||
## 邮件发送测试
|
||||
|
||||
你可以使用下面的命令来测试邮件的发送。记得替换你的 SMTP 变量。
|
||||
|
||||
@@ -34,6 +34,7 @@ services:
|
||||
volumes:
|
||||
- bitwardenrs-data:/bitwarden/data/
|
||||
- bitwardenrs-rclone-data:/config/
|
||||
# - /path/to/env:/.env
|
||||
|
||||
volumes:
|
||||
bitwardenrs-data:
|
||||
|
||||
Reference in New Issue
Block a user