Skip to content
/ mos3 Public

MOS3 - My Own S3. Mock application for Amazon S3.

License

Notifications You must be signed in to change notification settings

tttol/mos3

Repository files navigation

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.

About

MOS3 - My Own S3. Mock application for Amazon S3.

Resources

License

Stars

Watchers

Forks

Packages

No packages published