检查上传资源病毒
项目描述
ckanext-clamav
这是一个基本示例,帮助使用clamd库扫描上传资源中的恶意软件。
安装
ClamAV库使用clamav工具,您必须在环境中安装它才能使此扩展正常工作。
例如,在Ubuntu上安装ClamAV
-
使用APT安装ClamAV apt-get update apt-get install clamav clamav-daemon -y
-
更新ClamAV签名数据库 systemctl stop clamav-freshclam freshclam systemctl start clamav-freshclam
要安装ckanext-clamav
-
激活您的CKAN虚拟环境,例如
. /usr/lib/ckan/default/bin/activate
-
克隆源并将其安装在虚拟env中
git clone https://github.com/mutantsan/ckanext-clamav.git cd ckanext-clamav pip install -e . pip install -r requirements.txt
-
将
clamav
添加到您的CKAN配置文件中的ckan.plugins
设置(默认配置文件位于/etc/ckan/default/ckan.ini
)。 -
重启CKAN。例如,如果您在Ubuntu上使用Apache部署CKAN
sudo service apache2 reload
配置设置
# If your socket file is in different folder, you can specify it
# (optional, default: /var/run/clamav/clamd.ctl).
ckanext.clamav.socket_path = /your/path/to/socket.file
# You can decide to upload unscanned files or not.
# For example, if clamav is disabled, you won't be able to scan a file
# (optional, default: True).
ckanext.clamav.upload_unscanned = False
# ClamAV connection mechanism. There are two options: `tcp` or `unix`.
# If `tcp` selected, you must provide host:port (check next options).
# ( optional, default: unix)
ckanext.clamav.socket_type = unix
# TCP/IP hostname
ckanext.clamav.tcp.host = your.hostname.address
# TCP/IP port
ckanext.clamav.tcp.port = 3310
# ClamAV connection timeout. Either `tcp` or `unix`
# By default, there is no timeout.
# ( optional, default: 60)
ckanext.clamav.timeout = 120
开发者安装
要为开发安装ckanext-clamav,激活您的CKAN虚拟环境并执行
git clone https://github.com/mutantsan/ckanext-clamav.git
cd ckanext-clamav
python setup.py develop
pip install -r dev-requirements.txt
测试
要运行测试,请执行
pytest --ckan-ini=test.ini
许可证
项目详情
下载文件
为您的平台下载文件。如果您不确定要选择哪个,请了解更多关于安装包的信息。
源分布
ckanext-clamav-1.0.3.tar.gz (20.4 kB 查看哈希值)
构建分发版
ckanext_clamav-1.0.3-py3-none-any.whl (19.6 kB 查看哈希值)
关闭
ckanext-clamav-1.0.3.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | bfe9d8e6333d9ef5bc0d1713f352348111abbe58f075c415588a284801d1d9ea |
|
MD5 | 85769cd8ddc6e26814b3e979791867ac |
|
BLAKE2b-256 | bab4a1173d1b6ba54a68aeb84b8a52cbe16b0a92b3b4edfe7c98b510ca630f6d |
关闭
ckanext_clamav-1.0.3-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 4a3181b5215566dc1dc5e43c7b16e5a4f25f6cc40ec1419f3bd46a31958b2463 |
|
MD5 | a09b36430519158a2ae4fbe49b2ef0b5 |
|
BLAKE2b-256 | b05c6ea1d6bd99abe769ea3960d0e9a41bbe9a847d4a320ae38e2c65afeb9fed |