Merge pull request #32 from thsrite/main

This commit is contained in:
jxxghp
2023-08-05 22:27:53 +08:00
committed by GitHub
3 changed files with 282 additions and 280 deletions

View File

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

View File

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

View File

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