26
OPENWRT SUMMIT 2017 Integration of custom Web UIs into OpenWrt Davor Popović

IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

  • Upload
    others

  • View
    15

  • Download
    0

Embed Size (px)

Citation preview

Page 1: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

OPENWRT SUMMIT 2017

Integration of custom Web UIsinto OpenWrtDavor Popović

Page 2: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

About the presenter

◦ Davor Popović

Page 3: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port
Page 4: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port
Page 5: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Web UI

◦ Main communication with users

◦ Simplifies router setup and customization

◦ Displays router statistics and data

Page 6: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Existing OpenWrt Web UI flavors

◦ LuCI

◦ LuCI 2

◦ Gargoyle

Page 7: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Rolling your own Web UI

◦ Product differentiator

◦ UI/UX design

◦ Implementation

◦ Integration

Page 8: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Product differentiator

◦ Define who will use the router

◦ Define how often the router will be used

◦ Define special HW or SW features

Page 9: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Web UI/UX design

◦ Design based on target audience

◦ Importance of an experienced UX team

Page 10: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Implementation - Back end

◦ Three utilities of interest in OpenWrt ecosystem

• ubus• UCI• rpcd

◦ Front end invoking different RPC calls to change routerbehavior

Page 11: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Implementation - Back end

◦ Accessing and modifying UCI files – straightforward

◦ Additional functionallities – additional rpcd modules

• Using existing OpenWrt packages• Implementing your own

Page 12: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Implementation - Front end

◦ Two development approaches:

• Directly from host PC• From host PC through proxy on host PC

Page 13: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Implementation - Front end

WiFi device(mobile phone) Router PC / Laptop

Web

Proxy

Wired connection

Changes

WiFi connection

192.168.1.x:port request

Page 14: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Implementation - Front end

◦ Development components:

• Bundler• JS Framework• HTML + CSS

◦ Example:

• Webpack + Vue.js + HTML & CSS preprocesors

Page 15: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Integration

.js

.png

.css

.css OpenWrt package

.png

.js

.jsuci-defaults etc rpcd ...

.js

.json

Bundler

Page 16: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

Integration

◦ Potential hickups:

• Timeouts• Adding additional functionality (Captive Portal, Wizard, …)• Security considerations (e.g. cgi-bin)• 3rd party software bugs

Page 17: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

ExamplesSome Web UI design & functionality examples

Page 18: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port
Page 19: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port
Page 20: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port
Page 21: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port
Page 22: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port
Page 23: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port
Page 24: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port
Page 25: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port
Page 26: IntegrationofcustomWebUIs intoOpenWrt · Implementation-Frontend WiFi device (mobile phone) Router PC / Laptop Web Proxy Wired connection Changes WiFi connection 192.168.1.x:port

OPENWRT SUMMIT 2017

Integration of custom Web UIsinto [email protected]

[email protected]