# Lightning Router Config Archive ## Configure frontend ### Splash screen Connect on a fresh device - Can also visit `192.168.2.1` manually ![[Screenshot_20210823-214245_CaptivePortalLogin.jpg|400]] ### Hitting custom HTML ```bash # Configure new webroot uci set opennds.@opennds[0].webroot='/root/frontend/build' # Build and deploy frontend cd ~path/to/Lightning-Router/frontend ./deploy.sh ``` ![[Screenshot_20210824-021317_CaptivePortalLogin.jpg|400]] ### Removing values in config Method 1: Delete the corresponding line in `/etc/config/opennds` ```bash vim scp://[email protected]//etc/config/opennds ``` Method 2: Delete using uci ```bash uci delete opennds.@opennds[0].nameofoption ``` ### Example scripts in `/usr/lib/opennds` ![[Screen Shot 2021-08-24 at 12.30.33 AM.png]] ## Fix missing conf file ### Add back using UCI ```bash cd /etc/opennds touch opennds.conf uci set opennds.@opennds[0]=opennds uci set opennds.@opennds[0].enabled='1' uci set opennds.@opennds[0].fwhook_enabled='1' uci set opennds.@opennds[0].login_option_enabled='0' uci set opennds.@opennds[0].use_outdated_mhd='1' uci set opennds.@opennds[0].unescape_callback_enabled='0' uci set opennds.@opennds[0].gatewayinterface='br-lan' uci set opennds.@opennds[0].gatewayname='OpenWrt openNDS' uci set opennds.@opennds[0].maxclients='250' uci set opennds.@opennds[0].preauthidletimeout='30' uci set opennds.@opennds[0].authidletimeout='120' uci set opennds.@opennds[0].checkinterval='60' uci set opennds.@opennds[0].uploadrate='0' uci set opennds.@opennds[0].downloadrate='0' uci set opennds.@opennds[0].ratecheckwindow='2' uci set opennds.@opennds[0].uploadquota='0' uci set opennds.@opennds[0].downloadquota='0' uci set opennds.@opennds[0].authenticated_users='allow all' uci add_list opennds.@opennds[0].users_to_router='allow tcp port 53' uci add_list opennds.@opennds[0].users_to_router='allow udp port 53' uci add_list opennds.@opennds[0].users_to_router='allow udp port 67' uci add_list opennds.@opennds[0].users_to_router='allow tcp port 22' uci add_list opennds.@opennds[0].users_to_router='allow tcp port 23' uci add_list opennds.@opennds[0].users_to_router='allow tcp port 80' uci add_list opennds.@opennds[0].users_to_router='allow tcp port 443' uci set opennds.@opennds[0].sessiontimeout='0' uci set opennds.@opennds[0].webroot='/root/frontend/build' ``` ### Config error ```text root@OpenWrt:/etc/opennds# opennds restart [5][Tue Aug 31 12:08:22 2021][15765](src/main.c:664) openNDS Version 5.2.0 [3][Tue Aug 31 12:08:22 2021][15765](src/conf.c:1503) GatewayInterface is not set [3][Tue Aug 31 12:08:22 2021][15765](src/conf.c:1479) Configuration is not complete, exiting... ``` Fix (don't know how it worked but)... ```bash # Add back all the config options using uci as above # Paste their default config file in /etc/opennds/opennds.conf # Default: https://raw.githubusercontent.com/openNDS/openNDS/master/resources/opennds.conf vim scp://[email protected]//etc/opennds/opennds.conf ```