Skip to end of metadata
Go to start of metadata

General

The general.json is the central configuration object of LoxBerry beginning with LoxBerry 2.0.2. In all versions before LoxBerry 2.0.2, the general.cfg (ini-style config file) was the primary configuration object of LoxBerry (and is automatically generated also by LoxBerry 2.0.2+).

The general.json includes all the configuration done in the widgets, including the Miniservers and it's network settings and credentials. For Perl and PHP users, it is recommended to use the library functions from LoxBerry::System (Perl) and loxberry_system.php (PHP), as they provide on-the-fly calculated information like your plugin directory and resolved network settings of the Miniservers. With other languages, like Python or Node.js, read the general.json.

The general.json (and general.cfg too) by design is thought to be read-only for plugin developers. Reading of the file is allowed, changes are forbidden.

Configuration settings

This is a mapping table of all general.json settings and general.cfg settings. Not all settings of general.json are present in general.cfg (and vice versa) because of new features. Key names in general.json are always first-letter-uppercase (e.g. Base.Sendstatistic, or Ipv4address), in general.cfg everything is capital letters (e.g. BASE.SENDSTATISTIC). Key names are not equal in all cases. Note, that LoxBerry::System/loxberry_system.php functions like get_miniservers use other casing for the values.

general.json introduced hierarchy of objects, that were not possible in the ini format. The general.json - like general.cfg - still maintains main sections as objects,, e.g. Base, Miniserver, Network.

Settings and mapping

general.jsonLB versiongeneral.cfgConfigured byPossible valuesDescription

Base

2.0.2+BASE


Base.Clouddnsuri
CLOUDDNSImage

Base.Lang
LANGMy LoxBerry
ISO-Code of users selected language
Base.Sendstatistic
SENDSTATISTICMy LoxBerry

Base.Startsetup
STARTSETUPWizard

Base.Systemloglevel
SYSTEMLOGLEVELImage

Base.Version
VERSIONImage & LoxBerry Update

Base.ImageVersion
n/aImage
The inital version LoxBerry was installed.
n/a
MINISERVERSMiniserver widget1-xThe number of Miniserver entries as [MINISERVERx].
Not required in general.json
n/a
INSTALLFOLDERImage<Path>LoxBerrys base folder /opt/loxberry
Not required anymore, use $ENV{'LBHOMEDIR'}

Healthcheck

2.0.2+HEALTHCHECKno UI
(no UI, read by healthcheck.cgi)
Disable_all
DISABLE_ALL

Disables all healthcheck to not send notifications/emails
Disable_<checkname>
DISABLE_<CHECKNAME>

<checkname> is the name of the specific check to disable. 

Log2Ram

2.0.0+n/a


Log2ram.Compalg




Log2ram.Logdisksize




Log2ram.Manualconfigured




Log2ram.Ramlog




Log2ram.Size




Log2ram.Zl2r




Network

2.0.2+NETWORK


Network.Friendlyname
FRIENDLYNAME


Network.Interface
INTERFACE


Network.Ssid
SSID


Network.Wpa
WPA


Network.Ipv4.Dns
DNS


Network.Ipv4.Gateway
GATEWAY


Network.Ipv4.Ipaddress
IPADDRESS


Network.Ipv4.Mask
MASK


Network.Ipv4.Type
TYPE


Network.Ipv6.Dns
DNS_IPv6


Network.Ipv6.Ipaddress
IPADDRESS_IPv6


Network.Ipv6.Mask
MASK_IPv6


Network.Ipv6.Privacyext
PRIVACYEXT_IPv6


Network.Ipv6.Type
TYPE_IPv6


Remote

1.4.0+n/a


Remote.Autoconnect




Remote.Httpport




Remote.Httpproxy




Ssdp

2.0.2+SSDP


Ssdp.Disabled
DISABLED


Ssdp.Uuid
UUID


Timeserver

2.0.2+TIMESERVER


Timeserver.Method
METHOD


Timeserver.Ntpserver
SERVER


Timeserver.Timemsno
n/a


Timeserver.Timezone
ZONE


Update

2.0.2+UPDATE


Update.Branch
BRANCH

Default branch is 'master'. To update from a specific branch, set the branch name here.
Update.Dryrun
DRYRUN

No changes are made, no update scripts are run. (DEBUGGING)
Update.Failedscript
FAILED_SCRIPT

If one or more update scripts fail during LoxBerry Update, this value stores the lowest version number (the version number of the first failed update script)  
Update.Installtype
INSTALLTYPE


Update.Interval
INTERVAL


Update.Keepinstallfiles
KEEPINSTALLFILES

Does not delete the downloaded and unzipped files. They stay in the /tmp/... directory. (DEBUGGING)
Update.Keepupdatefiles
KEEPUPDATEFILES

Updates LoxBerry, but does not overwrite loxberryupdatecheck.pl and loxberryupdate.pl (DEBUGGING)
Update.Latestsha
LATESTSHA

If installtype is Latest, stores the last commit sha that was installed. Required to detect if a new commit is present.
Update.max_version2.0.0
ajax-config-handler.cgi (updates.html)
This value limits the maximal version LoxBerry Update will update to. User has to accept a warning in LoxBerry Update to update to a new major release.
Update.Releasetype
RELEASETYPE


Watchdog

1.4.0+n/a


Watchdog.Enable




Watchdog.Logging




Watchdog.Ping




Watchdog.Maxload1




Watchdog.Maxload5




Watchdog.Maxload15




Watchdog.Minmem




Watchdog.Maxtemp




Watchdog.Tempsensor




Webserver2.0.2+WEBSERVER


Webserver.Port
PORT


Webserver.Porthttps
n/a


Miniserver

2.0.2+MINISERVERxMiniserver widget

"x" is a string label with the number, The "x" object holds the data of each Miniserver



In general.json, each Miniserver is an object, named by the number ("1", "2",...)
In general.cfg, each Miniserver has a section [MINISERVERx], where x is starting at 1, maximal count in BASE.MINISERVERS
Miniserver.x.Admin
ADMIN


Miniserver.x.Admin_raw
ADMIN_RAW


Miniserver.x.Cloudurl
CLOUDURL


Miniserver.x.Cloudurlftpport
CLOUDURLFTPPORT


Miniserver.x.Credentials
CREDENTIALS


Miniserver.x.Credentials_raw
CREDENTIALS_RAW


Miniserver.x.Encryptresponse
ENCRYPTRESPONSE


Miniserver.x.Fulluri
n/a


Miniserver.x.Fulluri_raw
n/a


Miniserver.x.Ipaddress
IPADDRESS


Miniserver.x.Ipv6format
n/a


Miniserver.x.Name
NAME


Miniserver.x.Note
NOTE


Miniserver.x.Pass
PASS


Miniserver.x.Pass_raw
PASS_RAW


Miniserver.x.Port
PORT


Miniserver.x.Porthttps
n/a


Miniserver.x.Preferhttps
n/a


Miniserver.x.Securegateway
SECUREGATEWAY


Miniserver.x.Transport
n/a


Miniserver.x.Useclouddns
USECLOUDDNS


Access json properties from different languages

This examples show, how to access the above listed properties

  • Webserver.Port, and
  • Miniserver.1.Name

Perl

  • Use decode_json to parse the content to a $cfg variable
  • To access Webserver.Port: $cfg->{Webserver}→{Port}
  • To access the Miniserver.x.Name of the first Miniserver: $cfg->{Miniserver}->{1}->{Name}

PHP

  • Use json_decode to parse the content to a $cfg object (without the assoc = true parameter, so the content is parsed to be objects
  • To access Webserver.Port: $cfg->Webserver->Port
  • To access the Miniserver.x.Name of the first Miniserver: $cfg->Miniserver->{1}->Name

JavaScript / Node.js

  • Use JSON.Parse to parse the content to a cfg object
  • To access Webserver.Port: cfg.Webserver.Port
  • To access the Miniserver.x.Name of the first Miniserver: cfg.Miniserver[1].Name

Python

  • Use import json and  cfg = json.loads to parse the content to a cfg object
  • To access Webserver.Port: cfg['Webserver']['Port']
  • To access the Miniserver.x.Name of the first Miniserver: cfg['Miniserver']['1']['Name']

Bash

Use the pre-installed tool jq to assign the result of every needed line to a variable:

  • To access Webserver.Port: PORT=$(jq -r '.Webserver.Port' "$LBSCONFIG/general.json")
  • To access the Miniserver.x.Name of the first Miniserver: MSNAME=$(jq -r '.Miniserver["1"].Name' "$LBSCONFIG/general.json")
  • Use the variables, e.g. echo $MSNAME $PORT


Perl Modul LoxBerry::System::General

  • No labels