diff --git a/app/validators/screen_name_validator.rb b/app/validators/screen_name_validator.rb index 815d4faa..8fea65bb 100644 --- a/app/validators/screen_name_validator.rb +++ b/app/validators/screen_name_validator.rb @@ -1,10 +1,7 @@ # frozen_string_literal: true class ScreenNameValidator < ActiveModel::EachValidator - FORBIDDEN_SCREEN_NAMES = %w[justask_admin retrospring_admin admin justask retrospring about public - notifications inbox sign_in sign_up sidekiq moderation moderator mod administrator - siteadmin site_admin help retro_spring retroospring retrosprlng niisding nllsding - pixeidesu plxeldesu plxeidesu terms privacy linkfilter feedback].freeze + FORBIDDEN_SCREEN_NAMES = APP_CONFIG["forbidden_screen_names"].freeze FORBIDDEN_SCREEN_NAME_REGEXPS = [/wreciap\z/i].freeze def validate_each(record, attribute, value) diff --git a/config/justask.yml.example b/config/justask.yml.example index f1a50127..b5e33f98 100644 --- a/config/justask.yml.example +++ b/config/justask.yml.example @@ -9,6 +9,23 @@ email_from: "noreply@justask.rrerr.net" # Name of the "Anonymous" user. (e.g. "Anonymous Coward", "Arno Nym", "Mr. X", ...) anonymous_name: "Anonymous" +forbidden_screen_names: + - justask_admin + - retrospring_admin + - admin + - justask + - retrospring + - moderation + - moderator + - mod + - administrator + - siteadmin + - site_admin + - help + - retro_spring + - retroospring + - retrosprlng + # Text shown on the about page (Markdown can be used here) about: | # About