-
Notifications
You must be signed in to change notification settings - Fork 516
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
一键同步功能是否暂时无法使用 #297
Comments
根据readme文档以及历史issue可以回溯到问题是负责同步镜像的url无法访问,具体过程如下: 首先查看readme提示到vulfocus-api/views.py文件夹修改对应url解决同步问题, 查看/vulfocus-api/tasks/tasks.py代码中相应函数
可以看到现在访问的url是“http://vulfocus.io/api/imgs/info” |
… ------------------ 原始邮件 ------------------
发件人: "fofapro/vulfocus" ***@***.***>;
发送时间: 2022年8月1日(星期一) 晚上7:42
***@***.***>;
***@***.***>;
主题: Re: [fofapro/vulfocus] 一键同步功能是否暂时无法使用 (Issue #297)
亲爱的开发者您好,这边在使用的时候碰到了下面的问题
报错信息 点击一键同步后并未成功同步 操作系统: centos 7 内核版本: Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux Python 环境版本: docker环境 Vulfocus 版本: docker 最新版本 详细报错信息或堆栈报错信息: docker 启动容器后,centos7 关闭了firewalld seLinux,在一键同步镜像的时候,发现页面只有一个同步任务下发成功。查看日志结果 [2022-07-31 12:27:20,297: INFO/MainProcess] Received task: tasks.synchronous_image[acc27b00-dc73-4b5c-9284-1748a7ad214f] [2022-07-31 12:27:20,673: INFO/ForkPoolWorker-2] Task tasks.synchronous_image[acc27b00-dc73-4b5c-9284-1748a7ad214f] succeeded in 0.37512358300000415s: None 返回一个None,是否为同步地址出现了问题?
根据readme文档以及历史issue可以回溯到问题是 url:"http://vulfocus.io/api/imgs/info"已无法访问。过程如下:
首先查看readme提示到vulfocus-api/views.py文件夹修改对应url解决同步问题,但是查看历史issue发现同步官网镜像的函数已经更新,但readme没有及时更新。实际上目前在views.py的第1575行使用了tasks.synchronous_image.delay()进行同步,查看/vulfocus-api/tasks/tasks.py代码
def synchronous_image(): """ 同步官网镜像 :return: """ page = 1 image_names = list(ImageInfo.objects.all().values_list('image_name', flat=True)) req = None while True: url = "http://vulfocus.io/api/imgs/info" try: res = requests.get(url, verify=False, params={"page": page}).content req = json.loads(res) except Exception as e: return if "total_page" in req and page > req["total_page"]: return for item in req["imgs"]: if item['image_name'] == "": continue if 'is_docker_compose' in item: if item['is_docker_compose'] == True: continue if item['image_name'] in image_names: if item['image_name'] == "vulfocus/vulfocus:latest": continue single_img = ImageInfo.objects.filter(image_name__contains=item['image_name']).first() if single_img.image_vul_name != item['image_vul_name'] or single_img.image_vul_name == "": single_img.image_vul_name = item['image_vul_name'] if single_img.image_desc == "": single_img.image_desc = item['image_desc'] if single_img.rank != item['rank']: single_img.rank = item['rank'] if single_img.degree != item['degree']: single_img.degree = json.dumps(item['degree']) if "writeup_date" in item and single_img.writeup_date != item['writeup_date']: single_img.writeup_date = item['writeup_date'] single_img.save() else: if "writeup_date" in item: writeup_date = item['writeup_date'] else: writeup_date = "" image_info = ImageInfo(image_name=item['image_name'], image_vul_name=item['image_vul_name'], image_desc=item['image_desc'], rank=item['rank'], degree=json.dumps(item['degree']), writeup_date=writeup_date, is_ok=False, create_date=timezone.now(), update_date=timezone.now()) image_info.save() page += 1
可以看到现在访问的url是http://vulfocus.io/api/imgs/info
手动访问http://vulfocus.io/api/imgs/info,返回404,所以一键同步目前是无法使用的。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
亲爱的开发者您好,这边在使用的时候碰到了下面的问题
报错信息
点击一键同步后并未成功同步
操作系统:
centos 7
内核版本:
Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Python 环境版本:
docker环境
Vulfocus 版本:
docker 最新版本
详细报错信息或堆栈报错信息:
docker 启动容器后,centos7 关闭了firewalld seLinux,在一键同步镜像的时候,发现页面只有一个同步任务下发成功。查看日志结果
[2022-07-31 12:27:20,297: INFO/MainProcess] Received task: tasks.synchronous_image[acc27b00-dc73-4b5c-9284-1748a7ad214f]
[2022-07-31 12:27:20,673: INFO/ForkPoolWorker-2] Task tasks.synchronous_image[acc27b00-dc73-4b5c-9284-1748a7ad214f] succeeded in 0.37512358300000415s: None
返回一个None,是否为同步地址出现了问题?
The text was updated successfully, but these errors were encountered: