Skip to content

Add option to set ReadOnly mode for badgerdb #77

@xshadowlegendx

Description

@xshadowlegendx

What would you like to be added

type Options struct {
	Database              string
	ValueDir              string
	BadgerFileLoadingMode string
    BadgerIsOpenInReadOnlyMode  bool // <- add this option, corresponding helper function for the option and set badger.Options.ReadOnly = true
}

Why this is needed

I am implementing a simple ocsp responder that read from step-ca badgerdb and needs to open it in readonly mode since step-ca server is opening badgerdb in rw mode, the db cannot be open by other process with rw mode since I am using github.com/smallstep/nosql library to interact with step-ca badgerdb

I can open a PR to add the option if it is ok

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestneeds triageWaiting for discussion / prioritization by team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions