Implement feedback
This commit is contained in:
@@ -14,12 +14,12 @@ const prefix = "postmoogle"
|
||||
func New() (*Config, error) {
|
||||
env.SetPrefix(prefix)
|
||||
|
||||
wildCardUserPatterns := env.Slice("users")
|
||||
regexUserPatterns, err := utils.WildcardUserPatternsToRegexPatterns(wildCardUserPatterns)
|
||||
mxidPatterns := env.Slice("users")
|
||||
regexPatterns, err := utils.WildcardMXIDsToRegexes(mxidPatterns)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"failed to convert wildcard user patterns (`%s`) to regular expression: %s",
|
||||
wildCardUserPatterns,
|
||||
mxidPatterns,
|
||||
err,
|
||||
)
|
||||
}
|
||||
@@ -36,7 +36,7 @@ func New() (*Config, error) {
|
||||
Federation: env.Bool("federation"),
|
||||
MaxSize: env.Int("maxsize", defaultConfig.MaxSize),
|
||||
StatusMsg: env.String("statusmsg", defaultConfig.StatusMsg),
|
||||
Users: *regexUserPatterns,
|
||||
Users: *regexPatterns,
|
||||
Sentry: Sentry{
|
||||
DSN: env.String("sentry.dsn", defaultConfig.Sentry.DSN),
|
||||
},
|
||||
|
||||
@@ -28,10 +28,7 @@ type Config struct {
|
||||
MaxSize int
|
||||
// StatusMsg of the bot
|
||||
StatusMsg string
|
||||
// Users holds regular expression patterns of users that are allowed to use the bridge.
|
||||
// The regular expression patterns are compiled from wildcard patterns like:
|
||||
// `@someone:example.com`, `@*:example.com`, `@bot.*:example.com`, `@someone:*`, `@someone:*.example.com`
|
||||
// An empty list means that "everyone is allowed".
|
||||
// Users holds list of allowed users (wildcards supported), e.g.: @*:example.com, @bot.*:example.com, @admin:*. Empty = *
|
||||
Users []*regexp.Regexp
|
||||
|
||||
// DB config
|
||||
|
||||
Reference in New Issue
Block a user