site.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. Site
  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.tnp.services.ffeh'}
  34. opkg_repo : optional
  35. Overwrite the default ``opkg`` repository server, e.g.:
  36. ::
  37. opkg_repo = 'http://opkg.services.ffeh/attitude_adjustment/12.09/%S/packages'
  38. The `%S` is a variable, which is replaced with the platform of an device
  39. during the build process.
  40. regdom
  41. The wireless regulatory domain responsible for your area, e.g.:
  42. ::
  43. regdom = 'DE'
  44. wifi24
  45. WLAN configuration for 2.4 GHz devices.
  46. ``channel`` must be set to a valid wireless channel for your radio.
  47. ``htmode`` selects the desired htmode (e.g. HT20, HT40- or HT40+).
  48. There are currently three interface types available. You many choose to
  49. configure any subset of them:
  50. - ``ap`` creates a master interface where clients may connect
  51. - ``mesh`` creates an 802.11s mesh interface with forwarding disabled
  52. - ``ibss`` creates an ad-hoc interface
  53. Each interface may be disabled by setting ``disabled`` to ``true``.
  54. This will only affect new installations.
  55. Upgrades will not changed the disabled state.
  56. ``ap`` requires a single parameter, a string, named ``ssid`` which sets the interface's ESSID.
  57. ``mesh`` requires a single parameter, a string, named ``id`` which sets the mesh id.
  58. ``ibss`` requires two parametersr: ``ssid`` (a string) and ``bssid`` (a MAC).
  59. An optional parameter ``vlan`` (integer) is supported.
  60. Both ``mesh`` and ``ibss`` accept an optional ``mcast_rate`` (kbit/s) parameter for setting the default multicast datarate.
  61. ::
  62. wifi24 = {
  63. channel = 11,
  64. htmode = 'HT20',
  65. ap = {
  66. ssid = 'entenhausen.freifunk.net',
  67. },
  68. mesh = {
  69. id = 'entenhausen-mesh',
  70. mcast_rate = 12000,
  71. },
  72. ibss = {
  73. ssid = 'ff:ff:ff:ee:ba:be',
  74. bssid = 'ff:ff:ff:ee:ba:be',
  75. mcast_rate = 12000,
  76. },
  77. },
  78. wifi5
  79. Same as `wifi24` but for the 5Ghz radio.
  80. next_node : package
  81. Configuration of the local node feature of Gluon
  82. ::
  83. next_node = {
  84. ip4 = '10.23.42.1',
  85. ip6 = 'fdca:ffee:babe:1::1',
  86. mac = 'ca:ff:ee:ba:be:00'
  87. }
  88. fastd_mesh_vpn
  89. Remote server setup for the fastd-based mesh VPN.
  90. The `enabled` option can be set to true to enable the VPN by default.
  91. If `configurable` is `false` or unset, the method list will be replaced on updates
  92. with the list in the site configuration. Setting `configurable` to `true` will allow the user to
  93. add the method ``null`` to the front of the method list or remove ``null`` from it,
  94. and make this change survive updates. Settings configurable is necessary for the
  95. package `gluon-luci-mesh-vpn-fastd`, which adds a UI for this configuration.
  96. In any case, the ``null`` method should always be the first method in the list
  97. if it is supported at all. You should only set `configurable` to `true` if the
  98. configured peers support both the ``null`` method and methods with encryption.
  99. ::
  100. fastd_mesh_vpn = {
  101. methods = {'salsa2012+umac'},
  102. -- enabled = true,
  103. -- configurable = true,
  104. mtu = 1280,
  105. groups = {
  106. backbone = {
  107. limit = 1,
  108. peers = {
  109. peer1 = {
  110. key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  111. remotes = {'ipv4 "vpn1.entenhausen.freifunk.net" port 10000'},
  112. },
  113. }
  114. }
  115. }
  116. }
  117. mesh_on_wan : optional
  118. Enables the mesh on the WAN port (``true`` or ``false``).
  119. mesh_on_lan : optional
  120. Enables the mesh on the LAN port (``true`` or ``false``).
  121. autoupdater : package
  122. Configuration for the autoupdater feature of Gluon.
  123. ::
  124. autoupdater = {
  125. branch = 'experimental',
  126. branches = {
  127. stable = {
  128. name = 'stable',
  129. mirrors = {
  130. 'http://[fdca:ffee:babe:1::fec1]/firmware/stable/sysupgrade/',
  131. 'http://[fdca:ffee:babe:1::fec2]/firmware/stable/sysupgrade/',
  132. },
  133. good_signatures = 2,
  134. pubkeys = {
  135. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', -- someguy
  136. 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', -- someother
  137. }
  138. }
  139. }
  140. }
  141. roles : optional
  142. Optional role definitions. With this nodes will announce their role inside the mesh.
  143. In the backend this adds the facility to distinguish between normal, backbone and
  144. service nodes or even gateways (if they advertise the role, also). It is up to
  145. the community which roles to define. See the section below as an example.
  146. ``default`` takes the default role which is set initially. This value should be
  147. part of ``list``. If you want node owners to change the role via config mode add
  148. the package ``gluon-luci-node-role`` to ``site.mk``.
  149. The strings to display in the LuCI interface can be configured per language in the
  150. ``i18n/en.po``, ``i18n/de.po``, etc. files of the site repository using message IDs like
  151. ``gluon-luci-node-role:role:node`` and ``gluon-luci-node-role:role:backbone``.
  152. ::
  153. roles = {
  154. default = 'node',
  155. list = {
  156. 'node',
  157. 'test',
  158. 'backbone',
  159. 'service',
  160. },
  161. },
  162. simple_tc : package
  163. Uplink traffic control, ingress and egress values are specified in kbit/s.
  164. ::
  165. simple_tc = {
  166. mesh_vpn = {
  167. ifname = 'mesh-vpn',
  168. enabled = false,
  169. limit_egress = 200,
  170. limit_ingress = 3000,
  171. },
  172. },
  173. setup_mode : package
  174. Allows skipping setup mode (config mode) at first boot when attribute
  175. ``skip`` is set to ``true``. This is optional and may be left out.
  176. ::
  177. setup_mode = {
  178. skip = true,
  179. },
  180. legacy : package
  181. Configuration for the legacy upgrade path.
  182. This is only required in communities upgrading from Lübeck's LFF-0.3.x.
  183. ::
  184. legacy = {
  185. version_files = {'/etc/.freifunk_version_keep', '/etc/.eff_version_keep'},
  186. old_files = {'/etc/config/config_mode', '/etc/config/ffeh', '/etc/config/freifunk'},
  187. config_mode_configs = {'config_mode', 'ffeh', 'freifunk'},
  188. fastd_configs = {'ffeh_mesh_vpn', 'mesh_vpn'},
  189. mesh_ifname = 'freifunk',
  190. tc_configs = {'ffki', 'freifunk'},
  191. wifi_names = {'wifi_freifunk', 'wifi_freifunk5', 'wifi_mesh', 'wifi_mesh5'},
  192. }
  193. Packages
  194. --------
  195. The ``site.mk`` is a Makefile which should define constants
  196. involved in the build process of Gluon.
  197. GLUON_SITE_PACKAGES
  198. Defines a list of packages which should installed additional
  199. to the ``gluon_core`` package.
  200. GLUON_RELEASE
  201. The current release version Gluon should use.
  202. GLUON_PRIORITY
  203. The default priority for the generated manifests (see the autoupdater documentation
  204. for more information).
  205. GLUON_LANGS
  206. List of languages (as two-letter-codes) to include for the web interface. Should always contain
  207. ``en``.
  208. .. _site-config-mode-texts:
  209. Config mode texts
  210. -----------------
  211. The community-defined texts in the config mode are configured in PO files in the ``i18n`` subdirectory
  212. of the site configuration. The message IDs currently defined are:
  213. gluon-config-mode:welcome
  214. Welcome text on the top of the config wizard page.
  215. gluon-config-mode:pubkey
  216. Information about the public VPN key on the reboot page.
  217. gluon-config-mode:reboot
  218. General information about the reboot page.
  219. There is a POT file in the site example directory which can be used to create templates
  220. for the language files. The command ``msginit -l en -i ../../docs/site-example/i18n/gluon-site.pot``
  221. can be used from the ``i18n`` directory to create an initial PO file called ``en.po`` if the ``gettext``
  222. utilities are installed.
  223. .. note::
  224. An empty ``msgstr``, as is the default after running ``msginit``, leads to
  225. the ``msgid`` being printed as-is. It does *not* hide the whole text, as
  226. might be expected.
  227. Depending on the context, you might be able to use comments like
  228. ``<!-- empty -->`` as translations to effectively hide the text.
  229. Examples
  230. --------
  231. site.mk
  232. ^^^^^^^
  233. .. literalinclude:: ../site-example/site.mk
  234. :language: makefile
  235. site.conf
  236. ^^^^^^^^^
  237. .. literalinclude:: ../site-example/site.conf
  238. :language: lua
  239. i18n/en.po
  240. ^^^^^^^^^^
  241. .. literalinclude:: ../site-example/i18n/en.po
  242. :language: po
  243. i18n/de.po
  244. ^^^^^^^^^^
  245. .. literalinclude:: ../site-example/i18n/de.po
  246. :language: po
  247. modules
  248. ^^^^^^^
  249. .. literalinclude:: ../site-example/modules
  250. :language: makefile
  251. site-repos in the wild
  252. ^^^^^^^^^^^^^^^^^^^^^^
  253. This is a non-exhaustive list of site-repos from various communities:
  254. * `site-ffbs <https://github.com/ffbs/site-ffbs>`_ (Braunschweig)
  255. * `site-ffhb <https://github.com/FreifunkBremen/gluon-site-ffhb>`_ (Bremen)
  256. * `site-ffda <https://github.com/freifunk-darmstadt/site-ffda>`_ (Darmstadt)
  257. * `site-ffgoe <https://github.com/freifunk-goettingen/site-ffgoe>`_ (Göttingen)
  258. * `site-ffhh <https://github.com/freifunkhamburg/site-ffhh>`_ (Hamburg)
  259. * `site-ffhgw <https://github.com/lorenzo-greifswald/site-ffhgw>`_ (Greifswald)
  260. * `site-ffhl <https://github.com/freifunk-luebeck/site-ffhl>`_ (Lübeck)
  261. * `site-ffmd <https://github.com/FreifunkMD/site-ffmd>`_ (Magdeburg)
  262. * `site-ffmwu <https://github.com/freifunk-mwu/site-ffmwu>`_ (Mainz, Wiesbaden & Umgebung)
  263. * `site-ffmyk <https://github.com/FreifunkMYK/site-ffmyk>`_ (Mayen-Koblenz)
  264. * `site-ffm <https://github.com/freifunkMUC/site-ffm>`_ (München)
  265. * `site-ffms <https://github.com/FreiFunkMuenster/site-ffms>`_ (Münster)
  266. * `site-ffnw <https://git.freifunk-ol.de/root/siteconf.git>`_ (Nordwest)
  267. * `site-ffpb <https://git.c3pb.de/freifunk-pb/site-ffpb>`_ (Paderborn)
  268. * `site-ffka <https://github.com/ffka/site-ffka>`_ (Karlsruhe)
  269. * `site-ffrl <https://github.com/ffrl/sites-ffrl>`_ (Rheinland)
  270. * `site-ffrg <https://github.com/ffruhr/site-ffruhr>`_ (Ruhrgebiet)
  271. * `site-ffs <https://github.com/freifunk-stuttgart/site-ffs>`_ (Stuttgart)
  272. * `site-fftr <https://github.com/freifunktrier/site-fftr>`_ (Trier)