Browse Source

Remove gluon packages

The gluon packages will be maintained in the main repository in the future.
pull/118/head
Matthias Schiffer 7 years ago
parent
commit
db5699bede
  1. 32
      gluon/gluon-alfred/Makefile
  2. 1
      gluon/gluon-alfred/files/lib/gluon/cron/alfred
  3. 19
      gluon/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred
  4. 32
      gluon/gluon-announce/Makefile
  5. 10
      gluon/gluon-announce/files/lib/gluon/announce/collect.lua
  6. 1
      gluon/gluon-announce/files/lib/gluon/announce/neighbours.d/node_id
  7. 1
      gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model
  8. 1
      gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname
  9. 1
      gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac
  10. 1
      gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id
  11. 4
      gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware
  12. 3
      gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/system/site_code
  13. 1
      gluon/gluon-announce/files/lib/gluon/announce/statistics.d/idletime
  14. 1
      gluon/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg
  15. 13
      gluon/gluon-announce/files/lib/gluon/announce/statistics.d/memory
  16. 1
      gluon/gluon-announce/files/lib/gluon/announce/statistics.d/node_id
  17. 3
      gluon/gluon-announce/files/lib/gluon/announce/statistics.d/processes
  18. 4
      gluon/gluon-announce/files/lib/gluon/announce/statistics.d/rootfs_usage
  19. 1
      gluon/gluon-announce/files/lib/gluon/announce/statistics.d/uptime
  20. 33
      gluon/gluon-announce/files/usr/lib/lua/gluon/announce.lua
  21. 40
      gluon/gluon-announced/Makefile
  22. 45
      gluon/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced
  23. 6
      gluon/gluon-announced/src/Makefile
  24. 221
      gluon/gluon-announced/src/gluon-announced.c
  25. 36
      gluon/gluon-authorized-keys/Makefile
  26. 1
      gluon/gluon-authorized-keys/check_site.lua
  27. 22
      gluon/gluon-authorized-keys/files/lib/gluon/upgrade/100-authorized-keys
  28. 42
      gluon/gluon-autoupdater/Makefile
  29. 12
      gluon/gluon-autoupdater/check_site.lua
  30. 7
      gluon/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater
  31. 57
      gluon/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater
  32. 40
      gluon/gluon-config-mode-autoupdater/Makefile
  33. 19
      gluon/gluon-config-mode-autoupdater/files/lib/gluon/config-mode/wizard/0050-autoupdater-info.lua
  34. 17
      gluon/gluon-config-mode-autoupdater/i18n/de.po
  35. 7
      gluon/gluon-config-mode-autoupdater/i18n/gluon-config-mode-autoupdater.pot
  36. 36
      gluon/gluon-config-mode-contact-info/Makefile
  37. 34
      gluon/gluon-config-mode-contact-info/files/lib/gluon/config-mode/wizard/0500-contact-info.lua
  38. 27
      gluon/gluon-config-mode-contact-info/i18n/de.po
  39. 14
      gluon/gluon-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot
  40. 39
      gluon/gluon-config-mode-core/Makefile
  41. 3
      gluon/gluon-config-mode-core/files/lib/gluon/config-mode/reboot/0900-msg-reboot.lua
  42. 89
      gluon/gluon-config-mode-core/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua
  43. 38
      gluon/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua
  44. 46
      gluon/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm
  45. 17
      gluon/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm
  46. 24
      gluon/gluon-config-mode-core/i18n/de.po
  47. 14
      gluon/gluon-config-mode-core/i18n/gluon-config-mode-core.pot
  48. 36
      gluon/gluon-config-mode-geo-location/Makefile
  49. 60
      gluon/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua
  50. 36
      gluon/gluon-config-mode-geo-location/i18n/de.po
  51. 20
      gluon/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot
  52. 36
      gluon/gluon-config-mode-hostname/Makefile
  53. 21
      gluon/gluon-config-mode-hostname/files/lib/gluon/config-mode/wizard/0100-hostname.lua
  54. 14
      gluon/gluon-config-mode-hostname/i18n/de.po
  55. 5
      gluon/gluon-config-mode-hostname/i18n/gluon-config-mode-hostname.pot
  56. 36
      gluon/gluon-config-mode-mesh-vpn/Makefile
  57. 29
      gluon/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua
  58. 64
      gluon/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua
  59. 36
      gluon/gluon-config-mode-mesh-vpn/i18n/de.po
  60. 22
      gluon/gluon-config-mode-mesh-vpn/i18n/gluon-config-mode-mesh-vpn.pot
  61. 59
      gluon/gluon-core/Makefile
  62. 10
      gluon/gluon-core/check_site.lua
  63. 5
      gluon/gluon-core/files/etc/uci-defaults/zzz-gluon-upgrade
  64. 0
      gluon/gluon-core/files/lib/gluon/core/sysconfig/.keep
  65. 10
      gluon/gluon-core/files/lib/gluon/upgrade/001-upgrade
  66. 42
      gluon/gluon-core/files/lib/gluon/upgrade/010-primary-mac
  67. 36
      gluon/gluon-core/files/lib/gluon/upgrade/020-interfaces
  68. 18
      gluon/gluon-core/files/lib/gluon/upgrade/030-system
  69. 5
      gluon/gluon-core/files/lib/gluon/upgrade/100-dnsmasq
  70. 58
      gluon/gluon-core/files/lib/gluon/upgrade/110-network
  71. 14
      gluon/gluon-core/files/lib/gluon/upgrade/120-ntp-servers
  72. 5
      gluon/gluon-core/files/lib/gluon/upgrade/130-reboot-on-oom
  73. 30
      gluon/gluon-core/files/lib/gluon/upgrade/140-firewall-rules
  74. 12
      gluon/gluon-core/files/lib/gluon/upgrade/200-wireless
  75. 11
      gluon/gluon-core/files/lib/gluon/upgrade/999-version
  76. 1
      gluon/gluon-core/files/lib/upgrade/keep.d/gluon
  77. 31
      gluon/gluon-core/files/usr/lib/lua/gluon/platform.lua
  78. 21
      gluon/gluon-core/files/usr/lib/lua/gluon/site_config.lua
  79. 34
      gluon/gluon-core/files/usr/lib/lua/gluon/sysconfig.lua
  80. 8
      gluon/gluon-core/files/usr/lib/lua/gluon/sysctl.lua
  81. 33
      gluon/gluon-core/files/usr/lib/lua/gluon/users.lua
  82. 79
      gluon/gluon-core/files/usr/lib/lua/gluon/util.lua
  83. 40
      gluon/gluon-cron/Makefile
  84. 18
      gluon/gluon-cron/files/etc/init.d/gluon-cron
  85. 0
      gluon/gluon-cron/files/lib/gluon/cron/.keep
  86. 3
      gluon/gluon-cron/src/Makefile
  87. 316
      gluon/gluon-cron/src/gluon-crond.c
  88. 40
      gluon/gluon-ebtables-filter-multicast/Makefile
  89. 1
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/100-mcast-chain
  90. 3
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-arp
  91. 1
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-babel
  92. 1
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-btlpd
  93. 1
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-dhcpv4
  94. 1
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-dhcpv6
  95. 1
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-icmp
  96. 2
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-icmpv6
  97. 1
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-igmp
  98. 2
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-ospf
  99. 1
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/110-mcast-allow-ripng
  100. 2
      gluon/gluon-ebtables-filter-multicast/files/lib/gluon/ebtables/300-mcast

32
gluon/gluon-alfred/Makefile

@ -1,32 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-alfred
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/gluon-alfred
SECTION:=gluon
CATEGORY:=Gluon
DEPENDS:=+gluon-core +gluon-announce +gluon-cron +alfred
TITLE:=Configure alfred
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/gluon-alfred/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,gluon-alfred))

1
gluon/gluon-alfred/files/lib/gluon/cron/alfred

@ -1 +0,0 @@
* * * * * /lib/gluon/announce/collect.lua nodeinfo | gzip | alfred -s 158; /lib/gluon/announce/collect.lua statistics | gzip | alfred -s 159; /lib/gluon/announce/collect.lua neighbours | gzip | alfred -s 160

19
gluon/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred

@ -1,19 +0,0 @@
#!/usr/bin/lua
local uci = require 'luci.model.uci'
local c = uci.cursor()
c:delete('alfred', 'alfred')
c:section('alfred', 'alfred', 'alfred',
{
interface = 'br-client',
mode = 'slave',
batmanif = 'bat0',
start_vis = '1',
run_facters = '0',
}
)
c:save('alfred')
c:commit('alfred')

32
gluon/gluon-announce/Makefile

@ -1,32 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-announce
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/gluon-announce
SECTION:=gluon
CATEGORY:=Gluon
DEPENDS:=+gluon-core +luci-lib-json +lua-ethtool-stats
TITLE:=Lua scripts announcing various information
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/gluon-announce/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,gluon-announce))

10
gluon/gluon-announce/files/lib/gluon/announce/collect.lua

@ -1,10 +0,0 @@
#!/usr/bin/lua
local announce = require 'gluon.announce'
local json = require 'luci.json'
local ltn12 = require 'luci.ltn12'
local announce_dir = '/lib/gluon/announce/' .. arg[1] .. '.d'
encoder = json.Encoder(announce.collect_dir(announce_dir))
ltn12.pump.all(encoder:source(), ltn12.sink.file(io.stdout))

1
gluon/gluon-announce/files/lib/gluon/announce/neighbours.d/node_id

@ -1 +0,0 @@
return require('gluon.util').node_id()

1
gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model

@ -1 +0,0 @@
return require('platform_info').get_model()

1
gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname

@ -1 +0,0 @@
return uci:get_first('system', 'system', 'hostname')

1
gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac

@ -1 +0,0 @@
return require('gluon.sysconfig').primary_mac

1
gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id

@ -1 +0,0 @@
return require('gluon.util').node_id()

4
gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware

@ -1,4 +0,0 @@
return {
base = 'gluon-' .. util.trim(fs.readfile('/lib/gluon/gluon-version')),
release = util.trim(fs.readfile('/lib/gluon/release')),
}

3
gluon/gluon-announce/files/lib/gluon/announce/nodeinfo.d/system/site_code

@ -1,3 +0,0 @@
local site = require 'gluon.site_config'
return site.site_code

1
gluon/gluon-announce/files/lib/gluon/announce/statistics.d/idletime

@ -1 +0,0 @@
return tonumber(fs.readfile('/proc/uptime'):match('^[^ ]+ ([^ ]+)'))

1
gluon/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg

@ -1 +0,0 @@
return tonumber(fs.readfile('/proc/loadavg'):match('^([^ ]+) '))

13
gluon/gluon-announce/files/lib/gluon/announce/statistics.d/memory

@ -1,13 +0,0 @@
local data = fs.readfile('/proc/meminfo')
local fields = {}
for k, v in data:gmatch('([^\n:]+):%s*(%d+) kB') do
fields[k] = tonumber(v)
end
return {
total = fields.MemTotal,
free = fields.MemFree,
buffers = fields.Buffers,
cached = fields.Cached,
}

1
gluon/gluon-announce/files/lib/gluon/announce/statistics.d/node_id

@ -1 +0,0 @@
return require('gluon.util').node_id()

3
gluon/gluon-announce/files/lib/gluon/announce/statistics.d/processes

@ -1,3 +0,0 @@
local running, total = fs.readfile('/proc/loadavg'):match('^[^ ]+ [^ ]+ [^ ]+ (%d+)/(%d+)')
return { running = tonumber(running), total = tonumber(total) }

4
gluon/gluon-announce/files/lib/gluon/announce/statistics.d/rootfs_usage

@ -1,4 +0,0 @@
local fs = require "nixio.fs"
local st = fs.statvfs("/")
return 1 - st.bfree / st.blocks

1
gluon/gluon-announce/files/lib/gluon/announce/statistics.d/uptime

@ -1 +0,0 @@
return tonumber(fs.readfile('/proc/uptime'):match('^([^ ]+) '))

33
gluon/gluon-announce/files/usr/lib/lua/gluon/announce.lua

@ -1,33 +0,0 @@
#!/usr/bin/lua
module('gluon.announce', package.seeall)
fs = require 'luci.fs'
uci = require('luci.model.uci').cursor()
util = require 'luci.util'
local function collect_entry(entry)
if fs.isdirectory(entry) then
return collect_dir(entry)
else
return setfenv(loadfile(entry), _M)()
end
end
function collect_dir(dir)
local ret = {}
for _, entry in ipairs(fs.dir(dir)) do
if entry:sub(1, 1) ~= '.' then
local ok, val = pcall(collect_entry, dir .. '/' .. entry)
if ok then
ret[entry] = val
else
io.stderr:write(val, '\n')
end
end
end
return ret
end

40
gluon/gluon-announced/Makefile

@ -1,40 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-announced
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/gluon-announced
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=announced support
DEPENDS:=+gluon-announce
endef
define Package/gluon-announced/description
Gluon community wifi mesh firmware framework: announced support
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Build/Configure
endef
define Build/Compile
CFLAGS="$(TARGET_CFLAGS)" CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS)
endef
define Package/gluon-announced/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/gluon-announced $(1)/usr/bin/
endef
$(eval $(call BuildPackage,gluon-announced))

45
gluon/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced

@ -1,45 +0,0 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/functions/service.sh
DEVLIST=/var/run/gluon-announced.devs
DAEMON=/usr/bin/gluon-announced
ifname_to_dev () {
json_load "$(ubus call network.interface.$1 status)"
json_get_var dev device
echo "$dev"
}
restart_announced () {
SERVICE_USE_PID=1
SERVICE_WRITE_PID=1
SERVICE_DAEMONIZE=1
DEVS=$(cat $DEVLIST | while read dev iface;do echo -n " -i $dev";done)
service_stop $DAEMON
service_start $DAEMON -g ff02:0:0:0:0:0:2:1001 -p 1001 -s '/lib/gluon/announce/collect.lua nodeinfo' $DEVS
}
case "$ACTION" in
ifdown)
sed -i "/$INTERFACE/d" $DEVLIST
;;
ifup)
DEVICE=$(ifname_to_dev $INTERFACE)
MESH=$(cat /sys/class/net/$DEVICE/batman_adv/mesh_iface)
[ $MESH = "bat0" ] || exit 0
DEVS="$(cat $DEVLIST; echo $DEVICE $INTERFACE)"
echo "$DEVS" | sort | uniq > $DEVLIST
restart_announced
;;
esac

6
gluon/gluon-announced/src/Makefile

@ -1,6 +0,0 @@
all: gluon-announced
gluon-announced: gluon-announced.c
clean:
rm gluon-announced

221
gluon/gluon-announced/src/gluon-announced.c

@ -1,221 +0,0 @@
/*
Copyright (c) 2014, Nils Schneider <nils@nilsschneider.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
void usage() {
puts("Usage: gluon-announced [-h] -g <group> -p <port> -i <if0> [-i <if1> ..] -s <script>");
puts(" -g <ip6> multicast group, e.g. ff02:0:0:0:0:0:2:1001");
puts(" -p <int> port number to listen on");
puts(" -i <string> interface on which the group is joined");
puts(" -s <string> script to be executed for each request");
puts(" -h this help\n");
}
/* The maximum size of output returned is limited to 8192 bytes (including
* terminating null byte) for now. If this turns out to be problem, a
* dynamic buffer should be implemented instead of increasing the
* limit.
*/
#define BUFFER 8192
char *run_script(size_t *length, const char *script) {
FILE *f;
char *buffer;
buffer = calloc(BUFFER, sizeof(char));
if (buffer == NULL) {
fprintf(stderr, "couldn't allocate buffer\n");
return NULL;
}
f = popen(script, "r");
size_t read_bytes = 0;
while (1) {
ssize_t ret = fread(buffer+read_bytes, sizeof(char), BUFFER-read_bytes, f);
if (ret <= 0)
break;
read_bytes += ret;
}
int ret = pclose(f);
if (ret != 0)
fprintf(stderr, "script exited with status %d\n", ret);
*length = read_bytes;
return buffer;
}
void join_mcast(const int sock, const struct in6_addr addr, const char *iface) {
struct ipv6_mreq mreq;
mreq.ipv6mr_multiaddr = addr;
mreq.ipv6mr_interface = if_nametoindex(iface);
if (mreq.ipv6mr_interface == 0)
goto error;
if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
goto error;
return;
error:
fprintf(stderr, "Could not join multicast group on %s: ", iface);
perror(NULL);
return;
}
#define REQUESTSIZE 64
char *recvrequest(const int sock, struct sockaddr *client_addr, socklen_t *clilen) {
char request_buffer[REQUESTSIZE];
ssize_t read_bytes;
read_bytes = recvfrom(sock, request_buffer, sizeof(request_buffer), 0, client_addr, clilen);
if (read_bytes < 0) {
perror("recvfrom failed");
exit(EXIT_FAILURE);
}
char *request = strndup(request_buffer, read_bytes);
if (request == NULL)
perror("Could not receive request");
return strsep(&request, "\r\n\t ");
}
void serve(const int sock, const char *script) {
char *request;
socklen_t clilen;
struct sockaddr_in6 client_addr;
clilen = sizeof(client_addr);
while (1) {
request = recvrequest(sock, (struct sockaddr*)&client_addr, &clilen);
int cmp = strcmp(request, "nodeinfo");
free(request);
if (cmp != 0)
continue;
char *msg;
size_t msg_length;
msg = run_script(&msg_length, script);
if (sendto(sock, msg, msg_length, 0, (struct sockaddr *)&client_addr, sizeof(client_addr)) < 0) {
perror("sendto failed");
exit(EXIT_FAILURE);
}
free(msg);
}
}
int main(int argc, char **argv) {
int sock;
struct sockaddr_in6 server_addr = {};
char *script = NULL;
struct in6_addr mgroup_addr;
sock = socket(PF_INET6, SOCK_DGRAM, 0);
if (sock < 0) {
perror("creating socket");
exit(EXIT_FAILURE);
}
server_addr.sin6_family = AF_INET6;
server_addr.sin6_addr = in6addr_any;
opterr = 0;
int group_set = 0;
int c;
while ((c = getopt(argc, argv, "p:g:s:i:h")) != -1)
switch (c) {
case 'p':
server_addr.sin6_port = htons(atoi(optarg));
break;
case 'g':
if (!inet_pton(AF_INET6, optarg, &mgroup_addr)) {
perror("Invalid multicast group. This message will probably confuse you");
exit(EXIT_FAILURE);
}
group_set = 1;
break;
case 's':
script = optarg;
break;
case 'i':
if (!group_set) {
fprintf(stderr, "Multicast group must be given before interface.\n");
exit(EXIT_FAILURE);
}
join_mcast(sock, mgroup_addr, optarg);
break;
case 'h':
usage();
exit(EXIT_SUCCESS);
break;
default:
fprintf(stderr, "Invalid parameter %c ignored.\n", c);
}
if (script == NULL) {
fprintf(stderr, "No script given\n");
exit(EXIT_FAILURE);
}
if (bind(sock, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
perror("bind failed");
exit(EXIT_FAILURE);
}
serve(sock, script);
return EXIT_FAILURE;
}

36
gluon/gluon-authorized-keys/Makefile

@ -1,36 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-authorized-keys
PKG_VERSION:=2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
define Package/gluon-authorized-keys
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Fill /etc/dropbear/authorized_keys from site.conf
DEPENDS:=+gluon-core
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/gluon-authorized-keys/install
$(CP) ./files/* $(1)/
endef
define Package/gluon-authorized-keys/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-authorized-keys))

1
gluon/gluon-authorized-keys/check_site.lua

@ -1 +0,0 @@
need_string_array 'authorized_keys'

22
gluon/gluon-authorized-keys/files/lib/gluon/upgrade/100-authorized-keys

@ -1,22 +0,0 @@
#!/usr/bin/lua
local site = require 'gluon.site_config'
local file = '/etc/dropbear/authorized_keys'
local keys = {}
function load_keys()
for line in io.lines(file) do
keys[line] = true
end
end
pcall(load_keys)
local f = io.open(file, 'a')
for _, key in ipairs(site.authorized_keys) do
if not keys[key] then
f:write(key .. '\n')
end
end
f:close()

42
gluon/gluon-autoupdater/Makefile

@ -1,42 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-autoupdater
PKG_VERSION:=4
PKG_RELEASE:=$(GLUON_BRANCH)
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
define Package/gluon-autoupdater
SECTION:=gluon
CATEGORY:=Gluon
DEPENDS:=+gluon-core +gluon-cron +autoupdater
TITLE:=Automatically update firmware
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/gluon-autoupdater/install
$(CP) ./files/* $(1)/
if [ '$(GLUON_BRANCH)' ]; then \
$(INSTALL_DIR) $(1)/lib/gluon/autoupdater; \
echo '$(GLUON_BRANCH)' > $(1)/lib/gluon/autoupdater/default_branch; \
fi
endef
define Package/gluon-autoupdater/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-autoupdater))

12
gluon/gluon-autoupdater/check_site.lua

@ -1,12 +0,0 @@
need_string 'autoupdater.branch'
local function check_branch(k, _)
local prefix = string.format('autoupdater.branches[%q].', k)
need_string(prefix .. 'name')
need_string_array(prefix .. 'mirrors')
need_number(prefix .. 'good_signatures')
need_string_array(prefix .. 'pubkeys')
end
need_table('autoupdater.branches', check_branch)

7
gluon/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater

@ -1,7 +0,0 @@
local autoupdater = uci:get_all('autoupdater', 'settings')
if autoupdater then
return {
branch = autoupdater['branch'],
enabled = uci:get_bool('autoupdater', 'settings', 'enabled'),
}
end

57
gluon/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater

@ -1,57 +0,0 @@
#!/usr/bin/lua
local site = require 'gluon.site_config'
local uci = require 'luci.model.uci'
local c = uci.cursor()
for name, config in pairs(site.autoupdater.branches) do
c:delete('autoupdater', name)
c:section('autoupdater', 'branch', name,
{
name = config.name,
mirror = config.mirrors,
good_signatures = config.good_signatures,
pubkey = config.pubkeys,
}
)
end
if not c:get('autoupdater', 'settings') then
local enabled = 0
local branch = site.autoupdater.branch
local f = io.open('/lib/gluon/autoupdater/default_branch')
if f then
enabled = 1
branch = f:read('*line')
f:close()
end
c:section('autoupdater', 'autoupdater', 'settings',
{
enabled = enabled,
branch = branch,
}
)
end
c:set('autoupdater', 'settings', 'version_file', '/lib/gluon/release')
c:save('autoupdater')
c:commit('autoupdater')
local autoupdater_util = require 'autoupdater.util'
autoupdater_util.randomseed()
-- Perform updates at a random time between 04:00 and 05:00, and once an hour
-- a fallback update (used after the regular updates haven't
local minute = math.random(0, 59)
local f = io.open('/lib/gluon/cron/autoupdater', 'w')
f:write(string.format('%i 4 * * * /usr/sbin/autoupdater\n', minute))
f:write(string.format('%i 0-3,5-23 * * * /usr/sbin/autoupdater --fallback\n', minute))
f:close()

40
gluon/gluon-config-mode-autoupdater/Makefile

@ -1,40 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-autoupdater
PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-config-mode-autoupdater
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Let the user know whether the autoupdater is enabled or not.
DEPENDS:=+gluon-config-mode-core +gluon-autoupdater
endef
define Package/gluon-config-mode-autoupdater/description
Luci based config mode
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
$(call GluonBuildI18N,gluon-config-mode-autoupdater,i18n)
endef
define Package/gluon-config-mode-autoupdater/install
$(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-config-mode-autoupdater,$(1))
endef
$(eval $(call BuildPackage,gluon-config-mode-autoupdater))

19
gluon/gluon-config-mode-autoupdater/files/lib/gluon/config-mode/wizard/0050-autoupdater-info.lua

@ -1,19 +0,0 @@
local cbi = require "luci.cbi"
local i18n = require "luci.i18n"
local uci = luci.model.uci.cursor()
local M = {}
function M.section(form)
local enabled = uci:get_bool("autoupdater", "settings", "enabled")
if enabled then
local s = form:section(cbi.SimpleSection, nil,
i18n.translate('This node will automatically update its firmware when a new version is available.'))
end
end
function M.handle(data)
return
end
return M

17
gluon/gluon-config-mode-autoupdater/i18n/de.po

@ -1,17 +0,0 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-03-18 16:03+0100\n"
"Last-Translator: Matthias Schiffer <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid ""
"This node will automatically update its firmware when a new version is "
"available."
msgstr "Dieser Knoten aktualisiert seine Firmware automatisch, sobald "
"eine neue Version vorliegt."

7
gluon/gluon-config-mode-autoupdater/i18n/gluon-config-mode-autoupdater.pot

@ -1,7 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid ""
"This node will automatically update its firmware when a new version is "
"available."
msgstr ""

36
gluon/gluon-config-mode-contact-info/Makefile

@ -1,36 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-contact-info
PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-config-mode-contact-info
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Set a custom string that will be distributed in the mesh.
DEPENDS:=+gluon-config-mode-core +gluon-node-info
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
$(call GluonBuildI18N,gluon-config-mode-contact-info,i18n)
endef
define Package/gluon-config-mode-contact-info/install
$(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-config-mode-contact-info,$(1))
endef
$(eval $(call BuildPackage,gluon-config-mode-contact-info))

34
gluon/gluon-config-mode-contact-info/files/lib/gluon/config-mode/wizard/0500-contact-info.lua

@ -1,34 +0,0 @@
local cbi = require "luci.cbi"
local i18n = require "luci.i18n"
local uci = luci.model.uci.cursor()
local M = {}
function M.section(form)
local s = form:section(cbi.SimpleSection, nil, i18n.translate(
'You can provide your contact information here to '
.. 'allow others to contact you. Please note that '
.. 'this information will be visible <em>publicly</em> '
.. 'on the internet together with your node\'s coordinates.'
)
)
local o = s:option(cbi.Value, "_contact", i18n.translate("Contact info"))
o.default = uci:get_first("gluon-node-info", "owner", "contact", "")
o.rmempty = true
o.datatype = "string"
o.description = i18n.translate("e.g. E-mail or phone number")
o.maxlen = 140
end
function M.handle(data)
if data._contact ~= nil then
uci:set("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact", data._contact)
else
uci:delete("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact")
end
uci:save("gluon-node-info")
uci:commit("gluon-node-info")
end
return M

27
gluon/gluon-config-mode-contact-info/i18n/de.po

@ -1,27 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-03-19 01:32+0100\n"
"Last-Translator: Matthias Schiffer <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Contact info"
msgstr "Kontakt"
msgid ""
"You can provide your contact information here to allow others to contact "
"you. Please note that this information will be visible <em>publicly</em> on "
"the internet together with your node's coordinates."
msgstr ""
"Hier kannst du einen <em>öffentlichen</em> Hinweis hinterlegen, um anderen "
"zu ermöglichen, Kontakt mit dir aufzunehmen. Bitte beachte, dass "
"dieser Hinweis auch öffentlich im Internet, zusammen mit den Koordinaten "
"deines Knotens, einsehbar sein wird."
msgid "e.g. E-mail or phone number"
msgstr "z.B. E-Mail oder Telefonnummer"

14
gluon/gluon-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot

@ -1,14 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Contact info"
msgstr ""
msgid ""
"You can provide your contact information here to allow others to contact "
"you. Please note that this information will be visible <em>publicly</em> on "
"the internet together with your node's coordinates."
msgstr ""
msgid "e.g. E-mail or phone number"
msgstr ""

39
gluon/gluon-config-mode-core/Makefile

@ -1,39 +0,0 @@
# Copyright (C) 2012 Nils Schneider <nils at nilsschneider.net>
# This is free software, licensed under the Apache 2.0 license.
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-core
PKG_VERSION:=2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-config-mode-core
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Luci based config mode for user friendly setup of new mesh nodes
DEPENDS:=+gluon-setup-mode +gluon-luci-theme +gluon-lock-password $(GLUON_I18N_PACKAGES)
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
$(call GluonBuildI18N,gluon-config-mode-core,i18n)
endef
define Package/gluon-config-mode-core/install
$(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-config-mode-core,$(1))
endef
$(eval $(call BuildPackage,gluon-config-mode-core))

3
gluon/gluon-config-mode-core/files/lib/gluon/config-mode/reboot/0900-msg-reboot.lua

@ -1,3 +0,0 @@
local i18n = require 'luci.i18n'
return function () luci.template.render_string(i18n.translate('gluon-config-mode:reboot')) end

89
gluon/gluon-config-mode-core/files/usr/lib/lua/luci/controller/gluon-config-mode/index.lua

@ -1,89 +0,0 @@
--[[
Copyright 2013 Nils Schneider <nils@nilsschneider.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
module("luci.controller.gluon-config-mode.index", package.seeall)
function index()
local uci_state = luci.model.uci.cursor_state()
if uci_state:get_first("gluon-setup-mode", "setup_mode", "running", "0") == "1" then
local root = node()
if not root.target then
root.target = alias("gluon-config-mode")
root.index = true
end
page = node()
page.lock = true
page.target = alias("gluon-config-mode")
page.subindex = true
page.index = false
page = node("gluon-config-mode")
page.title = _("Wizard")
page.target = alias("gluon-config-mode", "wizard")
page.order = 5
page.setuser = "root"
page.setgroup = "root"
page.index = true
entry({"gluon-config-mode", "wizard"}, form("gluon-config-mode/wizard")).index = true
entry({"gluon-config-mode", "reboot"}, call("action_reboot"))
end
end
function action_reboot()
local uci = luci.model.uci.cursor()
uci:set("gluon-setup-mode", uci:get_first("gluon-setup-mode", "setup_mode"), "configured", "1")
uci:save("gluon-setup-mode")
uci:commit("gluon-setup-mode")
if nixio.fork() ~= 0 then
local fs = require "luci.fs"
local parts_dir = "/lib/gluon/config-mode/reboot/"
local files = fs.dir(parts_dir)
table.sort(files)
local parts = {}
for _, entry in ipairs(files) do
if entry:sub(1, 1) ~= '.' then
local f = dofile(parts_dir .. '/' .. entry)
if f ~= nil then
table.insert(parts, f)
end
end
end
local hostname = uci:get_first("system", "system", "hostname")
luci.template.render("gluon-config-mode/reboot", { parts=parts
, hostname=hostname
})
else
debug.setfenv(io.stdout, debug.getfenv(io.open '/dev/null'))
io.stdout:close()
-- Sleep a little so the browser can fetch everything required to
-- display the reboot page, then reboot the device.
nixio.nanosleep(2)
-- Run reboot with popen so it gets its own std filehandles.
io.popen("reboot")
-- Prevent any further execution in this child.
os.exit()
end
end

38
gluon/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua

@ -1,38 +0,0 @@
local wizard_dir = "/lib/gluon/config-mode/wizard/"
local i18n = luci.i18n
local uci = luci.model.uci.cursor()
local fs = require "luci.fs"
local f, s
local wizard = {}
local files = fs.dir(wizard_dir)
table.sort(files)
for _, entry in ipairs(files) do
if entry:sub(1, 1) ~= '.' then
table.insert(wizard, dofile(wizard_dir .. '/' .. entry))
end
end
f = SimpleForm("wizard")
f.reset = false
f.template = "gluon-config-mode/cbi/wizard"
for _, s in ipairs(wizard) do
s.section(f)
end
function f.handle(self, state, data)
if state == FORM_VALID then
for _, s in ipairs(wizard) do
s.handle(data)
end
luci.http.redirect(luci.dispatcher.build_url("gluon-config-mode", "reboot"))
end
return true
end
return f

46
gluon/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm

@ -1,46 +0,0 @@
<%-
local sysconfig = require 'gluon.sysconfig'
local i18n = require 'luci.i18n'
local template = require 'luci.template'
-%>
<h2><%:Welcome!%></h2>
<p>
<%= template.render_string(i18n.translate('gluon-config-mode:welcome'), {hostname=hostname, sysconfig=sysconfig}) %>
</p>
<% if not self.embedded then %>
<form method="post" enctype="multipart/form-data" action="<%=REQUEST_URI%>">
<div>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<input type="hidden" name="cbi.submit" value="1" />
</div>
<% end %>
<div class="cbi-map" id="cbi-<%=self.config%>">
<% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
<% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
<% self:render_children() %>
<br />
</div>
<%- if self.message then %>
<div><%=self.message%></div>
<%- end %>
<%- if self.errmessage then %>
<div class="error"><%=self.errmessage%></div>
<%- end %>
<% if not self.embedded then %>
<div class="cbi-page-actions">
<%-
if type(self.hidden) == "table" then
for k, v in pairs(self.hidden) do
-%>
<input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
<%-
end
end
%>
<input class="cbi-button cbi-button-save" type="submit" value="<%:Save & restart%>" />
<script type="text/javascript">cbi_d_update();</script>
</div>
</form>
<% end %>

17
gluon/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=luci.i18n.context.lang%>" lang="<%=luci.i18n.context.lang%>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=hostname%> is rebooting</title>
<link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
</head>
<body>
<div id="maincontainer">
<div id="maincontent">
<h2><%:Your node's setup is now complete.%></h2>
<% for k, v in ipairs(parts) do v() end %>
</div>
</div>
</body>
</html>

24
gluon/gluon-config-mode-core/i18n/de.po

@ -1,24 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-03-19 02:07+0100\n"
"Last-Translator: Matthias Schiffer <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#, fuzzy
msgid "Save & restart"
msgstr "Speichern & Neustarten"
msgid "Welcome!"
msgstr "Willkommen!"
msgid "Wizard"
msgstr "Wizard"
msgid "Your node's setup is now complete."
msgstr "Dein Knoten ist nun fertig eingerichtet."

14
gluon/gluon-config-mode-core/i18n/gluon-config-mode-core.pot

@ -1,14 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Save & restart"
msgstr ""
msgid "Welcome!"
msgstr ""
msgid "Wizard"
msgstr ""
msgid "Your node's setup is now complete."
msgstr ""

36
gluon/gluon-config-mode-geo-location/Makefile

@ -1,36 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-geo-location
PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-config-mode-geo-location
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Set geographic location of a node
DEPENDS:=+gluon-config-mode-core +gluon-node-info
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
$(call GluonBuildI18N,gluon-config-mode-geo-location,i18n)
endef
define Package/gluon-config-mode-geo-location/install
$(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-config-mode-geo-location,$(1))
endef
$(eval $(call BuildPackage,gluon-config-mode-geo-location))

60
gluon/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua

@ -1,60 +0,0 @@
local cbi = require "luci.cbi"
local i18n = require "luci.i18n"
local uci = luci.model.uci.cursor()
local M = {}
function M.section(form)
local s = form:section(cbi.SimpleSection, nil, i18n.translate(
'If you want the location of your node to be displayed on the map, '
.. 'you can enter its coordinates here. Specifying the altitude '
.. 'is optional and should only be done if a proper value is known.'))
local o
o = s:option(cbi.Flag, "_location", i18n.translate("Show node on the map"))
o.default = uci:get_first("gluon-node-info", "location", "share_location", o.disabled)
o.rmempty = false
o = s:option(cbi.Value, "_latitude", i18n.translate("Latitude"))
o.default = uci:get_first("gluon-node-info", "location", "latitude")
o:depends("_location", "1")
o.rmempty = false
o.datatype = "float"
o.description = i18n.translatef("e.g. %s", "53.873621")
o = s:option(cbi.Value, "_longitude", i18n.translate("Longitude"))
o.default = uci:get_first("gluon-node-info", "location", "longitude")
o:depends("_location", "1")
o.rmempty = false
o.datatype = "float"
o.description = i18n.translatef("e.g. %s", "10.689901")
o = s:option(cbi.Value, "_altitude", i18n.translate("Altitude"))
o.default = uci:get_first("gluon-node-info", "location", "altitude")
o:depends("_location", "1")
o.rmempty = true
o.datatype = "float"
o.description = i18n.translatef("e.g. %s", "11.51")
end
function M.handle(data)
local sname = uci:get_first("gluon-node-info", "location")
uci:set("gluon-node-info", sname, "share_location", data._location)
if data._location and data._latitude ~= nil and data._longitude ~= nil then
uci:set("gluon-node-info", sname, "latitude", data._latitude)
uci:set("gluon-node-info", sname, "longitude", data._longitude)
if data._altitude ~= nil then
uci:set("gluon-node-info", sname, "altitude", data._altitude)
else
uci:delete("gluon-node-info", sname, "altitude")
end
end
uci:save("gluon-node-info")
uci:commit("gluon-node-info")
end
return M

36
gluon/gluon-config-mode-geo-location/i18n/de.po

@ -1,36 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: gluon-config-mode-geo-location\n"
"PO-Revision-Date: 2015-03-23 02:18+0100\n"
"Last-Translator: Martin Weinelt <martin@darmstadt.freifunk.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid ""
"If you want the location of your node to be displayed on the map, you can "
"enter its coordinates here. Specifying the altitude is optional and should "
"only be done if a proper value is known."
msgstr ""
"Um deinen Knoten auf der Karte anzeigen zu können, benötigen wir seine "
"Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen. Die "
"Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein exakter "
"Wert bekannt ist."
msgid "Latitude"
msgstr "Breitengrad"
msgid "Longitude"
msgstr "Längengrad"
msgid "Altitude"
msgstr "Höhenmeter über Normalnull"
msgid "Show node on the map"
msgstr "Knoten auf der Karte anzeigen"
msgid "e.g. %s"
msgstr "z.B. %s"

20
gluon/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot

@ -1,20 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid ""
"If you want the location of your node to be displayed on the map, you can "
"enter its coordinates here. Specifying the altitude is optional and should "
"only be done if a proper value is known."
msgstr ""
msgid "Latitude"
msgstr ""
msgid "Longitude"
msgstr ""
msgid "Show node on the map"
msgstr ""
msgid "e.g. %s"
msgstr ""

36
gluon/gluon-config-mode-hostname/Makefile

@ -1,36 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-hostname
PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-config-mode-hostname
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Set the hostname
DEPENDS:=+gluon-config-mode-core
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
$(call GluonBuildI18N,gluon-config-mode-hostname,i18n)
endef
define Package/gluon-config-mode-hostname/install
$(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-config-mode-hostname,$(1))
endef
$(eval $(call BuildPackage,gluon-config-mode-hostname))

21
gluon/gluon-config-mode-hostname/files/lib/gluon/config-mode/wizard/0100-hostname.lua

@ -1,21 +0,0 @@
local cbi = require "luci.cbi"
local i18n = require "luci.i18n"
local uci = luci.model.uci.cursor()
local M = {}
function M.section(form)
local s = form:section(cbi.SimpleSection, nil, nil)
local o = s:option(cbi.Value, "_hostname", i18n.translate("Node name"))
o.value = uci:get_first("system", "system", "hostname")
o.rmempty = false
o.datatype = "hostname"
end
function M.handle(data)
uci:set("system", uci:get_first("system", "system"), "hostname", data._hostname)
uci:save("system")
uci:commit("system")
end
return M

14
gluon/gluon-config-mode-hostname/i18n/de.po

@ -1,14 +0,0 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-03-19 00:54+0100\n"
"Last-Translator: Matthias Schiffer <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Node name"
msgstr "Name dieses Knotens"

5
gluon/gluon-config-mode-hostname/i18n/gluon-config-mode-hostname.pot

@ -1,5 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Node name"
msgstr ""

36
gluon/gluon-config-mode-mesh-vpn/Makefile

@ -1,36 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-mesh-vpn
PKG_VERSION:=2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-config-mode-mesh-vpn
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Toggle mesh-vpn and bandwidth limit
DEPENDS:=+gluon-config-mode-core +gluon-mesh-vpn-fastd +gluon-simple-tc
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
$(call GluonBuildI18N,gluon-config-mode-mesh-vpn,i18n)
endef
define Package/gluon-config-mode-mesh-vpn/install
$(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-config-mode-mesh-vpn,$(1))
endef
$(eval $(call BuildPackage,gluon-config-mode-mesh-vpn))

29
gluon/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua

@ -1,29 +0,0 @@
local uci = luci.model.uci.cursor()
local meshvpn_enabled = uci:get("fastd", "mesh_vpn