-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
可修改域名证书配置和用户信息 支持 Docker 部署 Docker 容器自动配置定时任务,每天 01:00 执行更新,日志自动记录在 cdncert.log
- Loading branch information
Showing
14 changed files
with
162 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ cert/ | |
venv | ||
.DS_Store | ||
config.ini | ||
cdncert.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
FROM python:latest | ||
VOLUME ['/app', '/cert'] | ||
WORKDIR /app | ||
|
||
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple | ||
COPY ./sources.list /etc/apt/sources.list | ||
RUN apt update -y && apt install cron -y | ||
WORKDIR /app | ||
COPY ./requirements.txt ./requirements.txt | ||
RUN cd /app && pip install -r requirements.txt | ||
ENTRYPOINT ["python3", "cron.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import time | ||
|
||
import schedule | ||
from core import Core | ||
from logger import log | ||
|
||
Time = '01:00' | ||
|
||
log.info('cdn_cert cron job started, will check at %s every day', Time) | ||
|
||
core = Core() | ||
|
||
schedule.every().day.at(Time).do(core.do) | ||
|
||
while True: | ||
schedule.run_pending() | ||
time.sleep(100) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import sys | ||
import logging | ||
|
||
log_format = '[%(asctime)s] %(levelname)s %(message)s' | ||
datetime_format = '%Y-%m-%d %H:%M:%S' | ||
|
||
logging.basicConfig(filename="cdncert.log", | ||
filemode="w", | ||
format=log_format, | ||
datefmt=datetime_format, | ||
level=logging.INFO) | ||
|
||
console = logging.StreamHandler() | ||
console.setLevel(logging.INFO) | ||
console.setFormatter(logging.Formatter(fmt=log_format, datefmt=datetime_format)) | ||
|
||
logging.getLogger().addHandler(console) | ||
|
||
log = logging.getLogger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
aliyun_python_sdk_cdn==3.6.1 | ||
aliyun_python_sdk_core==2.13.30 | ||
prettytable==2.0.0 | ||
SQLAlchemy==1.3.23 | ||
aliyun_python_sdk_cdn==3.6.4 | ||
aliyun_python_sdk_core==2.13.35 | ||
prettytable==2.2.0 | ||
schedule==1.1.0 | ||
SQLAlchemy==1.4.23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters