Skip to content

Commit

Permalink
🎨 The access authorization code command line parameter must be set wh…
Browse files Browse the repository at this point in the history
…en deploying via Docker siyuan-note#9328
  • Loading branch information
88250 committed Oct 2, 2023
1 parent d235675 commit 279e17e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,16 @@ The overall program is located under `/opt/siyuan/`, which is basically the stru

The entry point is set when building the Docker image: `ENTRYPOINT ["/opt/siyuan/kernel" ]`, use `docker run b3log/siyuan` with parameters to start:

* `--workspace` specifies the workspace folder path, mounted to the container via `-v` on the host
* `--workspace`: Specifies the workspace folder path, mounted to the container via `-v` on the host
* `--accessAuthCode`: Specifies the access authorization code

More parameters can refer to `--help`. The following is an example of a startup command:

```
docker run -v workspace_dir_host:workspace_dir_container -p 6806:6806 b3log/siyuan --workspace=workspace_dir_container --accessAuthCode=xxx
```

* `workspace_dir_host`: the workspace folder path on the host
* `workspace_dir_host`: The workspace folder path on the host
* `workspace_dir_container`: The path of the workspace folder in the container, which is the same as specified in `--workspace`
* `accessAuthCode`: Access authorization code, please **be sure to modify**, otherwise anyone can read and write your data

Expand Down
3 changes: 2 additions & 1 deletion README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@

构建 Docker 镜像时设置了入口:`ENTRYPOINT [ "/opt/siyuan/kernel" ]`,使用 `docker run b3log/siyuan` 并带参即可启动:

* `--workspace` 指定工作空间文件夹路径,在宿主机上通过 `-v` 挂载到容器中
* `--workspace`:指定工作空间文件夹路径,在宿主机上通过 `-v` 挂载到容器中
* `--accessAuthCode`:指定访问授权码

更多的参数可参考 `--help`。下面是一条启动命令示例:

Expand Down
5 changes: 5 additions & 0 deletions kernel/util/working.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ func Boot() {
Container = ContainerStd
if isRunningInDockerContainer() {
Container = ContainerDocker
if "" == AccessAuthCode {
// The access authorization code command line parameter must be set when deploying via Docker https://github.com/siyuan-note/siyuan/issues/9328
fmt.Printf("The access authorization code command line parameter (--accessAuthCode) must be set when deploying via Docker.")
os.Exit(1)
}
}
if ContainerStd != Container {
ServerPort = FixedPort
Expand Down

0 comments on commit 279e17e

Please sign in to comment.