From 9029163c4065b317b97ab6969d27b64d9126667a Mon Sep 17 00:00:00 2001 From: Eggbertx Date: Tue, 5 Mar 2024 22:09:14 -0800 Subject: [PATCH] Update configuration documentation with GeoIP and fingerprinting --- config.md | 29 ++++++++++++++++++++++++++++ examples/configs/gochan.example.json | 6 ++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/config.md b/config.md index 309db045..8c3ff36a 100644 --- a/config.md +++ b/config.md @@ -23,6 +23,35 @@ Valid `DBtype` values are "mysql" and "postgres" (sqlite3 is no longer supported * `SiteDomain` is used for links throughout the site. * `WebRoot` is used as the prefix for boards, files, and pretty much everything on the site. If it isn't set, "/" will be used. +## GeoIP/Flag configuration +* `EnableGeoIP` specifies whether or not GeoIP will be used. It can be set in the global configuration file or in a board configuration. +* `GeoIPType` specifies the GeoIP handler. If it is blank or unset, GeoIP will not be used. Gochan has built-in support for MaxMind GeoIP2/GeoLite2 databases by setting the value to "mmdb", "geoip2", or "geolite2". +* `GeoIPOptions` is an object with keys and values for configuring the specified GeoIP handler. Not all GeoIP receivers may need it. Example: +```JSONC +"GeoIPType": "mmdb", +"GeoIPOptions": { + "dbLocation": "/usr/share/geoip/GeoIP2.mmdb", + "isoCode": "en" // optional +} +``` +* `CustomFlags` is an array with custom flags, selectable via dropdown. The `Flag` value is assumed to be in /static/flags/. Example: +```JSON +"CustomFlags": [ + {"Flag":"california.png", "Name": "California"}, + {"Flag":"cia.png", "Name": "CIA"}, + {"Flag":"lgbtq.png", "Name": "LGBTQ"}, + {"Flag":"ms-dos.png", "Name": "MS-DOS"}, + {"Flag":"stallman.png", "Name": "Stallman"}, + {"Flag":"templeos.png", "Name": "TempleOS"}, + {"Flag":"tux.png", "Name": "Linux"}, + {"Flag":"windows9x.png", "Name": "Windows 9x"} +] +``` +* `EnableNoFlag` is only relevant if another flag option is used, and allows the user to not have a flag shown on their post on a flag board. + +## Fingerprinting configuration +By default, only images are fingerprinted, but if `FingerprintVideoThumbnails` is set to true, the thumbnails of videos will also be checked. + ## Styles * `Styles` is an array, with each element representing a theme selectable by the user from the frontend settings screen. Each element should have `Name` string value and a `Filename` string value. Example: ```JSON diff --git a/examples/configs/gochan.example.json b/examples/configs/gochan.example.json index 057a3d8c..b07c1972 100644 --- a/examples/configs/gochan.example.json +++ b/examples/configs/gochan.example.json @@ -28,6 +28,7 @@ "SiteSlogan": "", "SiteDomain": "127.0.0.1", "WebRoot": "/", + "FingerprintVideoThumbnails": false, "Styles": [ { "Name": "Pipes", "Filename": "pipes.css" }, @@ -91,6 +92,7 @@ ], "BanMessage": "USER WAS BANNED FOR THIS POST", "EnableEmbeds": true, + "EnableNoFlag": true, "EmbedWidth": 200, "EmbedHeight": 164, "ImagesOpenNewTab": true, @@ -106,8 +108,8 @@ "SiteKey": "your site key goes here (if you want a captcha, make sure to replace '_Captcha' with 'Captcha'", "AccountSecret": "your account secret key goes here" }, - "_GeoIPType": "mmdb", - "_GeoIPOptions": { + "GeoIPType": "mmdb", + "GeoIPOptions": { "dbLocation": "/usr/share/geoip/GeoIP2.mmdb", "isoCode": "en" },