docs: add DATA_DIR environment variables description

This commit is contained in:
ttionya
2021-03-03 02:11:34 +08:00
parent c12e90f3cb
commit 7e3d8d4618
2 changed files with 51 additions and 5 deletions
+26 -3
View File
@@ -62,7 +62,9 @@ Note that you need to set the environment variable `RCLONE_REMOTE_NAME` to a rem
Make sure that your bitwarden_rs container is named `bitwardenrs` otherwise you have to replace the container name in the `--volumes-from` section of the docker run call. Make sure that your bitwarden_rs container is named `bitwardenrs` otherwise you have to replace the container name in the `--volumes-from` section of the docker run call.
Start backup container with default settings (automatic backup at 5 minute every hour) By default the data folder for bitwarden_rs is `/data`, you need to explicitly specify the data folder using the environment variable `DATA_DIR`.
Start the backup container with default settings. (automatic backup at 5 minute every hour)
```shell ```shell
docker run -d \ docker run -d \
@@ -70,7 +72,8 @@ docker run -d \
--name bitwardenrs_backup \ --name bitwardenrs_backup \
--volumes-from=bitwardenrs \ --volumes-from=bitwardenrs \
--mount type=volume,source=bitwardenrs-rclone-data,target=/config/ \ --mount type=volume,source=bitwardenrs-rclone-data,target=/config/ \
-e RCLONE_REMOTE_NAME="YouRemoteName" -e RCLONE_REMOTE_NAME="YouRemoteName" \
-e DATA_DIR="/data" \
ttionya/bitwardenrs-backup:latest ttionya/bitwardenrs-backup:latest
``` ```
@@ -102,7 +105,7 @@ Because the host's files are not accessible in the Docker container, you need to
And go to the directory where your backup files are located. And go to the directory where your backup files are located.
If you are using automatic backups, please confirm the bitwarden_rs volume and replace the `--mount` `source` section. If you are using automatic backups, please confirm the bitwarden_rs volume and replace the `--mount` `source` section. Also don't forget to use the environment variable `DATA_DIR` to specify the data directory (`-e DATA_DIR="/data"`).
```shell ```shell
docker run --rm -it \ docker run --rm -it \
@@ -255,6 +258,26 @@ Send email when backup fails.
Default: `TRUE` Default: `TRUE`
#### DATA_DIR
The folder where bitwarden_rs stores its data.
When using `Docker Compose`, you don't need to change it, but when using automatic backup, you need to change it to `/data`.
Default: `/bitwarden/data`
#### DATA_DB
Set the sqlite database file path, you do not need to modify it.
Default: `${DATA_DIR}/db.sqlite3`
#### DATA_ATTACHMENTS
Set the attachment folder path, you don't need to modify it.
Default: `${DATA_DIR}/attachments`
## Use `.env` file ## Use `.env` file
+25 -2
View File
@@ -62,6 +62,8 @@ docker run --rm -it \
确保你的 bitwarden_rs 容器被命名为 `bitwardenrs`,否则你需要自行替换 docker run 的 `--volumes-from` 部分。 确保你的 bitwarden_rs 容器被命名为 `bitwardenrs`,否则你需要自行替换 docker run 的 `--volumes-from` 部分。
默认情况下 bitwarden_rs 的数据文件夹是 `/data`,你需要显式使用环境变量 `DATA_DIR` 指定数据文件夹。
使用默认设置启动容器(每小时的 05 分自动备份)。 使用默认设置启动容器(每小时的 05 分自动备份)。
```shell ```shell
@@ -70,7 +72,8 @@ docker run -d \
--name bitwardenrs_backup \ --name bitwardenrs_backup \
--volumes-from=bitwardenrs \ --volumes-from=bitwardenrs \
--mount type=volume,source=bitwardenrs-rclone-data,target=/config/ \ --mount type=volume,source=bitwardenrs-rclone-data,target=/config/ \
-e RCLONE_REMOTE_NAME="YouRemoteName" -e RCLONE_REMOTE_NAME="YouRemoteName" \
-e DATA_DIR="/data" \
ttionya/bitwardenrs-backup:latest ttionya/bitwardenrs-backup:latest
``` ```
@@ -104,7 +107,7 @@ docker-compose down
首先进入备份文件所在目录。 首先进入备份文件所在目录。
如果你使用的是自动备份,请确认 bitwarden_rs 卷的命名,并替换 `--mount` `source` 部分。 如果你使用的是自动备份,请确认 bitwarden_rs 卷的命名,并替换 `--mount` `source` 部分。同时不要忘记使用环境变量 `DATA_DIR` 指定数据目录(`-e DATA_DIR="/data"`)。
```shell ```shell
docker run --rm -it \ docker run --rm -it \
@@ -256,6 +259,26 @@ Rclone 远程名称,你可以自己修改命名。
默认值:`TRUE` 默认值:`TRUE`
#### DATA_DIR
指定存放 bitwarden_rs 数据的目录。
当使用 `Docker Compose` 时,你一般不需要修改它,但是当你使用自动备份时,你通常需要将它修改为 `/data`
默认值:`/bitwarden/data`
#### DATA_DB
指定 sqlite 数据库文件的路径,你不需要修改它。
默认值:`${DATA_DIR}/db.sqlite3`
#### DATA_ATTACHMENTS
指定附件文件夹路径,你不需要修改它。
默认值:`${DATA_DIR}/attachments`
## Use `.env` file ## Use `.env` file