Settings

sewifurs.org reads its configuration from two locations:

  • the file instance/config.py, if it exists

  • environment variables, prefixed with SEWIFURS_

Use SCREAMING_SNAKE_CASE when providing values.

Deployment settings

sewifurs.org uses Docker Compose for development and deployment. The Compose configuration is split into compose.yaml, which defines all the ‘core’ infrastructure for sewifurs.org, and compose.deploy.yaml, which contains specifics for how it is deployed to the self-hosted server that powers https://sewifurs.org/ and other related websites. The former is recommended for everyone to use, while the latter is recommended to modify (or ignore) to fit your deployment environment.

If you are using the base compose.yaml, set the environment variable SEWIFURS_PORT to a port available on the host machine for nginx to be exposed on. The default is 5000.

If you go a step further and use compose.deploy.yaml as well, SEWIFURS_TIER should be staging, production, or any other environment name that can be stuffed into a directory name.

Note

When using compose.deploy.yaml, by default, all sewifurs.org services will be configured to run on startup.

Dependencies’ settings

Some of sewifurs.org’s dependencies also read values from instance/config.py. These are:

  • Flask
    • You must set SECRET_KEY, or some website functions will not work.

Application settings

These settings are specific to sewifurs.org itself. While they can be read using Flask’s standard configuration system, it is recommended to instead access them through sewifurs.settings.Settings for inline documentation, type information, and default values.

Use the lowercase version of each key when reading settings from this object.

Database

property Settings.database_url: str

The database URL that SQLAlchemy connects to.

Defaults to an SQLite3 database at instance/database.db.

See SQLAlchemy’s database URL documentation for details.

Telegram bot

property Settings.admin_chat_id: int | str | None

ID of the Telegram chat the bot sends administrative updates to.

The ID may either be the integer ID of the chat, or its custom handle. If unset, administrative updates will instead be logged to the console.

property Settings.bot_token: str | None

API token for the Telegram bot to login with.

If unset, bot and website login functionality will be unavailable.

News messages

Make sure BOT_TOKEN is also set in order to read and record news messages.

property Settings.allowed_channels: list[int]

IDs of the Telegram chats the bot should record news messages from.

The bot only needs to be able to read messages in the listed chats.

property Settings.show_news: bool

Whether to display news messages on the homepage.

If False (default), but ALLOWED_CHANNELS is set, the bot will still record news messages, even though they are not being displayed.

Permissions

To set people’s permissions with /set_permission or through the Tools section of the website, set a superuser first.

property Settings.superuser_id: int

Telegram user ID of the superuser, who is the root of all permissions.

External services

property Settings.bluesky_domains: dict[str, DnsEditor]

Domains configured for self-serve Bluesky custom handles.

Keys are domain names; values subclass sewifurs.dns.DnsEditor. Here is an example configuration for instance/config.py:

from sewifurs.dns import CloudflareEditor, NamecheapEditor, NamecomEditor

BLUESKY_DOMAINS = {
    'furwaukee.org': NamecomEditor('username', 'token', [123]),
    'sewifurs.org': NamecheapEditor('username', 'token', [123, 456]),
    'wifu.rs': CloudflareEditor('email', 'token', [456]),
}

If you are setting this through the SEWIFURS_BLUESKY_DOMAINS environment variable, subclasses of sewifurs.dns.DnsEditor are already imported for you.

property Settings.calendar_url: str | None

If set, embed this calendar URL below the chat directory in an iframe.

property Settings.mappoll_base: str

Base URL of the PollWhere service, used by /mappoll.

property Settings.scam_tracking_url: str | None

URL of the scam tracking service.

URL should point to a JSON file with an array of Telegram user IDs as strings or integers.

If None, the scam tracking service feature is disabled.

Defaults to the Furry Assisted Scam Tracking (FAST) project: https://scamtracking.org/home

property Settings.scam_tracking_info_url: str

Where to check for more information about user found in the scam tracking list.

Defaults to the Furry Assisted Scam Tracking (FAST) project: https://scamtracking.org/home

property Settings.scam_tracking_cache_timeout: timedelta

How many seconds the bot should cache the scam tracking list.

Defaults to 24 * 60 * 60 = 86,400 seconds, or roughly 1 day.

Website

property Settings.base: str

Base URL of the website.

This is used to generate absolute, canonical URLs for the website’s Open Graph metadata.

property Settings.development: str | None

Which development instance this is.

The website is marked as a development version by default. Set this to None to mark this as a production deployment. Use different strings for different development instances to help disambiguate, such as local versus staging.

Development deployments:

  • prominently display the development string

  • set Disallow: / in robots.txt

  • use DNS providers’ sandbox instances for Bluesky handle self-service

property Settings.webring_url: str | None

URL for the SEWI Furs Webring website, if enabled.

Set this to add a Webring link to the main navigation on the website. The SEWI Furs Webring is a separate application.

Common values:

  • Local: http://webring.sewifurs.localhost

  • Deployed: https://webring.sewifurs.org