Code Monkey home page Code Monkey logo

Comments (13)

maorfr avatar maorfr commented on July 3, 2024

Hey @alexbarta,

Thanks for bringing this up!
Adding support for minio is definitely something that can be done.

Would you like to get involved and try to take this on?

from skbn.

alexbarta avatar alexbarta commented on July 3, 2024

Thanks for the fast reply!

I was already looking into setting a custom s3 configuration like in this example but with a os.Getenv approach:
https://github.com/minio/cookbook/blob/master/docs/aws-sdk-for-go-with-minio.md

However I have problems compiling my own project fork.. I'll raise a separate issue for that.

from skbn.

maorfr avatar maorfr commented on July 3, 2024

Thanks for helping us improve skbn!

As a guideline, try to keep things as similar as you can to current implmentation.
For example, AWS has a credentials chain (there is a link in the README file). try to avoid using the credentials environment variables explicitly.

Another example would be to try and keep the usage of --dst like it is used today. I know that to use minio you will have to provide the URL where minio can be found, but maybe there is a way to provide that as an environment variable or as a separate flag.

If you need any help, let me know :)

Good luck!

from skbn.

maorfr avatar maorfr commented on July 3, 2024

I have assigned the issue to you to keep things visible :)

from skbn.

alexbarta avatar alexbarta commented on July 3, 2024

got it working with latest minio! see this commit (no command line impacted :) )
alexbarta@cda0ae2

I have used the following envs:

export AWS_ACCESS_KEY_ID=minio
export AWS_SECRET_ACCESS_KEY=minio123
export AWS_S3_ENDPOINT=http://minio-svc.default.svc.cluster.local:9000
export AWS_S3_NO_SSL=true
export AWS_S3_FORCE_PATH_STYLE=true
skbn cp --src k8s://default/cassandra-0/cassandra/etc/cassandra/cassandra.yaml --dst s3://cassandra

Can you check on aws side if it is still working fine ?

from skbn.

maorfr avatar maorfr commented on July 3, 2024

Hey,

That's a very elegant solution!
I like it a lot.

It currently doesn't work for AWS S3. The problem is with the endpoint (shouldn't pass it if this is not minio).
Something along the lines of the following snippet should fix it for both cases:

        awsConfig := &aws.Config{}

        // ...

	if disSSL := os.Getenv("AWS_S3_NO_SSL"); disSSL != "" {
		disableSSL, err := strconv.ParseBool(disSSL)
                // handle error
		awsConfig.DisableSSL = aws.Bool(disableSSL)
	}

        // ...

        s, err := session.NewSession(awsConfig)

Would you like to create a PR for this? :)

Plus, from the example you sent (with cassandra), I assume you are interested in this feature to use cain?
https://github.com/nuvo/cain

from skbn.

alexbarta avatar alexbarta commented on July 3, 2024

Glad you like it!

And yes, I have started digging into cain (a very needed project kudos!) before finding skbn :) . Since I work on a local k8s + cassandra installation, reaching aws s3 is a bit problematic.

Btw, I have created the pull request. I will add commits to include your suggestions.

from skbn.

alexbarta avatar alexbarta commented on July 3, 2024

How do you plan to handle the ParseBool error ?

from skbn.

maorfr avatar maorfr commented on July 3, 2024

Actually, since ParseBool returns false for every invalid input, i don't think that we need an error handle.

Would you like to add a section about minio support in the README?

from skbn.

alexbarta avatar alexbarta commented on July 3, 2024

Sure I will

from skbn.

maorfr avatar maorfr commented on July 3, 2024

That was some very good work, thanks a lot!
Would you like to follow up on this and update cain as well?

from skbn.

alexbarta avatar alexbarta commented on July 3, 2024

Thanks for merging the code !
Sure no problem, I just need a couple of hours to test cain first with the new skbn.

from skbn.

maorfr avatar maorfr commented on July 3, 2024

Great! I'll close this issue in favor of a new issue in cain.

from skbn.

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.