Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-work the way the configuration works #116

Open
4 of 9 tasks
carlspring opened this issue Nov 23, 2020 · 1 comment
Open
4 of 9 tasks

Re-work the way the configuration works #116

carlspring opened this issue Nov 23, 2020 · 1 comment
Labels
help wanted Extra attention is needed on hold

Comments

@carlspring
Copy link
Owner

carlspring commented Nov 23, 2020

Task Description

The current way that the configuration is implemented is quite confusing and error-prone to work with. We need to clarify how we'd like this to work, gather the requirements and refactor this.

Current Way It Works

Generic Way

Map<String, Object> env;

String accessKey = System.getenv(ACCESS_KEY);
String secretKey = System.getenv(SECRET_KEY);
String region = System.getenv(REGION);
String protocol = System.getenv(PROTOCOL);

env = ImmutableMap.<String, Object>builder().put(ACCESS_KEY, accessKey)
                                            .put(SECRET_KEY, secretKey)
                                            .put(REGION, region)
                                            .put(PROTOCOL, protocol)
                                            .build();

Production

If there is an amazon.properties on the classpath, this will be used to load the properties. The configuration is loaded using org.carlspring.cloud.storage.s3fs.S3FileSystemProvider.

If not, the generic way can be used.

Tests

If there is an amazon-test.properties on the classpath, this will be used to load the properties. The configuration is loaded using org.carlspring.cloud.storage.s3fs.util.EnvironmentBuilder.

If not, the generic way can be used.

Current Problems

  • Production and testing should use the same code for loading properties and setting up the configuration.
  • It is not possible to use multiple buckets, region, or credential settings.

Tasks

The following tasks will need to be carried out:

Task Relationships

This task:

Help

@carlspring carlspring added the help wanted Extra attention is needed label Nov 23, 2020
@carlspring
Copy link
Owner Author

@ptirador , @steve-todorov , @elerch, @markjschreiber, @pditommaso ,

Please, feel free to join in and share your thoughts on this topic! :)

@elerch, @markjschreiber: I know you had some first hand experience in this regard, as well as a passionate disliking of how it currently works, which would be quite helpful in defining how to re-implement and do it better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed on hold
Projects
None yet
Development

No branches or pull requests

2 participants