site.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. Site configuration
  2. ==================
  3. The ``site`` consists of the files ``site.conf`` and ``site.mk``.
  4. In the first community based values are defined, which both are processed
  5. during the build process and runtime.
  6. The last is directly included in the make process of Gluon.
  7. Configuration
  8. -------------
  9. The ``site.conf`` is a lua dictionary with the following defined keys.
  10. hostname_prefix
  11. A string which shall prefix the default hostname of a device.
  12. site_name
  13. The name of your community.
  14. site_code
  15. The code of your community. It is good practice to use the TLD of
  16. your community here.
  17. prefix4
  18. The IPv4 Subnet of your community mesh network in CIDR notation, e.g.
  19. ::
  20. prefix4 = '10.111.111.0/18'
  21. prefix6
  22. The IPv6 subnet of your community mesh network, e.g.
  23. ::
  24. prefix6 = 'fdca::ffee:babe:1::/64'
  25. timezone
  26. The timezone of your community live in, e.g.
  27. ::
  28. -- Europe/Berlin
  29. timezone = 'CET-1CEST,M3.5.0,M10.5.0/3'
  30. ntp_server
  31. List of NTP servers available in your community or used by your community, e.g.:
  32. ::
  33. ntp_servers = {'1.ntp.services.ffeh','2.ntp.services.ffeh'}
  34. This NTP servers must be reachable via IPv6 from the nodes. If you don't want to set an IPv6 address
  35. explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ <faq-dns>`.
  36. opkg \: optional
  37. ``opkg`` package manager configuration.
  38. There are two optional fields in the ``opkg`` section:
  39. - ``openwrt`` overrides the default OpenWrt repository URL
  40. - ``extra`` specifies a table of additional repositories (with arbitrary keys)
  41. ::
  42. opkg = {
  43. openwrt = 'http://opkg.services.ffeh/openwrt/%n/%v/%S/packages',
  44. extra = {
  45. modules = 'http://opkg.services.ffeh/modules/gluon-%GS-%GR/%S',
  46. },
  47. }
  48. There are various patterns which can be used in the URLs:
  49. - ``%n`` is replaced by the OpenWrt version codename (e.g. "chaos_calmer")
  50. - ``%v`` is replaced by the OpenWrt version number (e.g. "15.05")
  51. - ``%S`` is replaced by the target architecture (e.g. "ar71xx/generic")
  52. - ``%GS`` is replaced by the Gluon site code (as specified in ``site.conf``)
  53. - ``%GV`` is replaced by the Gluon version
  54. - ``%GR`` is replaced by the Gluon release (as specified in ``site.mk``)
  55. regdom \: optional
  56. The wireless regulatory domain responsible for your area, e.g.:
  57. ::
  58. regdom = 'DE'
  59. Setting ``regdom`` in mandatory if ``wifi24`` or ``wifi5`` is defined.
  60. wifi24 \: optional
  61. WLAN configuration for 2.4 GHz devices.
  62. ``channel`` must be set to a valid wireless channel for your radio.
  63. There are currently three interface types available. You many choose to
  64. configure any subset of them:
  65. - ``ap`` creates a master interface where clients may connect
  66. - ``mesh`` creates an 802.11s mesh interface with forwarding disabled
  67. - ``ibss`` creates an ad-hoc interface
  68. Each interface may be disabled by setting ``disabled`` to ``true``.
  69. This will only affect new installations.
  70. Upgrades will not changed the disabled state.
  71. ``ap`` requires a single parameter, a string, named ``ssid`` which sets the
  72. interface's ESSID.
  73. ``mesh`` requires a single parameter, a string, named ``id`` which sets the mesh id.
  74. ``ibss`` requires two parametersr: ``ssid`` (a string) and ``bssid`` (a MAC).
  75. An optional parameter ``vlan`` (integer) is supported.
  76. Both ``mesh`` and ``ibss`` accept an optional ``mcast_rate`` (kbit/s) parameter for
  77. setting the default multicast datarate.
  78. ::
  79. wifi24 = {
  80. channel = 11,
  81. ap = {
  82. ssid = 'entenhausen.freifunk.net',
  83. },
  84. mesh = {
  85. id = 'entenhausen-mesh',
  86. mcast_rate = 12000,
  87. },
  88. ibss = {
  89. ssid = 'ff:ff:ff:ee:ba:be',
  90. bssid = 'ff:ff:ff:ee:ba:be',
  91. mcast_rate = 12000,
  92. },
  93. },
  94. wifi5 \: optional
  95. Same as `wifi24` but for the 5Ghz radio.
  96. next_node \: package
  97. Configuration of the local node feature of Gluon
  98. ::
  99. next_node = {
  100. ip4 = '10.23.42.1',
  101. ip6 = 'fdca:ffee:babe:1::1',
  102. mac = 'ca:ff:ee:ba:be:00'
  103. }
  104. mesh \: optional
  105. Options specific to routing protocols.
  106. At the moment, only the ``batman_adv`` routing protocol has such options:
  107. The optional value ``gw_sel_class`` sets the gateway selection class. The default
  108. class 20 is based on the link quality (TQ) only, class 1 is calculated from
  109. both the TQ and the announced bandwidth.
  110. ::
  111. mesh = {
  112. batman_adv = {
  113. gw_sel_class = 1,
  114. },
  115. }
  116. fastd_mesh_vpn
  117. Remote server setup for the fastd-based mesh VPN.
  118. The `enabled` option can be set to true to enable the VPN by default.
  119. If `configurable` is set to `false` or unset, the method list will be replaced on updates
  120. with the list from the site configuration. Setting `configurable` to `true` will allow the user to
  121. add the method ``null`` to the beginning of the method list or remove ``null`` from it,
  122. and make this change survive updates. Setting `configurable` is necessary for the
  123. package `gluon-luci-mesh-vpn-fastd`, which adds a UI for this configuration.
  124. In any case, the ``null`` method should always be the first method in the list
  125. if it is supported at all. You should only set `configurable` to `true` if the
  126. configured peers support both the ``null`` method and methods with encryption.
  127. ::
  128. fastd_mesh_vpn = {
  129. methods = {'salsa2012+umac'},
  130. -- enabled = true,
  131. -- configurable = true,
  132. mtu = 1280,
  133. groups = {
  134. backbone = {
  135. -- Limit number of connected peers from this group
  136. limit = 1,
  137. peers = {
  138. peer1 = {
  139. key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  140. -- Having multiple domains prevents SPOF in freifunk.net
  141. remotes = {
  142. 'ipv4 "vpn1.entenhausen.freifunk.net" port 10000',
  143. 'ipv4 "vpn1.entenhausener-freifunk.de" port 10000',
  144. },
  145. },
  146. peer2 = {
  147. key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  148. -- You can also omit the ipv4 to allow both connection via ipv4 and ipv6
  149. remotes = {'"vpn2.entenhausen.freifunk.net" port 10000'},
  150. },
  151. },
  152. -- Optional: nested peer groups
  153. -- groups = {
  154. -- lowend_backbone = {
  155. -- limit = 1,
  156. -- peers = ...
  157. -- },
  158. -- },
  159. },
  160. -- Optional: additional peer groups, possibly with other limits
  161. -- peertopeer = {
  162. -- limit = 10,
  163. -- peers = { ... },
  164. -- },
  165. },
  166. bandwidth_limit = {
  167. -- The bandwidth limit can be enabled by default here.
  168. enabled = false,
  169. -- Default upload limit (kbit/s).
  170. egress = 200,
  171. -- Default download limit (kbit/s).
  172. ingress = 3000,
  173. },
  174. }
  175. mesh_on_wan \: optional
  176. Enables the mesh on the WAN port (``true`` or ``false``).
  177. mesh_on_lan \: optional
  178. Enables the mesh on the LAN port (``true`` or ``false``).
  179. autoupdater \: package
  180. Configuration for the autoupdater feature of Gluon.
  181. ::
  182. autoupdater = {
  183. branch = 'stable',
  184. branches = {
  185. stable = {
  186. name = 'stable',
  187. mirrors = {
  188. 'http://[fdca:ffee:babe:1::fec1]/firmware/stable/sysupgrade/',
  189. 'http://autoupdate.entenhausen.freifunk.net/firmware/stable/sysupgrade/',
  190. },
  191. -- Number of good signatures required
  192. good_signatures = 2,
  193. pubkeys = {
  194. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', -- someguy
  195. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', -- someother
  196. }
  197. }
  198. }
  199. }
  200. All configured mirrors must be reachable from the nodes via IPv6. If you don't want to set an IPv6 address
  201. explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ <faq-dns>`.
  202. roles \: optional
  203. Optional role definitions. Nodes will announce their role inside the mesh.
  204. This will allow in the backend to distinguish between normal, backbone and
  205. service nodes or even gateways (if they advertise that role). It is up to
  206. the community which roles to define. See the section below as an example.
  207. ``default`` takes the default role which is set initially. This value should be
  208. part of ``list``. If you want node owners to change the role via config mode add
  209. the package ``gluon-luci-node-role`` to ``site.mk``.
  210. The strings to display in the LuCI interface can be configured per language in the
  211. ``i18n/en.po``, ``i18n/de.po``, etc. files of the site repository using message IDs like
  212. ``gluon-luci-node-role:role:node`` and ``gluon-luci-node-role:role:backbone``.
  213. ::
  214. roles = {
  215. default = 'node',
  216. list = {
  217. 'node',
  218. 'test',
  219. 'backbone',
  220. 'service',
  221. },
  222. },
  223. setup_mode \: package
  224. Allows skipping setup mode (config mode) at first boot when attribute
  225. ``skip`` is set to ``true``. This is optional and may be left out.
  226. ::
  227. setup_mode = {
  228. skip = true,
  229. },
  230. legacy \: package
  231. Configuration for the legacy upgrade path.
  232. This is only required in communities upgrading from Lübeck's LFF-0.3.x.
  233. ::
  234. legacy = {
  235. version_files = {'/etc/.freifunk_version_keep', '/etc/.eff_version_keep'},
  236. old_files = {'/etc/config/config_mode', '/etc/config/ffeh', '/etc/config/freifunk'},
  237. config_mode_configs = {'config_mode', 'ffeh', 'freifunk'},
  238. fastd_configs = {'ffeh_mesh_vpn', 'mesh_vpn'},
  239. mesh_ifname = 'freifunk',
  240. tc_configs = {'ffki', 'freifunk'},
  241. wifi_names = {'wifi_freifunk', 'wifi_freifunk5', 'wifi_mesh', 'wifi_mesh5'},
  242. }
  243. Packages
  244. --------
  245. The ``site.mk`` is a Makefile which should define constants
  246. involved in the build process of Gluon.
  247. GLUON_SITE_PACKAGES
  248. Defines a list of packages which should be installed additionally
  249. to the ``gluon-core`` package.
  250. GLUON_RELEASE
  251. The current release version Gluon should use.
  252. GLUON_PRIORITY
  253. The default priority for the generated manifests (see the autoupdater documentation
  254. for more information).
  255. GLUON_LANGS
  256. List of languages (as two-letter-codes) to be included in the web interface. Should always contain
  257. ``en``.
  258. .. _site-config-mode-texts:
  259. Config mode texts
  260. -----------------
  261. The community-defined texts in the config mode are configured in PO files in the ``i18n`` subdirectory
  262. of the site configuration. The message IDs currently defined are:
  263. gluon-config-mode:welcome
  264. Welcome text on the top of the config wizard page.
  265. gluon-config-mode:pubkey
  266. Information about the public VPN key on the reboot page.
  267. gluon-config-mode:reboot
  268. General information shown on the reboot page.
  269. There is a POT file in the site example directory which can be used to create templates
  270. for the language files. The command ``msginit -l en -i ../../docs/site-example/i18n/gluon-site.pot``
  271. can be used from the ``i18n`` directory to create an initial PO file called ``en.po`` if the ``gettext``
  272. utilities are installed.
  273. .. note::
  274. An empty ``msgstr``, as is the default after running ``msginit``, leads to
  275. the ``msgid`` being printed as-is. It does *not* hide the whole text, as
  276. might be expected.
  277. Depending on the context, you might be able to use comments like
  278. ``<!-- empty -->`` as translations to effectively hide the text.
  279. Site modules
  280. ------------
  281. The file ``modules`` in the site repository is completely optional and can be used
  282. to supply additional package feeds from which packages are built. The git repositories
  283. specified here are retrieved in addition to the default feeds when ``make update``
  284. it called.
  285. This file's format is very similar to the toplevel ``modules`` file of the Gluon
  286. tree, with the important different that the list of feeds must be assigned to
  287. the variable ``GLUON_SITE_FEEDS``. Multiple feed names must be separated by spaces,
  288. for example::
  289. GLUON_SITE_FEEDS='foo bar'
  290. The feed names may only contain alphanumerical characters, underscores and slashes.
  291. For each of the feeds, the following variables are used to specify how to update
  292. the feed:
  293. PACKAGES_${feed}_REPO
  294. The URL of the git repository to clone (usually ``git://`` or ``http(s)://``)
  295. PACKAGES_${feed}_COMMIT
  296. The commit ID of the repository to use
  297. PACKAGES_${feed}_BRANCH
  298. Optional: The branch of the repository the given commit ID can be found in.
  299. Defaults to the default branch of the repository (usually ``master``)
  300. These variables are always all uppercase, so for an entry ``foo`` in GLUON_SITE_FEEDS,
  301. the corresponding configuration variables would be ``PACKAGES_FOO_REPO``,
  302. ``PACKAGES_FOO_COMMIT`` and ``PACKAGES_FOO_BRANCH``. Slashes in feed names are
  303. replaced by underscores to get valid shell variable identifiers.
  304. Examples
  305. --------
  306. site.mk
  307. ^^^^^^^
  308. .. literalinclude:: ../site-example/site.mk
  309. :language: makefile
  310. site.conf
  311. ^^^^^^^^^
  312. .. literalinclude:: ../site-example/site.conf
  313. :language: lua
  314. i18n/en.po
  315. ^^^^^^^^^^
  316. .. literalinclude:: ../site-example/i18n/en.po
  317. :language: po
  318. i18n/de.po
  319. ^^^^^^^^^^
  320. .. literalinclude:: ../site-example/i18n/de.po
  321. :language: po
  322. modules
  323. ^^^^^^^
  324. .. literalinclude:: ../site-example/modules
  325. :language: makefile
  326. site-repos in the wild
  327. ^^^^^^^^^^^^^^^^^^^^^^
  328. This is a non-exhaustive list of site-repos from various communities:
  329. * `site-ffa <https://github.com/tecff/site-ffa>`_ (Altdorf, Landshut & Umgebung)
  330. * `site-ffac <https://github.com/ffac/site>`_ (Regio Aachen)
  331. * `site-ffbs <https://github.com/ffbs/site-ffbs>`_ (Braunschweig)
  332. * `site-ffhb <https://github.com/FreifunkBremen/gluon-site-ffhb>`_ (Bremen)
  333. * `site-ffda <https://github.com/freifunk-darmstadt/site-ffda>`_ (Darmstadt)
  334. * `site-ffgoe <https://github.com/freifunk-goettingen/site-ffgoe>`_ (Göttingen)
  335. * `site-ffhh <https://github.com/freifunkhamburg/site-ffhh>`_ (Hamburg)
  336. * `site-ffho <https://git.c3pb.de/freifunk-pb/site-ffho>`_ (Hochstift)
  337. * `site-ffhgw <https://github.com/lorenzo-greifswald/site-ffhgw>`_ (Greifswald)
  338. * `site-ffl <https://github.com/freifunk-leipzig/freifunk-gluon-leipzig>`_ (Leipzig)
  339. * `site-ffhl <https://github.com/freifunk-luebeck/site-ffhl>`_ (Lübeck)
  340. * `site-ffmd <https://github.com/FreifunkMD/site-ffmd>`_ (Magdeburg)
  341. * `site-ffmwu <https://github.com/freifunk-mwu/site-ffmwu>`_ (Mainz, Wiesbaden & Umgebung)
  342. * `site-ffmyk <https://github.com/FreifunkMYK/site-ffmyk>`_ (Mayen-Koblenz)
  343. * `site-ffm <https://github.com/freifunkMUC/site-ffm>`_ (München)
  344. * `site-ffms <https://github.com/FreiFunkMuenster/site-ffms>`_ (Münsterland)
  345. * `site-ffnw <https://git.nordwest.freifunk.net/ffnw-firmware/siteconf/tree/master>`_ (Nordwest)
  346. * `site-ffka <https://github.com/ffka/site-ffka>`_ (Karlsruhe)
  347. * `site-ffrl <https://github.com/ffrl/sites-ffrl>`_ (Rheinland)
  348. * `site-ffrg <https://github.com/ffruhr/site-ffruhr>`_ (Ruhrgebiet)
  349. * `site-ffs <https://github.com/freifunk-stuttgart/site-ffs>`_ (Stuttgart)
  350. * `site-fftr <https://github.com/freifunktrier/site-fftr>`_ (Trier)