-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a concept of HUGOBIN and a way to install binary dependencies #10757
Comments
Agree. This is what the Scoop, Chocolatey, and Snap packages for Embedded Dart Sass do. |
@jmooring can I borrow your attention for a minute. I have a working prototype of this running and, as usual, I'm a little paranoid about security. After a little testing I have concluded that having the user do PATH fiddling to make this work, isn't ... great. So with what I have now I use abs paths to the "imported" binaries, and this should be enough to get Dart Sass: [[module.imports]]
path="github.com/gohugoio/hugo-mod-bin-dartsass" The SHA56 of the downloaded archive (stored in the Hugo Module) is checked on installation. The one thing I'm a little worried about then is someone creating a fake Hugo Module with a fake dartsass binary. A little far fetched, perhaps, but to improve on this I have added a new whitelist to the security config: What do you think? Some links: |
Thoughts, in no particular order...
Finally, and please be don't be offended, but it seems like installing Go is a little more complicated than using a package manager, assuming they've already installed the package manager, which many have not, so maybe requiring Go is OK. And a couple of FYI's:
|
There's also this:
It is platform aware. Not sure you want to go down that path, but we do have precedence with POSTCSS. |
I'm not totally sure I'm able to land this issue anytime soon, but I appreciate your feedback. |
Thinking a little more on this, I'll let this be as it is for now:
|
The way 0.114.0 works with the new Dart Sass packaging is truly outstanding; kudos! Does this in any way suggest a path to resolving this particular issue (and/or #8299), or is it of no value in that regard? Edit, 2023-06-23: Actually, on the other hand, @jmooring has now made an excellent argument against further worrying about this. |
Dart Sass with Hugo is incredibly powerful, but it's also a pain to install. #8299 has been stranded because 1. Go doesn't have a way of doing this built-in and 2. Building a custom solution would be a challenge to do securely.
This proposal outlines a way to do this. This is deliberately a little vague about the details.
HUGOBIN
env var. The user (or installation script) would be responsible to add this folder to thePATH
.binary
component type which would allow mounting of files into thisHUGOBIN
folder.Since GitHub releases is separated from the Git repo, we need to somehow wrap these binaries in a module somehow:
The above should
The text was updated successfully, but these errors were encountered: