Skip to content

Conversation

@rclement
Copy link
Contributor

When using the Swift backend with some provider, some more options might be required.
For instance, when using OVH Object Storage service, OpenStack Swift Authentication v2 is required along with specifying the region name.

This PR allows to further configure the swiftclient library using optional variables:

  • AUTH_VERSION: The OpenStack auth version (optional, default: "1")
  • OS_OPTIONS: The OpenStack options as a dictionary with keys such as region_name (optional, default: None)

When configuring flask-fs, the flask user config for the Swift backend can look like:

    FS_SWIFT_AUTHURL = os.environ.get('SWIFT_AUTHURL')
    FS_SWIFT_AUTH_VERSION = os.environ.get('SWIFT_AUTH_VERSION')
    FS_SWIFT_OS_OPTIONS = {
        'region_name': os.environ.get('SWIFT_REGION_NAME')
    }
    FS_SWIFT_USER = os.environ.get('SWIFT_USER')
    FS_SWIFT_KEY = os.environ.get('SWIFT_KEY')
    FS_SWIFT_URL = os.environ.get('SWIFT_URL')

I did not add some more tests for the Swift backend as I currently do not know how to test these options with the used Docker image morrisjobke/docker-swift-onlyone.
However, I tested it successfully with a production-grade web-service.

Let me know if there is anything I can to make this better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant