├── .credo.exs ├── .dockerignore ├── .formatter.exs ├── .gitattributes ├── .gitignore ├── .gitlab-ci.yml ├── .gitlab ├── issue_templates │ └── Bug.md └── merge_request_templates │ ├── Default.md │ └── Release.md ├── .mailmap ├── .tool-versions ├── AGPL-3 ├── CC-BY-4.0 ├── CC-BY-SA-4.0 ├── CHANGELOG.md ├── CHANGELOG_soapbox.md ├── COPYING ├── Dockerfile ├── Procfile ├── README.md ├── SECURITY.md ├── app.json ├── benchmarks ├── load_testing │ ├── activities.ex │ ├── fetcher.ex │ ├── helper.ex │ └── users.ex └── mix │ └── tasks │ └── pleroma │ ├── benchmark.ex │ ├── benchmarks │ ├── tags.ex │ └── timelines.ex │ └── load_testing.ex ├── changelog.d ├── 2.6.0-mergeback.skip ├── 3895.add ├── 3896.add ├── 3900.change ├── akkoma-xml-remote-entities.security ├── authorize-interaction.add ├── bare_uri_test.skip ├── benchee.skip ├── check-attachment-attribution.security ├── digest_emails.fix ├── docs-max-elixir-erlang.change ├── emoji-pack-sanitization.security ├── federation_status-access.change ├── healthcheck-disabled-error.fix ├── meilisearch.add ├── nginx-media-redirect-fix.fix ├── otp_perms.security ├── quotes-count.skip ├── scrobble-url.add └── system-cflags.fix ├── ci ├── Dockerfile └── build_and_push.sh ├── config ├── benchmark.exs ├── config.exs ├── description.exs ├── dev.exs ├── docker.exs ├── dokku.exs ├── emoji.txt ├── prod.exs ├── soapbox.exs └── test.exs ├── coveralls.json ├── docker-entrypoint.sh ├── docs ├── README.md ├── SUMMARY.md ├── administration │ ├── CLI_tasks │ │ ├── config.md │ │ ├── database.md │ │ ├── digest.md │ │ ├── email.md │ │ ├── emoji.md │ │ ├── frontend.md │ │ ├── general_cli_task_info.include │ │ ├── instance.md │ │ ├── oauth_app.md │ │ ├── relay.md │ │ ├── robots_txt.md │ │ ├── uploads.md │ │ └── user.md │ ├── backup.md │ └── updating.md ├── clients.md ├── configuration │ ├── auth.md │ ├── cheatsheet.md │ ├── custom_emoji.md │ ├── hardening.md │ ├── how_to_serve_another_domain_for_webfinger.md │ ├── howto_database_config.md │ ├── howto_ejabberd.md │ ├── howto_mediaproxy.md │ ├── howto_mongooseim.md │ ├── howto_proxy.md │ ├── howto_search_cjk.md │ ├── howto_set_richmedia_cache_ttl_based_on_image.md │ ├── howto_theming_your_instance.md │ ├── i2p.md │ ├── mrf.md │ ├── onion_federation.md │ ├── optimizing_beam.md │ ├── postgresql.md │ ├── search.md │ ├── static_dir.md │ └── storing_remote_media.md ├── development │ ├── API │ │ ├── admin_api.md │ │ ├── chats.md │ │ ├── differences_in_mastoapi_responses.md │ │ ├── nodeinfo.md │ │ ├── pleroma_api.md │ │ └── prometheus.md │ ├── ap_extensions.md │ ├── authentication_authorization.md │ ├── index.md │ ├── setting_up_a_gitlab_runner.md │ └── setting_up_pleroma_dev.md ├── index.md └── installation │ ├── alpine_linux_en.md │ ├── arch_linux_en.md │ ├── debian_based_en.md │ ├── debian_based_jp.md │ ├── freebsd_en.md │ ├── further_reading.include │ ├── generic_dependencies.include │ ├── gentoo_en.md │ ├── gentoo_otp_en.md │ ├── migrating_from_source_otp_en.md │ ├── netbsd_en.md │ ├── nixos_en.md │ ├── openbsd_en.md │ ├── openbsd_fi.md │ ├── optional │ └── media_graphics_packages.md │ ├── otp_en.md │ ├── otp_vs_from_source.include │ ├── otp_vs_from_source_source.include │ └── yunohost_en.md ├── elixir_buildpack.config ├── installation ├── apache-cache-purge.sh.example ├── caddyfile-pleroma.example ├── freebsd │ └── rc.d │ │ └── pleroma ├── init.d │ └── pleroma ├── netbsd │ └── rc.d │ │ └── pleroma ├── nginx-cache-purge.sh.example ├── nsfw-api.service ├── openbsd │ ├── httpd.conf │ ├── rc.d │ │ └── pleromad │ └── relayd.conf ├── pleroma-apache.conf ├── pleroma-mediaproxy.nginx ├── pleroma-mongooseim.cfg ├── pleroma.nginx ├── pleroma.service ├── pleroma.supervisord └── pleroma.vcl ├── lib ├── mix │ ├── pleroma.ex │ └── tasks │ │ └── pleroma │ │ ├── app.ex │ │ ├── config.ex │ │ ├── count_statuses.ex │ │ ├── database.ex │ │ ├── digest.ex │ │ ├── docs.ex │ │ ├── ecto.ex │ │ ├── ecto │ │ ├── migrate.ex │ │ └── rollback.ex │ │ ├── email.ex │ │ ├── emoji.ex │ │ ├── frontend.ex │ │ ├── instance.ex │ │ ├── notification_settings.ex │ │ ├── openapi_spec.ex │ │ ├── refresh_counter_cache.ex │ │ ├── relay.ex │ │ ├── robots_txt.ex │ │ ├── search │ │ └── meilisearch.ex │ │ ├── uploads.ex │ │ └── user.ex ├── phoenix │ └── transports │ │ └── web_socket │ │ └── raw.ex ├── pleroma │ ├── activity.ex │ ├── activity │ │ ├── html.ex │ │ ├── ir │ │ │ └── topics.ex │ │ └── queries.ex │ ├── announcement.ex │ ├── announcement_read_relationship.ex │ ├── application.ex │ ├── application_requirements.ex │ ├── bookmark.ex │ ├── caching.ex │ ├── captcha.ex │ ├── captcha │ │ ├── kocaptcha.ex │ │ ├── native.ex │ │ └── service.ex │ ├── chat.ex │ ├── chat │ │ └── message_reference.ex │ ├── clippy.ex │ ├── config.ex │ ├── config │ │ ├── deprecation_warnings.ex │ │ ├── getting.ex │ │ ├── helpers.ex │ │ ├── holder.ex │ │ ├── loader.ex │ │ ├── oban.ex │ │ ├── release_runtime_provider.ex │ │ └── transfer_task.ex │ ├── config_db.ex │ ├── constants.ex │ ├── conversation.ex │ ├── conversation │ │ ├── participation.ex │ │ └── participation │ │ │ └── recipient_ship.ex │ ├── counter_cache.ex │ ├── data_migration.ex │ ├── delivery.ex │ ├── docs │ │ ├── generator.ex │ │ ├── json.ex │ │ ├── markdown.ex │ │ ├── translator.ex │ │ └── translator │ │ │ └── compiler.ex │ ├── ecto_enums.ex │ ├── ecto_type │ │ ├── activity_pub │ │ │ └── object_validators │ │ │ │ ├── bare_uri.ex │ │ │ │ ├── date_time.ex │ │ │ │ ├── emoji.ex │ │ │ │ ├── mime.ex │ │ │ │ ├── object_id.ex │ │ │ │ ├── recipients.ex │ │ │ │ ├── safe_text.ex │ │ │ │ └── uri.ex │ │ ├── config │ │ │ ├── atom.ex │ │ │ └── binary_value.ex │ │ └── string_id.ex │ ├── emails │ │ ├── admin_email.ex │ │ ├── mailer.ex │ │ ├── new_users_digest_email.ex │ │ └── user_email.ex │ ├── emoji-test.txt │ ├── emoji.ex │ ├── emoji │ │ ├── combinations.ex │ │ ├── formatter.ex │ │ ├── loader.ex │ │ └── pack.ex │ ├── filter.ex │ ├── following_relationship.ex │ ├── formatter.ex │ ├── frontend.ex │ ├── gopher │ │ └── server.ex │ ├── gun.ex │ ├── gun │ │ ├── api.ex │ │ ├── conn.ex │ │ ├── connection_pool.ex │ │ └── connection_pool │ │ │ ├── reclaimer.ex │ │ │ ├── worker.ex │ │ │ └── worker_supervisor.ex │ ├── hashtag.ex │ ├── healthcheck.ex │ ├── helpers │ │ ├── auth_helper.ex │ │ ├── inet_helper.ex │ │ ├── media_helper.ex │ │ ├── qt_fast_start.ex │ │ └── uri_helper.ex │ ├── html.ex │ ├── http.ex │ ├── http │ │ ├── adapter_helper.ex │ │ ├── adapter_helper │ │ │ ├── default.ex │ │ │ ├── gun.ex │ │ │ └── hackney.ex │ │ ├── ex_aws.ex │ │ ├── request.ex │ │ ├── request_builder.ex │ │ ├── tzdata.ex │ │ └── web_push.ex │ ├── instances.ex │ ├── instances │ │ └── instance.ex │ ├── job_queue_monitor.ex │ ├── jwt.ex │ ├── keys.ex │ ├── language │ │ ├── language_detector.ex │ │ ├── language_detector │ │ │ ├── fasttext.ex │ │ │ └── provider.ex │ │ ├── translation.ex │ │ └── translation │ │ │ ├── deepl.ex │ │ │ ├── libretranslate.ex │ │ │ └── provider.ex │ ├── list.ex │ ├── logging.ex │ ├── maintenance.ex │ ├── maps.ex │ ├── marker.ex │ ├── mfa.ex │ ├── mfa │ │ ├── backup_codes.ex │ │ ├── changeset.ex │ │ ├── settings.ex │ │ ├── token.ex │ │ └── totp.ex │ ├── migration_helper │ │ └── notification_backfill.ex │ ├── migrators │ │ ├── context_objects_deletion_migrator.ex │ │ ├── hashtags_table_migrator.ex │ │ └── support │ │ │ ├── base_migrator.ex │ │ │ └── base_migrator_state.ex │ ├── moderation_log.ex │ ├── notification.ex │ ├── object.ex │ ├── object │ │ ├── containment.ex │ │ ├── fetcher.ex │ │ └── updater.ex │ ├── object_tombstone.ex │ ├── otp_version.ex │ ├── pagination.ex │ ├── password │ │ └── pbkdf2.ex │ ├── password_reset_token.ex │ ├── prom_ex.ex │ ├── registration.ex │ ├── release_tasks.ex │ ├── repo.ex │ ├── report_note.ex │ ├── reverse_proxy.ex │ ├── reverse_proxy │ │ ├── client.ex │ │ └── client │ │ │ ├── hackney.ex │ │ │ ├── tesla.ex │ │ │ └── wrapper.ex │ ├── rule.ex │ ├── scheduled_activity.ex │ ├── search.ex │ ├── search │ │ ├── database_search.ex │ │ ├── meilisearch.ex │ │ └── search_backend.ex │ ├── signature.ex │ ├── stats.ex │ ├── telemetry │ │ └── logger.ex │ ├── tesla │ │ └── middleware │ │ │ └── connection_pool.ex │ ├── tests │ │ └── auth_test_controller.ex │ ├── thread_mute.ex │ ├── upload.ex │ ├── upload │ │ ├── filter.ex │ │ └── filter │ │ │ ├── analyze_metadata.ex │ │ │ ├── anonymize_filename.ex │ │ │ ├── dedupe.ex │ │ │ ├── exiftool │ │ │ ├── read_description.ex │ │ │ └── strip_location.ex │ │ │ ├── mogrifun.ex │ │ │ ├── mogrify.ex │ │ │ ├── only_media.ex │ │ │ └── set_meta.ex │ ├── uploaders │ │ ├── local.ex │ │ ├── s3.ex │ │ └── uploader.ex │ ├── user.ex │ ├── user │ │ ├── backup.ex │ │ ├── email_list.ex │ │ ├── import.ex │ │ ├── notification_setting.ex │ │ ├── query.ex │ │ ├── search.ex │ │ ├── welcome_chat_message.ex │ │ ├── welcome_email.ex │ │ └── welcome_message.ex │ ├── user_invite_token.ex │ ├── user_note.ex │ ├── user_relationship.ex │ ├── utils.ex │ ├── web.ex │ ├── web │ │ ├── activity_pub │ │ │ ├── activity_pub.ex │ │ │ ├── activity_pub │ │ │ │ ├── persisting.ex │ │ │ │ └── streaming.ex │ │ │ ├── activity_pub_controller.ex │ │ │ ├── builder.ex │ │ │ ├── internal_fetch_actor.ex │ │ │ ├── mrf.ex │ │ │ ├── mrf │ │ │ │ ├── activity_expiration_policy.ex │ │ │ │ ├── anti_duplication_policy.ex │ │ │ │ ├── anti_followbot_policy.ex │ │ │ │ ├── anti_link_spam_policy.ex │ │ │ │ ├── anti_mention_spam_policy.ex │ │ │ │ ├── block_notification_policy.ex │ │ │ │ ├── drop_policy.ex │ │ │ │ ├── emoji_policy.ex │ │ │ │ ├── ensure_re_prepended.ex │ │ │ │ ├── follow_bot_policy.ex │ │ │ │ ├── force_bot_unlisted_policy.ex │ │ │ │ ├── force_mentions_in_content.ex │ │ │ │ ├── hashtag_policy.ex │ │ │ │ ├── hellthread_policy.ex │ │ │ │ ├── inline_quote_policy.ex │ │ │ │ ├── keyword_policy.ex │ │ │ │ ├── media_proxy_warming_policy.ex │ │ │ │ ├── mention_policy.ex │ │ │ │ ├── no_empty_policy.ex │ │ │ │ ├── no_op_policy.ex │ │ │ │ ├── no_placeholder_text_policy.ex │ │ │ │ ├── normalize_markup.ex │ │ │ │ ├── nsfw_api_policy.ex │ │ │ │ ├── object_age_policy.ex │ │ │ │ ├── pipeline_filtering.ex │ │ │ │ ├── policy.ex │ │ │ │ ├── quote_to_link_tag_policy.ex │ │ │ │ ├── reject_non_public.ex │ │ │ │ ├── remote_report_policy.ex │ │ │ │ ├── simple_policy.ex │ │ │ │ ├── steal_emoji_policy.ex │ │ │ │ ├── subchain_policy.ex │ │ │ │ ├── tag_policy.ex │ │ │ │ ├── user_allow_list_policy.ex │ │ │ │ ├── utils.ex │ │ │ │ └── vocabulary_policy.ex │ │ │ ├── object_validator.ex │ │ │ ├── object_validator │ │ │ │ └── validating.ex │ │ │ ├── object_validators │ │ │ │ ├── accept_reject_validator.ex │ │ │ │ ├── add_remove_validator.ex │ │ │ │ ├── announce_validator.ex │ │ │ │ ├── answer_validator.ex │ │ │ │ ├── article_note_page_validator.ex │ │ │ │ ├── attachment_validator.ex │ │ │ │ ├── audio_image_video_validator.ex │ │ │ │ ├── block_validator.ex │ │ │ │ ├── chat_message_validator.ex │ │ │ │ ├── common_fields.ex │ │ │ │ ├── common_fixes.ex │ │ │ │ ├── common_validations.ex │ │ │ │ ├── create_chat_message_validator.ex │ │ │ │ ├── create_generic_validator.ex │ │ │ │ ├── delete_validator.ex │ │ │ │ ├── emoji_react_validator.ex │ │ │ │ ├── event_validator.ex │ │ │ │ ├── follow_validator.ex │ │ │ │ ├── join_validator.ex │ │ │ │ ├── leave_validator.ex │ │ │ │ ├── like_validator.ex │ │ │ │ ├── place_validator.ex │ │ │ │ ├── question_options_validator.ex │ │ │ │ ├── question_validator.ex │ │ │ │ ├── tag_validator.ex │ │ │ │ ├── undo_validator.ex │ │ │ │ └── update_validator.ex │ │ │ ├── pipeline.ex │ │ │ ├── publisher.ex │ │ │ ├── relay.ex │ │ │ ├── side_effects.ex │ │ │ ├── side_effects │ │ │ │ └── handling.ex │ │ │ ├── transmogrifier.ex │ │ │ ├── utils.ex │ │ │ ├── views │ │ │ │ ├── object_view.ex │ │ │ │ └── user_view.ex │ │ │ └── visibility.ex │ │ ├── admin_api │ │ │ ├── controllers │ │ │ │ ├── admin_api_controller.ex │ │ │ │ ├── announcement_controller.ex │ │ │ │ ├── chat_controller.ex │ │ │ │ ├── config_controller.ex │ │ │ │ ├── email_list_controller.ex │ │ │ │ ├── fallback_controller.ex │ │ │ │ ├── frontend_controller.ex │ │ │ │ ├── instance_controller.ex │ │ │ │ ├── instance_document_controller.ex │ │ │ │ ├── invite_controller.ex │ │ │ │ ├── media_proxy_cache_controller.ex │ │ │ │ ├── o_auth_app_controller.ex │ │ │ │ ├── relay_controller.ex │ │ │ │ ├── report_controller.ex │ │ │ │ ├── rule_controller.ex │ │ │ │ ├── status_controller.ex │ │ │ │ ├── user_controller.ex │ │ │ │ └── webhook_controller.ex │ │ │ ├── report.ex │ │ │ ├── search.ex │ │ │ └── views │ │ │ │ ├── account_view.ex │ │ │ │ ├── announcement_view.ex │ │ │ │ ├── chat_view.ex │ │ │ │ ├── config_view.ex │ │ │ │ ├── frontend_view.ex │ │ │ │ ├── invite_view.ex │ │ │ │ ├── media_proxy_cache_view.ex │ │ │ │ ├── moderation_log_view.ex │ │ │ │ ├── o_auth_app_view.ex │ │ │ │ ├── report_view.ex │ │ │ │ ├── rule_view.ex │ │ │ │ ├── status_view.ex │ │ │ │ ├── user_view.ex │ │ │ │ └── webhook_view.ex │ │ ├── api_spec.ex │ │ ├── api_spec │ │ │ ├── cast_and_validate.ex │ │ │ ├── helpers.ex │ │ │ ├── operations │ │ │ │ ├── account_operation.ex │ │ │ │ ├── admin │ │ │ │ │ ├── announcement_operation.ex │ │ │ │ │ ├── chat_operation.ex │ │ │ │ │ ├── config_operation.ex │ │ │ │ │ ├── frontend_operation.ex │ │ │ │ │ ├── instance_document_operation.ex │ │ │ │ │ ├── invite_operation.ex │ │ │ │ │ ├── media_proxy_cache_operation.ex │ │ │ │ │ ├── o_auth_app_operation.ex │ │ │ │ │ ├── relay_operation.ex │ │ │ │ │ ├── report_operation.ex │ │ │ │ │ ├── rule_operation.ex │ │ │ │ │ ├── status_operation.ex │ │ │ │ │ ├── user_operation.ex │ │ │ │ │ └── webhook_operation.ex │ │ │ │ ├── announcement_operation.ex │ │ │ │ ├── app_operation.ex │ │ │ │ ├── chat_operation.ex │ │ │ │ ├── conversation_operation.ex │ │ │ │ ├── custom_emoji_operation.ex │ │ │ │ ├── directory_operation.ex │ │ │ │ ├── domain_block_operation.ex │ │ │ │ ├── emoji_reaction_operation.ex │ │ │ │ ├── filter_operation.ex │ │ │ │ ├── follow_request_operation.ex │ │ │ │ ├── instance_operation.ex │ │ │ │ ├── list_operation.ex │ │ │ │ ├── marker_operation.ex │ │ │ │ ├── mastodon_admin │ │ │ │ │ ├── account_operation.ex │ │ │ │ │ └── report_operation.ex │ │ │ │ ├── media_operation.ex │ │ │ │ ├── notification_operation.ex │ │ │ │ ├── pleroma_account_operation.ex │ │ │ │ ├── pleroma_app_operation.ex │ │ │ │ ├── pleroma_backup_operation.ex │ │ │ │ ├── pleroma_conversation_operation.ex │ │ │ │ ├── pleroma_emoji_file_operation.ex │ │ │ │ ├── pleroma_emoji_pack_operation.ex │ │ │ │ ├── pleroma_event_operation.ex │ │ │ │ ├── pleroma_instances_operation.ex │ │ │ │ ├── pleroma_mascot_operation.ex │ │ │ │ ├── pleroma_notification_operation.ex │ │ │ │ ├── pleroma_report_operation.ex │ │ │ │ ├── pleroma_scrobble_operation.ex │ │ │ │ ├── pleroma_search_operation.ex │ │ │ │ ├── pleroma_status_operation.ex │ │ │ │ ├── poll_operation.ex │ │ │ │ ├── report_operation.ex │ │ │ │ ├── scheduled_activity_operation.ex │ │ │ │ ├── search_operation.ex │ │ │ │ ├── status_operation.ex │ │ │ │ ├── streaming_operation.ex │ │ │ │ ├── subscription_operation.ex │ │ │ │ ├── timeline_operation.ex │ │ │ │ ├── twitter_util_operation.ex │ │ │ │ └── user_import_operation.ex │ │ │ ├── render_error.ex │ │ │ ├── schemas │ │ │ │ ├── account.ex │ │ │ │ ├── account_field.ex │ │ │ │ ├── account_relationship.ex │ │ │ │ ├── actor_type.ex │ │ │ │ ├── announcement.ex │ │ │ │ ├── api_error.ex │ │ │ │ ├── app.ex │ │ │ │ ├── attachment.ex │ │ │ │ ├── boolean_like.ex │ │ │ │ ├── chat.ex │ │ │ │ ├── chat_message.ex │ │ │ │ ├── conversation.ex │ │ │ │ ├── emoji.ex │ │ │ │ ├── event.ex │ │ │ │ ├── flake_id.ex │ │ │ │ ├── list.ex │ │ │ │ ├── location_result.ex │ │ │ │ ├── participation_request.ex │ │ │ │ ├── poll.ex │ │ │ │ ├── push_subscription.ex │ │ │ │ ├── scheduled_status.ex │ │ │ │ ├── status.ex │ │ │ │ ├── tag.ex │ │ │ │ └── visibility_scope.ex │ │ │ └── scopes │ │ │ │ ├── compiler.ex │ │ │ │ └── translator.ex │ │ ├── auth │ │ │ ├── authenticator.ex │ │ │ ├── helpers.ex │ │ │ ├── ldap_authenticator.ex │ │ │ ├── pleroma_authenticator.ex │ │ │ ├── totp_authenticator.ex │ │ │ └── wrapper_authenticator.ex │ │ ├── common_api.ex │ │ ├── common_api │ │ │ ├── activity_draft.ex │ │ │ └── utils.ex │ │ ├── controller_helper.ex │ │ ├── embed_controller.ex │ │ ├── endpoint.ex │ │ ├── fallback │ │ │ ├── legacy_pleroma_api_rerouter_plug.ex │ │ │ └── redirect_controller.ex │ │ ├── federator.ex │ │ ├── federator │ │ │ ├── publisher.ex │ │ │ └── publishing.ex │ │ ├── feed │ │ │ ├── feed_view.ex │ │ │ ├── tag_controller.ex │ │ │ └── user_controller.ex │ │ ├── gettext.ex │ │ ├── instance_document.ex │ │ ├── mailer │ │ │ └── subscription_controller.ex │ │ ├── manifest_controller.ex │ │ ├── mastodon_api │ │ │ ├── admin │ │ │ │ ├── controllers │ │ │ │ │ ├── account_controller.ex │ │ │ │ │ └── report_controller.ex │ │ │ │ └── views │ │ │ │ │ ├── account_view.ex │ │ │ │ │ └── report_view.ex │ │ │ ├── controllers │ │ │ │ ├── account_controller.ex │ │ │ │ ├── announcement_controller.ex │ │ │ │ ├── app_controller.ex │ │ │ │ ├── auth_controller.ex │ │ │ │ ├── conversation_controller.ex │ │ │ │ ├── custom_emoji_controller.ex │ │ │ │ ├── directory_controller.ex │ │ │ │ ├── domain_block_controller.ex │ │ │ │ ├── fallback_controller.ex │ │ │ │ ├── filter_controller.ex │ │ │ │ ├── follow_request_controller.ex │ │ │ │ ├── instance_controller.ex │ │ │ │ ├── list_controller.ex │ │ │ │ ├── marker_controller.ex │ │ │ │ ├── mastodon_api_controller.ex │ │ │ │ ├── media_controller.ex │ │ │ │ ├── notification_controller.ex │ │ │ │ ├── poll_controller.ex │ │ │ │ ├── report_controller.ex │ │ │ │ ├── scheduled_activity_controller.ex │ │ │ │ ├── search_controller.ex │ │ │ │ ├── status_controller.ex │ │ │ │ ├── subscription_controller.ex │ │ │ │ ├── suggestion_controller.ex │ │ │ │ └── timeline_controller.ex │ │ │ ├── mastodon_api.ex │ │ │ ├── views │ │ │ │ ├── account_view.ex │ │ │ │ ├── announcement_view.ex │ │ │ │ ├── app_view.ex │ │ │ │ ├── conversation_view.ex │ │ │ │ ├── custom_emoji_view.ex │ │ │ │ ├── filter_view.ex │ │ │ │ ├── follow_request_view.ex │ │ │ │ ├── instance_view.ex │ │ │ │ ├── list_view.ex │ │ │ │ ├── marker_view.ex │ │ │ │ ├── media_view.ex │ │ │ │ ├── notification_view.ex │ │ │ │ ├── poll_view.ex │ │ │ │ ├── report_view.ex │ │ │ │ ├── scheduled_activity_view.ex │ │ │ │ ├── status_view.ex │ │ │ │ ├── subscription_view.ex │ │ │ │ ├── suggestion_view.ex │ │ │ │ └── timeline_view.ex │ │ │ └── websocket_handler.ex │ │ ├── media_proxy.ex │ │ ├── media_proxy │ │ │ ├── invalidation.ex │ │ │ ├── invalidation │ │ │ │ ├── http.ex │ │ │ │ └── script.ex │ │ │ └── media_proxy_controller.ex │ │ ├── metadata.ex │ │ ├── metadata │ │ │ ├── player_view.ex │ │ │ ├── providers │ │ │ │ ├── feed.ex │ │ │ │ ├── open_graph.ex │ │ │ │ ├── provider.ex │ │ │ │ ├── rel_me.ex │ │ │ │ ├── restrict_indexing.ex │ │ │ │ └── twitter_card.ex │ │ │ └── utils.ex │ │ ├── mongoose_im │ │ │ └── mongoose_im_controller.ex │ │ ├── multipart.ex │ │ ├── nodeinfo │ │ │ ├── nodeinfo.ex │ │ │ └── nodeinfo_controller.ex │ │ ├── o_auth.ex │ │ ├── o_auth │ │ │ ├── app.ex │ │ │ ├── authorization.ex │ │ │ ├── fallback_controller.ex │ │ │ ├── mfa_controller.ex │ │ │ ├── mfa_view.ex │ │ │ ├── o_auth_controller.ex │ │ │ ├── o_auth_view.ex │ │ │ ├── scopes.ex │ │ │ ├── token.ex │ │ │ └── token │ │ │ │ ├── query.ex │ │ │ │ ├── strategy │ │ │ │ ├── refresh_token.ex │ │ │ │ └── revoke.ex │ │ │ │ └── utils.ex │ │ ├── o_status │ │ │ └── o_status_controller.ex │ │ ├── pleroma_api │ │ │ ├── controllers │ │ │ │ ├── account_controller.ex │ │ │ │ ├── app_controller.ex │ │ │ │ ├── backup_controller.ex │ │ │ │ ├── chat_controller.ex │ │ │ │ ├── conversation_controller.ex │ │ │ │ ├── emoji_file_controller.ex │ │ │ │ ├── emoji_pack_controller.ex │ │ │ │ ├── emoji_reaction_controller.ex │ │ │ │ ├── event_controller.ex │ │ │ │ ├── instances_controller.ex │ │ │ │ ├── mascot_controller.ex │ │ │ │ ├── notification_controller.ex │ │ │ │ ├── report_controller.ex │ │ │ │ ├── scrobble_controller.ex │ │ │ │ ├── search_controller.ex │ │ │ │ ├── status_controller.ex │ │ │ │ ├── two_factor_authentication_controller.ex │ │ │ │ └── user_import_controller.ex │ │ │ └── views │ │ │ │ ├── account_view.ex │ │ │ │ ├── app_view.ex │ │ │ │ ├── backup_view.ex │ │ │ │ ├── chat │ │ │ │ └── message_reference_view.ex │ │ │ │ ├── chat_view.ex │ │ │ │ ├── conversation_view.ex │ │ │ │ ├── emoji_reaction_view.ex │ │ │ │ ├── event_view.ex │ │ │ │ ├── notification_view.ex │ │ │ │ ├── report_view.ex │ │ │ │ ├── scrobble_view.ex │ │ │ │ └── search_view.ex │ │ ├── plug.ex │ │ ├── plugs │ │ │ ├── admin_secret_authentication_plug.ex │ │ │ ├── authentication_plug.ex │ │ │ ├── basic_auth_decoder_plug.ex │ │ │ ├── cache.ex │ │ │ ├── digest_plug.ex │ │ │ ├── ensure_authenticated_plug.ex │ │ │ ├── ensure_privileged_plug.ex │ │ │ ├── ensure_public_or_authenticated_plug.ex │ │ │ ├── ensure_user_token_assigns_plug.ex │ │ │ ├── expect_authenticated_check_plug.ex │ │ │ ├── expect_public_or_authenticated_check_plug.ex │ │ │ ├── federating_plug.ex │ │ │ ├── frontend_static.ex │ │ │ ├── http_security_plug.ex │ │ │ ├── http_signature_plug.ex │ │ │ ├── idempotency_plug.ex │ │ │ ├── instance_static.ex │ │ │ ├── mapped_signature_to_identity_plug.ex │ │ │ ├── metrics_predicate.ex │ │ │ ├── o_auth_plug.ex │ │ │ ├── o_auth_scopes_plug.ex │ │ │ ├── plug_helper.ex │ │ │ ├── rate_limiter.ex │ │ │ ├── rate_limiter │ │ │ │ ├── limiter_supervisor.ex │ │ │ │ └── supervisor.ex │ │ │ ├── remote_ip.ex │ │ │ ├── set_application_plug.ex │ │ │ ├── set_format_plug.ex │ │ │ ├── set_locale_plug.ex │ │ │ ├── set_user_session_id_plug.ex │ │ │ ├── static_fe_plug.ex │ │ │ ├── trailing_format_plug.ex │ │ │ ├── uploaded_media.ex │ │ │ ├── user_enabled_plug.ex │ │ │ ├── user_fetcher_plug.ex │ │ │ ├── user_is_admin_plug.ex │ │ │ ├── user_is_staff_plug.ex │ │ │ └── user_tracking_plug.ex │ │ ├── preload.ex │ │ ├── preload │ │ │ └── providers │ │ │ │ ├── instance.ex │ │ │ │ ├── provider.ex │ │ │ │ ├── timelines.ex │ │ │ │ └── user.ex │ │ ├── push.ex │ │ ├── push │ │ │ ├── impl.ex │ │ │ └── subscription.ex │ │ ├── rel_me.ex │ │ ├── rich_media │ │ │ ├── helpers.ex │ │ │ ├── parser.ex │ │ │ ├── parser │ │ │ │ ├── card.ex │ │ │ │ ├── embed.ex │ │ │ │ ├── meta_tags.ex │ │ │ │ ├── ttl.ex │ │ │ │ └── ttl │ │ │ │ │ └── aws_signed_url.ex │ │ │ └── parsers │ │ │ │ ├── o_embed.ex │ │ │ │ ├── ogp.ex │ │ │ │ └── twitter_card.ex │ │ ├── router.ex │ │ ├── static_fe │ │ │ ├── static_fe_controller.ex │ │ │ └── static_fe_view.ex │ │ ├── streamer.ex │ │ ├── templates │ │ │ ├── email │ │ │ │ ├── digest.html.eex │ │ │ │ └── new_users_digest.html.eex │ │ │ ├── embed │ │ │ │ ├── _attachment.html.eex │ │ │ │ └── show.html.eex │ │ │ ├── feed │ │ │ │ └── feed │ │ │ │ │ ├── _activity.atom.eex │ │ │ │ │ ├── _activity.rss.eex │ │ │ │ │ ├── _author.atom.eex │ │ │ │ │ ├── _author.rss.eex │ │ │ │ │ ├── _tag_activity.atom.eex │ │ │ │ │ ├── _tag_activity.xml.eex │ │ │ │ │ ├── _tag_author.atom.eex │ │ │ │ │ ├── tag.atom.eex │ │ │ │ │ ├── tag.rss.eex │ │ │ │ │ ├── user.atom.eex │ │ │ │ │ └── user.rss.eex │ │ │ ├── layout │ │ │ │ ├── app.html.eex │ │ │ │ ├── email.html.eex │ │ │ │ ├── email_styled.html.eex │ │ │ │ ├── embed.html.eex │ │ │ │ ├── metadata_player.html.eex │ │ │ │ └── static_fe.html.eex │ │ │ ├── mailer │ │ │ │ └── subscription │ │ │ │ │ ├── unsubscribe_failure.html.eex │ │ │ │ │ └── unsubscribe_success.html.eex │ │ │ ├── o_auth │ │ │ │ ├── mfa │ │ │ │ │ ├── recovery.html.eex │ │ │ │ │ └── totp.html.eex │ │ │ │ └── o_auth │ │ │ │ │ ├── _scopes.html.eex │ │ │ │ │ ├── consumer.html.eex │ │ │ │ │ ├── oob_authorization_created.html.eex │ │ │ │ │ ├── oob_token_exists.html.eex │ │ │ │ │ ├── register.html.eex │ │ │ │ │ └── show.html.eex │ │ │ ├── static_fe │ │ │ │ └── static_fe │ │ │ │ │ ├── _attachment.html.eex │ │ │ │ │ ├── _notice.html.eex │ │ │ │ │ ├── _user_card.html.eex │ │ │ │ │ ├── conversation.html.eex │ │ │ │ │ ├── error.html.eex │ │ │ │ │ └── profile.html.eex │ │ │ └── twitter_api │ │ │ │ ├── password │ │ │ │ ├── invalid_token.html.eex │ │ │ │ ├── reset.html.eex │ │ │ │ ├── reset_failed.html.eex │ │ │ │ └── reset_success.html.eex │ │ │ │ ├── remote_follow │ │ │ │ ├── follow.html.eex │ │ │ │ ├── follow_login.html.eex │ │ │ │ ├── follow_mfa.html.eex │ │ │ │ └── followed.html.eex │ │ │ │ └── util │ │ │ │ ├── status_interact.html.eex │ │ │ │ └── subscribe.html.eex │ │ ├── translation_helpers.ex │ │ ├── twitter_api │ │ │ ├── controller.ex │ │ │ ├── controllers │ │ │ │ ├── password_controller.ex │ │ │ │ ├── remote_follow_controller.ex │ │ │ │ └── util_controller.ex │ │ │ ├── twitter_api.ex │ │ │ └── views │ │ │ │ ├── password_view.ex │ │ │ │ ├── remote_follow_view.ex │ │ │ │ ├── token_view.ex │ │ │ │ └── util_view.ex │ │ ├── uploader_controller.ex │ │ ├── utils │ │ │ ├── colors.ex │ │ │ ├── colors │ │ │ │ └── rgb.ex │ │ │ ├── guards.ex │ │ │ └── params.ex │ │ ├── views │ │ │ ├── email_view.ex │ │ │ ├── embed_view.ex │ │ │ ├── error_helpers.ex │ │ │ ├── error_view.ex │ │ │ ├── layout_view.ex │ │ │ ├── mailer │ │ │ │ └── subscription_view.ex │ │ │ ├── manifest_view.ex │ │ │ └── streamer_view.ex │ │ ├── web_finger.ex │ │ ├── web_finger │ │ │ └── web_finger_controller.ex │ │ └── xml.ex │ ├── webhook.ex │ ├── webhook │ │ └── notify.ex │ ├── workers │ │ ├── attachments_cleanup_worker.ex │ │ ├── background_worker.ex │ │ ├── backup_worker.ex │ │ ├── cron │ │ │ ├── digest_emails_worker.ex │ │ │ └── new_users_digest_worker.ex │ │ ├── event_reminder_worker.ex │ │ ├── mailer_worker.ex │ │ ├── mute_expire_worker.ex │ │ ├── notification_worker.ex │ │ ├── poll_worker.ex │ │ ├── publisher_worker.ex │ │ ├── purge_expired_activity.ex │ │ ├── purge_expired_filter.ex │ │ ├── purge_expired_token.ex │ │ ├── receiver_worker.ex │ │ ├── remote_fetcher_worker.ex │ │ ├── scheduled_activity_worker.ex │ │ ├── search_indexing_worker.ex │ │ ├── web_pusher_worker.ex │ │ └── worker_helper.ex │ └── xml_builder.ex └── soapbox.ex ├── mix.exs ├── mix.lock ├── priv ├── gettext │ ├── config_descriptions.pot │ ├── default.pot │ ├── en │ │ └── LC_MESSAGES │ │ │ ├── oauth_scopes.po │ │ │ └── posix_errors.po │ ├── en_test │ │ └── LC_MESSAGES │ │ │ ├── default.po │ │ │ ├── errors.po │ │ │ ├── posix_errors.po │ │ │ └── static_pages.po │ ├── errors.pot │ ├── es │ │ └── LC_MESSAGES │ │ │ └── errors.po │ ├── fr │ │ └── LC_MESSAGES │ │ │ ├── config_descriptions.po │ │ │ ├── default.po │ │ │ ├── errors.po │ │ │ ├── posix_errors.po │ │ │ └── static_pages.po │ ├── he │ │ └── LC_MESSAGES │ │ │ └── errors.po │ ├── id │ │ └── LC_MESSAGES │ │ │ └── errors.po │ ├── it │ │ └── LC_MESSAGES │ │ │ └── errors.po │ ├── ja │ │ └── LC_MESSAGES │ │ │ └── errors.po │ ├── ko │ │ └── LC_MESSAGES │ │ │ └── default.po │ ├── nl │ │ └── LC_MESSAGES │ │ │ ├── errors.po │ │ │ ├── posix_errors.po │ │ │ └── static_pages.po │ ├── oauth_scopes.pot │ ├── pl │ │ └── LC_MESSAGES │ │ │ └── errors.po │ ├── posix_errors.pot │ ├── pt_PT │ │ └── LC_MESSAGES │ │ │ └── errors.po │ ├── ru │ │ └── LC_MESSAGES │ │ │ └── errors.po │ ├── static_pages.pot │ ├── uk │ │ └── LC_MESSAGES │ │ │ ├── config_descriptions.po │ │ │ ├── default.po │ │ │ └── errors.po │ ├── vi │ │ └── LC_MESSAGES │ │ │ └── errors.po │ ├── zh_Hans │ │ └── LC_MESSAGES │ │ │ ├── config_descriptions.po │ │ │ ├── default.po │ │ │ ├── errors.po │ │ │ ├── posix_errors.po │ │ │ └── static_pages.po │ └── zh_Hant │ │ └── LC_MESSAGES │ │ └── errors.po ├── repo │ ├── migrations │ │ ├── 20170320193800_create_user.exs │ │ ├── 20170321074828_create_activity.exs │ │ ├── 20170321074832_create_object.exs │ │ ├── 20170321133335_add_following_list_to_users.exs │ │ ├── 20170321143152_add_ap_id_to_users.exs │ │ ├── 20170330153447_add_index_to_objects.exs │ │ ├── 20170415141210_add_unique_index_to_email_and_nickname.exs │ │ ├── 20170416122418_add_avatar_object_to_users.exs │ │ ├── 20170418200143_create_webssub_server_subscription.exs │ │ ├── 20170423154511_add_fields_to_users.exs │ │ ├── 20170426154155_create_websub_client_subscription.exs │ │ ├── 20170427054757_add_user_and_hub.exs │ │ ├── 20170501124823_add_id_contraints_to_activities_and_objects.exs │ │ ├── 20170501133231_add_id_contraints_to_activities_and_objects_part_two.exs │ │ ├── 20170502083023_add_local_field_to_activities.exs │ │ ├── 20170506222027_add_unique_index_to_apid.exs │ │ ├── 20170522160642_case_insensivtivity.exs │ │ ├── 20170529093232_longer_bios.exs │ │ ├── 20170620095947_remove_activities_index.exs │ │ ├── 20170620133028_add_object_activity_index.exs │ │ ├── 20170620142420_add_object_activity_index_part_two.exs │ │ ├── 20170701142005_add_actor_index_to_activity.exs │ │ ├── 20170719152213_add_follower_address_to_user.exs │ │ ├── 20170906120646_add_mastodon_apps.exs │ │ ├── 20170906143140_create_o_auth_authorizations.exs │ │ ├── 20170906152508_create_o_auth_token.exs │ │ ├── 20170911123607_create_notifications.exs │ │ ├── 20170912114248_add_context_index.exs │ │ ├── 20170916090107_add_fts_index_to_activities.exs │ │ ├── 20170917120416_add_tag_index.exs │ │ ├── 20171019141706_create_password_reset_tokens.exs │ │ ├── 20171023155035_add_second_object_index_to_activty.exs │ │ ├── 20171024090137_drop_object_index.exs │ │ ├── 20171024121413_add_object_actor_index.exs │ │ ├── 20171109091239_add_actor_to_activity.exs │ │ ├── 20171109114020_fill_actor_field.exs │ │ ├── 20171109141309_add_sort_index_to_activities.exs │ │ ├── 20171130135819_add_local_index_to_user.exs │ │ ├── 20171212163643_add_recipients_to_activities.exs │ │ ├── 20171212164525_fill_recipients_in_activities.exs │ │ ├── 20180221210540_make_following_postgres_array.exs │ │ ├── 20180325172351_add_follower_address_index_to_users.exs │ │ ├── 20180327174350_drop_local_index_on_activities.exs │ │ ├── 20180327175831_actually_drop_local_index.exs │ │ ├── 20180429094642_create_lists.exs │ │ ├── 20180513104714_modify_activity_index.exs │ │ ├── 20180516144508_add_trigram_extension.exs │ │ ├── 20180516154905_create_user_trigram_index.exs │ │ ├── 20180530123448_add_list_follow_index.exs │ │ ├── 20180606173637_create_apid_host_extraction_index.exs │ │ ├── 20180612110515_create_user_invite_tokens.exs │ │ ├── 20180617221540_create_activities_in_reply_to_index.exs │ │ ├── 20180813003722_create_filters.exs │ │ ├── 20180829082446_add_recipients_to_and_cc_fields_to_activities.exs │ │ ├── 20180829182612_activities_add_to_cc_indices.exs │ │ ├── 20180829183529_remove_recipients_to_and_cc_fields_from_activities.exs │ │ ├── 20180903114437_users_add_is_moderator_index.exs │ │ ├── 20180918182427_create_push_subscriptions.exs │ │ ├── 20180919060348_users_add_last_refreshed_at.exs │ │ ├── 20181201104428_add_uuid_extension.exs │ │ ├── 20181201105617_add_uui_ds_to_user_info.exs │ │ ├── 20181206125616_add_tags_to_users.exs │ │ ├── 20181214121049_add_bookmarks_to_users.exs │ │ ├── 20181218172826_users_and_activities_flake_id.exs │ │ ├── 20190109152453_add_visibility_function.exs │ │ ├── 20190115085500_create_user_fts_index.exs │ │ ├── 20190118074940_fix_user_trigram_index.exs │ │ ├── 20190122153157_update_activity_visibility.exs │ │ ├── 20190123092341_users_add_is_admin_index.exs │ │ ├── 20190123125546_create_instances.exs │ │ ├── 20190123125839_fix_info_ids.exs │ │ ├── 20190124131141_update_activity_visibility_again.exs │ │ ├── 20190126160540_change_push_subscriptions_varchar.exs │ │ ├── 20190127151220_add_activities_likes_index.exs │ │ ├── 20190203185340_split_hide_network.exs │ │ ├── 20190204200237_add_correct_dm_index.exs │ │ ├── 20190205114625_create_thread_mutes.exs │ │ ├── 20190208131753_add_scopes_to_o_auth_entities.exs │ │ ├── 20190213185503_change_apps_scopes_to_varchar_array.exs │ │ ├── 20190213185600_data_migration_populate_o_auth_scopes.exs │ │ ├── 20190222104808_data_migration_normalize_scopes.exs │ │ ├── 20190301101154_add_default_tags_to_user.exs │ │ ├── 20190303120636_update_user_note_counters.exs │ │ ├── 20190315101315_create_registrations.exs │ │ ├── 20190325185009_create_notification_id_index.exs │ │ ├── 20190328053912_create_scheduled_activities.exs │ │ ├── 20190403131720_add_oauth_token_indexes.exs │ │ ├── 20190404050946_add_fields_to_user_invite_tokens.exs │ │ ├── 20190405160700_add_index_on_subscribers.exs │ │ ├── 20190408123347_create_conversations.exs │ │ ├── 20190410152859_add_participation_updated_at_index.exs │ │ ├── 20190411094120_add_index_on_user_info_deactivated.exs │ │ ├── 20190412052952_add_user_info_fields.exs │ │ ├── 20190413082658_create_bookmarks.exs │ │ ├── 20190413085040_add_signin_and_last_digest_dates_to_user.exs │ │ ├── 20190414125034_migrate_old_bookmarks.exs │ │ ├── 20190501125843_add_fts_index_to_objects.exs │ │ ├── 20190501133552_add_refresh_token_index_to_token.exs │ │ ├── 20190506054542_add_multi_factor_authentication_settings_to_user.exs │ │ ├── 20190508193213_create_mfa_tokens.exs │ │ ├── 20190511191044_set_default_state_to_reports.exs │ │ ├── 20190513175809_change_hide_column_in_filter_table.exs │ │ ├── 20190515222404_add_thread_visibility_function.exs │ │ ├── 20190516112144_add_ap_id_to_lists.exs │ │ ├── 20190518032627_create_config.exs │ │ ├── 20190525071417_add_non_follows_and_non_followers_fields_to_notification_settings.exs │ │ ├── 20190603115238_add_index_on_activities_local.exs │ │ ├── 20190603162018_add_object_in_reply_to_index.exs │ │ ├── 20190603173419_add_tag_index_to_objects.exs │ │ ├── 20190622151019_add_group_key_to_config.exs │ │ ├── 20190710115833_add_following_address_to_user.exs │ │ ├── 20190710125051_add_following_address_index_to_user.exs │ │ ├── 20190710125158_add_following_address_from_source_data.exs │ │ ├── 20190711042021_create_safe_jsonb_set.exs │ │ ├── 20190711042024_copy_muted_to_muted_notifications.exs │ │ ├── 20190716100804_add_expirations_table.exs │ │ ├── 20190730055101_add_oban_jobs_table.exs │ │ ├── 20190801154554_create_conversation_participation_recipient_ships.exs │ │ ├── 20190818124341_create_moderation_log.exs │ │ ├── 20190823000549_add_likes_index_to_objects.exs │ │ ├── 20190912065617_create_deliveries.exs │ │ ├── 20190917100019_update_oban.exs │ │ ├── 20190929201536_drop_subscription_if_exists.exs │ │ ├── 20191005165212_add_unread_conversation_count_to_user_info.exs │ │ ├── 20191006123824_add_keys_column.exs │ │ ├── 20191006135457_move_keys_to_separate_column.exs │ │ ├── 20191007073319_create_following_relationships.exs │ │ ├── 20191008132217_migrate_following_relationships.exs │ │ ├── 20191008132427_drop_users_following.exs │ │ ├── 20191009154606_add_user_info_columns.exs │ │ ├── 20191009154608_copy_users_info_fields_to_users.exs │ │ ├── 20191014181019_create_markers.exs │ │ ├── 20191017225002_drop_websub_tables.exs │ │ ├── 20191025081729_add_move_support_to_users.exs │ │ ├── 20191025143434_add_defaults_to_tables.exs │ │ ├── 20191026190317_set_not_null_for_activities.exs │ │ ├── 20191026190415_set_not_null_for_activity_expirations.exs │ │ ├── 20191026190500_set_not_null_for_apps.exs │ │ ├── 20191026190533_set_not_null_for_bookmarks.exs │ │ ├── 20191026190622_set_not_null_for_config.exs │ │ ├── 20191026190712_set_not_null_for_conversation_participation_recipient_ships.exs │ │ ├── 20191026190759_set_not_null_for_conversation_participations.exs │ │ ├── 20191026190841_set_not_null_for_filters.exs │ │ ├── 20191026191023_set_not_null_for_instances.exs │ │ ├── 20191026191100_set_not_null_for_lists.exs │ │ ├── 20191026191134_set_not_null_for_markers.exs │ │ ├── 20191026191218_set_not_null_for_moderation_log.exs │ │ ├── 20191026191249_set_not_null_for_notifications.exs │ │ ├── 20191026191328_set_not_null_for_oauth_authorizations.exs │ │ ├── 20191026191401_set_not_null_for_oauth_tokens.exs │ │ ├── 20191026191442_set_not_null_for_objects.exs │ │ ├── 20191026191524_set_not_null_for_password_reset_tokens.exs │ │ ├── 20191026191603_set_not_null_for_push_subscriptions.exs │ │ ├── 20191026191635_set_not_null_for_registrations.exs │ │ ├── 20191026191711_set_not_null_for_scheduled_activities.exs │ │ ├── 20191026191753_set_not_null_for_thread_mutes.exs │ │ ├── 20191026191826_set_not_null_for_user_invite_tokens.exs │ │ ├── 20191026191910_set_not_null_for_users.exs │ │ ├── 20191029101340_migrate_missing_follow_requests.exs │ │ ├── 20191029172832_fix_blocked_follows.exs │ │ ├── 20191104133100_set_visible_service_actors.exs │ │ ├── 20191118084425_create_user_relationships.exs │ │ ├── 20191118084500_data_migration_populate_user_relationships.exs │ │ ├── 20191123030554_add_activitypub_actor_type.exs │ │ ├── 20191123103423_remove_info_from_users.exs │ │ ├── 20191128153944_fix_missing_following_count.exs │ │ ├── 20191203043610_create_report_notes.exs │ │ ├── 20191220174645_add_scopes_to_pleroma_feo_auth_records.exs │ │ ├── 20200109123126_add_counter_cache_table.exs │ │ ├── 20200227122417_add_trusted_to_apps.exs │ │ ├── 20200307103755_fix_moderation_log_subjects.exs │ │ ├── 20200309123730_create_chats.exs │ │ ├── 20200314123607_config_remove_fetch_initial_posts.exs │ │ ├── 20200315125756_delete_fetch_initial_posts_jobs.exs │ │ ├── 20200322174133_user_raw_bio.exs │ │ ├── 20200323122421_mrf_config_move_from_instance_namespace.exs │ │ ├── 20200328124805_change_following_relationships_state_to_integer.exs │ │ ├── 20200328130139_add_following_relationships_following_id_index.exs │ │ ├── 20200328193433_populate_user_raw_bio.exs │ │ ├── 20200401030751_users_add_public_key.exs │ │ ├── 20200401072456_users_add_inboxes.exs │ │ ├── 20200402063221_update_oban_jobs_table.exs │ │ ├── 20200406100225_users_add_emoji.exs │ │ ├── 20200406105422_users_remove_source_data.exs │ │ ├── 20200415181818_update_markers.exs │ │ ├── 20200428221338_insert_skeletons_for_deleted_users.exs │ │ ├── 20200505072231_remove_magic_key_field.exs │ │ ├── 20200508092434_update_counter_cache_table.exs │ │ ├── 20200520155351_add_recipients_contain_blocked_domains_function.exs │ │ ├── 20200526144426_add_apps_indexes.exs │ │ ├── 20200527104138_change_notification_user_index.exs │ │ ├── 20200527163635_delete_notifications_from_invisible_users.exs │ │ ├── 20200602094828_add_type_to_notifications.exs │ │ ├── 20200602125218_backfill_notification_types.exs │ │ ├── 20200602150528_create_chat_message_reference.exs │ │ ├── 20200603105113_add_unique_index_to_chat_message_references.exs │ │ ├── 20200603120448_remove_unread_from_chats.exs │ │ ├── 20200603122732_add_seen_index_to_chat_message_references.exs │ │ ├── 20200604150318_migrate_seen_to_unread_in_chat_message_references.exs │ │ ├── 20200606105430_change_type_to_enum_for_notifications.exs │ │ ├── 20200607112923_change_chat_id_to_flake.exs │ │ ├── 20200626163359_rename_notification_privacy_option.exs │ │ ├── 20200630162024_rename_user_settings_col.exs │ │ ├── 20200703101031_add_chat_acceptance_to_users.exs │ │ ├── 20200706060258_remove_tesla_from_config.exs │ │ ├── 20200707112859_instances_add_favicon.exs │ │ ├── 20200708193702_drop_user_trigram_index.exs │ │ ├── 20200712234852_add_approval_fields_to_users.exs │ │ ├── 20200714081657_oban_2_0_config_changes.exs │ │ ├── 20200716195806_autolinker_to_linkify.exs │ │ ├── 20200722185515_fix_malformed_formatter_config.exs │ │ ├── 20200724133313_move_welcome_settings.exs │ │ ├── 20200802170532_fix_legacy_tags.exs │ │ ├── 20200804180322_remove_nonlocal_expirations.exs │ │ ├── 20200804183107_add_unique_index_to_app_client_id.exs │ │ ├── 20200806175913_rename_instance_chat.exs │ │ ├── 20200808173046_only_expire_creates.exs │ │ ├── 20200811125613_set_defaults_to_user_approval_pending.exs │ │ ├── 20200811143147_ap_id_not_null.exs │ │ ├── 20200817120935_add_invisible_index_to_users.exs │ │ ├── 20200824115541_rename_activity_expiration_setting.exs │ │ ├── 20200825061316_move_activity_expirations_to_oban.exs │ │ ├── 20200825093037_drop_activity_expirations_table.exs │ │ ├── 20200831114918_remove_unread_conversation_count_from_user.exs │ │ ├── 20200831115854_add_unread_index_to_conversation_participation.exs │ │ ├── 20200831142509_chat_constraints.exs │ │ ├── 20200831152600_add_pleroma_report_to_enum_for_notifications.exs │ │ ├── 20200831192323_create_backups.exs │ │ ├── 20200901061256_ensure_bio_is_string.exs │ │ ├── 20200901061637_bio_set_not_null.exs │ │ ├── 20200905082737_rename_await_up_timeout_in_connections_pool.exs │ │ ├── 20200905091427_rename_timeout_in_pools.exs │ │ ├── 20200906072147_remove_cron_stats_worker_from_oban_config.exs │ │ ├── 20200907084956_remove_cron_clear_oauth_token_worker_from_oban_config.exs │ │ ├── 20200907092050_move_tokens_expiration_into_oban.exs │ │ ├── 20200910113106_remove_managed_config_from_db.exs │ │ ├── 20200911055909_remove_cron_jobs.exs │ │ ├── 20200914105638_delete_notification_without_activity.exs │ │ ├── 20200914105800_add_notification_constraints.exs │ │ ├── 20200915095704_remove_background_jobs.exs │ │ ├── 20200919182636_remoteip_plug_rename.exs │ │ ├── 20200925065249_make_user_ids_ci.exs │ │ ├── 20200928145912_revert_citext_change.exs │ │ ├── 20200930082320_user_ur_is_index_part_three.exs │ │ ├── 20201005123100_simple_policy_string_to_tuple.exs │ │ ├── 20201005124600_quarantained_policy_string_to_tuple.exs │ │ ├── 20201005132900_transparency_exclusions_string_to_tuple.exs │ │ ├── 20201012173004_refactor_deactivated_user_field.exs │ │ ├── 20201013141127_refactor_locked_user_field.exs │ │ ├── 20201013144052_refactor_discoverable_user_field.exs │ │ ├── 20201013184200_refactor_confirmation_pending_user_field.exs │ │ ├── 20201016205220_refactor_approval_pending_user_field.exs │ │ ├── 20201113060459_remove_purge_expired_activity_worker_from_oban_config.exs │ │ ├── 20201217172858_data_migration_prolong_o_auth_tokens_valid_until.exs │ │ ├── 20201221202251_create_hashtags.exs │ │ ├── 20201221202252_remove_data_from_hashtags.exs │ │ ├── 20201221203824_create_hashtags_objects.exs │ │ ├── 20201231185546_confirm_logged_in_users.exs │ │ ├── 20210105195018_create_data_migrations.exs │ │ ├── 20210106183301_data_migration_create_populate_hashtags_table.exs │ │ ├── 20210111172254_create_data_migration_failed_ids.exs │ │ ├── 20210113225652_deprecate_public_endpoint.exs │ │ ├── 20210115205649_upgrade_oban_jobs_to_v9.exs │ │ ├── 20210121080964_add_default_text_search_config.exs │ │ ├── 20210122151424_add_last_active_at_to_users.exs │ │ ├── 20210128092834_remove_duplicates_from_activity_expiration_queue.exs │ │ ├── 20210202110641_add_pinned_objects_to_users.exs │ │ ├── 20210203141144_add_featured_address_to_users.exs │ │ ├── 20210205145000_move_pinned_activities_into_pinned_objects.exs │ │ ├── 20210206045221_remove_pinned_activities_from_users.exs │ │ ├── 20210218223811_add_disclose_client_to_users.exs │ │ ├── 20210222183840_remove_hashtags_objects_duplicate_index.exs │ │ ├── 20210222184616_change_hashtags_name_to_text.exs │ │ ├── 20210401143153_user_notification_settings_fix.exs │ │ ├── 20210416051708_remove_mastofe_settings_from_users.exs │ │ ├── 20210420204354_delete_hashtags_objects_cascade.exs │ │ ├── 20210612185407_add_email_list_field_to_users.exs │ │ ├── 20210717000000_add_poll_to_notifications_enum.exs │ │ ├── 20210818023112_add_user_id_to_apps.exs │ │ ├── 20211121000000_create_user_notes.exs │ │ ├── 20211125110126_force_pinned_objects_to_exist.exs │ │ ├── 20211126191138_add_suggestions.exs │ │ ├── 20211222165256_add_last_status_at_to_users.exs │ │ ├── 20211225154802_add_is_discoverable_index_to_users.exs │ │ ├── 20211229075801_user_relationships_target_id_relationship_type_index.exs │ │ ├── 20220116183110_add_birthday_to_users.exs │ │ ├── 20220125104429_add_birthday_month_day_index_to_users.exs │ │ ├── 20220203224011_create_rules.exs │ │ ├── 20220220135625_upload_filter_exiftool_to_exiftool_strip_location.exs │ │ ├── 20220225164000_add_activity_assigned_account_index.exs │ │ ├── 20220302013920_add_language_to_users.exs │ │ ├── 20220308012601_create_announcements.exs │ │ ├── 20220314220000_add_location_to_users.exs │ │ ├── 20220319000000_add_status_to_notifications_enum.exs │ │ ├── 20220506175506_add_index_hotspots.exs │ │ ├── 20220509180452_change_thread_visibility_to_be_local_only_aware.exs │ │ ├── 20220527134341_add_quote_url_index_to_objects.exs │ │ ├── 20220602052233_change_report_notes_content_to_text.exs │ │ ├── 20220605185734_add_update_to_notifications_enum.exs │ │ ├── 20220616163503_add_expires_at_to_user_relationships.exs │ │ ├── 20220624104914_create_webhooks.exs │ │ ├── 20220711182322_add_associated_object_id_function.exs │ │ ├── 20220711192750_switch_to_associated_object_id_index.exs │ │ ├── 20220807125023_data_migration_delete_context_objects.exs │ │ ├── 20220819171321_add_pleroma_participation_accepted_to_notifications_enum.exs │ │ ├── 20220821004840_change_thread_visibility_to_use_new_object_id_index.exs │ │ ├── 20220905011454_generate_unset_user_keys.exs │ │ ├── 20220927220033_add_last_move_at_to_users.exs │ │ ├── 20221029171353_add_internal_to_webhooks.exs │ │ ├── 20221103014611_create_oban_peers.exs │ │ ├── 20221103014728_swap_primary_oban_indexes.exs │ │ ├── 20221111164213_deprecate_quack.exs │ │ ├── 20221207235104_add_events_index.exs │ │ ├── 20221216052127_add_state_to_backups.exs │ │ ├── 20230306112859_instances_add_metadata.exs │ │ ├── 20230422154018_drop_unused_indexes.exs │ │ ├── 20230504173400_remove_user_ap_enabled.exs │ │ └── 20231107200724_consolidate_email_queues.exs │ ├── optional_migrations │ │ └── rum_indexing │ │ │ └── 20190510135645_add_fts_index_to_objects_two.exs │ └── seeds.exs ├── scrubbers │ ├── default.ex │ ├── links_only.ex │ ├── media_proxy.ex │ ├── o_embed.ex │ ├── search_indexing.ex │ └── twitter_text.ex ├── static │ ├── READ_THIS_BEFORE_TOUCHING_FILES_HERE │ ├── adminfe │ │ ├── app.147d87e8.css │ │ ├── chunk-0c3d.79348811.css │ │ ├── chunk-0c60.ee394b7b.css │ │ ├── chunk-0fa6.d224ff3a.css │ │ ├── chunk-1a25.098b6a73.css │ │ ├── chunk-2be3.846d0d5a.css │ │ ├── chunk-2cfa.c090392a.css │ │ ├── chunk-305b.64cc20ab.css │ │ ├── chunk-31b9.abc32430.css │ │ ├── chunk-33c9.3c0c7538.css │ │ ├── chunk-42d5.9ade3c1d.css │ │ ├── chunk-45ed.fc62bc5c.css │ │ ├── chunk-4995.ba9a98d5.css │ │ ├── chunk-5669.9e91529b.css │ │ ├── chunk-59e6.07d1d2f0.css │ │ ├── chunk-5cf2.5bf52c8f.css │ │ ├── chunk-68b6.d7a7a7ea.css │ │ ├── chunk-7c11.5c2bbb9c.css │ │ ├── chunk-elementUI.852ab1db.css │ │ ├── chunk-libs.0b4a26df.css │ │ ├── favicon.ico │ │ ├── index.html │ │ └── static │ │ │ ├── fonts │ │ │ ├── element-icons.535877f.woff │ │ │ └── element-icons.732389d.ttf │ │ │ └── js │ │ │ ├── 7zzA.e1ae1c94.js │ │ │ ├── 7zzA.e1ae1c94.js.map │ │ │ ├── JEtC.f9ba4594.js │ │ │ ├── JEtC.f9ba4594.js.map │ │ │ ├── app.c3e187df.js │ │ │ ├── app.c3e187df.js.map │ │ │ ├── chunk-0c3d.00a00ec3.js │ │ │ ├── chunk-0c3d.00a00ec3.js.map │ │ │ ├── chunk-0c60.e0f08810.js │ │ │ ├── chunk-0c60.e0f08810.js.map │ │ │ ├── chunk-0e2d.04760e2c.js │ │ │ ├── chunk-0e2d.04760e2c.js.map │ │ │ ├── chunk-0fa6.ddd4199e.js │ │ │ ├── chunk-0fa6.ddd4199e.js.map │ │ │ ├── chunk-16d0.7d343bb9.js │ │ │ ├── chunk-16d0.7d343bb9.js.map │ │ │ ├── chunk-1a25.107c34e7.js │ │ │ ├── chunk-1a25.107c34e7.js.map │ │ │ ├── chunk-2be3.7b7c045e.js │ │ │ ├── chunk-2be3.7b7c045e.js.map │ │ │ ├── chunk-2cfa.608c3714.js │ │ │ ├── chunk-2cfa.608c3714.js.map │ │ │ ├── chunk-305b.3a7fb27b.js │ │ │ ├── chunk-305b.3a7fb27b.js.map │ │ │ ├── chunk-319f.8919d1e7.js │ │ │ ├── chunk-319f.8919d1e7.js.map │ │ │ ├── chunk-31b9.7b89f7b5.js │ │ │ ├── chunk-31b9.7b89f7b5.js.map │ │ │ ├── chunk-33c9.cf3bdd1b.js │ │ │ ├── chunk-33c9.cf3bdd1b.js.map │ │ │ ├── chunk-42d5.f83ab775.js │ │ │ ├── chunk-42d5.f83ab775.js.map │ │ │ ├── chunk-45ed.10b6b7a7.js │ │ │ ├── chunk-45ed.10b6b7a7.js.map │ │ │ ├── chunk-4995.94e052fc.js │ │ │ ├── chunk-4995.94e052fc.js.map │ │ │ ├── chunk-5669.88725eaa.js │ │ │ ├── chunk-5669.88725eaa.js.map │ │ │ ├── chunk-59e6.01e205d8.js │ │ │ ├── chunk-59e6.01e205d8.js.map │ │ │ ├── chunk-5cf2.a8562f1f.js │ │ │ ├── chunk-5cf2.a8562f1f.js.map │ │ │ ├── chunk-68b6.4347fd87.js │ │ │ ├── chunk-68b6.4347fd87.js.map │ │ │ ├── chunk-7c11.b858969e.js │ │ │ ├── chunk-7c11.b858969e.js.map │ │ │ ├── chunk-elementUI.bec6fa77.js │ │ │ ├── chunk-elementUI.bec6fa77.js.map │ │ │ ├── chunk-libs.eb232bda.js │ │ │ ├── chunk-libs.eb232bda.js.map │ │ │ ├── oAJy.25bb7cc7.js │ │ │ ├── oAJy.25bb7cc7.js.map │ │ │ ├── runtime.f1a41c33.js │ │ │ └── runtime.f1a41c33.js.map │ ├── embed.css │ ├── embed.js │ ├── favicon.png │ ├── images │ │ ├── avi.png │ │ ├── banner.png │ │ ├── logo.png │ │ ├── rebased-wide.svg │ │ └── shortcuts │ │ │ ├── chats.png │ │ │ ├── notifications.png │ │ │ └── search.png │ ├── index.html │ ├── instance │ │ ├── panel.html │ │ ├── static.css │ │ └── thumbnail.png │ ├── robots.txt │ ├── schemas │ │ └── litepub-0.1.jsonld │ ├── static-fe │ │ └── static-fe.css │ ├── static │ │ ├── css │ │ │ ├── 7586.0d43f70bc6240422f179.css │ │ │ ├── 7586.0d43f70bc6240422f179.css.map │ │ │ ├── 7962.76663e78ad5ea0bb0b90.css │ │ │ ├── 7962.76663e78ad5ea0bb0b90.css.map │ │ │ ├── 9801.cfe503d4c949ae0c3813.css │ │ │ ├── 9801.cfe503d4c949ae0c3813.css.map │ │ │ ├── app.c18a2c80794a1b699a61.css │ │ │ └── app.c18a2c80794a1b699a61.css.map │ │ ├── js │ │ │ ├── 159.903e90c9de8ef6c67077.js │ │ │ ├── 159.903e90c9de8ef6c67077.js.map │ │ │ ├── 3733.7060d1e6bca813125a0c.js │ │ │ ├── 3733.7060d1e6bca813125a0c.js.LICENSE.txt │ │ │ ├── 3733.7060d1e6bca813125a0c.js.map │ │ │ ├── 48.b5ecdbc517423af07ca4.js │ │ │ ├── 48.b5ecdbc517423af07ca4.js.LICENSE.txt │ │ │ ├── 48.b5ecdbc517423af07ca4.js.map │ │ │ ├── 6464.eb9c90a1c948cde554e9.js │ │ │ ├── 6464.eb9c90a1c948cde554e9.js.map │ │ │ ├── 7586.981b2305a0019f6042a5.js │ │ │ ├── 7586.981b2305a0019f6042a5.js.map │ │ │ ├── 7962.e25d40b042f8ee7389c3.js │ │ │ ├── 7962.e25d40b042f8ee7389c3.js.map │ │ │ ├── 9060.24271e167e0471a1a732.js │ │ │ ├── 9060.24271e167e0471a1a732.js.map │ │ │ ├── 9801.99ace6b5dc657bf1a65b.js │ │ │ ├── 9801.99ace6b5dc657bf1a65b.js.map │ │ │ ├── app.7c4b412b26221a7c8572.js │ │ │ ├── app.7c4b412b26221a7c8572.js.map │ │ │ └── i18n │ │ │ │ ├── ar-json.4916f840147303aa65fe.js │ │ │ │ ├── ar-json.4916f840147303aa65fe.js.map │ │ │ │ ├── eo-json.6c62eef99e850912498b.js │ │ │ │ ├── eo-json.6c62eef99e850912498b.js.map │ │ │ │ ├── id-json.e5c9ee768155f88128b9.js │ │ │ │ ├── id-json.e5c9ee768155f88128b9.js.map │ │ │ │ ├── ko-json.9029d09084bb22d8b705.js │ │ │ │ ├── ko-json.9029d09084bb22d8b705.js.map │ │ │ │ ├── nan-TW-json.7f2789d8a461e86d1734.js │ │ │ │ ├── nan-TW-json.7f2789d8a461e86d1734.js.map │ │ │ │ ├── zh-json.5831b903c3e6d281f122.js │ │ │ │ ├── zh-json.5831b903c3e6d281f122.js.map │ │ │ │ ├── zh_Hant-json.f7e1d0f4b873c60d6396.js │ │ │ │ └── zh_Hant-json.f7e1d0f4b873c60d6396.js.map │ │ └── terms-of-service.html │ ├── sw-pleroma.js │ └── sw-pleroma.js.map └── templates │ ├── robots_txt.eex │ ├── sample_config.eex │ └── sample_psql.eex ├── rebased.png ├── rel ├── env.sh.eex ├── files │ ├── bin │ │ └── pleroma_ctl │ └── installation │ │ ├── init.d │ │ └── pleroma │ │ └── pleroma.service └── vm.args.eex ├── restarter ├── lib │ ├── pleroma.ex │ └── restarter.ex └── mix.exs ├── test ├── config │ └── emoji.txt ├── credo │ └── check │ │ └── consistency │ │ └── file_location.ex ├── fixtures │ ├── DSCN0010.jpg │ ├── activitypub-client-post-activity.json │ ├── avatar_data_uri │ ├── birthdays │ │ └── misskey-user.json │ ├── bogus-mastodon-announce.json │ ├── bridgy │ │ └── actor.json │ ├── config │ │ ├── temp.exported_from_db.secret.exs │ │ └── temp.secret.exs │ ├── create-chat-message.json │ ├── create-pleroma-reply-to-misskey-thread.json │ ├── custom-emoji-reaction.json │ ├── custom_instance_panel.html │ ├── emoji-reaction-no-emoji.json │ ├── emoji-reaction-too-long.json │ ├── emoji-reaction.json │ ├── emoji │ │ └── packs │ │ │ ├── blank.png.zip │ │ │ ├── default-manifest.json │ │ │ ├── finmoji.json │ │ │ └── manifest.json │ ├── emojis.zip │ ├── empty.zip │ ├── fep-e232.json │ ├── fetch_mocks │ │ ├── 104410921027210069.json │ │ ├── 9wTkLEnuq47B25EehM.json │ │ ├── eal.json │ │ └── tuxcrafting.json │ ├── friendica_salmon.xml │ ├── guppe-actor.json │ ├── host-meta-zetsubou.xn--q9jyb4c.xml │ ├── hubzilla-actor.json │ ├── hubzilla-create-image.json │ ├── hubzilla-follow-activity.json │ ├── image.gif │ ├── image.jpg │ ├── image.png │ ├── image_with_caption-abstract.jpg │ ├── image_with_imagedescription_and_caption-abstract.jpg │ ├── image_with_imagedescription_and_caption-abstract_and_stray_data_after.png │ ├── image_with_imagedescription_and_caption-abstract_whitespaces.jpg │ ├── image_with_no_description.jpg │ ├── image_with_stray_data_after.png │ ├── kroeg-announce-with-inline-actor.json │ ├── kroeg-array-less-emoji.json │ ├── kroeg-array-less-hashtag.json │ ├── kroeg-post-activity.json │ ├── lain.xml │ ├── lambadalambda.json │ ├── margaret-corbin-grave-west-point.html │ ├── mastodon-accept-activity.json │ ├── mastodon-announce-private.json │ ├── mastodon-announce.json │ ├── mastodon-block-activity.json │ ├── mastodon-create-with-attachment.json │ ├── mastodon-delete-user.json │ ├── mastodon-delete.json │ ├── mastodon-follow-activity.json │ ├── mastodon-like.json │ ├── mastodon-nodeinfo20.json │ ├── mastodon-note-object.json │ ├── mastodon-post-activity-contentmap.json │ ├── mastodon-post-activity-hashtag.json │ ├── mastodon-post-activity-nsfw.json │ ├── mastodon-post-activity.json │ ├── mastodon-question-activity.json │ ├── mastodon-reject-activity.json │ ├── mastodon-unblock-activity.json │ ├── mastodon-undo-announce.json │ ├── mastodon-undo-like-compact-object.json │ ├── mastodon-undo-like.json │ ├── mastodon-unfollow-activity.json │ ├── mastodon-update.json │ ├── mastodon-vote.json │ ├── mastodon-well-known-nodeinfo.json │ ├── mastodon │ │ ├── application_actor.json │ │ └── collections │ │ │ ├── external_featured.json │ │ │ └── featured.json │ ├── mewmew_no_name.json │ ├── misskey-like.json │ ├── modules │ │ ├── good_mrf.ex │ │ └── runtime_module.ex │ ├── nypd-facial-recognition-children-teenagers.html │ ├── nypd-facial-recognition-children-teenagers2.html │ ├── nypd-facial-recognition-children-teenagers3.html │ ├── nypd-facial-recognition-children-teenagers4.html │ ├── osada-follow-activity.json │ ├── owncast-note-with-attachment.json │ ├── peertube │ │ ├── actor-person.json │ │ └── video-object-mpegURL-only.json │ ├── preload_static │ │ └── instance │ │ │ └── panel.html │ ├── prismo-url-map.json │ ├── private_key.pem │ ├── quote_post │ │ ├── fedibird_quote_mismatched.json │ │ ├── fedibird_quote_post.json │ │ ├── fedibird_quote_uri.json │ │ ├── fep-e232-tag-example.json │ │ └── misskey_quote_post.json │ ├── rel_me_anchor.html │ ├── rel_me_anchor_nofollow.html │ ├── rel_me_link.html │ ├── rel_me_null.html │ ├── relay │ │ ├── accept-follow.json │ │ └── relay.json │ ├── rich_media │ │ ├── amz.html │ │ ├── malformed-data.html │ │ ├── non_ogp_embed.html │ │ ├── oembed.html │ │ ├── oembed.json │ │ ├── ogp-missing-data.html │ │ ├── ogp-missing-title.html │ │ ├── ogp.html │ │ ├── twitter_card.html │ │ ├── wordpress.html │ │ └── wordpress_embed.json │ ├── roadhouse-create-activity.json │ ├── rsa_keys │ │ ├── key_1.pem │ │ ├── key_2.pem │ │ ├── key_3.pem │ │ ├── key_4.pem │ │ └── key_5.pem │ ├── salmon.xml │ ├── salmon2.xml │ ├── snow.js │ ├── soapbox_no_mentions_in_content.json │ ├── sound.mp3 │ ├── spoofed-object.json │ ├── statuses │ │ ├── masto-note.json │ │ └── note.json │ ├── tesla_mock │ │ ├── 7369654.html │ │ ├── 7even.json │ │ ├── admin@mastdon.example.org.json │ │ ├── aimu@misskey.io.json │ │ ├── atarifrosch_webfinger.xml │ │ ├── baptiste.gelex.xyz-article.json │ │ ├── baptiste.gelex.xyz-user.json │ │ ├── craigmaloney.json │ │ ├── deepl-languages-list.json │ │ ├── deepl-translation.json │ │ ├── dist │ │ │ └── test.txt │ │ ├── eal_sakamoto.xml │ │ ├── emelie.json │ │ ├── emoji-in-summary.json │ │ ├── framasoft@framatube.org.json │ │ ├── framatube.org-video.json │ │ ├── framatube.org_host_meta │ │ ├── frontend.zip │ │ ├── frontend_dist.zip │ │ ├── funkwhale_audio.json │ │ ├── funkwhale_channel.json │ │ ├── funkwhale_create_audio.json │ │ ├── gerzilla.de_host_meta │ │ ├── gleasonator-AG3RzWfwEKKrY63qj2.json │ │ ├── gleasonator.com_host_meta │ │ ├── gnusocial.de_host_meta │ │ ├── gs.example.org_host_meta │ │ ├── helene@p.helene.moe.json │ │ ├── hellpie.json │ │ ├── http___gs.example.org_4040_index.php_user_1.xml │ │ ├── http___mastodon.example.org_users_admin_status_1234.json │ │ ├── https___framatube.org_accounts_framasoft.json │ │ ├── https___info.pleroma.site_actor.json │ │ ├── https___lm.kazv.moe_users_mewmew.xml │ │ ├── https___mastodon.social_users_lambadalambda.xml │ │ ├── https___osada.macgirvin.com.html │ │ ├── https___osada.macgirvin.com_channel_mike.json │ │ ├── https___pawoo.net_users_aqidaqidaqid.xml │ │ ├── https___pawoo.net_users_pekorino.xml │ │ ├── https___pleroma.soykaf.com_users_lain.xml │ │ ├── https___prismo.news__mxb.json │ │ ├── https___shitposter.club_notice_2827873.html │ │ ├── https___shitposter.club_user_1.xml │ │ ├── https___social.heldscal.la_user_23211.xml │ │ ├── https___social.heldscal.la_user_29191.xml │ │ ├── https__info.pleroma.site_activity.json │ │ ├── https__info.pleroma.site_activity2.json │ │ ├── https__info.pleroma.site_activity3.json │ │ ├── https__info.pleroma.site_activity4.json │ │ ├── kaniini@gerzilla.de.json │ │ ├── kaniini@hubzilla.example.org.json │ │ ├── kpherox@mstdn.jp.xml │ │ ├── lain_squeet.me_webfinger.xml │ │ ├── lemmy-page.json │ │ ├── lemmy-user.json │ │ ├── lm.kazv.moe_host_meta │ │ ├── lucifermysticus.json │ │ ├── macgirvin.com_host_meta │ │ ├── macgirvin@gleasonator.com.json │ │ ├── mametsuko@mk.absturztau.be.json │ │ ├── mamot.fr_host_meta │ │ ├── mastodon.social_host_meta │ │ ├── mastodon.xyz_host_meta │ │ ├── mayumayu.json │ │ ├── mayumayupost.json │ │ ├── mewmew@lm.kazv.moe.json │ │ ├── mike@osada.macgirvin.com.json │ │ ├── misskey.io_8vs6wxufd0.json │ │ ├── misskey_poll_no_end_date.json │ │ ├── mitra.social_01830912-1357-d4c5-e4a2-76eab347e749.json │ │ ├── mk.absturztau.be-93e7nm8wqg-activity.json │ │ ├── mk.absturztau.be-93e7nm8wqg.json │ │ ├── mobilizon-event-join-accept.json │ │ ├── mobilizon-event-join.json │ │ ├── mobilizon.org-event.json │ │ ├── mobilizon.org-user.json │ │ ├── moonman@shitposter.club.json │ │ ├── mstdn.jp_host_meta │ │ ├── nominatim_search_results.json │ │ ├── nominatim_single_result.json │ │ ├── nonexistant@social.heldscal.la.xml │ │ ├── osada-user-indio.json │ │ ├── p.helene.moe-AM7S6vZQmL6pI9TgPY.json │ │ ├── pawoo.net_host_meta │ │ ├── peertube-social.json │ │ ├── peertube.moe-vid.json │ │ ├── pekorino@pawoo.net_host_meta.json │ │ ├── pleroma.soykaf.com_host_meta │ │ ├── poll_attachment.json │ │ ├── poll_modified.json │ │ ├── poll_original.json │ │ ├── puckipedia.com.json │ │ ├── relay@mastdon.example.org.json │ │ ├── rin.json │ │ ├── rinpatch.json │ │ ├── rye.json │ │ ├── sdf.org_host_meta │ │ ├── shitposter.club_host_meta │ │ ├── shp@pleroma.soykaf.com.webfigner │ │ ├── shp@social.heldscal.la.xml │ │ ├── sjw.json │ │ ├── skruyb@mamot.fr.atom │ │ ├── smithereen_non_anonymous_poll.json │ │ ├── smithereen_user.json │ │ ├── snowdusk@sdf.org_host_meta.json │ │ ├── social.heldscal.la_host_meta │ │ ├── social.sakamoto.gq_host_meta │ │ ├── social.stopwatchingus-heidelberg.de_host_meta │ │ ├── social.wxcafe.net_host_meta │ │ ├── soykaf.com_host_meta │ │ ├── spc_5381_xrd.xml │ │ ├── squeet.me_host_meta │ │ ├── status.alpicola.com_host_meta │ │ ├── status.emelie.json │ │ ├── stopwatchingus-heidelberg.de_host_meta │ │ ├── webfinger_emelie.json │ │ ├── webfinger_spoof.json │ │ ├── wedistribute-article.json │ │ ├── wedistribute-create-article.json │ │ ├── wedistribute-user.json │ │ └── winterdienst_webfinger.json │ ├── test.txt │ ├── user_full.xml │ ├── user_name_only.xml │ ├── users_mock │ │ ├── friendica_followers.json │ │ ├── friendica_following.json │ │ ├── masto_closed_followers.json │ │ ├── masto_closed_followers_page.json │ │ ├── masto_closed_following.json │ │ ├── masto_closed_following_page.json │ │ ├── masto_featured.json │ │ ├── pleroma_followers.json │ │ ├── pleroma_following.json │ │ └── user.json │ ├── video.mp4 │ ├── warnings │ │ └── otp_version │ │ │ ├── 21.1 │ │ │ ├── 22.1 │ │ │ ├── 22.4 │ │ │ └── 23.0 │ ├── webfinger.xml │ ├── webfinger │ │ ├── masto-host-meta.xml │ │ ├── masto-user.json │ │ ├── masto-webfinger.json │ │ ├── pleroma-host-meta.xml │ │ ├── pleroma-user.json │ │ └── pleroma-webfinger.json │ ├── wildebeest-nodeinfo21.json │ ├── wildebeest-well-known-nodeinfo.json │ ├── xml_billion_laughs.xml │ └── xml_external_entities.xml ├── instance_static │ ├── add │ │ └── shortcode.png │ ├── emoji │ │ ├── blobs.gg │ │ │ ├── blank.png │ │ │ └── pack.json │ │ ├── pack_bad_sha │ │ │ ├── blank.png │ │ │ ├── pack.json │ │ │ └── pack_bad_sha.zip │ │ ├── test_pack │ │ │ ├── blank.png │ │ │ ├── blank2.png │ │ │ └── pack.json │ │ ├── test_pack_for_import │ │ │ └── blank.png │ │ └── test_pack_nonshared │ │ │ ├── nonshared.zip │ │ │ └── pack.json │ └── local_pack │ │ ├── files.json │ │ └── manifest.json ├── mix │ ├── pleroma_test.exs │ └── tasks │ │ └── pleroma │ │ ├── app_test.exs │ │ ├── config_test.exs │ │ ├── count_statuses_test.exs │ │ ├── database_test.exs │ │ ├── digest_test.exs │ │ ├── ecto │ │ ├── migrate_test.exs │ │ └── rollback_test.exs │ │ ├── ecto_test.exs │ │ ├── email_test.exs │ │ ├── emoji_test.exs │ │ ├── frontend_test.exs │ │ ├── instance_test.exs │ │ ├── openapi_spec_test.exs │ │ ├── refresh_counter_cache_test.exs │ │ ├── relay_test.exs │ │ ├── robots_txt_test.exs │ │ ├── uploads_test.exs │ │ └── user_test.exs ├── pleroma │ ├── activity │ │ └── ir │ │ │ └── topics_test.exs │ ├── activity_test.exs │ ├── announcement_read_relationship_test.exs │ ├── announcement_test.exs │ ├── application_requirements_test.exs │ ├── bookmark_test.exs │ ├── captcha_test.exs │ ├── chat │ │ └── message_reference_test.exs │ ├── chat_test.exs │ ├── config │ │ ├── deprecation_warnings_test.exs │ │ ├── holder_test.exs │ │ ├── loader_test.exs │ │ ├── release_runtime_provider_test.exs │ │ └── transfer_task_test.exs │ ├── config_db_test.exs │ ├── config_test.exs │ ├── conversation │ │ └── participation_test.exs │ ├── conversation_test.exs │ ├── docs │ │ ├── generator_test.exs │ │ └── translator │ │ │ └── compiler_test.exs │ ├── ecto_type │ │ └── activity_pub │ │ │ └── object_validators │ │ │ ├── bare_uri_test.exs │ │ │ ├── date_time_test.exs │ │ │ ├── object_id_test.exs │ │ │ ├── recipients_test.exs │ │ │ └── safe_text_test.exs │ ├── emails │ │ ├── admin_email_test.exs │ │ ├── mailer_test.exs │ │ └── user_email_test.exs │ ├── emoji │ │ ├── formatter_test.exs │ │ ├── loader_test.exs │ │ └── pack_test.exs │ ├── emoji_test.exs │ ├── filter_test.exs │ ├── following_relationship_test.exs │ ├── formatter_test.exs │ ├── frontend_test.exs │ ├── gun │ │ └── connection_pool_test.exs │ ├── hashtag_test.exs │ ├── healthcheck_test.exs │ ├── html_test.exs │ ├── http │ │ ├── adapter_helper │ │ │ ├── gun_test.exs │ │ │ └── hackney_test.exs │ │ ├── adapter_helper_test.exs │ │ ├── ex_aws_test.exs │ │ ├── request_builder_test.exs │ │ └── tzdata_test.exs │ ├── http_test.exs │ ├── instances │ │ └── instance_test.exs │ ├── instances_test.exs │ ├── integration │ │ ├── federation_test.exs │ │ └── mastodon_websocket_test.exs │ ├── job_queue_monitor_test.exs │ ├── keys_test.exs │ ├── language │ │ ├── language_detector_test.exs │ │ ├── translation │ │ │ └── deepl_test.exs │ │ └── translation_test.exs │ ├── list_test.exs │ ├── marker_test.exs │ ├── mfa │ │ ├── backup_codes_test.exs │ │ └── totp_test.exs │ ├── mfa_test.exs │ ├── migration_helper │ │ └── notification_backfill_test.exs │ ├── moderation_log_test.exs │ ├── notification_test.exs │ ├── object │ │ ├── containment_test.exs │ │ ├── fetcher_test.exs │ │ └── updater_test.exs │ ├── object_test.exs │ ├── otp_version_test.exs │ ├── pagination_test.exs │ ├── password │ │ └── pbkdf2_test.exs │ ├── registration_test.exs │ ├── repo │ │ └── migrations │ │ │ ├── autolinker_to_linkify_test.exs │ │ │ ├── confirm_logged_in_users_test.exs │ │ │ ├── deprecate_public_endpoint_test.exs │ │ │ ├── fix_legacy_tags_test.exs │ │ │ ├── fix_malformed_formatter_config_test.exs │ │ │ └── move_welcome_settings_test.exs │ ├── repo_test.exs │ ├── report_note_test.exs │ ├── resilience_test.exs │ ├── reverse_proxy_test.exs │ ├── rule_test.exs │ ├── runtime_test.exs │ ├── safe_jsonb_set_test.exs │ ├── scheduled_activity_test.exs │ ├── search │ │ ├── database_search_test.exs │ │ └── meilisearch_test.exs │ ├── signature_test.exs │ ├── stats_test.exs │ ├── upload │ │ ├── filter │ │ │ ├── analyze_metadata_test.exs │ │ │ ├── anonymize_filename_test.exs │ │ │ ├── dedupe_test.exs │ │ │ ├── exiftool │ │ │ │ ├── read_description_test.exs │ │ │ │ └── strip_location_test.exs │ │ │ ├── mogrifun_test.exs │ │ │ ├── mogrify_test.exs │ │ │ └── only_media_test.exs │ │ └── filter_test.exs │ ├── upload_test.exs │ ├── uploaders │ │ ├── local_test.exs │ │ └── s3_test.exs │ ├── user │ │ ├── backup_test.exs │ │ ├── email_list_test.exs │ │ ├── import_test.exs │ │ ├── notification_setting_test.exs │ │ ├── query_test.exs │ │ ├── welcome_chat_message_test.exs │ │ ├── welcome_email_test.exs │ │ └── welcome_message_test.exs │ ├── user_invite_token_test.exs │ ├── user_relationship_test.exs │ ├── user_search_test.exs │ ├── user_test.exs │ ├── utils_test.exs │ ├── web │ │ ├── activity_pub │ │ │ ├── activity_pub_controller_test.exs │ │ │ ├── activity_pub_test.exs │ │ │ ├── builder_test.exs │ │ │ ├── mrf │ │ │ │ ├── activity_expiration_policy_test.exs │ │ │ │ ├── anti_duplication_policy_test.exs │ │ │ │ ├── anti_followbot_policy_test.exs │ │ │ │ ├── anti_link_spam_policy_test.exs │ │ │ │ ├── anti_mention_spam_policy_test.exs │ │ │ │ ├── block_notification_policy_test.exs │ │ │ │ ├── emoji_policy_test.exs │ │ │ │ ├── ensure_re_prepended_test.exs │ │ │ │ ├── follow_bot_policy_test.exs │ │ │ │ ├── force_bot_unlisted_policy_test.exs │ │ │ │ ├── force_mentions_in_content_test.exs │ │ │ │ ├── hashtag_policy_test.exs │ │ │ │ ├── hellthread_policy_test.exs │ │ │ │ ├── inline_quote_policy_test.exs │ │ │ │ ├── keyword_policy_test.exs │ │ │ │ ├── media_proxy_warming_policy_test.exs │ │ │ │ ├── mention_policy_test.exs │ │ │ │ ├── no_empty_policy_test.exs │ │ │ │ ├── no_placeholder_text_policy_test.exs │ │ │ │ ├── normalize_markup_test.exs │ │ │ │ ├── nsfw_api_policy_test.exs │ │ │ │ ├── object_age_policy_test.exs │ │ │ │ ├── quote_to_link_tag_policy_test.exs │ │ │ │ ├── reject_non_public_test.exs │ │ │ │ ├── remote_report_policy_test.exs │ │ │ │ ├── simple_policy_test.exs │ │ │ │ ├── steal_emoji_policy_test.exs │ │ │ │ ├── subchain_policy_test.exs │ │ │ │ ├── tag_policy_test.exs │ │ │ │ ├── user_allow_list_policy_test.exs │ │ │ │ ├── utils_test.exs │ │ │ │ └── vocabulary_policy_test.exs │ │ │ ├── mrf_test.exs │ │ │ ├── object_validators │ │ │ │ ├── accept_validation_test.exs │ │ │ │ ├── announce_validation_test.exs │ │ │ │ ├── article_note_page_validator_test.exs │ │ │ │ ├── attachment_validator_test.exs │ │ │ │ ├── block_validation_test.exs │ │ │ │ ├── chat_validation_test.exs │ │ │ │ ├── create_generic_validator_test.exs │ │ │ │ ├── delete_validation_test.exs │ │ │ │ ├── emoji_react_handling_test.exs │ │ │ │ ├── follow_validation_test.exs │ │ │ │ ├── like_validation_test.exs │ │ │ │ ├── reject_validation_test.exs │ │ │ │ ├── undo_handling_test.exs │ │ │ │ └── update_handling_test.exs │ │ │ ├── pipeline_test.exs │ │ │ ├── publisher_test.exs │ │ │ ├── relay_test.exs │ │ │ ├── side_effects │ │ │ │ └── delete_test.exs │ │ │ ├── side_effects_test.exs │ │ │ ├── transmogrifier │ │ │ │ ├── accept_handling_test.exs │ │ │ │ ├── add_remove_handling_test.exs │ │ │ │ ├── announce_handling_test.exs │ │ │ │ ├── answer_handling_test.exs │ │ │ │ ├── article_handling_test.exs │ │ │ │ ├── audio_handling_test.exs │ │ │ │ ├── block_handling_test.exs │ │ │ │ ├── chat_message_test.exs │ │ │ │ ├── delete_handling_test.exs │ │ │ │ ├── emoji_react_handling_test.exs │ │ │ │ ├── event_handling_test.exs │ │ │ │ ├── follow_handling_test.exs │ │ │ │ ├── image_handling_test.exs │ │ │ │ ├── join_handling_test.exs │ │ │ │ ├── like_handling_test.exs │ │ │ │ ├── note_handling_test.exs │ │ │ │ ├── page_handling_test.exs │ │ │ │ ├── question_handling_test.exs │ │ │ │ ├── reject_handling_test.exs │ │ │ │ ├── undo_handling_test.exs │ │ │ │ ├── user_update_handling_test.exs │ │ │ │ └── video_handling_test.exs │ │ │ ├── transmogrifier_test.exs │ │ │ ├── utils_test.exs │ │ │ ├── views │ │ │ │ ├── object_view_test.exs │ │ │ │ └── user_view_test.exs │ │ │ └── visibility_test.exs │ │ ├── admin_api │ │ │ ├── controllers │ │ │ │ ├── admin_api_controller_test.exs │ │ │ │ ├── announcement_controller_test.exs │ │ │ │ ├── chat_controller_test.exs │ │ │ │ ├── config_controller_test.exs │ │ │ │ ├── email_list_controller_test.exs │ │ │ │ ├── frontend_controller_test.exs │ │ │ │ ├── instance_controller_test.exs │ │ │ │ ├── instance_document_controller_test.exs │ │ │ │ ├── invite_controller_test.exs │ │ │ │ ├── media_proxy_cache_controller_test.exs │ │ │ │ ├── o_auth_app_controller_test.exs │ │ │ │ ├── relay_controller_test.exs │ │ │ │ ├── report_controller_test.exs │ │ │ │ ├── rule_controller_test.exs │ │ │ │ ├── status_controller_test.exs │ │ │ │ ├── user_controller_test.exs │ │ │ │ └── webhook_controller_test.exs │ │ │ ├── search_test.exs │ │ │ └── views │ │ │ │ ├── account_view_test.exs │ │ │ │ ├── moderation_log_view_test.exs │ │ │ │ └── report_view_test.exs │ │ ├── api_spec │ │ │ ├── schema_examples_test.exs │ │ │ └── scopes │ │ │ │ └── compiler_test.exs │ │ ├── auth │ │ │ ├── auth_controller_test.exs │ │ │ ├── authenticator_test.exs │ │ │ ├── basic_auth_test.exs │ │ │ ├── pleroma_authenticator_test.exs │ │ │ └── totp_authenticator_test.exs │ │ ├── common_api │ │ │ ├── activity_draft_test.exs │ │ │ └── utils_test.exs │ │ ├── common_api_test.exs │ │ ├── endpoint │ │ │ └── metrics_exporter_test.exs │ │ ├── fallback_test.exs │ │ ├── federator_test.exs │ │ ├── feed │ │ │ ├── tag_controller_test.exs │ │ │ └── user_controller_test.exs │ │ ├── gettext_test.exs │ │ ├── manifest_controller_test.exs │ │ ├── mastodon_api │ │ │ ├── admin │ │ │ │ └── controllers │ │ │ │ │ ├── account_controller_test.exs │ │ │ │ │ └── report_controller_test.exs │ │ │ ├── controllers │ │ │ │ ├── account_controller_test.exs │ │ │ │ ├── announcement_controller_test.exs │ │ │ │ ├── app_controller_test.exs │ │ │ │ ├── conversation_controller_test.exs │ │ │ │ ├── custom_emoji_controller_test.exs │ │ │ │ ├── directory_controller_test.exs │ │ │ │ ├── domain_block_controller_test.exs │ │ │ │ ├── filter_controller_test.exs │ │ │ │ ├── follow_request_controller_test.exs │ │ │ │ ├── instance_controller_test.exs │ │ │ │ ├── list_controller_test.exs │ │ │ │ ├── marker_controller_test.exs │ │ │ │ ├── media_controller_test.exs │ │ │ │ ├── notification_controller_test.exs │ │ │ │ ├── poll_controller_test.exs │ │ │ │ ├── report_controller_test.exs │ │ │ │ ├── scheduled_activity_controller_test.exs │ │ │ │ ├── search_controller_test.exs │ │ │ │ ├── status_controller_test.exs │ │ │ │ ├── subscription_controller_test.exs │ │ │ │ ├── suggestion_controller_test.exs │ │ │ │ └── timeline_controller_test.exs │ │ │ ├── mastodon_api_controller_test.exs │ │ │ ├── mastodon_api_test.exs │ │ │ ├── update_credentials_test.exs │ │ │ └── views │ │ │ │ ├── account_view_test.exs │ │ │ │ ├── conversation_view_test.exs │ │ │ │ ├── list_view_test.exs │ │ │ │ ├── marker_view_test.exs │ │ │ │ ├── notification_view_test.exs │ │ │ │ ├── poll_view_test.exs │ │ │ │ ├── scheduled_activity_view_test.exs │ │ │ │ ├── status_view_test.exs │ │ │ │ ├── subscription_view_test.exs │ │ │ │ └── suggestion_view_test.exs │ │ ├── media_proxy │ │ │ ├── invalidation │ │ │ │ ├── http_test.exs │ │ │ │ └── script_test.exs │ │ │ ├── invalidation_test.exs │ │ │ └── media_proxy_controller_test.exs │ │ ├── media_proxy_test.exs │ │ ├── metadata │ │ │ ├── player_view_test.exs │ │ │ ├── providers │ │ │ │ ├── feed_test.exs │ │ │ │ ├── open_graph_test.exs │ │ │ │ ├── rel_me_test.exs │ │ │ │ ├── restrict_indexing_test.exs │ │ │ │ └── twitter_card_test.exs │ │ │ └── utils_test.exs │ │ ├── mongoose_im_controller_test.exs │ │ ├── node_info_test.exs │ │ ├── o_auth │ │ │ ├── app_test.exs │ │ │ ├── authorization_test.exs │ │ │ ├── ldap_authorization_test.exs │ │ │ ├── mfa_controller_test.exs │ │ │ ├── o_auth_controller_test.exs │ │ │ ├── token │ │ │ │ └── utils_test.exs │ │ │ └── token_test.exs │ │ ├── o_status │ │ │ └── o_status_controller_test.exs │ │ ├── pleroma_api │ │ │ ├── controllers │ │ │ │ ├── account_controller_test.exs │ │ │ │ ├── app_controller_test.exs │ │ │ │ ├── backup_controller_test.exs │ │ │ │ ├── chat_controller_test.exs │ │ │ │ ├── conversation_controller_test.exs │ │ │ │ ├── emoji_file_controller_test.exs │ │ │ │ ├── emoji_pack_controller_test.exs │ │ │ │ ├── emoji_reaction_controller_test.exs │ │ │ │ ├── event_controller_test.exs │ │ │ │ ├── instances_controller_test.exs │ │ │ │ ├── mascot_controller_test.exs │ │ │ │ ├── notification_controller_test.exs │ │ │ │ ├── report_controller_test.exs │ │ │ │ ├── scrobble_controller_test.exs │ │ │ │ ├── search_controller_test.exs │ │ │ │ ├── status_controller_test.exs │ │ │ │ ├── two_factor_authentication_controller_test.exs │ │ │ │ └── user_import_controller_test.exs │ │ │ └── views │ │ │ │ ├── app_view_test.exs │ │ │ │ ├── backup_view_test.exs │ │ │ │ ├── chat_message_reference_view_test.exs │ │ │ │ ├── chat_view_test.exs │ │ │ │ └── scrobble_view_test.exs │ │ ├── plugs │ │ │ ├── admin_secret_authentication_plug_test.exs │ │ │ ├── authentication_plug_test.exs │ │ │ ├── basic_auth_decoder_plug_test.exs │ │ │ ├── cache_control_test.exs │ │ │ ├── cache_test.exs │ │ │ ├── digest_plug_test.exs │ │ │ ├── ensure_authenticated_plug_test.exs │ │ │ ├── ensure_privileged_plug_test.exs │ │ │ ├── ensure_public_or_authenticated_plug_test.exs │ │ │ ├── ensure_user_token_assigns_plug_test.exs │ │ │ ├── federating_plug_test.exs │ │ │ ├── frontend_static_plug_test.exs │ │ │ ├── http_security_plug_test.exs │ │ │ ├── http_signature_plug_test.exs │ │ │ ├── idempotency_plug_test.exs │ │ │ ├── instance_static_test.exs │ │ │ ├── mapped_signature_to_identity_plug_test.exs │ │ │ ├── o_auth_plug_test.exs │ │ │ ├── o_auth_scopes_plug_test.exs │ │ │ ├── plug_helper_test.exs │ │ │ ├── rate_limiter_test.exs │ │ │ ├── remote_ip_test.exs │ │ │ ├── set_format_plug_test.exs │ │ │ ├── set_locale_plug_test.exs │ │ │ ├── set_user_session_id_plug_test.exs │ │ │ ├── uploaded_media_plug_test.exs │ │ │ ├── user_enabled_plug_test.exs │ │ │ ├── user_fetcher_plug_test.exs │ │ │ ├── user_is_admin_plug_test.exs │ │ │ ├── user_is_staff_plug_test.exs │ │ │ └── user_tracking_plug_test.exs │ │ ├── preload │ │ │ └── providers │ │ │ │ ├── instance_test.exs │ │ │ │ ├── timeline_test.exs │ │ │ │ └── user_test.exs │ │ ├── push │ │ │ └── impl_test.exs │ │ ├── rel_me_test.exs │ │ ├── rich_media │ │ │ ├── helpers_test.exs │ │ │ ├── parser │ │ │ │ ├── card_test.exs │ │ │ │ ├── meta_tags_test.exs │ │ │ │ └── ttl │ │ │ │ │ └── aws_signed_url_test.exs │ │ │ ├── parser_test.exs │ │ │ └── parsers │ │ │ │ └── twitter_card_test.exs │ │ ├── static_fe │ │ │ └── static_fe_controller_test.exs │ │ ├── streamer_test.exs │ │ ├── twitter_api │ │ │ ├── controller_test.exs │ │ │ ├── password_controller_test.exs │ │ │ ├── remote_follow_controller_test.exs │ │ │ ├── twitter_api_test.exs │ │ │ └── util_controller_test.exs │ │ ├── uploader_controller_test.exs │ │ ├── utils │ │ │ └── colors_test.exs │ │ ├── views │ │ │ └── error_view_test.exs │ │ ├── web_finger │ │ │ └── web_finger_controller_test.exs │ │ ├── web_finger_test.exs │ │ └── xml_test.exs │ ├── webhook │ │ └── notify_test.exs │ ├── webhook_test.exs │ ├── workers │ │ ├── cron │ │ │ ├── digest_emails_worker_test.exs │ │ │ └── new_users_digest_worker_test.exs │ │ ├── publisher_worker_test.exs │ │ ├── purge_expired_activity_test.exs │ │ ├── purge_expired_filter_test.exs │ │ ├── purge_expired_token_test.exs │ │ ├── receiver_worker_test.exs │ │ └── scheduled_activity_worker_test.exs │ └── xml_builder_test.exs ├── support │ ├── api_spec_helpers.ex │ ├── builders │ │ ├── activity_builder.ex │ │ └── user_builder.ex │ ├── cachex_proxy.ex │ ├── captcha │ │ └── mock.ex │ ├── channel_case.ex │ ├── cluster.ex │ ├── conn_case.ex │ ├── data_case.ex │ ├── factory.ex │ ├── helpers.ex │ ├── http_request_mock.ex │ ├── language_detector_mock.ex │ ├── mocks.ex │ ├── mrf_module_mock.ex │ ├── null_cache.ex │ ├── oban_helpers.ex │ ├── translation_mock.ex │ └── websocket_client.ex └── test_helper.exs ├── tools ├── check-changelog └── collect-changelog └── uploads └── .gitignore /.formatter.exs: -------------------------------------------------------------------------------- 1 | [ 2 | inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}", "priv/repo/migrations/*.exs", "priv/repo/optional_migrations/**/*.exs", "priv/scrubbers/*.ex"] 3 | ] 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.ex diff=elixir 2 | *.exs diff=elixir 3 | 4 | priv/static/instance/static.css diff=css 5 | 6 | # Most of js/css files included in the repo are minified bundles, 7 | # and we don't want to search/diff those as text files. 8 | *.js binary 9 | *.js.map binary 10 | *.css binary 11 | -------------------------------------------------------------------------------- /.gitlab/merge_request_templates/Release.md: -------------------------------------------------------------------------------- 1 | ### Release checklist 2 | * [ ] Bump version in `mix.exs` 3 | * [ ] Compile a changelog with the `tools/collect-changelog` script 4 | * [ ] Create an MR with an announcement to pleroma.social 5 | #### post-merge 6 | * [ ] Tag the release on the merge commit 7 | * [ ] Make the tag into a Gitlab Release™ 8 | * [ ] Merge `stable` into `develop` (in case the fixes are already in develop, use `git merge -s ours --no-commit` and manually merge the changelogs) 9 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Ariadne Conill 2 | Ariadne Conill 3 | rinpatch 4 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | elixir 1.13 2 | erlang 24.3.4.2 3 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: mix phx.server 2 | release: mix ecto.migrate 3 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rebased", 3 | "description": "Rebased, the recommended backend for Soapbox written in Elixir.", 4 | "keywords": [ 5 | "fediverse" 6 | ], 7 | "website": "https://soapbox.pub", 8 | "dokku": { 9 | "plugins": [ 10 | "postgres" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /benchmarks/load_testing/helper.ex: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.LoadTesting.Helper do 2 | alias Ecto.Adapters.SQL 3 | alias Pleroma.Repo 4 | 5 | def to_sec(microseconds), do: microseconds / 1_000_000 6 | 7 | def clean_tables do 8 | IO.puts("Deleting old data...\n") 9 | SQL.query!(Repo, "TRUNCATE users CASCADE;") 10 | SQL.query!(Repo, "TRUNCATE activities CASCADE;") 11 | SQL.query!(Repo, "TRUNCATE objects CASCADE;") 12 | SQL.query!(Repo, "TRUNCATE oban_jobs CASCADE;") 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /changelog.d/2.6.0-mergeback.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/changelog.d/2.6.0-mergeback.skip -------------------------------------------------------------------------------- /changelog.d/3895.add: -------------------------------------------------------------------------------- 1 | Uploaded media content-type is scrubbed before serving the files to limit the security impact of some attachments 2 | -------------------------------------------------------------------------------- /changelog.d/3896.add: -------------------------------------------------------------------------------- 1 | Validate Host header for Uploads and return a 302 if the base_url has changed 2 | -------------------------------------------------------------------------------- /changelog.d/3900.change: -------------------------------------------------------------------------------- 1 | Update to Phoenix 1.7 2 | -------------------------------------------------------------------------------- /changelog.d/akkoma-xml-remote-entities.security: -------------------------------------------------------------------------------- 1 | Fix XML External Entity (XXE) loading vulnerability allowing to fetch arbitary files from the server's filesystem 2 | -------------------------------------------------------------------------------- /changelog.d/authorize-interaction.add: -------------------------------------------------------------------------------- 1 | Support /authorize-interaction route used by Mastodon -------------------------------------------------------------------------------- /changelog.d/bare_uri_test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/changelog.d/bare_uri_test.skip -------------------------------------------------------------------------------- /changelog.d/benchee.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/changelog.d/benchee.skip -------------------------------------------------------------------------------- /changelog.d/check-attachment-attribution.security: -------------------------------------------------------------------------------- 1 | CommonAPI: Prevent users from accessing media of other users by creating a status with reused attachment ID 2 | -------------------------------------------------------------------------------- /changelog.d/digest_emails.fix: -------------------------------------------------------------------------------- 1 | Fix the processing of email digest jobs. 2 | -------------------------------------------------------------------------------- /changelog.d/docs-max-elixir-erlang.change: -------------------------------------------------------------------------------- 1 | - Document maximum supported version of Erlang & Elixir 2 | -------------------------------------------------------------------------------- /changelog.d/emoji-pack-sanitization.security: -------------------------------------------------------------------------------- 1 | Emoji pack loader sanitizes pack names 2 | -------------------------------------------------------------------------------- /changelog.d/federation_status-access.change: -------------------------------------------------------------------------------- 1 | - Make `/api/v1/pleroma/federation_status` publicly available 2 | -------------------------------------------------------------------------------- /changelog.d/healthcheck-disabled-error.fix: -------------------------------------------------------------------------------- 1 | TwitterAPI: Return proper error when healthcheck is disabled 2 | -------------------------------------------------------------------------------- /changelog.d/meilisearch.add: -------------------------------------------------------------------------------- 1 | Add meilisearch, make search engines pluggable 2 | -------------------------------------------------------------------------------- /changelog.d/nginx-media-redirect-fix.fix: -------------------------------------------------------------------------------- 1 | Fixing 302 redirect issue with media 2 | -------------------------------------------------------------------------------- /changelog.d/otp_perms.security: -------------------------------------------------------------------------------- 1 | - Reduced permissions of config files and directories, distros requiring greater permissions like group-read need to pre-create the directories -------------------------------------------------------------------------------- /changelog.d/quotes-count.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/changelog.d/quotes-count.skip -------------------------------------------------------------------------------- /changelog.d/scrobble-url.add: -------------------------------------------------------------------------------- 1 | Adds the capability to add a URL to a scrobble (optional field) 2 | -------------------------------------------------------------------------------- /changelog.d/system-cflags.fix: -------------------------------------------------------------------------------- 1 | - Fix eblurhash and elixir-captcha not using system cflags 2 | -------------------------------------------------------------------------------- /ci/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM elixir:1.12.3 2 | 3 | # Single RUN statement, otherwise intermediate images are created 4 | # https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run 5 | RUN apt-get update &&\ 6 | apt-get install -y libmagic-dev cmake libimage-exiftool-perl ffmpeg &&\ 7 | mix local.hex --force &&\ 8 | mix local.rebar --force 9 | -------------------------------------------------------------------------------- /ci/build_and_push.sh: -------------------------------------------------------------------------------- 1 | docker build -t gitlab.com/soapbox-pub/rebased/ci:latest --push . 2 | -------------------------------------------------------------------------------- /config/emoji.txt: -------------------------------------------------------------------------------- 1 | firefox, /emoji/Firefox.gif, Gif,Fun 2 | blank, /emoji/blank.png, Fun 3 | dinosaur, /emoji/dino walking.gif, Gif 4 | -------------------------------------------------------------------------------- /coveralls.json: -------------------------------------------------------------------------------- 1 | { 2 | "skip_files": [ 3 | "test/support", 4 | "lib/mix/tasks/pleroma/benchmark.ex", 5 | "lib/credo/check/consistency/file_location.ex" 6 | ] 7 | } -------------------------------------------------------------------------------- /docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | DATABASE_URL=${DATABASE_URL:-"postgres://${DB_USER:-postgres}:${DB_PASS:-postgres}@${DB_HOST:-db}:5432/${DB_NAME:-postgres}"} 6 | 7 | echo "-- Waiting for database..." 8 | while ! pg_isready -d $DATABASE_URL -t 1; do 9 | sleep 1s 10 | done 11 | 12 | echo "-- Running migrations..." 13 | $HOME/bin/pleroma_ctl migrate 14 | 15 | echo "-- Starting!" 16 | exec $HOME/bin/pleroma start 17 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Rebased 2 | 3 | **Rebased** is a Fediverse backend written in Elixir. 4 | It's compatible with the Mastodon API and is the recommended backend for Soapbox. 5 | -------------------------------------------------------------------------------- /docs/SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [Introduction](README.md) 4 | 5 | * Administration 6 | * [Backing up](administration/backup.md) 7 | * [Updating](administration/updating.md) 8 | 9 | ## Configuration 10 | 11 | * [Cheatsheet](configuration/cheatsheet.md) 12 | * [Hardening](configuration/hardening.md) 13 | 14 | * Guides 15 | * [Setting up the media proxy](configuration/howto_proxy.md) 16 | * [Saving config in the database](configuration/howto_database_config.md) -------------------------------------------------------------------------------- /docs/administration/CLI_tasks/general_cli_task_info.include: -------------------------------------------------------------------------------- 1 | Every command should be ran as the `pleroma` user from it's home directory. For example if you are superuser, you would have to wrap the command in `su pleroma -s $SHELL -lc "$COMMAND"`. 2 | 3 | ??? note "From source note about `MIX_ENV`" 4 | 5 | The `mix` command should be prefixed with the name of environment your Pleroma server is running in, usually it's `MIX_ENV=prod` 6 | -------------------------------------------------------------------------------- /docs/administration/CLI_tasks/oauth_app.md: -------------------------------------------------------------------------------- 1 | # Creating trusted OAuth App 2 | 3 | {! backend/administration/CLI_tasks/general_cli_task_info.include !} 4 | 5 | ## Create trusted OAuth App. 6 | 7 | Optional params: 8 | * `-s SCOPES` - scopes for app, e.g. `read,write,follow,push`. 9 | 10 | === "OTP" 11 | 12 | ```sh 13 | ./bin/pleroma_ctl app create -n APP_NAME -r REDIRECT_URI 14 | ``` 15 | 16 | === "From Source" 17 | 18 | ```sh 19 | mix pleroma.app create -n APP_NAME -r REDIRECT_URI 20 | ``` -------------------------------------------------------------------------------- /docs/configuration/auth.md: -------------------------------------------------------------------------------- 1 | See `Authentication` section of [the configuration cheatsheet](../configuration/cheatsheet.md#authentication). 2 | -------------------------------------------------------------------------------- /docs/configuration/howto_proxy.md: -------------------------------------------------------------------------------- 1 | # How to configure upstream proxy for federation 2 | If you want to proxify all http requests (e.g. for TOR) that pleroma makes to an upstream proxy server, edit you config file (`dev.secret.exs` or `prod.secret.exs`) and add the following: 3 | 4 | ``` 5 | config :pleroma, :http, 6 | proxy_url: "127.0.0.1:8123" 7 | ``` 8 | 9 | The other way to do it, for example, with Tor you would most likely add something like this: 10 | ``` 11 | config :pleroma, :http, proxy_url: {:socks5, :localhost, 9050} 12 | ``` 13 | -------------------------------------------------------------------------------- /docs/development/index.md: -------------------------------------------------------------------------------- 1 | This section contains notes and guidelines for developers. 2 | -------------------------------------------------------------------------------- /docs/installation/further_reading.include: -------------------------------------------------------------------------------- 1 | * [How Federation Works/Why is my Federated Timeline empty?](https://blog.soykaf.com/post/how-federation-works/) 2 | * [Backup your instance](../administration/backup.md) 3 | * [Updating your instance](../administration/updating.md) 4 | * [Hardening your instance](../configuration/hardening.md) 5 | * [How to activate mediaproxy](../configuration/howto_mediaproxy.md) 6 | -------------------------------------------------------------------------------- /docs/installation/generic_dependencies.include: -------------------------------------------------------------------------------- 1 | ## Required dependencies 2 | 3 | * PostgreSQL >=9.6 4 | * Elixir >=1.11.0 <1.15 5 | * Erlang OTP >=22.2.0 <26 6 | * git 7 | * file / libmagic 8 | * gcc or clang 9 | * GNU make 10 | * CMake 11 | 12 | ## Optional dependencies 13 | 14 | * ImageMagick 15 | * FFmpeg 16 | * exiftool 17 | -------------------------------------------------------------------------------- /docs/installation/nixos_en.md: -------------------------------------------------------------------------------- 1 | # Installing on NixOS 2 | 3 | NixOS contains a source build package of pleroma and a NixOS module to install it. 4 | For installation add this to your configuration.nix and add a config.exs next to it: 5 | ```nix 6 | services.pleroma = { 7 | enable = true; 8 | configs = [ (lib.fileContents ./config.exs) ]; 9 | secretConfigFile = "/var/lib/pleroma/secret.exs"; 10 | }; 11 | ``` 12 | 13 | ## Questions 14 | The nix community uses matrix for communication: [#nix:nixos.org](https://matrix.to/#/#nix:nixos.org) 15 | 16 | -------------------------------------------------------------------------------- /docs/installation/otp_vs_from_source_source.include: -------------------------------------------------------------------------------- 1 | {! backend/installation/otp_vs_from_source.include !} 2 | 3 | This guide covers a manual from-source installation. To install using OTP releases, please check for the presence of a distro package, failing that you can use [Pleroma-provided OTP binaries](./otp_en.md). 4 | -------------------------------------------------------------------------------- /elixir_buildpack.config: -------------------------------------------------------------------------------- 1 | elixir_version=1.10.4 2 | erlang_version=22.3.4.1 3 | -------------------------------------------------------------------------------- /installation/caddyfile-pleroma.example: -------------------------------------------------------------------------------- 1 | # default Caddyfile config for Pleroma 2 | # 3 | # Simple installation instructions: 4 | # 1. Replace 'example.tld' with your instance's domain wherever it appears. 5 | # 2. Copy this section into your Caddyfile and restart Caddy. 6 | 7 | example.tld { 8 | log { 9 | output file /var/log/caddy/pleroma.log 10 | } 11 | 12 | encode gzip 13 | 14 | # this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only 15 | # and `localhost.` resolves to [::0] on some systems: see issue #930 16 | reverse_proxy 127.0.0.1:4000 17 | } 18 | -------------------------------------------------------------------------------- /installation/nsfw-api.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=NSFW API 3 | After=docker.service 4 | Requires=docker.service 5 | 6 | [Service] 7 | TimeoutStartSec=0 8 | Restart=always 9 | ExecStartPre=-/usr/bin/docker stop %n 10 | ExecStartPre=-/usr/bin/docker rm %n 11 | ExecStartPre=/usr/bin/docker pull eugencepoi/nsfw_api:latest 12 | ExecStart=/usr/bin/docker run --rm -p 127.0.0.1:5000:5000/tcp --env PORT=5000 --name %n eugencepoi/nsfw_api:latest 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /lib/pleroma/config/getting.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Config.Getting do 6 | @callback get(any()) :: any() 7 | @callback get(any(), any()) :: any() 8 | 9 | def get(key), do: get(key, nil) 10 | def get(key, default), do: impl().get(key, default) 11 | 12 | def impl do 13 | Application.get_env(:pleroma, :config_impl, Pleroma.Config) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/pleroma/config/helpers.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Config.Helpers do 6 | alias Pleroma.Config 7 | 8 | def instance_name, do: Config.get([:instance, :name]) 9 | 10 | defp instance_notify_email do 11 | Config.get([:instance, :notify_email]) || Config.get([:instance, :email]) 12 | end 13 | 14 | def sender do 15 | {instance_name(), instance_notify_email()} 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/pleroma/docs/translator.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Docs.Translator do 6 | require Pleroma.Docs.Translator.Compiler 7 | require Pleroma.Web.Gettext 8 | 9 | @before_compile Pleroma.Docs.Translator.Compiler 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/ecto_type/activity_pub/object_validators/safe_text.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.SafeText do 6 | use Ecto.Type 7 | 8 | alias Pleroma.HTML 9 | 10 | def type, do: :string 11 | 12 | def cast(str) when is_binary(str) do 13 | {:ok, HTML.filter_tags(str)} 14 | end 15 | 16 | def cast(_), do: :error 17 | 18 | def dump(data) do 19 | {:ok, data} 20 | end 21 | 22 | def load(data) do 23 | {:ok, data} 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/pleroma/ecto_type/string_id.ex: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.EctoType.StringId do 2 | @moduledoc """ 3 | Stores the value as a number in the database, but represents it as a string. 4 | """ 5 | use Ecto.Type 6 | 7 | def type, do: :id 8 | 9 | def cast(value) do 10 | {:ok, to_string(value)} 11 | end 12 | 13 | def load(value) do 14 | {:ok, to_string(value)} 15 | end 16 | 17 | def dump(value) do 18 | case Integer.parse(value) do 19 | {n, _} -> {:ok, n} 20 | _ -> {:error, value} 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/pleroma/helpers/inet_helper.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Helpers.InetHelper do 6 | def parse_address(ip) when is_tuple(ip) do 7 | {:ok, ip} 8 | end 9 | 10 | def parse_address(ip) when is_binary(ip) do 11 | ip 12 | |> String.to_charlist() 13 | |> parse_address() 14 | end 15 | 16 | def parse_address(ip) do 17 | :inet.parse_address(ip) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/pleroma/http/web_push.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.HTTP.WebPush do 6 | @moduledoc false 7 | 8 | def post(url, payload, headers, options \\ []) do 9 | list_headers = Map.to_list(headers) 10 | Pleroma.HTTP.post(url, payload, list_headers, options) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/pleroma/jwt.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.JWT do 6 | use Joken.Config 7 | 8 | @impl true 9 | def token_config do 10 | default_claims(skip: [:aud]) 11 | |> add_claim("aud", &Pleroma.Web.Endpoint.url/0, &(&1 == Pleroma.Web.Endpoint.url())) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/pleroma/language/language_detector/provider.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Language.LanguageDetector.Provider do 6 | @callback missing_dependencies() :: [String.t()] 7 | 8 | @callback configured?() :: boolean() 9 | 10 | @callback detect(text :: String.t()) :: String.t() | nil 11 | end 12 | -------------------------------------------------------------------------------- /lib/pleroma/logging.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Logging do 6 | @callback error(String.t()) :: any() 7 | end 8 | -------------------------------------------------------------------------------- /lib/pleroma/object_tombstone.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.ObjectTombstone do 6 | @enforce_keys [:id, :formerType, :deleted] 7 | defstruct [:id, :formerType, :deleted, type: "Tombstone"] 8 | end 9 | -------------------------------------------------------------------------------- /lib/pleroma/search.ex: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Search do 2 | alias Pleroma.Workers.SearchIndexingWorker 3 | 4 | def add_to_index(%Pleroma.Activity{id: activity_id}) do 5 | SearchIndexingWorker.enqueue("add_to_index", %{"activity" => activity_id}) 6 | end 7 | 8 | def remove_from_index(%Pleroma.Object{id: object_id}) do 9 | SearchIndexingWorker.enqueue("remove_from_index", %{"object" => object_id}) 10 | end 11 | 12 | def search(query, options) do 13 | search_module = Pleroma.Config.get([Pleroma.Search, :module], Pleroma.Activity) 14 | 15 | search_module.search(options[:for_user], query, options) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/pleroma/upload/filter/set_meta.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2021 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Upload.Filter.SetMeta do 6 | # This filter was renamed to AnalyzeMetadata. 7 | # Include this module for backwards compatibilty. 8 | defdelegate filter(upload), to: Pleroma.Upload.Filter.AnalyzeMetadata 9 | end 10 | -------------------------------------------------------------------------------- /lib/pleroma/web/activity_pub/activity_pub/persisting.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ActivityPub.ActivityPub.Persisting do 6 | @callback persist(map(), keyword()) :: {:ok, struct()} 7 | end 8 | -------------------------------------------------------------------------------- /lib/pleroma/web/activity_pub/activity_pub/streaming.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ActivityPub.ActivityPub.Streaming do 6 | @callback stream_out(struct()) :: any() 7 | @callback stream_out_participations(struct(), struct()) :: any() 8 | end 9 | -------------------------------------------------------------------------------- /lib/pleroma/web/activity_pub/internal_fetch_actor.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ActivityPub.InternalFetchActor do 6 | alias Pleroma.User 7 | 8 | require Logger 9 | 10 | def init do 11 | # Wait for everything to settle. 12 | Process.sleep(1000 * 5) 13 | get_actor() 14 | end 15 | 16 | def get_actor do 17 | "#{Pleroma.Web.Endpoint.url()}/internal/fetch" 18 | |> User.get_or_create_service_actor_by_ap_id("internal.fetch") 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/pleroma/web/activity_pub/mrf/drop_policy.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ActivityPub.MRF.DropPolicy do 6 | require Logger 7 | @moduledoc "Drop and log everything received" 8 | @behaviour Pleroma.Web.ActivityPub.MRF.Policy 9 | 10 | @impl true 11 | def filter(object) do 12 | Logger.debug("REJECTING #{inspect(object)}") 13 | {:reject, object} 14 | end 15 | 16 | @impl true 17 | def describe, do: {:ok, %{}} 18 | end 19 | -------------------------------------------------------------------------------- /lib/pleroma/web/activity_pub/mrf/no_op_policy.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ActivityPub.MRF.NoOpPolicy do 6 | @moduledoc "Does nothing (lets the messages go through unmodified)" 7 | @behaviour Pleroma.Web.ActivityPub.MRF.Policy 8 | 9 | @impl true 10 | def filter(object) do 11 | {:ok, object} 12 | end 13 | 14 | @impl true 15 | def describe, do: {:ok, %{}} 16 | end 17 | -------------------------------------------------------------------------------- /lib/pleroma/web/activity_pub/mrf/pipeline_filtering.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ActivityPub.MRF.PipelineFiltering do 6 | @callback pipeline_filter(map(), keyword()) :: {:ok, map(), keyword()} | {:error, any()} 7 | end 8 | -------------------------------------------------------------------------------- /lib/pleroma/web/activity_pub/mrf/utils.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2023 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ActivityPub.MRF.Utils do 6 | @spec describe_regex_or_string(String.t() | Regex.t()) :: String.t() 7 | def describe_regex_or_string(pattern) do 8 | # This horror is needed to convert regex sigils to strings 9 | if not is_binary(pattern) do 10 | inspect(pattern) 11 | else 12 | pattern 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/pleroma/web/activity_pub/object_validator/validating.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ActivityPub.ObjectValidator.Validating do 6 | @callback validate(map(), keyword()) :: {:ok, map(), keyword()} | {:error, any()} 7 | end 8 | -------------------------------------------------------------------------------- /lib/pleroma/web/activity_pub/side_effects/handling.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ActivityPub.SideEffects.Handling do 6 | @callback handle(map(), keyword()) :: {:ok, map(), keyword()} | {:error, any()} 7 | @callback handle_after_transaction(map()) :: map() 8 | end 9 | -------------------------------------------------------------------------------- /lib/pleroma/web/admin_api/views/announcement_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.AdminAPI.AnnouncementView do 6 | use Pleroma.Web, :view 7 | 8 | def render("index.json", %{announcements: announcements}) do 9 | render_many(announcements, __MODULE__, "show.json") 10 | end 11 | 12 | def render("show.json", %{announcement: announcement}) do 13 | Pleroma.Announcement.render_json(announcement, admin: true) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/pleroma/web/admin_api/views/media_proxy_cache_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.AdminAPI.MediaProxyCacheView do 6 | use Pleroma.Web, :view 7 | 8 | def render("index.json", %{urls: urls, page_size: page_size, count: count}) do 9 | %{ 10 | urls: urls, 11 | count: count, 12 | page_size: page_size 13 | } 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/pleroma/web/admin_api/views/o_auth_app_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.AdminAPI.OAuthAppView do 6 | use Pleroma.Web, :view 7 | alias Pleroma.Web.MastodonAPI 8 | 9 | def render(view, opts), do: MastodonAPI.AppView.render(view, opts) 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/admin_api/views/rule_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.AdminAPI.RuleView do 6 | use Pleroma.Web, :view 7 | 8 | require Pleroma.Constants 9 | 10 | def render("index.json", %{rules: rules} = _opts) do 11 | render_many(rules, __MODULE__, "show.json") 12 | end 13 | 14 | def render("show.json", %{rule: rule} = _opts) do 15 | %{ 16 | id: rule.id, 17 | priority: rule.priority, 18 | text: rule.text 19 | } 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/pleroma/web/admin_api/views/user_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.AdminAPI.UserView do 6 | use Pleroma.Web, :view 7 | alias Pleroma.Web.AdminAPI 8 | 9 | def render(view, opts), do: AdminAPI.AccountView.render(view, opts) 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/api_spec/schemas/actor_type.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ApiSpec.Schemas.ActorType do 6 | require OpenApiSpex 7 | 8 | OpenApiSpex.schema(%{ 9 | title: "ActorType", 10 | type: :string, 11 | enum: ["Application", "Group", "Organization", "Person", "Service"] 12 | }) 13 | end 14 | -------------------------------------------------------------------------------- /lib/pleroma/web/api_spec/schemas/api_error.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ApiSpec.Schemas.ApiError do 6 | alias OpenApiSpex.Schema 7 | 8 | require OpenApiSpex 9 | 10 | OpenApiSpex.schema(%{ 11 | title: "ApiError", 12 | description: "Response schema for API error", 13 | type: :object, 14 | properties: %{error: %Schema{type: :string}}, 15 | example: %{ 16 | "error" => "Something went wrong" 17 | } 18 | }) 19 | end 20 | -------------------------------------------------------------------------------- /lib/pleroma/web/api_spec/schemas/flake_id.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ApiSpec.Schemas.FlakeID do 6 | require OpenApiSpex 7 | 8 | OpenApiSpex.schema(%{ 9 | title: "FlakeID", 10 | description: 11 | "Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are lexically sortable strings", 12 | type: :string 13 | }) 14 | end 15 | -------------------------------------------------------------------------------- /lib/pleroma/web/api_spec/schemas/visibility_scope.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ApiSpec.Schemas.VisibilityScope do 6 | require OpenApiSpex 7 | 8 | OpenApiSpex.schema(%{ 9 | title: "VisibilityScope", 10 | description: "Status visibility", 11 | type: :string, 12 | enum: ["public", "unlisted", "local", "private", "direct", "list"] 13 | }) 14 | end 15 | -------------------------------------------------------------------------------- /lib/pleroma/web/api_spec/scopes/translator.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2023 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ApiSpec.Scopes.Translator do 6 | require Pleroma.Web.ApiSpec.Scopes.Compiler 7 | require Pleroma.Web.Gettext 8 | 9 | @before_compile Pleroma.Web.ApiSpec.Scopes.Compiler 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/federator/publishing.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.Federator.Publishing do 6 | @callback publish(map()) :: any() 7 | end 8 | -------------------------------------------------------------------------------- /lib/pleroma/web/manifest_controller.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.ManifestController do 6 | use Pleroma.Web, :controller 7 | 8 | plug(:skip_auth when action == :show) 9 | 10 | @doc "GET /manifest.json" 11 | def show(conn, _params) do 12 | render(conn, "manifest.json") 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/pleroma/web/mastodon_api/views/announcement_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.MastodonAPI.AnnouncementView do 6 | use Pleroma.Web, :view 7 | 8 | def render("index.json", %{announcements: announcements, user: user}) do 9 | render_many(announcements, __MODULE__, "show.json", user: user) 10 | end 11 | 12 | def render("show.json", %{announcement: announcement, user: user}) do 13 | Pleroma.Announcement.render_json(announcement, for: user) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/pleroma/web/mastodon_api/views/follow_request_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.MastodonAPI.FollowRequestView do 6 | use Pleroma.Web, :view 7 | alias Pleroma.Web.MastodonAPI 8 | 9 | def render(view, opts), do: MastodonAPI.AccountView.render(view, opts) 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/mastodon_api/views/list_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.MastodonAPI.ListView do 6 | use Pleroma.Web, :view 7 | alias Pleroma.Web.MastodonAPI.ListView 8 | 9 | def render("index.json", %{lists: lists} = opts) do 10 | render_many(lists, ListView, "show.json", opts) 11 | end 12 | 13 | def render("show.json", %{list: list}) do 14 | %{ 15 | id: to_string(list.id), 16 | title: list.title 17 | } 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/pleroma/web/mastodon_api/views/media_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.MastodonAPI.MediaView do 6 | use Pleroma.Web, :view 7 | alias Pleroma.Web.MastodonAPI 8 | 9 | def render(view, opts), do: MastodonAPI.StatusView.render(view, opts) 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/mastodon_api/views/report_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.MastodonAPI.ReportView do 6 | use Pleroma.Web, :view 7 | 8 | def render("show.json", %{activity: activity}) do 9 | %{ 10 | id: to_string(activity.id), 11 | action_taken: false 12 | } 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/pleroma/web/mastodon_api/views/timeline_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.MastodonAPI.TimelineView do 6 | use Pleroma.Web, :view 7 | alias Pleroma.Web.MastodonAPI 8 | 9 | def render(view, opts), do: MastodonAPI.StatusView.render(view, opts) 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/metadata/providers/provider.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.Metadata.Providers.Provider do 6 | @callback build_tags(map()) :: list() 7 | end 8 | -------------------------------------------------------------------------------- /lib/pleroma/web/o_auth.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.OAuth do 6 | end 7 | -------------------------------------------------------------------------------- /lib/pleroma/web/o_auth/mfa_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.OAuth.MFAView do 6 | use Pleroma.Web, :view 7 | import Phoenix.HTML.Form 8 | alias Pleroma.MFA 9 | alias Pleroma.Web.Gettext 10 | 11 | def render("mfa_response.json", %{token: token, user: user}) do 12 | %{ 13 | error: "mfa_required", 14 | mfa_token: token.token, 15 | supported_challenge_types: MFA.supported_methods(user) 16 | } 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/pleroma/web/pleroma_api/views/account_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.PleromaAPI.AccountView do 6 | use Pleroma.Web, :view 7 | alias Pleroma.Web.MastodonAPI 8 | 9 | def render(view, opts), do: MastodonAPI.AccountView.render(view, opts) 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/pleroma_api/views/app_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.PleromaAPI.AppView do 6 | use Pleroma.Web, :view 7 | 8 | def render("index.json", %{apps: apps}) do 9 | render_many(apps, Pleroma.Web.MastodonAPI.AppView, "show.json") 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/pleroma/web/pleroma_api/views/conversation_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.PleromaAPI.ConversationView do 6 | use Pleroma.Web, :view 7 | alias Pleroma.Web.MastodonAPI 8 | 9 | def render(view, opts), do: MastodonAPI.ConversationView.render(view, opts) 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/pleroma_api/views/notification_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.PleromaAPI.NotificationView do 6 | use Pleroma.Web, :view 7 | alias Pleroma.Web.MastodonAPI 8 | 9 | def render(view, opts), do: MastodonAPI.NotificationView.render(view, opts) 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/plug.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.Plug do 6 | # Substitute for `call/2` which is defined with `use Pleroma.Web, :plug` 7 | @callback perform(Plug.Conn.t(), Plug.opts()) :: Plug.Conn.t() 8 | end 9 | -------------------------------------------------------------------------------- /lib/pleroma/web/plugs/set_user_session_id_plug.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.Plugs.SetUserSessionIdPlug do 6 | alias Pleroma.Helpers.AuthHelper 7 | alias Pleroma.Web.OAuth.Token 8 | 9 | def init(opts) do 10 | opts 11 | end 12 | 13 | def call(%{assigns: %{token: %Token{} = oauth_token}} = conn, _) do 14 | AuthHelper.put_session_token(conn, oauth_token.token) 15 | end 16 | 17 | def call(conn, _), do: conn 18 | end 19 | -------------------------------------------------------------------------------- /lib/pleroma/web/preload/providers/provider.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.Preload.Providers.Provider do 6 | @callback generate_terms(map()) :: map() 7 | end 8 | -------------------------------------------------------------------------------- /lib/pleroma/web/rich_media/parser/embed.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2021 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.RichMedia.Parser.Embed do 6 | @moduledoc """ 7 | Represents embedded content, including scraped markup and OEmbed. 8 | """ 9 | defstruct url: nil, title: nil, meta: nil, oembed: nil 10 | end 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/rich_media/parser/ttl.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.RichMedia.Parser.TTL do 6 | @callback ttl(Map.t(), String.t()) :: Integer.t() | nil 7 | end 8 | -------------------------------------------------------------------------------- /lib/pleroma/web/rich_media/parsers/ogp.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.RichMedia.Parsers.OGP do 6 | @deprecated "OGP parser is deprecated. Use TwitterCard instead." 7 | def parse(_html, data), do: data 8 | end 9 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/embed/_attachment.html.eex: -------------------------------------------------------------------------------- 1 | <%= case @mediaType do %> 2 | <% "audio" -> %> 3 | 4 | <% "video" -> %> 5 | 6 | <% _ -> %> 7 | <%= @name %> 8 | <% end %> 9 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/feed/feed/_tag_activity.xml.eex: -------------------------------------------------------------------------------- 1 | 2 | <%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %> 3 | 4 | 5 | <%= activity_context(@activity) %> 6 | <%= activity_context(@activity) %> 7 | <%= to_rfc2822(@data["published"]) %> 8 | 9 | <%= activity_description(@data) %> 10 | <%= for attachment <- @data["attachment"] || [] do %> 11 | 12 | <% end %> 13 | 14 | 15 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/layout/email.html.eex: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= @email.subject %> 6 | 7 | 8 | <%= render Phoenix.Controller.view_module(@conn), Phoenix.Controller.view_template(@conn), assigns %> 9 | 10 | 11 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/layout/embed.html.eex: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <%= Pleroma.Config.get([:instance, :name]) %> 7 | 8 | <%= Phoenix.HTML.raw(assigns[:meta] || "") %> 9 | 10 | 11 | 12 | 13 | <%= render Phoenix.Controller.view_module(@conn), Phoenix.Controller.view_template(@conn), assigns %> 14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/layout/metadata_player.html.eex: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | <%= @inner_content %> 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/layout/static_fe.html.eex: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <%= Pleroma.Config.get([:instance, :name]) %> 7 | <%= Phoenix.HTML.raw(assigns[:meta] || "") %> 8 | 9 | 10 | 11 |
12 | <%= @inner_content %> 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/mailer/subscription/unsubscribe_failure.html.eex: -------------------------------------------------------------------------------- 1 |

<%= Gettext.dpgettext("static_pages", "mailer unsubscribe failed message", "UNSUBSCRIBE FAILURE") %>

2 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/mailer/subscription/unsubscribe_success.html.eex: -------------------------------------------------------------------------------- 1 |

<%= Gettext.dpgettext("static_pages", "mailer unsubscribe successful message", "UNSUBSCRIBE SUCCESSFUL") %>

2 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/o_auth/o_auth/oob_authorization_created.html.eex: -------------------------------------------------------------------------------- 1 |

<%= Gettext.dpgettext("static_pages", "oauth authorized page title", "Successfully authorized") %>

2 |

<%= raw Gettext.dpgettext("static_pages", "oauth token code message", "Token code is
%{token}
", token: safe_to_string(html_escape(@auth.token))) %>

3 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/o_auth/o_auth/oob_token_exists.html.eex: -------------------------------------------------------------------------------- 1 |

<%= Gettext.dpgettext("static_pages", "oauth authorization exists page title", "Authorization exists") %>

2 |

<%= raw Gettext.dpgettext("static_pages", "oauth token code message", "Token code is
%{token}
", token: safe_to_string(html_escape(@token.token))) %>

3 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/static_fe/static_fe/_attachment.html.eex: -------------------------------------------------------------------------------- 1 | <%= case @mediaType do %> 2 | <% "audio" -> %> 3 | 4 | <% "video" -> %> 5 | 6 | <% _ -> %> 7 | <%= @name %> 8 | <% end %> 9 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/static_fe/static_fe/_user_card.html.eex: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/static_fe/static_fe/conversation.html.eex: -------------------------------------------------------------------------------- 1 |
2 |

<%= link instance_name(), to: "/" %>

3 |
4 | 5 |
6 |
7 | <%= for activity <- @activities do %> 8 | <%= render("_notice.html", activity) %> 9 | <% end %> 10 |
11 |
12 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/static_fe/static_fe/error.html.eex: -------------------------------------------------------------------------------- 1 |
2 |

<%= gettext("Oops") %>

3 |
4 | 5 |
6 |

<%= @message %>

7 |
8 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/twitter_api/password/invalid_token.html.eex: -------------------------------------------------------------------------------- 1 |

<%= Gettext.dpgettext("static_pages", "password reset invalid token message", "Invalid Token") %>

2 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/twitter_api/password/reset_failed.html.eex: -------------------------------------------------------------------------------- 1 |

<%= Gettext.dpgettext("static_pages", "password reset failed message", "Password reset failed") %>

2 |

3 | 4 | <%= Gettext.dpgettext("static_pages", "password reset failed homepage link", "Homepage") %> 5 | 6 |

7 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/twitter_api/password/reset_success.html.eex: -------------------------------------------------------------------------------- 1 |

<%= Gettext.dpgettext("static_pages", "password reset successful message", "Password changed!") %>

2 |

<%= Gettext.dpgettext("static_pages", "password reset successful homepage link", "Homepage") %>

3 | -------------------------------------------------------------------------------- /lib/pleroma/web/templates/twitter_api/remote_follow/followed.html.eex: -------------------------------------------------------------------------------- 1 | <%= if @error do %> 2 |

<%= Gettext.dpgettext("static_pages", "remote follow error", "Error following account") %>

3 | <% else %> 4 |

<%= Gettext.dpgettext("static_pages", "remote follow success", "Account followed!") %>

5 | <% end %> 6 | -------------------------------------------------------------------------------- /lib/pleroma/web/twitter_api/views/password_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.TwitterAPI.PasswordView do 6 | use Pleroma.Web, :view 7 | import Phoenix.HTML.Form 8 | alias Pleroma.Web.Gettext 9 | end 10 | -------------------------------------------------------------------------------- /lib/pleroma/web/twitter_api/views/remote_follow_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.TwitterAPI.RemoteFollowView do 6 | use Pleroma.Web, :view 7 | import Phoenix.HTML.Form 8 | alias Pleroma.Web.Gettext 9 | 10 | def avatar_url(user) do 11 | user 12 | |> Pleroma.User.avatar_url() 13 | |> Pleroma.Web.MediaProxy.url() 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/pleroma/web/utils/colors/rgb.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.Utils.Colors.RGB do 6 | defstruct red: 0, green: 0, blue: 0 7 | 8 | @type t :: %__MODULE__{ 9 | red: non_neg_integer(), 10 | green: non_neg_integer(), 11 | blue: non_neg_integer() 12 | } 13 | end 14 | -------------------------------------------------------------------------------- /lib/pleroma/web/utils/guards.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.Utils.Guards do 6 | @moduledoc """ 7 | Project-wide custom guards. 8 | See: https://hexdocs.pm/elixir/master/patterns-and-guards.html#custom-patterns-and-guards-expressions 9 | """ 10 | 11 | @doc "Checks for non-empty string" 12 | defguard not_empty_string(string) when is_binary(string) and string != "" 13 | end 14 | -------------------------------------------------------------------------------- /lib/pleroma/web/views/layout_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.LayoutView do 6 | use Pleroma.Web, :view 7 | end 8 | -------------------------------------------------------------------------------- /lib/pleroma/web/views/mailer/subscription_view.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.Mailer.SubscriptionView do 6 | use Pleroma.Web, :view 7 | alias Pleroma.Web.Gettext 8 | end 9 | -------------------------------------------------------------------------------- /lib/pleroma/workers/remote_fetcher_worker.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Workers.RemoteFetcherWorker do 6 | alias Pleroma.Object.Fetcher 7 | 8 | use Pleroma.Workers.WorkerHelper, queue: "remote_fetcher" 9 | 10 | @impl Oban.Worker 11 | def perform(%Job{args: %{"op" => "fetch_remote", "id" => id} = args}) do 12 | {:ok, _object} = Fetcher.fetch_object_from_id(id, depth: args["depth"]) 13 | end 14 | 15 | @impl Oban.Worker 16 | def timeout(_job), do: :timer.seconds(10) 17 | end 18 | -------------------------------------------------------------------------------- /lib/soapbox.ex: -------------------------------------------------------------------------------- 1 | defmodule Soapbox do 2 | @version "3.0.0" 3 | 4 | def version, do: @version 5 | end 6 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170320193800_create_user.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreatePleroma.User do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:users) do 10 | add(:email, :string) 11 | add(:password_hash, :string) 12 | add(:name, :string) 13 | add(:nickname, :string) 14 | add(:bio, :string) 15 | 16 | timestamps() 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170321074828_create_activity.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreatePleroma.Activity do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:activities) do 10 | add(:data, :map) 11 | 12 | timestamps() 13 | end 14 | 15 | create_if_not_exists(index(:activities, [:data], using: :gin)) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170321074832_create_object.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreatePleroma.Object do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:objects) do 10 | add(:data, :map) 11 | 12 | timestamps() 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170321133335_add_following_list_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddFollowingListToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:following, :map) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170321143152_add_ap_id_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddApIdToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:ap_id, :string) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170330153447_add_index_to_objects.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddIndexToObjects do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(index(:objects, [:data], using: :gin)) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170415141210_add_unique_index_to_email_and_nickname.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddUniqueIndexToEmailAndNickname do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(unique_index(:users, [:email])) 10 | create_if_not_exists(unique_index(:users, [:nickname])) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170416122418_add_avatar_object_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddAvatarObjectToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:avatar, :map) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170423154511_add_fields_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddFieldsToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:local, :boolean, default: true) 11 | add(:info, :map) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170427054757_add_user_and_hub.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddUserAndHub do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:websub_client_subscriptions) do 10 | add(:hub, :string) 11 | add(:user_id, references(:users)) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170501124823_add_id_contraints_to_activities_and_objects.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddIdContraintsToActivitiesAndObjects do 6 | use Ecto.Migration 7 | 8 | def change do 9 | # This was wrong, make it a noop. 10 | # create index(:objects, ["(data->>\"id\")"], name: :objects_unique_apid_index) 11 | # create index(:activities, ["(data->>\"id\")"], name: :activities_unique_apid_index) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170502083023_add_local_field_to_activities.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddLocalFieldToActivities do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:activities) do 10 | add(:local, :boolean, default: true) 11 | end 12 | 13 | create_if_not_exists(index(:activities, [:local])) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170506222027_add_unique_index_to_apid.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddUniqueIndexToAPID do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(unique_index(:users, [:ap_id])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170529093232_longer_bios.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.LongerBios do 6 | use Ecto.Migration 7 | 8 | def up do 9 | alter table(:users) do 10 | modify(:bio, :text) 11 | end 12 | end 13 | 14 | def down do 15 | alter table(:users) do 16 | modify(:bio, :string) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170620095947_remove_activities_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemoveActivitiesIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | drop_if_exists(index(:activities, [:data])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170620133028_add_object_activity_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddObjectActivityIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | # This was wrong, now a noop 10 | # create_if_not_exists index(:objects, ["(data->'object'->>'id')", "(data->>'type')"], name: :activities_create_objects_index) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170701142005_add_actor_index_to_activity.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddActorIndexToActivity do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists( 10 | index(:activities, ["(data->>'actor')", "inserted_at desc"], name: :activities_actor_index) 11 | ) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170719152213_add_follower_address_to_user.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddFollowerAddressToUser do 6 | use Ecto.Migration 7 | 8 | def up do 9 | alter table(:users) do 10 | add(:follower_address, :string, unique: true) 11 | end 12 | end 13 | 14 | def down do 15 | alter table(:users) do 16 | remove(:follower_address) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170906120646_add_mastodon_apps.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddMastodonApps do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:apps) do 10 | add(:client_name, :string) 11 | add(:redirect_uris, :string) 12 | add(:scopes, :string) 13 | add(:website, :string) 14 | add(:client_id, :string) 15 | add(:client_secret, :string) 16 | 17 | timestamps() 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170906152508_create_o_auth_token.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateOAuthToken do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:oauth_tokens) do 10 | add(:app_id, references(:apps)) 11 | add(:user_id, references(:users)) 12 | add(:token, :string) 13 | add(:refresh_token, :string) 14 | add(:valid_until, :naive_datetime_usec) 15 | 16 | timestamps() 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170912114248_add_context_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddContextIndex do 6 | use Ecto.Migration 7 | @disable_ddl_transaction true 8 | 9 | def change do 10 | create( 11 | index(:activities, ["(data->>'type')", "(data->>'context')"], 12 | name: :activities_context_index, 13 | concurrently: true 14 | ) 15 | ) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170916090107_add_fts_index_to_activities.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddFTSIndexToActivities do 6 | use Ecto.Migration 7 | @disable_ddl_transaction true 8 | 9 | def change do 10 | create( 11 | index(:activities, ["(to_tsvector('english', data->'object'->>'content'))"], 12 | concurrently: true, 13 | using: :gin, 14 | name: :activities_fts 15 | ) 16 | ) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /priv/repo/migrations/20170917120416_add_tag_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddTagIndex do 6 | use Ecto.Migration 7 | 8 | @disable_ddl_transaction true 9 | 10 | def change do 11 | create( 12 | index(:activities, ["(data #> '{\"object\",\"tag\"}')"], 13 | concurrently: true, 14 | using: :gin, 15 | name: :activities_tags 16 | ) 17 | ) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20171019141706_create_password_reset_tokens.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreatePasswordResetTokens do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:password_reset_tokens) do 10 | add(:token, :string) 11 | add(:user_id, references(:users)) 12 | add(:used, :boolean, default: false) 13 | 14 | timestamps() 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20171024090137_drop_object_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.DropObjectIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | drop_if_exists(index(:objects, [:data], using: :gin)) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20171024121413_add_object_actor_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddObjectActorIndex do 6 | use Ecto.Migration 7 | 8 | @disable_ddl_transaction true 9 | 10 | def change do 11 | create( 12 | index(:objects, ["(data->>'actor')", "(data->>'type')"], 13 | concurrently: true, 14 | name: :objects_actor_type 15 | ) 16 | ) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /priv/repo/migrations/20171109141309_add_sort_index_to_activities.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddSortIndexToActivities do 6 | use Ecto.Migration 7 | @disable_ddl_transaction true 8 | 9 | def change do 10 | create(index(:activities, ["id desc nulls last"], concurrently: true)) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20171130135819_add_local_index_to_user.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddLocalIndexToUser do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(index(:users, [:local])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20171212163643_add_recipients_to_activities.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddRecipientsToActivities do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:activities) do 10 | add(:recipients, {:array, :string}) 11 | end 12 | 13 | create_if_not_exists(index(:activities, [:recipients], using: :gin)) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180325172351_add_follower_address_index_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddFollowerAddressIndexToUsers do 6 | use Ecto.Migration 7 | 8 | @disable_ddl_transaction true 9 | def change do 10 | create(index(:users, [:follower_address], concurrently: true)) 11 | create(index(:users, [:following], concurrently: true, using: :gin)) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180327174350_drop_local_index_on_activities.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.DropLocalIndexOnActivities do 6 | use Ecto.Migration 7 | 8 | def change do 9 | drop_if_exists(index(:users, [:local])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180327175831_actually_drop_local_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.ActuallyDropLocalIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(index(:users, [:local])) 10 | drop_if_exists(index("activities", :local)) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180429094642_create_lists.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateLists do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:lists) do 10 | add(:user_id, references(:users, on_delete: :delete_all)) 11 | add(:title, :string) 12 | add(:following, {:array, :string}) 13 | 14 | timestamps() 15 | end 16 | 17 | create_if_not_exists(index(:lists, [:user_id])) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180513104714_modify_activity_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.ModifyActivityIndex do 6 | use Ecto.Migration 7 | @disable_ddl_transaction true 8 | 9 | def change do 10 | create(index(:activities, ["id desc nulls last", "local"], concurrently: true)) 11 | drop_if_exists(index(:activities, ["id desc nulls last"])) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180516154905_create_user_trigram_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateUserTrigramIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists( 10 | index(:users, ["(nickname || name) gist_trgm_ops"], name: :users_trigram_index, using: :gist) 11 | ) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180530123448_add_list_follow_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddListFollowIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(index(:lists, [:following])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180606173637_create_apid_host_extraction_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateApidHostExtractionIndex do 6 | use Ecto.Migration 7 | @disable_ddl_transaction true 8 | 9 | def change do 10 | create( 11 | index(:activities, ["(split_part(actor, '/', 3))"], 12 | concurrently: true, 13 | name: :activities_hosts 14 | ) 15 | ) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180612110515_create_user_invite_tokens.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateUserInviteTokens do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:user_invite_tokens) do 10 | add(:token, :string) 11 | add(:used, :boolean, default: false) 12 | 13 | timestamps() 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180617221540_create_activities_in_reply_to_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateActivitiesInReplyToIndex do 6 | use Ecto.Migration 7 | @disable_ddl_transaction true 8 | 9 | def change do 10 | create( 11 | index(:activities, ["(data->'object'->>'inReplyTo')"], 12 | concurrently: true, 13 | name: :activities_in_reply_to 14 | ) 15 | ) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180829182612_activities_add_to_cc_indices.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.ActivitiesAddToCcIndices do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists( 10 | index(:activities, ["(data->'to')"], name: :activities_to_index, using: :gin) 11 | ) 12 | 13 | create_if_not_exists( 14 | index(:activities, ["(data->'cc')"], name: :activities_cc_index, using: :gin) 15 | ) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180903114437_users_add_is_moderator_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.UsersAddIsModeratorIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists( 10 | index(:users, ["(info->'is_moderator')"], name: :users_is_moderator_index, using: :gin) 11 | ) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20180919060348_users_add_last_refreshed_at.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.UsersAddLastRefreshedAt do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:last_refreshed_at, :naive_datetime_usec) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20181201104428_add_uuid_extension.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddUUIDExtension do 6 | use Ecto.Migration 7 | 8 | def up do 9 | execute("create extension if not exists \"uuid-ossp\"") 10 | end 11 | 12 | def down, do: :ok 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20181201105617_add_uui_ds_to_user_info.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddUUIDsToUserInfo do 6 | use Ecto.Migration 7 | 8 | def up do 9 | execute("update users set info = jsonb_set(info, '{\"id\"}', to_jsonb(uuid_generate_v4()))") 10 | end 11 | 12 | def down, do: :ok 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20181206125616_add_tags_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddTagsToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:tags, {:array, :string}) 11 | end 12 | 13 | create_if_not_exists(index(:users, [:tags], using: :gin)) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20181214121049_add_bookmarks_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddBookmarksToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:bookmarks, {:array, :string}, null: false, default: []) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190123092341_users_add_is_admin_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.UsersAddIsAdminIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists( 10 | index(:users, ["(info->'is_admin')"], name: :users_is_admin_index, using: :gin) 11 | ) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190123125839_fix_info_ids.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.FixInfoIds do 6 | use Ecto.Migration 7 | 8 | def up do 9 | execute( 10 | "update users set info = jsonb_set(info, '{id}', to_jsonb(uuid_generate_v4())) where info->'id' is null;" 11 | ) 12 | end 13 | 14 | def down, do: :ok 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190126160540_change_push_subscriptions_varchar.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.ChangePushSubscriptionsVarchar do 6 | use Ecto.Migration 7 | 8 | def up do 9 | alter table(:push_subscriptions) do 10 | modify(:endpoint, :varchar) 11 | end 12 | end 13 | 14 | def down do 15 | alter table(:push_subscriptions) do 16 | modify(:endpoint, :string) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190127151220_add_activities_likes_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddActivitiesLikesIndex do 6 | use Ecto.Migration 7 | @disable_ddl_transaction true 8 | 9 | def change do 10 | create( 11 | index(:activities, ["((data #> '{\"object\",\"likes\"}'))"], 12 | concurrently: true, 13 | name: :activities_likes, 14 | using: :gin 15 | ) 16 | ) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190205114625_create_thread_mutes.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateThreadMutes do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:thread_mutes) do 10 | add(:user_id, references(:users, type: :uuid, on_delete: :delete_all)) 11 | add(:context, :string) 12 | end 13 | 14 | create_if_not_exists(unique_index(:thread_mutes, [:user_id, :context], name: :unique_index)) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190208131753_add_scopes_to_o_auth_entities.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddScopeSToOAuthEntities do 6 | use Ecto.Migration 7 | 8 | def change do 9 | for t <- [:oauth_authorizations, :oauth_tokens] do 10 | alter table(t) do 11 | add(:scopes, {:array, :string}, default: [], null: false) 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190213185600_data_migration_populate_o_auth_scopes.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.DataMigrationPopulateOAuthScopes do 6 | use Ecto.Migration 7 | 8 | def up do 9 | for t <- [:oauth_authorizations, :oauth_tokens] do 10 | execute("UPDATE #{t} SET scopes = apps.scopes FROM apps WHERE #{t}.app_id = apps.id;") 11 | end 12 | end 13 | 14 | def down, do: :noop 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190222104808_data_migration_normalize_scopes.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.DataMigrationNormalizeScopes do 6 | use Ecto.Migration 7 | 8 | def up do 9 | for t <- [:apps, :oauth_authorizations, :oauth_tokens] do 10 | execute("UPDATE #{t} SET scopes = string_to_array(array_to_string(scopes, ' '), ' ');") 11 | end 12 | end 13 | 14 | def down, do: :noop 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190301101154_add_default_tags_to_user.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddDefaultTagsToUser do 6 | use Ecto.Migration 7 | 8 | def up do 9 | execute("UPDATE users SET tags = array[]::varchar[] where tags IS NULL") 10 | end 11 | 12 | def down, do: :noop 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190325185009_create_notification_id_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateNotificationIdIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(index(:notifications, ["id desc nulls last"])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190403131720_add_oauth_token_indexes.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddOauthTokenIndexes do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(unique_index(:oauth_tokens, [:token])) 10 | create_if_not_exists(index(:oauth_tokens, [:app_id])) 11 | create_if_not_exists(index(:oauth_tokens, [:user_id])) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190404050946_add_fields_to_user_invite_tokens.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddFieldsToUserInviteTokens do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:user_invite_tokens) do 10 | add(:expires_at, :date) 11 | add(:uses, :integer, default: 0) 12 | add(:max_use, :integer) 13 | add(:invite_type, :string, default: "one_time") 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190405160700_add_index_on_subscribers.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddIndexOnSubscribers do 6 | use Ecto.Migration 7 | 8 | @disable_ddl_transaction true 9 | def change do 10 | create( 11 | index(:users, ["(info->'subscribers')"], 12 | name: :users_subscribers_index, 13 | using: :gin, 14 | concurrently: true 15 | ) 16 | ) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190410152859_add_participation_updated_at_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddParticipationUpdatedAtIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(index(:conversation_participations, ["updated_at desc"])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190411094120_add_index_on_user_info_deactivated.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddIndexOnUserInfoDeactivated do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists( 10 | index(:users, ["(info->'deactivated')"], name: :users_deactivated_index, using: :gin) 11 | ) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190413085040_add_signin_and_last_digest_dates_to_user.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddSigninAndLastDigestDatesToUser do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:last_digest_emailed_at, :naive_datetime, default: fragment("now()")) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190501133552_add_refresh_token_index_to_token.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddRefreshTokenIndexToToken do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(unique_index(:oauth_tokens, [:refresh_token])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190506054542_add_multi_factor_authentication_settings_to_user.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddMultiFactorAuthenticationSettingsToUser do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:multi_factor_authentication_settings, :map, default: %{}) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190513175809_change_hide_column_in_filter_table.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.ChangeHideColumnInFilterTable do 6 | use Ecto.Migration 7 | 8 | def up do 9 | alter table(:filters) do 10 | modify(:hide, :boolean, default: false) 11 | end 12 | end 13 | 14 | def down do 15 | alter table(:filters) do 16 | modify(:hide, :boolean) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190518032627_create_config.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateConfig do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:config) do 10 | add(:key, :string) 11 | add(:value, :binary) 12 | timestamps() 13 | end 14 | 15 | create_if_not_exists(unique_index(:config, :key)) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190603115238_add_index_on_activities_local.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddIndexOnActivitiesLocal do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(index("activities", [:local])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190603162018_add_object_in_reply_to_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddObjectInReplyToIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create(index(:objects, ["(data->>'inReplyTo')"], name: :objects_in_reply_to_index)) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190603173419_add_tag_index_to_objects.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddTagIndexToObjects do 6 | use Ecto.Migration 7 | 8 | def change do 9 | drop_if_exists( 10 | index(:activities, ["(data #> '{\"object\",\"tag\"}')"], using: :gin, name: :activities_tags) 11 | ) 12 | 13 | create_if_not_exists(index(:objects, ["(data->'tag')"], using: :gin, name: :objects_tags)) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190622151019_add_group_key_to_config.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddGroupKeyToConfig do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table("config") do 10 | add(:group, :string) 11 | end 12 | 13 | drop_if_exists(unique_index("config", :key)) 14 | create_if_not_exists(unique_index("config", [:group, :key])) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190710115833_add_following_address_to_user.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddFollowingAddressToUser do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:following_address, :string, unique: true) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190710125051_add_following_address_index_to_user.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddFollowingAddressIndexToUser do 6 | use Ecto.Migration 7 | 8 | @disable_ddl_transaction true 9 | def change do 10 | create(index(:users, [:following_address], concurrently: true)) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CopyMutedToMutedNotifications do 6 | use Ecto.Migration 7 | 8 | def change do 9 | execute("update users set info = '{}' where info is null") 10 | 11 | execute( 12 | "update users set info = safe_jsonb_set(info, '{muted_notifications}', info->'mutes', true) where local = true" 13 | ) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190716100804_add_expirations_table.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddExpirationsTable do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:activity_expirations) do 10 | add(:activity_id, references(:activities, type: :uuid, on_delete: :delete_all)) 11 | add(:scheduled_at, :naive_datetime, null: false) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190730055101_add_oban_jobs_table.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddObanJobsTable do 6 | use Ecto.Migration 7 | 8 | def up do 9 | Oban.Migrations.up(version: 2) 10 | end 11 | 12 | defdelegate down, to: Oban.Migrations 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190818124341_create_moderation_log.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateModerationLog do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create table(:moderation_log) do 10 | add(:data, :map) 11 | 12 | timestamps() 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190823000549_add_likes_index_to_objects.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddLikesIndexToObjects do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(index(:objects, ["(data->'likes')"], using: :gin, name: :objects_likes)) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190917100019_update_oban.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.UpdateOban do 6 | use Ecto.Migration 7 | 8 | def up do 9 | Oban.Migrations.up(version: 4) 10 | end 11 | 12 | def down do 13 | Oban.Migrations.down(version: 3) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191005165212_add_unread_conversation_count_to_user_info.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddUnreadConversationCountToUserInfo do 6 | use Ecto.Migration 7 | 8 | def up do 9 | execute(""" 10 | update users set info = jsonb_set(info, '{unread_conversation_count}', 0::varchar::jsonb, true) where local=true 11 | """) 12 | end 13 | 14 | def down, do: :ok 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191006123824_add_keys_column.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddKeysColumn do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table("users") do 10 | add_if_not_exists(:keys, :text) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191006135457_move_keys_to_separate_column.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.MoveKeysToSeparateColumn do 6 | use Ecto.Migration 7 | 8 | def change do 9 | execute( 10 | "update users set keys = info->>'keys' where local", 11 | "update users set info = jsonb_set(info, '{keys}'::text[], to_jsonb(keys)) where local" 12 | ) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191017225002_drop_websub_tables.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.DropWebsubTables do 6 | use Ecto.Migration 7 | 8 | def up do 9 | drop_if_exists(table(:websub_client_subscriptions)) 10 | drop_if_exists(table(:websub_server_subscriptions)) 11 | end 12 | 13 | def down, do: :noop 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191025081729_add_move_support_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddMoveSupportToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:also_known_as, {:array, :string}, default: [], null: false) 11 | add(:allow_following_move, :boolean, default: true, null: false) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191026191023_set_not_null_for_instances.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.SetNotNullForInstances do 6 | use Ecto.Migration 7 | 8 | # modify/3 function will require index recreation, so using execute/1 instead 9 | 10 | def up do 11 | execute("ALTER TABLE instances 12 | ALTER COLUMN host SET NOT NULL") 13 | end 14 | 15 | def down do 16 | execute("ALTER TABLE instances 17 | ALTER COLUMN host DROP NOT NULL") 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191026191100_set_not_null_for_lists.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.SetNotNullForLists do 6 | use Ecto.Migration 7 | 8 | # modify/3 function will require index recreation, so using execute/1 instead 9 | 10 | def up do 11 | execute("ALTER TABLE lists 12 | ALTER COLUMN user_id SET NOT NULL") 13 | end 14 | 15 | def down do 16 | execute("ALTER TABLE lists 17 | ALTER COLUMN user_id DROP NOT NULL") 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191026191134_set_not_null_for_markers.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.SetNotNullForMarkers do 6 | use Ecto.Migration 7 | 8 | # modify/3 function will require index recreation, so using execute/1 instead 9 | 10 | def up do 11 | execute("ALTER TABLE markers 12 | ALTER COLUMN user_id SET NOT NULL") 13 | end 14 | 15 | def down do 16 | execute("ALTER TABLE markers 17 | ALTER COLUMN user_id DROP NOT NULL") 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191026191442_set_not_null_for_objects.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.SetNotNullForObjects do 6 | use Ecto.Migration 7 | 8 | # modify/3 function will require index recreation, so using execute/1 instead 9 | 10 | def up do 11 | execute("ALTER TABLE objects 12 | ALTER COLUMN data SET NOT NULL") 13 | end 14 | 15 | def down do 16 | execute("ALTER TABLE objects 17 | ALTER COLUMN data DROP NOT NULL") 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191123030554_add_activitypub_actor_type.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddActivitypubActorType do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table("users") do 10 | add(:actor_type, :string, null: false, default: "Person") 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191123103423_remove_info_from_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemoveInfoFromUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | remove(:info, :map, default: %{}) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191203043610_create_report_notes.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateReportNotes do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:report_notes) do 10 | add(:user_id, references(:users, type: :uuid)) 11 | add(:activity_id, references(:activities, type: :uuid)) 12 | add(:content, :string) 13 | 14 | timestamps() 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200227122417_add_trusted_to_apps.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddTrustedToApps do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:apps) do 10 | add(:trusted, :boolean, default: false) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200307103755_fix_moderation_log_subjects.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.FixModerationLogSubjects do 6 | use Ecto.Migration 7 | 8 | def change do 9 | execute( 10 | "update moderation_log set data = safe_jsonb_set(data, '{subject}', safe_jsonb_set('[]'::jsonb, '{0}', data->'subject')) where jsonb_typeof(data->'subject') != 'array' and data->>'action' = ANY('{revoke,grant,activate,deactivate,delete}');" 11 | ) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200314123607_config_remove_fetch_initial_posts.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.ConfigRemoveFetchInitialPosts do 6 | use Ecto.Migration 7 | 8 | def change do 9 | execute( 10 | "delete from config where config.key = ':fetch_initial_posts' and config.group = ':pleroma';", 11 | "" 12 | ) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200315125756_delete_fetch_initial_posts_jobs.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.DeleteFetchInitialPostsJobs do 6 | use Ecto.Migration 7 | 8 | def change do 9 | execute( 10 | "delete from oban_jobs where worker = 'Pleroma.Workers.BackgroundWorker' and args->>'op' = 'fetch_initial_posts';", 11 | "" 12 | ) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200322174133_user_raw_bio.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.UserRawBio do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add_if_not_exists(:raw_bio, :text) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200402063221_update_oban_jobs_table.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.UpdateObanJobsTable do 6 | use Ecto.Migration 7 | 8 | def up do 9 | Oban.Migrations.up(version: 8) 10 | end 11 | 12 | def down do 13 | Oban.Migrations.down(version: 8) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200406105422_users_remove_source_data.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.UsersRemoveSourceData do 6 | use Ecto.Migration 7 | 8 | def up do 9 | alter table(:users) do 10 | remove_if_exists(:source_data, :map) 11 | end 12 | end 13 | 14 | def down do 15 | alter table(:users) do 16 | add_if_not_exists(:source_data, :map, default: %{}) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200505072231_remove_magic_key_field.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemoveMagicKeyField do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | remove(:magic_key, :string) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200526144426_add_apps_indexes.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddAppsIndexes do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create(index(:apps, [:client_id, :client_secret])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200527104138_change_notification_user_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.ChangeNotificationUserIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | drop_if_exists(index(:notifications, [:user_id])) 10 | create_if_not_exists(index(:notifications, [:user_id, "id desc nulls last"])) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200602094828_add_type_to_notifications.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddTypeToNotifications do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:notifications) do 10 | add(:type, :string) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200602125218_backfill_notification_types.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.BackfillNotificationTypes do 6 | use Ecto.Migration 7 | 8 | def up do 9 | Pleroma.MigrationHelper.NotificationBackfill.fill_in_notification_types() 10 | end 11 | 12 | def down do 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200603105113_add_unique_index_to_chat_message_references.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddUniqueIndexToChatMessageReferences do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create(unique_index(:chat_message_references, [:object_id, :chat_id])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200603120448_remove_unread_from_chats.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemoveUnreadFromChats do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:chats) do 10 | remove(:unread, :integer, default: 0) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200603122732_add_seen_index_to_chat_message_references.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddSeenIndexToChatMessageReferences do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create( 10 | index(:chat_message_references, [:chat_id], 11 | where: "seen = false", 12 | name: "unseen_messages_count_index" 13 | ) 14 | ) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200630162024_rename_user_settings_col.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RenameUserSettingsCol do 6 | use Ecto.Migration 7 | 8 | def up do 9 | rename(table(:users), :settings, to: :mastofe_settings) 10 | end 11 | 12 | def down do 13 | rename(table(:users), :mastofe_settings, to: :settings) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200706060258_remove_tesla_from_config.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemoveTeslaFromConfig do 6 | use Ecto.Migration 7 | 8 | def up do 9 | execute("DELETE FROM config WHERE config.group = ':tesla'") 10 | end 11 | 12 | def down do 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200707112859_instances_add_favicon.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.InstancesAddFavicon do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:instances) do 10 | add(:favicon, :string) 11 | add(:favicon_updated_at, :naive_datetime) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200712234852_add_approval_fields_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddApprovalFieldsToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:approval_pending, :boolean) 11 | add(:registration_reason, :text) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200804180322_remove_nonlocal_expirations.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemoveNonlocalExpirations do 6 | use Ecto.Migration 7 | 8 | def up do 9 | statement = """ 10 | DELETE FROM 11 | activity_expirations A USING activities B 12 | WHERE 13 | A.activity_id = B.id 14 | AND B.local = false; 15 | """ 16 | 17 | execute(statement) 18 | end 19 | 20 | def down do 21 | :ok 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200804183107_add_unique_index_to_app_client_id.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddUniqueIndexToAppClientId do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create(unique_index(:apps, [:client_id])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200806175913_rename_instance_chat.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RenameInstanceChat do 6 | use Ecto.Migration 7 | 8 | alias Pleroma.ConfigDB 9 | 10 | def up, do: :noop 11 | def down, do: :noop 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200811125613_set_defaults_to_user_approval_pending.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.SetDefaultsToUserApprovalPending do 6 | use Ecto.Migration 7 | 8 | def up do 9 | execute("UPDATE users SET approval_pending = false WHERE approval_pending IS NULL") 10 | 11 | alter table(:users) do 12 | modify(:approval_pending, :boolean, default: false, null: false) 13 | end 14 | end 15 | 16 | def down do 17 | :ok 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200817120935_add_invisible_index_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddInvisibleIndexToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create(index(:users, [:invisible])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200824115541_rename_activity_expiration_setting.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RenameActivityExpirationSetting do 6 | use Ecto.Migration 7 | 8 | def change do 9 | config = Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: Pleroma.ActivityExpiration}) 10 | 11 | if config do 12 | config 13 | |> Ecto.Changeset.change(key: Pleroma.Workers.PurgeExpiredActivity) 14 | |> Pleroma.Repo.update() 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200825093037_drop_activity_expirations_table.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.DropActivityExpirationsTable do 6 | use Ecto.Migration 7 | 8 | def change do 9 | drop(table("activity_expirations")) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200831115854_add_unread_index_to_conversation_participation.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddUnreadIndexToConversationParticipation do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create( 10 | index(:conversation_participations, [:user_id], 11 | where: "read = false", 12 | name: "unread_conversation_participation_count_index" 13 | ) 14 | ) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200901061256_ensure_bio_is_string.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.EnsureBioIsString do 6 | use Ecto.Migration 7 | 8 | def change do 9 | execute("update users set bio = '' where bio is null", "") 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200901061637_bio_set_not_null.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.BioSetNotNull do 6 | use Ecto.Migration 7 | 8 | def change do 9 | execute( 10 | "alter table users alter column bio set not null", 11 | "alter table users alter column bio drop not null" 12 | ) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200925065249_make_user_ids_ci.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.MakeUserIdsCI do 6 | use Ecto.Migration 7 | 8 | def change do 9 | # Migration retired, see 10 | # https://git.pleroma.social/pleroma/pleroma/-/issues/2188 11 | :noop 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200928145912_revert_citext_change.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RevertCitextChange do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | modify(:uri, :text) 11 | end 12 | 13 | # create_if_not_exists(unique_index(:users, :uri)) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200930082320_user_ur_is_index_part_three.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.UserURIsIndexPartThree do 6 | use Ecto.Migration 7 | 8 | def change do 9 | drop_if_exists(unique_index(:users, :uri)) 10 | create_if_not_exists(index(:users, :uri)) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20201013141127_refactor_locked_user_field.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RefactorLockedUserField do 6 | use Ecto.Migration 7 | 8 | def up do 9 | execute("ALTER TABLE users RENAME COLUMN locked TO is_locked;") 10 | end 11 | 12 | def down do 13 | execute("ALTER TABLE users RENAME COLUMN is_locked TO locked;") 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20201013144052_refactor_discoverable_user_field.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RefactorDiscoverableUserField do 6 | use Ecto.Migration 7 | 8 | def up do 9 | execute("ALTER TABLE users RENAME COLUMN discoverable TO is_discoverable;") 10 | end 11 | 12 | def down do 13 | execute("ALTER TABLE users RENAME COLUMN is_discoverable TO discoverable;") 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20201221202251_create_hashtags.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.CreateHashtags do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists table(:hashtags) do 10 | add(:name, :citext, null: false) 11 | 12 | timestamps() 13 | end 14 | 15 | create_if_not_exists(unique_index(:hashtags, [:name])) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20201221202252_remove_data_from_hashtags.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemoveDataFromHashtags do 6 | use Ecto.Migration 7 | 8 | def up do 9 | alter table(:hashtags) do 10 | remove_if_exists(:data, :map) 11 | end 12 | end 13 | 14 | def down do 15 | alter table(:hashtags) do 16 | add_if_not_exists(:data, :map, default: %{}) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210115205649_upgrade_oban_jobs_to_v9.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.UpgradeObanJobsToV9 do 6 | use Ecto.Migration 7 | 8 | def up do 9 | Oban.Migrations.up(version: 9) 10 | end 11 | 12 | def down do 13 | Oban.Migrations.down(version: 9) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210121080964_add_default_text_search_config.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddDefaultTextSearchConfig do 6 | use Ecto.Migration 7 | 8 | def change do 9 | execute("DO $$ 10 | BEGIN 11 | execute 'ALTER DATABASE \"'||current_database()||'\" SET default_text_search_config = ''english'' '; 12 | END 13 | $$;") 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210122151424_add_last_active_at_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddLastActiveAtToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:last_active_at, :naive_datetime) 11 | end 12 | 13 | create_if_not_exists(index(:users, [:last_active_at])) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210202110641_add_pinned_objects_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddPinnedObjectsToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:pinned_objects, :map) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210206045221_remove_pinned_activities_from_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemovePinnedActivitiesFromUsers do 6 | use Ecto.Migration 7 | 8 | def up do 9 | alter table(:users) do 10 | remove(:pinned_activities) 11 | end 12 | end 13 | 14 | def down do 15 | alter table(:users) do 16 | add(:pinned_activities, {:array, :string}, default: []) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210218223811_add_disclose_client_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddDiscloseClientToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:disclose_client, :boolean, default: true) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210222183840_remove_hashtags_objects_duplicate_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemoveHashtagsObjectsDuplicateIndex do 6 | use Ecto.Migration 7 | 8 | @moduledoc "Removes `hashtags_objects_hashtag_id_object_id_index` index (duplicate of PK index)." 9 | 10 | def up do 11 | drop_if_exists(unique_index(:hashtags_objects, [:hashtag_id, :object_id])) 12 | end 13 | 14 | def down, do: nil 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210222184616_change_hashtags_name_to_text.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.ChangeHashtagsNameToText do 6 | use Ecto.Migration 7 | 8 | def up do 9 | alter table(:hashtags) do 10 | modify(:name, :text) 11 | end 12 | end 13 | 14 | def down do 15 | alter table(:hashtags) do 16 | modify(:name, :citext) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210416051708_remove_mastofe_settings_from_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemoveMastofeSettingsFromUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | remove_if_exists(:mastofe_settings, :map) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210612185407_add_email_list_field_to_users.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Repo.Migrations.AddEmailListFieldToUsers do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add(:accepts_email_list, :boolean, default: false) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210818023112_add_user_id_to_apps.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddUserIdToApps do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:apps) do 10 | add(:user_id, references(:users, type: :uuid, on_delete: :delete_all)) 11 | end 12 | 13 | create_if_not_exists(index(:apps, [:user_id])) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20211125110126_force_pinned_objects_to_exist.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.ForcePinnedObjectsToExist do 6 | use Ecto.Migration 7 | 8 | def change do 9 | execute("UPDATE users SET pinned_objects = '{}' WHERE pinned_objects IS NULL") 10 | 11 | alter table("users") do 12 | modify(:pinned_objects, :map, null: false, default: %{}) 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20211126191138_add_suggestions.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddSuggestions do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:is_suggested, :boolean, default: false, null: false) 11 | end 12 | 13 | create_if_not_exists(index(:users, [:is_suggested])) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20211222165256_add_last_status_at_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddLastStatusAtToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:last_status_at, :naive_datetime) 11 | end 12 | 13 | create_if_not_exists(index(:users, [:last_status_at])) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20211225154802_add_is_discoverable_index_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddIsDiscoverableIndexToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create(index(:users, [:is_discoverable])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20211229075801_user_relationships_target_id_relationship_type_index.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.UserRelationshipsTargetIdRelationshipTypeIndex do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(index(:user_relationships, [:target_id, :relationship_type])) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220116183110_add_birthday_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddBirthdayToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add_if_not_exists(:birthday, :date) 11 | add_if_not_exists(:show_birthday, :boolean, default: false, null: false) 12 | end 13 | 14 | create_if_not_exists(index(:users, [:show_birthday])) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220125104429_add_birthday_month_day_index_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddBirthdayMonthDayIndexToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create( 10 | index(:users, ["date_part('month', birthday)", "date_part('day', birthday)"], 11 | name: :users_birthday_month_day_index 12 | ) 13 | ) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220203224011_create_rules.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Repo.Migrations.CreateRules do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create_if_not_exists table(:rules) do 6 | add(:priority, :integer, default: 0, null: false) 7 | add(:text, :text, null: false) 8 | 9 | timestamps() 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220225164000_add_activity_assigned_account_index.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Repo.Migrations.AddActivityAssignedAccountIndex do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create_if_not_exists( 6 | index(:activities, ["(data->>'assigned_account')"], name: :activities_assigned_account_index) 7 | ) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220302013920_add_language_to_users.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Repo.Migrations.AddLanguageToUsers do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add_if_not_exists(:language, :string) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220314220000_add_location_to_users.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Repo.Migrations.AddLocationToUsers do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add_if_not_exists(:location, :string) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220527134341_add_quote_url_index_to_objects.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddQuoteUrlIndexToObjects do 6 | use Ecto.Migration 7 | 8 | def change do 9 | create_if_not_exists(index(:objects, ["(data->'quoteUrl')"], name: :objects_quote_url)) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220602052233_change_report_notes_content_to_text.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Repo.Migrations.ChangeReportNotesContentToText do 2 | use Ecto.Migration 3 | 4 | def up do 5 | alter table(:report_notes) do 6 | modify(:content, :text) 7 | end 8 | end 9 | 10 | # 20191203043610_create_report_notes.exs 11 | def down do 12 | alter table(:report_notes) do 13 | modify(:content, :string) 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220616163503_add_expires_at_to_user_relationships.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddExpiresAtToUserRelationships do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:user_relationships) do 10 | add_if_not_exists(:expires_at, :utc_datetime) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220807125023_data_migration_delete_context_objects.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Repo.Migrations.DataMigrationDeleteContextObjects do 2 | use Ecto.Migration 3 | 4 | require Logger 5 | 6 | def up do 7 | dt = NaiveDateTime.utc_now() 8 | 9 | execute( 10 | "INSERT INTO data_migrations(name, inserted_at, updated_at) " <> 11 | "VALUES ('delete_context_objects', '#{dt}', '#{dt}') ON CONFLICT DO NOTHING;" 12 | ) 13 | end 14 | 15 | def down do 16 | execute("DELETE FROM data_migrations WHERE name = 'delete_context_objects';") 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220927220033_add_last_move_at_to_users.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddLastMoveAtToUsers do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | add(:last_move_at, :naive_datetime) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20221029171353_add_internal_to_webhooks.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddInternalToWebhooks do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:webhooks) do 10 | add(:internal, :boolean, default: false, null: false) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20221103014611_create_oban_peers.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Repo.Migrations.CreateObanPeers do 2 | use Ecto.Migration 3 | 4 | def up, do: Oban.Migrations.up(version: 11) 5 | 6 | def down, do: Oban.Migrations.down(version: 11) 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20221207235104_add_events_index.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Repo.Migrations.AddEventsIndex do 2 | use Ecto.Migration 3 | 4 | @disable_ddl_transaction true 5 | @disable_migration_lock true 6 | 7 | def change do 8 | create_if_not_exists( 9 | index(:objects, ["(data->>'type')"], 10 | where: "data->>'type' = 'Event'", 11 | name: :objects_events, 12 | concurrently: true 13 | ) 14 | ) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20221216052127_add_state_to_backups.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.AddStateToBackups do 6 | use Ecto.Migration 7 | 8 | def up do 9 | alter table(:backups) do 10 | add(:state, :integer, default: 5) 11 | add(:processed_number, :integer, default: 0) 12 | end 13 | end 14 | 15 | def down do 16 | alter table(:backups) do 17 | remove(:state) 18 | remove(:processed_number) 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230306112859_instances_add_metadata.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2023 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.InstancesAddMetadata do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:instances) do 10 | add(:metadata, :map) 11 | add(:metadata_updated_at, :utc_datetime) 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230504173400_remove_user_ap_enabled.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2023 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Repo.Migrations.RemoveUserApEnabled do 6 | use Ecto.Migration 7 | 8 | def change do 9 | alter table(:users) do 10 | remove(:ap_enabled, :boolean, default: false, null: false) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20231107200724_consolidate_email_queues.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Repo.Migrations.ConsolidateEmailQueues do 2 | use Ecto.Migration 3 | 4 | def change do 5 | execute( 6 | "UPDATE oban_jobs SET queue = 'mailer' WHERE queue in ('digest_emails', 'new_users_digest')" 7 | ) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/seeds.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | # Script for populating the database. You can run it as: 6 | # 7 | # mix run priv/repo/seeds.exs 8 | # 9 | # Inside the script, you can read and write to any of your 10 | # repositories directly: 11 | # 12 | # Pleroma.Repo.insert!(%Pleroma.SomeSchema{}) 13 | # 14 | # We recommend using the bang functions (`insert!`, `update!` 15 | # and so on) as they will fail if something goes wrong. 16 | -------------------------------------------------------------------------------- /priv/scrubbers/o_embed.ex: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.HTML.Scrubber.OEmbed do 2 | @moduledoc """ 3 | Scrubs OEmbed HTML 4 | """ 5 | require FastSanitize.Sanitizer.Meta 6 | alias FastSanitize.Sanitizer.Meta 7 | 8 | Meta.strip_comments() 9 | 10 | Meta.allow_tag_with_these_attributes(:iframe, [ 11 | "width", 12 | "height", 13 | "src", 14 | "allowfullscreen" 15 | ]) 16 | 17 | Meta.strip_everything_not_covered() 18 | end 19 | -------------------------------------------------------------------------------- /priv/static/READ_THIS_BEFORE_TOUCHING_FILES_HERE: -------------------------------------------------------------------------------- 1 | If you are an instance admin and you want to modify the instace static files, this is probably not the right place to do it. This directory is checked in version control, so don't be surprised if you get merge conflicts after modifying anything here. Please use instance static directory instead, it has the same directory structure and files placed there will override files placed here. See https://docs.pleroma.social/backend/configuration/static_dir/ for more info 2 | -------------------------------------------------------------------------------- /priv/static/adminfe/chunk-0c60.ee394b7b.css: -------------------------------------------------------------------------------- 1 | .error-page-container[data-v-09709f1e]{min-height:100%;width:100%;background-color:#2d3a4b;overflow:hidden}.error-page-container .buttons-group[data-v-09709f1e]{margin-top:4em}.error-page-container .el-icon-warning[data-v-09709f1e]{font-size:4.2em;color:#eee;margin:0 auto}.error-page-container .error-page[data-v-09709f1e]{width:45rem;max-width:100%;margin:16rem auto;text-align:center}.error-page-container .error-title[data-v-09709f1e]{color:#eee} -------------------------------------------------------------------------------- /priv/static/adminfe/chunk-45ed.fc62bc5c.css: -------------------------------------------------------------------------------- 1 | .error-page-container[data-v-6c40cae5]{min-height:100%;width:100%;background-color:#2d3a4b;overflow:hidden}.error-page-container .buttons-group[data-v-6c40cae5]{margin-top:4em}.error-page-container .el-icon-warning[data-v-6c40cae5]{font-size:4.2em;color:#eee;margin:0 auto}.error-page-container .error-page[data-v-6c40cae5]{width:45rem;max-width:100%;margin:16rem auto;text-align:center}.error-page-container .error-title[data-v-6c40cae5]{color:#eee} -------------------------------------------------------------------------------- /priv/static/adminfe/chunk-5cf2.5bf52c8f.css: -------------------------------------------------------------------------------- 1 | .follow-relay{width:350px;margin-right:7px}.relays-container{margin:0 15px}.relays-header-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}@media only screen and (max-width:480px){.follow-relay{width:75%;margin-right:5px}.follow-relay input{width:100%}.follow-relay-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:0 5px}.relays-container{margin:0 10px}} -------------------------------------------------------------------------------- /priv/static/adminfe/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/adminfe/favicon.ico -------------------------------------------------------------------------------- /priv/static/adminfe/static/fonts/element-icons.535877f.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/adminfe/static/fonts/element-icons.535877f.woff -------------------------------------------------------------------------------- /priv/static/adminfe/static/fonts/element-icons.732389d.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/adminfe/static/fonts/element-icons.732389d.ttf -------------------------------------------------------------------------------- /priv/static/adminfe/static/js/7zzA.e1ae1c94.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([["7zzA"],{"7zzA":function(e,r,n){"use strict";n.r(r);var t={beforeCreate:function(){var e=this.$route,r=e.params,n=e.query,t=r.path;this.$router.replace({path:"/"+t,query:n})},render:function(e){return e()}},o=n("KHd+"),u=Object(o.a)(t,void 0,void 0,!1,null,null,null);u.options.__file="index.vue";r.default=u.exports}}]); 2 | //# sourceMappingURL=7zzA.e1ae1c94.js.map -------------------------------------------------------------------------------- /priv/static/adminfe/static/js/JEtC.f9ba4594.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([["JEtC"],{JEtC:function(o,n,i){"use strict";i.r(n);var e={name:"AuthRedirect",created:function(){var o=window.location.search.slice(1);window.opener.location.href=window.location.origin+"/login#"+o,window.close()}},t=i("KHd+"),c=Object(t.a)(e,void 0,void 0,!1,null,null,null);c.options.__file="authredirect.vue";n.default=c.exports}}]); 2 | //# sourceMappingURL=JEtC.f9ba4594.js.map -------------------------------------------------------------------------------- /priv/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/favicon.png -------------------------------------------------------------------------------- /priv/static/images/avi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/images/avi.png -------------------------------------------------------------------------------- /priv/static/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/images/banner.png -------------------------------------------------------------------------------- /priv/static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/images/logo.png -------------------------------------------------------------------------------- /priv/static/images/shortcuts/chats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/images/shortcuts/chats.png -------------------------------------------------------------------------------- /priv/static/images/shortcuts/notifications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/images/shortcuts/notifications.png -------------------------------------------------------------------------------- /priv/static/images/shortcuts/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/images/shortcuts/search.png -------------------------------------------------------------------------------- /priv/static/instance/panel.html: -------------------------------------------------------------------------------- 1 |
2 |

Welcome to Pleroma!

3 |

Pleroma FE

4 |
5 | 6 | -------------------------------------------------------------------------------- /priv/static/instance/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/priv/static/instance/thumbnail.png -------------------------------------------------------------------------------- /priv/static/robots.txt: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /priv/static/static/js/48.b5ecdbc517423af07ca4.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * Cropper.js v1.5.13 3 | * https://fengyuanchen.github.io/cropperjs 4 | * 5 | * Copyright 2015-present Chen Fengyuan 6 | * Released under the MIT license 7 | * 8 | * Date: 2022-11-20T05:30:46.114Z 9 | */ 10 | 11 | /*! vue-qrcode v2.0.0 | (c) 2018-present Chen Fengyuan | MIT */ 12 | -------------------------------------------------------------------------------- /priv/static/static/terms-of-service.html: -------------------------------------------------------------------------------- 1 |

Terms of Service

2 | 3 |

This is the default placeholder ToS. You should copy it over to your static folder and edit it to fit the needs of your instance.

4 | 5 |

To do so, place a file at "/instance/static/static/terms-of-service.html" in your 6 | Pleroma install containing the real ToS for your instance.

7 |

See the Pleroma documentation for more information.

8 |
9 | 10 | -------------------------------------------------------------------------------- /priv/templates/robots_txt.eex: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Disallow: <%= if indexable, do: "", else: "/" %> 3 | -------------------------------------------------------------------------------- /priv/templates/sample_psql.eex: -------------------------------------------------------------------------------- 1 | CREATE USER <%= dbuser %> WITH ENCRYPTED PASSWORD '<%= dbpass %>'; 2 | CREATE DATABASE <%= dbname %> OWNER <%= dbuser %>; 3 | \c <%= dbname %>; 4 | --Extensions made by ecto.migrate that need superuser access 5 | CREATE EXTENSION IF NOT EXISTS citext; 6 | CREATE EXTENSION IF NOT EXISTS pg_trgm; 7 | CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; 8 | <%= if rum_enabled do 9 | "CREATE EXTENSION IF NOT EXISTS rum;" 10 | else 11 | "" 12 | end %> 13 | -------------------------------------------------------------------------------- /rebased.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/rebased.png -------------------------------------------------------------------------------- /rel/env.sh.eex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Sets and enables heart (recommended only in daemon mode) 4 | # if [ "$RELEASE_COMMAND" = "daemon" ] || [ "$RELEASE_COMMAND" = "daemon_iex" ]; then 5 | # HEART_COMMAND="$RELEASE_ROOT/bin/$RELEASE_NAME $RELEASE_COMMAND" 6 | # export HEART_COMMAND 7 | # export ELIXIR_ERL_OPTIONS="-heart" 8 | # fi 9 | 10 | # Set the release to work across nodes 11 | export RELEASE_DISTRIBUTION="${RELEASE_DISTRIBUTION:-name}" 12 | export RELEASE_NODE="${RELEASE_NODE:-<%= @release.name %>@127.0.0.1}" 13 | -------------------------------------------------------------------------------- /rel/files/installation/init.d/pleroma: -------------------------------------------------------------------------------- 1 | #!/sbin/openrc-run 2 | 3 | supervisor=supervise-daemon 4 | 5 | # Requires OpenRC >= 0.35 6 | directory=/opt/pleroma 7 | 8 | command=/opt/pleroma/bin/pleroma 9 | command_args="start" 10 | command_user=pleroma 11 | command_background=1 12 | no_new_privs="yes" 13 | 14 | # Ask process to terminate within 30 seconds, otherwise kill it 15 | retry="SIGTERM/30/SIGKILL/5" 16 | 17 | pidfile="/var/run/pleroma.pid" 18 | 19 | depend() { 20 | want nginx 21 | need postgresql 22 | } 23 | -------------------------------------------------------------------------------- /rel/vm.args.eex: -------------------------------------------------------------------------------- 1 | ## Customize flags given to the VM: http://erlang.org/doc/man/erl.html 2 | ## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here 3 | 4 | ## Number of dirty schedulers doing IO work (file, sockets, etc) 5 | ##+SDio 5 6 | 7 | ## Increase number of concurrent ports/sockets 8 | ##+Q 65536 9 | 10 | ## Tweak GC to run more often 11 | ##-env ERL_FULLSWEEP_AFTER 10 12 | -------------------------------------------------------------------------------- /restarter/lib/restarter.ex: -------------------------------------------------------------------------------- 1 | defmodule Restarter do 2 | use Application 3 | 4 | def start(_, _) do 5 | opts = [strategy: :one_for_one, name: Restarter.Supervisor] 6 | Supervisor.start_link([Restarter.Pleroma], opts) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /restarter/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Restarter.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :restarter, 7 | version: "0.1.0", 8 | elixir: "~> 1.10", 9 | start_permanent: Mix.env() == :prod, 10 | deps: deps() 11 | ] 12 | end 13 | 14 | def application do 15 | [ 16 | mod: {Restarter, []}, 17 | extra_applications: [:logger] 18 | ] 19 | end 20 | 21 | defp deps, do: [] 22 | end 23 | -------------------------------------------------------------------------------- /test/config/emoji.txt: -------------------------------------------------------------------------------- 1 | external_emoji, https://example.com/emoji.png 2 | -------------------------------------------------------------------------------- /test/fixtures/DSCN0010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/DSCN0010.jpg -------------------------------------------------------------------------------- /test/fixtures/activitypub-client-post-activity.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": ["https://www.w3.org/ns/activitystreams", {"@language": "en-GB"}], 3 | "type": "Create", 4 | "object": { 5 | "type": "Note", 6 | "to": ["https://www.w3.org/ns/activitystreams#Public"], 7 | "content": "It's a note" 8 | }, 9 | "to": ["https://www.w3.org/ns/activitystreams#Public"] 10 | } 11 | -------------------------------------------------------------------------------- /test/fixtures/config/temp.exported_from_db.secret.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | import Config 6 | 7 | config :pleroma, exported_config_merged: true 8 | 9 | config :pleroma, :first_setting, key: "new value" 10 | -------------------------------------------------------------------------------- /test/fixtures/config/temp.secret.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | import Config 6 | 7 | config :pleroma, :first_setting, key: "value", key2: [Pleroma.Repo] 8 | 9 | config :pleroma, :second_setting, key: "value2", key2: ["Activity"] 10 | 11 | config :pleroma, Pleroma.Repo, pool: Ecto.Adapters.SQL.Sandbox 12 | 13 | config :postgrex, :json_library, Poison 14 | 15 | config :pleroma, :database, rum_enabled: true 16 | -------------------------------------------------------------------------------- /test/fixtures/custom_instance_panel.html: -------------------------------------------------------------------------------- 1 |

Custom instance panel

-------------------------------------------------------------------------------- /test/fixtures/emoji/packs/blank.png.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/emoji/packs/blank.png.zip -------------------------------------------------------------------------------- /test/fixtures/emoji/packs/default-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "finmoji": { 3 | "license": "CC BY-NC-ND 4.0", 4 | "homepage": "https://finland.fi/emoji/", 5 | "description": "Finland is the first country in the world to publish its own set of country themed emojis. The Finland emoji collection contains 56 tongue-in-cheek emotions, which were created to explain some hard-to-describe Finnish emotions, Finnish words and customs.", 6 | "src": "https://finland.fi/wp-content/uploads/2017/06/finland-emojis.zip", 7 | "src_sha256": "384025A1AC6314473863A11AC7AB38A12C01B851A3F82359B89B4D4211D3291D", 8 | "files": "finmoji.json" 9 | } 10 | } -------------------------------------------------------------------------------- /test/fixtures/emoji/packs/finmoji.json: -------------------------------------------------------------------------------- 1 | { 2 | "blank": "blank.png" 3 | } -------------------------------------------------------------------------------- /test/fixtures/emoji/packs/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "blobs.gg": { 3 | "src_sha256": "3a12f3a181678d5b3584a62095411b0d60a335118135910d879920f8ade5a57f", 4 | "src": "https://git.pleroma.social/pleroma/emoji-index/raw/master/packs/blobs_gg.zip", 5 | "license": "Apache 2.0", 6 | "homepage": "https://blobs.gg", 7 | "files": "blobs_gg.json", 8 | "description": "Blob Emoji from blobs.gg repacked as apng" 9 | } 10 | } -------------------------------------------------------------------------------- /test/fixtures/emojis.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/emojis.zip -------------------------------------------------------------------------------- /test/fixtures/empty.zip: -------------------------------------------------------------------------------- 1 | PK -------------------------------------------------------------------------------- /test/fixtures/host-meta-zetsubou.xn--q9jyb4c.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/fixtures/image.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/image.gif -------------------------------------------------------------------------------- /test/fixtures/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/image.jpg -------------------------------------------------------------------------------- /test/fixtures/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/image.png -------------------------------------------------------------------------------- /test/fixtures/image_with_caption-abstract.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/image_with_caption-abstract.jpg -------------------------------------------------------------------------------- /test/fixtures/image_with_imagedescription_and_caption-abstract.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/image_with_imagedescription_and_caption-abstract.jpg -------------------------------------------------------------------------------- /test/fixtures/image_with_imagedescription_and_caption-abstract_and_stray_data_after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/image_with_imagedescription_and_caption-abstract_and_stray_data_after.png -------------------------------------------------------------------------------- /test/fixtures/image_with_imagedescription_and_caption-abstract_whitespaces.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/image_with_imagedescription_and_caption-abstract_whitespaces.jpg -------------------------------------------------------------------------------- /test/fixtures/image_with_no_description.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/image_with_no_description.jpg -------------------------------------------------------------------------------- /test/fixtures/image_with_stray_data_after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/image_with_stray_data_after.png -------------------------------------------------------------------------------- /test/fixtures/mastodon-nodeinfo20.json: -------------------------------------------------------------------------------- 1 | {"version":"2.0","software":{"name":"mastodon","version":"4.1.0"},"protocols":["activitypub"],"services":{"outbound":[],"inbound":[]},"usage":{"users":{"total":971090,"activeMonth":167218,"activeHalfyear":384808},"localPosts":52071541},"openRegistrations":true,"metadata":{}} -------------------------------------------------------------------------------- /test/fixtures/mastodon-well-known-nodeinfo.json: -------------------------------------------------------------------------------- 1 | {"links":[{"rel":"http://nodeinfo.diaspora.software/ns/schema/2.0","href":"https://mastodon.example.org/nodeinfo/2.0"}]} -------------------------------------------------------------------------------- /test/fixtures/mastodon/collections/external_featured.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://www.w3.org/ns/activitystreams", 4 | "https://{{domain}}/schemas/litepub-0.1.jsonld", 5 | { 6 | "@language": "und" 7 | } 8 | ], 9 | "id": "https://{{domain}}/users/{{nickname}}/collections/featured", 10 | "orderedItems": [ 11 | "https://{{domain}}/objects/{{object_id}}" 12 | ], 13 | "type": "OrderedCollection" 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/misskey-like.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context" : [ 3 | "https://www.w3.org/ns/activitystreams", 4 | "https://w3id.org/security/v1", 5 | {"Hashtag" : "as:Hashtag"} 6 | ], 7 | "_misskey_reaction" : "pudding", 8 | "actor": "http://mastodon.example.org/users/admin", 9 | "cc" : ["https://testing.pleroma.lol/users/lain"], 10 | "id" : "https://misskey.xyz/75149198-2f45-46e4-930a-8b0538297075", 11 | "nickname" : "lain", 12 | "object" : "https://testing.pleroma.lol/objects/c331bbf7-2eb9-4801-a709-2a6103492a5a", 13 | "type" : "Like" 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/modules/good_mrf.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Fixtures.Modules.GoodMRF do 6 | @behaviour Pleroma.Web.ActivityPub.MRF.Policy 7 | 8 | @impl true 9 | def filter(a), do: {:ok, a} 10 | 11 | @impl true 12 | def describe, do: %{} 13 | 14 | @impl true 15 | def config_description do 16 | %{ 17 | key: :good_mrf, 18 | related_policy: "Fixtures.Modules.GoodMRF", 19 | label: "Good MRF", 20 | description: "Some description" 21 | } 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /test/fixtures/modules/runtime_module.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Fixtures.Modules.RuntimeModule do 6 | @moduledoc """ 7 | This is a dummy module to test custom runtime modules. 8 | """ 9 | end 10 | -------------------------------------------------------------------------------- /test/fixtures/preload_static/instance/panel.html: -------------------------------------------------------------------------------- 1 | HEY! 2 | -------------------------------------------------------------------------------- /test/fixtures/rel_me_anchor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blog 6 | 7 | 8 |
9 |

Lorem ipsum

10 |

Lorem ipsum dolor sit ameph, …

11 | lain’s account 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /test/fixtures/rel_me_anchor_nofollow.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blog 6 | 7 | 8 |
9 |

Lorem ipsum

10 |

Lorem ipsum dolor sit ameph, …

11 | lain’s account 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /test/fixtures/rel_me_link.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blog 6 | 7 | 8 | 9 |
10 |

Lorem ipsum

11 |

Lorem ipsum dolor sit ameph, …

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /test/fixtures/rel_me_null.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blog 6 | 7 | 8 |
9 |

Lorem ipsum

10 |

Lorem ipsum dolor sit ameph, …

11 | lain’s account 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /test/fixtures/relay/accept-follow.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://www.w3.org/ns/activitystreams", 3 | "actor": "https://relay.mastodon.host/actor", 4 | "id": "https://relay.mastodon.host/activities/ec477b69-db26-4019-923e-cf809de516ab", 5 | "object": { 6 | "actor": "{{ap_id}}", 7 | "id": "{{activity_id}}", 8 | "object": "https://relay.mastodon.host/actor", 9 | "type": "Follow" 10 | }, 11 | "to": [ 12 | "{{ap_id}}" 13 | ], 14 | "type": "Accept" 15 | } -------------------------------------------------------------------------------- /test/fixtures/rich_media/malformed-data.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/rich_media/malformed-data.html -------------------------------------------------------------------------------- /test/fixtures/rich_media/oembed.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /test/fixtures/rich_media/ogp-missing-data.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Pleroma 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/fixtures/rich_media/ogp-missing-title.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The Rock (1996) 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/fixtures/rich_media/ogp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | The Rock (1996) 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/fixtures/rich_media/twitter_card.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/fixtures/sound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/sound.mp3 -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/deepl-translation.json: -------------------------------------------------------------------------------- 1 | {"translations":[{"detected_source_language":"PL","text":"REMOVE THE FOLLOWER!Paste this on your follower. If we get 70% of nk users...they will remove the follower!!!"}]} -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/dist/test.txt: -------------------------------------------------------------------------------- 1 | this is a text file 2 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/framasoft@framatube.org.json: -------------------------------------------------------------------------------- 1 | {"subject":"acct:framasoft@framatube.org","aliases":["https://framatube.org/accounts/framasoft"],"links":[{"rel":"self","type":"application/activity+json","href":"https://framatube.org/accounts/framasoft"}]} -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/framatube.org_host_meta: -------------------------------------------------------------------------------- 1 | 2 | framatube.orgResource Descriptor 3 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/frontend.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/tesla_mock/frontend.zip -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/frontend_dist.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/tesla_mock/frontend_dist.zip -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/gerzilla.de_host_meta: -------------------------------------------------------------------------------- 1 | 3 | 4 | gerzilla.de 5 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/gleasonator.com_host_meta: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/gnusocial.de_host_meta: -------------------------------------------------------------------------------- 1 | 2 | gnusocial.deResource Descriptor 3 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/https__info.pleroma.site_activity.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://www.w3.org/ns/activitystreams", 3 | "actor": "http://mastodon.example.org/users/admin", 4 | "attachment": [], 5 | "attributedTo": "http://mastodon.example.org/users/admin", 6 | "content": "

this post was not actually written by Haelwenn

", 7 | "id": "https://info.pleroma.site/activity.json", 8 | "published": "2018-09-01T22:15:00Z", 9 | "tag": [], 10 | "to": [ 11 | "https://www.w3.org/ns/activitystreams#Public" 12 | ], 13 | "type": "Note" 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/https__info.pleroma.site_activity2.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://www.w3.org/ns/activitystreams", 3 | "attributedTo": "https://info.pleroma.site/actor.json", 4 | "attachment": [], 5 | "actor": "http://mastodon.example.org/users/admin", 6 | "content": "

this post was not actually written by Haelwenn

", 7 | "id": "https://info.pleroma.site/activity2.json", 8 | "published": "2018-09-01T22:15:00Z", 9 | "tag": [], 10 | "to": [ 11 | "https://www.w3.org/ns/activitystreams#Public" 12 | ], 13 | "type": "Note" 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/https__info.pleroma.site_activity3.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://www.w3.org/ns/activitystreams", 3 | "attributedTo": "http://mastodon.example.org/users/admin", 4 | "attachment": [], 5 | "content": "

this post was not actually written by Haelwenn

", 6 | "id": "https://info.pleroma.site/activity2.json", 7 | "published": "2018-09-01T22:15:00Z", 8 | "tag": [], 9 | "to": [ 10 | "https://www.w3.org/ns/activitystreams#Public" 11 | ], 12 | "type": "Note" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/https__info.pleroma.site_activity4.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://www.w3.org/ns/activitystreams", 3 | "attributedTo": "http://mastodon.example.org/users/admin", 4 | "attachment": [], 5 | "content": "

this post was not actually written by Haelwenn

", 6 | "id": "http://mastodon.example.org/users/admin/activities/1234", 7 | "published": "2018-09-01T22:15:00Z", 8 | "tag": [], 9 | "to": [ 10 | "https://www.w3.org/ns/activitystreams#Public" 11 | ], 12 | "type": "Note" 13 | } 14 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/lm.kazv.moe_host_meta: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/macgirvin.com_host_meta: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | macgirvin.com 6 | 7 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/mamot.fr_host_meta: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/mastodon.social_host_meta: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/mastodon.xyz_host_meta: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/mstdn.jp_host_meta: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/pawoo.net_host_meta: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/pleroma.soykaf.com_host_meta: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/sdf.org_host_meta: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/social.sakamoto.gq_host_meta: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/social.wxcafe.net_host_meta: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/soykaf.com_host_meta: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/tesla_mock/status.alpicola.com_host_meta: -------------------------------------------------------------------------------- 1 | 2 | status.alpicola.comResource Descriptor 3 | -------------------------------------------------------------------------------- /test/fixtures/test.txt: -------------------------------------------------------------------------------- 1 | this is a text file 2 | -------------------------------------------------------------------------------- /test/fixtures/user_name_only.xml: -------------------------------------------------------------------------------- 1 | 2 | http://activitystrea.ms/schema/1.0/person 3 | http://gs.example.org:4040/index.php/user/1 4 | lambda 5 | 6 | -------------------------------------------------------------------------------- /test/fixtures/users_mock/masto_closed_followers.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://www.w3.org/ns/activitystreams", 3 | "id": "http://localhost:4001/users/masto_closed/followers", 4 | "type": "OrderedCollection", 5 | "totalItems": 437, 6 | "first": "http://localhost:4001/users/masto_closed/followers?page=1" 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/users_mock/masto_closed_following.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://www.w3.org/ns/activitystreams", 3 | "id": "http://localhost:4001/users/masto_closed/following", 4 | "type": "OrderedCollection", 5 | "totalItems": 152, 6 | "first": "http://localhost:4001/users/masto_closed/following?page=1" 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/users_mock/masto_featured.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://www.w3.org/ns/activitystreams", 4 | { 5 | "ostatus": "http://ostatus.org#", 6 | "atomUri": "ostatus:atomUri", 7 | "inReplyToAtomUri": "ostatus:inReplyToAtomUri", 8 | "conversation": "ostatus:conversation", 9 | "sensitive": "as:sensitive", 10 | "toot": "http://joinmastodon.org/ns#", 11 | "votersCount": "toot:votersCount" 12 | } 13 | ], 14 | "id": "https://{{domain}}/users/{{nickname}}/collections/featured", 15 | "type": "OrderedCollection", 16 | "totalItems": 0, 17 | "orderedItems": [] 18 | } 19 | -------------------------------------------------------------------------------- /test/fixtures/video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/fixtures/video.mp4 -------------------------------------------------------------------------------- /test/fixtures/warnings/otp_version/21.1: -------------------------------------------------------------------------------- 1 | 21.1 -------------------------------------------------------------------------------- /test/fixtures/warnings/otp_version/22.1: -------------------------------------------------------------------------------- 1 | 22.1 -------------------------------------------------------------------------------- /test/fixtures/warnings/otp_version/22.4: -------------------------------------------------------------------------------- 1 | 22.4 -------------------------------------------------------------------------------- /test/fixtures/warnings/otp_version/23.0: -------------------------------------------------------------------------------- 1 | 23.0 -------------------------------------------------------------------------------- /test/fixtures/webfinger/masto-host-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/webfinger/pleroma-host-meta.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/fixtures/wildebeest-nodeinfo21.json: -------------------------------------------------------------------------------- 1 | {"version":"2.1","software":{"name":"wildebeest","version":"0.0.1","repository":"https://github.com/cloudflare/wildebeest"},"protocols":["activitypub"],"usage":{"users":{"total":1,"activeMonth":1,"activeHalfyear":1}},"openRegistrations":false,"metadata":{"upstream":{"name":"mastodon","version":"3.5.1"}}} -------------------------------------------------------------------------------- /test/fixtures/wildebeest-well-known-nodeinfo.json: -------------------------------------------------------------------------------- 1 | {"links":[{"rel":"http://nodeinfo.diaspora.software/ns/schema/2.0","href":"https://wildebeest.example.org/nodeinfo/2.0"},{"rel":"http://nodeinfo.diaspora.software/ns/schema/2.1","href":"https://wildebeest.example.org/nodeinfo/2.1"}]} -------------------------------------------------------------------------------- /test/fixtures/xml_external_entities.xml: -------------------------------------------------------------------------------- 1 | 2 | ]> 3 | &xxe; 4 | -------------------------------------------------------------------------------- /test/instance_static/add/shortcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/instance_static/add/shortcode.png -------------------------------------------------------------------------------- /test/instance_static/emoji/blobs.gg/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/instance_static/emoji/blobs.gg/blank.png -------------------------------------------------------------------------------- /test/instance_static/emoji/blobs.gg/pack.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "blank": "blank.png" 4 | }, 5 | "pack": { 6 | "description": "Test description", 7 | "homepage": "https://pleroma.social", 8 | "license": "Test license", 9 | "share-files": true 10 | } 11 | } -------------------------------------------------------------------------------- /test/instance_static/emoji/pack_bad_sha/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/instance_static/emoji/pack_bad_sha/blank.png -------------------------------------------------------------------------------- /test/instance_static/emoji/pack_bad_sha/pack.json: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "license": "Test license", 4 | "homepage": "https://pleroma.social", 5 | "description": "Test description", 6 | "can-download": true, 7 | "share-files": true, 8 | "download-sha256": "57482F30674FD3DE821FF48C81C00DA4D4AF1F300209253684ABA7075E5FC238" 9 | }, 10 | "files": { 11 | "blank": "blank.png" 12 | } 13 | } -------------------------------------------------------------------------------- /test/instance_static/emoji/pack_bad_sha/pack_bad_sha.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/instance_static/emoji/pack_bad_sha/pack_bad_sha.zip -------------------------------------------------------------------------------- /test/instance_static/emoji/test_pack/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/instance_static/emoji/test_pack/blank.png -------------------------------------------------------------------------------- /test/instance_static/emoji/test_pack/blank2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/instance_static/emoji/test_pack/blank2.png -------------------------------------------------------------------------------- /test/instance_static/emoji/test_pack/pack.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "blank": "blank.png", 4 | "blank2": "blank2.png" 5 | }, 6 | "pack": { 7 | "description": "Test description", 8 | "homepage": "https://pleroma.social", 9 | "license": "Test license", 10 | "share-files": true 11 | } 12 | } -------------------------------------------------------------------------------- /test/instance_static/emoji/test_pack_for_import/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/instance_static/emoji/test_pack_for_import/blank.png -------------------------------------------------------------------------------- /test/instance_static/emoji/test_pack_nonshared/nonshared.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soapbox-pub/rebased/cb3e04623556195181d4cf0cda2a947acd9c3b3f/test/instance_static/emoji/test_pack_nonshared/nonshared.zip -------------------------------------------------------------------------------- /test/instance_static/emoji/test_pack_nonshared/pack.json: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "license": "Test license", 4 | "homepage": "https://pleroma.social", 5 | "description": "Test description", 6 | "fallback-src": "https://nonshared-pack", 7 | "fallback-src-sha256": "1967BB4E42BCC34BCC12D57BE7811D3B7BE52F965BCE45C87BD377B9499CE11D", 8 | "share-files": false 9 | }, 10 | "files": { 11 | "blank": "blank.png" 12 | } 13 | } -------------------------------------------------------------------------------- /test/instance_static/local_pack/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "blank": "blank.png" 3 | } -------------------------------------------------------------------------------- /test/instance_static/local_pack/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "local": { 3 | "src_sha256": "384025A1AC6314473863A11AC7AB38A12C01B851A3F82359B89B4D4211D3291D", 4 | "src": "test/fixtures/emoji/packs/blank.png.zip", 5 | "license": "Apache 2.0", 6 | "homepage": "https://example.com", 7 | "files": "files.json", 8 | "description": "Some local pack" 9 | } 10 | } -------------------------------------------------------------------------------- /test/mix/tasks/pleroma/ecto_test.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Mix.Tasks.Pleroma.EctoTest do 6 | use ExUnit.Case, async: true 7 | 8 | test "raise on bad path" do 9 | assert_raise RuntimeError, ~r/Could not find migrations directory/, fn -> 10 | Mix.Tasks.Pleroma.Ecto.ensure_migrations_path(Pleroma.Repo, 11 | migrations_path: "some-path" 12 | ) 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test/pleroma/hashtag_test.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.HashtagTest do 6 | use Pleroma.DataCase 7 | 8 | alias Pleroma.Hashtag 9 | 10 | describe "changeset validations" do 11 | test "ensure non-blank :name" do 12 | changeset = Hashtag.changeset(%Hashtag{}, %{name: ""}) 13 | 14 | assert {:name, {"can't be blank", [validation: :required]}} in changeset.errors 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /test/pleroma/mfa/backup_codes_test.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.MFA.BackupCodesTest do 6 | use Pleroma.DataCase, async: true 7 | 8 | alias Pleroma.MFA.BackupCodes 9 | 10 | test "generate backup codes" do 11 | codes = BackupCodes.generate(number_of_codes: 2, length: 4) 12 | 13 | assert [<<_::bytes-size(4)>>, <<_::bytes-size(4)>>] = codes 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test/pleroma/runtime_test.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.RuntimeTest do 6 | use ExUnit.Case, async: true 7 | 8 | test "it loads custom runtime modules" do 9 | assert {:module, Fixtures.Modules.RuntimeModule} == 10 | Code.ensure_compiled(Fixtures.Modules.RuntimeModule) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/pleroma/utils_test.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.UtilsTest do 6 | use ExUnit.Case, async: true 7 | 8 | describe "tmp_dir/1" do 9 | test "returns unique temporary directory" do 10 | {:ok, path} = Pleroma.Utils.tmp_dir("emoji") 11 | assert path =~ ~r/\/emoji-(.*)-#{:os.getpid()}-(.*)/ 12 | File.rm_rf(path) 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test/pleroma/web/admin_api/views/account_view_test.exs: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule Pleroma.Web.AdminAPI.AccountViewTest do 6 | use Pleroma.DataCase, async: true 7 | import Pleroma.Factory 8 | alias Pleroma.Web.AdminAPI.AccountView 9 | 10 | describe "show.json" do 11 | test "renders the user's email" do 12 | user = insert(:user, email: "yolo@yolofam.tld") 13 | assert %{"email" => "yolo@yolofam.tld"} = AccountView.render("show.json", %{user: user}) 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /test/pleroma/web/xml_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Pleroma.Web.XMLTest do 2 | use Pleroma.DataCase, async: true 3 | 4 | alias Pleroma.Web.XML 5 | 6 | test "refuses to parse any entities from XML" do 7 | data = File.read!("test/fixtures/xml_billion_laughs.xml") 8 | assert(:error == XML.parse_document(data)) 9 | end 10 | 11 | test "refuses to load external entities from XML" do 12 | data = File.read!("test/fixtures/xml_external_entities.xml") 13 | assert(:error == XML.parse_document(data)) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test/support/language_detector_mock.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule LanguageDetectorMock do 6 | alias Pleroma.Language.LanguageDetector.Provider 7 | 8 | @behaviour Provider 9 | 10 | @impl Provider 11 | def missing_dependencies, do: [] 12 | 13 | @impl Provider 14 | def configured?, do: true 15 | 16 | @impl Provider 17 | def detect(_text), do: "fr" 18 | end 19 | -------------------------------------------------------------------------------- /test/support/mrf_module_mock.ex: -------------------------------------------------------------------------------- 1 | # Pleroma: A lightweight social networking server 2 | # Copyright © 2017-2022 Pleroma Authors 3 | # SPDX-License-Identifier: AGPL-3.0-only 4 | 5 | defmodule MRFModuleMock do 6 | @behaviour Pleroma.Web.ActivityPub.MRF.Policy 7 | 8 | @impl true 9 | def filter(message), do: {:ok, message} 10 | 11 | @impl true 12 | def describe, do: {:ok, %{mrf_module_mock: "some config data"}} 13 | end 14 | -------------------------------------------------------------------------------- /tools/check-changelog: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "looking for change log" 4 | 5 | git remote add upstream https://git.pleroma.social/pleroma/pleroma.git 6 | git fetch upstream ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}:refs/remotes/upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME 7 | 8 | git diff --raw --no-renames upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD -- changelog.d | \ 9 | grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security\|change\)$' 10 | ret=$? 11 | 12 | if [ $ret -eq 0 ]; then 13 | echo "found a changelog entry" 14 | exit 0 15 | else 16 | echo "changelog entry not found" 17 | exit 1 18 | fi 19 | -------------------------------------------------------------------------------- /uploads/.gitignore: -------------------------------------------------------------------------------- 1 | # Git will ignore everything in this directory except this file. 2 | * 3 | !.gitignore 4 | --------------------------------------------------------------------------------