GithubHelp home page GithubHelp logo

mkschreder / juci Goto Github PK

View Code? Open in Web Editor NEW
381.0 41.0 106.0 35.63 MB

JUCI JavaScript Webgui for embedded devices running OpenWRT

License: Other

Makefile 0.45% Shell 0.37% HTML 11.32% JavaScript 83.50% CSS 0.91% Lua 2.66% Less 0.30% Terra 0.07% ShaderLab 0.42%

juci's Introduction

JUCI Webgui for Embedded Routers

Author: Martin K. Schröder [email protected]

JUCI architecture looks roughly like this:

JUCI Architecture

JUCI frontend is built with html5, angularjs and bootstrap:

Desktop

JUCI is theme-able and fully mobile-ready (responsive):

Mobile

JUCI is modern web interface developed for OpenWRT-based embedded devices. It is built using HTML5 and angular.js and uses websockets for communicating with a compact and fast lua backend running on the embedded device. You can build both the frontend application and the backend server independently of each other and use them separately.

The OrangeRPCD project which JUCI uses as it's websocket based backend RPC server can be found here: https://github.com/mkschreder/orangerpcd.git.

JUCI Documentation in HTML form can be found here: http://mkschreder.github.io/juci

It is recommended that you start by reading overview of how juci works found here: http://mkschreder.github.io/juci/manual/how-juci-works.html

JUCI Flash and Memory Requirements (actual runtime usage):

  • ~5M flash for full-featured frontend install (including http server)
  • ~160k flash for backend rpc server (revorpcd)
  • 16M ram (revorpcd + lighttpd server)

News

Latest version of juci is 2.16.05.

Release notes:

  • Removed plugins that do not work on OpenWRT.

Release notes version 2.16.03:

  • Moved backend to a specialized juci server and removed dependency on ubus in the backend (see motivation below)

Removing ubus dependency (Feb 2016)

Original juci server was using ubus as it's primary way to organize backend components. This seemed like an awesome idea at the time when juci project was started. Everyone was going to "ubusify" everything. But with time this was starting to cause more pain than good. I will try to explain the implications of "ubusifying" everything below.

Ubus is an excellent system for interprocess communication. However, using it for organizing components of a single application is a very bad idea. It leads to what can best be compared to "microkernel" design. This forces even the most simple tasks such as checking whether user has access rights to some resource to require a serialization and deserialization of parameters (twice!). Micokernel is no different in that it forces everything to be a service. We know from experience that microkernels never really have been successful because their performance sucks for quite obvious reasons (you end up spending most of your time packing and unpacking messages instead of just making simple method calls).

So latest version of juci eliminates all this meaningless rpc message passing and instead implements a single lua backend server that responds to rpc calls from the client and directly provides all necessary services to all backend components that are installed. Instead of all backend components making ubus calls for things like session control, they all now instead just make direct calls into the backend server and this is orders of magnitude more efficient then all the unnecessary internal ubus calls.

Ubus is still supported of course and in fact you should use ubus as means of communicating with other programs running on the system. But for components of the juci backend ubus is no longer used. A single backend server is currently the best solution that I have tried. I have also tried using CGI and lua scripts, but I was not happy with the performance of that solution. It is important to be able to support large number of rpc calls and a specialized juci server makes this very easy to do.

What is JUCI?

If offers you the following:

  • Extremely resource-efficient for your device - your router only needs to run the core functions (which can be written in C!) and the gui itself is running entirely inside the client's browser). You router only computes and sends the minimum information necessary.
  • Full mobile support
  • Easy to work with - the code uses angular.js and html5, making it extremely easy to add new gui elements to the gui.
  • Full control and flexibility - yet many ready-made components: allowing you to pick yourself which level you want to develop on. There are no restrictions to the look and feel of your gui.
  • Dynamic theming - you can switch color themes at runtime.
  • Full language support - allowing for complete localization of your gui. Language file generation is even partially automatic (for html text). Also supporting dynamically changing language on page without having to reload the application. Also featuring quick debug mode for translations where you can see which strings are missing in currently used language pack.

Usage on OpenWRT

Here is how to build a user-mode-linux juci test build. For other architectures these instructions will for the most part be the same (apart from the uml options). UML image will run the whole system as a single executable on your host so you don't need to use any kind of emulator.

# go to your openwrt directory
cd openwrt

# do a full clean (at least delete all your feeds first because we will be overriding things)
make distclean

# add juci feed to feeds conf
echo "src-git-full juci https://github.com/mkschreder/juci-openwrt-feed.git" >> feeds.conf.default

# update your feeds
./scripts/feeds update -a 

# first install all juci packages with force flag
./scripts/feeds install -f -a -p juci

# THEN install all openwrt packages
./scripts/feeds install -a

# select a few top level packages
cat >> .config
CONFIG_TARGET_uml=y
CONFIG_PACKAGE_juci-full-openwrt=y
CONFIG_PACKAGE_orange-rpcd=y
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUSYBOX_CONFIG_SHA1SUM=y
^D

# fill out the rest of the selections
make defconfig

# build your image 
make 

# image will be in bin/uml

Before you test your image you need to set up tuntap network device on your host so that you can connect to the gui on the uml image:

# install user mode linux utils
sudo apt-get install uml-utilities

# create a tuntap network device
sudo tunctl -n <your user id>

# set ip address of our tap 
sudo ifconfig tap0 192.168.2.254

# enable ip forwarding 
bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'

# add route
sudo route add -host 192.168.2.100 dev tap0

Now you can start your uml image:

cd openwrt/bin/uml/

# starm uml image with tun tap network interface
./openwrt-uml-vmlinux ubd0=/data/software/openwrt-cc/bin/uml/openwrt-uml-ext4.img eth0=tuntap,tap0

Once you are in openwrt do this:

# add orangerpcd user admin
orangectl adduser admin

# set password for juci user admin
orangectl passwd admin admin

# set network ip of openwrt to correct ip 
uci set network.lan.ipaddr=192.168.2.100
uci commit
ubus call network reload

# you will probably need to reboot because tuntap seems to be broken without it 
poweroff

Now restart the uml image again and you should be able to access the gui at 192.168.2.100 using your browser.

Menus will be automatically configured by the juci-full-openwrt package uci-defaults scripts. If you want to use juci in a custom firmware you would typically create a custom metapackage that would only select your plugins and configure JUCI according to your own custom needs.

If you go to your router ip you should see the login screen. By default admin user is used to login but if you don't have password set for admin user you will not be able to login. So then go to the console and set password for admin user or change the user used for logging in by editing /etc/config/rpcd and then do /etc/init.d/rpcd restart.

If you can not login, it could be that you have not installed all juci packages correctly. JUCI requires modified versions of rpcd and uhttpd. In the case that you did not install the feed with "-f" option, you will not be overriding rpcd and so you will not be able to login.

JUCI also includes a nodejs server which you can do for local testing and for forwarding jsonrpc calls to your router during testing (juci-local-server).

Contribution

If you want to contribute to this project, feel free to submit pull requests.

Good to know

Addons can be developed on top of juci by creating package that installs js and css files into the router /www folder and then runs juci-update at postinstall (index.html is actually generated automatically).

In most cases you will never need to modify core juci code. If you need to change behavior of some function, you can always override the public function in javascript without having to modify the original implementation.

Juci uses modified version of uhttpd that can serve gz files with proper content type based on actual gzipped content.

JUCI also uses modified versions of ubus and rpcd on openwrt which you can also install from the feed (using -f option).

Getting started

New: you can now find compiled juci manuals here: http://mkschreder.github.io/juci/

JUCI is designed to work primarily on OpenWRT based systems. Even if you surely can use this code on other systems as well, a lot of functionality is implemented in the backend using OpenWRT tools and packages. So you will naturally need to build your firmware using openwrt to get the most of juci.

To install necessary tools to compile JUCI you can use the file ./scripts/ubuntu-bootstrap.sh. Run it using sudo.

JUCI is a collection of many files including individual javascript files, html templates, translations and styles (written in LESS). All of these files need to be built into a set of modules which can then be included as scripts into an index.html page. This is done using make.

make - without any arguments builds production files (minified and gzipped). 
make debug - builds uncompressed files for use with juci-local-server. 

When developing, it can be very good to use local server because it allows you to continuously test your changes locally. Local server is a small program written using node.js that starts a local http server while forwarding ubus calls to a real box.

To run local server for testing new gui elements during development:

./juci-local-server --host <your router ip with juci installed>

now go to http://localhost:3000/ to see the local gui. 

when you make changes in code, run make debug again and reload the local page. 

Common Issues

  • I visit the home page and can not see anything. The homepage is blank.

    Solution: open up your browser console and see if you have some error printed there.

  • Juci fails to start. Says juci.ui.menu ubus call is missing.

    Solution: make sure ubus-scriptd is running on the router. And make sure it loads all scripts without errors. To check, do /etc/init.d/ubus-scriptd stop and then just run ubus-scriptd. It will print a trace. Now cancel it with ctrl+c and once you fix the errors restart it using /etc/init.d/ubus-scriptd start. Then make sure the necessary call is present in output of "ubus list"

  • I get to login page but can not login. What is the password?

    Solution: the login user is set in /etc/config/rpcd. Password is the unix password for that user - which you can change using passwd .

  • I can login but get a big fat error box with a lot of text mentioning angular.

    Solution: this means that some module completely failed to initialize or that you have syntax error somewhere or that you have duplicate controller names or anything else that will cause an exception in angular. Usually the first thing to do is check browser console for any messages before the error. Then check the cryptic anuglar message mentioned in the error to get a clue on what to do next.

  • My page xyz can not access ubus. I get "Access Denied" in browser console.

    Solution: check that you have proper acl permissions configured in your access.json file in your plugin (if it is not there then create it - use existing plugins to see how). Then copy this file to your router and restart rpcd (/etc/init.d/rpcd restart). Then it should work.

  • My build process just hangs at line that contains "npm"

    Solution: build process needs connection to the internet to download necessary dependencies for some build scripts. If it is not possible then programs like "npm" may block indefinetely.

  • Compilation fails at "Compiling css/..juci.css.."

    Solution: this happens when yui-compressor (css minifier (which is written in java)) runs out of memory. This file tends to get large, and minifier needs more memory. Make sure your java VM is configured to use larger stack size (I find it amazing how easily java always wastes memory).

Unit testing

NOTE: unit testing is no longer supported for now since sep 2015! But old files are still there.

Previously it was possible to run juci core in node js and make ubus calls directly from command line. This functionality is still there and is implemented in lib-juci in tests directory, but it has not been used for a while so probably things have become outdated there. It would be nice in the future to actually make most of the angular factories standalone modules available through nodejs. This is not a difficult task because the code itself is very easy to make into a standalone library not dependent on angular.

This is on the list of things to be done.

Using UCI from the web console

It is possible to use UCI directly from your browser console. When you open your console you will have a global uci object defined in the application.

$uci.$sync("wireless") // will sync the wireless table
$uci.$sync(["wireless", "hosts"]) // will sync both wireless and hosts configs. 

$uci.wireless.wl0.channel.value = 1 // will set channel value to 1 

$uci.$save() // will save the uci config

All of the above methods return a promise. So if you need to run code AFTER the operation completes, you have to set the done (or fail/always) callback for the returned promise. You do it like this:

$uci.$sync("wireless").done(function(){
	console.log("Channel: "+$uci.wireless.wl0.channel.value); 
}).fail(function(){
	console.log("Failed to sync tables!"); 
}).always(function(){
	console.log("Done!"); 
}); 

When you invoke $sync() the uci code will load the specified configs into memory. The config types must be defined in your plugin first, so that fields that are not present in the configs can be created with their default values.

For more details on how this is done, check the .js files in the plugins under src/ folder (not pages and widgets, but the main plugin file which is usually called plugin-name.js or just main.js).

Just like in command line uci, JUCI gives you several ways to access config elements:

$uci.wireless["@all"] // list of all sections in the wireless config
$uci.wireless["@wifi-device"] // list of only the wifi device sections
$uci.wireless.wl0 // access wl0 section by name (all sections that have a name can be accessed like this)
$uci.wireless.cfg012345 // access a section with an automatically created uci name. 

Each field in uci section has a "value" member which is current value of that field. So if you use uci sections in your gui elements you have to use .value in order to set their values.

JUCI also retains the default and original values of each field so that you can revert the value to what it was when you loaded the config.

It is also possible to attach validators to each field. Examples are in uci.js file.

Backend Code

Juci backend mostly consists of scripts that implement ubus functions which become available to the gui code through json rpc. These scripts are simple glue that juci uses to interact with the rest of the system. You can place these scripts in ubus/ folder of your plugin. Each script should have a globally unique name (preferably a name that identifies it as being part of a specific plugin) and it will be placed into /usr/lib/ubus/juci folder on the router.

All of these scripts are then managed by ubus-scriptd service on the router which makes then available on ubus.

ubus-scriptd supports both batch scripts and services. Most of juci backend tasks are usually batch scripts that become ubus objects.

Further information

JUCI documentation can definitely be improved. You can speed up this process by posting your questions on the issues board on juci github page (https://github.com/mkschreder/juci/issues).

License Notice

All individual parts in JUCI are Copyright of their respective authors. 

Current list of contributors: 

	Reidar Cederqvist <[email protected]>
	Stefan Nygren <[email protected]>
	Martin K. Schröder <[email protected]>
	Charlie Robbins <http://nodejitsu.com>
	Craig Mason-Jones
	Kord Campbell <[email protected]>
	Mihai Bazon
	Philippe Rathé <[email protected]>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 3 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA

juci's People

Contributors

bittner avatar max-b avatar mkschreder avatar nunojpg avatar p4u avatar senlisu avatar vidhyadharan24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

juci's Issues

Build failed.(luaposix-release-v33.3.1)

CC       ext/posix/posix.lo
In file included from ext/posix/posix.c:25:0:
ext/posix/sched.c: In function 'Psched_setscheduler':
ext/posix/sched.c:74:9: error: variable 'sched_param' has initializer but incomplete type
  struct sched_param sched_param = {0};
         ^
ext/posix/sched.c:74:9: warning: excess elements in struct initializer [enabled by default]
ext/posix/sched.c:74:9: warning: (near initialization for 'sched_param') [enabled by default]
ext/posix/sched.c:74:21: error: storage size of 'sched_param' isn't known
  struct sched_param sched_param = {0};
                     ^
ext/posix/sched.c:76:28: error: 'SCHED_OTHER' undeclared (first use in this function)
  int policy = optint(L, 2, SCHED_OTHER);
                            ^
ext/posix/sched.c:76:28: note: each undeclared identifier is reported only once for each function it appears in
ext/posix/sched.c:79:2: warning: implicit declaration of function 'sched_setscheduler' [-Wimplicit-function-declaration]
  return pushresult(L, sched_setscheduler(pid, policy, &sched_param), NULL);
  ^
In file included from ext/posix/posix.c:30:0:
ext/posix/sys/resource.c: In function 'luaopen_posix_sys_resource':
ext/posix/sys/resource.c:155:2: warning: overflow in implicit constant conversion [-Woverflow]
  LPOSIX_CONST( RLIM_INFINITY );
  ^
ext/posix/sys/resource.c:157:2: warning: overflow in implicit constant conversion [-Woverflow]
  LPOSIX_CONST( RLIM_SAVED_CUR );
  ^
ext/posix/sys/resource.c:160:2: warning: overflow in implicit constant conversion [-Woverflow]
  LPOSIX_CONST( RLIM_SAVED_MAX );
make[5]: *** [ext/posix/posix.lo] Error 1

Add "#include <pthread.h>" in luaposix-release-v33.3.1/ext/posix/sched.c file, it can be resolved.

RPC error (system.board): {"jsonrpc":"2.0","id":1,"error":{"code":-32002,"message":"Access denied"}}

Hi
I was able to build openwrtCC with JUCI for virtualbox and successfully run it. But after login page i get in console:

UBUS payload: {"jsonrpc":"2.0","method":"call","id":1,"params":["fd041fd8cb536a29fee7673ad4e6c309","system","board",{}]}
Response: {"jsonrpc":"2.0","id":1,"error":{"code":-32002,"message":"Access denied"}}

In console:
RPC error (system.board): {"jsonrpc":"2.0","id":1,"error":{"code":-32002,"message":"Access denied"}}request.error @ 01-juci.js:55

can u help me?

CAN NOT LOGIN THE WEB

I think i do everything right with compile, and I can see the login page, I also use orangectl adduser and orangectl passwd user password the set the password, but I still can not login the WEB, I compile after your step.
I really like this project,
thank you!

default GUI password !

Issue isnt gone with todays update.
Orangectl : not found
The better solution i think is to make root user is user for GUI by default. Then we can change password inside GUI.....
BTW Thank you for solving luaposix isuue

build error openwrt + juci

In file included from base.h:23:0,
                 from mod_extforward.c:1:
mod_extforward.c: In function 'mod_extforward_uri_handler':
mod_extforward.c:442:10: error: 'addrs_left' undeclared (first use in this function)
   UNUSED(addrs_left);
          ^
buffer.h:131:28: note: in definition of macro 'UNUSED'
 #define UNUSED(x) ( (void)(x) )
                            ^
mod_extforward.c:442:10: note: each undeclared identifier is reported only once for each function it appears in
   UNUSED(addrs_left);
          ^
buffer.h:131:28: note: in definition of macro 'UNUSED'
 #define UNUSED(x) ( (void)(x) )
                            ^
Makefile:1348: recipe for target 'mod_extforward.lo' failed
make[7]: *** [mod_extforward.lo] Error 1
make[7]: Leaving directory '/home/kota/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/lighttpd-23644e8f150baac0aa5199a6820234d8e7898231/src'
Makefile:945: recipe for target 'all' failed
make[6]: *** [all] Error 2
make[6]: Leaving directory '/home/kota/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/lighttpd-23644e8f150baac0aa5199a6820234d8e7898231/src'
Makefile:435: recipe for target 'all-recursive' failed
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory '/home/kota/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/lighttpd-23644e8f150baac0aa5199a6820234d8e7898231'
Makefile:365: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/home/kota/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/lighttpd-23644e8f150baac0aa5199a6820234d8e7898231'
Makefile:316: recipe for target '/home/kota/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/lighttpd-23644e8f150baac0aa5199a6820234d8e7898231/.built' failed
make[3]: *** [/home/kota/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/lighttpd-23644e8f150baac0aa5199a6820234d8e7898231/.built] Error 2
make[3]: Leaving directory '/home/kota/openwrt/feeds/juci/lighttpd'
package/Makefile:191: recipe for target 'package/feeds/juci/lighttpd/compile' failed
make[2]: *** [package/feeds/juci/lighttpd/compile] Error 2
make[2]: Leaving directory '/home/kota/openwrt'
package/Makefile:188: recipe for target '/home/kota/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.package_compile' failed
make[1]: *** [/home/kota/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/kota/openwrt'
/home/kota/openwrt/include/toplevel.mk:181: ошибка выполнения рецепта для цели «world»
make: *** [world] Ошибка 2
kota@kota:~/openwrt$ 

Juci working partially

Hello
Trying to make Juci working for about 5 month,no success...
Target X86 (64)
System is Ubuntu 16.04 (14.04.12.05):
npm install
npm -g install nodejs
npm -g install express

./ubuntu-bootstrap.sh

adduser openwrt
passwd openwrt
su openwrt

git clone git://git.openwrt.org/15.05/openwrt.git
chown -R openwrt openwrt
cd openwrt
nano feeds.conf.default

src-git juci https://github.com/mkschreder/juci-openwrt-feed.git;v2.16.02
src-git packages https://github.com/openwrt/packages.git;for-15.05
src-git luci https://github.com/openwrt/luci.git;for-15.05
src-git routing https://github.com/openwrt-routing/packages.git;for-15.05
src-git telephony https://github.com/openwrt/telephony.git;for-15.05
src-git management https://github.com/openwrt-management/packages.git;for-15.05

src-git targets https://github.com/openwrt/targets.git

src-git oldpackages http://git.openwrt.org/packages.git

src-svn xwrt http://x-wrt.googlecode.com/svn/trunk/package

src-svn phone svn://svn.openwrt.org/openwrt/feeds/phone

src-svn efl svn://svn.openwrt.org/openwrt/feeds/efl

src-svn xorg svn://svn.openwrt.org/openwrt/feeds/xorg

src-svn desktop svn://svn.openwrt.org/openwrt/feeds/desktop

src-svn xfce svn://svn.openwrt.org/openwrt/feeds/xfce

src-svn lxde svn://svn.openwrt.org/openwrt/feeds/lxde

src-link custom /usr/src/openwrt/custom-feed

./scripts/feeds update -a
./scripts/feeds install -a
./scripts/feeds install -f -p juci -a

Overriding 3 packages...
Make menuconfig
Select juci-full ONLY

make V=s -j 3

successful compile!

openwrt-x86-64-combined-ext4 write to usb disk with physdiskwrite...

Openwrt loads on target PC

From PC in local network:
192.168.1.1

See Login screen
Using root login & pass.
juci login screen

And here:
JS errors
juci js error 2
juci js error1

Ok waiting....

Can click only system.
If i click other button - blank screen.

Here i chanched uhttpd port as you see
Did rpcd and juci restart and reload, no success.

Tried with openwrt versions:
15.05,14.07,trunk
Tried Juci branches:
2.16.02,2.16.03.2.16.04, for-15.07

Dear Mkschreder can you say what im doing incorrect?

Multiwan

Hello Martin!
It is possible to add menu in GUI for dualwan(mwan3)?
Want to test juci in battlefield :) (60pcs and 60 on wifi)

You do not have an RPC connection to the router! 2

Thank you for project!!

But there is a little problem.

When you try to access the Web interface, comes the following statement.

-> You do not have an RPC connection to the router!

F12

  1. Console message

01-juci.js:57 RPC init
01-juci.js:56 connecting to rpc server at (ws://192.168.20.18/websocket/)
01-juci.js:56 WebSocket connection to 'ws://192.168.20.18/websocket/' failed: Error during WebSocket handshake: Unexpected response code: 404RevoRPC.$connect @ 01-juci.js:56doConnect @ 01-juci.js:57(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1iterate @ 01-juci.js:1async.eachSeries @ 01-juci.js:1_asyncMap @ 01-juci.js:1(anonymous function) @ 01-juci.js:1async.series @ 01-juci.js:1JUCIMain.$init @ 01-juci.js:57(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29ready @ 01-juci.js:29I @ 01-juci.js:29
01-juci.js:56 connection failed!socket.onerror @ 01-juci.js:56
01-juci.js:57 could not connect to rpc interface(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29socket.onerror @ 01-juci.js:56
01-juci.js:57 UCI Init
01-juci.js:56 Init UCI
01-juci.js:56 No uci rpc object present!UCI.$init @ 01-juci.js:56(anonymous function) @ 01-juci.js:57(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1iterate @ 01-juci.js:1(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29socket.onerror @ 01-juci.js:56
01-juci.js:56 connection closed!socket.onclose @ 01-juci.js:56
01-juci.js:57 UCI failed to initialize!(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56
01-juci.js:57 JUCI Init
01-juci.js:57 init: config
01-juci.js:56 Could not sync config juci(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56
01-juci.js:57 Using settings from config/juci on router
01-juci.js:57 skipping menu init
01-juci.js:57 CONF
01-juci.js:57 juci: angular init
01-juci.js:56 Could not sync config firewall(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56
01-juci.js:56 Could not sync config hosts(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56
01-juci.js:56 Could not sync config wireless(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56
01-juci.js:56 Could not sync config system(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56
01-juci.js:56 Could not sync config upnpd(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56

404 ->
Request URL:ws://192.168.20.18/websocket/
Request Method:GET
Status Code:404 Not Found

help me~

Hi,mkschreder I got this error

make[5]: Entering directory /home/gxc/openwrt_widora/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/jucid-49c573252ed8a1c0972d241a30364d717237b31a/src' mipsel-openwrt-linux-uclibc-gcc -DPACKAGE_NAME=\"jucid\" -DPACKAGE_TARNAME=\"jucid\" -DPACKAGE_VERSION=\"0.1.0\" -DPACKAGE_STRING=\"jucid\ 0.1.0\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"jucid\" -DVERSION=\"0.1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LUA_H=1 -DHAVE_UCI_H=1 -I. -I/home/gxc/openwrt_widora/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/include -I/home/gxc/openwrt_widora/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/include -I/home/gxc/openwrt_widora/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/gxc/openwrt_widora/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/include -std=gnu99 -Wall -Werror -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kec -mdsp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -MT revorpcd-juci_ws_server.o -MD -MP -MF .deps/revorpcd-juci_ws_server.Tpo -c -o revorpcd-juci_ws_server.otest -f 'juci_ws_server.c' || echo './'juci_ws_server.c juci_ws_server.c:119:56: error: 'enum lws_callback_reasons' declared inside parameter list [-Werror] static int _ubus_socket_callback(struct lws *wsi, enum lws_callback_reasons reason, void *_user, void *in, size_t len){ ^ juci_ws_server.c:119:56: error: its scope is only this definition or declaration, which is probably not what you want [-Werror] juci_ws_server.c:119:77: error: parameter 2 ('reason') has incomplete type static int _ubus_socket_callback(struct lws *wsi, enum lws_callback_reasons reason, void *_user, void *in, size_t len){ ^ juci_ws_server.c: In function '_ubus_socket_callback': juci_ws_server.c:121:15: error: implicit declaration of function 'lws_get_protocol' [-Werror=implicit-function-declaration] const struct lws_protocols *proto = lws_get_protocol(wsi); ^ juci_ws_server.c:121:38: error: initialization makes pointer from integer without a cast [-Werror] const struct lws_protocols *proto = lws_get_protocol(wsi); ^ juci_ws_server.c:129:2: error: implicit declaration of function 'lws_get_socket_fd' [-Werror=implicit-function-declaration] int32_t peer_id = lws_get_socket_fd(wsi); ^ juci_ws_server.c:132:57: error: dereferencing pointer to incomplete type struct ubus_srv_ws *self = (struct ubus_srv_ws*)proto->user; ^ juci_ws_server.c:138:4: error: implicit declaration of function 'lws_get_peer_addresses' [-Werror=implicit-function-declaration] lws_get_peer_addresses(wsi, peer_id, hostname, sizeof(hostname), ipaddr, sizeof(ipaddr)); ^ juci_ws_server.c:143:4: error: implicit declaration of function 'lws_callback_on_writable' [-Werror=implicit-function-declaration] lws_callback_on_writable(wsi); ^ juci_ws_server.c:151:57: error: dereferencing pointer to incomplete type struct ubus_srv_ws *self = (struct ubus_srv_ws*)proto->user; ^ juci_ws_server.c:161:57: error: dereferencing pointer to incomplete type struct ubus_srv_ws *self = (struct ubus_srv_ws*)proto->user; ^ juci_ws_server.c:179:5: error: implicit declaration of function 'lws_write' [-Werror=implicit-function-declaration] int n = lws_write(wsi, &frame->buf[LWS_SEND_BUFFER_PRE_PADDING]+frame->sent_count, len, flags); ^ juci_ws_server.c:198:4: error: implicit declaration of function 'lws_rx_flow_control' [-Werror=implicit-function-declaration] lws_rx_flow_control(wsi, 1); ^ juci_ws_server.c:205:57: error: dereferencing pointer to incomplete type struct ubus_srv_ws *self = (struct ubus_srv_ws*)proto->user; ^ juci_ws_server.c:213:4: error: implicit declaration of function 'lws_is_final_fragment' [-Werror=implicit-function-declaration] if((!(*user)->buffer_start && lws_is_final_fragment(wsi)) || lws_is_final_fragment(wsi)){ ^ juci_ws_server.c: In function '_websocket_destroy': juci_ws_server.c:286:2: error: implicit declaration of function 'lws_context_destroy' [-Werror=implicit-function-declaration] if(self->ctx) lws_context_destroy(self->ctx); ^ juci_ws_server.c: In function '_websocket_listen': juci_ws_server.c:321:17: error: assignment from incompatible pointer type [-Werror] info.protocols = self->protocols; ^ juci_ws_server.c:323:17: error: 'LWS_SERVER_OPTION_VALIDATE_UTF8' undeclared (first use in this function) info.options = LWS_SERVER_OPTION_VALIDATE_UTF8; ^ juci_ws_server.c:323:17: note: each undeclared identifier is reported only once for each function it appears in juci_ws_server.c:325:2: error: implicit declaration of function 'lws_create_context' [-Werror=implicit-function-declaration] self->ctx = lws_create_context(&info); ^ juci_ws_server.c:325:12: error: assignment makes pointer from integer without a cast [-Werror] self->ctx = lws_create_context(&info); ^ juci_ws_server.c: In function '_websocket_server_thread': juci_ws_server.c:339:3: error: implicit declaration of function 'lws_service' [-Werror=implicit-function-declaration] lws_service(self->ctx, 10); ^ juci_ws_server.c: In function 'juci_ws_server_new': juci_ws_server.c:421:37: error: invalid application of 'sizeof' to incomplete type 'struct lws_protocols' self->protocols = calloc(2, sizeof(struct lws_protocols)); ^ juci_ws_server.c:423:2: error: invalid use of undefined type 'struct lws_protocols' self->protocols[0] = (struct lws_protocols){ ^ juci_ws_server.c:423:17: error: dereferencing pointer to incomplete type self->protocols[0] = (struct lws_protocols){ ^ juci_ws_server.c:424:3: error: unknown field 'name' specified in initializer .name = "", ^ juci_ws_server.c:424:3: error: excess elements in struct initializer [-Werror] juci_ws_server.c:424:3: error: (near initialization for '(anonymous)') [-Werror] juci_ws_server.c:425:3: error: unknown field 'callback' specified in initializer .callback = _ubus_socket_callback, ^ juci_ws_server.c:425:3: error: excess elements in struct initializer [-Werror] juci_ws_server.c:425:3: error: (near initialization for '(anonymous)') [-Werror] juci_ws_server.c:426:3: error: unknown field 'per_session_data_size' specified in initializer .per_session_data_size = sizeof(struct ubus_srv_ws_client*), ^ juci_ws_server.c:426:42: error: excess elements in struct initializer [-Werror] .per_session_data_size = sizeof(struct ubus_srv_ws_client*), ^ juci_ws_server.c:426:42: error: (near initialization for '(anonymous)') [-Werror] juci_ws_server.c:427:3: error: unknown field 'user' specified in initializer .user = self ^ juci_ws_server.c:428:2: error: excess elements in struct initializer [-Werror] }; ^ juci_ws_server.c:428:2: error: (near initialization for '(anonymous)') [-Werror] juci_ws_server.c:428:2: error: invalid use of undefined type 'struct lws_protocols' cc1: all warnings being treated as errors make[5]: *** [revorpcd-juci_ws_server.o] Error 1 make[5]: Leaving directory/home/gxc/openwrt_widora/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/jucid-49c573252ed8a1c0972d241a30364d717237b31a/src'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory /home/gxc/openwrt_widora/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/jucid-49c573252ed8a1c0972d241a30364d717237b31a' make[3]: *** [/home/gxc/openwrt_widora/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/jucid-49c573252ed8a1c0972d241a30364d717237b31a/.built] Error 2 make[3]: Leaving directory/home/gxc/openwrt_widora/feeds/juci/jucid'
make[2]: *** [package/feeds/juci/jucid/compile] Error 2
make[2]: Leaving directory /home/gxc/openwrt_widora' make[1]: *** [/home/gxc/openwrt_widora/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.package_compile] Error 2 make[1]: Leaving directory/home/gxc/openwrt_widora'

rpcd - fatal: reference is not a tree: 72048bb2c8c23fbb57c7d9e6de4ab7373036da5a

How to fix it??

make[3]: Leaving directory `/home/kota/juciwrt/package/network/utils/iwinfo
make[3]: Entering directory `/home/kota/juciwrt/package/system/rpcd'
mkdir -p /home/kota/juciwrt/dl
echo "Checking out files from the git repository..."; mkdir -p /home/kota/juciwrt/tmp/dl && cd /home/kota/juciwrt/tmp/dl && rm -rf rpcd && [ \! -d rpcd ] && git clone https://github.com/mkschreder/juci-rpcd.git rpcd --recursive && (cd rpcd && git checkout 72048bb2c8c23fbb57c7d9e6de4ab7373036da5a && git submodule update) && echo "Packing checkout..." && rm -rf rpcd/.git &&  tar czf /home/kota/juciwrt/tmp/dl/rpcd-2015-01-10-72048bb2c8c23fbb57c7d9e6de4ab7373036da5a.tar.gz rpcd && mv /home/kota/juciwrt/tmp/dl/rpcd-2015-01-10-72048bb2c8c23fbb57c7d9e6de4ab7373036da5a.tar.gz /home/kota/juciwrt/dl/ && rm -rf rpcd; 
Checking out files from the git repository...
Cloning into 'rpcd'...
remote: Counting objects: 647, done.
remote: Total 647 (delta 0), reused 0 (delta 0), pack-reused 647
Receiving objects: 100% (647/647), 137.50 KiB | 0 bytes/s, done.
Resolving deltas: 100% (423/423), done.
Checking connectivity... done.
fatal: reference is not a tree: 72048bb2c8c23fbb57c7d9e6de4ab7373036da5a
make[3]: *** [/home/kota/juciwrt/dl/rpcd-2015-01-10-72048bb2c8c23fbb57c7d9e6de4ab7373036da5a.tar.gz] Error 128
make[3]: Leaving directory `/home/kota/juciwrt/package/system/rpcd'
make[2]: *** [package/system/rpcd/compile] Error 2
make[2]: Leaving directory `/home/kota/juciwrt'
make[1]: *** [/home/kota/juciwrt/staging_dir/target-mipsel_24kec+dsp_musl-1.1.11/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/kota/juciwrt'
make: *** [world] Error 2
kota@kota:~/juciwrt$ 

General Help

Hello, i would like to try juci but i’am not an expert and certainly i am doing something wrong and i can’t reach the goal.

Could you explain schematically the procedure top down from cloning your git untill to build the package ?

I also would like to install on a 4 Mb flash router (TL-WR841N) do you think is it possible ?

Thank you very much
regards
Giulio

Juci on WR940N, e.g. 4MB flash

How can I compile it? I tried with minimalistic choose of things included and it still does't compile with a normal upgrade file, because of the size.. Any suggestions ?

Error: Cannot find module './index'

Anyone see this error?
Running "nggettext_compile:all" (nggettext_compile) task

Done.
Compiling JS bin/www/js/01-juci.js..
Compiling JS bin/www/js/01-juci.tpl.js..
Compiling JS bin/www/js/99-translations.js..
Compiling CSS bin/www/css/01-juci.css..
which: no yui-compressor in (/path/OpenWrt_JuCi/juciwrt/staging_dir/target-mipsel_24kec+dsp_musl-1.1.11/host/bin:/path/OpenWrt_JuCi/juciwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_musl-1.1.11/bin:/path/OpenWrt_JuCi/juciwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_musl-1.1.11/bin:/path/OpenWrt_JuCi/juciwrt/staging_dir/host/bin:/path/OpenWrt_JuCi/juciwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_musl-1.1.11/bin:/path/OpenWrt_JuCi/juciwrt/staging_dir/host/bin:/path/OpenWrt_JuCi/juciwrt/staging_dir/host/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)

module.js:340
throw err;
^
Error: Cannot find module './index'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/bin/yuicompressor:10:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
make[4]: *** [release] Error 8
make[4]: Leaving directory /path/OpenWrt_JuCi/juciwrt/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/juci-74d402a457e6cbabeb6e1e7acf75f8274a9eb274' make[3]: *** [/path/OpenWrt_JuCi/juciwrt/build_dir/target-mipsel_24kec+dsp_musl-1.1.11/juci-74d402a457e6cbabeb6e1e7acf75f8274a9eb274/.built] Error 2 make[3]: Leaving directory/path/OpenWrt_JuCi/juciwrt/feeds/juci/juci'
make[2]: *** [package/feeds/juci/juci/compile] Error 2
make[2]: Leaving directory /path/OpenWrt_JuCi/juciwrt' make[1]: *** [/path/OpenWrt_JuCi/juciwrt/staging_dir/target-mipsel_24kec+dsp_musl-1.1.11/stamp/.package_compile] Error 2 make[1]: Leaving directory/path/OpenWrt_JuCi/juciwrt'
make: *** [world] Error 2

*** No rule to make target 'package/feeds/juci/libzmq/compile', needed by 'package/feeds/juci/czmq/compile'. Stop.

Hi, mkschreder!
Compilation for ar71xx permanently comes to an end with an error:
make[2]: *** No rule to make target 'package/feeds/juci/libzmq/compile', needed by 'package/feeds/juci/czmq/compile'. Stop.
make[2]: Leaving directory '/root/trunk'
package/Makefile:188: recipe for target '/root/trunk/staging_dir/target-mips_34kc_musl-1.1.11/stamp/.package_compile' failed
make[1]: *** [/root/trunk/staging_dir/target-mips_34kc_musl-1.1.11/stamp/.package_compile] Error 2
make[1]: Leaving directory '/root/trunk'
/root/trunk/include/toplevel.mk:177: recipe run error for the purpose of "world"
make: *** [world] Error 2
What do I do not and how to correct it? Thanks)

You do not have an RPC connection to the router!

F12 in browser:
Request URL:ws://192.168.200.254/websocket/
Request Method:GET
Status Code:503 Service Not Available

Error log in /var/log/error.log(openwrt):
root@Box:/tmp/log# cat error.log
2016-04-09 11:37:20: (log.c.166) server started
2016-04-09 11:37:20: (server.c.1032) WARNING: unknown config-key: url.access-deny (ignored)
2016-04-09 11:37:20: (mod_websocket.c.340) /websocket/ is match WebSocket extension: /websocket/
2016-04-09 11:37:20: (mod_websocket_handshake.c.98) allowed origins are not specified
2016-04-09 11:37:20: (mod_websocket.c.531) works as WebSocket Proxy
2016-04-09 11:37:20: (mod_websocket.c.152) try to connect backend -> 127.0.0.1 : 1234
2016-04-09 11:37:20: (mod_websocket.c.156) fail to connect
2016-04-09 11:37:20: (mod_websocket.c.854) disconnected from client ( fd = 8 )
2016-04-09 11:37:25: (mod_websocket.c.340) /websocket/ is match WebSocket extension: /websocket/
2016-04-09 11:37:25: (mod_websocket_handshake.c.98) allowed origins are not specified
2016-04-09 11:37:25: (mod_websocket.c.531) works as WebSocket Proxy
2016-04-09 11:37:25: (mod_websocket.c.152) try to connect backend -> 127.0.0.1 : 1234
2016-04-09 11:37:25: (mod_websocket.c.156) fail to connect
2016-04-09 11:37:25: (mod_websocket.c.854) disconnected from client ( fd = 9 )

Missing dependencies Angular, JUCI, UCI

Hello,

I compiled OpenWRT following the guidelines in README.
However, the web interface is not functional:

juci_console log

Please note that this is after running juci-update manually. Without this, it the web root doesn't contain any HTML and no assets.

can not access default page

juci version: 1.15.12

  1. access root page 192.168.1.1
    rediret to url: http://192.168.1.1/#!/login, then a js alert displayed.

    Error: [$injector:unpr] http://errors.angularjs.org/1.3.15/$injector/unpr?p0=%24eventsProvider%20%3C-%20%24events
    
  2. in the console, there are other errors

    RPC error (uci.revert): {"jsonrpc":"2.0","id":1,"error":{"code":-32002,"message":"Access denied"}}
    Could not sync config netmode
    Could not sync config hosts
    Could not sync config firewall
    

can someone help me to go through it?

Can not establish ubus connection to router. If the router is rebooting then please wait a few minutes and try again.

Hi, mkschreder

build success, but i got "Can not establish ubus connection to router. If the router is rebooting then please wait a few minutes and try again."

openwrt use 15.05 branch (Chaos Calmer)
git clone git://git.openwrt.org/15.05/openwrt.git

~/source/openwrt_juci$ cat feeds.conf.default | grep juci
src-git juci https://github.com/mkschreder/juci-openwrt-feed.git;

devel has the same problems

uci failed to initialize

please help mkschreder
i got this error
sorry for my bad english
RPC init
01-juci.js:50 connecting to rpc server at (ws://192.168.1.1/websocket/)
01-juci.js:50 RPC connection established!
01-juci.js:50 RPC initialized!
01-juci.js:50 UCI Init
01-juci.js:50 Init UCI
01-juci.js:50 UCI failed to initialize!(anonymous function) @ 01-juci.js:50
01-juci.js:50 JUCI Init
01-juci.js:51 init: config
01-juci.js:50 Could not sync config juci(anonymous function) @ 01-juci.js:50
01-juci.js:51 Using settings from config/juci on router
01-juci.js:50 Failed to verify session.
01-juci.js:50 juci: loading menu from server..
01-juci.js:38 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=juci&p1=Error%3A%2…20%20%20at%20_t%20(http%3A%2F%2F192.168.1.1%2Fjs%2F01-juci.js%3A38%3A32716)
https://cr-input.mxpnl.net/data?_channel_id=&_partner_id=39571&_sub_id=0000&_app_version=1.0.23&_app=cs-dca Failed to load resource: net::ERR_NAME_NOT_RESOLVED

[juci-openwrt-wireless]: Sometimes "/juci/wireless clients" will get incorrect results.

~$ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method":"call","params":["6d2f27bd7e596cda7aa1182029d7b59c","/juci/wireless","clients",{}], "id":"1"}' http://192.168.1.1/ubus
{"jsonrpc":"2.0","id":"1","result":[0,{"clients":[{"rx_bytes":21851,"authenticated":true,"tx_bytes":22243}],"error":"could not add json","json":"{\"clients\":[{\"rx_bytes\":21851,\"authenticated\":true,\"tx_bytes\":22243,\"tx_bitrate\":21.7,\"tx_packets\":175,\"tx_retries\":33,\"signal_avg\":-51,\"rx_packets\":385,\"device\":\"wlan0\",\"inactive_time\":18550,\"tdls_peer\":false,\"tx_failed\":0,\"wmm_wme\":true,\"rx_bitrate\":65,\"authorized\":true,\"preamble\":\"short\",\"expected_throughput\":\"1.473Mbps\",\"macaddr\":\"00:11:22:33:44:55\",\"mfp\":false,\"signal\":-51}]}"}]}

"error":"could not add json"
Sometimes it is normal, very strange

can not change "lan" ip address

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdcb:5bd4:6ddb::/48'

config interface 'lan'
        option ifname 'eth0'
        option force_link '1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '10'

I can not change "lan" ip address,
I think it's because interface 'loopback' properties "ipaddr" and interface 'loopback' properties "ipaddr" repeated

Where to install services

I want to know where to install the services such as ueventd an juci-networkd. Others, if it need a init.d script.

I can sign in the juci

I just look the sign in page, after sign in , the
sid is always “RPC_DEFAULT_SESSION_ID”. And I get this log "WARNING: JUCI.module() is deprecated! [core]"

compile error: libblobpack-1.0.1/src/*.h': No such file or directory

Hi Martin,
Just updated my source, mainly juci package, but got the following compile error:

Could you take a look and how to fix it?

Thanks,

Shufen

cp: cannot stat '/home/szhang/Projects/Adaptrum/Endor/cc_15_04/ChaosCalmer15.04/build_dir/target-arm_cortex-a9+vfpv3_uClibc-0.9.33.2_eabi/libblobpack-1.0.1/src/.h': No such file or directory
make[3]: *
* [/home/szhang/Projects/Adaptrum/Endor/cc_15_04/ChaosCalmer15.04/staging_dir/target-arm_cortex-a9+vfpv3_uClibc-0.9.33.2_eabi/stamp/.libblobpack_installed] Error 1
make[3]: Leaving directory `/home/szhang/Projects/Adaptrum/Endor/cc_15_04/ChaosCalmer15.04/feeds/juci/libblobpack'
make[2]: *** [package/feeds/juci/libblobpack/compile] Error 2

Build failed with latest feed

Build host: ubuntu 14 x64
Openwrt branch: 15.05

Feed:

echo "src-git juci https://github.com/mkschreder/juci-openwrt-feed.git" >> feeds.conf.default
./scripts/feeds update juci
./scripts/feeds install -p juci -a

Make:

make package/juci/compile V=s                                                                                                                                  !1763
make[1]: Entering directory `/home/user/openwrt'
make[1]: *** No rule to make target `package/juci/compile'.  Stop.
make[1]: Leaving directory `/home/user/openwrt'
make: *** [package/juci/compile] Error 2

.config diff:

1204,1205c1204,1205
< CONFIG_PACKAGE_libpthread=y
< CONFIG_PACKAGE_librt=y

---
> # CONFIG_PACKAGE_libpthread is not set
> # CONFIG_PACKAGE_librt is not set
1284,1330d1283
< # JUCI
< #
<
< #
< # Core
< #
< CONFIG_PACKAGE_juci=y
< CONFIG_JUCI_THEME_SELECTED=y
<
< #
< # Plugins
< #
< # CONFIG_PACKAGE_juci-asterisk is not set
< # CONFIG_PACKAGE_juci-broadcom-dsl is not set
< # CONFIG_PACKAGE_juci-broadcom-ethernet is not set
< # CONFIG_PACKAGE_juci-broadcom-vlan is not set
< # CONFIG_PACKAGE_juci-broadcom-wl is not set
< # CONFIG_PACKAGE_juci-ddns is not set
< CONFIG_PACKAGE_juci-diagnostics=y
< CONFIG_PACKAGE_juci-dnsmasq-dhcp=y
< CONFIG_PACKAGE_juci-dropbear=y
< # CONFIG_PACKAGE_juci-event is not set
< CONFIG_PACKAGE_juci-firewall-fw3=y
< # CONFIG_PACKAGE_juci-igmpinfo is not set
< # CONFIG_PACKAGE_juci-inteno-router is not set
< # CONFIG_PACKAGE_juci-jquery-console is not set
< CONFIG_PACKAGE_juci-macdb=y
< # CONFIG_PACKAGE_juci-minidlna is not set
< # CONFIG_PACKAGE_juci-mod-status is not set
< CONFIG_PACKAGE_juci-mod-system=y
< CONFIG_PACKAGE_juci-natalie-dect=y
< # CONFIG_PACKAGE_juci-netmode is not set
< # CONFIG_PACKAGE_juci-network-netifd is not set
< CONFIG_PACKAGE_juci-router-openwrt=y
< # CONFIG_PACKAGE_juci-samba is not set
< CONFIG_PACKAGE_juci-sysupgrade=y
< CONFIG_PACKAGE_juci-theme-inteno=y
< # CONFIG_PACKAGE_juci-upnp is not set
< # CONFIG_PACKAGE_juci-usb is not set
<
< #
< # Themes
< #
< CONFIG_PACKAGE_juci-theme-default=y
< CONFIG_JUCI_THEME_INTENO=y
<
< #
1830c1783
< CONFIG_PACKAGE_lua=y

---
> # CONFIG_PACKAGE_lua is not set
1834d1786
< # CONFIG_PACKAGE_lua-examples is not set
2110c2062
< CONFIG_PACKAGE_liblua=y

---
> # CONFIG_PACKAGE_liblua is not set
2200c2152
< CONFIG_PACKAGE_libubox-lua=y

---
> # CONFIG_PACKAGE_libubox-lua is not set
2202c2154
< CONFIG_PACKAGE_libubus-lua=y

---
> # CONFIG_PACKAGE_libubus-lua is not set
2204c2156
< CONFIG_PACKAGE_libuci-lua=y

---
> # CONFIG_PACKAGE_libuci-lua is not set
2220,2221c2172
< CONFIG_PACKAGE_libuv=y
< CONFIG_PACKAGE_libuv-lua=y

---
> # CONFIG_PACKAGE_libuv is not set
2240d2190
< # CONFIG_PACKAGE_luajit is not set
2930,2933d2879
< CONFIG_PACKAGE_juci-uhttpd=y
< # CONFIG_PACKAGE_uhttpd_debug is not set
< # CONFIG_PACKAGE_uhttpd_no_same_origin is not set
< CONFIG_PACKAGE_juci-uhttpd-mod-ubus=y
2945a2892
> # CONFIG_PACKAGE_uhttpd_debug is not set
2990d2936
< # CONFIG_PACKAGE_iconnect is not set
3125,3133d3070
< # UBUS
< #
< CONFIG_PACKAGE_etc-ubus-daemon=y
< CONFIG_PACKAGE_juci-rpcd=y
< # CONFIG_PACKAGE_juci-rpcd-mod-file is not set
< CONFIG_PACKAGE_juci-ubus-core=y
< CONFIG_JUCI_UBUS_CORE=y
<
< #
3344d3280
< # CONFIG_PACKAGE_network-address-from-cfe is not set

Problems building luci-express

Hi,

I'm keen to see luci-express working, as it looks really interesting!

Ive been trying to build it for my alix2 router, but seem to be having a number of
problems.

  1. Do dont seem to be able to clone:
    git clone http://ihgsp.inteno.se/git/iopsysAA.git

I thought:
https://github.com/mkschreder/iopsys-openwrt-inteno.git
was a mirror of it, but when I look for:
package/inteno/webgui/juci

As per your discussion with mullex, it not present!

  1. aditionally if I try to build what I clone from:
    https://github.com/mkschreder/iopsys-openwrt-inteno.git

I get am unable to access the juci-feeds:

src-git juci http://iopsys.inteno.se:juci-feed.git

Can you help? as Im keen to get this working!

Best Regards,
Paul

There is only overview page,no plugins' pages compiled in

I selected and saved some plugin options in menuconfig such as “ethernet mod” , “status mod” and so on.. but there is no internet-ehternet.html or other plugin html files copied in building DIR, except "index.html".
The .css files generated are also strange, all file sizes are zero except "01-juci.css" ,"50-minidlna.css" ,"50-juci-network-netifd.css" and “80-juci-theme-inteno.css”.
There is no use to copy file "juci.config.example“ to router, as you can see here, no html files copied firstly at all.
So, when opening JUCI in broswer, there is no navigation taps (Should have like Overview Phone Wifi Seetings Status... ) in TOP-Navigation Bar area. It's blank there with only logo IOPSYS.
The overview page looks fine by the way. Router datas were shown normally.
Anybody help here? Thanks.

Juci GUI problem

Hello Martin, I'm beginer with openwrt and I loved this interface JUCI... but I have a problem with WRTNode compilation. I do compile and get successfull results. But after update I get this problem show in follow picture.

captura de tela de 2016-08-24 10 39 30

Can you help me with this problem?

Thanks a lot.

Error running

I used git clone to retrieve your current repo, then ran npm install, then `node server.js, then connect to http://localhost:3000

The web browser screen goes blank, and I got the following errors in the console:

bash-3.2$ npm install
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
bash-3.2$ node server.js
Local server listening on http://:::3000
JSON_CALL (-> http://192.168.1.4/ubus): {"jsonrpc":"2.0","method":"list","id":1,"params":["00000000000000000000000000000000","*","",{}]}
JSON_RESP: {"jsonrpc":"2.0","result":[1,"ETIMEOUT"]}
JSON_CALL (-> http://192.168.1.4/ubus): {"jsonrpc":"2.0","method":"call","id":1,"params":["00000000000000000000000000000000","session","access",{"keys":""}]}
ERROR: Error: connect EHOSTUNREACH
JSON_RESP: {"jsonrpc":"2.0","result":[1,"Error: connect EHOSTUNREACH"]}
ERROR: Error: connect ETIMEDOUT
^C
bash-3.2$ node --version
v0.12.2

I note that the "listening" address is the IPv6 any address ("::"), I also tried connecting to [::1]:3000 with the same result. Any thoughts?

[juci-openwrt-wireless]: Sometimes I do some operations, "ubus call / juci / wireless devices" will get incorrect results.

Sometimes I do some operations, "ubus call / juci / wireless devices" will get incorrect results.

Just start time (first start):

~# ubus call /juci/wireless devices
{
    "devices": [
        {
            "encryption": {
                "enabled": true,
                "auth_algs": [
                    "OPEN"
                ],
                "description": "WPA2 PSK (CCMP)",
                "wep": false,
                "auth_suites": [
                    "PSK"
                ],
                "wpa": 2,
                "pair_ciphers": [
                    "CCMP"
                ],
                "group_ciphers": [
                    "CCMP"
                ]
            },
            "bssid": "00:11:22:33:44:55",
            "hwmodes": {
                "a": false,
                "b": true,
                "ac": false,
                "g": true,
                "n": true
            },
            "mode": "Master",
            "mbssid_support": true,
            "type": "nl80211",
            "ssid": "test_123",
            "country": "US",
            "device": "wlan0",
            "txpower": 26,
            "channel": 11,
            "noise": -95,
            "frequency": 2462
        }
    ]
}

After modifying lan ip address:

~# ubus call /juci/wireless devices
{
    "devices": [
        {
            "hwmodes": {
                "a": false,
                "b": true,
                "ac": false,
                "g": true,
                "n": true
            },
            "mode": "Unknown",
            "mbssid_support": true,
            "type": "nl80211",
            "country": "US",
            "device": "radio0"
        }
    ]
}

Why "wlan0" will become "radio0"?

Out of memory: Kill process xxxx(juci-eventd) score 673 or sacrifice child

[34703.401730] hostapd invoked oom-killer: gfp_mask=0x20858, order=0, oom_score_adj=0
[34703.409644] CPU: 0 PID: 3468 Comm: hostapd Not tainted 4.1.11 #9
[34703.415872] Stack : 804142d2 00000034 00000000 00000001 803581a0 803b4743 838f25b0 00000d8c
          80413530 00000000 803b4838 803b495c 00000000 800a6c00 00000000 00000004
          00000006 00000002 8035ba28 82ea1964 00000000 800a5210 804142d2 00000046
          00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          ...
[34703.453124] Call Trace:
[34703.455742] [<800721c4>] show_stack+0x50/0x84
[34703.460310] [<800cff38>] dump_header.isra.18+0x4c/0x140
[34703.465745] [<800d03ac>] oom_kill_process+0xd8/0x3c8
[34703.470883] [<800d0a14>] __out_of_memory.isra.21+0x2fc/0x334
[34703.476758] [<800d0bd0>] out_of_memory+0x64/0x98
[34703.481533] [<800d3dd8>] __alloc_pages_nodemask+0x564/0x608
[34703.487374] [<800cd6f8>] pagecache_get_page+0x15c/0x248
[34703.492813] [<8012ccb0>] __getblk_slow+0x120/0x35c
[34703.497851] [<8015259c>] squashfs_read_data+0x1c0/0x6bc
[34703.503288] [<80156664>] squashfs_readpage_block+0x2d8/0x468
[34703.509141] [<80154380>] squashfs_readpage+0x584/0x674
[34703.514480] [<800d7004>] __do_page_cache_readahead+0x1ec/0x24c
[34703.520511] [<800cf2e4>] filemap_fault+0x1c4/0x438
[34703.525519] [<800e8b08>] __do_fault+0x3c/0xa8
[34703.530084] [<800eb8c0>] handle_mm_fault+0x244/0xb54
[34703.535286] [<80076e3c>] __do_page_fault+0x130/0x44c
[34703.540419] [<80060820>] ret_from_exception+0x0/0x10
[34703.545579] 
[34703.547121] Mem-Info:
[34703.549502] active_anon:11250 inactive_anon:6 isolated_anon:0
[34703.549502]  active_file:154 inactive_file:217 isolated_file:0
[34703.549502]  unevictable:0 dirty:0 writeback:0 unstable:0
[34703.549502]  slab_reclaimable:176 slab_unreclaimable:1265
[34703.549502]  mapped:30 shmem:31 pagetables:76 bounce:0
[34703.549502]  free:244 free_pcp:2 free_cma:0
[34703.582227] Normal free:976kB min:984kB low:1228kB high:1476kB active_anon:45000kB inactive_anon:24kB active_file:616kB inactive_file:868kB unevictable:0kB isolated(anon):0kB isolato
[34703.626864] lowmem_reserve[]: 0 0
[34703.630317] Normal: 14*4kB (UEMR) 9*8kB (UER) 5*16kB (MR) 0*32kB 2*64kB (R) 1*128kB (R) 0*256kB 1*512kB (R) 0*1024kB 0*2048kB 0*4096kB = 976kB
[34703.644303] 402 total pagecache pages
[34703.648086] 0 pages in swap cache
[34703.651518] Swap cache stats: add 0, delete 0, find 0/0
[34703.656924] Free swap  = 0kB
[34703.659964] Total swap = 0kB
[34703.662965] 16384 pages RAM
[34703.665904] 0 pages HighMem/MovableOnly
[34703.669864] 1180 pages reserved
[34703.673133] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name
[34703.681978] [  517]     0   517      260       18       6       0        0             0 ubusd
[34703.690905] [  518]     0   518      292        9       3       0        0             0 ash
[34703.699697] [ 1053]     0  1053      295       22       4       0        0             0 logd
[34703.708584] [ 1062]     0  1062      405       44       5       0        0             0 rpcd
[34703.717428] [ 1071]     0  1071      664      306       3       0        0             0 ubus-scriptd
[34703.726975] [ 1075]     0  1075    11010    10530      14       0        0             0 juci-eventd
[34703.736433] [ 1077]     0  1077      546       65       3       0        0             0 juci-netmond
[34703.746027] [ 1135]     0  1135      407       60       4       0        0             0 netifd
[34703.755046] [ 1196]     0  1196      278       20       4       0        0             0 mountd
[34703.764060] [ 1391] 65534  1391      260       17       3       0        0             0 dnsmasq
[34703.773206] [ 1524]     0  1524      379       48       3       0        0             0 uhttpd
[34703.782196] [ 1563]     0  1563      292        9       3       0        0             0 ntpd
[34703.791046] [ 1648]     0  1648      262       11       3       0        0             0 dropbear
[34703.800242] [ 3468]     0  3468      409       32       3       0        0             0 hostapd
[34703.809384] [  418]     0   418      292        9       3       0        0             0 sh
[34703.818049] [  419]     0   419      335       22       4       0        0             0 logread
[34703.827137] [  420]     0   420      292       11       3       0        0             0 sh
[34703.835812] Out of memory: Kill process 1075 (juci-eventd) score 672 or sacrifice child
[34703.844157] Killed process 418 (sh) total-vm:1168kB, anon-rss:36kB, file-rss:0kB
[34708.711463] hostapd invoked oom-killer: gfp_mask=0x20858, order=0, oom_score_adj=0
[34708.719377] CPU: 0 PID: 3468 Comm: hostapd Not tainted 4.1.11 #9
[34708.725705] Stack : 804142d2 00000034 00000000 00000001 803581a0 803b4743 838f25b0 00000d8c
          80413530 00000000 803b4838 803b495c 00000000 800a6c00 00000000 00000004
          00000006 00000000 8035ba28 82ea1964 00000000 800a5210 804142d2 00000046
          00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          ...
[34708.762900] Call Trace:
[34708.765446] [<800721c4>] show_stack+0x50/0x84
[34708.769966] [<800cff38>] dump_header.isra.18+0x4c/0x140
[34708.775396] [<800d03ac>] oom_kill_process+0xd8/0x3c8
[34708.780589] [<800d0a14>] __out_of_memory.isra.21+0x2fc/0x334
[34708.786478] [<800d0bd0>] out_of_memory+0x64/0x98
[34708.791256] [<800d3dd8>] __alloc_pages_nodemask+0x564/0x608
[34708.797047] [<800cd6f8>] pagecache_get_page+0x15c/0x248
[34708.802448] [<8012ccb0>] __getblk_slow+0x120/0x35c
[34708.807433] [<8015259c>] squashfs_read_data+0x1c0/0x6bc
[34708.812862] [<80156664>] squashfs_readpage_block+0x2d8/0x468
[34708.818711] [<80154380>] squashfs_readpage+0x584/0x674
[34708.824109] [<800d7004>] __do_page_cache_readahead+0x1ec/0x24c
[34708.830145] [<800cf2e4>] filemap_fault+0x1c4/0x438
[34708.835148] [<800e8b08>] __do_fault+0x3c/0xa8
[34708.839660] [<800eb8c0>] handle_mm_fault+0x244/0xb54
[34708.844817] [<80076e3c>] __do_page_fault+0x130/0x44c
[34708.849981] [<80060820>] ret_from_exception+0x0/0x10
[34708.855135] 
[34708.856674] Mem-Info:
[34708.859042] active_anon:11241 inactive_anon:6 isolated_anon:0
[34708.859042]  active_file:200 inactive_file:202 isolated_file:0
[34708.859042]  unevictable:0 dirty:0 writeback:0 unstable:0
[34708.859042]  slab_reclaimable:174 slab_unreclaimable:1265
[34708.859042]  mapped:30 shmem:31 pagetables:73 bounce:0
[34708.859042]  free:238 free_pcp:2 free_cma:0
[34708.891842] Normal free:952kB min:984kB low:1228kB high:1476kB active_anon:44964kB inactive_anon:24kB active_file:800kB inactive_file:808kB unevictable:0kB isolated(anon):0kB isolats
[34708.936909] lowmem_reserve[]: 0 0
[34708.940362] Normal: 32*4kB (UEMR) 5*8kB (UR) 3*16kB (UR) 1*32kB (R) 1*64kB (R) 1*128kB (R) 0*256kB 1*512kB (R) 0*1024kB 0*2048kB 0*4096kB = 952kB
[34708.954223] 433 total pagecache pages
[34708.958071] 0 pages in swap cache
[34708.961519] Swap cache stats: add 0, delete 0, find 0/0
[34708.966940] Free swap  = 0kB
[34708.969910] Total swap = 0kB
[34708.972999] 16384 pages RAM
[34708.975992] 0 pages HighMem/MovableOnly
[34708.979954] 1180 pages reserved
[34708.983238] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name
[34708.992129] [  517]     0   517      260       18       6       0        0             0 ubusd
[34709.001066] [  518]     0   518      292        9       3       0        0             0 ash
[34709.009966] [ 1053]     0  1053      295       22       4       0        0             0 logd
[34709.018978] [ 1062]     0  1062      405       44       5       0        0             0 rpcd
[34709.027871] [ 1071]     0  1071      664      306       3       0        0             0 ubus-scriptd
[34709.037475] [ 1075]     0  1075    11010    10546      14       0        0             0 juci-eventd
[34709.046956] [ 1077]     0  1077      546       65       3       0        0             0 juci-netmond
[34709.056539] [ 1135]     0  1135      407       35       4       0        0             0 netifd
[34709.065620] [ 1196]     0  1196      278       27       4       0        0             0 mountd
[34709.074636] [ 1391] 65534  1391      260       21       3       0        0             0 dnsmasq
[34709.083736] [ 1524]     0  1524      379       46       3       0        0             0 uhttpd
[34709.092794] [ 1563]     0  1563      292        9       3       0        0             0 ntpd
[34709.101604] [ 1648]     0  1648      262       11       3       0        0             0 dropbear
[34709.110822] [ 3468]     0  3468      409       31       3       0        0             0 hostapd
[34709.119966] [  419]     0   419      335       29       4       0        0             0 logread
[34709.129065] [  420]     0   420      292       13       3       0        0             0 sh
[34709.137716] Out of memory: Kill process 1075 (juci-eventd) score 673 or sacrifice child
[34709.146051] Killed process 1075 (juci-eventd) total-vm:44040kB, anon-rss:42112kB, file-rss:72kB

Running for some time, "juci-event" will be killed.

v2.16.08 question

Hello
Successfuly compiled v2.16.08
Had one issue with luaposix, but changed to v33.4.0 in Makefile and its compiled....
But, i cant access GUI.
In v2.16.01 i enter only login root and thats it , but here its dont working...
Can you help me with this?
And can you change luaposix33 version by default?

Can you say what the initial password or how to setup it?

Build failed.

I git cloned the project to local and use make to build it. I then got the error message below. What is the problem?

make[1]: ../juci-build-tpl-cache: Command not found
make[1]: *** [htdocs/js/01-juci-tpl.js] Error 127
make[1]: Leaving directory `/home/alex/Projects/luci-express/juci'
make: *** [juci] Error 2

Any interest in hosting built packages?

Some folks were just mentioning that they wanted to check out your UI, but didn't want to build an entire kernel to test it out. They seemed like they were on the early adopter side of things, but maybe not the kind of folks who have a buildroot sitting around somewhere.

I know that a lot of your development workflow includes people customizing their own builds, but do you think it would be possible to host built packages for maybe just a handful of the most popular architectures?

juci core debug

hi Schreder,

i want to understand more inside the juci core js, but when compile into 01-juci.js then it is hard to debug in browser. is there any to to used the raw form of all the js file? like to replace the 01-juci.js tag with all js resource files in juci/src folder? thanks

compile error

Hello,

i got following error when compling juci in openwrt. also i got same error when using Makefile.Local to test. i have no clue what could be the root cause since error information is very limited.
pls help take a look, thanks.

npm install --production
npm WARN package.json [email protected] No repository field.
[JS] juci -> tmp/01-juci.js
[LESS] juci -> tmp/juci-compiled-styles.css
[CSS] juci -> tmp/01-juci.css
make[3]: *** [tmp/01-juci.css.js] Error 1
make[3]: Leaving directory `/home/allen/ugw/UGW-7.1/build_dir/target-mips_mips32_uClibc-0.9.33.2_vrx220_gw_el_vdsl_71/juci-eda7ee991f6a7cfbdd7742b6e956a6b802b3e594'

br
Allen

Size of juci? building it in an image?

I have a router that has very little free space, I could switch luci for juci but only if it takes less space. ALso I'd need to build it in the flashable image because I do not have enough space to install directly..

How to debug juci in host

hi Schreder,

your juci project is great, now i can run it with DD in both X86/Mips machine. next i would like to learn develop my own view into Juci, and i prefer to debug in host which is better and simple.
but when i run /juci-local-server on host, then the browser will complained 'Uncaught TypeError: Cannot read property 'system' of undefined'. i think it because no ubus service running properly in host.
would you give some idea how to debug juci on host? thanks.

br
Allen

Consider using whitelisting in input validation at /juci/lua/core.lua line 84

As the comment on the line 80 says, the currently used blacklist approach is dangerous. There are many other symbols (e.g. backtick, ampersand etc) and symbol sequences (e.g "$()") that can be used to perform OS command injection attacks. For example using "127.0.0.1 && /bin/cat /etc/shadow" as the host parameter value in /plugins/juci-diagnostics/rpc/diagnostics.lua causes displaying the shadow file contents.

Recommendation: consider using whitelist based approach instead of a blacklist. In case any of the arguments contain a symbol that is not in a specified whitelist, drop all arguments and raise an error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.