Skip to content

Commit

Permalink
Merge branch 'master' into f/reference_state
Browse files Browse the repository at this point in the history
  • Loading branch information
javierbrk committed Aug 1, 2024
2 parents e85670d + a3d751c commit b19b1ca
Show file tree
Hide file tree
Showing 28 changed files with 31 additions and 29 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Start an ImageBuilder of your choice, for example ath79-generic if your device i

```shell
mkdir ./images/
docker run -it -v $(pwd)/images:/images/ ghcr.io/openwrt/imagebuilder:ath79-generic-v22.03.5
docker run -it -v $(pwd)/images:/images/ ghcr.io/openwrt/imagebuilder:ath79-generic-v23.05.3
```

If your device is not part of ath79-generic profiles, you can replace it with another <target>-<subtarget> combination. For knowing which target and subtarget is best suited for your router, check out the page about it in the [OpenWrt's Table of Hardware][OpenWrt-ToH].
Expand All @@ -65,6 +65,7 @@ Within the container, add the `lime-packages` feeds:

```shell
echo "src/gz libremesh https://feed.libremesh.org/master" >> repositories.conf
echo "src/gz libremesh_profiles https://feed.libremesh.org/profiles" >> repositories.conf
echo "src/gz libremesh_arch_packages https://feed.libremesh.org/arch_packages/master/mips_24kc" >> repositories.conf
echo "untrusted comment: signed by libremesh.org key a71b3c8285abd28b" > keys/a71b3c8285abd28b
echo "RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" >> keys/a71b3c8285abd28b
Expand Down Expand Up @@ -95,6 +96,7 @@ Go to <https://firmware-selector.openwrt.org/>. Find your device. Click on the f

```shell
echo "src/gz libremesh https://feed.libremesh.org/master" >> repositories.conf
echo "src/gz libremesh_profiles https://feed.libremesh.org/profiles" >> repositories.conf
echo "src/gz libremesh_arch_packages https://feed.libremesh.org/arch_packages/master/mips_24kc" >> repositories.conf
echo "untrusted comment: signed by libremesh.org key a71b3c8285abd28b" > keys/a71b3c8285abd28b
echo "RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" >> keys/a71b3c8285abd28b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bw_test() {
while [ -z "$bw" -a $try -lt $TRIES ]; do
test=$({ wget -T5 -q $1 -O- | pv -n -b -t >/dev/null; } 2>&1)
bw=$(echo $test | awk '{printf "%.0f",$NF/$(NF-1)*8}')
try=$(($try+1))
try=$((try+1))
done
echo $bw
}
Expand Down
2 changes: 1 addition & 1 deletion packages/check-date-http/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
MAINTAINER:=Gioacchino Mazzurco <gio@altermundi.net>
URL:=http://libremesh.org
DEPENDS:=+libuci-lua +lua +random-numgen \
DEPENDS:=+libuci-lua +lua \
+luci-lib-httpclient
PKGARCH:=all
endef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ unique_append()
}

unique_append \
'*/20 * * * * ((sleep $(($(random-numgen) % 600)); check-date-http &> /dev/null)&)'\
'*/20 * * * * ((sleep $((RANDOM % 600)); check-date-http &> /dev/null)&)'\
/etc/crontabs/root
2 changes: 1 addition & 1 deletion packages/eupgrade/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=$(PKG_NAME) provides semi automated firmware upgrades
MAINTAINER:=Santiago Piccinini <spiccinini@altermundi.net>
DEPENDS:=+lua +lime-system +luci-lib-jsonc +luci-lib-nixio +libubus-lua +libuci-lua +random-numgen
DEPENDS:=+lua +lime-system +luci-lib-jsonc +luci-lib-nixio +libubus-lua +libuci-lua
PKGARCH:=all
endef

Expand Down
2 changes: 1 addition & 1 deletion packages/eupgrade/files/etc/uci-defaults/99-eupgrades-cron
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ unique_append()
}

unique_append \
'0 */6 * * * ((sleep $(($(random-numgen) % 120)); eupgrade-check &> /dev/null)&)'\
'0 */6 * * * ((sleep $((RANDOM % 120)); eupgrade-check &> /dev/null)&)'\
/etc/crontabs/root
2 changes: 1 addition & 1 deletion packages/hotplug-initd-services/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
MAINTAINER:=Gioacchino Mazzurco <gio@altermundi.net>
URL:=http://libremesh.org
DEPENDS:=+libubox-lua +libubus-lua +random-numgen \
DEPENDS:=+libubox-lua +libubus-lua \
+lua +luci-lib-nixio
PKGARCH:=all
endef
Expand Down
4 changes: 2 additions & 2 deletions packages/lime-docs/files/www/docs/lime-example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ config net wirelessclientbackbone
# list protocols 'wan' # Some of these protocols require the relative package "lime-proto-..."
# list protocols 'static' # Set up a static IP (both IPv4 and IPv6 supported)
# option static_ipv4 '192.168.1.2/24'
# option static_gateway_ipv4 '192.168.1.1'
# option static_gateway_ipv4 '192.168.1.1' # in static protocol, specifying an IP for the gateway is optional. Skip this line if no default route should be added on this interface.
# option static_ipv6 '2a00:1508:0a00::1234/64'
# option static_gateway_ipv6 'fe80::1'
# option static_gateway_ipv6 'fe80::1' # in static protocol, specifying an IP for the gateway is optional. Skip this line if no default route should be added on this interface.

## (optional) configure lan1 for connection to other nodes, not for users connection:
config net
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ uci set shared-state.${mSc}.update_interval='120'
uci commit shared-state

unique_append \
'*/3 * * * * ((sleep $(($RANDOM % 120)); shared-state-async insert net-stats < /tmp/shared-state/network_statistics.json &> /dev/null)&)' \
'*/3 * * * * ((sleep $((RANDOM % 120)); shared-state-async insert net-stats < /tmp/shared-state/network_statistics.json &> /dev/null)&)' \
/etc/crontabs/root
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ unique_append()
}

unique_append \
'*/30 * * * * ((sleep $(($RANDOM % 120)); shared-state-async-publish-all &> /dev/null)&)' \
'*/30 * * * * ((sleep $((RANDOM % 120)); shared-state-async-publish-all &> /dev/null)&)' \
/etc/crontabs/root
2 changes: 1 addition & 1 deletion packages/shared-state-babel_links_info/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ define Package/$(PKG_NAME)
TITLE:=Babel links module for shared-state
MAINTAINER:=Asociación Civil Altermundi <info@altermundi.net>
DEPENDS:=+lua +luci-lib-jsonc +ubus-lime-utils \
+libubus-lua +random-numgen +shared-state-ref_state_commons shared-state-async
+libubus-lua +shared-state-ref_state_commons shared-state-async
PKGARCH:=all
endef

Expand Down
2 changes: 1 addition & 1 deletion packages/shared-state-babeld_hosts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
MAINTAINER:=Gioacchino Mazzurco <gio@altermundi.net>
URL:=http://libremesh.org
DEPENDS:=+hotplug-initd-services +random-numgen \
DEPENDS:=+hotplug-initd-services \
+lua +luci-lib-jsonc shared-state
PKGARCH:=all
endef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ unique_append()
}

unique_append \
'*/5 * * * * ((sleep $(($(random-numgen) % 120)); shared-state sync babeld-hosts &> /dev/null)&)'\
'*/5 * * * * ((sleep $((RANDOM % 120)); shared-state sync babeld-hosts &> /dev/null)&)'\
/etc/crontabs/root
2 changes: 1 addition & 1 deletion packages/shared-state-dnsmasq_hosts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
MAINTAINER:=Gioacchino Mazzurco <gio@altermundi.net>
URL:=http://libremesh.org
DEPENDS:=+lua +luci-lib-jsonc +random-numgen \
DEPENDS:=+lua +luci-lib-jsonc \
shared-state
PKGARCH:=all
endef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ unique_append()
}

unique_append \
'*/5 * * * * ((sleep $(($(random-numgen) % 120)); shared-state sync dnsmasq-hosts &> /dev/null)&)'\
'*/5 * * * * ((sleep $((RANDOM % 120)); shared-state sync dnsmasq-hosts &> /dev/null)&)'\
/etc/crontabs/root
2 changes: 1 addition & 1 deletion packages/shared-state-dnsmasq_leases/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
MAINTAINER:=Gioacchino Mazzurco <gio@altermundi.net>
URL:=http://libremesh.org
DEPENDS:=+libuci-lua +lua +random-numgen \
DEPENDS:=+libuci-lua +lua \
+luci-lib-jsonc shared-state +shared-state-dnsmasq_hosts \
+luci-lib-nixio
PKGARCH:=all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ unique_append()
}

unique_append \
'*/5 * * * * ((sleep $(($(random-numgen) % 120)); shared-state sync dnsmasq-leases &> /dev/null)&)'\
'*/5 * * * * ((sleep $((RANDOM % 120)); shared-state sync dnsmasq-leases &> /dev/null)&)'\
/etc/crontabs/root

exit 0
2 changes: 1 addition & 1 deletion packages/shared-state-dnsmasq_servers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
MAINTAINER:=Gui iribarren <gui@altermundi.net>
URL:=http://libremesh.org
DEPENDS:=+lua +luci-lib-jsonc +random-numgen \
DEPENDS:=+lua +luci-lib-jsonc \
shared-state
PKGARCH:=all
endef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ unique_append()
}

unique_append \
'*/5 * * * * ((sleep $(($(random-numgen) % 120)); shared-state sync dnsmasq-servers &> /dev/null)&)'\
'*/5 * * * * ((sleep $((RANDOM % 120)); shared-state sync dnsmasq-servers &> /dev/null)&)'\
/etc/crontabs/root
2 changes: 1 addition & 1 deletion packages/shared-state-network_nodes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ define Package/$(PKG_NAME)
TITLE:=$(PKG_NAME) provides data-type for network nodes marked as reliable by user
MAINTAINER:=Asociacion Civil Altermundi <info@altermundi.net>
DEPENDS:=+shared-state +shared-state-nodes_and_links +lime-system +luci-lib-jsonc \
+libubus-lua +random-numgen
+libubus-lua
PKGARCH:=all
endef

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ unique_append()
}

unique_append \
'*/5 * * * * ((sleep $(($(random-numgen) % 120)); shared-state-multiwriter sync network_nodes &> /dev/null)&)'\
'*/5 * * * * ((sleep $((RANDOM % 120)); shared-state-multiwriter sync network_nodes &> /dev/null)&)'\
/etc/crontabs/root
2 changes: 1 addition & 1 deletion packages/shared-state-nodes_and_links/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
MAINTAINER:=Nicolas Pace <nico@libre.ws>
URL:=http://libremesh.org
DEPENDS:=+lua +luci-lib-jsonc +random-numgen \
DEPENDS:=+lua +luci-lib-jsonc \
shared-state +ubus-lime-location
PKGARCH:=all
endef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ unique_append()
}

unique_append \
'*/5 * * * * ((sleep $(($(random-numgen) % 120)); shared-state sync nodes_and_links &> /dev/null)&)'\
'*/5 * * * * ((sleep $((RANDOM % 120)); shared-state sync nodes_and_links &> /dev/null)&)'\
/etc/crontabs/root
2 changes: 1 addition & 1 deletion packages/shared-state-pirania/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
MAINTAINER:=Asociación Civil AlterMundi <info@altermundi.net>
URL:=http://libremesh.org
DEPENDS:=+lua +luci-lib-jsonc +random-numgen shared-state
DEPENDS:=+lua +luci-lib-jsonc shared-state
PKGARCH:=all
endef

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ unique_append()
}

unique_append \
'*/2 * * * * ((sleep $(($(random-numgen) % 30)); /etc/shared-state/publishers/shared-state-publish_vouchers && shared-state sync pirania-vouchers &> /dev/null)&)'\
'*/2 * * * * ((sleep $((RANDOM % 30)); /etc/shared-state/publishers/shared-state-publish_vouchers && shared-state sync pirania-vouchers &> /dev/null)&)'\
/etc/crontabs/root

exit 0
2 changes: 1 addition & 1 deletion packages/shared-state/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define Package/$(PKG_NAME)
MAINTAINER:=Gioacchino Mazzurco <gio@altermundi.net>
URL:=http://libremesh.org
DEPENDS:=+libuci-lua +lime-system +lua +luci-lib-jsonc +luci-lib-nixio \
+iputils-ping +uclient-fetch +random-numgen
+iputils-ping +uclient-fetch
PKGARCH:=all
endef

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ unique_append()
}

unique_append \
'*/30 * * * * ((sleep $(($(random-numgen) % 1000)); shared-state-publish-all &> /dev/null)&)'\
'*/30 * * * * ((sleep $((RANDOM % 1000)); shared-state-publish-all &> /dev/null)&)'\
/etc/crontabs/root

unique_append \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lastRunFile="/tmp/shared-state-get_candidates_neigh.lastrun"
lastRun=$(if [ -s $lastRunFile ]; then echo $(cat $lastRunFile); else echo -9999; fi)
currUptime="$(get_uptime)"

[ "$(($currUptime - $lastRun))" -lt "30" ] &&
[ "$((currUptime - lastRun))" -lt "30" ] &&
{
cat "$cacheFile"
exit 0
Expand Down

0 comments on commit b19b1ca

Please sign in to comment.