YAML format for configs

Share your opinion about Porteus Kiosk Edition.
Post Reply
ehawman-rosenberg
Ronin
Ronin
Posts: 1
Joined: 10 May 2022, 19:43
Distribution: Kiosk

YAML format for configs

Post#1 by ehawman-rosenberg » 10 May 2022, 20:31

Given ini's lack of multiline support, I have found it inconvenient to work with long parameters, specifically, 'managed_bookmarks' and 'homepage', which always span multiple pages in width while simultaneously being quite finicky about their syntax (especially the bookmarks).

I was wondering if the team would be open to a more robust format with mapping, such as YAML. See below a sample config converted to YAML format (sanitized and greatly reduced for size. also note that the highlighting is wonky here):

Code: Select all

GLOBAL:
  kiosk_config: https://yourdomainhere/your-config.txt
  managed_bookmarks:
    Your_Homepage: https://yourdomainhere.org
    Your_Story: https://yourdomainhere.org/story
    Your_Login: https://yourdomainhere.org/login
  enable_file_protocol: yes
  homepage:
    - https://yourdomainhere.org
    - https://yourdomainhere.org/story
    - https://yourdomainhere.org/login
  allow_icmp_protocol: yes
  slide_duration: 90
  root_password: This-Is-A-Password-Example
  additional_components:
    - uefi.zip
    - fonts.zip
CLIENTS:
  - PCID: CC-44-B8-54-20-43  # Client under the stairs and around the corner
    ip_address: 192.168.1.1
  - PCID: E5-8B-8A-A9-9E-64  # Client currently on Mars
    ip_address: 192.168.1.2
The biggest structural change would be an additional collection layer for clients (you could also use separate documents with `---`). I'm guessing type concerns could be an issue as well. That said, I really think this would make config management easier, particularly in the case of managed_bookmarks (look at how nice that is!).

Not at all suggesting that this is a simple or quick change, or even one that I would call "important". However, I feel that this change would be a good investment for the team because:
  • It is more easily read and edited by humans (particularly with syntax highlighting)
  • It has extensive cross-language support similar to JSON, meaning config files could be generated via script from a multitude of environments.
  • Its mapping support matching native data structures allows more flexibility in development.
Thank you for your time.

User avatar
fanthom
Site Admin
Site Admin
Posts: 5497
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

YAML format for configs

Post#2 by fanthom » 11 May 2022, 07:20

Hi,

Many kiosk users edit their configs in simple editors like notepad, nano, pico etc.
I doubt they would be interested in switching to a new config format which would require using a special text formatting tool.

We also cannot break a backward compatibility with existing configs.
In short - big trouble for a low gain.

Thanks for your feedback but I need to reject this suggestion.
Please add [Solved] to your thread title if the solution was found.

Post Reply