使用亚马逊Web服务的S3存储托管资源文件
项目描述
ckanext-s3filestore
使用亚马逊S3作为资源存储。
需求
需要CKAN 2.5+
安装
要安装ckanext-s3filestore
- 激活您的CKAN虚拟环境,例如 - . /usr/lib/ckan/default/bin/activate 
- 将ckanext-s3filestore Python包安装到您的虚拟环境中 - pip install ckanext-s3filestore 
- 将s3filestore添加到CKAN配置文件中的ckan.plugins设置(默认配置文件位于/etc/ckan/default/production.ini)。 
- 重启CKAN。例如,如果您在Ubuntu上使用Apache部署了CKAN - sudo service apache2 reload 
配置设置
必需
ckanext.s3filestore.aws_access_key_id = Your-AWS-Access-Key-ID ckanext.s3filestore.aws_secret_access_key = Your-AWS-Secret-Access-Key ckanext.s3filestore.aws_bucket_name = a-bucket-to-store-your-stuff
可选
# An optional path to prepend to keys ckanext.s3filestore.aws_storage_path = my-site-name # An optional setting to fallback to filesystem for downloads ckanext.s3filestore.filesystem_download_fallback = true # The ckan storage path option must also be set correctly for the fallback to work ckan.storage_path = path/to/storage/directory
开发安装
要为开发安装ckanext-s3filestore,激活您的CKAN虚拟env并执行
git clone https://github.com/okfn/ckanext-s3filestore.git cd ckanext-s3filestore python setup.py develop pip install -r dev-requirements.txt pip install -r requirements.txt
运行测试
要运行测试,请执行
nosetests --ckan --nologcapture --with-pylons=test.ini
要运行测试并生成覆盖率报告,请首先确保您在虚拟env中安装了覆盖率工具(pip install coverage),然后运行
nosetests --ckan --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.s3filestore --cover-inclusive --cover-erase --cover-tests
在PyPI上注册ckanext-s3filestore
ckanext-s3filestore应可在PyPI上通过https://pypi.python.org/pypi/ckanext-s3filestore访问。如果该链接无法工作,您可以通过以下步骤首次在PyPI上注册项目:
- 创建项目的源代码分发版 - python setup.py sdist 
- 注册项目 - python setup.py register 
- 将源代码分发版上传到PyPI - python setup.py sdist upload 
- 在GitHub上使用来自setup.py文件的版本号标记项目的第一个版本。例如,如果setup.py中的版本号是0.0.1,则执行以下操作: - git tag 0.0.1 git push --tags 
发布ckanext-s3filestore的新版本
ckanext-s3filestore可在PyPI上通过https://pypi.python.org/pypi/ckanext-s3filestore访问。要向PyPI发布新版本,请按照以下步骤操作:
- 在setup.py文件中更新版本号。有关如何选择版本号的详细信息,请参阅PEP 440。 
- 创建新版本的源代码分发版 - python setup.py sdist 
- 将源代码分发版上传到PyPI - python setup.py sdist upload 
- 在GitHub上使用来自setup.py文件的版本号标记项目的最新版本。例如,如果setup.py中的版本号是0.0.2,则执行以下操作: - git tag 0.0.2 git push --tags 
项目详情
ckanext-s3filestore-0.0.3.tar.gz的散列值
| 算法 | 散列摘要 | |
|---|---|---|
| SHA256 | 1fd4a0271c50f8f90c0ff29fc949ee7013b3cb2211a7fbfefe16baa037f78110 | |
| MD5 | f892b2e4e117e998839e2624bf1d73cc | |
| BLAKE2b-256 | f0ef92890d8a301ba2f6f4471b48c75289fbe42685381c7c70250692e5e3a1e8 |