Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • R relay
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • PleromaPleroma
  • relay
  • Merge requests
  • !33

Reorganize codebase

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Izalia Mae requested to merge izalia/relay:rework into master Apr 09, 2022
  • Overview 0
  • Commits 11
  • Changes 28

In order to make the relay easier to work on, I'm making a ton of changes.

  • General:

    • Web views have been moved into their own file as views.py
    • Processing functions have been moved into processors.py
    • The 'request' function was created for making GETs and POSTs and put in misc.py
    • All functions in http_signaturese where moved into misc.py
    • Directly import the logging module instead of importing from logging.py
    • Set the log level via 'LOG_LEVEL' environmental variable
    • Use 'X-Forwarded-For' header to determine remote IP address for access log
    • DB and Config are attached to an aiohttp.web.Application in order to set the config path via cli
    • If installed via pip, the relay can be ran via activityrelay
  • Management:

    • No need to call relay.manage
    • Commands to manage banlists and whitelist
    • Setup command to configure a new server
  • Routes:

    • Only enable '/stats' route and aiohttp.TraceConfig if the logging level is set to DEBUG
    • Treat 'POST /actor' as an inbox so only one url needs to be used for all software
  • Docker:

    • Moved relay to /opt/activityrelay and data to /data
    • Created docker.sh script for easy management
  • RelayConfig: a class that manages loading and saving of relay.yaml

    • Access to config options as attributes or dict items
    • Functions to check if an instance is banned or whitelisted
    • Properties for various urls used throughout the relay (actor, inbox, and keyid)
    • If a database file is not specified, it will be named after the config file
  • RelayDatabase: class for db management

    • Removed the public key from the database since it can be generated on startup
    • Properties for public and private keys as string (lowercase) and RSA (uppercase) objects
    • Save to disk when adding or removing an inbox instead of every 30 seconds
Edited Apr 12, 2022 by Izalia Mae
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: rework