Code Monkey home page Code Monkey logo

less3's Introduction

alt tag

Less3 :: S3-Compatible Object Storage

Less3 is an S3-compatible object storage platform that you can run anywhere.

alt tag

Use Cases

Core use cases for Less3:

  • Local object storage - S3-compatible storage on your laptop, virtual machine, container, or bare metal
  • Private cloud object storage - use your existing private cloud hardware to create an S3-compatible storage pool
  • Development and test - local devtest against S3-compatible storage
  • Remote storage - deploy S3-compatible storage in environments where you must control data placement

New in This Version

v2.1.x

  • Dependency update and changes to improve compatibility with AWS CLI
  • Testing with key AWS CLI capabilities, see AWSCLI.md

Help and Feedback

First things first - do you need help or have feedback? Please file an issue here.

Special Thanks

Thanks to @iain-cyborn for helping make the platform better!

Initial Setup

The binaries for Less3 can be created by compiling from source. Executing the binary will create a system configuration in the system.json file along with the configuration database less3.db.

The Server.DnsHostname MUST be set to a hostname. You cannot use IP addresses (parsing will fail). Incoming HTTP requests must have a HOST header value that matches the value in Server.DnsHostname. If it does not match, you will receive a 400/Bad Request.

If you use *, +, or 0.0.0.0 for the Server.DnsHostname, Less3 must be executed using administrative privileges (this is required by the underlying operating system).

To get started, clone Less3, build, publish, and run!

$ git clone https://github.com/jchristn/less3
$ cd less3
$ dotnet build -f netcoreapp2.2
$ dotnet publish -f netcoreapp2.2
$ cd less3/bin/debug/netcoreapp2.2/publish
$ dotnet less3.dll

S3 Client Compatibility

Less3 was designed to be consumed using either the AWS SDK or direct RESTful integration in accordance with Amazon's official documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html). Should you encounter a discrepancy between how Less3 operates and how AWS S3 operates, please file an issue.

I tested Less3 using the AWS SDK for C#, a live account on S3, CloudBerry Explorer for S3 (see https://www.cloudberrylab.com/explorer/windows/amazon-s3.aspx), and S3 Browser (see http://s3browser.com/). If you have or recommend other tools, please file an issue here and let me know!

Supported APIs

Please refer to the compatibility matrix found in 'assets' for a full list of supported APIs and caveats.

The following APIs are supported with Less3:

  • Service APIs

    • ListBuckets
  • Bucket APIs

    • Write
    • WriteAcl
    • WriteTagging
    • WriteVersioning (no MFA delete support)
    • Delete
    • DeleteTagging
    • Exists
    • Read (list objects v2)
    • ReadAcl
    • ReadVersions
    • ReadTagging
  • Object APIs

    • Write
    • WriteAcl
    • WriteTagging
    • Delete
    • DeleteMultiple
    • DeleteTagging
    • Exists
    • Read
    • ReadAcl
    • ReadRange
    • ReadTagging

API Support

There are several minor differences between how S3 and less3 handle certain aspects of API requests. However, these should be inconsequential from the perspective of the developer (for instance, version IDs are numbers internally within less3 rather than strings).

Should you find any incompatibilities or behavioral issues with the APIs listed above that are considered 'supported', please file an issue here along with details on the expected behavior. I've tried to mimic the behavior of S3 while building out the API logic. A link to the supporting documentation will also be helpful to aid me in righting the wrong :)

Bucket in Hostname vs URL

Less3 supports cases where having the bucket name as:

  • Path style URLs - the bucket name is part of the URL (http://[hostname]/[bucket]/[key])
  • Virtual hosted URLs - the bucket name is part of the hostname (http://[bucket].[hostname]/[key])

To use path style URLs do not set Server.BaseDomain. This is the default configuration.

To use virtual hosted URLs, you must:

  • Set Server.BaseDomain - if your hostname is localhost, set this value to .localhost (prepend with a period)
  • Set Server.DnsHostname to *
  • Run Less3 as administrator
  • Ensure your hosted hostnames (i.e. [bucket].[hostname]) are resolvable through DNS to your machine

Administrative APIs

Please refer to the 'wiki' for helpful notes including how to use the administrative APIs.

Open Source Packages

Less3 is built using a series of open-source packages, including:

Deployment in Docker

Please refer to Docker.md and Dockerfile in the project directory.

Version History

Refer to CHANGELOG.md for details.

less3's People

Contributors

jchristn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

less3's Issues

Less3 host / port

Hi, I have set up Less3 on sever with domain and port xxxx, S3 Browser 10.0.9 works and I can upload image to bucket.

However when using the AWS SDK with the following code, host is not found.

var s3Config = new AmazonS3Config();
s3Config.ServiceURL = "http://storage.abc.co.za:3435";

            using (var cli = new AmazonS3Client("default","default",s3Config))
            {                    
                var utility = new TransferUtility(cli);
                await utility.UploadAsync(filePic.Path, "mibbmedia");
            }

Any pointers would be a great help.

Just getting started with S3. Making Less3 work.

I have gotten Less3 running (visual studio 2019 - windows), connect to Sql/Server 2019.
For now, I will be mounting these with the fuse-s3fs, and likely later as docker storage.

I am quite the beginner on S3, so likely missing things.

It did not seem to create me any default user or default, account, so I created my own... Watson did create all the schemas for the tables, so not hard to figure out.

INSERT INTO [dbo].[users] ([guid] ,[name] ,[email]) VALUES (newid() ,'thor' ,'[email protected]') GO

INSERT INTO [dbo].[credential] ([guid] ,[userguid] ,[description] ,[accesskey] ,[secretkey] ,[isbase64]) VALUES (newid() ,'E86D8681-A474-4876-A710-B4464D66CFFE' ,'Thor Test Account' ,'ABCDEFG' ,'ReindeerFlotilla' ,0) GO

I may have to create ACLs for this user.

I am reasonably baffled by the accesskey and the secretkey. All of the examples I see out of them show them as a 16 digit key and a binary (probably base64 string), like they were some component of an encryption pair.

So, I need to setup buckets and such, and so downloaded S3 browser as you suggest.

But, I get HMAC errors...

image

image

So, it rather seems me like it's trying to sign things with those keys, and that my choices for keys and secrets are bogus, though your examples are default/default, seemly just strings like I used.

I have been unable to find a command like tool to generate an AWS like key/secret set (without getting them from AWS itself). Seems like there would be one out there, or some trick to allow me to do it in openssl or similar. I'm not unfamiliar with crypto and hmac, but don't quite know what's being used here.

I'm ultimately wanting to write my own storage classes for Less3 to abstract several filesystems that I have, but have not yet gotten to "hello world" yet.

Thanks for your efforts!

---Thor Halbert

High Mysql Usage

Good Day. Firstly thank you for a great s3 server

I have one small issue i cant seem to get past.

I setup the less3 server on a ubuntu box with mysql as db. this works great but when traffic picks up then mysql load skyrockets to 100% and when viewing mysql processes this is displayed.

image

Can you give me any advise on how to resolve this. Apologies for the bother and thank you once again

Problem with minio client

Hi, Im try to move my data from minio to less3, but the command line tool are not working. Seems because less3 output xml in latin1 but only utf8 is supported by mc.

mc ls less3
mc.exe: Unable to list folder. xml: encoding "iso-8859-1" declared but Decoder.CharsetReader is nil

Chunked transfer issue

I think this is really a WatsonWebserver issue but it manifests in Less3.

The AWS S3 SDK PutObjectRequest class has a boolean UseChunkEncoding attribute and by default this is set to true. This influences the request that the S3 SDK makes to the S3 API and the S3ServerLibrary (another dependency of Less3) correctly reads that and sets the Chunked attribute of the S3Request class:
https://github.com/jchristn/S3Server/blob/b449b11b9159fa0f8183b8c360c995eeba41dc4f/S3Server/S3Request.cs#L517-L524
if (HeaderExists("x-amz-content-sha256", false)) { string sha256content = RetrieveHeaderValue("x-amz-content-sha256"); if (!String.IsNullOrEmpty(sha256content)) { if (sha256content.Contains("STREAMING")) Chunked = true; } }

Then the Less3 code will act on that attribute of the S3Request class to determine if ReadChunk should be called:

if (ctx.Request.Chunked)
{
while (true)
{
Chunk chunk = await ctx.Request.ReadChunk();

And that ReadChunk function is implemented in WatsonWebserver where the first line of the function is:
if (!ChunkedTransfer) throw new IOException("Request is not chunk transfer-encoded.");

Where that ChunkedTransfer attribute is set from request headers:
https://github.com/jchristn/WatsonWebserver/blob/b3833c2edc7bd27d4c686e49efa2b0b412905e83/WatsonWebserver/HttpRequest.cs#L220-L223
if (curr.Key.ToLower().Equals("transfer-encoding")) { if (curr.Value.ToLower().Contains("chunked")) ChunkedTransfer = true;

But the AWS S3 SDK does not seem to set transfer-encoding header despite actually chunking the data. Which resulted in the first attempt to use my AWS S3 SDK code hitting that "Request is not chunk transfer-encoded" exception. So there's a conflict between the attribute that determines if Less3 calls ReadChunk and the attribute that WatsonWebserver expects to be set when ReadChunk is called.

Yes, there is a workaround of specifically setting UseChunkEncoding to false in the PutObjectRequest class but my preference would be to use the default behaviour of the AWS S3 SDK and not have to specifically set UseChunkEncoding to false.

Does Less3 support resume?

I am very happy that I found this project and also thank you so much for publishing your work.
I want to know if this implementation supports resume for uploading and downloading?

Does it support multipart uploads? (doc)
Does it support range header for downloads? (doc)
Thanks.

Problem with delete commands

Could definitely be me doing something wrong, but I'm having trouble with deletion. Creating buckets and uploading objects to them has been working.

Screenshot 2024-06-24 at 9 49 49 AM Screenshot 2024-06-24 at 9 45 44 AM

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.