slidge.core.config#

Module Contents#

Classes#

_TimedeltaSeconds

Represent the difference between two datetime objects.

Attributes#

class slidge.core.config._TimedeltaSeconds[source]#

Bases: datetime.timedelta

Represent the difference between two datetime objects.

Supported operators:

  • add, subtract timedelta

  • unary plus, minus, abs

  • compare to timedelta

  • multiply, divide by int

In addition, datetime supports subtraction of two datetime objects returning a timedelta, and addition or subtraction of a datetime and a timedelta giving a datetime.

Representation: (days, seconds, microseconds). Why? Because I felt like it.

slidge.core.config.LEGACY_MODULE: str[source]#
slidge.core.config.LEGACY_MODULE__DOC = 'Importable python module containing (at least) a BaseGateway and a LegacySession subclass'[source]#
slidge.core.config.SERVER: str = 'localhost'[source]#
slidge.core.config.SERVER__DOC = "The XMPP server's host name. Defaults to localhost, which is the standard way of running slidge,..."[source]#
slidge.core.config.SERVER__SHORT = 's'[source]#
slidge.core.config.SECRET: str[source]#
slidge.core.config.SECRET__DOC = "The gateway component's secret (required to connect to the XMPP server)"[source]#
slidge.core.config.JID: slixmpp.JID[source]#
slidge.core.config.JID__DOC = "The gateway component's JID"[source]#
slidge.core.config.JID__SHORT = 'j'[source]#
slidge.core.config.PORT: str = '5347'[source]#
slidge.core.config.PORT__DOC = "The XMPP server's port for incoming component connections"[source]#
slidge.core.config.PORT__SHORT = 'p'[source]#
slidge.core.config.HOME_DIR: pathlib.Path[source]#
slidge.core.config.HOME_DIR__DOC = 'Shelve file used to store persistent user data. Defaults to /var/lib/slidge/${SLIDGE_JID}. '[source]#
slidge.core.config.HOME_DIR__DYNAMIC_DEFAULT = True[source]#
slidge.core.config.USER_JID_VALIDATOR: str[source]#
slidge.core.config.USER_JID_VALIDATOR__DOC = 'Regular expression to restrict users that can register to the gateway, by JID. Defaults to...'[source]#
slidge.core.config.USER_JID_VALIDATOR__DYNAMIC_DEFAULT = True[source]#
slidge.core.config.ADMINS: tuple[slixmpp.JID, Ellipsis] = ()[source]#
slidge.core.config.ADMINS__DOC = 'JIDs of the gateway admins'[source]#
slidge.core.config.UPLOAD_SERVICE: str | None[source]#
slidge.core.config.UPLOAD_SERVICE__DOC = 'JID of an HTTP upload service the gateway can use. This is optional, as it should be...'[source]#
slidge.core.config.SECRET_KEY: str | None[source]#
slidge.core.config.SECRET_KEY__DOC = 'Encryption for disk storage'[source]#
slidge.core.config.NO_ROSTER_PUSH = False[source]#
slidge.core.config.NO_ROSTER_PUSH__DOC = "Do not fill users' rosters with legacy contacts automatically"[source]#
slidge.core.config.ROSTER_PUSH_PRESENCE_SUBSCRIPTION_REQUEST_FALLBACK = True[source]#
slidge.core.config.ROSTER_PUSH_PRESENCE_SUBSCRIPTION_REQUEST_FALLBACK__DOC = 'If True, legacy contacts will send a presence request subscription when privileged roster push...'[source]#
slidge.core.config.AVATAR_SIZE = 200[source]#
slidge.core.config.AVATAR_SIZE__DOC = 'Maximum image size (width and height), image ratio will be preserved'[source]#
slidge.core.config.USE_ATTACHMENT_ORIGINAL_URLS = False[source]#
slidge.core.config.USE_ATTACHMENT_ORIGINAL_URLS__DOC = 'For legacy plugins in which attachments are publicly downloadable URLs, let XMPP clients...'[source]#
slidge.core.config.UPLOAD_REQUESTER: str | None[source]#
slidge.core.config.UPLOAD_REQUESTER__DOC = 'Set which JID should request the upload slots. Defaults to the component JID.'[source]#
slidge.core.config.NO_UPLOAD_PATH: str | None[source]#
slidge.core.config.NO_UPLOAD_PATH__DOC = "Instead of using the XMPP server's HTTP upload component, copy files to this dir. You need to..."[source]#
slidge.core.config.NO_UPLOAD_URL_PREFIX: str | None[source]#
slidge.core.config.NO_UPLOAD_URL_PREFIX__DOC = 'Base URL that servers files in the dir set in the no-upload-path option, eg...'[source]#
slidge.core.config.NO_UPLOAD_METHOD: str = 'copy'[source]#
slidge.core.config.NO_UPLOAD_METHOD__DOC = "Whether to 'copy', 'move', 'hardlink' or 'symlink' the files in no-upload-path."[source]#
slidge.core.config.NO_UPLOAD_FILE_READ_OTHERS = False[source]#
slidge.core.config.NO_UPLOAD_FILE_READ_OTHERS__DOC = "After writing a file in NO_UPLOAD_PATH, change its permission so that 'others' can read it."[source]#
slidge.core.config.IGNORE_DELAY_THRESHOLD[source]#
slidge.core.config.IGNORE_DELAY_THRESHOLD__DOC = 'Threshold, in seconds, below which the <delay> information is stripped out of emitted stanzas.'[source]#
slidge.core.config.PARTIAL_REGISTRATION_TIMEOUT = 3600[source]#
slidge.core.config.PARTIAL_REGISTRATION_TIMEOUT__DOC = 'Timeout before registration and login. Only useful for legacy networks where a single step...'[source]#
slidge.core.config.LAST_SEEN_FALLBACK = True[source]#
slidge.core.config.LAST_SEEN_FALLBACK__DOC = 'When using XEP-0319 (Last User Interaction in Presence), use the presence status to display the...'[source]#
slidge.core.config.QR_TIMEOUT = 60[source]#
slidge.core.config.QR_TIMEOUT__DOC = 'Timeout for QR code flashing confirmation.'[source]#
slidge.core.config.DOWNLOAD_CHUNK_SIZE = 1024[source]#
slidge.core.config.DOWNLOAD_CHUNK_SIZE__DOC = 'Chunk size when slidge needs to download files using HTTP.'[source]#
slidge.core.config.LAST_MESSAGE_CORRECTION_RETRACTION_WORKAROUND = False[source]#
slidge.core.config.LAST_MESSAGE_CORRECTION_RETRACTION_WORKAROUND__DOC = 'If the legacy service does not support last message correction but supports message retractions,...'[source]#
slidge.core.config.FIX_FILENAME_SUFFIX_MIME_TYPE = False[source]#
slidge.core.config.FIX_FILENAME_SUFFIX_MIME_TYPE__DOC = 'Fix the Filename suffix based on the Mime Type of the file. Some clients (eg Conversations) may...'[source]#
slidge.core.config.LOG_FILE: pathlib.Path | None[source]#
slidge.core.config.LOG_FILE__DOC = 'Log to a file instead of stdout/err'[source]#
slidge.core.config.MAM_MAX_DAYS = 7[source]#
slidge.core.config.MAM_MAX_DAYS__DOC = 'Maximum number of days for group archive retention. Since all text content stored in RAM right now, '[source]#
slidge.core.config.CORRECTION_EMPTY_BODY_AS_RETRACTION = True[source]#
slidge.core.config.CORRECTION_EMPTY_BODY_AS_RETRACTION__DOC = 'Treat last message correction to empty message as a retraction. (this is what cheogram do for retraction)'[source]#
slidge.core.config.ATTACHMENT_MAXIMUM_FILE_NAME_LENGTH = 200[source]#
slidge.core.config.ATTACHMENT_MAXIMUM_FILE_NAME_LENGTH__DOC = 'Some legacy network provide ridiculously long filenames, strip above this limit, preserving suffix.'[source]#