site.rst 17 KB

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