I'm packaging LLDAP, a tiny and simple to use LDAP server, and got the problem: it's web ui actually is a webasm binary.
Just for now i use precompilled version, but i'd like to have full build.
I'm not sure, should i upstream it to packages repo. At least not with repackaging...
Actually would be interesting to ask lldap authors to explore openwrt and suggest way to get it there. They have hundred-and-counting linux distributions already described.
Yes, LLDAP https://github.com/lldap/lldap/ .
It's quite simple LDAP server with tiny web UI to manage records.
And it's only LDAP, nothing more. But what do you really need for a self-hosted homelab?
Over the week i tried to setup several solutions, namely Kanidm, Zitadel, Casdoor and now LLDAP + Authelia.
And this one seems suits me the best.
While yes, wasm executed on the user's browser, you still need a method to provide that binary.
While usually nowadays UI is a SPA, which needs to be "compilled" by nodejs, here a bit different way.
Whilst the UI is hosted in the users browsers it still needs some kind of API backend right?
Iād think either uhttpd / lighttpd would be able to host the path for both the cgi backend and also for the UI launch point (where the web client would download the webasm file(s)).
Youād need to use a different port than the default luci port however, and a different instance of uhttp / lighttpd.
In regards to the packaging. The webasm file(s) are really just the same as a .js or .html file, so they should just be bundled and distributed. Expecting the end hosting device to have a webasm compiler to create the bytecode itself isnāt typical.
@bevanweiss sorry, but you get me wrong. Iām not asking how to serve the frontend, thatās pretty obvious and LLDAP actually has built-in server for that.
The question is about how to build the frontend from the sources, instead of packaging prebuilt binaries.
Similarly to other modern apps which uses some JS frameworks (or TypeScript) you need first to ācompileā to get this final frontend files to serve, which typically done during package build. LLDAP is a bit different, that instead of some JS code and something like npm build it needs to have a Rust compiler for WASM target.
And here is a problem: OpenWrt build system has NodeJS and NPM, Rust for the target arch (e.g. aarch64), but for WASM.
That requires modifications to lang/rust, some kind of way to define extra dependency on wasm target.
And i conciser it's too much hassle for a single service which is unlikely end up into packages anyway.
I donāt think youād touch the existing rust package, but add a new one for ārust-webasmā or such.. the new package would have a host dependency of rust, but would add the webasm component (via cargo or similar).