From 823ec9d91e0ea766f14e31a4722fdb0c6cfab295 Mon Sep 17 00:00:00 2001 From: eryajf Date: Wed, 11 Sep 2024 21:25:43 +0800 Subject: [PATCH] doc: add en readme --- README-en.md | 165 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 7 +- config.example.yaml | 2 +- go.sum | 9 +++ 4 files changed, 180 insertions(+), 3 deletions(-) create mode 100644 README-en.md diff --git a/README-en.md b/README-en.md new file mode 100644 index 0000000..c092b22 --- /dev/null +++ b/README-en.md @@ -0,0 +1,165 @@ +English | [简体中文](README.md) + +
+

Cloud DNS Exporter

+ +[![Auth](https://img.shields.io/badge/Auth-eryajf-ff69b4)](https://github.com/eryajf) +[![GitHub contributors](https://img.shields.io/github/contributors/eryajf/cloud_dns_exporter)](https://github.com/eryajf/cloud_dns_exporter/graphs/contributors) +[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/eryajf/cloud_dns_exporter)](https://github.com/eryajf/cloud_dns_exporter/pulls) +[![GitHub Pull Requests](https://img.shields.io/github/stars/eryajf/cloud_dns_exporter)](https://github.com/eryajf/cloud_dns_exporter/stargazers) +[![HitCount](https://views.whatilearened.today/views/github/eryajf/cloud_dns_exporter.svg)](https://github.com/eryajf/cloud_dns_exporter) +[![GitHub license](https://img.shields.io/github/license/eryajf/cloud_dns_exporter)](https://github.com/eryajf/cloud_dns_exporter/blob/main/LICENSE) +[![](https://img.shields.io/badge/Awesome-MyStarList-c780fa?logo=Awesome-Lists)](https://github.com/eryajf/awesome-stars-eryajf#readme) + +

🧰 Automatically obtain the domain name and resolution list of the DNS provider, and automatically obtain the certificate information for each domain name resolution.。🧰

+ + +

+ +![cloud_dns_exporter](https://socialify.git.ci/eryajf/cloud_dns_exporter/image?description=1&descriptionEditable=%E9%80%90%E6%AD%A5%E8%BF%88%E5%90%91%E8%BF%90%E7%BB%B4%E7%9A%84%E5%9B%9B%E4%B8%AA%E7%8E%B0%E4%BB%A3%E5%8C%96%EF%BC%9A%E8%A7%84%E8%8C%83%E5%8C%96%EF%BC%8C%E6%A0%87%E5%87%86%E5%8C%96%EF%BC%8C%E9%AB%98%E6%95%88%E5%8C%96%EF%BC%8C%E4%BC%98%E9%9B%85%E5%8C%96&font=Bitter&forks=1&issues=1&language=1&name=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Light) + + + +## Project Introduction + +When we maintain the website, we may occasionally make some relatively simple mistakes, such as forgetting to replace the domain name certificate and making the website inaccessible. However, when we remembered and replaced the certificate, the website became inaccessible because some parsing was missed. These are painful mistakes. + +This project aims to enable you to easily grasp the certificate information for each domain name resolution, so that when changing certificates, you will not miss any resolution. + +Supports multiple DNS providers, and supports single provider multi account management, while also supporting custom configuration files to obtain certificate information. + +## How to use + +You can download the binary directly from the [Release](https://github.com/eryajf/cloud_dns_exporter/releases) release page, then change the configuration file and run it directly. + +The default port listening is `21798` . Why choose this port? Because the dashboard ID corresponding to the project in Grafana is [21798](https://grafana.com/grafana/dashboards/21798-cloud-dns-record-info/)。 + +You can also choose to use Docker deployment. Configure `config.yaml` locally when deploying, and then override the default in the container by mounting (`-v ./config.yaml:/app/config.yaml`) when running. Just configure it. + +Image Address : +- Abroad: `eryajf/cloud_dns_exporter` +- Domestic: `registry.cn-hangzhou.aliyuncs.com/eryajf/cloud_dns_exporter` + +The current application also provides the `-v` parameter, which is used to print the currently used version information. + +## Quick Experience + +This project provides a `docker-compose.yml` configuration file for quick experience. Before starting, please configure your DNS service provider's `AK/SK` related information in 'docker-compose.yml' and ensure that your `docker-compose` version is not lower than [2.23.0](https://github.com/compose-spec/compose-spec/pull/429)。 + +Then execute the following command in the directory where `docker-compose.yml` is located: + +```bash +docker-compose up -d +``` + +`docker-compose.yml` Three containers are defined in the document, namely: +- `cloud_dns_exporter`: Used to obtain domain name and resolution/certificate information +- `grafana`: Used to display domain name and resolution/certificate information +- `prometheus`: Used for persistent storage of domain names and resolution/certificate information + +After starting with `docker - compose.yml`, access `Grafana` through http://localhost:3000 and log in using the default username and password `admin/admin`. + +Add a `Prometheus` type data source to `Grafana` with the address `http://prometheus:9090`, and then save it. Then import `Grafana Dashboard 21798`, select the `prometheus` data source just added as the data source, and you can see the `UI` display effect. + +## Some Attention + +- In order to improve the efficiency when requesting indicator data, the project is designed to cache the data in advance through scheduled tasks. By default, the domain name and resolution record information is 30s/time, and the certificate information is obtained once every morning. If you want to get it again, just restart the application. +- Obtaining the certificate information of the parsing records will be limited by different network access scenarios, so please deploy this program in a place where all parsing records can be accessed as much as possible. +- Many domain name certificates may not match the domain name. This is because the certificate information corresponding to 443 monitored by the load service is obtained. You can choose to ignore or process it according to your own situation. +- Because domain name registration and resolution management may not be under the same cloud account, there may be cases where the domain name creation time and expiration time labels in the `domain_list` indicator are empty. + +> If you find that the certificate is obtained incorrectly or incorrectly, please submit an issue for communication. + +## Indicator Description + +The indicators provided by this project include the following: + +| NAME | Description | +| ------------------ | -------------------- | +| `domain_list` | Domain Name List | +| `record_list` | Domain name resolution record list | +| `record_cert_info` | Parse record certificate information list | + +Indicator label description: + +``` + +domain_list{ + cloud_provider="DNS Provider", + cloud_name="cloud name", + domain_id="domain id", + domain_name="domain name", + domain_remark="domain remark", + domain_status="domain status", + create_data="Domain name creation date", + expiry_date="Domain expiration date"} 99 (This value is the number of days until the domain name expires) + + +record_list{ + cloud_provider="DNS Provider", + cloud_name="cloud name", + domain_name="domain name", + record_id="record id", + record_type="record type", + record_name="record name", + record_value="record value", + record_ttl="record ttl", + record_weight="record weight", + record_status="record status", + record_remark="record remark", + update_time="update time", + full_record="full record"} 0 + + +record_cert_info{ + cloud_provider="DNS Provider", + cloud_name="cloud name", + domain_name="domain name", + record_id="record id", + full_record="full record", + subject_common_name="subject common name", + subject_organization="subject organization", + subject_organizational_unit="subject organizational unit", + issuer_common_name="issuer common name", + issuer_organization="issuer organization", + issuer_organizational_unit="issuer organizational unit", + created_date="created date", + expiry_date="expiry date", + cert_matched="cert matched", + error_msg="error msg"} 30 (This value is the number of days from the expiration of the recorded certificate) +``` + +## Supported DNS service providers + +- [x] Tencent DnsPod +- [x] Aliyun Dns +- [x] Godaddy +- [x] DNSLA +- [x] Amazon Route53 +- [x] Cloudflare + +## Grafana Dashboard + +Project corresponding Grafana Dashboard ID: [21798](https://grafana.com/grafana/dashboards/21798-cloud-dns-record-info/) + +Overview and Domain Name List: + +![](https://t.eryajf.net/imgs/2024/09/1725288099522.webp) + +List of Analysis Records and Certificate Details: + +![](https://t.eryajf.net/imgs/2024/08/1725118643455.webp) + +## Other instructions + +- If you think the project is good, please make a small gesture ⭐️star⭐️! +- If you have other ideas or needs, please feel free to communicate in the issue! +- New DNS service providers are especially welcome to contribute. The scenarios I encountered are not comprehensive and everyone needs to work together to improve the project. I've put a lot of effort into making it very easy to extend the project with a new module, so go ahead and do it. + +## Donation and Reward + +If you think this project is helpful to you, you can treat the author to a cup of coffee ☕️ + +| Alipay|WeChat| +|:--------: |:--------: | +|![](https://t.eryajf.net/imgs/2023/01/fc21022aadd292ca.png)| ![](https://t.eryajf.net/imgs/2023/01/834f12107ebc432a.png) | diff --git a/README.md b/README.md index 3526932..5e4f546 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[English](./README-en.md) | 简体中文 +

Cloud DNS Exporter

@@ -24,7 +26,7 @@ 这个项目,希望能够让你轻松掌握到每个域名解析的证书信息,从而在更换证书时,不会遗漏任何一个解析。 -支持多种 DNS 提供商(目前支持阿里云,腾讯云,其他更多,期待有缘人PR),且支持单提供商多账号管理。 +支持多种 DNS 提供商,且支持单提供商多账号管理,同时支持自定义配置文件获取证书信息。 ## 如何使用 @@ -135,7 +137,8 @@ record_cert_info{ - [x] Aliyun Dns - [x] Godaddy - [x] DNSLA -- [x] Amazon +- [x] Amazon Route53 +- [x] Cloudflare ## Grafana 仪表板 diff --git a/config.example.yaml b/config.example.yaml index 438fea2..c9b19b3 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -35,4 +35,4 @@ cloud_providers: - name: a1 secretId: "xxxxx" # 注册邮箱 secretKey: "xxxxx" # ApiKey密钥 - # 目前支持Tencent, Aliyun, Godaddy, DNALA, Amazon, CloudFlare,如需支持更多云厂商,请提交 issue,也欢迎 PR + # 目前支持 Tencent, Aliyun, Godaddy, DNALA, Amazon, Cloudflare,如需支持更多云厂商,请提交 issue,也欢迎 PR diff --git a/go.sum b/go.sum index 0615453..b8972dc 100644 --- a/go.sum +++ b/go.sum @@ -59,6 +59,8 @@ github.com/charmbracelet/log v0.2.2 h1:CaXgos+ikGn5tcws5Cw3paQuk9e/8bIwuYGhnkqQF github.com/charmbracelet/log v0.2.2/go.mod h1:Zs11hKpb8l+UyX4y1srwZIGW+MPCXJHIty3MB9l/sno= github.com/clbanning/mxj/v2 v2.5.5 h1:oT81vUeEiQQ/DcHbzSytRngP6Ky9O+L+0Bw0zSJag9E= github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/cloudflare/cloudflare-go v0.103.0 h1:XXKzgXeUbAo7UTtM4T5wuD2bJPBtNZv7TlZAEy5QI4k= +github.com/cloudflare/cloudflare-go v0.103.0/go.mod h1:0DrjT4g8wgYFYIxhlqR8xi8dNWfyHFGilUkU3+XV8h0= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -68,6 +70,8 @@ github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-resty/resty/v2 v2.14.0 h1:/rhkzsAqGQkozwfKS5aFAbb6TyKd3zyFRWcdRXLPCAU= github.com/go-resty/resty/v2 v2.14.0/go.mod h1:IW6mekUOsElt9C7oWr0XRt9BNSD6D5rr9mhk6NjmNHg= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/golang-module/carbon/v2 v2.3.12 h1:VC1DwN1kBwJkh5MjXmTFryjs5g4CWyoM8HAHffZPX/k= github.com/golang-module/carbon/v2 v2.3.12/go.mod h1:HNsedGzXGuNciZImYP2OMnpiwq/vhIstR/vn45ib5cI= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -75,9 +79,12 @@ github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgj github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -254,6 +261,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=