Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved chat filtering + rate limiting #201

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions assets/assets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package assets

import _ "embed"

//go:embed lobbySettingsData.json
var LobbySettingsJSON []byte

//go:embed geoip.mmdb
var GeoIPDB []byte
13 changes: 0 additions & 13 deletions build_assets.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,3 @@ function download_assets {
if [ ! -f assets/geoip.mmdb ]; then
download_assets
fi

if [ "$1" = "production" ]; then
echo "Compiling assets"
go-bindata -nomemcopy -ignore="bindata\.go" \
-pkg assets \
-o assets/bindata.go assets/{geoip.mmdb,lobbySettingsData.json}
else
echo "Compiling assets (debug)"
go-bindata -debug -ignore="bindata\.go" \
-pkg assets \
-o assets/bindata.go assets/{geoip.mmdb,lobbySettingsData.json}

fi
28 changes: 15 additions & 13 deletions config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
"os"
"reflect"
"text/template"
"time"

"github.com/sirupsen/logrus"
"github.com/kelseyhightower/envconfig"
"github.com/sirupsen/logrus"
)

var (
Expand Down Expand Up @@ -51,18 +52,19 @@ type constants struct {

ProfilerAddr string `envconfig:"PROFILER_ADDR" doc:"Address to serve the web-based profiler over"`

SlackbotURL string `envconfig:"SLACK_URL" doc:"Slack webhook URL"`
SentryDSN string `envconfig:"SENTRY_DSN" doc:"Sentry DSN"`
DiscordToken string `envconfig:"DISCORD_TOKEN" doc:"Discord Token"`
DiscordGuildId string `envconfig:"DISCORD_GUILD_ID" doc:"Discord Guild ID"`
Environment string `envconfig:"DEPLOYED_ENV" default:"development" doc:"Deployment environment"`
TwitchClientID string `envconfig:"TWITCH_CLIENT_ID" doc:"Twitch API Client ID"`
TwitchClientSecret string `envconfig:"TWITCH_CLIENT_SECRET" doc:"Twitch API Client Secret"`
ServemeAPIKey string `envconfig:"SERVEME_API_KEY" doc:"serveme.tf API Key"`
HealthChecks bool `envconfig:"HEALTH_CHECKS" default:"false" doc:"Enable health checks"`
SecureCookies bool `envconfig:"SECURE_COOKIE" doc:"Enable 'secure' flag on cookies" default:"false"`
FilteredWords []string `envconfig:"FILTERED_WORDS"`
DemosFolder string `envconfig:"DEMOS_FOLDER" doc:"Folder to store STV demos in" default:"demos"`
SlackbotURL string `envconfig:"SLACK_URL" doc:"Slack webhook URL"`
SentryDSN string `envconfig:"SENTRY_DSN" doc:"Sentry DSN"`
DiscordToken string `envconfig:"DISCORD_TOKEN" doc:"Discord Token"`
DiscordGuildId string `envconfig:"DISCORD_GUILD_ID" doc:"Discord Guild ID"`
Environment string `envconfig:"DEPLOYED_ENV" default:"development" doc:"Deployment environment"`
TwitchClientID string `envconfig:"TWITCH_CLIENT_ID" doc:"Twitch API Client ID"`
TwitchClientSecret string `envconfig:"TWITCH_CLIENT_SECRET" doc:"Twitch API Client Secret"`
ServemeAPIKey string `envconfig:"SERVEME_API_KEY" doc:"serveme.tf API Key"`
HealthChecks bool `envconfig:"HEALTH_CHECKS" default:"false" doc:"Enable health checks"`
SecureCookies bool `envconfig:"SECURE_COOKIE" doc:"Enable 'secure' flag on cookies" default:"false"`
FilteredWords []string `envconfig:"FILTERED_WORDS"`
ChatRateLimit time.Duration `envconfig:"CHAT_RATE_LIMIT"`
DemosFolder string `envconfig:"DEMOS_FOLDER" doc:"Folder to store STV demos in" default:"demos"`
}

var Constants = constants{}
Expand Down
63 changes: 0 additions & 63 deletions glide.yaml

This file was deleted.

52 changes: 52 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module github.com/TF2Stadium/Helen

go 1.19

require (
github.com/TF2Stadium/PlayerStatsScraper v0.0.0-20160321044610-c2109c66ae06
github.com/TF2Stadium/TF2RconWrapper v0.0.0-20160403121525-3f8ba97e297c
github.com/TF2Stadium/logstf v0.0.0-20160615154040-251bc96664fd
github.com/TF2Stadium/servemetf v0.0.0-20200331210202-2282b050105a
github.com/TF2Stadium/wsevent v0.0.0-20160322154148-1b422452cdad
github.com/bitly/go-simplejson v0.5.0
github.com/blang/semver v3.1.0+incompatible
github.com/bwmarrin/discordgo v0.18.0
github.com/dgrijalva/jwt-go v3.0.0+incompatible
github.com/evalphobia/logrus_sentry v0.5.0
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052
github.com/getsentry/raven-go v0.2.1-0.20190619092523-5c24d5110e0e
github.com/gorilla/websocket v0.0.0-20160313191446-e2e3d8414d0f
github.com/jinzhu/gorm v0.0.0-20160314000545-83002c4d5f06
github.com/kelseyhightower/envconfig v1.1.1-0.20160312064728-dd8b03cb3232
github.com/lib/pq v0.0.0-20160306064014-165a3529e799
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
github.com/oschwald/geoip2-golang v0.1.1-0.20160221025127-ac55b72a85f5
github.com/rs/cors v0.0.0-20170801073201-eabcc6af4bbe
github.com/sirupsen/logrus v0.9.0
github.com/streadway/amqp v0.0.0-20160311215503-2e25825abdbd
github.com/stretchr/testify v1.8.2-0.20221220093916-9acc22213e5f
github.com/vibhavp/amqp-rpc v0.0.0-20160309123414-8433bc7f29b2
github.com/yohcop/openid-go v0.0.0-20160304164425-f38c0087a377
golang.org/x/net v0.4.1-0.20221213214114-ad92d3db360b
golang.org/x/text v0.5.0
)

require (
github.com/TF2Stadium/rcon v0.0.0-20160403104014-1fcab576012d // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denisenkom/go-mssqldb v0.12.3 // indirect
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect
github.com/go-sql-driver/mysql v1.7.0 // indirect
github.com/jinzhu/inflection v1.0.1-0.20210111022912-b5281034e75e // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mattn/go-sqlite3 v1.14.16 // indirect
github.com/oschwald/maxminddb-golang v1.10.1-0.20221216215600-09b10dd95df1 // indirect
github.com/pkg/errors v0.9.2-0.20201214064552-5dd12d0cfe7f // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/crypto v0.4.1-0.20221221171930-bc7d1d1eb54b // indirect
golang.org/x/sys v0.3.1-0.20221221033156-3b1fc93fc15c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading