GithubHelp home page GithubHelp logo

igit-cn / apfree_wifidog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liudf0716/apfree-wifidog

0.0 1.0 0.0 2.47 MB

ApFree WiFiDog is a high efficient captive portal solution for wireless router based on LEDE/Openwrt.

License: GNU General Public License v3.0

CMake 7.26% HTML 4.86% Makefile 0.47% Shell 1.74% C 85.66%

apfree_wifidog's Introduction

ApFreeWiFiDog

license PRs Welcome Issue Welcome Release Version OpenWRT KunTeng

Apfree WiFiDog: More efficient captive portal solution

Apfree-WiFidog is an open source captive portal solution for wireless router which with embeddable Linux(LEDE/Openwrt).

中文介绍

Enhancement of apfree-wifidog

In fact, the title should be why we choose apfree-wifidog, the reason was the following:

Stable

apfree-wifidog was widely used in tens of thousands device, which were running in business scene. In order to improve its stable, we rewrite all iptables rule by api instead of fork call, which will easily cause deadlock in multithread-fork running environment

Efficent

apfree-wifidog's http request-response is more quick, u can find statistic data in our test document

More features

apfree-wifidog support https redirect, mac temporary-pass, ip,domain,pan-domain,white-mac,black-mac rule and etc. all these rules can be applied without restarting wifidog

Compitable with wifidog authentication server

u don't need to modify your wifidog authentication server to adapt apfree-wifidog


How to added apfree-wifidog into Openwrt package

cd your_openwrt_sdk_dir
mkdir -p packages/net/apfree-wifidog
cp -r apfree_wifidog_openwrt/* packages/net/apfree-wifidog
make menuconfig
select apfree-wifidog

Please go to package_apfree_wifidoghttps://github.com/KunTengRom/package_apfree_wifidog


Getting started

before starting apfree-wifidog, we must know how to configure it. apfree-wifidog use OpenWrt standard uci config system, all your apfree-wifidog configure information stored in /etc/confg/wifidogx, which will be parsed by /etc/init.d/wifidogx to /tmp/wifidog.conf, apfree-wifidog's real configure file is /tmp/wifidog.conf

The default apfree-wifidog UCI configuration file like this:

config wifidog
    option  gateway_interface   'br-lan'
    option  auth_server_hostname    'wifidog.kunteng.org.cn'
    option  auth_server_port    443
    option  auth_server_path    '/wifidog/'
    option  check_interval      60
    option  client_timeout      5
    option  apple_cna           1
    option  thread_number       5
    option  wired_passed        0
    option  enable      0

auth_server_hostname was apfree-wifidog auth server, it can be domain or ip; wifidog.kunteng.org.cn is a free auth server we provided, it was also open source

apple_cna 1 apple captive detect deceive; 2 apple captive detect deceive to disallow portal page appear

wired_passed means whether LAN access devices need to auth or not, value 1 means no need to auth

enable means whether start apfree-wifidog when we executed /etc/init.d/wifidogx start, if u wanted to start apfree-wifidog, you must set enable to 1 before executing /etc/init.d/wifidogx start

How to support https redirect

In order to support https redirect, apfree-wifidog need x509 pem cert and private key, u can generate youself like this:

PX5G_BIN="/usr/sbin/px5g"
OPENSSL_BIN="/usr/bin/openssl"
APFREE_CERT="/etc/apfree.crt"
APFREE_KEY="/etc/apfree.key"

generate_keys() {
    local days bits country state location commonname

    # Prefer px5g for certificate generation (existence evaluated last)
    local GENKEY_CMD=""
    local UNIQUEID=$(dd if=/dev/urandom bs=1 count=4 | hexdump -e '1/1 "%02x"')
    [ -x "$OPENSSL_BIN" ] && GENKEY_CMD="$OPENSSL_BIN req -x509 -sha256 -outform pem -nodes"
    [ -x "$PX5G_BIN" ] && GENKEY_CMD="$PX5G_BIN selfsigned -pem"
    [ -n "$GENKEY_CMD" ] && {
        $GENKEY_CMD \
            -days ${days:-730} -newkey rsa:${bits:-2048} -keyout "${APFREE_KEY}.new" -out "${APFREE_CERT}.new" \
            -subj /C="${country:-CN}"/ST="${state:-localhost}"/L="${location:-Unknown}"/O="${commonname:-ApFreeWiFidog}$UNIQUEID"/CN="${commonname:-ApFreeWiFidog}"
        sync
        mv "${APFREE_KEY}.new" "${APFREE_KEY}"
        mv "${APFREE_CERT}.new" "${APFREE_CERT}"
    }
}

or when u start /etc/init.d/wifidogx start, it will generate it automatically

Attention! when apfree-wifidog redirect https request, u will receive certificate file is illegal warning, no need to panic, it's normal response

apfree-wifidog Auth server open source project

apfree wifidog's official auth server is wwas, which support wfc pay and weixin auth-mode and more auth-way will be support.

demo pic

demo video

http://www.iqiyi.com/w_19s09zie6t.html

More auth server please read AUTHSERVER.md

How To Contribute

Feel free to create issues or pull-requests if you have any problems.

Please read CONTRIBUTING.md before pushing any changes.

contact us

QQ group: 331230369 telegram: apfreewifidog

donate

wfc: weiKbu9DYg26gH2zucSHJHgH5KsuuZd3wW


apfree_wifidog's People

Contributors

caizhibang avatar cooboyno111 avatar easyteacher avatar echowxsy avatar fenggui321 avatar gigibox avatar heartache1987 avatar kerwinkoo avatar landrash avatar liudf0716 avatar pedrycz avatar ruichen1113 avatar sherronburtint avatar tea4go avatar tianmax avatar wangyin2016 avatar zenghi avatar zjh809 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.