Skip to content

Commit

Permalink
feat(readonly): add fields for ReadOnly option
Browse files Browse the repository at this point in the history
Add ReadOnly field in api config and --read-only flag in cli
  • Loading branch information
ramfox committed Mar 23, 2018
1 parent cf48acf commit 832f7e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ type Config struct {
RPCPort string
// set to to disable webapp
WebappPort string
// read-only mode
ReadOnly bool
// list of addresses to bootsrap qri peers on
BoostrapAddrs []string
// WebappScripts is a list of script tags to include the webapp page, useful for using alternative / beta
Expand Down
3 changes: 3 additions & 0 deletions cmd/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var (
connectMemOnly bool
connectOffline bool
connectSetup bool
connectReadOnly bool
)

// connectCmd represents the run command
Expand Down Expand Up @@ -70,6 +71,7 @@ call it a “prime” port number.`,
cfg.WebappPort = connectCmdWebappPort
cfg.MemOnly = connectMemOnly
cfg.Online = !connectOffline
cfg.ReadOnly = connectReadOnly
cfg.BoostrapAddrs = viper.GetStringSlice("bootstrap")
cfg.PostP2POnlineHook = initializeDistributedAssets
})
Expand Down Expand Up @@ -150,5 +152,6 @@ func init() {
connectCmd.Flags().BoolVarP(&connectSetup, "setup", "", false, "run setup if necessary, reading options from enviornment variables")
connectCmd.Flags().BoolVarP(&connectMemOnly, "mem-only", "", false, "run qri entirely in-memory, persisting nothing")
connectCmd.Flags().BoolVarP(&connectOffline, "offline", "", false, "disable networking")
connectCmd.Flags().BoolVarP(&connectReadOnly, "read-only", "", false, "run qri in read-only mode, limits the api endpoints")
RootCmd.AddCommand(connectCmd)
}

0 comments on commit 832f7e3

Please sign in to comment.