fix: Embed CSS files into templates#678
Conversation
…iroh` commands (n0-computer#348) * docs: add full help text for `lookup`, `connect`, `get`, `p2p`, and `iroh` commands * move long descriptions into constants Co-authored-by: b5 <sparkle_pony_2000@qri.io>
We used to use the same config for the service and server (aka the binary). This is confusing when creating configs to use with e.g. iroh-one, iroh-embed or iroh-share because some fields are not used. This splits off the config structs to avoid this problem, services now have a Config and binaries a ServerConfig. This allows creating the services standalone without all the baggage a server needs. While this isn't many fields yet, this will get worse as we add more features (this is split off from another PR where this seemed useful).
This removes the use of mockall which is causing a lot of trouble with the cargo features intricacies it brings with it. A lot of the tooling struggles with these different versions of the structs which also behave differently in surprising ways. The tests affected by this will be converted into end-to-end tests as part of is now unused. This is possibly only temprorary and that might come back when the end-to-end tests are added.
rklaehn
left a comment
There was a problem hiding this comment.
So this removes the assets from ../assets/style.css and ../assets/icons.css and includes them in the dir_list and 404 page.
Not sure if this is an improvement. It simplifies the routes for sure, but now you have to "recompile" the css and icons to html whenever you want to do a change.
It is not an improvement but a required fix. There is a subdomain handler that accepts urls such as |
|
How does Kubo do this currently? |
|
Kubo embeds all assets. |
In general css & images loads are not subject to SOP restrictions so you should not need CORS. But it should also be possible to serve them from roo_url/static/xxx and set the CORS headers on all of /static/ |
|
You mean second-level domain by root_url? We need to embed JS snippet for detecting root url then, is it ok? |
|
I think the base url is part of the config, so you could use it to generate the css url without needing a script. |
f4d451f to
5c73ff7
Compare
|
@fabricedesre Thanks for idea, done. However there is still small regression: by default, public_url_base is empty and users will have to set it manually for development environment |
a1f2f69 to
c63d0b6
Compare
|
I've also fixed a bug here with rendering |
* feat: Add pub ctor to Directory * fix: reduce logging level * feat: Pretty printing for addrs * fix: clippy * pr fixes
|
Let's review and merge? |
|
Hello! The code that was previously hosted in this repository has been moved to n0-computer/beetle. If you are still interested in getting your PR merged, please re-open your PR on n0-computer/beetle. Check out our blog post for more info on our new direction for |
There are two changes: