[GH-ISSUE #2521] Configuration: use YAML/JSON instead of INI #1999

Closed
opened 2026-05-05 13:17:37 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @fatedier on GitHub (Aug 8, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2521

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.
Originally created by @fatedier on GitHub (Aug 8, 2021). Original GitHub issue: https://github.com/fatedier/frp/issues/2521 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.
gitea-mirror 2026-05-05 13:17:37 -06:00
  • closed this issue
  • added the
    todo
    label
Author
Owner

@fakeboboliu commented on GitHub (Aug 10, 2021):

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
<!-- gh-comment-id:895792869 --> @fakeboboliu commented on GitHub (Aug 10, 2021): 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
Author
Owner

@fatedier commented on GitHub (Aug 12, 2021):

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.

<!-- gh-comment-id:897610999 --> @fatedier commented on GitHub (Aug 12, 2021): 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.
Author
Owner

@cloudwindy commented on GitHub (May 2, 2023):

Is this planned in v1.0?

<!-- gh-comment-id:1531875581 --> @cloudwindy commented on GitHub (May 2, 2023): Is this planned in v1.0?
Author
Owner

@fatedier commented on GitHub (May 4, 2023):

@cloudwindy For compatibility reasons, this issue has been temporarily shelved. In the next major version, it will be directly supported, not v1, but v2.

<!-- gh-comment-id:1534015701 --> @fatedier commented on GitHub (May 4, 2023): @cloudwindy For compatibility reasons, this issue has been temporarily shelved. In the next major version, it will be directly supported, not v1, but v2.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1999
No description provided.