Skip to content

Instantly share code, notes, and snippets.

@kukat
Last active February 18, 2017 12:51
Show Gist options
  • Save kukat/b21ce86abfcc51af1f0c to your computer and use it in GitHub Desktop.
Save kukat/b21ce86abfcc51af1f0c to your computer and use it in GitHub Desktop.
WifiDog + AuthPuppy

WifiDog + AuthPuppy

  • 路由器固件: OpenWRT/DDWRT
  • Gateway: WifiDog
  • Auth Server: AuthPuppy

每个路由器就是一个节点(node)

AuthPuppy 的安装

  • 下载 AuthPuppy 源码包 https://launchpad.net/authpuppy
  • 解压 tar zxvf authpuppy-1.0.0-stable.tgz
  • 移动到网站目录 mv authpuppy /var/www/
  • 修改文件所有者以免出现权限问题报错 chown -R www-data:www-data /var/www/authpuppy
  • 创建 MySQL 数据库(略)
  • 创建 Apache/Nginx 虚拟主机
    • 网站路径:/var/www/authpuppy/web
    • 绑定域名:auth.blackmagic.science
    • 启用 url rewrite
  • 打开 http://auth.blackmagic.science 执行 AuthPuppy 安装程序

添加新节点

登录 AuthPuppy 管理平台,新建节点

  • Name: 这个节点的名称,可以随意。比如 Gateway 01

  • gw id: gateway id,比如 GW01 对应 wifidog 里的配置

  • Deployment status: deployed

    (其他可选填)

路由器上的设置

安装 wifidog

  • OpenWRT: opkg install wifidog
  • DDWRT: (已经内置预装了)

配置 wifidog

编辑 etc/wifidog.conf, 需要修改两个地方

  • GatewayID GW01
  • AuthServer
AuthServer {
    Hostname auth.blackmagic.science
    SSLAvailable no
    Path /
}

启用 wifidog

  • /etc/init.d/wifidog enable
  • /etc/init.d/wifidog start

TODOs

  • AuthPuppy 和 现有用户系统的整合
  • 认证页面的美化
  • 白名单
@cqllzp
Copy link

cqllzp commented Dec 23, 2016

@aleen42
需要在nginx.conf里面添加
location / {
try_files $uri $uri/ /index.php?$query_string;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment