Configuration of Erlang system

Interesting, it looks like Cue has quite some things in common with Rego.

FYI, I’m looking into Rego, because I would like to have an access-control/policy language I can use in Erlang.

2 Likes

Yes I’ve been looking at OPA/Rego too but I preferred my (not open/not finished Datalog implementation and CUE would be compatible with that). But I agree that’s another válida option to look at.

2 Likes

My hunch is that Cue is even be better for policies than Rego, and because it is based on lattices maybe even for delegation. Thanks for the rabbit hole :ok_hand:.

2 Likes

I think GitHub - k32/Lee: Model-driven configuration for Erlang and Elixir can fulfill most of requirements.

  • Validation: check. It checks types and completeness of the configuration. Also it automatically validates the configuration schema itself, so it’ll catch errors like default values not complying with the specified type
  • Good error indication: this is something that can be improved, but right now it’s not too bad (at least it’s not a crash dump)
  • Support for documentation: check, it can generate HTML, manpages and whatever format is supported by DocBook stylesheets (one doesn’t have to write docbook by hand, thankfully)
  • Configuration is namespaced, so it can be merged from “schema modules”.
  • Config formats: a bit of a weak spot now, but Lee is very extensible, so it can support whatever method of getting configuration (CLI arguments, OS environment variables, …) so it’s a matter of implementing a callback module

We’re using this library for GitHub - emqx/emqttb: A scriptable autotuning load generator for MQTT , which has tons of tweakable parameters, and it works fine so far.

3 Likes