Skip to content

Commit

Permalink
🎨 Set the env SIYUAN_ACCESS_AUTH_CODE_BYPASS=true to skip checking …
Browse files Browse the repository at this point in the history
…access auth code when deploying Docker Fix #9709
  • Loading branch information
88250 committed Nov 22, 2023
1 parent cb016aa commit e00d106
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions kernel/util/working.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,21 @@ func Boot() {
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)
interruptBoot := true

// Set the env `SIYUAN_ACCESS_AUTH_CODE_BYPASS=true` to skip checking access auth code when deploying Docker https://github.com/siyuan-note/siyuan/issues/9709
byPassEnv := os.Getenv("SIYUAN_ACCESS_AUTH_CODE_BYPASS")
bypass, parseErr := strconv.ParseBool(byPassEnv)
if nil == parseErr && bypass {
interruptBoot = false
logging.LogInfof("bypass access auth code check since the env [SIYUAN_ACCESS_AUTH_CODE_BYPASS] is set to [true]")
}

if interruptBoot {
// 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 {
Expand Down

0 comments on commit e00d106

Please sign in to comment.