The settings panel without programming

Hello,

This is a small service, designed to solve the configuration problem anything. More specifically, the configuration of anything connected to the Internet, which can be represented in a branching object delivered in the form of JSON.

Problem


Programs need to store and use a variety of data, known as "settings" or "configuration". What is this data?

the
    the
  • they are not very well structured
  • the
  • they are not very much, often not more than a hundred values
  • the
  • they need to give edit ("admin interface")
  • the
  • the application must be aware of the changes.


What we can come up with, and why is it not good?


the
    the
  • theRelational database. Table structure is unsuitable for scattering of unrelated data. The interface missing.
  • Store setup along with the code. Structure can be either, but the user interface will be a conversation with the developer.

    Store setup in a text file. a Variation of the previous approach. Try to teach a normal person to edit YAML.

    Use a third-party service, like Google Data API. Will work, but the overhead is terrible, and the speed of a turtle.



Actually, service.
image


Simple logic:

Register, choose a name for the circuit (this is called "seed"). The names common to all, as they are with subdomains. Fill the schema contents in the form's constructor:

image

For each value, select the type, field name, and what is on the screen in the edit form.

Automatically receive one hypostasis (instance) of that schema (each person is a "tree") called main. You can make a few, for example, for test or development environment. Assign a password to each tree.

The data in each incarnation available to man, for editing at https://<schema name>.config.ly
the
    the
  • username: the name of the incarnation ("main", if you didn't change anything)
  • the
  • password: the one you set in the configuration.


So how to create the scheme you are too lazy (I would be), and the interface to look like, you can go to ready:
the
Data is also available to read soulless bot via HTTPS GET api.config.ly with Basic Authentication:
the
    the
  • excellent: the name of the schema
  • the
  • password: the API key that was generated for the tree, and which can be viewed when editing the schema.


And again, you can try:

curl -k-u primer:yV7mkhNRs00tM2nTdKuEWV2a api.config.ly

total


What have we got? Just store JSON objects to which fastened the minimum convenient editing interface. Perhaps this will save you from writing another admin's panel.

Reviews and constructive criticism gratefully accepted.
Article based on information from habrahabr.ru

Популярные сообщения из этого блога

Approval of WSUS updates: import, export, copy

The Hilbert curve vs. Z-order

Kaspersky Security Center — the fight for automation