Merge pull request #32 from thsrite/main

This commit is contained in:
jxxghp 2023-08-05 22:27:53 +08:00 committed by GitHub
commit 8d01630d03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 282 additions and 280 deletions

View File

@ -40,6 +40,7 @@ RUN apt-get update \
procps \
gosu \
bash \
wget \
&& mkdir -p /etc/nginx ${HOME} \
&& cp -f nginx.conf /etc/nginx/nginx.template.conf \
&& mv ./public / \

View File

@ -11,7 +11,7 @@ from python_hosts import Hosts, HostsEntry
from app.core.config import settings
from app.log import logger
from app.plugins import _PluginBase
from app.schemas.types import EventType
from app.schemas.types import EventType, NotificationType
from app.utils.http import RequestUtils
from app.utils.ip import IpUtils
from app.utils.system import SystemUtils
@ -192,7 +192,8 @@ class CloudflareSpeedTest(_PluginBase):
"plugin_id": "CustomHosts"
})
if self._notify:
logger.send_message(
self.post_message(
mtype=NotificationType.SiteMessage,
title="【Cloudflare优选任务完成】",
text=f"原ip{old_ip}\n"
f"新ip{best_ip}"

View File

@ -54,7 +54,7 @@ class CustomHosts(_PluginBase):
# 更新错误Hosts
self.update_config({
"hosts": self._hosts,
"hosts": ''.join(self._hosts),
"err_hosts": error_hosts,
"enabled": self._enabled
})