tttol / mos3

MOS3 - My Own S3. Mock application for Amazon S3.
MIT License
0 stars 0 forks source link

MOS3 - My Own S3

GitHub GitHub
MOS3 is a mock application for Amazon S3, meaning My Own S3, pronounced mɒsˈθri.

screen image

Install

Docker

Run the following command:

# https://hub.docker.com/r/tttol/mos3
docker run -p 3333:3333 -v ./upload:/app/upload -it --rm tttol/mos3:latest

Then access http://localhost:3333/s3.

[!NOTE] You can replace ./upload with any path you prefer.

Files uploaded to MOS3 will be saved in /app/upload.
This means that the files and directories in MOS3 will appear in the host machine's path specified with -v ./upload:/app/upload.

Docker Compose

The compose.yml file is here.

[!NOTE] You can replace ./upload with any path you prefer.

Run the following command:

docker compose up -d

Then access http://localhost:3333/s3.

Usage

Upload file/directory

You can upload a file or a directory using the "New File" or "New Dir" button at the top right of the screen.
Alternatively, you can create them in the directory mounted to /app/upload using commands like touch or mkdir.

New File/Dir button

Remove file/directory

You can remove a file or directory using trash box icon at the right of each file/directory. Alternatively, you can use commands like rm in the directory mounted to /app/upload to delete them.

Download file

You can download a file. Click the filename, then start downloading.

Connect your application with MOS3

Here’s how to connect an application that uses Amazon S3 to MOS3.
By default, MOS3 runs on localhost:3333. To access MOS3 from your application, set the S3 endpoint to http://localhost:3333.
Here's an example using the AWS SDK for Java:

S3Client s3 = S3Client.builder()
        .region(region)
        .endpointOverride(new URI("http://localhost:3333"))
        .serviceConfiguration(s3Configuration)
        .build();

[!NOTE]

S3Configuration s3Configuration = S3Configuration.builder()
.pathStyleAccessEnabled(true) // enable path style access
.build();

When specifying localhost as the endpoint, you may need to enable path style access as shown above.

Contributing guidelines

Thank you for your interest in contributing to our project. Please visit CONTRIBUTING.md for additional information on contributing to this project.