|
@@ -14,6 +14,7 @@ import (
|
|
|
"imuslab.com/arozos/ReverseProxy/mod/auth"
|
|
|
"imuslab.com/arozos/ReverseProxy/mod/database"
|
|
|
"imuslab.com/arozos/ReverseProxy/mod/dynamicproxy/redirection"
|
|
|
+ "imuslab.com/arozos/ReverseProxy/mod/geodb"
|
|
|
"imuslab.com/arozos/ReverseProxy/mod/tlscert"
|
|
|
)
|
|
|
|
|
@@ -23,13 +24,14 @@ var showver = flag.Bool("version", false, "Show version of this server")
|
|
|
|
|
|
var (
|
|
|
name = "Zoraxy"
|
|
|
- version = "2.0"
|
|
|
+ version = "2.1"
|
|
|
|
|
|
handler *aroz.ArozHandler
|
|
|
sysdb *database.Database
|
|
|
authAgent *auth.AuthAgent
|
|
|
tlsCertManager *tlscert.Manager
|
|
|
redirectTable *redirection.RuleTable
|
|
|
+ geodbStore *geodb.Store
|
|
|
)
|
|
|
|
|
|
// Kill signal handler. Do something before the system the core terminate.
|
|
@@ -82,7 +84,6 @@ func main() {
|
|
|
if err != nil {
|
|
|
log.Fatal(err)
|
|
|
}
|
|
|
-
|
|
|
authAgent = auth.NewAuthenticationAgent(name, []byte(sessionKey), sysdb, true, func(w http.ResponseWriter, r *http.Request) {
|
|
|
//Not logged in. Redirecting to login page
|
|
|
http.Redirect(w, r, "/login.html", http.StatusTemporaryRedirect)
|
|
@@ -100,6 +101,12 @@ func main() {
|
|
|
panic(err)
|
|
|
}
|
|
|
|
|
|
+ //Create a geodb store
|
|
|
+ geodbStore, err = geodb.NewGeoDb(sysdb, "./system/GeoLite2-Country.mmdb")
|
|
|
+ if err != nil {
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+
|
|
|
//Initiate management interface APIs
|
|
|
initAPIs()
|
|
|
|