Developer Guide¶
Pre-requisites¶
Before you start writing code, please read:
System requirements¶
- Gradle 8.1, or higher
JDK8
,JDK11
orJDK17
Finding issues to work on¶
We are using GitHub issue tracker to keep track of issues. The ones which are suitable for contributors to help with are marked with the following labels:
Preparing credentials¶
S3 - Easy¶
Gives access to all buckets which could be dangerous!
The easiest way to get started would be to:
- Go to the Identity and Access Management (IAM)
- Go to
Users
->Add User
:- Username:
my-s3fs-username
(or whatever) - Access Type:
Programmatic access
must be selected!
- Username:
Set Permissions
:- Select
Attach existing policies directly
- Search for
AmazonS3FullAccess
and select it.
- Select
- Continue with next steps (apply changes if necessary)
- At the final step you will receive an
Access Key
andSecret Access Key
- copy those into youramazon-test.properties
or export them asS3FS_**
env variable name (if running in a container).
S3 - Advanced¶
Allows access to a specific bucket and is safer if you have multiple buckets in your account.
- Go to the Identity and Access Management (IAM)
- Go to
Policies
:- Create a new policy
- Switch to
JSON
editor and copy the policy below which will limit the access to only a specific bucket:{ "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObjectAcl", "s3:GetObject", "s3:DeleteObjectVersion", "s3:PutReplicationConfiguration", "s3:ListBucket", "s3:DeleteObject", "s3:GetBucketAcl" ], "Resource": [ "arn:aws:s3:::YOUR_BUCKET_NAME", "arn:aws:s3:::YOUR_BUCKET_NAME/*" ] }, { "Sid": "VisualEditor1", "Effect": "Allow", "Action": "s3:ListAllMyBuckets", "Resource": "*" } ] }
- Replace
YOUR_BUCKET_NAME
with your actual bucket name. - Give a name and save (i.e.
s3fs-full-access-to-YOUR_BUCKET_NAME
)
- Go to
Users
->Add User
:- Username:
my-s3fs-username
(or whatever) - Access Type:
Programmatic access
must be selected!
- Username:
Set Permissions
:- Select
Attach existing policies directly
- Search for
s3fs-full-access-to-YOUR_BUCKET_NAME
and select it - Continue with next steps (apply changes if necessary)
- Select
- At the final step you will receive an
Access Key
andSecret Access Key
- copy those into youramazon-test.properties
or export them asS3FS_**
env variable name (if running in a container).
Building the code¶
Cloning¶
git clone https://github.com/carlspring/s3fs-nio
cd s3fs-nio
Custom proxy (optional)¶
If you have Nexus/Artifactory running locally you can setup Gradle to use that repository.
Place the following configuration in your ~/.gradle/gradle.properties
:
s3fs.proxy.url=https://my.local.domain/path/to/repository
Build¶
Builds the entire code and runs unit and integration tests. It is assumed you already have the amazon-test.properties
configuration in place.
./gradlew build
Run only unit tests¶
./gradlew test
Run only integration tests¶
./gradlew it-s3
Run all tests¶
./gradlew check
Gradle build properties¶
The following properties can be set in your ~/.gradle/gradle.properties
file to modify the build execution
Key | Default | Required | Description |
---|---|---|---|
s3fs.proxy.url | null | No | Allows you to specify a close proxy to be used to resolve artifact. |
s3fs.publish.internal.release | null | No | Allows internal testing. |
s3fs.publish.internal.snapshot | null | No | Allows internal testing. |
s3fs.publish.sonar.login | null | Yes if building with CI | Required by the sonar plugin to publish reports to SonarQube. |
s3fs.publish.sonatype.user | null | Yes, when publishing | Maven Central User |
s3fs.publish.sonatype.pass | null | Yes, when publishing | Maven Central Secret |