Skip to main content

No project description provided

Project description

Tests

ckanext-file-keeper-cloud

This CKAN extension provides a way to store uploaded files on external cloud storage services. It extends management functionality introduced in CKAN v2.12 and provides a set of adapters for different cloud storage providers.

Requirements

Compatibility with core CKAN versions:

CKAN version Compatible?
2.11 no
2.12 yes

Installation

TODO: Add any additional install steps to the list below. For example installing any non-Python dependencies or adding any required config settings.

To install ckanext-file-keeper-cloud:

  1. Activate your CKAN virtual environment, for example:

    . /usr/lib/ckan/default/bin/activate
    
  2. Clone the source and install it on the virtualenv

    git clone https://github.com/ckan/ckanext-file-keeper-cloud.git
    cd ckanext-file-keeper-cloud
    
    # to install all adapters
    pip install -e '.[all]'
    
    # or, to install only specific adapter
    pip install -e '.[s3]'
    pip install -e '.[gcs]'
    pip install -e '.[azure]'
    pip install -e '.[libcloud]'
    
  3. Add file_keeper_cloud to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/ckan.ini).

  4. Restart CKAN.

Available adapters

Note, cloud providers can be emulated using docker images. Even though it these images do not replicate ideally corresponding cloud provider, generally they are close enough to be used for local development and testing.

ckan:s3

AWS S3 adapter. Wraps file-keeper's implementation

Installation:

pip install 'ckanext-file-keeper-cloud[s3]'
## or, if using development installation, switch to repository folder and
pip install -e '.[s3]'

Configuration example:

ckan.files.storage.my_cloud.type = ckan:s3
ckan.files.storage.my_cloud.bucket = my_bucket
ckan.files.storage.my_cloud.key = ABC123
ckan.files.storage.my_cloud.secret = 321CBA

Only bucket option is required as all other parameters can be read from environment variables:

  • bucket: name of the storage bucket
  • key: the AWS Access Key
  • secret: the AWS Secret Key
  • region: the AWS Region of the bucket

ckan:azure_blob

Microsoft Azure Blob Storage adapter. Wraps file-keeper's implementation

Installation:

pip install 'ckanext-file-keeper-cloud[azure]'
## or, if using development installation, switch to repository folder and
pip install -e '.[azure]'

Configuration example:

ckan.files.storage.my_cloud.type = ckan:azure_blob
ckan.files.storage.my_cloud.container_name = my_container
ckan.files.storage.my_cloud.account_name = ABC123
ckan.files.storage.my_cloud.account_key = 321CBA

Recommended options:

  • container_name: name of the storage container
  • account_name: name of the Azure account
  • account_key: key for the Azure account

ckan:gcs

Google Cloud Storage adapter. Wraps file-keeper's implementation

Installation:

pip install 'ckanext-file-keeper-cloud[gcs]'
## or, if using development installation, switch to repository folder and
pip install -e '.[gcs]'

Configuration example:

ckan.files.storage.my_cloud.type = ckan:gcs
ckan.files.storage.my_cloud.bucket_name = my_bucket
ckan.files.storage.my_cloud.project_id = my-project
ckan.files.storage.my_cloud.credentials_file = /etc/ckan/default/google-cloud-credentials.json

Recommended options:

  • bucket_name: name of the storage bucket
  • credentials_files: path to the JSON with cloud credentials
  • project_id: the project which the client acts on behalf of

ckan:libcloud

Apache Libcloud adapter. Wraps file-keeper's implementation

Installation:

pip install 'ckanext-file-keeper-cloud[libcloud]'
## or, if using development installation, switch to repository folder and
pip install -e '.[libcloud]'

Configuration example:

ckan.files.storage.my_cloud.type = ckan:libcloud
ckan.files.storage.my_cloud.provider = S3
ckan.files.storage.my_cloud.container_name = my_bucket
ckan.files.storage.my_cloud.key = ABC123
ckan.files.storage.my_cloud.secret = 321CBA

Requires following options:

  • provider: one of Apache Libcloud providers
  • key: API key or username
  • secret: Secret password
  • container_name: Name of the container/bucket

Majority of providers do not support permanent links out of the box. But if the container supports public anonymous access and all files are available at URL https://<PROVIDER>/<CONTAINER>/<FILENAME>, this shared https://<PROVIDER>/<CONTAINER> part can be specified as public_prefix of the storage. In this case, CKAN will append file's location to the configured public_prefix whenever it needs a permanent public link for the file.

Files are uploaded to the root of container. To specify nested location for all uploads, use path option.

Any other provider specific option can be added inside params option which expects a valid JSON object

Developer installation

To install ckanext-file-keeper-cloud for development, activate your CKAN virtualenv and do:

git clone https://github.com/ckan/ckanext-file-keeper-cloud.git
cd ckanext-file-keeper-cloud
pip install -e '.[all]'

License

AGPL

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext_file_keeper_cloud-0.0.1.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckanext_file_keeper_cloud-0.0.1-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file ckanext_file_keeper_cloud-0.0.1.tar.gz.

File metadata

File hashes

Hashes for ckanext_file_keeper_cloud-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c7c6f867ff53cfc0758e5bd81696edcad9fd148cb0793639338626ea7b7b0039
MD5 3b0b160fe4d8d6b17ad04ccd12d8ba65
BLAKE2b-256 7a7cae62145d1f2d6b3691527ad7dda029eab47a25b134e40fa4f4f620666d33

See more details on using hashes here.

File details

Details for the file ckanext_file_keeper_cloud-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ckanext_file_keeper_cloud-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f2955c085de25d2d9fe1721a582a417e51478e4caa59c98f73a6665dd4e947e3
MD5 10e6026449f426b11837500a8597cb13
BLAKE2b-256 5aba66e23ea29011bb91d0c6e0974ac2ad4731b0cd4a24ee531133a69a6e7922

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page