-
132 | <%
133 | for _, d in ipairs(gapps_domains) do
134 | write(""
135 | % {d, d})
136 | end
137 | %>
138 |
├── .gitignore ├── Makefile ├── Makefile_build_standalone ├── README.md ├── dist └── etc │ └── config │ └── kikiauth └── luasrc ├── controller └── kikiauth │ ├── admin.lua │ └── authserver.lua ├── model └── cbi │ └── kikiauth-admin │ ├── services.lua │ └── status.lua └── view └── kikiauth ├── auth.htm ├── facebookcallback.htm ├── gatewaymessage.htm ├── googlecallback.htm └── login.htm /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | Makefile 3 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | include ../../build/config.mk 2 | include ../../build/module.mk -------------------------------------------------------------------------------- /Makefile_build_standalone: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2009 3 | # 4 | # This is free software, licensed under the Apache License, Version 2.0 . 5 | # 6 | 7 | include $(TOPDIR)/rules.mk 8 | 9 | PKG_NAME:=luci-app-kikiauth 10 | PKG_RELEASE:=1 11 | 12 | include $(INCLUDE_DIR)/package.mk 13 | 14 | define Package/$(PKG_NAME) 15 | SECTION:=luci 16 | CATEGORY:=LuCI 17 | SUBMENU:=3rd Party 18 | TITLE:=Splash login with OAuth 19 | DEPENDS:=luci-lib-json wget wifidog 20 | endef 21 | 22 | define Package/$(PKG_NAME)/description 23 | Auth server for WifiDog, provide external OAuth login method. 24 | endef 25 | 26 | define Build/Prepare 27 | for d in luasrc root; do \ 28 | if [ -d ./$$$$d ]; then \ 29 | mkdir -p $(PKG_BUILD_DIR)/$$$$d; \ 30 | $(CP) ./$$$$d/* $(PKG_BUILD_DIR)/$$$$d/; \ 31 | fi; \ 32 | done 33 | endef 34 | 35 | define Build/Configure 36 | endef 37 | 38 | define Build/Compile 39 | endef 40 | 41 | HTDOCS = /www 42 | LUA_LIBRARYDIR = /usr/lib/lua 43 | LUCI_LIBRARYDIR = $(LUA_LIBRARYDIR)/luci 44 | 45 | define Package/$(PKG_NAME)/install 46 | if [ -d $(PKG_BUILD_DIR)/luasrc ]; then \ 47 | $(INSTALL_DIR) $(1)$(LUCI_LIBRARYDIR); \ 48 | cp -pR $(PKG_BUILD_DIR)/luasrc/* $(1)$(LUCI_LIBRARYDIR)/; \ 49 | else true; fi 50 | if [ -d $(PKG_BUILD_DIR)/htdocs ]; then \ 51 | $(INSTALL_DIR) $(1)$(HTDOCS); \ 52 | cp -pR $(PKG_BUILD_DIR)/htdocs/* $(1)$(HTDOCS)/; \ 53 | else true; fi 54 | if [ -d $(PKG_BUILD_DIR)/root ]; then \ 55 | $(INSTALL_DIR) $(1)/; \ 56 | cp -pR $(PKG_BUILD_DIR)/root/* $(1)/; \ 57 | else true; fi 58 | endef 59 | 60 | $(eval $(call BuildPackage,$(PKG_NAME))) 61 | 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | KikiAuth 2 | ======== 3 | 4 | KikiAuth is based on LuCI, providing an alternative to Auth Server for WifiDog. 5 | KikiAuth aims to support authentication via OAuth services (Google, Facebook, Twitter...) only and run on the same box as WifiDog (no need to setup a separated machine for authentication). 6 | 7 | Important note 8 | -------------- 9 | 10 | The project is halted, because of these obstacles: 11 | 12 | - Entire Facebook website is on HTTPS. It means that if we let user to login to Facebook, we have to open all traffic to Facebook website. It means that even before logging in our splash screen, user still can use Facebook, Google. These sites are open to allow OAuth login. 13 | 14 | - The firewall open the traffic based on destination IP address, not domain. It means that we have to find all IP addresses of facebook.com and other Facebook owned domains. But due to Facebook's load balancing mechanism, each time we query, the DNS returns a different set of IP addresses. The set of IP address also become invalid after a while, and come back valid after another time. 15 | 16 | - Facebook doesn't use only facebook.com. It also uses various domains for other resource (JS, CSS). These are also not fixed and can be changed any time. 17 | 18 | I can only have workaround for the second issue, by making the router to periodically retrieve new IP addresses for a set of known domain. But still, the overall is not reliable. 19 | 20 | Build 21 | ----- 22 | 23 | You must have a copy of LuCI source tree (luci-0.10). 24 | Copy KikiAuth folder to luci-0.10/applications. 25 | 26 | Run 27 | 28 | make runhttpd 29 | 30 | to compile. 31 | 32 | Build ipk package 33 | ----- 34 | 35 | - Copy the folder to openwrt/package (source tree) 36 | - Rename Makefile_build_standalone to Makefile (replace the old Makefile) 37 | - Rename "dist" folder to "root" 38 | - Choose the luci-app-kikiauth in `make menuconfig`. 39 | - Run `make package/luci-app-kikiauth/compile V=99` to build. 40 | -------------------------------------------------------------------------------- /dist/etc/config/kikiauth: -------------------------------------------------------------------------------- 1 | 2 | config 'oauth_services' 'facebook' 3 | option 'enabled' '1' 4 | option 'app_id' '420756987974770' 5 | option 'redirect_uri' 'http://openwrt.lan/cgi-bin/luci/kikiauth/oauth/facebookcallback' 6 | list 'googleapps' 'mbm.vn' 7 | list 'googleapps' 'pfiev.net' 8 | list 'ips' 'www-slb-10-01-prn1.facebook.com', 9 | list 'ips' 'www-slb-11-12-prn1.facebook.com', 10 | list 'ips' 's-static.ak.fbcdn.net' 11 | 12 | config 'oauth_services' 'google' 13 | option 'enabled' '1' 14 | option 'app_id' '396818136722.apps.googleusercontent.com' 15 | option 'redirect_uri' 'https://kikiauth.appspot.com/google' 16 | list 'ips' 'accounts.l.google.com' 17 | list 'ips' 'accounts-cctld.l.google.com' 18 | list 'ips' 'clients.l.google.com' 19 | list 'ips' 'googlehosted.l.googleusercontent.com' 20 | list 'ips' 'ssl.gstatic.com' 21 | list 'ips' 'kikiauth.appspot.com' 22 | 23 | config 'oauth_services' 'twitter' 24 | 25 | config 'success_page' 'oauth_success_page' 26 | option 'success_text' '