Code Monkey home page Code Monkey logo

Comments (5)

almunnings avatar almunnings commented on June 29, 2024

Possibly related to https://github.com/lando/lando/issues/3091

$ lando ssh -s cli -c "ls -al /lando/keys"

...
-rw-------  1 user dialout 1811 Sep  9 06:44 lagoon-32ee3a15-b507-4591-902e-e848c300b924

$ lando ssh -s cli -c "cat /etc/ssh/ssh_config"

Host *
  User "al"
  StrictHostKeyChecking no
  UserKnownHostsFile=/dev/null
  LogLevel=FATAL

$ lando logs -s cli

cli_1        | loadkeys 11:16:12.69 INFO  ==> Scanning /lando/keys for keys...
cli_1        | loadkeys 11:16:12.70 INFO  ==> Scanning /var/www/.ssh for keys...
cli_1        | loadkeys 11:16:12.71 INFO  ==> Scanning /user/.ssh for keys...
cli_1        | loadkeys 11:16:12.72 INFO  ==> Found keys /lando/keys/lagoon-32ee3a15-b507-4591-902e-e848c300b924
cli_1        | loadkeys 11:16:12.72 DEBUG ==> Ensuring permissions and ownership of /lando/keys/lagoon-32ee3a15-b507-4591-902e-e848c300b924...
cli_1        | loadkeys 11:16:12.75 DEBUG ==> Checking whether /lando/keys/lagoon-32ee3a15-b507-4591-902e-e848c300b924 is a private key...
cli_1        | loadkeys 11:16:12.76 INFO  ==> Using the following keys: 

$ lando ssh -s cli -c "cat /lando/keys/lagoon-32ee3a15-b507-4591-902e-e848c300b924"

-----BEGIN OPENSSH PRIVATE KEY-----
...
...
...
...
...
-----END OPENSSH PRIVATE KEY-----

So it never gets past the -L to actually add the key.

Am I on the wrong hunt here? The logic looks wrong. -l would make sense. But again, I'm unsure of the reasoning behind the entire block of code.

from cli.

almunnings avatar almunnings commented on June 29, 2024

So big goose hunt on with @pirog over slack. We may have found an underlying cause for the inconsistencies. This looks like its due to a BusyBox flavour of grep.

grep -L "PRIVATE KEY" /lando/keys/a-random-key returns nothing. No status code 0.

Docker image uselagoon/php-7.3-cli-drupal if you go up the chain of FROM's is based off of FROM alpine:3.14

To upgrade grep to a gnu install, and make it work, in your Dockerfile you could add:

RUN apk add --no-cache --upgrade grep

It would appear there is some inconsistencies between the greps out there.
But thats not really a fix to a problem. Alpine will continue to use busybox grep, this continues to pop-up as a problem.

I wonder if something like busybox detection might be the answer here? Minimal impact.

if grep --help 2>&1 | grep -q -i "busybox"; then
  ... this greps crazy shit, set a diff condition
fi

https://bugs.busybox.net/show_bug.cgi?id=13151

https://lists.gnu.org/archive/html/bug-grep/2017-08/msg00010.html

from cli.

pirog avatar pirog commented on June 29, 2024

@sonuku to add more fun to this we get status code 0 on alpine:3.13 so i'm guessing this started showing up when Lagoon bumped up to alpine:3.14.

All said and now that we understand the issue here i think we should just switch over to the -l from -L as you initially recommended. That seems like the option we want anyway and THEORETICALLY it should produce the same behavior in our none alpine:3.14 images.

from cli.

almunnings avatar almunnings commented on June 29, 2024

Yeah seems depending on your grep version (even gnu) -L is a bit fucky. Pasted in the bug reports in above comment.

from cli.

tobybellwood avatar tobybellwood commented on June 29, 2024

hihi - circling the square here - wherever possible we try to avoid overwriting the busybox packages, just to avoid potential complications. Thanks for digging into this @sonuku!

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.