Skip to content

Commit

Permalink
Add configuration to disable write actions (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmeapples authored Jul 28, 2022
1 parent 479a2e0 commit 60b5d1c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions config/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ codec:
session:
filesystem:
path: # .tmp
disableWriteActions: false
1 change: 1 addition & 0 deletions docker/config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ session:
filesystem:
# if non-empty, switches to filesystem store instead of cookie store. Increases size limit from 4K to 64K
path: {{ default .Env.TEMPORAL_SESSION_STORE_PATH "" }}
disableWriteActions: {{ default .Env.TEMPORAL_DISABLE_WRITE_ACTIONS "false" }}
2 changes: 2 additions & 0 deletions server/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type SettingsResponse struct {
NotifyOnNewVersion bool
Codec *CodecResponse
Version string
DisableWriteActions bool
}

func TemporalAPIHandler(cfgProvider *config.ConfigProviderWithRefresh, apiMiddleware []Middleware) echo.HandlerFunc {
Expand Down Expand Up @@ -129,6 +130,7 @@ func GetSettings(cfgProvier *config.ConfigProviderWithRefresh) func(echo.Context
NotifyOnNewVersion: cfg.NotifyOnNewVersion,
Codec: codec,
Version: version.UIVersion,
DisableWriteActions: cfg.DisableWriteActions,
}

return c.JSON(http.StatusOK, settings)
Expand Down
7 changes: 4 additions & 3 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ type (
// show temporal-system namespace in namespace selector
ShowTemporalSystemNamespace bool `yaml:"showTemporalSystemNamespace"`
// How often to reload the config
RefreshInterval time.Duration `yaml:"refreshInterval"`
Codec Codec `yaml:"codec"`
Session Session `yaml:"session"`
RefreshInterval time.Duration `yaml:"refreshInterval"`
Codec Codec `yaml:"codec"`
Session Session `yaml:"session"`
DisableWriteActions bool `yaml:"disableWriteActions"`
}

CORS struct {
Expand Down

0 comments on commit 60b5d1c

Please sign in to comment.