1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-16 18:16:24 -07:00

Set up lua GeoIP handler registration and Cloudflare GeoIP header example plugin

This commit is contained in:
Eggbertx 2024-01-22 16:48:20 -08:00
parent c26b7e9e1d
commit 39908d74c6
4 changed files with 166 additions and 2 deletions

View file

@ -30,8 +30,8 @@ func main() {
fmt.Println("Cleaning up")
gcsql.Close()
gcutil.CloseLog()
gcplugin.ClosePlugins()
geoip.Close()
gcplugin.ClosePlugins()
}()
fmt.Printf("Starting gochan v%s\n", versionStr)
@ -78,7 +78,9 @@ func main() {
parseCommandLine()
serverutil.InitMinifier()
siteCfg := config.GetSiteConfig()
geoip.SetupGeoIP(siteCfg.GeoIPType, siteCfg.GeoIPOptions)
if err = geoip.SetupGeoIP(siteCfg.GeoIPType, siteCfg.GeoIPOptions); err != nil {
gcutil.LogFatal().Err(err).Msg("Unable to initialize GeoIP")
}
posting.InitCaptcha()
if err = gctemplates.InitTemplates(); err != nil {