{"id":18972020,"url":"https://github.com/gralliry/wifidog-authserver-gin","last_synced_at":"2026-04-28T17:02:30.060Z","repository":{"id":257283753,"uuid":"857621336","full_name":"gralliry/Wifidog-AuthServer-Gin","owner":"gralliry","description":"基于openwrt软路由系统中，软件包wifidog的认证服务器实现","archived":false,"fork":false,"pushed_at":"2025-02-22T19:08:53.000Z","size":20048,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T05:40:07.455Z","etag":null,"topics":["authserver","gin","go","golang","openwrt","wifidog"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gralliry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-15T06:31:11.000Z","updated_at":"2025-02-22T19:08:57.000Z","dependencies_parsed_at":"2025-01-11T11:23:24.275Z","dependency_job_id":"7cd15f56-9830-4f30-af9c-4fedb06b32a8","html_url":"https://github.com/gralliry/Wifidog-AuthServer-Gin","commit_stats":null,"previous_names":["gralliry/wifidog-server-gin"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gralliry/Wifidog-AuthServer-Gin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gralliry%2FWifidog-AuthServer-Gin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gralliry%2FWifidog-AuthServer-Gin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gralliry%2FWifidog-AuthServer-Gin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gralliry%2FWifidog-AuthServer-Gin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gralliry","download_url":"https://codeload.github.com/gralliry/Wifidog-AuthServer-Gin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gralliry%2FWifidog-AuthServer-Gin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32390067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authserver","gin","go","golang","openwrt","wifidog"],"created_at":"2024-11-08T15:06:15.459Z","updated_at":"2026-04-28T17:02:30.044Z","avatar_url":"https://github.com/gralliry.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wifidog-Server-Gin\n\n## 描述\n\n本项目是基于openwrt软路由系统中，软件包`wifidog` `luci-app-wifidog`的认证服务器实现\n\n## 安装\n\n```shell\ngit clone https://github.com/gralliry/Wifidog-Server-Gin.git\ncd Wifidog-Server-Gin\n\n# GOOS和GOARCH对应关系：https://freshman.tech/snippets/go/cross-compile-go-programs/\n# gin运行模式：debug | release | test\n```\n\n### Linux\n\n```shell\nenv GOOS=linux GOARCH=amd64 GIN_MODE=debug go build -o out/authserver\n```\n\n### windows\n\n```shell\nset GOOS=windows\nset GOARCH=amd64\nset GIN_MODE=debug\ngo build -o out/authserver.exe\n```\n### darwin(MacOS)\n\n```shell\nenv GOOS=darwin GOARCH=amd64 GIN_MODE=debug go build -o out/authserver\n```\n\n### openwrt(linux-mipsel)\n\n```shell\nenv GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -ldflags=\"-s -w\" -o out/authserver\n```\n\n## 使用\n\n打开`openwrt`的`服务`-\u003e`wifodog配置`\n\n有几项需要与`config.toml`中对应：\n\n* `ListenHost`对应`认证服务器：主机名`\n* `ListenPort`对应`认证服务器：web服务端口` (注意在`config.toml`中是字符串)\n\n然后执行以下\n```shell\nsqlite3 ./data/database.db\n```\n```sqlite\n-- `通用配置`-\u003e`设备ID`(一般是路由器mac地址，对应上你wifidog的配置页面内容即可)\nINSERT INTO net(sid, address, port)\nVALUES ('设备ID', '认证服务器：主机名', '认证服务器：web服务端口')\n```\n\n打开`认证服务器配置`：\n\n* `认证服务器：url路径` -\u003e `/wifidog/`\n* `服务器login接口脚本url路径段` -\u003e `login/?`\n* `服务器portal接口脚本url路径段` -\u003e `portal/?`\n* `服务器ping接口脚本url路径段` -\u003e `ping/?`\n* `服务器auth接口脚本url路径段` -\u003e `auth/?`\n* `服务器消息接口脚本url路径段` -\u003e `gw_message.php?`\n\n注意：在`config.toml`不需要添加`?`\n\n## 作者留言\n\n如果是路由器本身作为认证服务器，极力建议使用可执行文件（而不是使用go命令运行源码，其环境和程序占用都过大）\n\n```shell\n./out/authserver\n```\n\n如果路由器存在go语言环境，你也可以直接运行源码\n\n```shell\ngo run ./main.go\n```\n\n## 问题\n\n部分存在无法编译的问题可能是因为缺少对应的gcc库，尤其是对于openwrt中linux-mipsel架构\n\n使用官方的sqlite3驱动是依赖CGO的，不适合低存储低内存的场景，这里使用了其他的sqlite驱动，但是该驱动并不支持`mipsel`的架构\n\n目前作者在寻找适配的、能快速部署的gcc编译器和sqlite驱动，如果你有好的想法可以在issue中提出建议，作者会一一回复\n\nnginx不要设置强制ssl，不然会发生301重定向，导致wifidog无法获取直接返回的结果","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgralliry%2Fwifidog-authserver-gin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgralliry%2Fwifidog-authserver-gin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgralliry%2Fwifidog-authserver-gin/lists"}