contrib: introduce ucode-mod-html The ucode-mod-html library provides assorted utility functions for dealing with HTML markup data. Example usage: #!/usr/bin/ucode 'use strict'; import { tokenize, striptags, entitydecode, entityencode, OPEN, ATTR, TEXT, CLOSE, RAW, COMMENT, CDATA, PROCINST, EOF } from 'html'; tokenize('<div class="example">Hello world!</div>...', function(type, text, value) { switch (type) { case OPEN: print(`Opening tag: ${text}\n`); break; case ATTR: print(`Attribute: ${text}${value ? `=${value}`}\n`; break; case TEXT: print(`Text data: ${text}\n`); break; case CLOSE: print(`Closing tag: ${text}\n`); break; case RAW: print(`Script/CSS: ${text}\n`); break; case COMMENT: print(`Comment: ${text}\n`); break; case CDATA: print(`CDATA text: ${text}\n`); break; case PROCINST: print(`<!...> tag: ${text}\n`); break; case EOF: print(`End of input\n`); break; } } ); print(striptags('<p>This is some <b>text</b> with <br> markup</p>\n')); print(entitydecode('<   & ä')); print(entityencode('1 < 2 && "foo"')); Signed-off-by: Jo-Philipp Wich <jo@mein.io>
ucode-mod-lua: various fixes Properly handle accesses to properties of the userdatum itself in the lua_uv_index() __index metamethod and treat integer keys as array indexes in case of wrapped ucode array values. Also fix an incorrect refcount decrement in the function. Also fix uc_lua_vm_get() and uc_lua_lv_getraw() to gracefully handle accesses to not defined or non-table values and ensure that those functions properly reset the Lua stack after they complete. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
ucode-mod-lua: support prototype lookups and method calls on ucode values Expose ucode arrays and objects with prototypes as userdata proxy objects to Lua and extend the userdata metadatable with an __index metamethod to lookup not found properties in the ucode values prototype chain. Also extend the __call metamethod implementation to infer method call status from the activation record in order to invoke ucode functions with the correct `this` context when called as method from Lua. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
ucode-mod-lua: add workaround for dynamic Lua extension loading Reopen self with dlopen(RTLD_GLOBAL) in order to export liblua symbols for runtime loading of dynamic Lua extensions. Reported-by: Stijn Tintel <stijn@linux-ipv6.be> Tested-by: Stijn Tintel <stijn@linux-ipv6.be> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
contrib: introduce ucode-mod-lua The ucode-mod-lua library provides an ucode-to-Lua bridge and a set of functions to instantiate Lua VMs, invoke Lua functions as well as exchanging data structures between ucode and Lua. Example usage: #!/usr/bin/ucode 'use strict'; const lua = require("lua"); let vm = lua.create(); vm.set({ hello: function(...args) { print(`A ucode "Hello world" function called from Lua! Got arguments: ${args}\n`); }, data_from_ucode: { bool: true, float: 1.3, int: 0x11223344, string: "Hello from ucode!", array: [ 1, 2, 3, null, 5 ], object: { apple: "green", banana: "yellow", [5]: "foo", [-1]: null, nested: { a: [ 5, 6 ], b: { c: NaN } } }, regexp: /foo/ } }); vm.invoke("hello", true, 123, "Foo"); vm.eval('print("Print from Lua!", data_from_ucode.int * data_from_ucode.float);'); try { vm.invoke("error", "Throwing a Lua exception..."); } catch (e) { print(`Caught exception: ${e}\n`); } print(`Lua VM version is: ${vm.get('_G', '_VERSION').value()}\n`); Signed-off-by: Jo-Philipp Wich <jo@mein.io>
lucihttp: update to latest Git HEAD Fixes compilation under 32bit systems by using the proper printf format specifier for size_t values. Also fixes compilation with Ninja by appending instead of overwriting CMAKE_OPTIONS. Fixes: #5116 Suggested-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
lucihttp: update to latest Git HEAD a34a17d src: allow overriding buffer size from cli in multipart tester 730a46f lib: fix potentially lost bytes in boundary parsing across buffer limits 8734af2 lib: add buffer tracing to multipart parser 913051b src: add file dump option to multipart test utility c419539 src: allow specifying custom buffer sizes in multipart testcases f6e0564 lib: fix handling of empty multipart fields Fixes: #2816 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
treewide: move freifunk-related packages to separate repo Even Freifunk was one of the major factory to create the LuCI-system, it's now only a very small part of LuCI. LuCI has become a much bigger thing and it seems that it's time to move the packages only relating to Freifunk into it's own feed. On the mailinglist it was discussed [1] and a repo below the general Freifunk team on github was created. This commit removes all packages that will be hosted in the new repo [2] 1 - http://lists.freifunk.net/pipermail/wlannews-freifunk.net/2019-February/004818.html 2 - https://github.com/freifunk/openwrt-packages Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
community-profiles: create profile for Fürstenwalde New profile for Fürstenwalde. At the moment we use parts of the Berlin- infrastructure. Thus I have not changed the ip-address-related things. Signed-off-by: Martin Hübner <martin.hubner@web.de> [reword and rewrap commit message] Signed-off-by: Jo-Philipp Wich <jo@mein.io>