Skip to content

Commit

Permalink
gluon-config-mode-contact-info: change "mandatory" site option to "op…
Browse files Browse the repository at this point in the history
…tional"

Also add documentation about config mode settings.
  • Loading branch information
neocturne committed Mar 17, 2018
1 parent 440cc1e commit 486c2e4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
32 changes: 32 additions & 0 deletions docs/user/site.rst
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,38 @@ autoupdater \: package
All configured mirrors must be reachable from the nodes via IPv6. If you don't want to set an IPv6 address
explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ <faq-dns>`.

config_mode \: optional
Additional configuration for the configuration web interface. All values are
optional.

By default, no altitude fields are shown by the *gluon-config-mode-geo-location*
package. If *geo_location.show_altitude* is set to *true*, the *gluon-config-mode:altitude-label*
and *gluon-config-mode:altitude-help* strings must be provided in the site i18n
data as well.

The *owner.optional* option can be set to *false* to make the contact
information field mandatory.

The remote login page only shows SSH key configuration by default. A
password form can be displayed by setting *remote_login.show_password_form*
to true; in this case, *remote_login.min_password_length* defines the
minimum password length.
::

config_mode = {
geo_location = {
show_altitude = true,
},
owner = {
optional = false,

This comment has been minimized.

Copy link
@rubo77

rubo77 Mar 17, 2018

Contributor

This explanation must be changed in some more places: https://github.com/freifunk-gluon/gluon/search?utf8=%E2%9C%93&q=obligatory

This comment has been minimized.

Copy link
@neocturne

neocturne Mar 17, 2018

Author Member

Thanks, I have removed the duplicated and outdated docs.

},
remote_login = {
show_password_form = true,
min_password_length = 10,
},
},


roles \: optional
Optional role definitions. Nodes will announce their role inside the mesh.
This will allow in the backend to distinguish between normal, backbone and
Expand Down
2 changes: 1 addition & 1 deletion package/gluon-config-mode-contact-info/check_site.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
need_boolean(in_site({'config_mode', 'owner', 'obligatory'}), false)
need_boolean(in_site({'config_mode', 'owner', 'optional'}), false)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ return function(form, uci)

local o = s:option(Value, "contact", pkg_i18n.translate("Contact info"), pkg_i18n.translate("e.g. E-mail or phone number"))
o.default = uci:get("gluon-node-info", owner, "contact")
o.optional = not site.config_mode.owner.obligatory(false)
o.optional = site.config_mode.owner.optional(true)
-- without a minimal length, an empty string will be accepted even with "optional = false"
o.datatype = "minlength(1)"
function o:write(data)
Expand Down

0 comments on commit 486c2e4

Please sign in to comment.