sayhi-admin


Namesayhi-admin JSON
Version 1.4.3 PyPI version JSON
download
home_pagehttps://github.com/MeDeity/domain-admin.git
Summaryan admin for sayhi(this is fork demo)
upload_time2023-09-06 09:27:56
maintainer
docs_urlNone
authorPeng Shiyu
requires_python
licenseMIT
keywords an admin for sayhi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # Domain Admin

[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/domain-admin)](https://pypi.org/project/domain-admin)
[![PyPI](https://img.shields.io/pypi/v/domain-admin.svg)](https://pypi.org/project/domain-admin)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/domain-admin?label=pypi%20downloads)](https://pypi.org/project/domain-admin)
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/mouday/domain-admin?label=docker%20version&sort=semver)](https://hub.docker.com/r/mouday/domain-admin)
[![Docker Pulls](https://img.shields.io/docker/pulls/mouday/domain-admin)](https://hub.docker.com/r/mouday/domain-admin)
[![Build Status](https://app.travis-ci.com/mouday/domain-admin.svg?branch=master)](https://app.travis-ci.com/mouday/domain-admin)
[![PyPI - License](https://img.shields.io/pypi/l/domain-admin)](https://github.com/mouday/domain-admin/blob/master/LICENSE)

![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/domain.svg)

基于Python + Vue3.js 技术栈实现的域名和SSL证书监测平台

核心功能:到期自动邮件提醒

用于解决,不同业务域名SSL证书,申请自不同的平台,到期后不能及时收到通知,导致线上访问异常,被老板责骂的问题

支持平台:macOS、Linux、Windows

- 项目地址:https://github.com/mouday/domain-admin
- 国内镜像:https://gitee.com/mouday/domain-admin
- pypi:https://pypi.org/project/domain-admin
- docker:https://hub.docker.com/r/mouday/domain-admin

## 项目截图

网页版:

![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/screencapture.png)

预览地址:[https://mouday.github.io/domain-admin-web/](https://mouday.github.io/domain-admin-web/)

账号密码随意,预览模式仅提供模拟数据,无法操作修改

## 安装

### 方式一:pip安装

运行环境:

- Python 3.7.0

可以使用`pyenv` 管理多个Python版本

```bash
$ python3 --version
Python 3.7.0

# 创建名为 venv 的虚拟环境
$ python3 -m venv venv

# 激活虚拟环境
$ source venv/bin/activate

# 安装 domain-admin
$ pip install domain-admin

# 升级到最新版本,可选
$ pip3 install -U domain-admin -i https://pypi.org/simple

# 启动运行
$ gunicorn 'domain_admin.main:app'
```

访问地址:http://127.0.0.1:8000

默认的管理员账号:admin 密码:123456

> `强烈建议`:登录系统后修改默认密码

### 方式二:docker启动

感谢[@miss85246](https://github.com/miss85246) 提供Docker支持

```bash
$ docker run -p 8000:8000 mouday/domain-admin

# 后台运行
$ docker run -d -p 8000:8000 mouday/domain-admin

# 本地文件夹和容器文件夹映射
$ docker run \
-v $(pwd)/database:/app/database \
-v $(pwd)/logs:/app/logs \
-p 8000:8000 \
--name domain-admin \
mouday/domain-admin:latest
```

### 方式三:克隆源码运行

本方式仅适用于二次开发,推荐采用 pip安装 或者 docker启动 的方式体验

```bash
# 后端项目
git clone https://github.com/mouday/domain-admin.git

# 安装依赖
pip install -r requirements.txt

# 启动开发服务
make dev


# 前端项目
git clone https://github.com/mouday/domain-admin-web.git

# 启动开发服务
make dev
```

为了更多地人参与到项目中来,现已开放前端代码

前端项目地址:[https://github.com/mouday/domain-admin-web](https://github.com/mouday/domain-admin-web)

## 项目简介

功能:

- 权限
    - 用户登录
    - 用户退出
    - 修改密码
    
- 域名管理
    - 域名添加
    - 域名删除
    - 域名搜索
    - 域名导入、导出功能
    - 域名信息

- 证书监控
    - 定时监控
    - 到期邮件提醒
    - 微信提醒
    - 手动/自动更新证书信息

- 用户管理
    - 添加用户
    - 删除用户
    - 禁用/启用用户

- 监控日志

- 管理界面
    - api接口(用于二次开发) 
    - web浏览器 
    - 桌面 
    - ~~移动端(app+小程序)~~

## 系统设置

如果需要对域名进行到期监控和邮件提醒,必须设置

1、设置系统发送邮件的账号密码

![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/system-list.png)

2、批量导入域名

导入文本示例: [/docs/domain.txt](/docs/domain.txt)

3、设置邮件通知

![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/notify-email.png)

4、设置webhook通知

![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/notify-webhook.png)

推送到微信的webhook第三方工具

- [微信推送消息通知接口汇总](https://blog.csdn.net/mouday/article/details/124135877)

## 二次开发

接口文档:[https://mouday.github.io/domain-admin/](https://mouday.github.io/domain-admin/)

代码推送

```bash
# github
git push -u origin master

# gitee
git push -u gitee master
```

## 技术选型

前端选型(网页版)

- Node.js
- Vite.js
- Vue3.js
- Vue Router
- Pinia
- Element Plus
- Tailwind CSS

前端选型(桌面版)

- node.js v16.15.1
- vue3.js
- quasar + electron

后端选型

- Python3.7.0
- [Flask](https://flask.palletsprojects.com/en/2.2.x/) 
- [jinja2](https://jinja.palletsprojects.com/en/3.1.x/)
- [peewee(sqlite)](http://docs.peewee-orm.com/en/latest/index.html#)
- [apscheduler](https://apscheduler.readthedocs.io/en/3.x/)
- [supervisord](http://supervisord.org/index.html) 部署推荐
- [gunicorn](https://docs.gunicorn.org/) mac/linux 推荐
- [waitress](https://github.com/Pylons/waitress) windows 推荐

## 问题

### 1、暂不支持多进程方式启动

使用 master + 多worker 方式启动应用,会启动多个定时任务Scheduler,导致多次执行任务

如果小规模使用,启动一个进程即可

如果是需要支持并发访问,可自行改进应用

将定时器独立出来,单独一个进程控制,行成 scheduler + Flask(master + 多worker)

### 2、为什么外网访问不到?

```bash
# 启动运行
$ gunicorn 'domain_admin.main:app'

# 支持外网可访问,云服务器(阿里云或腾讯云)需要设置安全组 
# 默认内网访问 --bind 127.0.0.1:8000
$ gunicorn --bind '0.0.0.0:8000' domain_admin.main:app'
```

更多设置,可参考[gunicorn](https://docs.gunicorn.org/en/stable/index.html)

### 3、Windows平台启动报错,找不到模块 `fcntl`

gunicorn不支持Windows,可以使用[waitress](https://github.com/Pylons/waitress) 替换,感谢[@cbr252522489](https://github.com/cbr252522489)提供的解决方案

```bash
$ pip install waitress

$ waitress-serve --listen=127.0.0.1:8000 domain_admin.main:app
```

参考:[https://stackoverflow.com/questions/45228395/error-no-module-named-fcntl](https://stackoverflow.com/questions/45228395/error-no-module-named-fcntl)

### 4、添加域名数据后系统异常

可按如下步骤删除异常数据

docker 启动方式

```bash
# 查看容器的运行信息
$ docker ps

# 进入容器
$ docker exec -it <容器id> /bin/sh

# 安装依赖
$ apk add sqlite

# 进入sqlite3
$ sqlite3

sqlite> .open /app/database/database.db

sqlite> .tables
log_scheduler  tb_group       tb_system      tb_version
tb_domain      tb_notify      tb_user

# 查看数据
sqlite> select * from tb_domain;

# 删除数据
sqlite> DELETE FROM tb_domain WHERE id = 1;

# 退出
sqlite> .quit
```

### 5、邮件发送失败

可尝试更换端口25或465

### 6、webhook模板

可以参考接口文档:[更新用户通知配置](docs/notify/updateNotifyOfUser.md)

### 7、监控域名非443的端口

域名格式

```
域名:端口

eg:

www.baidu.com:8080
```

### 8、修改数据库链接

通过配置`.env` 文件或者直接设置系统环境变量

```bash
# sqlite 默认
DB_CONNECT_URL=sqlite:///database/database.db

# mysql
DB_CONNECT_URL=mysql://root:123456@127.0.0.1:3306/data_domain
```

### 9、k8s部署

配置文件示例

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: domain-admin-latest
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: domain-admin
    app.kubernetes.io/version: 1.16.0
    argocd.argoproj.io/instance: domain-admin-latest
    helm.sh/chart: domain-admin-0.1.0
  name: domain-admin-latest
  namespace: domain-admin-production
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/instance: domain-admin-latest
      app.kubernetes.io/name: domain-admin
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/instance: domain-admin-latest
        app.kubernetes.io/name: domain-admin
    spec:
      containers:
      - envFrom:
        - secretRef:
            name: env
        image: mouday/domain-admin:latest
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: http
            scheme: HTTP
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        name: domain-admin
        ports:
        - containerPort: 8000
          name: http
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: http
            scheme: HTTP
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
```

## 问题反馈交流

QQ群号:731742868

邀请码:domain-admin

<img src="https://raw.githubusercontent.com/mouday/domain-admin/master/image/qq-group.jpeg" width="300">

开发计划

- `已完成` 支持企业微信通知
- `已完成` 支持域名分组
- 增加理员权限,权限分级:root 管理员 普通用户
- `已完成` 解决批量导入超时问题,支持1000条数据导入 
- `已完成` 支持域名备注
- `已完成` 支持域名到期数据
- `已完成` webhook支持变量
- `已完成` 异步操作的前端状态显示  
- 暗黑模式
- `已完成` 支持内网用户自己设置过期时间
- `已完成` 增加筛选功能: 筛选域名状态、证书状态、网站状态
- `已完成` 增加批量删除域名的功能

证书测试:[https://badssl.com/](https://badssl.com/)

获取证书列表

```js
JSON.stringify([...document.querySelectorAll('a')].map(a=>a.href))
```

批量域名列表 (746314个)
 
- [alexa-top-1m.csv.zip](http://s3.amazonaws.com/alexa-static/top-1m.csv.zip)
- [docs/top-1m.csv](docs/top-1m.csv)

## 更新日志

[CHANGELOG.md](https://github.com/mouday/domain-admin/blob/master/CHANGELOG.md)

![](image/domain-admin-process.png)

## 参考文章

- [Python:获取域名ssl证书信息和到期时间](https://pengshiyu.blog.csdn.net/article/details/115861795)
- [一文搞定:whois数据库查询域名信息(WHOIS)](https://pengshiyu.blog.csdn.net/article/details/129691736)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MeDeity/domain-admin.git",
    "name": "sayhi-admin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "an admin for sayhi",
    "author": "Peng Shiyu",
    "author_email": "pengshiyuyx@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/09/a9/f9203ecccd1c9750598d3b306f8c9a80850662cb52a4aea0ac97df3fbf3d/sayhi-admin-1.4.3.tar.gz",
    "platform": null,
    "description": "# Domain Admin\r\n\r\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/domain-admin)](https://pypi.org/project/domain-admin)\r\n[![PyPI](https://img.shields.io/pypi/v/domain-admin.svg)](https://pypi.org/project/domain-admin)\r\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/domain-admin?label=pypi%20downloads)](https://pypi.org/project/domain-admin)\r\n[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/mouday/domain-admin?label=docker%20version&sort=semver)](https://hub.docker.com/r/mouday/domain-admin)\r\n[![Docker Pulls](https://img.shields.io/docker/pulls/mouday/domain-admin)](https://hub.docker.com/r/mouday/domain-admin)\r\n[![Build Status](https://app.travis-ci.com/mouday/domain-admin.svg?branch=master)](https://app.travis-ci.com/mouday/domain-admin)\r\n[![PyPI - License](https://img.shields.io/pypi/l/domain-admin)](https://github.com/mouday/domain-admin/blob/master/LICENSE)\r\n\r\n![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/domain.svg)\r\n\r\n\u57fa\u4e8ePython + Vue3.js \u6280\u672f\u6808\u5b9e\u73b0\u7684\u57df\u540d\u548cSSL\u8bc1\u4e66\u76d1\u6d4b\u5e73\u53f0\r\n\r\n\u6838\u5fc3\u529f\u80fd\uff1a\u5230\u671f\u81ea\u52a8\u90ae\u4ef6\u63d0\u9192\r\n\r\n\u7528\u4e8e\u89e3\u51b3\uff0c\u4e0d\u540c\u4e1a\u52a1\u57df\u540dSSL\u8bc1\u4e66\uff0c\u7533\u8bf7\u81ea\u4e0d\u540c\u7684\u5e73\u53f0\uff0c\u5230\u671f\u540e\u4e0d\u80fd\u53ca\u65f6\u6536\u5230\u901a\u77e5\uff0c\u5bfc\u81f4\u7ebf\u4e0a\u8bbf\u95ee\u5f02\u5e38\uff0c\u88ab\u8001\u677f\u8d23\u9a82\u7684\u95ee\u9898\r\n\r\n\u652f\u6301\u5e73\u53f0\uff1amacOS\u3001Linux\u3001Windows\r\n\r\n- \u9879\u76ee\u5730\u5740\uff1ahttps://github.com/mouday/domain-admin\r\n- \u56fd\u5185\u955c\u50cf\uff1ahttps://gitee.com/mouday/domain-admin\r\n- pypi\uff1ahttps://pypi.org/project/domain-admin\r\n- docker\uff1ahttps://hub.docker.com/r/mouday/domain-admin\r\n\r\n## \u9879\u76ee\u622a\u56fe\r\n\r\n\u7f51\u9875\u7248\uff1a\r\n\r\n![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/screencapture.png)\r\n\r\n\u9884\u89c8\u5730\u5740\uff1a[https://mouday.github.io/domain-admin-web/](https://mouday.github.io/domain-admin-web/)\r\n\r\n\u8d26\u53f7\u5bc6\u7801\u968f\u610f\uff0c\u9884\u89c8\u6a21\u5f0f\u4ec5\u63d0\u4f9b\u6a21\u62df\u6570\u636e\uff0c\u65e0\u6cd5\u64cd\u4f5c\u4fee\u6539\r\n\r\n## \u5b89\u88c5\r\n\r\n### \u65b9\u5f0f\u4e00\uff1apip\u5b89\u88c5\r\n\r\n\u8fd0\u884c\u73af\u5883\uff1a\r\n\r\n- Python 3.7.0\r\n\r\n\u53ef\u4ee5\u4f7f\u7528`pyenv` \u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\r\n\r\n```bash\r\n$ python3 --version\r\nPython 3.7.0\r\n\r\n# \u521b\u5efa\u540d\u4e3a venv \u7684\u865a\u62df\u73af\u5883\r\n$ python3 -m venv venv\r\n\r\n# \u6fc0\u6d3b\u865a\u62df\u73af\u5883\r\n$ source venv/bin/activate\r\n\r\n# \u5b89\u88c5 domain-admin\r\n$ pip install domain-admin\r\n\r\n# \u5347\u7ea7\u5230\u6700\u65b0\u7248\u672c\uff0c\u53ef\u9009\r\n$ pip3 install -U domain-admin -i https://pypi.org/simple\r\n\r\n# \u542f\u52a8\u8fd0\u884c\r\n$ gunicorn 'domain_admin.main:app'\r\n```\r\n\r\n\u8bbf\u95ee\u5730\u5740\uff1ahttp://127.0.0.1:8000\r\n\r\n\u9ed8\u8ba4\u7684\u7ba1\u7406\u5458\u8d26\u53f7\uff1aadmin \u5bc6\u7801\uff1a123456\r\n\r\n> `\u5f3a\u70c8\u5efa\u8bae`\uff1a\u767b\u5f55\u7cfb\u7edf\u540e\u4fee\u6539\u9ed8\u8ba4\u5bc6\u7801\r\n\r\n### \u65b9\u5f0f\u4e8c\uff1adocker\u542f\u52a8\r\n\r\n\u611f\u8c22[@miss85246](https://github.com/miss85246) \u63d0\u4f9bDocker\u652f\u6301\r\n\r\n```bash\r\n$ docker run -p 8000:8000 mouday/domain-admin\r\n\r\n# \u540e\u53f0\u8fd0\u884c\r\n$ docker run -d -p 8000:8000 mouday/domain-admin\r\n\r\n# \u672c\u5730\u6587\u4ef6\u5939\u548c\u5bb9\u5668\u6587\u4ef6\u5939\u6620\u5c04\r\n$ docker run \\\r\n-v $(pwd)/database:/app/database \\\r\n-v $(pwd)/logs:/app/logs \\\r\n-p 8000:8000 \\\r\n--name domain-admin \\\r\nmouday/domain-admin:latest\r\n```\r\n\r\n### \u65b9\u5f0f\u4e09\uff1a\u514b\u9686\u6e90\u7801\u8fd0\u884c\r\n\r\n\u672c\u65b9\u5f0f\u4ec5\u9002\u7528\u4e8e\u4e8c\u6b21\u5f00\u53d1\uff0c\u63a8\u8350\u91c7\u7528 pip\u5b89\u88c5 \u6216\u8005 docker\u542f\u52a8 \u7684\u65b9\u5f0f\u4f53\u9a8c\r\n\r\n```bash\r\n# \u540e\u7aef\u9879\u76ee\r\ngit clone https://github.com/mouday/domain-admin.git\r\n\r\n# \u5b89\u88c5\u4f9d\u8d56\r\npip install -r requirements.txt\r\n\r\n# \u542f\u52a8\u5f00\u53d1\u670d\u52a1\r\nmake dev\r\n\r\n\r\n# \u524d\u7aef\u9879\u76ee\r\ngit clone https://github.com/mouday/domain-admin-web.git\r\n\r\n# \u542f\u52a8\u5f00\u53d1\u670d\u52a1\r\nmake dev\r\n```\r\n\r\n\u4e3a\u4e86\u66f4\u591a\u5730\u4eba\u53c2\u4e0e\u5230\u9879\u76ee\u4e2d\u6765\uff0c\u73b0\u5df2\u5f00\u653e\u524d\u7aef\u4ee3\u7801\r\n\r\n\u524d\u7aef\u9879\u76ee\u5730\u5740\uff1a[https://github.com/mouday/domain-admin-web](https://github.com/mouday/domain-admin-web)\r\n\r\n## \u9879\u76ee\u7b80\u4ecb\r\n\r\n\u529f\u80fd\uff1a\r\n\r\n- \u6743\u9650\r\n    - \u7528\u6237\u767b\u5f55\r\n    - \u7528\u6237\u9000\u51fa\r\n    - \u4fee\u6539\u5bc6\u7801\r\n    \r\n- \u57df\u540d\u7ba1\u7406\r\n    - \u57df\u540d\u6dfb\u52a0\r\n    - \u57df\u540d\u5220\u9664\r\n    - \u57df\u540d\u641c\u7d22\r\n    - \u57df\u540d\u5bfc\u5165\u3001\u5bfc\u51fa\u529f\u80fd\r\n    - \u57df\u540d\u4fe1\u606f\r\n\r\n- \u8bc1\u4e66\u76d1\u63a7\r\n    - \u5b9a\u65f6\u76d1\u63a7\r\n    - \u5230\u671f\u90ae\u4ef6\u63d0\u9192\r\n    - \u5fae\u4fe1\u63d0\u9192\r\n    - \u624b\u52a8/\u81ea\u52a8\u66f4\u65b0\u8bc1\u4e66\u4fe1\u606f\r\n\r\n- \u7528\u6237\u7ba1\u7406\r\n    - \u6dfb\u52a0\u7528\u6237\r\n    - \u5220\u9664\u7528\u6237\r\n    - \u7981\u7528/\u542f\u7528\u7528\u6237\r\n\r\n- \u76d1\u63a7\u65e5\u5fd7\r\n\r\n- \u7ba1\u7406\u754c\u9762\r\n    - api\u63a5\u53e3\uff08\u7528\u4e8e\u4e8c\u6b21\u5f00\u53d1\uff09 \r\n    - web\u6d4f\u89c8\u5668 \r\n    - \u684c\u9762 \r\n    - ~~\u79fb\u52a8\u7aef\uff08app+\u5c0f\u7a0b\u5e8f\uff09~~\r\n\r\n## \u7cfb\u7edf\u8bbe\u7f6e\r\n\r\n\u5982\u679c\u9700\u8981\u5bf9\u57df\u540d\u8fdb\u884c\u5230\u671f\u76d1\u63a7\u548c\u90ae\u4ef6\u63d0\u9192\uff0c\u5fc5\u987b\u8bbe\u7f6e\r\n\r\n1\u3001\u8bbe\u7f6e\u7cfb\u7edf\u53d1\u9001\u90ae\u4ef6\u7684\u8d26\u53f7\u5bc6\u7801\r\n\r\n![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/system-list.png)\r\n\r\n2\u3001\u6279\u91cf\u5bfc\u5165\u57df\u540d\r\n\r\n\u5bfc\u5165\u6587\u672c\u793a\u4f8b: [/docs/domain.txt](/docs/domain.txt)\r\n\r\n3\u3001\u8bbe\u7f6e\u90ae\u4ef6\u901a\u77e5\r\n\r\n![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/notify-email.png)\r\n\r\n4\u3001\u8bbe\u7f6ewebhook\u901a\u77e5\r\n\r\n![](https://raw.githubusercontent.com/mouday/domain-admin/master/image/notify-webhook.png)\r\n\r\n\u63a8\u9001\u5230\u5fae\u4fe1\u7684webhook\u7b2c\u4e09\u65b9\u5de5\u5177\r\n\r\n- [\u5fae\u4fe1\u63a8\u9001\u6d88\u606f\u901a\u77e5\u63a5\u53e3\u6c47\u603b](https://blog.csdn.net/mouday/article/details/124135877)\r\n\r\n## \u4e8c\u6b21\u5f00\u53d1\r\n\r\n\u63a5\u53e3\u6587\u6863\uff1a[https://mouday.github.io/domain-admin/](https://mouday.github.io/domain-admin/)\r\n\r\n\u4ee3\u7801\u63a8\u9001\r\n\r\n```bash\r\n# github\r\ngit push -u origin master\r\n\r\n# gitee\r\ngit push -u gitee master\r\n```\r\n\r\n## \u6280\u672f\u9009\u578b\r\n\r\n\u524d\u7aef\u9009\u578b\uff08\u7f51\u9875\u7248\uff09\r\n\r\n- Node.js\r\n- Vite.js\r\n- Vue3.js\r\n- Vue Router\r\n- Pinia\r\n- Element Plus\r\n- Tailwind CSS\r\n\r\n\u524d\u7aef\u9009\u578b\uff08\u684c\u9762\u7248\uff09\r\n\r\n- node.js v16.15.1\r\n- vue3.js\r\n- quasar + electron\r\n\r\n\u540e\u7aef\u9009\u578b\r\n\r\n- Python3.7.0\r\n- [Flask](https://flask.palletsprojects.com/en/2.2.x/) \r\n- [jinja2](https://jinja.palletsprojects.com/en/3.1.x/)\r\n- [peewee\uff08sqlite\uff09](http://docs.peewee-orm.com/en/latest/index.html#)\r\n- [apscheduler](https://apscheduler.readthedocs.io/en/3.x/)\r\n- [supervisord](http://supervisord.org/index.html) \u90e8\u7f72\u63a8\u8350\r\n- [gunicorn](https://docs.gunicorn.org/) mac/linux \u63a8\u8350\r\n- [waitress](https://github.com/Pylons/waitress) windows \u63a8\u8350\r\n\r\n## \u95ee\u9898\r\n\r\n### 1\u3001\u6682\u4e0d\u652f\u6301\u591a\u8fdb\u7a0b\u65b9\u5f0f\u542f\u52a8\r\n\r\n\u4f7f\u7528 master + \u591aworker \u65b9\u5f0f\u542f\u52a8\u5e94\u7528\uff0c\u4f1a\u542f\u52a8\u591a\u4e2a\u5b9a\u65f6\u4efb\u52a1Scheduler\uff0c\u5bfc\u81f4\u591a\u6b21\u6267\u884c\u4efb\u52a1\r\n\r\n\u5982\u679c\u5c0f\u89c4\u6a21\u4f7f\u7528\uff0c\u542f\u52a8\u4e00\u4e2a\u8fdb\u7a0b\u5373\u53ef\r\n\r\n\u5982\u679c\u662f\u9700\u8981\u652f\u6301\u5e76\u53d1\u8bbf\u95ee\uff0c\u53ef\u81ea\u884c\u6539\u8fdb\u5e94\u7528\r\n\r\n\u5c06\u5b9a\u65f6\u5668\u72ec\u7acb\u51fa\u6765\uff0c\u5355\u72ec\u4e00\u4e2a\u8fdb\u7a0b\u63a7\u5236\uff0c\u884c\u6210 scheduler + Flask\uff08master + \u591aworker\uff09\r\n\r\n### 2\u3001\u4e3a\u4ec0\u4e48\u5916\u7f51\u8bbf\u95ee\u4e0d\u5230\uff1f\r\n\r\n```bash\r\n# \u542f\u52a8\u8fd0\u884c\r\n$ gunicorn 'domain_admin.main:app'\r\n\r\n# \u652f\u6301\u5916\u7f51\u53ef\u8bbf\u95ee\uff0c\u4e91\u670d\u52a1\u5668\uff08\u963f\u91cc\u4e91\u6216\u817e\u8baf\u4e91\uff09\u9700\u8981\u8bbe\u7f6e\u5b89\u5168\u7ec4 \r\n# \u9ed8\u8ba4\u5185\u7f51\u8bbf\u95ee --bind 127.0.0.1:8000\r\n$ gunicorn --bind '0.0.0.0:8000' domain_admin.main:app'\r\n```\r\n\r\n\u66f4\u591a\u8bbe\u7f6e\uff0c\u53ef\u53c2\u8003[gunicorn](https://docs.gunicorn.org/en/stable/index.html)\r\n\r\n### 3\u3001Windows\u5e73\u53f0\u542f\u52a8\u62a5\u9519,\u627e\u4e0d\u5230\u6a21\u5757 `fcntl`\r\n\r\ngunicorn\u4e0d\u652f\u6301Windows\uff0c\u53ef\u4ee5\u4f7f\u7528[waitress](https://github.com/Pylons/waitress) \u66ff\u6362\uff0c\u611f\u8c22[@cbr252522489](https://github.com/cbr252522489)\u63d0\u4f9b\u7684\u89e3\u51b3\u65b9\u6848\r\n\r\n```bash\r\n$ pip install waitress\r\n\r\n$ waitress-serve --listen=127.0.0.1:8000 domain_admin.main:app\r\n```\r\n\r\n\u53c2\u8003\uff1a[https://stackoverflow.com/questions/45228395/error-no-module-named-fcntl](https://stackoverflow.com/questions/45228395/error-no-module-named-fcntl)\r\n\r\n### 4\u3001\u6dfb\u52a0\u57df\u540d\u6570\u636e\u540e\u7cfb\u7edf\u5f02\u5e38\r\n\r\n\u53ef\u6309\u5982\u4e0b\u6b65\u9aa4\u5220\u9664\u5f02\u5e38\u6570\u636e\r\n\r\ndocker \u542f\u52a8\u65b9\u5f0f\r\n\r\n```bash\r\n# \u67e5\u770b\u5bb9\u5668\u7684\u8fd0\u884c\u4fe1\u606f\r\n$ docker ps\r\n\r\n# \u8fdb\u5165\u5bb9\u5668\r\n$ docker exec -it <\u5bb9\u5668id> /bin/sh\r\n\r\n# \u5b89\u88c5\u4f9d\u8d56\r\n$ apk add sqlite\r\n\r\n# \u8fdb\u5165sqlite3\r\n$ sqlite3\r\n\r\nsqlite> .open /app/database/database.db\r\n\r\nsqlite> .tables\r\nlog_scheduler  tb_group       tb_system      tb_version\r\ntb_domain      tb_notify      tb_user\r\n\r\n# \u67e5\u770b\u6570\u636e\r\nsqlite> select * from tb_domain;\r\n\r\n# \u5220\u9664\u6570\u636e\r\nsqlite> DELETE FROM tb_domain WHERE id = 1;\r\n\r\n# \u9000\u51fa\r\nsqlite> .quit\r\n```\r\n\r\n### 5\u3001\u90ae\u4ef6\u53d1\u9001\u5931\u8d25\r\n\r\n\u53ef\u5c1d\u8bd5\u66f4\u6362\u7aef\u53e325\u6216465\r\n\r\n### 6\u3001webhook\u6a21\u677f\r\n\r\n\u53ef\u4ee5\u53c2\u8003\u63a5\u53e3\u6587\u6863\uff1a[\u66f4\u65b0\u7528\u6237\u901a\u77e5\u914d\u7f6e](docs/notify/updateNotifyOfUser.md)\r\n\r\n### 7\u3001\u76d1\u63a7\u57df\u540d\u975e443\u7684\u7aef\u53e3\r\n\r\n\u57df\u540d\u683c\u5f0f\r\n\r\n```\r\n\u57df\u540d:\u7aef\u53e3\r\n\r\neg:\r\n\r\nwww.baidu.com:8080\r\n```\r\n\r\n### 8\u3001\u4fee\u6539\u6570\u636e\u5e93\u94fe\u63a5\r\n\r\n\u901a\u8fc7\u914d\u7f6e`.env` \u6587\u4ef6\u6216\u8005\u76f4\u63a5\u8bbe\u7f6e\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\r\n\r\n```bash\r\n# sqlite \u9ed8\u8ba4\r\nDB_CONNECT_URL=sqlite:///database/database.db\r\n\r\n# mysql\r\nDB_CONNECT_URL=mysql://root:123456@127.0.0.1:3306/data_domain\r\n```\r\n\r\n### 9\u3001k8s\u90e8\u7f72\r\n\r\n\u914d\u7f6e\u6587\u4ef6\u793a\u4f8b\r\n\r\n```yaml\r\napiVersion: apps/v1\r\nkind: Deployment\r\nmetadata:\r\n  labels:\r\n    app.kubernetes.io/instance: domain-admin-latest\r\n    app.kubernetes.io/managed-by: Helm\r\n    app.kubernetes.io/name: domain-admin\r\n    app.kubernetes.io/version: 1.16.0\r\n    argocd.argoproj.io/instance: domain-admin-latest\r\n    helm.sh/chart: domain-admin-0.1.0\r\n  name: domain-admin-latest\r\n  namespace: domain-admin-production\r\nspec:\r\n  progressDeadlineSeconds: 600\r\n  replicas: 1\r\n  revisionHistoryLimit: 10\r\n  selector:\r\n    matchLabels:\r\n      app.kubernetes.io/instance: domain-admin-latest\r\n      app.kubernetes.io/name: domain-admin\r\n  strategy:\r\n    rollingUpdate:\r\n      maxSurge: 25%\r\n      maxUnavailable: 25%\r\n    type: RollingUpdate\r\n  template:\r\n    metadata:\r\n      creationTimestamp: null\r\n      labels:\r\n        app.kubernetes.io/instance: domain-admin-latest\r\n        app.kubernetes.io/name: domain-admin\r\n    spec:\r\n      containers:\r\n      - envFrom:\r\n        - secretRef:\r\n            name: env\r\n        image: mouday/domain-admin:latest\r\n        imagePullPolicy: Always\r\n        livenessProbe:\r\n          failureThreshold: 3\r\n          httpGet:\r\n            path: /\r\n            port: http\r\n            scheme: HTTP\r\n          periodSeconds: 10\r\n          successThreshold: 1\r\n          timeoutSeconds: 1\r\n        name: domain-admin\r\n        ports:\r\n        - containerPort: 8000\r\n          name: http\r\n          protocol: TCP\r\n        readinessProbe:\r\n          failureThreshold: 3\r\n          httpGet:\r\n            path: /\r\n            port: http\r\n            scheme: HTTP\r\n          periodSeconds: 10\r\n          successThreshold: 1\r\n          timeoutSeconds: 1\r\n```\r\n\r\n## \u95ee\u9898\u53cd\u9988\u4ea4\u6d41\r\n\r\nQQ\u7fa4\u53f7:731742868\r\n\r\n\u9080\u8bf7\u7801\uff1adomain-admin\r\n\r\n<img src=\"https://raw.githubusercontent.com/mouday/domain-admin/master/image/qq-group.jpeg\" width=\"300\">\r\n\r\n\u5f00\u53d1\u8ba1\u5212\r\n\r\n- `\u5df2\u5b8c\u6210` \u652f\u6301\u4f01\u4e1a\u5fae\u4fe1\u901a\u77e5\r\n- `\u5df2\u5b8c\u6210` \u652f\u6301\u57df\u540d\u5206\u7ec4\r\n- \u589e\u52a0\u7406\u5458\u6743\u9650\uff0c\u6743\u9650\u5206\u7ea7\uff1aroot \u7ba1\u7406\u5458 \u666e\u901a\u7528\u6237\r\n- `\u5df2\u5b8c\u6210` \u89e3\u51b3\u6279\u91cf\u5bfc\u5165\u8d85\u65f6\u95ee\u9898\uff0c\u652f\u63011000\u6761\u6570\u636e\u5bfc\u5165 \r\n- `\u5df2\u5b8c\u6210` \u652f\u6301\u57df\u540d\u5907\u6ce8\r\n- `\u5df2\u5b8c\u6210` \u652f\u6301\u57df\u540d\u5230\u671f\u6570\u636e\r\n- `\u5df2\u5b8c\u6210` webhook\u652f\u6301\u53d8\u91cf\r\n- `\u5df2\u5b8c\u6210` \u5f02\u6b65\u64cd\u4f5c\u7684\u524d\u7aef\u72b6\u6001\u663e\u793a  \r\n- \u6697\u9ed1\u6a21\u5f0f\r\n- `\u5df2\u5b8c\u6210` \u652f\u6301\u5185\u7f51\u7528\u6237\u81ea\u5df1\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4\r\n- `\u5df2\u5b8c\u6210` \u589e\u52a0\u7b5b\u9009\u529f\u80fd: \u7b5b\u9009\u57df\u540d\u72b6\u6001\u3001\u8bc1\u4e66\u72b6\u6001\u3001\u7f51\u7ad9\u72b6\u6001\r\n- `\u5df2\u5b8c\u6210` \u589e\u52a0\u6279\u91cf\u5220\u9664\u57df\u540d\u7684\u529f\u80fd\r\n\r\n\u8bc1\u4e66\u6d4b\u8bd5\uff1a[https://badssl.com/](https://badssl.com/)\r\n\r\n\u83b7\u53d6\u8bc1\u4e66\u5217\u8868\r\n\r\n```js\r\nJSON.stringify([...document.querySelectorAll('a')].map(a=>a.href))\r\n```\r\n\r\n\u6279\u91cf\u57df\u540d\u5217\u8868 (746314\u4e2a)\r\n \r\n- [alexa-top-1m.csv.zip](http://s3.amazonaws.com/alexa-static/top-1m.csv.zip)\r\n- [docs/top-1m.csv](docs/top-1m.csv)\r\n\r\n## \u66f4\u65b0\u65e5\u5fd7\r\n\r\n[CHANGELOG.md](https://github.com/mouday/domain-admin/blob/master/CHANGELOG.md)\r\n\r\n![](image/domain-admin-process.png)\r\n\r\n## \u53c2\u8003\u6587\u7ae0\r\n\r\n- [Python\uff1a\u83b7\u53d6\u57df\u540dssl\u8bc1\u4e66\u4fe1\u606f\u548c\u5230\u671f\u65f6\u95f4](https://pengshiyu.blog.csdn.net/article/details/115861795)\r\n- [\u4e00\u6587\u641e\u5b9a\uff1awhois\u6570\u636e\u5e93\u67e5\u8be2\u57df\u540d\u4fe1\u606f\uff08WHOIS\uff09](https://pengshiyu.blog.csdn.net/article/details/129691736)\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "an admin for sayhi(this is fork demo)",
    "version": "1.4.3",
    "project_urls": {
        "Homepage": "https://github.com/MeDeity/domain-admin.git"
    },
    "split_keywords": [
        "an",
        "admin",
        "for",
        "sayhi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66e5926e36d170802c000fd0d2c3e2696b122f805107a314ae72ab3c00973835",
                "md5": "00d48e9c37e39f35f65646680caa3486",
                "sha256": "1423fc162daacad324b7d8abb76afeac3c988ec3a0fa48b85e7f4b2e41b53639"
            },
            "downloads": -1,
            "filename": "sayhi_admin-1.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "00d48e9c37e39f35f65646680caa3486",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 597979,
            "upload_time": "2023-09-06T09:27:54",
            "upload_time_iso_8601": "2023-09-06T09:27:54.478753Z",
            "url": "https://files.pythonhosted.org/packages/66/e5/926e36d170802c000fd0d2c3e2696b122f805107a314ae72ab3c00973835/sayhi_admin-1.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09a9f9203ecccd1c9750598d3b306f8c9a80850662cb52a4aea0ac97df3fbf3d",
                "md5": "a1f8cae23b9ebf053dcb02fb8100e1f5",
                "sha256": "cf6854212e15ea8b1239ff596c3bc770a298e227b3743421597e8bbfbd00ede9"
            },
            "downloads": -1,
            "filename": "sayhi-admin-1.4.3.tar.gz",
            "has_sig": false,
            "md5_digest": "a1f8cae23b9ebf053dcb02fb8100e1f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 545461,
            "upload_time": "2023-09-06T09:27:56",
            "upload_time_iso_8601": "2023-09-06T09:27:56.644332Z",
            "url": "https://files.pythonhosted.org/packages/09/a9/f9203ecccd1c9750598d3b306f8c9a80850662cb52a4aea0ac97df3fbf3d/sayhi-admin-1.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-06 09:27:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MeDeity",
    "github_project": "domain-admin",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sayhi-admin"
}
        
Elapsed time: 0.27226s