68 lines
1.9 KiB
Python
68 lines
1.9 KiB
Python
|
from tinysql import Column, Table
|
||
|
|
||
|
|
||
|
DEFAULT_CONFIG = {
|
||
|
'description': ('str', 'Make a note about your relay here'),
|
||
|
'http_timeout': ('int', 10),
|
||
|
'json_cache': ('int', 1024),
|
||
|
'log_level': ('str', 'INFO'),
|
||
|
'name': ('str', 'ActivityRelay'),
|
||
|
'privkey': ('str', ''),
|
||
|
'push_limit': ('int', 512),
|
||
|
'require_approval': ('bool', False),
|
||
|
'version': ('int', 20221211),
|
||
|
'whitelist': ('bool', False),
|
||
|
'workers': ('int', 8)
|
||
|
}
|
||
|
|
||
|
RELAY_SOFTWARE = [
|
||
|
'activity-relay', # https://github.com/yukimochi/Activity-Relay
|
||
|
'activityrelay', # https://git.pleroma.social/pleroma/relay
|
||
|
'aoderelay', # https://git.asonix.dog/asonix/relay
|
||
|
'feditools-relay' # https://git.ptzo.gdn/feditools/relay
|
||
|
]
|
||
|
|
||
|
TABLES = [
|
||
|
Table('config',
|
||
|
Column('key', 'text', unique=True, nullable=False, primary_key=True),
|
||
|
Column('value', 'text')
|
||
|
),
|
||
|
Table('instances',
|
||
|
Column('id', 'serial'),
|
||
|
Column('domain', 'text', unique=True, nullable=False),
|
||
|
Column('actor', 'text'),
|
||
|
Column('inbox', 'text', nullable=False),
|
||
|
Column('followid', 'text'),
|
||
|
Column('software', 'text'),
|
||
|
Column('note', 'text'),
|
||
|
Column('joined', 'datetime', nullable=False),
|
||
|
Column('updated', 'datetime')
|
||
|
),
|
||
|
Table('whitelist',
|
||
|
Column('id', 'serial'),
|
||
|
Column('domain', 'text', unique=True),
|
||
|
Column('created', 'datetime', nullable=False)
|
||
|
),
|
||
|
Table('bans',
|
||
|
Column('id', 'serial'),
|
||
|
Column('name', 'text', unique=True),
|
||
|
Column('note', 'text'),
|
||
|
Column('type', 'text', nullable=False),
|
||
|
Column('created', 'datetime', nullable=False)
|
||
|
),
|
||
|
Table('users',
|
||
|
Column('id', 'serial'),
|
||
|
Column('handle', 'text', unique=True, nullable=False),
|
||
|
Column('domain', 'text', nullable=False),
|
||
|
Column('api_token', 'text'),
|
||
|
Column('created', 'datetime', nullable=False),
|
||
|
Column('updated', 'datetime')
|
||
|
),
|
||
|
Table('tokens',
|
||
|
Column('id', 'text', unique=True, nullable=False, primary_key=True),
|
||
|
Column('userid', 'integer', nullable=False),
|
||
|
Column('created', 'datetime', nullable=False),
|
||
|
Column('updated', 'datetime')
|
||
|
)
|
||
|
]
|