Introduce default configuration to remove boiler plate code in org.config files

64 views
Skip to first unread message

Pragya Jilowa

unread,
Apr 2, 2021, 8:29:37 PM4/2/21
to OpenWISP Google Summer of Code
I was going through the project idea [Wifi-login-page] and there is this point mentioned that we should introduce a default configuration file so that we don't have to write config. for every organization. And after having a look at the codebase I found out that we have a file called default-configuration.yml in org-configurations folder. Just by having look at that i am unable to figure out what we are intending to do there. 

Regards
Pragya

Federico Capoano

unread,
Apr 2, 2021, 11:37:43 PM4/2/21
to Pragya Jilowa, OpenWISP Google Summer of Code
The default organization is a different concept, consider it as the pre-existing organization in the system, but it's a separate organization from the others.

Say you manage the networks of two organizations which are using the captive page:

- University of Bangalore
- University of Rome

You'll have two configuration files, one for each, eg: bangalore.yml and rome.yml, default.yml will not be mentioned anymore. 

But most of the configuration in both files is boilerplate (repeated code), if you delete everything and leave only what is different it won't work, but that's what we need.

We need an internal configuration definition which is used as default but can be overridden in the files of bangalore.yml and rome.yml.
The result we'll have is much leaner org config files and will also be easier to add new config without having to go over all the YAML to update them because they'll update themselves automatically.
There's one catch: it shall be possible to override/delete default values by passing empty objects for example.

Is it clearer now? If not please ask more detailed questions.

--
You received this message because you are subscribed to the Google Groups "OpenWISP Google Summer of Code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp-gso...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openwisp-gsoc/c10bc7cd-d3b5-4498-a397-f206b8f7ab56n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pragya Jilowa

unread,
Apr 3, 2021, 3:09:32 PM4/3/21
to OpenWISP Google Summer of Code
Yes, thanks, It is very clear to me. 
Reply all
Reply to author
Forward
0 new messages