Giter Club home page Giter Club logo

mastodon / mastodon Goto Github PK

View Code? Open in Web Editor NEW
46.0K 712.0 6.7K 230.54 MB

Your self-hosted, globally interconnected microblogging community

Home Page: https://joinmastodon.org

License: GNU Affero General Public License v3.0

Ruby 63.90% JavaScript 23.26% CSS 0.01% HTML 0.20% Shell 0.05% Dockerfile 0.21% SCSS 4.88% Haml 4.72% Procfile 0.01% Procfile 0.01% TypeScript 2.76%
mastodon docker microblog activity-stream webfinger social-network activitypub fediverse social-web

mastodon's Introduction

Mastodon

GitHub release Ruby Testing Crowdin

Mastodon is a free, open-source social network server based on ActivityPub where users can follow friends and discover new ones. On Mastodon, users can publish anything they want: links, pictures, text, and video. All Mastodon servers are interoperable as a federated network (users on one server can seamlessly communicate with users from another one, including non-Mastodon software that implements ActivityPub!)

Click below to learn more in a video:

Screenshot

Navigation

Features

No vendor lock-in: Fully interoperable with any conforming platform

It doesn't have to be Mastodon; whatever implements ActivityPub is part of the social network! Learn more

Real-time, chronological timeline updates

Updates of people you're following appear in real-time in the UI via WebSockets. There's a firehose view as well!

Media attachments like images and short videos

Upload and view images and WebM/MP4 videos attached to the updates. Videos with no audio track are treated like GIFs; normal videos loop continuously!

Safety and moderation tools

Mastodon includes private posts, locked accounts, phrase filtering, muting, blocking, and all sorts of other features, along with a reporting and moderation system. Learn more

OAuth2 and a straightforward REST API

Mastodon acts as an OAuth2 provider, so 3rd party apps can use the REST and Streaming APIs. This results in a rich app ecosystem with a lot of choices!

Deployment

Tech stack

  • Ruby on Rails powers the REST API and other web pages
  • React.js and Redux are used for the dynamic parts of the interface
  • Node.js powers the streaming API

Requirements

  • PostgreSQL 12+
  • Redis 4+
  • Ruby 3.1+
  • Node.js 16+

The repository includes deployment configurations for Docker and docker-compose as well as specific platforms like Heroku, Scalingo, and Nanobox. For Helm charts, reference the mastodon/chart repository. The standalone installation guide is available in the documentation.

Development

Vagrant

A Vagrant configuration is included for development purposes. To use it, complete the following steps:

  • Install Vagrant and Virtualbox
  • Install the vagrant-hostsupdater plugin: vagrant plugin install vagrant-hostsupdater
  • Run vagrant up
  • Run vagrant ssh -c "cd /vagrant && bin/dev"
  • Open http://mastodon.local in your browser

MacOS

To set up MacOS for native development, complete the following steps:

  • Use a Ruby version manager to install the specified version from .ruby-version
  • Run brew install postgresql@14 redis imagemagick libidn to install required dependencies
  • Navigate to Mastodon's root directory and run brew install nvm then nvm use to use the version from .nvmrc
  • Run corepack enable && corepack prepare
  • Run bundle exec rails db:setup (optionally prepend RAILS_ENV=development to target the dev environment)
  • Finally, run bin/dev which will launch the local services via overmind (if installed) or foreman

Docker

For development with Docker, complete the following steps:

  • Install Docker Desktop
  • Run docker compose -f .devcontainer/docker-compose.yml up -d
  • Run docker compose -f .devcontainer/docker-compose.yml exec app .devcontainer/post-create.sh
  • Finally, run docker compose -f .devcontainer/docker-compose.yml exec app bin/dev

If you are using an IDE with support for the Development Container specification, it will run the above docker compose commands automatically. For Visual Studio Code this requires the Dev Container extension.

GitHub Codespaces

To get you coding in just a few minutes, GitHub Codespaces provides a web-based version of Visual Studio Code and a cloud-hosted development environment fully configured with the software needed for this project..

  • Click this button to create a new codespace:
    Open in GitHub Codespaces
  • Wait for the environment to build. This will take a few minutes.
  • When the editor is ready, run bin/dev in the terminal.
  • After a few seconds, a popup will appear with a button labeled Open in Browser. This will open Mastodon.
  • On the Ports tab, right click on the β€œstream” row and select Port visibility β†’ Public.

Contributing

Mastodon is free, open-source software licensed under AGPLv3.

You can open issues for bugs you've found or features you think are missing. You can also submit pull requests to this repository or submit translations using Crowdin. To get started, take a look at CONTRIBUTING.md. If your contributions are accepted into Mastodon, you can request to be paid through our OpenCollective.

IRC channel: #mastodon on irc.libera.chat

License

Copyright (C) 2016-2024 Eugen Rochko & other Mastodon contributors (see AUTHORS.md)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

mastodon's People

Contributors

abcang avatar akihikodaki avatar alpaca-tc avatar c960657 avatar clearlyclaire avatar danielmbrasil avatar dependabot-preview[bot] avatar dependabot[bot] avatar gargron avatar github-actions[bot] avatar ineffyble avatar lynlynlynx avatar mayaeh avatar mjankowski avatar noellabo avatar nolanlawson avatar nschonni avatar renatolond avatar renchap avatar renovate[bot] avatar shleeable avatar sorin-davidoi avatar takayamaki avatar thisismissem avatar tribela avatar unarist avatar yiskah avatar ykzts avatar ysksn avatar zunda 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mastodon's Issues

Account settings

There should be a way to edit your e-mail address, change password, and manage e-mail notifications from the UI.

Following a remote user via local user when no PuSH subscription has been established

Assuming a local representation of a remote account is created from an incoming Salmon or reblog, in which case no PuSH subscription is established (i.e. the Mastodon server does not want to receive the user's feed updates).

It becomes possible to follow that user using the /api/accounts/:id/follow end-point.

Expected behaviour: A PuSH subscription is then established. A Salmon slap is sent to the remote user.

Current behaviour: No PuSH subscription is established. No Salmon slap is sent.

Streaming API

Mastodon already uses Redis for timelines. The fan-out-on-write system merely needs to make a publish call to an appropriate Redis channel. ActionController::Live can be used to create the API end-point.

Public status threading display

Current behaviour: A single public status page displays the status it is an immediate response to, and all statuses that are immediate replies to it.

Expected behaviour: Display as much context as possible, by resolving all connected statuses, not just immediate replies.

Potential problems:

  1. Given local status A, and remote reply B. If somebody replies to B, the instance A is on does not get notified.
  2. Given remote status A, and local reply B, it is impossible to fetch A's other responses (B's remote siblings)

Problem 1. shouldn't be a problem if the replies still mention A's user, in which case A's instance gets a Salmon slap. However, technically, in-text mentions are not neccessary for threads in OStatus.

Add more to streams

Currently only home timeline and mention timeline updates are streamed to the user via ActionCable. But it doesn't have to be this way! Literally anything could be streamed:

  • User's status has been favourited/reblogged
  • User got a new follower
  • User unfollowed someone (can be used to quickly clean up UI)

When unfollowing, clean home timeline

When unfollowing a user, the home feed should be purged of the unfollowed user's posts.

This could be done by simply removing the whole feed, forcing a PrecomputeFeedService on next access.

How to handle 3rd party apps with OAuth

OAuth is great for allowing all sorts of 3rd party apps to flourish around the API, but thinking it through, I am encountering a small obstacle. Each app requires a client ID and secret on the instance it wants to work with (so it needs to be pre-registered). This means that each app needs to be tailored for a specific instance of Mastodon, but it's not like each app could connect to whatever instance the user wanted it to.

How could this be solved?

Admin dashboard

Mastodon should provide an Admin dashboard with an overview of what is happening behind the scenes:

  • How many local users do we have?
  • How many remote users are we subscribed to?
  • What other instances are we aware of?
  • How many local statuses are we hosting?

Furthermore, the admin dashboard should be the place where account or status suspensions from #9 should be managed.

Implement client app registration API

So that 3rd party apps can get their client key/secret and use OAuth2.

Big networks like Twitter and Facebook have a complicated, user-bound app registration process to have better control and credibility, so one app has one entry in their database or whatever. But in a decentralized network, that's not really possible. Just let apps register themselves, and if one app has multiple database entries/tokens, whatever, so be it. The real point is to have a secure user authorization process that doesn't involve revealing the user's password to 3rd parties.

Rate limiting

All APIs need to be rate-limited to prevent abuse.

When Salmon-delivered status is supposed to be deleted

If a status from a user who is not followed by anyone on the instance gets delivered via Salmon, and is then consequently deleted on the remote source (because of a typo or other mistake), the instance does not get notified of this.

As a consequence the mentions timeline can be spammed with minor corrections, which is annoying.

This could be fixed if GNU Social and Mastodon made sure to send a follow-up Salmon with a deletion request when such a status is deleted on their end. But handling of deletion requests needs to be implemented in Mastodon, as well.

E-mail notifications

Since no client UI is provided, until the user setups a 3rd party app to interact with Mastodon, there is no way to know when you've been followed or mentioned, reblogged or favourited.

E-mail notifications are needed. They should be opt-out. User settings are required for this.

Cache fragments to improve performance

A big % of the response time in the app is rendering partials (not even SQL queries). So the response time could be improved significantly by caching fragments.

This isn't pressing since we're talking 500ms vs maybe 200ms here.

Add pagination

Add pagination to public account pages and add Atom feed pagination as well.

Account suspension

It should be possible, in case of abuse, for a Mastodon instance owner to suspend a user's account.

Suspension should hide the account and all statuses from public view. Suspension should be reversible.

Switch license to GNU AGPL?

It would be good to promote this on gnu.io, but with the current license it would be inappropriate. The GNU AGPL v3 or later versions would be a good license choice for this project.

Thread resolving for remote statuses

In ProcessFeedService, if a remote status we want to save (A) is a response to another status (B), then we try to look up a local copy of B. If it fails, no reply-to information is saved.

It's up for debate if the method should then try to somehow fetch the B status. The potential problem with that approach would be that B is a reply to status C, etc etc indefinitely, which would force the Mastodon service to crawl the entire fediverse. That may not be wise.

Detail view for statuses, profiles, etc

Front-end should have a way of displaying statuses in conversation context, profiles (with the ability to follow/unfollow), also a form for updating own profile, and maybe a list of followees/followers.

Reblogs in Atom need more tags

Reblogs in Atom need a slightly different tag structure, and at the very least they need to include the <author /> of the <activity:object />. Current reblogs originating from Mastodon are malformed.

Media attachments

Statuses can have enclosures. It should be possible to upload pictures. Remote statuses should have their enclosures cached and displayed neatly.

Loading bar stuck as displayed after remote follow

This is because a follow request dispatches a timeline refresh action, which is another request-success-fail cycle, however, the final action is not called TIMELINE_REFRESH_SUCCESS, instead it's the more legacy TIMELINE_SET which is not being picked up by the react-redux-loading-bar middleware. Solution is just to rename that.

Better filter out irrelevant statuses in the home timeline

FanOutOnWriteService needs to be improved: Currently it filters out statuses that are direct replies to people the home timeline owner does not follow himself (standard Twitter behaviour). However, most statuses are not direct replies, even if they're meant for somebody home owner does not follow. The status body actually needs to be check for if it begins with a mention.

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.