frp
frp copied to clipboard
Configuration: use YAML/JSON instead of INI
In the early stage of development, i choose INI as configure format because it looks simple and easy to write.
However, with the increase of project complexity, INI can't describe complex configures. It doesn't support hierarchical configuration. We use same prefix to represent arrays or maps. It's not an elegant way and difficult to unmarshal to a struct.
We want to use YAML and JSON to replace INI in a smooth way:
- YAML and JSON will be supported in a future v0.x relase and can fully replace INI.
- INI is still supported in v0.x versions but will be removed in v1 versions.
- Complicated new featrues won't be supported by INI in future release. Users who want to use those features should change their configuration format to YAML/JSON.
maybe TOML? JSON is hard to write by a human since its commas and quotes. And YAML needs lots of spaces for indenting, which causes hard to read.
TOML will be more flexible:
- You can indent your config if you have a complicated setup
- You can just write a flat text file for a simple server config
TOML maybe not suitable for multiple levels configurations. It's redundant.
We will support JSON and YAML first, it's widely used and easy to auto generate. And then, other format can also be supported if it can simple map file content to a golang struct.
Is this planned in v1.0?
@cloudwindy For compatibility reasons, this issue has been temporarily shelved. In the next major version, it will be directly supported, not v1, but v2.