Giter VIP home page Giter VIP logo

bovine's People

Contributors

helgekrueger avatar mayel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mayel

bovine's Issues

Mastodon (and similar software) as an ActivityPub Client

The goal of this issue is to create a better separation between "ActivityPub Server", i.e. bovine, and "ActivityPub Client, e.g. Mastodon. This will be done by "forwarding" activities to the "ActivityPub Client", so it can process the activity through its internal ActivityPub Server.

Goal

If one can succesfully implemented this, one should be able to separate the ActivityPub Actors from the user accounts on Mastodon. This means one can create a setup where a Pixelfed, Mastodon account result in the same Fediverse handle, e.g. [email protected]. Similarly, this Fediverse handle can then be used to send encrypted messages ...

First Implementation

Why I stopped

Running Mastodon in the vagrant box generated a lot of CPU load / network traffic. This seemed unnecessary. I lack the knowledge of Mastodon to fix this.

The posts appearing in the federated timeline do not create the experience, I expect ... So it was not fun to work on. I don't think getting the posts into the home screen would help, as I'm used to seeing full conversations by now.

Authentication

There should be a way for an ActivityPub Client to authenticate against Bovine and request access to an Actor's data. Something like OAuth is probably necessary.

bovine_process

The package bovine_process handles the task a server has to do to satisfy the requirements set out in Sections 6 and 7 of https://www.w3.org/TR/activitypub/. The pattern should be pretty straightforward: One method for each Subsection.

The entire processing chain is defined in the variables default_inbox_process and default_outbox_process in bovine_process.process (I might want to move this to bovine_process).

Implementing the methods themselves should be "easy". Thinking of appropriate test cases will probably not be.

The tests in /tests should do actual http

It should be possible to adapt the tests in /tests to do actual HTTP. A few things will be necessary for this:

  • Start bovine_blog as an actual server best reachable through a domain name one can configure. So http://bovine.local/ would work as a domain.
  • Probably even start an external instance to do the posting from, so something like http://bovine.external/activitypub/user#main-key is resolvable. Otherwise it might be hard to test stuff like HTTP Signatures
  • Rewrite /tests/utils/blog_test_env in order to use this setup

It should not be necessary to actually touch the tests. At least once bovine 0.1.0 is released.

The main goal of this would be to be able to run this test suite against any valid ActivityPub implementation (it replaces bovine.local) and the suite should pass.

Of course, this assumes that bovine flavored Client To Server is implemented. E.g. the eventSource test only works if an eventSource is implemented.

Example: How to filter and proxy activities

The setup:

This example does:

  • Activity from Home:
    • Forwards to the Fediverse as own activity
  • Activity from Fediverse
    • Filters if activity contains more than 100 characters, if yes discards
    • Forwards to Home

This should demonstrate how bovine can be used for things beyong "yay, it's the best Fediverse server in my humble opinion".

Necessary thinking

Build an all reply fetcher

A common complaint about the FediVerse are missing replies. Here is how to implement a "reply fetcher" in an ActivityPub Client. Usage will require a server supporting ActivityPub Client 2 Server.

Implementation Strategy

Here's how to implement this:

from bovine.activitypub import actor_from_file
actor = actor_from_file('you.toml', aiohttp.ClientSession())

# the following is awkward and should be fixed
response = await actor.proxy_element(original_url)
element = json.loads(await response.text)

The element then has a replies collection. Fetch it ... getting it with actor.get_ordered_collection might be currently possible. As the credentials used to connect to the Bovine ActivityPub Server are the same as used to other hosts. However, it would be cleaner to also proxy the elements.

Then repeat this for all the replies.

Once this is done build a display. It might be possible to reuse Buffalo in particular:
https://codeberg.org/helge/Buffalo/src/branch/main/src/components/timeline/DisplayConversation.js

Rotate cryptographic keys for ActivityPub Server 2 Server communication

Implement automatic rotation of the public key pair used for ActivityPub Server 2 Server communication after say a month:

  • Investigate best practices on the period to update a keypair
  • Ensure updating the key pair doesn't create problems when communicating with other FediVerse services
  • Investigate if there is a way to inform other services about an updated keypair. Otherwise consider writing a FEP

Automatic rotation will probably implemented as part of Moo-Auth-1 as the key is part of the header there, rotation should be unproblematic.

bovine_user needs management of user data

User should be able to

  • Set his actor name / summary. Possibly change his preferredUsername. Not sure if this is compatible with Mastodon and company.
  • Upload new public keys

This could be done for example through a web form. Also disabling the account might be a possibility to add.

Maybe also consider some type of admin role.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.