mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-26 00:21:54 +08:00
feat(ipinfo): support GeoIP (#26)
Co-authored-by: E99p1ant <[email protected]>
This commit is contained in:
+16
-14
@@ -1,6 +1,7 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/li4n0/revsuit/internal/ipinfo"
|
||||
"github.com/li4n0/revsuit/pkg/dns"
|
||||
"github.com/li4n0/revsuit/pkg/ftp"
|
||||
"github.com/li4n0/revsuit/pkg/mysql"
|
||||
@@ -16,18 +17,19 @@ type noticeConfig struct {
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Version float64
|
||||
Addr string
|
||||
Token string
|
||||
Domain string
|
||||
ExternalIP string `yaml:"external_ip"`
|
||||
AdminPathPrefix string `yaml:"admin_path_prefix"`
|
||||
Database string
|
||||
LogLevel string `yaml:"log_level"`
|
||||
Notice noticeConfig
|
||||
HTTP rhttp.Config
|
||||
DNS dns.Config
|
||||
MySQL mysql.Config
|
||||
RMI rmi.Config
|
||||
FTP ftp.Config
|
||||
Version float64
|
||||
Addr string
|
||||
Token string
|
||||
Domain string
|
||||
ExternalIP string `yaml:"external_ip"`
|
||||
AdminPathPrefix string `yaml:"admin_path_prefix"`
|
||||
Database string
|
||||
LogLevel string `yaml:"log_level"`
|
||||
IpLocationDatabase ipinfo.Config `yaml:"ip_location_database"`
|
||||
Notice noticeConfig
|
||||
HTTP rhttp.Config
|
||||
DNS dns.Config
|
||||
MySQL mysql.Config
|
||||
RMI rmi.Config
|
||||
FTP ftp.Config
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/li4n0/revsuit/internal/database"
|
||||
"github.com/li4n0/revsuit/internal/file"
|
||||
"github.com/li4n0/revsuit/internal/ipinfo"
|
||||
"github.com/li4n0/revsuit/internal/notice"
|
||||
"github.com/li4n0/revsuit/internal/record"
|
||||
"github.com/li4n0/revsuit/pkg/dns"
|
||||
@@ -178,6 +179,7 @@ func New(c *Config) *Revsuit {
|
||||
|
||||
initDatabase(c.Database)
|
||||
logLevel := initLog(c.LogLevel)
|
||||
ipinfo.Init(c.IpLocationDatabase)
|
||||
initNotice(c.Notice)
|
||||
|
||||
s := &Revsuit{
|
||||
|
||||
Reference in New Issue
Block a user