remarkbox/test.ini
russell@unturf.com 66964f736a Add spam prevention, superuser system, and LLM relevance checking
- Thread creation rate limit: 1 per 7 min per user/IP via API
- is_superuser column on User model with alembic migration
- Superusers bypass namespace-scoped is_moderator() checks
- super_fly_required now checks is_superuser instead of hardcoded names
- /topsecret/users admin page to promote/demote superusers
- Spam scoring module with 6 signals (link density, patterns, duplicates,
  new account velocity, IP reputation, content length)
- Hard threshold (0.8) rejects, soft threshold (0.5) holds for moderation
- LLM relevance checking via Hermes (hermes.ai.unturf.com) on every
  message when enabled, including embed mode parent page URL context
- Admin API endpoints: GET /api/v1/admin/namespaces, recent-nodes
- Spam hunting scripts: scan.py, disable_spam.py, promote_superuser.py
- Updated Python client with admin methods
2026-02-02 09:19:16 -05:00

157 lines
4 KiB
INI

# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html
[alembic]
script_location = remarkbox:scripts/alembic
sqlalchemy.url = sqlite:///%(here)s/${TEST_DATABASE_PATH:-test-remarkbox.sqlite}
[app:main]
use = egg:remarkbox
sqlalchemy.url = sqlite:///%(here)s/${TEST_DATABASE_PATH:-test-remarkbox.sqlite}
#sqlalchemy.url = postgres://localhost/remarkbox_test
###
# Pyramid configuration.
###
pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
pyramid.includes =
pyramid_tm
# By default, the toolbar only appears for clients from IP addresses
# '127.0.0.1' and '::1'.
# debugtoolbar.hosts = 127.0.0.1 ::1
###
# session / cookie configuration.
# http://docs.pylonsproject.org/docs/pyramid/en/latest/api/session.html
###
session.hashalg = sha512
session.secret = test-test-secret
session.timeout = 31104000
session.max_age = 31104000
session.reissue_time = 15552000
###
# API configuration (permissive for tests).
###
api.enabled = true
api.rate_limit.read_requests = 1000
api.rate_limit.write_requests = 1000
api.rate_limit.window = 60
api.rate_limit.create_thread_requests = 1000
api.rate_limit.create_thread_window = 3600
###
# spam detection (disabled for tests).
###
spam.enabled = false
spam.llm.enabled = false
###
# custom app configuration.
###
app.avatar.size = 35
# If set we force all links related to `join or log in` to this base url
# and use this url for links in email notifications.
# Also useful when multiple subdomains point at the same Remarkbox cluster.
# In prod I set this to: https://my.remarkbox.com (default = request.host_url)
#app.app_url = ""
# if your marketing / main landing page base url is different then app url.
# In prod I set this to: https://www.remarkbox.com (default = request.app_url)
#app.marketing_url = ""
# if Node is None, we can redirect to this uri.
#app.safe_redirect = https://unturf.com
app.email.relay = localhost
app.email.sender = no-reply@remarkbox.com
# set this to the path of your private DKIM key.
# reference: https://russell.ballestrini.net/quickstart-to-dkim-signed-email-with-python/
#app.email.dkim_private_key_path = ""
#app.email.dkim_selector = ""
# The app name in the email subject (default = request.app_domain)
# In production I set this to "Remarkbox".
#app.email.subject_postfix
# optional theme plugin name.
#app.theme = westworld
app.theme = meta
# optional theme plugin name for embed mode.
#app.theme_embed = meta
# stand-alone mode disables a bunch of views and templates
# related to billing and registering Namespaces. Defaults to False
#app.stand_alone_mode = enabled
# stripe: Stripe Checkout payment processing.
# This syntax will automatically expand an ENV var of the same name.
app.stripe.secret = ${REMARKBOX_APP_STRIPE_SECRET}
app.stripe.public = ${REMARKBOX_APP_STRIPE_PUBLIC}
app.stripe.webhook_secret = ${REMARKBOX_APP_STRIPE_WEBHOOK_SECRET:-}
# slack: bot notifications.
app.slack.secret = ${REMARKBOX_APP_SLACK_SECRET}
app.slack.public = ${REMARKBOX_APP_SLACK_PUBLIC}
app.slack.oauth_scope = channels:read,chat:write:bot
# feature flag for email notifications.
#app.deliver_email_notifications = true
###
# wsgi server configuration
###
[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
###
# logging configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
###
[loggers]
keys = root, remarkbox, sqlalchemy
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[logger_remarkbox]
level = DEBUG
handlers =
qualname = remarkbox
[logger_sqlalchemy]
level = INFO
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
[pshell]
m = remarkbox.models