Repository navigation
Expand file tree
/
Copy pathconfig.example.py
More file actions
126 lines (106 loc) · 5.88 KB
/
Copy pathconfig.example.py
File metadata and controls
126 lines (106 loc) · 5.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
"""Example configuration for altero.
Copy this file to ``config.py`` and adjust the values. ``config.py`` is ignored by
git, so local settings never end up in the repository.
Every setting can also be supplied as an ``ALTERO_``-prefixed environment variable
(for example ``ALTERO_PORT=9000``), which takes precedence over this file. Point
``ALTERO_CONFIG`` at another path to load a different configuration module.
"""
# SQLAlchemy database URL. The driver must be an asynchronous one.
DATABASE_URL = "sqlite+aiosqlite:///altero.sqlite"
# Database connections kept open for requests to share, and how many more may
# be opened when they are all in use.
DATABASE_POOL_SIZE = 5
DATABASE_MAX_OVERFLOW = 10
# Interface and port the server binds to.
HOST = "127.0.0.1"
PORT = 8000
# Enable debug behaviour, SQL echoing and auto-reload. Never enable in production.
DEBUG = False
# Directory holding attachment files.
STORAGE_PATH = "./storage"
# Largest attachment file accepted, in MiB, from a sync client or the browser.
MAX_UPLOAD_MB = 1024
# Requests allowed per API key, or per address when unauthenticated, in each
# window. Zero disables the limit. A caller over it gets 429 with Retry-After.
RATE_LIMIT = 0
RATE_LIMIT_WINDOW = 60
# Relay for outgoing mail — confirmations, group invitations and security
# notices — as smtp://[user:password@]host[:port] or smtps://... Credentials
# are percent-encoded, so an address as the username is `ada%40example.org`.
# Empty writes the messages to the log instead, which is how a fresh instance
# with no relay stays self-serviceable. A relay requires PUBLIC_URL below.
# See docs/email.md.
SMTP_URL = ""
# From address on outgoing mail. Set it to something the relay will send as.
MAIL_FROM = "altero@localhost"
# Absolute external base URL for API/file links, email and identity protocols.
# SMTP requires it at startup. Without SMTP, account links use relative paths
# if it is empty; they never trust request host headers. API/file links alone
# can fall back to the request address. Single sign-on, passkeys and the OAuth
# authorization server also require it rather than guessing an identity.
# See docs/deployment.md and docs/email.md.
PUBLIC_URL = ""
# Addresses of proxies whose X-Forwarded-For and X-Forwarded-Proto may be
# believed, comma separated, or "*" to believe any peer. Empty trusts nothing
# and reports the address the connection came from — behind a TLS terminator
# that is the terminator, so the rate limiter and the record of where a key was
# last used see one address for everybody until this is set. Only ever name a
# proxy that overwrites the header it forwards. See docs/deployment.md.
FORWARDED_ALLOW_IPS = ""
# Group notifications. A member of a group library can ask to be told when it
# changes; nobody is subscribed until they do, so an instance where nobody has
# asked sends nothing regardless of these.
#
# The quiet period is how long a library must stop changing before what
# happened in it goes out, which is what turns one sync into one message rather
# than one per batch of fifty. The interval is how often to look; zero turns
# group notifications off entirely, though activity is still recorded.
GROUP_DIGEST_QUIET_PERIOD = 900
GROUP_DIGEST_INTERVAL = 60
# Retention: how long the server keeps what nobody asked it to keep. Zero is
# never, which is the default for the first two — an instance that started
# deleting somebody's trash because it was upgraded would be the worst kind of
# surprise. zotero.org empties the trash after 30 days, if matching it is what
# you want. An administrator can change these three in the browser, and a value
# set there wins over the value here.
#
# The interval is how often to apply them; zero, the default, means only
# `altero retention run` ever does. Age is measured from the last time the
# server saw the object change — see docs/administration.md#retention.
TRASH_RETENTION_DAYS = 0
ACTIVITY_RETENTION_DAYS = 0
UPLOAD_RETENTION_HOURS = 24
RETENTION_INTERVAL = 0
# Whether anybody may register an account from the browser. The first account
# is always allowed, so a fresh instance is reachable without shell access, and
# so is anyone holding an unanswered invitation to a group. Everything else is
# `altero user add`.
# Claim the first administrator before exposing a fresh instance publicly.
OPEN_REGISTRATION = False
# Additional local accounts require mailbox proof and administrator approval.
# Requires SMTP_URL and PUBLIC_URL, and cannot be combined with SSO_ONLY.
# Open registration and invitations permit applications, never direct admission.
REGISTRATION_APPROVAL = False
# Exact ASCII domains; list subdomains separately. Empty allows any domain.
REGISTRATION_DOMAINS = []
REGISTRATION_MAX_PENDING = 1000
# Submission/recovery attempts per fixed hour window. Recipient mail is also
# limited to one/minute and five/day, including failed delivery attempts.
REGISTRATION_IP_LIMIT = 5
REGISTRATION_GLOBAL_LIMIT = 100
# New passwords only; existing passwords still sign in. No composition rules.
PASSWORD_MIN_LENGTH = 8 # 8 to 1024 characters
PASSWORD_BLOCK_COMMON = True
# Require OIDC/SAML for browser sign-in and recent proof for sensitive actions.
# Configure and test providers and link existing accounts before enabling.
# Local passwords, registration, recovery, email changes and MFA are disabled.
# Requires PUBLIC_URL; API keys and OAuth tokens still work for sync.
SSO_ONLY = False
# Whether somebody who has forgotten their password may ask for a link to set a
# new one. Off by default: it makes the mail relay part of the authentication,
# so whoever can read the mailbox can take the account. Does nothing without
# SMTP_URL and PUBLIC_URL above — a link that sets a password in the log is one
# anybody who can read the log can follow — and nothing for an account whose
# address was never confirmed. An administrator can issue the same link from
# Administration → Accounts whatever this says.
PASSWORD_RESET = False