davidaparicio/namecheck

GitHub: davidaparicio/namecheck

Namecheck 是一个用 Go 编写的 CLI 和服务器,用于一次性检查用户名在 GitHub、GitLab、Reddit、Bluesky 等多个平台上的可用性。

Stars: 1 | Forks: 5

# Namecheck

Namecheck logo

[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://pkg.go.dev/github.com/davidaparicio/namecheck) [![Go Report Card](https://goreportcard.com/badge/davidaparicio/namecheck)](https://goreportcard.com/report/davidaparicio/namecheck) [![codecov](https://codecov.io/gh/davidaparicio/namecheck/branch/main/graph/badge.svg?token=VYP4LAODQ6)](https://codecov.io/gh/davidaparicio/namecheck) [![build](https://static.pigsec.cn/wp-content/uploads/repos/cas/3f/3f9eb1c7b09ab5963d1f089030ee8c12d07cb1214cd221fdcb4e7bbfbcc40b8a.svg)](https://github.com/davidaparicio/namecheck/actions/workflows/goreleaser.yml) [![Github](https://img.shields.io/static/v1?label=github&logo=github&color=E24329&message=main&style=flat-square)](https://github.com/davidaparicio/namecheck) [![GitLab](https://img.shields.io/static/v1?label=gitlab&logo=gitlab&color=green&message=mirrored&style=flat-square)](https://gitlab.com/davidaparicio/namecheck) [![Froggit](https://img.shields.io/static/v1?label=froggit&logo=froggit&color=red&message=no&style=flat-square)](https://lab.frogg.it/davidaparicio/namecheck) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=davidaparicio_namecheck&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=davidaparicio_namecheck) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=davidaparicio_namecheck&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=davidaparicio_namecheck) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/davidaparicio/namecheck/blob/main/LICENSE.md) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdavidaparicio%2Fnamecheck.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdavidaparicio%2Fnamecheck?ref=badge_shield) [![Maintenance](https://img.shields.io/maintenance/yes/2023.svg)]() [![Twitter](https://img.shields.io/twitter/follow/dadideo.svg?style=social)](https://twitter.com/intent/follow?screen_name=dadideo) ## 概述 一个简单的 CLI 和服务器,用于检查名称在 GitHub、GitLab、Reddit、Bluesky、Mastodon 和 Hacker News 等多个网站上的可用性。 ### 支持的网站 | 网站 | 检查方式 | |---|---| | GitHub | 当用户名可用时,`https://github.com/` 返回 404 | | GitLab | 公开的 REST API `https://gitlab.com/api/v4/users?username=` 在用户名可用时返回 `[]` | | Reddit | 当用户名可用时,`https://www.reddit.com/user//about.json` 返回 404 | | Bluesky | 公开的 AT Protocol API `com.atproto.identity.resolveHandle` 在 handle `.bsky.social` 可用时返回 400 | | Mastodon | 公开的 REST API `https://mastodon.social/api/v1/accounts/lookup?acct=` 在(`mastodon.social` 实例上的)用户名可用时返回 404 | | Hacker News | 官方的 Firebase API `https://hacker-news.firebaseio.com/v0/user/.json` 在用户名可用时返回 `null` | | Tinder | 抓取个人资料页面(`https://tinder.com/@`) | | Twitter | 通过 GCP Cloud Function 模拟(详见下文说明) | | Instagram | 抓取个人资料页面(默认禁用) | Namecheck diagram 来源:https://gitdiagram.com/davidaparicio/namecheck ## 如何使用 如果你的笔记本电脑上已经安装了 ```Docker``` ```docker run davidaparicio/namecheck: ``` 如果未安装,你需要 ```Go``` 以及所有依赖项 ```go run cmd/cli/main.go ``` 或者通过以下命令运行服务器 ```go run cmd/server/main.go``` 并使用 curl 命令进行检查 ```curl http://localhost:8080/check?username=``` 了解更多信息,你可以查看[这里的示例](EXAMPLES.md) ## 备注 Twitter 检查器使用了 GCP Cloud Function,添加了网络延迟模拟功能,可通过参数进行配置。 服务器处理超时的方式采纳了 [Filippo Valsorda](https://github.com/FiloSottile) 在 Cloudflare 博客上的建议([文章 1 ](https://blog.cloudflare.com/the-complete-guide-to-golang-net-http-timeouts/)/[ 文章 2](https://blog.cloudflare.com/exposing-go-on-the-internet/))以及 [Ilija Eftimov](https://ieftimov.com/posts/make-resilient-golang-net-http-servers-using-timeouts-deadlines-context-cancellation/) 的建议。 关于使用 `gorilla/mux` 的 [ADR](https://github.blog/2020-08-13-why-write-adrs/)(架构决策记录)可以在[这里](https://www.alexedwards.net/blog/which-go-router-should-i-use)找到。 ## 代码覆盖率 ![coverage](https://codecov.io/gh/davidaparicio/namecheck/branch/main/graphs/sunburst.svg?token=VYP4LAODQ6) ## 原始项目 Fork 自 [@jub0bs](https://github.com/jub0bs/) 的开源项目,可在 GitHub 上查看 [https://github.com/jub0bs/namecheck](https://github.com/jub0bs/namecheck)。 ## 许可证 基于 MIT 许可证第 2.0 版(“许可证”)授权。除非遵守该许可证,否则你不得使用此文件。 你可以从[这里](https://choosealicense.com/licenses/mit/)获取许可证副本。 如果需要帮助,这里有 [FOSSA 的“许可证 101”](https://fossa.com/blog/open-source-licenses-101-mit-license/)、关于 MIT 许可证的 [Snyk 说明](https://snyk.io/learn/what-is-mit-license/) ,以及 [Jean-Michael Legait](https://twitter.com/jmlegait) 关于许可证的[法语会议演讲](https://www.youtube.com/watch?v=8WwTe0vLhgc)。 [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdavidaparicio%2Fnamecheck.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdavidaparicio%2Fnamecheck?ref=badge_large)
标签:EVTX分析, Golang, Web服务, 安全编程, 日志审计, 用户名查询, 社交媒体, 请求拦截