Skip to content
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

cURL not universally available #35

Open
pirog opened this issue Apr 2, 2024 · 4 comments
Open

cURL not universally available #35

pirog opened this issue Apr 2, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@pirog
Copy link
Sponsor Member

pirog commented Apr 2, 2024

Currently, the build step we use to download the mhsendmail binary into each hogfrom service assumes that curl exists within said service.

This worked great until recently when bitnami removed curl from newer versions of nginx. You can see this failure demonstrated in #36. To provide a more robust service and to prep for Lando 4 we should make getting mhsendmail a bit more sophisticated.

So, the fix should be something like this:

1. Convert needed build steps into a shell script that lives in the scripts folder.

The script should test for the existence of curl and install it if needed, i think its probably OK to assume apt/debian flavored images but adding apk support for alpine images wouldnt be horrible.

Then the script should download the arch specific binary, move it into PATH and make it executable.

2. Invoke the script as a build step

Everything put into the scripts folder in a plugin ends up in the /helpers folder in each container so we should switch the build step to just run that script. It's possible we need to pass in an option/arg to handle the different architectures. I'm a bit confused on how that works tbh.

3. The tests should pass

We should also add the code from #36 and make sure those tests pass.

@pirog pirog added the bug Something isn't working label Apr 2, 2024
@matthewgarrettks
Copy link
Collaborator

I can take this one unless someone else wants it.

@matthewgarrettks
Copy link
Collaborator

@pirog @reynoldsalec - Do you know of any docs on how to do #2 above? I get that I can create a scripts folder and do a bash script in there, and that it maps to the helpers folder in the build process (weird), but looking through the other plugins that do this, they all rely on a services object being defined earlier in the builder, which this builder.js doesn't have. I can't seem to make it call the shell script. EG, right now I'm trying to do:

      options.services.mailhog.push('/helpers/mailhog.sh');

but it throws "ERROR ==> Cannot read properties of undefined (reading 'services')". How do I make it call the helpers /mailhog.sh script?

@reynoldsalec
Copy link
Sponsor Member

@matthewgarrettks here's an example in the Pantheon builder of adding the scripts as build steps: https://github.com/lando/pantheon/blob/main/builders/pantheon.js#L42

After options is declared in mailhog.js, I think you should be able to use the same logic.

LMK if you have more questions!

@matthewgarrettks
Copy link
Collaborator

Sorry gang, I'm buried in other work, unassigning myself from this in hopes someone else will pick it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants