apfree_wifidog/README.md

110 lines
4.5 KiB
Markdown
Raw Normal View History

## Apfree WiFiDog: Efficient captive portal solution
2016-12-02 11:10:03 +08:00
2016-12-16 16:42:26 +08:00
Apfree-WiFidog is an open source captive protal solution for wireless router which with embeddabled linux([LEDE](https://github.com/lede-project/source)/[Openwrt](https://github.com/openwrt/openwrt)).
2016-12-02 11:10:03 +08:00
2016-12-08 16:08:39 +08:00
2017-01-23 14:21:32 +08:00
**[中文介绍](https://github.com/liudf0716/apfree_wifidog/blob/master/README_ZH.md)**
2016-12-01 13:37:09 +08:00
2017-03-23 16:58:31 +08:00
## Features different between original wifidog and us
2016-12-01 13:37:09 +08:00
It has some awesome features:
2016-12-01 11:35:07 +08:00
* *Compatible with original wifodog protocol*. You can seamless migration Apfree WiFidog to connect your auth server if you runned traditional wifidog.
2016-12-01 11:35:31 +08:00
* *HTTPS support*. Not only `HTTP`, Apfree WiFiDog can capture `HTTPS` URL request. It's a big deference between traditional WiFiDog.
2016-12-01 11:34:36 +08:00
* *Efficient performance*. Run shell command `time curl --compressed` to test the Apfree WiFiDog reaction rate, `HTTP` response time is 0.05s and `HTTPS` is about 0.2s.
2016-12-15 14:09:05 +08:00
* *Dynamical bulk loading*. Support MAC address and IP address bulk loading with out restart Apfree WiFiDog.
2016-11-25 11:37:09 +08:00
* *Wide application of business*. Apfree WiFidog has been installed and used in tens of thousands routers from KunTeng.Org and partners. Users have been affirmed, fully embodies the applicability, reliability.
2016-11-25 11:37:09 +08:00
----
2016-11-25 11:37:09 +08:00
## How To Compile
2016-11-25 11:37:09 +08:00
2017-03-23 16:52:56 +08:00
**[基于LEDE编译Apfree_wifidog](https://github.com/liudf0716/apfree_wifidog/wiki/%E5%9F%BA%E4%BA%8ELEDE%E7%BC%96%E8%AF%91Apfree_wifidog)**
Fork and clone the Apfree WiFiDog project:
2016-11-25 11:37:09 +08:00
2017-01-25 16:42:57 +08:00
git clone https://github.com/liudf0716/apfree_wifidog
cd apfree_wifidog
2016-11-25 11:37:09 +08:00
2016-12-16 16:44:34 +08:00
Assuming you have a working [LEDE](https://github.com/lede-project/source)/[Openwrt](https://github.com/openwrt/openwrt) setup, taking `LEDE` as an example and assuming your LEDE root path is `LEDE_ROOT`:
2016-11-25 11:37:09 +08:00
cp -r package/apfree_wifidog/ /LEDE_ROOT/package/
2016-11-25 11:37:09 +08:00
To support `HTTPS`, you need install `libevent` with version 2.1.7 or latest in your LEDE environment, Or using the package copied in Apfree WiFiDog git project:
2016-11-25 11:39:27 +08:00
cp -r package/libevent2/ /LEDE_ROOT/package/libs/
2016-11-25 11:37:09 +08:00
Now Apfree WiFiDog package has been installed in LEDE packages environment.
2016-11-30 13:43:39 +08:00
cd /LEDE_ROOT/
make menuconfig
2016-11-30 13:38:47 +08:00
2017-02-20 11:34:26 +08:00
Chose your `Target System` and `Network -->Captive Portals --> apfree_wifidog`. `SAVE` and `EXIT`.
2016-11-30 13:43:39 +08:00
2016-12-19 11:12:19 +08:00
Do compiling:
```
2017-03-23 16:54:46 +08:00
make package/apfree_wifidog/compile V=s
2016-12-19 11:12:19 +08:00
```
2017-03-23 16:54:46 +08:00
After Doing `make package/apfree_wifidog/compile V=s`, Apfree WiFiDog `ipk` package is packed in path `bin/packages/YOUR-TARGET-ARCH/base/apfree_wifidog_VERSION-RELEASE_YOUR-TARGET-ARCH.ipk `. Push it up into your LEDE-system router, use `opkg install ` command to install this `ipk`.
2016-11-30 13:43:39 +08:00
2016-12-02 11:10:03 +08:00
**The CA-Certificate in this project is ONLY for Apfree WiFiDog HTTPS captive testing, CAN NOT be used for business scene**
2016-11-25 11:37:09 +08:00
2016-12-01 11:34:36 +08:00
--------
## Getting started
After compiling and installing Apfree WiFiDog into your local router, run the `ps | grep wifidog` command. The `ps | grep wifidog` command queries the linux system for information about Apfree WiFiDog.
```
root@lede:~# ps | grep wifidog
1406 root 6532 S /usr/bin/wifidog -c /tmp/wifidog.conf -f -d 0
```
In this example, we can see Apfree WiFiDog has run automatically. This command shows some useful information:
* `/usr/bin/wifidog` is the executable binary daemon program, it's named `wifidog` for compatible.
* `/tmp/wifidog.conf` is the WiFiDog's configuration file that generated by parsing `/etc/config/wifidog`. The `UCI` format file `/etc/config/wifidog` is the main configuration file for user, and it will be used by Apfree WiFidog to generate wifidog reader file `/tmp/wifidog.conf`.
* Using operations of `-c -f -d` for default parameters, and you can get their by running command `wifidog --help`.
The default UCI configuration file like this:
```
config wifidog
option gateway_interface 'br-lan'
option auth_server_hostname 'entrance.yourauth.org'
option auth_server_port '80'
option auth_server_path '/wifidog/'
option check_interval '60'
option client_timeout '72000'
option httpd_max_conn '200'
option pool_mode '1'
option thread_number '5'
option queue_size '20'
option wired_passed '0'
option trusted_domains 'www.baidu.com,www.qq.com,www.qq.com.cn,www.weixin.com'
```
Domains of `www.baidu.com,www.qq.com,www.qq.com.cn,www.weixin.com` is trusted in this default configuration file, and you can modify it to what you want.
2017-01-11 18:07:23 +08:00
### How To Contribute
2017-03-23 16:48:39 +08:00
Feel free to create issues or pull-requests if you have any problems.
2017-01-11 18:07:23 +08:00
2017-03-23 16:48:39 +08:00
**Please read [CONTRIBUTING.md](https://github.com/liudf0716/apfree_wifidog/blob/master/CONTRIBUTING.md) before pushing any changes.**
2017-01-11 18:07:23 +08:00
---
2016-12-19 11:12:19 +08:00