This demo uses slim prplOS based prpl-webui-testing-container-x86-64 container which serves only upcoming prplOS reference prpl-webui
web UI and otherwise it's using TR181 REST API from the host.
Requests to TR-181 REST API /serviceElements
endpoint are being proxied to host TR-181 REST API endpoint on http://192.168.1.1:8080 backend server and can be changed in /etc/lighttpd/conf.d/50-prplos-auth.conf
file if needed be:
$HTTP["url"] =~ "^/serviceElements" {
proxy.server = ( "" => ( ("host"=>"192.168.1.1","port" => "8080" ) ) )
}
Following ubus-cli
can be used to start the container:
- Cthulhu.Config.DhcpCommand="udhcpc -r 192.168.1.200 -i"
- Cthulhu.Sandbox.Instances.1.NetworkNS.Type="Veth"
- Cthulhu.Sandbox.Instances.1.NetworkNS.Interfaces.+{Bridge="br-lan",Interface="eth0",EnableDhcp=1}'
- Cthulhu.Sandbox.Instances.1.NetworkNS.Enable=1
- Cthulhu.Sandbox.start(SandboxId="generic")
- SoftwareModules.InstallDU(URL="docker://registry.gitlab.com/prpl-foundation/prplos/prplos/prpl-webui-testing-container-x86-64", UUID="prplos-testing", ExecutionEnvRef="generic")
prpl-webui
is work in progress, so authentication is not implemented yet and thus it needs to be disabled.
sed -i '9,$d' /etc/lighttpd/conf.d/50-prplos-auth.conf
/etc/init.d/lighttpd restart
Makes web UI available on the host from LAN on port 8081.
container_ip=$(/opt/prplos/usr/bin/lxc-info -iH prplos-testing)
iptables -A PREROUTING -t nat -i br-lan -p tcp --dport 8081 -j DNAT --to ${container_ip}:8080
iptables -A INPUT -i br-lan -p tcp --dport 8081 -j ACCEPT