mirror of
https://github.com/mastodon/mastodon.git
synced 2025-06-18 02:59:15 +00:00
Compare commits
No commits in common. "main" and "v0.7" have entirely different histories.
|
@ -1,59 +0,0 @@
|
||||||
---
|
|
||||||
:position: before
|
|
||||||
:position_in_additional_file_patterns: before
|
|
||||||
:position_in_class: before
|
|
||||||
:position_in_factory: before
|
|
||||||
:position_in_fixture: before
|
|
||||||
:position_in_routes: before
|
|
||||||
:position_in_serializer: before
|
|
||||||
:position_in_test: before
|
|
||||||
:classified_sort: true
|
|
||||||
:exclude_controllers: true
|
|
||||||
:exclude_factories: true
|
|
||||||
:exclude_fixtures: true
|
|
||||||
:exclude_helpers: true
|
|
||||||
:exclude_scaffolds: true
|
|
||||||
:exclude_serializers: true
|
|
||||||
:exclude_sti_subclasses: true
|
|
||||||
:exclude_tests: true
|
|
||||||
:force: false
|
|
||||||
:format_markdown: false
|
|
||||||
:format_rdoc: false
|
|
||||||
:format_yard: false
|
|
||||||
:frozen: false
|
|
||||||
:ignore_model_sub_dir: false
|
|
||||||
:ignore_unknown_models: false
|
|
||||||
:include_version: false
|
|
||||||
:show_complete_foreign_keys: false
|
|
||||||
:show_foreign_keys: false
|
|
||||||
:show_indexes: false
|
|
||||||
:simple_indexes: false
|
|
||||||
:sort: false
|
|
||||||
:timestamp: false
|
|
||||||
:trace: false
|
|
||||||
:with_comment: true
|
|
||||||
:with_column_comments: true
|
|
||||||
:with_table_comments: true
|
|
||||||
:active_admin: false
|
|
||||||
:command:
|
|
||||||
:debug: false
|
|
||||||
:hide_default_column_types: ''
|
|
||||||
:hide_limit_column_types: 'integer,boolean'
|
|
||||||
:ignore_columns:
|
|
||||||
:ignore_routes:
|
|
||||||
:models: true
|
|
||||||
:routes: false
|
|
||||||
:skip_on_db_migrate: false
|
|
||||||
:target_action: :do_annotations
|
|
||||||
:wrapper:
|
|
||||||
:wrapper_close:
|
|
||||||
:wrapper_open:
|
|
||||||
:classes_default_to_s: []
|
|
||||||
:additional_file_patterns: []
|
|
||||||
:model_dir:
|
|
||||||
- app/models
|
|
||||||
:require: []
|
|
||||||
:root_dir:
|
|
||||||
- ''
|
|
||||||
|
|
||||||
:show_check_constraints: false
|
|
4
.babelrc
Normal file
4
.babelrc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"presets": ["es2015", "react"],
|
||||||
|
"plugins": ["transform-object-rest-spread"]
|
||||||
|
}
|
|
@ -1,6 +0,0 @@
|
||||||
defaults
|
|
||||||
> 0.2%
|
|
||||||
firefox >= 78
|
|
||||||
ios >= 15.6
|
|
||||||
not dead
|
|
||||||
not OperaMini all
|
|
|
@ -1,3 +0,0 @@
|
||||||
https://github.com/heroku/heroku-buildpack-apt
|
|
||||||
https://github.com/Scalingo/ffmpeg-buildpack
|
|
||||||
https://github.com/Scalingo/ruby-buildpack
|
|
|
@ -1,18 +0,0 @@
|
||||||
# For details, see https://github.com/devcontainers/images/tree/main/src/ruby
|
|
||||||
FROM mcr.microsoft.com/devcontainers/ruby:1-3.3-bookworm
|
|
||||||
|
|
||||||
# Install node version from .nvmrc
|
|
||||||
WORKDIR /app
|
|
||||||
COPY .nvmrc .
|
|
||||||
RUN /bin/bash --login -i -c "nvm install"
|
|
||||||
|
|
||||||
# Install additional OS packages
|
|
||||||
RUN apt-get update && \
|
|
||||||
export DEBIAN_FRONTEND=noninteractive && \
|
|
||||||
apt-get -y install --no-install-recommends libicu-dev libidn11-dev ffmpeg imagemagick libvips42 libpam-dev
|
|
||||||
|
|
||||||
# Disable download prompt for Corepack
|
|
||||||
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
|
||||||
|
|
||||||
# Move welcome message to where VS Code expects it
|
|
||||||
COPY .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
|
|
|
@ -1,51 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Mastodon on GitHub Codespaces",
|
|
||||||
"dockerComposeFile": "../compose.yaml",
|
|
||||||
"service": "app",
|
|
||||||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
|
||||||
|
|
||||||
"features": {
|
|
||||||
"ghcr.io/devcontainers/features/sshd:1": {}
|
|
||||||
},
|
|
||||||
|
|
||||||
"runServices": ["app", "db", "redis"],
|
|
||||||
|
|
||||||
"forwardPorts": [3000, 4000],
|
|
||||||
|
|
||||||
"portsAttributes": {
|
|
||||||
"3000": {
|
|
||||||
"label": "web",
|
|
||||||
"onAutoForward": "notify"
|
|
||||||
},
|
|
||||||
"4000": {
|
|
||||||
"label": "stream",
|
|
||||||
"onAutoForward": "silent"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"remoteUser": "root",
|
|
||||||
|
|
||||||
"otherPortsAttributes": {
|
|
||||||
"onAutoForward": "silent"
|
|
||||||
},
|
|
||||||
|
|
||||||
"remoteEnv": {
|
|
||||||
"LOCAL_DOMAIN": "${localEnv:CODESPACE_NAME}-3000.app.github.dev",
|
|
||||||
"LOCAL_HTTPS": "true",
|
|
||||||
"STREAMING_API_BASE_URL": "https://${localEnv:CODESPACE_NAME}-4000.app.github.dev",
|
|
||||||
"DISABLE_FORGERY_REQUEST_PROTECTION": "true",
|
|
||||||
"ES_ENABLED": "",
|
|
||||||
"LIBRE_TRANSLATE_ENDPOINT": ""
|
|
||||||
},
|
|
||||||
|
|
||||||
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
|
|
||||||
"postCreateCommand": "bin/setup",
|
|
||||||
"waitFor": "postCreateCommand",
|
|
||||||
|
|
||||||
"customizations": {
|
|
||||||
"vscode": {
|
|
||||||
"settings": {},
|
|
||||||
"extensions": ["EditorConfig.EditorConfig", "webben.browserslist"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,93 +0,0 @@
|
||||||
services:
|
|
||||||
app:
|
|
||||||
working_dir: /workspaces/mastodon/
|
|
||||||
build:
|
|
||||||
context: ..
|
|
||||||
dockerfile: .devcontainer/Dockerfile
|
|
||||||
volumes:
|
|
||||||
- ..:/workspaces/mastodon:cached
|
|
||||||
environment:
|
|
||||||
RAILS_ENV: development
|
|
||||||
NODE_ENV: development
|
|
||||||
VITE_RUBY_HOST: 0.0.0.0
|
|
||||||
BIND: 0.0.0.0
|
|
||||||
BOOTSNAP_CACHE_DIR: /tmp
|
|
||||||
REDIS_HOST: redis
|
|
||||||
REDIS_PORT: '6379'
|
|
||||||
DB_HOST: db
|
|
||||||
DB_USER: postgres
|
|
||||||
DB_PASS: postgres
|
|
||||||
DB_PORT: '5432'
|
|
||||||
ES_ENABLED: 'true'
|
|
||||||
ES_HOST: es
|
|
||||||
ES_PORT: '9200'
|
|
||||||
LIBRE_TRANSLATE_ENDPOINT: http://libretranslate:5000
|
|
||||||
LOCAL_DOMAIN: ${LOCAL_DOMAIN:-localhost:3000}
|
|
||||||
VITE_DEV_SERVER_PUBLIC: ${VITE_DEV_SERVER_PUBLIC:-localhost:3036}
|
|
||||||
# Overrides default command so things don't shut down after the process ends.
|
|
||||||
command: sleep infinity
|
|
||||||
ports:
|
|
||||||
- '3000:3000'
|
|
||||||
- '3036:3036'
|
|
||||||
- '4000:4000'
|
|
||||||
networks:
|
|
||||||
- external_network
|
|
||||||
- internal_network
|
|
||||||
|
|
||||||
db:
|
|
||||||
image: postgres:14-alpine
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- postgres-data:/var/lib/postgresql/data
|
|
||||||
environment:
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_DB: postgres
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_HOST_AUTH_METHOD: trust
|
|
||||||
networks:
|
|
||||||
- internal_network
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- redis-data:/data
|
|
||||||
networks:
|
|
||||||
- internal_network
|
|
||||||
|
|
||||||
es:
|
|
||||||
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
|
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
|
||||||
ES_JAVA_OPTS: -Xms512m -Xmx512m
|
|
||||||
cluster.name: es-mastodon
|
|
||||||
discovery.type: single-node
|
|
||||||
bootstrap.memory_lock: 'true'
|
|
||||||
volumes:
|
|
||||||
- es-data:/usr/share/elasticsearch/data
|
|
||||||
networks:
|
|
||||||
- internal_network
|
|
||||||
ulimits:
|
|
||||||
memlock:
|
|
||||||
soft: -1
|
|
||||||
hard: -1
|
|
||||||
|
|
||||||
libretranslate:
|
|
||||||
image: libretranslate/libretranslate:v1.6.2
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- lt-data:/home/libretranslate/.local
|
|
||||||
networks:
|
|
||||||
- external_network
|
|
||||||
- internal_network
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
postgres-data:
|
|
||||||
redis-data:
|
|
||||||
es-data:
|
|
||||||
lt-data:
|
|
||||||
|
|
||||||
networks:
|
|
||||||
external_network:
|
|
||||||
internal_network:
|
|
||||||
internal: true
|
|
|
@ -1,42 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Mastodon on local machine",
|
|
||||||
"dockerComposeFile": "compose.yaml",
|
|
||||||
"service": "app",
|
|
||||||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
|
||||||
|
|
||||||
"features": {
|
|
||||||
"ghcr.io/devcontainers/features/sshd:1": {}
|
|
||||||
},
|
|
||||||
|
|
||||||
"forwardPorts": [3000, 4000],
|
|
||||||
|
|
||||||
"portsAttributes": {
|
|
||||||
"3000": {
|
|
||||||
"label": "web",
|
|
||||||
"onAutoForward": "notify",
|
|
||||||
"requireLocalPort": true
|
|
||||||
},
|
|
||||||
"4000": {
|
|
||||||
"label": "stream",
|
|
||||||
"onAutoForward": "silent",
|
|
||||||
"requireLocalPort": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"remoteUser": "root",
|
|
||||||
|
|
||||||
"otherPortsAttributes": {
|
|
||||||
"onAutoForward": "silent"
|
|
||||||
},
|
|
||||||
|
|
||||||
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
|
|
||||||
"postCreateCommand": "bin/setup",
|
|
||||||
"waitFor": "postCreateCommand",
|
|
||||||
|
|
||||||
"customizations": {
|
|
||||||
"vscode": {
|
|
||||||
"settings": {},
|
|
||||||
"extensions": ["EditorConfig.EditorConfig", "webben.browserslist"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
👋 Welcome to your Mastodon Dev Container!
|
|
||||||
|
|
||||||
🛠️ Your environment is fully setup with all the required software.
|
|
||||||
|
|
||||||
💥 Run `bin/dev` to start the application processes.
|
|
||||||
|
|
||||||
🥼 Run `RAILS_ENV=test bin/rails assets:precompile && RAILS_ENV=test bin/rspec` to run the test suite.
|
|
|
@ -1,28 +1,5 @@
|
||||||
.bundle
|
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
.git
|
|
||||||
.gitattributes
|
|
||||||
.gitignore
|
|
||||||
.github
|
|
||||||
public/system
|
public/system
|
||||||
public/assets
|
public/assets
|
||||||
public/packs
|
|
||||||
public/packs-test
|
|
||||||
node_modules
|
node_modules
|
||||||
neo4j
|
|
||||||
vendor/bundle
|
|
||||||
.DS_Store
|
|
||||||
*.swp
|
|
||||||
*~
|
|
||||||
postgres
|
|
||||||
postgres14
|
|
||||||
redis
|
|
||||||
elasticsearch
|
|
||||||
chart
|
|
||||||
.yarn/
|
|
||||||
!.yarn/patches
|
|
||||||
!.yarn/plugins
|
|
||||||
!.yarn/releases
|
|
||||||
!.yarn/sdks
|
|
||||||
!.yarn/versions
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
# EditorConfig is awesome: http://EditorConfig.org
|
|
||||||
|
|
||||||
# top-most EditorConfig file
|
|
||||||
root = true
|
|
||||||
|
|
||||||
# Unix-style newlines with a newline ending every file
|
|
||||||
[*]
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
charset = utf-8
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
trim_trailing_whitespace = true
|
|
|
@ -1,4 +0,0 @@
|
||||||
# Required by ActiveRecord encryption feature
|
|
||||||
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=fkSxKD2bF396kdQbrP1EJ7WbU7ZgNokR
|
|
||||||
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=r0hvVmzBVsjxC7AMlwhOzmtc36ZCOS1E
|
|
||||||
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=PhdFyyfy5xJ7WVd2lWBpcPScRQHzRTNr
|
|
|
@ -1,111 +1,23 @@
|
||||||
# This is a sample configuration file. You can generate your configuration
|
# Service dependencies
|
||||||
# with the `bundle exec rails mastodon:setup` interactive setup wizard, but to customize
|
REDIS_HOST=redis
|
||||||
# your setup even further, you'll need to edit it manually. This sample does
|
|
||||||
# not demonstrate all available configuration options. Please look at
|
|
||||||
# https://docs.joinmastodon.org/admin/config/ for the full documentation.
|
|
||||||
|
|
||||||
# Note that this file accepts slightly different syntax depending on whether
|
|
||||||
# you are using `docker-compose` or not. In particular, if you use
|
|
||||||
# `docker-compose`, the value of each declared variable will be taken verbatim,
|
|
||||||
# including surrounding quotes.
|
|
||||||
# See: https://github.com/mastodon/mastodon/issues/16895
|
|
||||||
|
|
||||||
# Federation
|
|
||||||
# ----------
|
|
||||||
# This identifies your server and cannot be changed safely later
|
|
||||||
# ----------
|
|
||||||
LOCAL_DOMAIN=example.com
|
|
||||||
|
|
||||||
# Redis
|
|
||||||
# -----
|
|
||||||
REDIS_HOST=localhost
|
|
||||||
REDIS_PORT=6379
|
REDIS_PORT=6379
|
||||||
|
DB_HOST=db
|
||||||
# PostgreSQL
|
DB_USER=postgres
|
||||||
# ----------
|
DB_NAME=postgres
|
||||||
DB_HOST=/var/run/postgresql
|
|
||||||
DB_USER=mastodon
|
|
||||||
DB_NAME=mastodon_production
|
|
||||||
DB_PASS=
|
DB_PASS=
|
||||||
DB_PORT=5432
|
DB_PORT=5432
|
||||||
|
|
||||||
# Elasticsearch (optional)
|
# Federation
|
||||||
# ------------------------
|
LOCAL_DOMAIN=example.com
|
||||||
ES_ENABLED=true
|
LOCAL_HTTPS=true
|
||||||
ES_HOST=localhost
|
|
||||||
ES_PORT=9200
|
|
||||||
# Authentication for ES (optional)
|
|
||||||
ES_USER=elastic
|
|
||||||
ES_PASS=password
|
|
||||||
|
|
||||||
# Secrets
|
# Application secrets
|
||||||
# -------
|
PAPERCLIP_SECRET=
|
||||||
# Make sure to use `bundle exec rails secret` to generate secrets
|
|
||||||
# -------
|
|
||||||
SECRET_KEY_BASE=
|
SECRET_KEY_BASE=
|
||||||
|
|
||||||
# Encryption secrets
|
# E-mail configuration
|
||||||
# ------------------
|
SMTP_SERVER=smtp.mailgun.org
|
||||||
# Must be available (and set to same values) for all server processes
|
|
||||||
# These are private/secret values, do not share outside hosting environment
|
|
||||||
# Use `bin/rails db:encryption:init` to generate fresh secrets
|
|
||||||
# Do NOT change these secrets once in use, as this would cause data loss and other issues
|
|
||||||
# ------------------
|
|
||||||
# ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=
|
|
||||||
# ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=
|
|
||||||
# ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=
|
|
||||||
|
|
||||||
# Web Push
|
|
||||||
# --------
|
|
||||||
# Generate with `bundle exec rails mastodon:webpush:generate_vapid_key`
|
|
||||||
# --------
|
|
||||||
VAPID_PRIVATE_KEY=
|
|
||||||
VAPID_PUBLIC_KEY=
|
|
||||||
|
|
||||||
# Sending mail
|
|
||||||
# ------------
|
|
||||||
SMTP_SERVER=
|
|
||||||
SMTP_PORT=587
|
SMTP_PORT=587
|
||||||
SMTP_LOGIN=
|
SMTP_LOGIN=
|
||||||
SMTP_PASSWORD=
|
SMTP_PASSWORD=
|
||||||
SMTP_FROM_ADDRESS=notifications@example.com
|
SMTP_FROM_ADDRESS=notifications@example.com
|
||||||
|
|
||||||
# File storage (optional)
|
|
||||||
# -----------------------
|
|
||||||
S3_ENABLED=true
|
|
||||||
S3_BUCKET=files.example.com
|
|
||||||
AWS_ACCESS_KEY_ID=
|
|
||||||
AWS_SECRET_ACCESS_KEY=
|
|
||||||
S3_ALIAS_HOST=files.example.com
|
|
||||||
|
|
||||||
# Optional list of hosts that are allowed to serve media for your instance
|
|
||||||
# EXTRA_MEDIA_HOSTS=https://data.example1.com,https://data.example2.com
|
|
||||||
|
|
||||||
# IP and session retention
|
|
||||||
# -----------------------
|
|
||||||
# Make sure to modify the scheduling of ip_cleanup_scheduler in config/sidekiq.yml
|
|
||||||
# to be less than daily if you lower IP_RETENTION_PERIOD below two days (172800).
|
|
||||||
# -----------------------
|
|
||||||
IP_RETENTION_PERIOD=31556952
|
|
||||||
SESSION_RETENTION_PERIOD=31556952
|
|
||||||
|
|
||||||
# Fetch All Replies Behavior
|
|
||||||
# --------------------------
|
|
||||||
# When a user expands a post (DetailedStatus view), fetch all of its replies
|
|
||||||
# (default: false)
|
|
||||||
FETCH_REPLIES_ENABLED=false
|
|
||||||
|
|
||||||
# Period to wait between fetching replies (in minutes)
|
|
||||||
FETCH_REPLIES_COOLDOWN_MINUTES=15
|
|
||||||
|
|
||||||
# Period to wait after a post is first created before fetching its replies (in minutes)
|
|
||||||
FETCH_REPLIES_INITIAL_WAIT_MINUTES=5
|
|
||||||
|
|
||||||
# Max number of replies to fetch - total, recursively through a whole reply tree
|
|
||||||
FETCH_REPLIES_MAX_GLOBAL=1000
|
|
||||||
|
|
||||||
# Max number of replies to fetch - for a single post
|
|
||||||
FETCH_REPLIES_MAX_SINGLE=500
|
|
||||||
|
|
||||||
# Max number of replies Collection pages to fetch - total
|
|
||||||
FETCH_REPLIES_MAX_PAGES=500
|
|
||||||
|
|
11
.env.test
11
.env.test
|
@ -1,11 +0,0 @@
|
||||||
# In test, compile the NodeJS code as if we are in production
|
|
||||||
NODE_ENV=production
|
|
||||||
# Federation
|
|
||||||
LOCAL_DOMAIN=cb6e6126.ngrok.io
|
|
||||||
LOCAL_HTTPS=true
|
|
||||||
|
|
||||||
# Secret values required by ActiveRecord encryption feature
|
|
||||||
# Use `bin/rails db:encryption:init` to generate fresh secrets
|
|
||||||
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=test_determinist_key_DO_NOT_USE_IN_PRODUCTION
|
|
||||||
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=test_salt_DO_NOT_USE_IN_PRODUCTION
|
|
||||||
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=test_primary_key_DO_NOT_USE_IN_PRODUCTION
|
|
|
@ -1,8 +0,0 @@
|
||||||
VAGRANT=true
|
|
||||||
LOCAL_DOMAIN=mastodon.local
|
|
||||||
BIND=0.0.0.0
|
|
||||||
DB_HOST=/var/run/postgresql/
|
|
||||||
|
|
||||||
ES_ENABLED=true
|
|
||||||
ES_HOST=localhost
|
|
||||||
ES_PORT=9200
|
|
21
.eslintrc
Normal file
21
.eslintrc
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"node": false,
|
||||||
|
"es6": true
|
||||||
|
},
|
||||||
|
|
||||||
|
"parser": "babel-eslint",
|
||||||
|
|
||||||
|
"plugins": [
|
||||||
|
"react"
|
||||||
|
],
|
||||||
|
|
||||||
|
"parserOptions": {
|
||||||
|
"sourceType": "module",
|
||||||
|
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"jsx": true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
14
.gitattributes
vendored
14
.gitattributes
vendored
|
@ -1,14 +0,0 @@
|
||||||
* text=auto eol=lf
|
|
||||||
*.eot -text
|
|
||||||
*.gif -text
|
|
||||||
*.gz -text
|
|
||||||
*.ico -text
|
|
||||||
*.jpg -text
|
|
||||||
*.mp3 -text
|
|
||||||
*.ogg -text
|
|
||||||
*.png -text
|
|
||||||
*.ttf -text
|
|
||||||
*.webm -text
|
|
||||||
*.woff -text
|
|
||||||
*.woff2 -text
|
|
||||||
spec/fixtures/requests/** -text !eol
|
|
77
.github/ISSUE_TEMPLATE/1.web_bug_report.yml
vendored
77
.github/ISSUE_TEMPLATE/1.web_bug_report.yml
vendored
|
@ -1,77 +0,0 @@
|
||||||
name: Bug Report (Web Interface)
|
|
||||||
description: There is a problem using Mastodon's web interface.
|
|
||||||
labels: ['status/to triage', 'area/web interface']
|
|
||||||
type: Bug
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Make sure that you are submitting a new bug that was not previously reported or already fixed.
|
|
||||||
|
|
||||||
Please use a concise and distinct title for the issue.
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Steps to reproduce the problem
|
|
||||||
description: What were you trying to do?
|
|
||||||
value: |
|
|
||||||
1.
|
|
||||||
2.
|
|
||||||
3.
|
|
||||||
...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Expected behaviour
|
|
||||||
description: What should have happened?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Actual behaviour
|
|
||||||
description: What happened?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Detailed description
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Mastodon instance
|
|
||||||
description: The address of the Mastodon instance where you experienced the issue
|
|
||||||
placeholder: mastodon.social
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Mastodon version
|
|
||||||
description: |
|
|
||||||
This is displayed at the bottom of the About page, eg. `v4.4.0-beta.1`
|
|
||||||
placeholder: v4.4.0-beta.1
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Browser name and version
|
|
||||||
description: |
|
|
||||||
What browser are you using when getting this bug? Please specify the version as well.
|
|
||||||
placeholder: Firefox 139.0.0
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Operating system
|
|
||||||
description: |
|
|
||||||
What OS are you running? Please specify the version as well.
|
|
||||||
placeholder: macOS 15.5
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Technical details
|
|
||||||
description: |
|
|
||||||
Any additional technical details you may have. This can include the full error log, inspector's output…
|
|
||||||
validations:
|
|
||||||
required: false
|
|
66
.github/ISSUE_TEMPLATE/2.server_bug_report.yml
vendored
66
.github/ISSUE_TEMPLATE/2.server_bug_report.yml
vendored
|
@ -1,66 +0,0 @@
|
||||||
name: Bug Report (server / API)
|
|
||||||
description: |
|
|
||||||
There is a problem with the HTTP server, REST API, ActivityPub interaction, etc.
|
|
||||||
labels: ['status/to triage']
|
|
||||||
type: 'Bug'
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Make sure that you are submitting a new bug that was not previously reported or already fixed.
|
|
||||||
|
|
||||||
Please use a concise and distinct title for the issue.
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Steps to reproduce the problem
|
|
||||||
description: What were you trying to do?
|
|
||||||
value: |
|
|
||||||
1.
|
|
||||||
2.
|
|
||||||
3.
|
|
||||||
...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Expected behaviour
|
|
||||||
description: What should have happened?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Actual behaviour
|
|
||||||
description: What happened?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Detailed description
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Mastodon instance
|
|
||||||
description: The address of the Mastodon instance where you experienced the issue
|
|
||||||
placeholder: mastodon.social
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Mastodon version
|
|
||||||
description: |
|
|
||||||
This is displayed at the bottom of the About page, eg. `v4.4.0-beta.1`
|
|
||||||
placeholder: v4.4.0-beta.1
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Technical details
|
|
||||||
description: |
|
|
||||||
Any additional technical details you may have, like logs or error traces
|
|
||||||
value: |
|
|
||||||
If this is happening on your own Mastodon server, please fill out those:
|
|
||||||
- Ruby version: (from `ruby --version`, eg. v3.4.4)
|
|
||||||
- Node.js version: (from `node --version`, eg. v22.16.0)
|
|
||||||
validations:
|
|
||||||
required: false
|
|
74
.github/ISSUE_TEMPLATE/3.troubleshooting.yml
vendored
74
.github/ISSUE_TEMPLATE/3.troubleshooting.yml
vendored
|
@ -1,74 +0,0 @@
|
||||||
name: Deployment troubleshooting
|
|
||||||
description: |
|
|
||||||
You are a server administrator and you are encountering a technical issue during installation, upgrade or operations of Mastodon.
|
|
||||||
labels: ['status/to triage']
|
|
||||||
type: 'Troubleshooting'
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Make sure that you are submitting a new bug that was not previously reported or already fixed.
|
|
||||||
|
|
||||||
Please use a concise and distinct title for the issue.
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Steps to reproduce the problem
|
|
||||||
description: What were you trying to do?
|
|
||||||
value: |
|
|
||||||
1.
|
|
||||||
2.
|
|
||||||
3.
|
|
||||||
...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Expected behaviour
|
|
||||||
description: What should have happened?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Actual behaviour
|
|
||||||
description: What happened?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Detailed description
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Mastodon instance
|
|
||||||
description: The address of the Mastodon instance where you experienced the issue
|
|
||||||
placeholder: mastodon.social
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Mastodon version
|
|
||||||
description: |
|
|
||||||
This is displayed at the bottom of the About page, eg. `v4.4.0-alpha.1`
|
|
||||||
placeholder: v4.4.0-beta.1
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Environment
|
|
||||||
description: |
|
|
||||||
Details about your environment, like how Mastodon is deployed, if containers are used, version numbers, etc.
|
|
||||||
value: |
|
|
||||||
Please at least include those informations:
|
|
||||||
- Operating system: (eg. Ubuntu 24.04.2)
|
|
||||||
- Ruby version: (from `ruby --version`, eg. v3.4.4)
|
|
||||||
- Node.js version: (from `node --version`, eg. v22.16.0)
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Technical details
|
|
||||||
description: |
|
|
||||||
Any additional technical details you may have, like logs or error traces
|
|
||||||
validations:
|
|
||||||
required: false
|
|
22
.github/ISSUE_TEMPLATE/4.feature_request.yml
vendored
22
.github/ISSUE_TEMPLATE/4.feature_request.yml
vendored
|
@ -1,22 +0,0 @@
|
||||||
name: Feature Request
|
|
||||||
description: I have a suggestion
|
|
||||||
type: Suggestion
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Please use a concise and distinct title for the issue.
|
|
||||||
|
|
||||||
Consider: Could it be implemented as a 3rd party app using the REST API instead?
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Pitch
|
|
||||||
description: Describe your idea for a feature. Make sure it has not already been suggested/implemented/turned down before.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Motivation
|
|
||||||
description: Why do you think this feature is needed? Who would benefit from it?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
5
.github/ISSUE_TEMPLATE/config.yml
vendored
5
.github/ISSUE_TEMPLATE/config.yml
vendored
|
@ -1,5 +0,0 @@
|
||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: GitHub Discussions
|
|
||||||
url: https://github.com/mastodon/mastodon/discussions
|
|
||||||
about: Please ask and answer questions here.
|
|
42
.github/actions/setup-javascript/action.yml
vendored
42
.github/actions/setup-javascript/action.yml
vendored
|
@ -1,42 +0,0 @@
|
||||||
name: 'Setup Javascript'
|
|
||||||
description: 'Setup a Javascript environment ready to run the Mastodon code'
|
|
||||||
inputs:
|
|
||||||
onlyProduction:
|
|
||||||
description: Only install production dependencies
|
|
||||||
default: 'false'
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: 'composite'
|
|
||||||
steps:
|
|
||||||
- name: Set up Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: '.nvmrc'
|
|
||||||
|
|
||||||
# The following is needed because we can not use `cache: true` for `setup-node`, as it does not support Corepack yet and mess up with the cache location if ran after Node is installed
|
|
||||||
- name: Enable corepack
|
|
||||||
shell: bash
|
|
||||||
run: corepack enable
|
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
|
||||||
id: yarn-cache-dir-path
|
|
||||||
shell: bash
|
|
||||||
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-yarn-
|
|
||||||
|
|
||||||
- name: Install all yarn packages
|
|
||||||
shell: bash
|
|
||||||
run: yarn install --immutable
|
|
||||||
if: inputs.onlyProduction == 'false'
|
|
||||||
|
|
||||||
- name: Install all production yarn packages
|
|
||||||
shell: bash
|
|
||||||
run: yarn workspaces focus --production
|
|
||||||
if: inputs.onlyProduction != 'false'
|
|
23
.github/actions/setup-ruby/action.yml
vendored
23
.github/actions/setup-ruby/action.yml
vendored
|
@ -1,23 +0,0 @@
|
||||||
name: 'Setup RUby'
|
|
||||||
description: 'Setup a Ruby environment ready to run the Mastodon code'
|
|
||||||
inputs:
|
|
||||||
ruby-version:
|
|
||||||
description: The Ruby version to install
|
|
||||||
default: '.ruby-version'
|
|
||||||
additional-system-dependencies:
|
|
||||||
description: 'Additional packages to install'
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: 'composite'
|
|
||||||
steps:
|
|
||||||
- name: Install system dependencies
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y libicu-dev libidn11-dev libvips42 ${{ inputs.additional-system-dependencies }}
|
|
||||||
|
|
||||||
- name: Set up Ruby
|
|
||||||
uses: ruby/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ inputs.ruby-version }}
|
|
||||||
bundler-cache: true
|
|
13
.github/codecov.yml
vendored
13
.github/codecov.yml
vendored
|
@ -1,13 +0,0 @@
|
||||||
comment: false # Do not leave PR comments
|
|
||||||
coverage:
|
|
||||||
status:
|
|
||||||
project:
|
|
||||||
default:
|
|
||||||
# GitHub status check is not blocking
|
|
||||||
informational: true
|
|
||||||
patch:
|
|
||||||
default:
|
|
||||||
# GitHub status check is not blocking
|
|
||||||
informational: true
|
|
||||||
github_checks:
|
|
||||||
annotations: false
|
|
151
.github/renovate.json5
vendored
151
.github/renovate.json5
vendored
|
@ -1,151 +0,0 @@
|
||||||
{
|
|
||||||
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
|
|
||||||
extends: [
|
|
||||||
'config:recommended',
|
|
||||||
'customManagers:dockerfileVersions',
|
|
||||||
':labels(dependencies)',
|
|
||||||
':prConcurrentLimitNone', // Remove limit for open PRs at any time.
|
|
||||||
':prHourlyLimit2', // Rate limit PR creation to a maximum of two per hour.
|
|
||||||
],
|
|
||||||
rebaseWhen: 'conflicted',
|
|
||||||
minimumReleaseAge: '3', // Wait 3 days after the package has been published before upgrading it
|
|
||||||
// packageRules order is important, they are applied from top to bottom and are merged,
|
|
||||||
// meaning the most important ones must be at the bottom, for example grouping rules
|
|
||||||
// If we do not want a package to be grouped with others, we need to set its groupName
|
|
||||||
// to `null` after any other rule set it to something.
|
|
||||||
dependencyDashboardHeader: 'This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. Before approving any upgrade: read the description and comments in the [`renovate.json5` file](https://github.com/mastodon/mastodon/blob/main/.github/renovate.json5).',
|
|
||||||
postUpdateOptions: ['yarnDedupeHighest'],
|
|
||||||
// The types are now included in recent versions,we ignore them here until we upgrade and remove the dependency
|
|
||||||
ignoreDeps: ['@types/emoji-mart'],
|
|
||||||
packageRules: [
|
|
||||||
{
|
|
||||||
// Require Dependency Dashboard Approval for major version bumps of these node packages
|
|
||||||
matchManagers: ['npm'],
|
|
||||||
matchPackageNames: [
|
|
||||||
'tesseract.js', // Requires code changes
|
|
||||||
'react-hotkeys', // Requires code changes
|
|
||||||
|
|
||||||
// react-router: Requires manual upgrade
|
|
||||||
'history',
|
|
||||||
'react-router-dom',
|
|
||||||
|
|
||||||
// react-spring: Requires manual upgrade when upgrading react
|
|
||||||
'@react-spring/web',
|
|
||||||
],
|
|
||||||
matchUpdateTypes: ['major'],
|
|
||||||
dependencyDashboardApproval: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Require Dependency Dashboard Approval for major version bumps of these Ruby packages
|
|
||||||
matchManagers: ['bundler'],
|
|
||||||
matchPackageNames: [
|
|
||||||
'strong_migrations', // Requires manual upgrade
|
|
||||||
'sidekiq', // Requires manual upgrade
|
|
||||||
'sidekiq-unique-jobs', // Requires manual upgrades and sync with Sidekiq version
|
|
||||||
'redis', // Requires manual upgrade and sync with Sidekiq version
|
|
||||||
],
|
|
||||||
matchUpdateTypes: ['major'],
|
|
||||||
dependencyDashboardApproval: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Update GitHub Actions and Docker images weekly
|
|
||||||
matchManagers: ['github-actions', 'dockerfile', 'docker-compose'],
|
|
||||||
extends: ['schedule:weekly'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Require Dependency Dashboard Approval for major & minor bumps for the ruby image, this needs to be synced with .ruby-version
|
|
||||||
matchManagers: ['dockerfile'],
|
|
||||||
matchPackageNames: ['moritzheiber/ruby-jemalloc'],
|
|
||||||
matchUpdateTypes: ['minor', 'major'],
|
|
||||||
dependencyDashboardApproval: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Require Dependency Dashboard Approval for major bumps for the node image, this needs to be synced with .nvmrc
|
|
||||||
matchManagers: ['dockerfile'],
|
|
||||||
matchPackageNames: ['node'],
|
|
||||||
matchUpdateTypes: ['major'],
|
|
||||||
dependencyDashboardApproval: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Require Dependency Dashboard Approval for major postgres bumps in the docker-compose file, as those break dev environments
|
|
||||||
matchManagers: ['docker-compose'],
|
|
||||||
matchPackageNames: ['postgres'],
|
|
||||||
matchUpdateTypes: ['major'],
|
|
||||||
dependencyDashboardApproval: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Update devDependencies every week, with one grouped PR
|
|
||||||
matchManagers: ['npm'],
|
|
||||||
matchDepTypes: 'devDependencies',
|
|
||||||
matchUpdateTypes: ['patch', 'minor'],
|
|
||||||
groupName: 'devDependencies (non-major)',
|
|
||||||
extends: ['schedule:weekly'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Group all eslint-related packages with `eslint` in the same PR
|
|
||||||
matchManagers: ['npm'],
|
|
||||||
matchPackageNames: [
|
|
||||||
'eslint',
|
|
||||||
'eslint-*',
|
|
||||||
'typescript-eslint',
|
|
||||||
'@eslint/*',
|
|
||||||
'globals',
|
|
||||||
],
|
|
||||||
matchUpdateTypes: ['patch', 'minor'],
|
|
||||||
groupName: 'eslint (non-major)',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Group actions/*-artifact in the same PR
|
|
||||||
matchManagers: ['github-actions'],
|
|
||||||
matchPackageNames: [
|
|
||||||
'actions/download-artifact',
|
|
||||||
'actions/upload-artifact',
|
|
||||||
],
|
|
||||||
matchUpdateTypes: ['major'],
|
|
||||||
groupName: 'artifact actions (major)',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Update @types/* packages every week, with one grouped PR
|
|
||||||
matchManagers: ['npm'],
|
|
||||||
matchPackageNames: '@types/*',
|
|
||||||
matchUpdateTypes: ['patch', 'minor'],
|
|
||||||
groupName: 'DefinitelyTyped types (non-major)',
|
|
||||||
extends: ['schedule:weekly'],
|
|
||||||
addLabels: ['typescript'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// We want those packages to always have their own PR
|
|
||||||
matchManagers: ['npm'],
|
|
||||||
matchPackageNames: [
|
|
||||||
'typescript', // Typescript has code-impacting changes in minor versions
|
|
||||||
],
|
|
||||||
groupName: null, // We dont want them to belong to any group
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Group all RuboCop packages with `rubocop` in the same PR
|
|
||||||
matchManagers: ['bundler'],
|
|
||||||
matchPackageNames: ['rubocop', 'rubocop-*'],
|
|
||||||
matchUpdateTypes: ['patch', 'minor'],
|
|
||||||
groupName: 'RuboCop (non-major)',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Group all RSpec packages with `rspec` in the same PR
|
|
||||||
matchManagers: ['bundler'],
|
|
||||||
matchPackageNames: ['rspec', 'rspec-*'],
|
|
||||||
matchUpdateTypes: ['patch', 'minor'],
|
|
||||||
groupName: 'RSpec (non-major)',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// Group all opentelemetry-ruby packages in the same PR
|
|
||||||
matchManagers: ['bundler'],
|
|
||||||
matchPackageNames: ['opentelemetry-*'],
|
|
||||||
matchUpdateTypes: ['patch', 'minor'],
|
|
||||||
groupName: 'opentelemetry-ruby (non-major)',
|
|
||||||
},
|
|
||||||
// Add labels depending on package manager
|
|
||||||
{ matchManagers: ['npm', 'nvm'], addLabels: ['javascript'] },
|
|
||||||
{ matchManagers: ['bundler', 'ruby-version'], addLabels: ['ruby'] },
|
|
||||||
{ matchManagers: ['docker-compose', 'dockerfile'], addLabels: ['docker'] },
|
|
||||||
{ matchManagers: ['github-actions'], addLabels: ['github_actions'] },
|
|
||||||
],
|
|
||||||
}
|
|
10
.github/stale.yml
vendored
10
.github/stale.yml
vendored
|
@ -1,10 +0,0 @@
|
||||||
daysUntilStale: 120
|
|
||||||
daysUntilClose: 7
|
|
||||||
exemptLabels:
|
|
||||||
- security
|
|
||||||
staleLabel: wontfix
|
|
||||||
markComment: >
|
|
||||||
This issue has been automatically marked as stale because it has not had
|
|
||||||
recent activity. It will be closed if no further activity occurs. Thank you
|
|
||||||
for your contributions.
|
|
||||||
only: pulls
|
|
170
.github/workflows/build-container-image.yml
vendored
170
.github/workflows/build-container-image.yml
vendored
|
@ -1,170 +0,0 @@
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
cache:
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
push_to_images:
|
|
||||||
type: string
|
|
||||||
version_prerelease:
|
|
||||||
type: string
|
|
||||||
version_metadata:
|
|
||||||
type: string
|
|
||||||
flavor:
|
|
||||||
type: string
|
|
||||||
tags:
|
|
||||||
type: string
|
|
||||||
labels:
|
|
||||||
type: string
|
|
||||||
file_to_build:
|
|
||||||
type: string
|
|
||||||
|
|
||||||
# This builds multiple images with one runner each, allowing us to build for multiple architectures
|
|
||||||
# using Github's runners.
|
|
||||||
# The two-step process is adapted form:
|
|
||||||
# https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
|
|
||||||
jobs:
|
|
||||||
# Build each (amd64 and arm64) image separately
|
|
||||||
build-image:
|
|
||||||
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
platform:
|
|
||||||
- linux/amd64
|
|
||||||
- linux/arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Prepare
|
|
||||||
env:
|
|
||||||
PUSH_TO_IMAGES: ${{ inputs.push_to_images }}
|
|
||||||
run: |
|
|
||||||
platform=${{ matrix.platform }}
|
|
||||||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
|
||||||
# Transform multi-line variable into comma-separated variable
|
|
||||||
image_names=${PUSH_TO_IMAGES//$'\n'/,}
|
|
||||||
echo "IMAGE_NAMES=${image_names%,}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: docker/setup-buildx-action@v3
|
|
||||||
id: buildx
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
if: contains(inputs.push_to_images, 'tootsuite')
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Log in to the GitHub Container registry
|
|
||||||
if: contains(inputs.push_to_images, 'ghcr.io')
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
if: ${{ inputs.push_to_images != '' }}
|
|
||||||
with:
|
|
||||||
images: ${{ inputs.push_to_images }}
|
|
||||||
flavor: ${{ inputs.flavor }}
|
|
||||||
labels: ${{ inputs.labels }}
|
|
||||||
|
|
||||||
- name: Build and push by digest
|
|
||||||
id: build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ${{ inputs.file_to_build }}
|
|
||||||
build-args: |
|
|
||||||
MASTODON_VERSION_PRERELEASE=${{ inputs.version_prerelease }}
|
|
||||||
MASTODON_VERSION_METADATA=${{ inputs.version_metadata }}
|
|
||||||
SOURCE_COMMIT=${{ github.sha }}
|
|
||||||
platforms: ${{ matrix.platform }}
|
|
||||||
provenance: false
|
|
||||||
push: ${{ inputs.push_to_images != '' }}
|
|
||||||
cache-from: ${{ inputs.cache && 'type=gha' || '' }}
|
|
||||||
cache-to: ${{ inputs.cache && 'type=gha,mode=max' || '' }}
|
|
||||||
outputs: type=image,"name=${{ env.IMAGE_NAMES }}",push-by-digest=true,name-canonical=true,push=${{ inputs.push_to_images != '' }}
|
|
||||||
|
|
||||||
- name: Export digest
|
|
||||||
if: ${{ inputs.push_to_images != '' }}
|
|
||||||
run: |
|
|
||||||
mkdir -p "${{ runner.temp }}/digests"
|
|
||||||
digest="${{ steps.build.outputs.digest }}"
|
|
||||||
touch "${{ runner.temp }}/digests/${digest#sha256:}"
|
|
||||||
|
|
||||||
- name: Upload digest
|
|
||||||
if: ${{ inputs.push_to_images != '' }}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
# `hashFiles` is used to disambiguate between streaming and non-streaming images
|
|
||||||
name: digests-${{ hashFiles(inputs.file_to_build) }}-${{ env.PLATFORM_PAIR }}
|
|
||||||
path: ${{ runner.temp }}/digests/*
|
|
||||||
if-no-files-found: error
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
# Then merge the docker images into a single one
|
|
||||||
merge-images:
|
|
||||||
if: ${{ inputs.push_to_images != '' }}
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs:
|
|
||||||
- build-image
|
|
||||||
|
|
||||||
env:
|
|
||||||
PUSH_TO_IMAGES: ${{ inputs.push_to_images }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Download digests
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: ${{ runner.temp }}/digests
|
|
||||||
# `hashFiles` is used to disambiguate between streaming and non-streaming images
|
|
||||||
pattern: digests-${{ hashFiles(inputs.file_to_build) }}-*
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
if: contains(inputs.push_to_images, 'tootsuite')
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Log in to the GitHub Container registry
|
|
||||||
if: contains(inputs.push_to_images, 'ghcr.io')
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
if: ${{ inputs.push_to_images != '' }}
|
|
||||||
with:
|
|
||||||
images: ${{ inputs.push_to_images }}
|
|
||||||
flavor: ${{ inputs.flavor }}
|
|
||||||
tags: ${{ inputs.tags }}
|
|
||||||
labels: ${{ inputs.labels }}
|
|
||||||
|
|
||||||
- name: Create manifest list and push
|
|
||||||
working-directory: ${{ runner.temp }}/digests
|
|
||||||
run: |
|
|
||||||
echo "$PUSH_TO_IMAGES" | xargs -I{} \
|
|
||||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
|
||||||
$(printf '{}@sha256:%s ' *)
|
|
||||||
|
|
||||||
- name: Inspect image
|
|
||||||
run: |
|
|
||||||
echo "$PUSH_TO_IMAGES" | xargs -i{} \
|
|
||||||
docker buildx imagetools inspect {}:${{ steps.meta.outputs.version }}
|
|
62
.github/workflows/build-nightly.yml
vendored
62
.github/workflows/build-nightly.yml
vendored
|
@ -1,62 +0,0 @@
|
||||||
name: Build nightly container image
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 2 * * *' # run at 2 AM UTC
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
compute-suffix:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'mastodon/mastodon'
|
|
||||||
steps:
|
|
||||||
- id: version_vars
|
|
||||||
env:
|
|
||||||
TZ: Etc/UTC
|
|
||||||
run: |
|
|
||||||
echo mastodon_version_prerelease=nightly.$(date +'%Y-%m-%d')>> $GITHUB_OUTPUT
|
|
||||||
outputs:
|
|
||||||
prerelease: ${{ steps.version_vars.outputs.mastodon_version_prerelease }}
|
|
||||||
|
|
||||||
build-image:
|
|
||||||
needs: compute-suffix
|
|
||||||
uses: ./.github/workflows/build-container-image.yml
|
|
||||||
with:
|
|
||||||
file_to_build: Dockerfile
|
|
||||||
cache: false
|
|
||||||
push_to_images: |
|
|
||||||
tootsuite/mastodon
|
|
||||||
ghcr.io/mastodon/mastodon
|
|
||||||
version_prerelease: ${{ needs.compute-suffix.outputs.prerelease }}
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.description=Nightly build image used for testing purposes
|
|
||||||
flavor: |
|
|
||||||
latest=auto
|
|
||||||
tags: |
|
|
||||||
type=raw,value=edge
|
|
||||||
type=raw,value=nightly
|
|
||||||
type=schedule,pattern=${{ needs.compute-suffix.outputs.prerelease }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
build-image-streaming:
|
|
||||||
needs: compute-suffix
|
|
||||||
uses: ./.github/workflows/build-container-image.yml
|
|
||||||
with:
|
|
||||||
file_to_build: streaming/Dockerfile
|
|
||||||
cache: false
|
|
||||||
push_to_images: |
|
|
||||||
tootsuite/mastodon-streaming
|
|
||||||
ghcr.io/mastodon/mastodon-streaming
|
|
||||||
version_prerelease: ${{ needs.compute-suffix.outputs.prerelease }}
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.description=Nightly build image used for testing purposes
|
|
||||||
flavor: |
|
|
||||||
latest=auto
|
|
||||||
tags: |
|
|
||||||
type=raw,value=edge
|
|
||||||
type=raw,value=nightly
|
|
||||||
type=schedule,pattern=${{ needs.compute-suffix.outputs.prerelease }}
|
|
||||||
secrets: inherit
|
|
58
.github/workflows/build-push-pr.yml
vendored
58
.github/workflows/build-push-pr.yml
vendored
|
@ -1,58 +0,0 @@
|
||||||
name: Build container image for PR
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [labeled, synchronize, reopened, ready_for_review, opened]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
compute-suffix:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
# This is only allowed to run if:
|
|
||||||
# - the PR branch is in the `mastodon/mastodon` repository
|
|
||||||
# - the PR is not a draft
|
|
||||||
# - the PR has the "build-image" label
|
|
||||||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'build-image') }}
|
|
||||||
steps:
|
|
||||||
# Repository needs to be cloned so `git rev-parse` below works
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- id: version_vars
|
|
||||||
run: |
|
|
||||||
echo mastodon_version_metadata=pr-${{ github.event.pull_request.number }}-$(git rev-parse --short ${{github.event.pull_request.head.sha}}) >> $GITHUB_OUTPUT
|
|
||||||
echo mastodon_short_sha=$(git rev-parse --short ${{github.event.pull_request.head.sha}}) >> $GITHUB_OUTPUT
|
|
||||||
outputs:
|
|
||||||
metadata: ${{ steps.version_vars.outputs.mastodon_version_metadata }}
|
|
||||||
short_sha: ${{ steps.version_vars.outputs.mastodon_short_sha }}
|
|
||||||
|
|
||||||
build-image:
|
|
||||||
needs: compute-suffix
|
|
||||||
uses: ./.github/workflows/build-container-image.yml
|
|
||||||
with:
|
|
||||||
file_to_build: Dockerfile
|
|
||||||
push_to_images: |
|
|
||||||
ghcr.io/mastodon/mastodon
|
|
||||||
version_metadata: ${{ needs.compute-suffix.outputs.metadata }}
|
|
||||||
flavor: |
|
|
||||||
latest=auto
|
|
||||||
tags: |
|
|
||||||
type=ref,event=pr
|
|
||||||
type=ref,event=pr,suffix=-${{ needs.compute-suffix.outputs.short_sha }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
build-image-streaming:
|
|
||||||
needs: compute-suffix
|
|
||||||
uses: ./.github/workflows/build-container-image.yml
|
|
||||||
with:
|
|
||||||
file_to_build: streaming/Dockerfile
|
|
||||||
push_to_images: |
|
|
||||||
ghcr.io/mastodon/mastodon-streaming
|
|
||||||
version_metadata: ${{ needs.compute-suffix.outputs.metadata }}
|
|
||||||
flavor: |
|
|
||||||
latest=auto
|
|
||||||
tags: |
|
|
||||||
type=ref,event=pr
|
|
||||||
type=ref,event=pr,suffix=-${{ needs.compute-suffix.outputs.short_sha }}
|
|
||||||
secrets: inherit
|
|
46
.github/workflows/build-releases.yml
vendored
46
.github/workflows/build-releases.yml
vendored
|
@ -1,46 +0,0 @@
|
||||||
name: Build container release images
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-image:
|
|
||||||
uses: ./.github/workflows/build-container-image.yml
|
|
||||||
with:
|
|
||||||
file_to_build: Dockerfile
|
|
||||||
push_to_images: |
|
|
||||||
tootsuite/mastodon
|
|
||||||
ghcr.io/mastodon/mastodon
|
|
||||||
# Do not use cache when building releases, so apt update is always ran and the release always contain the latest packages
|
|
||||||
cache: false
|
|
||||||
# Only tag with latest when ran against the latest stable branch
|
|
||||||
# This needs to be updated after each minor version release
|
|
||||||
flavor: |
|
|
||||||
latest=${{ startsWith(github.ref, 'refs/tags/v4.3.') }}
|
|
||||||
tags: |
|
|
||||||
type=pep440,pattern={{raw}}
|
|
||||||
type=pep440,pattern=v{{major}}.{{minor}}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
build-image-streaming:
|
|
||||||
uses: ./.github/workflows/build-container-image.yml
|
|
||||||
with:
|
|
||||||
file_to_build: streaming/Dockerfile
|
|
||||||
push_to_images: |
|
|
||||||
tootsuite/mastodon-streaming
|
|
||||||
ghcr.io/mastodon/mastodon-streaming
|
|
||||||
# Do not use cache when building releases, so apt update is always ran and the release always contain the latest packages
|
|
||||||
cache: false
|
|
||||||
# Only tag with latest when ran against the latest stable branch
|
|
||||||
# This needs to be updated after each minor version release
|
|
||||||
flavor: |
|
|
||||||
latest=${{ startsWith(github.ref, 'refs/tags/v4.3.') }}
|
|
||||||
tags: |
|
|
||||||
type=pep440,pattern={{raw}}
|
|
||||||
type=pep440,pattern=v{{major}}.{{minor}}
|
|
||||||
secrets: inherit
|
|
60
.github/workflows/build-security.yml
vendored
60
.github/workflows/build-security.yml
vendored
|
@ -1,60 +0,0 @@
|
||||||
name: Build security nightly container image
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
compute-suffix:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'mastodon/mastodon'
|
|
||||||
steps:
|
|
||||||
- id: version_vars
|
|
||||||
env:
|
|
||||||
TZ: Etc/UTC
|
|
||||||
run: |
|
|
||||||
echo mastodon_version_prerelease=nightly.$(date --date='next day' +'%Y-%m-%d')-security>> $GITHUB_OUTPUT
|
|
||||||
outputs:
|
|
||||||
prerelease: ${{ steps.version_vars.outputs.mastodon_version_prerelease }}
|
|
||||||
|
|
||||||
build-image:
|
|
||||||
needs: compute-suffix
|
|
||||||
uses: ./.github/workflows/build-container-image.yml
|
|
||||||
with:
|
|
||||||
file_to_build: Dockerfile
|
|
||||||
cache: false
|
|
||||||
push_to_images: |
|
|
||||||
tootsuite/mastodon
|
|
||||||
ghcr.io/mastodon/mastodon
|
|
||||||
version_prerelease: ${{ needs.compute-suffix.outputs.prerelease }}
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.description=Nightly build image used for testing purposes
|
|
||||||
flavor: |
|
|
||||||
latest=auto
|
|
||||||
tags: |
|
|
||||||
type=raw,value=edge
|
|
||||||
type=raw,value=nightly
|
|
||||||
type=raw,value=${{ needs.compute-suffix.outputs.prerelease }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
build-image-streaming:
|
|
||||||
needs: compute-suffix
|
|
||||||
uses: ./.github/workflows/build-container-image.yml
|
|
||||||
with:
|
|
||||||
file_to_build: streaming/Dockerfile
|
|
||||||
cache: false
|
|
||||||
push_to_images: |
|
|
||||||
tootsuite/mastodon-streaming
|
|
||||||
ghcr.io/mastodon/mastodon-streaming
|
|
||||||
version_prerelease: ${{ needs.compute-suffix.outputs.prerelease }}
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.description=Nightly build image used for testing purposes
|
|
||||||
flavor: |
|
|
||||||
latest=auto
|
|
||||||
tags: |
|
|
||||||
type=raw,value=edge
|
|
||||||
type=raw,value=nightly
|
|
||||||
type=raw,value=${{ needs.compute-suffix.outputs.prerelease }}
|
|
||||||
secrets: inherit
|
|
39
.github/workflows/bundler-audit.yml
vendored
39
.github/workflows/bundler-audit.yml
vendored
|
@ -1,39 +0,0 @@
|
||||||
name: Bundler Audit
|
|
||||||
on:
|
|
||||||
merge_group:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
paths:
|
|
||||||
- 'Gemfile*'
|
|
||||||
- '.ruby-version'
|
|
||||||
- '.github/workflows/bundler-audit.yml'
|
|
||||||
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'Gemfile*'
|
|
||||||
- '.ruby-version'
|
|
||||||
- '.github/workflows/bundler-audit.yml'
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
- cron: '0 5 * * 1'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
security:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
env:
|
|
||||||
BUNDLE_ONLY: development
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Ruby
|
|
||||||
uses: ruby/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
bundler-cache: true
|
|
||||||
|
|
||||||
- name: Run bundler-audit
|
|
||||||
run: bin/bundler-audit check --update
|
|
52
.github/workflows/check-i18n.yml
vendored
52
.github/workflows/check-i18n.yml
vendored
|
@ -1,52 +0,0 @@
|
||||||
name: Check i18n
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
|
|
||||||
env:
|
|
||||||
RAILS_ENV: test
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check-i18n:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
|
|
||||||
- name: Set up Javascript environment
|
|
||||||
uses: ./.github/actions/setup-javascript
|
|
||||||
|
|
||||||
- name: Check for missing strings in English JSON
|
|
||||||
run: |
|
|
||||||
yarn i18n:extract --throws
|
|
||||||
git diff --exit-code
|
|
||||||
|
|
||||||
- name: Check locale file normalization
|
|
||||||
run: bin/i18n-tasks check-normalized
|
|
||||||
|
|
||||||
- name: Check for unused strings
|
|
||||||
run: bin/i18n-tasks unused
|
|
||||||
|
|
||||||
- name: Check for missing strings in English YML
|
|
||||||
run: |
|
|
||||||
bin/i18n-tasks add-missing -l en
|
|
||||||
git diff --exit-code
|
|
||||||
|
|
||||||
- name: Check for wrong string interpolations
|
|
||||||
run: bin/i18n-tasks check-consistent-interpolations
|
|
||||||
|
|
||||||
- name: Check that all required locale files exist
|
|
||||||
run: bin/rake repo:check_locales_files
|
|
41
.github/workflows/chromatic.yml
vendored
41
.github/workflows/chromatic.yml
vendored
|
@ -1,41 +0,0 @@
|
||||||
name: 'Chromatic'
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches-ignore:
|
|
||||||
- renovate/*
|
|
||||||
- stable-*
|
|
||||||
paths:
|
|
||||||
- 'package.json'
|
|
||||||
- 'yarn.lock'
|
|
||||||
- '**/*.js'
|
|
||||||
- '**/*.jsx'
|
|
||||||
- '**/*.ts'
|
|
||||||
- '**/*.tsx'
|
|
||||||
- '**/*.css'
|
|
||||||
- '**/*.scss'
|
|
||||||
- '.github/workflows/chromatic.yml'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
chromatic:
|
|
||||||
name: Run Chromatic
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'mastodon/mastodon'
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Set up Javascript environment
|
|
||||||
uses: ./.github/actions/setup-javascript
|
|
||||||
|
|
||||||
- name: Build Storybook
|
|
||||||
run: yarn build-storybook
|
|
||||||
|
|
||||||
- name: Run Chromatic
|
|
||||||
uses: chromaui/action@v12
|
|
||||||
with:
|
|
||||||
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
|
|
||||||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
|
||||||
zip: true
|
|
||||||
storybookBuildDir: 'storybook-static'
|
|
66
.github/workflows/codeql.yml
vendored
66
.github/workflows/codeql.yml
vendored
|
@ -1,66 +0,0 @@
|
||||||
name: 'CodeQL'
|
|
||||||
|
|
||||||
on:
|
|
||||||
merge_group:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
schedule:
|
|
||||||
- cron: '22 6 * * 1'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
language: ['javascript', 'ruby']
|
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
||||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v3
|
|
||||||
with:
|
|
||||||
languages: ${{ matrix.language }}
|
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
||||||
# By default, queries listed here will override any specified in a config file.
|
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
||||||
|
|
||||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
||||||
# queries: security-extended,security-and-quality
|
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
|
||||||
- name: Autobuild
|
|
||||||
uses: github/codeql-action/autobuild@v3
|
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
|
||||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
||||||
|
|
||||||
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
|
||||||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
|
||||||
|
|
||||||
# - run: |
|
|
||||||
# echo "Run, Build Application using script"
|
|
||||||
# ./location_of_script_within_repo/buildscript.sh
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v3
|
|
||||||
with:
|
|
||||||
category: '/language:${{matrix.language}}'
|
|
69
.github/workflows/crowdin-download-stable.yml
vendored
69
.github/workflows/crowdin-download-stable.yml
vendored
|
@ -1,69 +0,0 @@
|
||||||
name: Crowdin / Download translations (stable branches)
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
download-translations-stable:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'mastodon/mastodon'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Increase Git http.postBuffer
|
|
||||||
# This is needed due to a bug in Ubuntu's cURL version?
|
|
||||||
# See https://github.com/orgs/community/discussions/55820
|
|
||||||
run: |
|
|
||||||
git config --global http.version HTTP/1.1
|
|
||||||
git config --global http.postBuffer 157286400
|
|
||||||
|
|
||||||
# Download the translation files from Crowdin
|
|
||||||
- name: crowdin action
|
|
||||||
uses: crowdin/github-action@v2
|
|
||||||
with:
|
|
||||||
upload_sources: false
|
|
||||||
upload_translations: false
|
|
||||||
download_translations: true
|
|
||||||
crowdin_branch_name: ${{ github.base_ref || github.ref_name }}
|
|
||||||
push_translations: false
|
|
||||||
create_pull_request: false
|
|
||||||
env:
|
|
||||||
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
|
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
||||||
|
|
||||||
# As the files are extracted from a Docker container, they belong to root:root
|
|
||||||
# We need to fix this before the next steps
|
|
||||||
- name: Fix file permissions
|
|
||||||
run: sudo chown -R runner:docker .
|
|
||||||
|
|
||||||
# This is needed to run the normalize step
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
|
|
||||||
- name: Run i18n normalize task
|
|
||||||
run: bin/i18n-tasks normalize
|
|
||||||
|
|
||||||
# Create or update the pull request
|
|
||||||
- name: Create Pull Request
|
|
||||||
uses: peter-evans/create-pull-request@v7.0.6
|
|
||||||
with:
|
|
||||||
commit-message: 'New Crowdin translations'
|
|
||||||
title: 'New Crowdin Translations for ${{ github.base_ref || github.ref_name }} (automated)'
|
|
||||||
author: 'GitHub Actions <noreply@github.com>'
|
|
||||||
body: |
|
|
||||||
New Crowdin translations, automated with GitHub Actions
|
|
||||||
|
|
||||||
See `.github/workflows/crowdin-download.yml`
|
|
||||||
|
|
||||||
This PR will be updated every day with new translations.
|
|
||||||
|
|
||||||
Due to a limitation in GitHub Actions, checks are not running on this PR without manual action.
|
|
||||||
If you want to run the checks, then close and re-open it.
|
|
||||||
branch: i18n/crowdin/translations-${{ github.base_ref || github.ref_name }}
|
|
||||||
base: ${{ github.base_ref || github.ref_name }}
|
|
||||||
labels: i18n
|
|
71
.github/workflows/crowdin-download.yml
vendored
71
.github/workflows/crowdin-download.yml
vendored
|
@ -1,71 +0,0 @@
|
||||||
name: Crowdin / Download translations
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '17 4 * * *' # Every day
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
download-translations:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'mastodon/mastodon'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Increase Git http.postBuffer
|
|
||||||
# This is needed due to a bug in Ubuntu's cURL version?
|
|
||||||
# See https://github.com/orgs/community/discussions/55820
|
|
||||||
run: |
|
|
||||||
git config --global http.version HTTP/1.1
|
|
||||||
git config --global http.postBuffer 157286400
|
|
||||||
|
|
||||||
# Download the translation files from Crowdin
|
|
||||||
- name: crowdin action
|
|
||||||
uses: crowdin/github-action@v2
|
|
||||||
with:
|
|
||||||
upload_sources: false
|
|
||||||
upload_translations: false
|
|
||||||
download_translations: true
|
|
||||||
crowdin_branch_name: main
|
|
||||||
push_translations: false
|
|
||||||
create_pull_request: false
|
|
||||||
env:
|
|
||||||
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
|
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
||||||
|
|
||||||
# As the files are extracted from a Docker container, they belong to root:root
|
|
||||||
# We need to fix this before the next steps
|
|
||||||
- name: Fix file permissions
|
|
||||||
run: sudo chown -R runner:docker .
|
|
||||||
|
|
||||||
# This is needed to run the normalize step
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
|
|
||||||
- name: Run i18n normalize task
|
|
||||||
run: bin/i18n-tasks normalize
|
|
||||||
|
|
||||||
# Create or update the pull request
|
|
||||||
- name: Create Pull Request
|
|
||||||
uses: peter-evans/create-pull-request@v7
|
|
||||||
with:
|
|
||||||
commit-message: 'New Crowdin translations'
|
|
||||||
title: 'New Crowdin Translations (automated)'
|
|
||||||
author: 'GitHub Actions <noreply@github.com>'
|
|
||||||
body: |
|
|
||||||
New Crowdin translations, automated with GitHub Actions
|
|
||||||
|
|
||||||
See `.github/workflows/crowdin-download.yml`
|
|
||||||
|
|
||||||
This PR will be updated every day with new translations.
|
|
||||||
|
|
||||||
Due to a limitation in GitHub Actions, checks are not running on this PR without manual action.
|
|
||||||
If you want to run the checks, then close and re-open it.
|
|
||||||
branch: i18n/crowdin/translations
|
|
||||||
base: main
|
|
||||||
labels: i18n
|
|
37
.github/workflows/crowdin-upload.yml
vendored
37
.github/workflows/crowdin-upload.yml
vendored
|
@ -1,37 +0,0 @@
|
||||||
name: Crowdin / Upload translations
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
paths:
|
|
||||||
- crowdin.yml
|
|
||||||
- app/javascript/mastodon/locales/en.json
|
|
||||||
- config/locales/en.yml
|
|
||||||
- config/locales/simple_form.en.yml
|
|
||||||
- config/locales/activerecord.en.yml
|
|
||||||
- config/locales/devise.en.yml
|
|
||||||
- config/locales/doorkeeper.en.yml
|
|
||||||
- .github/workflows/crowdin-upload.yml
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upload-translations:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'mastodon/mastodon'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: crowdin action
|
|
||||||
uses: crowdin/github-action@v2
|
|
||||||
with:
|
|
||||||
upload_sources: true
|
|
||||||
upload_translations: false
|
|
||||||
download_translations: false
|
|
||||||
crowdin_branch_name: ${{ github.base_ref || github.ref_name }}
|
|
||||||
|
|
||||||
env:
|
|
||||||
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
|
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
22
.github/workflows/format-check.yml
vendored
22
.github/workflows/format-check.yml
vendored
|
@ -1,22 +0,0 @@
|
||||||
name: Check formatting
|
|
||||||
on:
|
|
||||||
merge_group:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Javascript environment
|
|
||||||
uses: ./.github/actions/setup-javascript
|
|
||||||
|
|
||||||
- name: Check formatting with Prettier
|
|
||||||
run: yarn format:check
|
|
17
.github/workflows/haml-lint-problem-matcher.json
vendored
17
.github/workflows/haml-lint-problem-matcher.json
vendored
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "haml-lint",
|
|
||||||
"severity": "warning",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(.*):(\\d+)\\s\\[W]\\s(.*):\\s(.*)$",
|
|
||||||
"file": 1,
|
|
||||||
"line": 2,
|
|
||||||
"code": 3,
|
|
||||||
"message": 4
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
43
.github/workflows/lint-css.yml
vendored
43
.github/workflows/lint-css.yml
vendored
|
@ -1,43 +0,0 @@
|
||||||
name: CSS Linting
|
|
||||||
on:
|
|
||||||
merge_group:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
paths:
|
|
||||||
- 'package.json'
|
|
||||||
- 'yarn.lock'
|
|
||||||
- '.nvmrc'
|
|
||||||
- '.prettier*'
|
|
||||||
- 'stylelint.config.js'
|
|
||||||
- '**/*.css'
|
|
||||||
- '**/*.scss'
|
|
||||||
- '.github/workflows/lint-css.yml'
|
|
||||||
- '.github/stylelint-matcher.json'
|
|
||||||
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'package.json'
|
|
||||||
- 'yarn.lock'
|
|
||||||
- '.nvmrc'
|
|
||||||
- '.prettier*'
|
|
||||||
- 'stylelint.config.js'
|
|
||||||
- '**/*.css'
|
|
||||||
- '**/*.scss'
|
|
||||||
- '.github/workflows/lint-css.yml'
|
|
||||||
- '.github/stylelint-matcher.json'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Javascript environment
|
|
||||||
uses: ./.github/actions/setup-javascript
|
|
||||||
|
|
||||||
- name: Stylelint
|
|
||||||
run: yarn lint:css --custom-formatter @csstools/stylelint-formatter-github
|
|
46
.github/workflows/lint-haml.yml
vendored
46
.github/workflows/lint-haml.yml
vendored
|
@ -1,46 +0,0 @@
|
||||||
name: Haml Linting
|
|
||||||
on:
|
|
||||||
merge_group:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/haml-lint-problem-matcher.json'
|
|
||||||
- '.github/workflows/lint-haml.yml'
|
|
||||||
- '.haml-lint*.yml'
|
|
||||||
- '.rubocop*.yml'
|
|
||||||
- '.ruby-version'
|
|
||||||
- '**/*.haml'
|
|
||||||
- 'Gemfile*'
|
|
||||||
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/haml-lint-problem-matcher.json'
|
|
||||||
- '.github/workflows/lint-haml.yml'
|
|
||||||
- '.haml-lint*.yml'
|
|
||||||
- '.rubocop*.yml'
|
|
||||||
- '.ruby-version'
|
|
||||||
- '**/*.haml'
|
|
||||||
- 'Gemfile*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
env:
|
|
||||||
BUNDLE_ONLY: development
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Ruby
|
|
||||||
uses: ruby/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
bundler-cache: true
|
|
||||||
|
|
||||||
- name: Run haml-lint
|
|
||||||
run: |
|
|
||||||
echo "::add-matcher::.github/workflows/haml-lint-problem-matcher.json"
|
|
||||||
bin/haml-lint --reporter github
|
|
50
.github/workflows/lint-js.yml
vendored
50
.github/workflows/lint-js.yml
vendored
|
@ -1,50 +0,0 @@
|
||||||
name: JavaScript Linting
|
|
||||||
on:
|
|
||||||
merge_group:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
paths:
|
|
||||||
- 'package.json'
|
|
||||||
- 'yarn.lock'
|
|
||||||
- 'tsconfig.json'
|
|
||||||
- '.nvmrc'
|
|
||||||
- '.prettier*'
|
|
||||||
- 'eslint.config.mjs'
|
|
||||||
- '**/*.js'
|
|
||||||
- '**/*.jsx'
|
|
||||||
- '**/*.ts'
|
|
||||||
- '**/*.tsx'
|
|
||||||
- '.github/workflows/lint-js.yml'
|
|
||||||
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'package.json'
|
|
||||||
- 'yarn.lock'
|
|
||||||
- 'tsconfig.json'
|
|
||||||
- '.nvmrc'
|
|
||||||
- '.prettier*'
|
|
||||||
- 'eslint.config.mjs'
|
|
||||||
- '**/*.js'
|
|
||||||
- '**/*.jsx'
|
|
||||||
- '**/*.ts'
|
|
||||||
- '**/*.tsx'
|
|
||||||
- '.github/workflows/lint-js.yml'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Javascript environment
|
|
||||||
uses: ./.github/actions/setup-javascript
|
|
||||||
|
|
||||||
- name: ESLint
|
|
||||||
run: yarn workspaces foreach --all --parallel run lint:js --max-warnings 0
|
|
||||||
|
|
||||||
- name: Typecheck
|
|
||||||
run: yarn typecheck
|
|
53
.github/workflows/lint-ruby.yml
vendored
53
.github/workflows/lint-ruby.yml
vendored
|
@ -1,53 +0,0 @@
|
||||||
name: Ruby Linting
|
|
||||||
on:
|
|
||||||
merge_group:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
paths:
|
|
||||||
- 'Gemfile*'
|
|
||||||
- '.rubocop*.yml'
|
|
||||||
- '.ruby-version'
|
|
||||||
- 'bin/rubocop'
|
|
||||||
- 'config/brakeman.ignore'
|
|
||||||
- '**/*.rb'
|
|
||||||
- '**/*.rake'
|
|
||||||
- '.github/workflows/lint-ruby.yml'
|
|
||||||
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'Gemfile*'
|
|
||||||
- '.rubocop*.yml'
|
|
||||||
- '.ruby-version'
|
|
||||||
- 'bin/rubocop'
|
|
||||||
- 'config/brakeman.ignore'
|
|
||||||
- '**/*.rb'
|
|
||||||
- '**/*.rake'
|
|
||||||
- '.github/workflows/lint-ruby.yml'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
env:
|
|
||||||
BUNDLE_ONLY: development
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Ruby
|
|
||||||
uses: ruby/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
bundler-cache: true
|
|
||||||
|
|
||||||
- name: Set-up RuboCop Problem Matcher
|
|
||||||
uses: r7kamura/rubocop-problem-matchers-action@v1
|
|
||||||
|
|
||||||
- name: Run rubocop
|
|
||||||
run: bin/rubocop
|
|
||||||
|
|
||||||
- name: Run brakeman
|
|
||||||
if: always() # Run both checks, even if the first failed
|
|
||||||
run: bin/brakeman
|
|
28
.github/workflows/rebase-needed.yml
vendored
28
.github/workflows/rebase-needed.yml
vendored
|
@ -1,28 +0,0 @@
|
||||||
name: PR Needs Rebase
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 * * * *'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
label-rebase-needed:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'mastodon/mastodon'
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Check for merge conflicts
|
|
||||||
uses: eps1lon/actions-label-merge-conflict@v3
|
|
||||||
with:
|
|
||||||
dirtyLabel: 'rebase needed :construction:'
|
|
||||||
repoToken: '${{ secrets.GITHUB_TOKEN }}'
|
|
||||||
commentOnClean: This pull request has resolved merge conflicts and is ready for review.
|
|
||||||
commentOnDirty: This pull request has merge conflicts that must be resolved before it can be merged.
|
|
||||||
retryMax: 30
|
|
||||||
continueOnMissingPermissions: false
|
|
34
.github/workflows/test-image-build.yml
vendored
34
.github/workflows/test-image-build.yml
vendored
|
@ -1,34 +0,0 @@
|
||||||
name: Test container image build
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- .github/workflows/build-nightly.yml
|
|
||||||
- .github/workflows/build-push-pr.yml
|
|
||||||
- .github/workflows/build-releases.yml
|
|
||||||
- .github/workflows/test-image-build.yml
|
|
||||||
- Dockerfile
|
|
||||||
- streaming/Dockerfile
|
|
||||||
- .dockerignore
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-image:
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
uses: ./.github/workflows/build-container-image.yml
|
|
||||||
with:
|
|
||||||
file_to_build: Dockerfile
|
|
||||||
cache: true
|
|
||||||
|
|
||||||
build-image-streaming:
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}-streaming
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
uses: ./.github/workflows/build-container-image.yml
|
|
||||||
with:
|
|
||||||
file_to_build: streaming/Dockerfile
|
|
||||||
cache: true
|
|
43
.github/workflows/test-js.yml
vendored
43
.github/workflows/test-js.yml
vendored
|
@ -1,43 +0,0 @@
|
||||||
name: JavaScript Testing
|
|
||||||
on:
|
|
||||||
merge_group:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
paths:
|
|
||||||
- 'package.json'
|
|
||||||
- 'yarn.lock'
|
|
||||||
- '.nvmrc'
|
|
||||||
- '**/*.js'
|
|
||||||
- '**/*.jsx'
|
|
||||||
- '**/*.ts'
|
|
||||||
- '**/*.tsx'
|
|
||||||
- '**/*.snap'
|
|
||||||
- '.github/workflows/test-js.yml'
|
|
||||||
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'package.json'
|
|
||||||
- 'yarn.lock'
|
|
||||||
- '.nvmrc'
|
|
||||||
- '**/*.js'
|
|
||||||
- '**/*.jsx'
|
|
||||||
- '**/*.ts'
|
|
||||||
- '**/*.tsx'
|
|
||||||
- '**/*.snap'
|
|
||||||
- '.github/workflows/test-js.yml'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Javascript environment
|
|
||||||
uses: ./.github/actions/setup-javascript
|
|
||||||
|
|
||||||
- name: JavaScript testing
|
|
||||||
run: yarn test:js
|
|
112
.github/workflows/test-migrations.yml
vendored
112
.github/workflows/test-migrations.yml
vendored
|
@ -1,112 +0,0 @@
|
||||||
name: Historical data migration test
|
|
||||||
|
|
||||||
on:
|
|
||||||
merge_group:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
paths:
|
|
||||||
- 'Gemfile*'
|
|
||||||
- '.ruby-version'
|
|
||||||
- '**/*.rb'
|
|
||||||
- '.github/workflows/test-migrations.yml'
|
|
||||||
- 'lib/tasks/tests.rake'
|
|
||||||
- 'lib/tasks/db.rake'
|
|
||||||
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'Gemfile*'
|
|
||||||
- '.ruby-version'
|
|
||||||
- '**/*.rb'
|
|
||||||
- '.github/workflows/test-migrations.yml'
|
|
||||||
- 'lib/tasks/tests.rake'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
postgres:
|
|
||||||
- 14-alpine
|
|
||||||
- 15-alpine
|
|
||||||
- 16-alpine
|
|
||||||
- 17-alpine
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:${{ matrix.postgres}}
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
options: >-
|
|
||||||
--health-cmd "redis-cli ping"
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
|
|
||||||
env:
|
|
||||||
DB_HOST: localhost
|
|
||||||
DB_USER: postgres
|
|
||||||
DB_PASS: postgres
|
|
||||||
RAILS_ENV: test
|
|
||||||
BUNDLE_CLEAN: true
|
|
||||||
BUNDLE_FROZEN: true
|
|
||||||
BUNDLE_WITHOUT: 'development:production'
|
|
||||||
BUNDLE_JOBS: 3
|
|
||||||
BUNDLE_RETRY: 3
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
|
|
||||||
- name: Ensure no errors with `db:prepare`
|
|
||||||
run: |
|
|
||||||
bin/rails db:drop
|
|
||||||
bin/rails db:prepare
|
|
||||||
bin/rails db:migrate
|
|
||||||
|
|
||||||
- name: Ensure no errors with `db:prepare` and SKIP_POST_DEPLOYMENT_MIGRATIONS
|
|
||||||
run: |
|
|
||||||
bin/rails db:drop
|
|
||||||
SKIP_POST_DEPLOYMENT_MIGRATIONS=true bin/rails db:prepare
|
|
||||||
bin/rails db:migrate
|
|
||||||
|
|
||||||
- name: Test "one step migration" flow
|
|
||||||
run: |
|
|
||||||
bin/rails db:drop
|
|
||||||
bin/rails db:create
|
|
||||||
bin/rails tests:migrations:prepare_database
|
|
||||||
bin/rails db:migrate
|
|
||||||
bin/rails tests:migrations:check_database
|
|
||||||
|
|
||||||
- name: Test "two step migration" flow
|
|
||||||
run: |
|
|
||||||
bin/rails db:drop
|
|
||||||
bin/rails db:create
|
|
||||||
SKIP_POST_DEPLOYMENT_MIGRATIONS=true bin/rails tests:migrations:prepare_database
|
|
||||||
|
|
||||||
# Migrate up to v4.2.0 breakpoint
|
|
||||||
bin/rails db:migrate VERSION=20230907150100
|
|
||||||
|
|
||||||
# Migrate the rest
|
|
||||||
SKIP_POST_DEPLOYMENT_MIGRATIONS=true bin/rails db:migrate
|
|
||||||
bin/rails db:migrate
|
|
||||||
bin/rails tests:migrations:check_database
|
|
483
.github/workflows/test-ruby.yml
vendored
483
.github/workflows/test-ruby.yml
vendored
|
@ -1,483 +0,0 @@
|
||||||
name: Ruby Testing
|
|
||||||
|
|
||||||
on:
|
|
||||||
merge_group:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'stable-*'
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
env:
|
|
||||||
BUNDLE_CLEAN: true
|
|
||||||
BUNDLE_FROZEN: true
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
mode:
|
|
||||||
- production
|
|
||||||
- test
|
|
||||||
env:
|
|
||||||
RAILS_ENV: ${{ matrix.mode }}
|
|
||||||
BUNDLE_WITH: ${{ matrix.mode }}
|
|
||||||
SECRET_KEY_BASE_DUMMY: 1
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
|
|
||||||
- name: Set up Javascript environment
|
|
||||||
uses: ./.github/actions/setup-javascript
|
|
||||||
with:
|
|
||||||
onlyProduction: 'true'
|
|
||||||
|
|
||||||
- name: Cache assets from compilation
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
public/assets
|
|
||||||
public/packs
|
|
||||||
public/packs-test
|
|
||||||
tmp/cache/vite
|
|
||||||
key: ${{ matrix.mode }}-assets-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ matrix.mode }}-assets-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
|
|
||||||
${{ matrix.mode }}-assets-${{ github.head_ref || github.ref_name }}
|
|
||||||
${{ matrix.mode }}-assets-main
|
|
||||||
${{ matrix.mode }}-assets
|
|
||||||
|
|
||||||
- name: Precompile assets
|
|
||||||
run: |-
|
|
||||||
bin/rails assets:precompile
|
|
||||||
|
|
||||||
- name: Archive asset artifacts
|
|
||||||
run: |
|
|
||||||
tar --exclude={"*.br","*.gz"} -zcf artifacts.tar.gz public/assets public/packs* tmp/cache/vite/last-build*.json
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
if: matrix.mode == 'test'
|
|
||||||
with:
|
|
||||||
path: |-
|
|
||||||
./artifacts.tar.gz
|
|
||||||
name: ${{ github.sha }}
|
|
||||||
retention-days: 0
|
|
||||||
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:14-alpine
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
options: >-
|
|
||||||
--health-cmd "redis-cli ping"
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
|
|
||||||
env:
|
|
||||||
DB_HOST: localhost
|
|
||||||
DB_USER: postgres
|
|
||||||
DB_PASS: postgres
|
|
||||||
COVERAGE: ${{ matrix.ruby-version == '.ruby-version' }}
|
|
||||||
RAILS_ENV: test
|
|
||||||
ALLOW_NOPAM: true
|
|
||||||
PAM_ENABLED: true
|
|
||||||
PAM_DEFAULT_SERVICE: pam_test
|
|
||||||
PAM_CONTROLLED_SERVICE: pam_test_controlled
|
|
||||||
OIDC_ENABLED: true
|
|
||||||
OIDC_SCOPE: read
|
|
||||||
SAML_ENABLED: true
|
|
||||||
CAS_ENABLED: true
|
|
||||||
BUNDLE_WITH: 'pam_authentication test'
|
|
||||||
GITHUB_RSPEC: ${{ matrix.ruby-version == '.ruby-version' && github.event.pull_request && 'true' }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
ruby-version:
|
|
||||||
- '3.2'
|
|
||||||
- '3.3'
|
|
||||||
- '.ruby-version'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: './'
|
|
||||||
name: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Expand archived asset artifacts
|
|
||||||
run: |
|
|
||||||
tar xvzf artifacts.tar.gz
|
|
||||||
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ matrix.ruby-version}}
|
|
||||||
additional-system-dependencies: ffmpeg libpam-dev
|
|
||||||
|
|
||||||
- name: Load database schema
|
|
||||||
run: |
|
|
||||||
bin/rails db:setup
|
|
||||||
bin/flatware fan bin/rails db:test:prepare
|
|
||||||
|
|
||||||
- name: Cache RSpec persistence file
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
tmp/rspec/examples.txt
|
|
||||||
key: rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }}-${{ matrix.ruby-version }}
|
|
||||||
rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
|
|
||||||
rspec-persistence-${{ github.head_ref || github.ref_name }}
|
|
||||||
rspec-persistence-main
|
|
||||||
rspec-persistence
|
|
||||||
|
|
||||||
- run: bin/flatware rspec -r ./spec/flatware_helper.rb
|
|
||||||
|
|
||||||
- name: Upload coverage reports to Codecov
|
|
||||||
if: matrix.ruby-version == '.ruby-version'
|
|
||||||
uses: codecov/codecov-action@v5
|
|
||||||
with:
|
|
||||||
files: coverage/lcov/*.lcov
|
|
||||||
env:
|
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
|
|
||||||
test-imagemagick:
|
|
||||||
name: ImageMagick tests
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:14-alpine
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
options: >-
|
|
||||||
--health-cmd "redis-cli ping"
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
|
|
||||||
env:
|
|
||||||
DB_HOST: localhost
|
|
||||||
DB_USER: postgres
|
|
||||||
DB_PASS: postgres
|
|
||||||
COVERAGE: ${{ matrix.ruby-version == '.ruby-version' }}
|
|
||||||
RAILS_ENV: test
|
|
||||||
ALLOW_NOPAM: true
|
|
||||||
PAM_ENABLED: true
|
|
||||||
PAM_DEFAULT_SERVICE: pam_test
|
|
||||||
PAM_CONTROLLED_SERVICE: pam_test_controlled
|
|
||||||
OIDC_ENABLED: true
|
|
||||||
OIDC_SCOPE: read
|
|
||||||
SAML_ENABLED: true
|
|
||||||
CAS_ENABLED: true
|
|
||||||
BUNDLE_WITH: 'pam_authentication test'
|
|
||||||
GITHUB_RSPEC: ${{ matrix.ruby-version == '.ruby-version' && github.event.pull_request && 'true' }}
|
|
||||||
MASTODON_USE_LIBVIPS: false
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
ruby-version:
|
|
||||||
- '3.2'
|
|
||||||
- '3.3'
|
|
||||||
- '.ruby-version'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: './'
|
|
||||||
name: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Expand archived asset artifacts
|
|
||||||
run: |
|
|
||||||
tar xvzf artifacts.tar.gz
|
|
||||||
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ matrix.ruby-version}}
|
|
||||||
additional-system-dependencies: ffmpeg imagemagick libpam-dev
|
|
||||||
|
|
||||||
- name: Load database schema
|
|
||||||
run: './bin/rails db:create db:schema:load db:seed'
|
|
||||||
|
|
||||||
- run: bin/rspec --tag attachment_processing
|
|
||||||
|
|
||||||
- name: Upload coverage reports to Codecov
|
|
||||||
if: matrix.ruby-version == '.ruby-version'
|
|
||||||
uses: codecov/codecov-action@v5
|
|
||||||
with:
|
|
||||||
files: coverage/lcov/mastodon.lcov
|
|
||||||
env:
|
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
|
|
||||||
test-e2e:
|
|
||||||
name: End to End testing
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:14-alpine
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
options: >-
|
|
||||||
--health-cmd "redis-cli ping"
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
|
|
||||||
env:
|
|
||||||
DB_HOST: localhost
|
|
||||||
DB_USER: postgres
|
|
||||||
DB_PASS: postgres
|
|
||||||
RAILS_ENV: test
|
|
||||||
BUNDLE_WITH: test
|
|
||||||
LOCAL_DOMAIN: localhost:3000
|
|
||||||
LOCAL_HTTPS: false
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
ruby-version:
|
|
||||||
- '3.2'
|
|
||||||
- '3.3'
|
|
||||||
- '.ruby-version'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: './'
|
|
||||||
name: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Expand archived asset artifacts
|
|
||||||
run: |
|
|
||||||
tar xvzf artifacts.tar.gz
|
|
||||||
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ matrix.ruby-version}}
|
|
||||||
additional-system-dependencies: ffmpeg
|
|
||||||
|
|
||||||
- name: Set up Javascript environment
|
|
||||||
uses: ./.github/actions/setup-javascript
|
|
||||||
|
|
||||||
- name: Load database schema
|
|
||||||
run: './bin/rails db:create db:schema:load db:seed'
|
|
||||||
|
|
||||||
- name: Cache Playwright Chromium browser
|
|
||||||
id: playwright-cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ~/.cache/ms-playwright
|
|
||||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
|
|
||||||
|
|
||||||
- name: Install Playwright Chromium browser (with deps)
|
|
||||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
|
||||||
run: yarn run playwright install --with-deps chromium
|
|
||||||
|
|
||||||
- name: Install Playwright Chromium browser deps
|
|
||||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
|
||||||
run: yarn run playwright install-deps chromium
|
|
||||||
|
|
||||||
- run: bin/rspec spec/system --tag streaming --tag js
|
|
||||||
|
|
||||||
- name: Archive logs
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
name: e2e-logs-${{ matrix.ruby-version }}
|
|
||||||
path: log/
|
|
||||||
|
|
||||||
- name: Archive test screenshots
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
name: e2e-screenshots-${{ matrix.ruby-version }}
|
|
||||||
path: tmp/capybara/
|
|
||||||
|
|
||||||
test-search:
|
|
||||||
name: Elastic Search integration testing
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:14-alpine
|
|
||||||
env:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
options: >-
|
|
||||||
--health-cmd "redis-cli ping"
|
|
||||||
--health-interval 10ms
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
|
|
||||||
elasticsearch:
|
|
||||||
image: ${{ contains(matrix.search-image, 'elasticsearch') && matrix.search-image || '' }}
|
|
||||||
env:
|
|
||||||
discovery.type: single-node
|
|
||||||
xpack.security.enabled: false
|
|
||||||
options: >-
|
|
||||||
--health-cmd "curl http://localhost:9200/_cluster/health"
|
|
||||||
--health-interval 2s
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 9200:9200
|
|
||||||
|
|
||||||
opensearch:
|
|
||||||
image: ${{ contains(matrix.search-image, 'opensearch') && matrix.search-image || '' }}
|
|
||||||
env:
|
|
||||||
discovery.type: single-node
|
|
||||||
DISABLE_INSTALL_DEMO_CONFIG: true
|
|
||||||
DISABLE_SECURITY_PLUGIN: true
|
|
||||||
options: >-
|
|
||||||
--health-cmd "curl http://localhost:9200/_cluster/health"
|
|
||||||
--health-interval 2s
|
|
||||||
--health-timeout 3s
|
|
||||||
--health-retries 50
|
|
||||||
ports:
|
|
||||||
- 9200:9200
|
|
||||||
|
|
||||||
env:
|
|
||||||
DB_HOST: localhost
|
|
||||||
DB_USER: postgres
|
|
||||||
DB_PASS: postgres
|
|
||||||
RAILS_ENV: test
|
|
||||||
BUNDLE_WITH: test
|
|
||||||
ES_ENABLED: true
|
|
||||||
ES_HOST: localhost
|
|
||||||
ES_PORT: 9200
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
ruby-version:
|
|
||||||
- '3.2'
|
|
||||||
- '3.3'
|
|
||||||
- '.ruby-version'
|
|
||||||
search-image:
|
|
||||||
- docker.elastic.co/elasticsearch/elasticsearch:7.17.13
|
|
||||||
include:
|
|
||||||
- ruby-version: '.ruby-version'
|
|
||||||
search-image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
|
|
||||||
- ruby-version: '.ruby-version'
|
|
||||||
search-image: opensearchproject/opensearch:2
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: './'
|
|
||||||
name: ${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Set up Ruby environment
|
|
||||||
uses: ./.github/actions/setup-ruby
|
|
||||||
with:
|
|
||||||
ruby-version: ${{ matrix.ruby-version}}
|
|
||||||
additional-system-dependencies: ffmpeg
|
|
||||||
|
|
||||||
- name: Set up Javascript environment
|
|
||||||
uses: ./.github/actions/setup-javascript
|
|
||||||
|
|
||||||
- name: Load database schema
|
|
||||||
run: './bin/rails db:create db:schema:load db:seed'
|
|
||||||
|
|
||||||
- run: bin/rspec --tag search
|
|
||||||
|
|
||||||
- name: Archive logs
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
name: test-search-logs-${{ matrix.ruby-version }}
|
|
||||||
path: log/
|
|
||||||
|
|
||||||
- name: Archive test screenshots
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
name: test-search-screenshots
|
|
||||||
path: tmp/capybara/
|
|
67
.gitignore
vendored
67
.gitignore
vendored
|
@ -4,77 +4,20 @@
|
||||||
# or operating system, you probably want to add a global ignore instead:
|
# or operating system, you probably want to add a global ignore instead:
|
||||||
# git config --global core.excludesfile '~/.gitignore_global'
|
# git config --global core.excludesfile '~/.gitignore_global'
|
||||||
|
|
||||||
# Ignore bundler config and downloaded libraries.
|
# Ignore bundler config.
|
||||||
/.bundle
|
/.bundle
|
||||||
/vendor/bundle
|
|
||||||
|
|
||||||
# Ignore the default SQLite database.
|
# Ignore the default SQLite database.
|
||||||
/db/*.sqlite3
|
/db/*.sqlite3
|
||||||
/db/*.sqlite3-journal
|
/db/*.sqlite3-journal
|
||||||
|
|
||||||
# Ignore all logfiles and tempfiles.
|
# Ignore all logfiles and tempfiles.
|
||||||
.eslintcache
|
|
||||||
/log/*
|
/log/*
|
||||||
!/log/.keep
|
!/log/.keep
|
||||||
/tmp
|
/tmp
|
||||||
/coverage
|
coverage
|
||||||
/public/system
|
public/system
|
||||||
/public/assets
|
public/assets
|
||||||
/public/packs
|
|
||||||
/public/packs-dev
|
|
||||||
/public/packs-test
|
|
||||||
.env
|
.env
|
||||||
.env.production
|
.env.*
|
||||||
node_modules/
|
node_modules/
|
||||||
/build/
|
|
||||||
|
|
||||||
# Ignore Vagrant files
|
|
||||||
.vagrant/
|
|
||||||
|
|
||||||
# Ignore IDE files
|
|
||||||
.vscode/
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# Ignore postgres + redis + elasticsearch volume optionally created by docker-compose
|
|
||||||
/postgres
|
|
||||||
/postgres14
|
|
||||||
/redis
|
|
||||||
/elasticsearch
|
|
||||||
|
|
||||||
# Ignore Apple files
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Ignore vim files
|
|
||||||
*~
|
|
||||||
*.swp
|
|
||||||
|
|
||||||
# Ignore npm debug log
|
|
||||||
npm-debug.log
|
|
||||||
|
|
||||||
# Ignore yarn log files
|
|
||||||
yarn-error.log
|
|
||||||
yarn-debug.log
|
|
||||||
|
|
||||||
# From https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
|
|
||||||
.pnp.*
|
|
||||||
.yarn/*
|
|
||||||
!.yarn/patches
|
|
||||||
!.yarn/plugins
|
|
||||||
!.yarn/releases
|
|
||||||
!.yarn/sdks
|
|
||||||
!.yarn/versions
|
|
||||||
|
|
||||||
# Ignore vagrant log files
|
|
||||||
*-cloudimg-console.log
|
|
||||||
|
|
||||||
# Ignore Docker option files
|
|
||||||
docker-compose.override.yml
|
|
||||||
|
|
||||||
# Ignore dotenv .local files
|
|
||||||
.env*.local
|
|
||||||
|
|
||||||
# Ignore local-only rspec configuration
|
|
||||||
.rspec-local
|
|
||||||
|
|
||||||
*storybook.log
|
|
||||||
storybook-static
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
exclude:
|
|
||||||
- 'vendor/**/*'
|
|
||||||
|
|
||||||
require:
|
|
||||||
- ./lib/linter/haml_middle_dot.rb
|
|
||||||
|
|
||||||
linters:
|
|
||||||
AltText:
|
|
||||||
enabled: true
|
|
||||||
MiddleDot:
|
|
||||||
enabled: true
|
|
||||||
LineLength:
|
|
||||||
max: 300
|
|
||||||
ViewLength:
|
|
||||||
max: 200 # Override default value of 100 inherited from rubocop
|
|
|
@ -1 +0,0 @@
|
||||||
yarn lint-staged
|
|
|
@ -1,83 +0,0 @@
|
||||||
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
|
||||||
#
|
|
||||||
# If you find yourself ignoring temporary files generated by your text editor
|
|
||||||
# or operating system, you probably want to add a global ignore instead:
|
|
||||||
# git config --global core.excludesfile '~/.gitignore_global'
|
|
||||||
|
|
||||||
# Ignore bundler config and downloaded libraries.
|
|
||||||
/.bundle
|
|
||||||
/vendor/bundle
|
|
||||||
|
|
||||||
# Ignore the default SQLite database.
|
|
||||||
/db/*.sqlite3
|
|
||||||
/db/*.sqlite3-journal
|
|
||||||
|
|
||||||
# Ignore all logfiles and tempfiles.
|
|
||||||
.eslintcache
|
|
||||||
/log/*
|
|
||||||
!/log/.keep
|
|
||||||
/tmp
|
|
||||||
/coverage
|
|
||||||
.env
|
|
||||||
.env.production
|
|
||||||
.env.development
|
|
||||||
/node_modules/
|
|
||||||
/build/
|
|
||||||
|
|
||||||
# Ignore Vagrant files
|
|
||||||
.vagrant/
|
|
||||||
|
|
||||||
# Ignore IDE files
|
|
||||||
.vscode/
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# Ignore postgres + redis + elasticsearch volume optionally created by docker-compose
|
|
||||||
/postgres
|
|
||||||
/postgres14
|
|
||||||
/redis
|
|
||||||
/elasticsearch
|
|
||||||
|
|
||||||
# Ignore Apple files
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Ignore vim files
|
|
||||||
*~
|
|
||||||
*.swp
|
|
||||||
|
|
||||||
# Ignore log files
|
|
||||||
*.log
|
|
||||||
|
|
||||||
# Ignore Docker option files
|
|
||||||
docker-compose.override.yml
|
|
||||||
|
|
||||||
# Ignore public
|
|
||||||
/public/assets
|
|
||||||
/public/emoji
|
|
||||||
/public/packs
|
|
||||||
/public/packs-test
|
|
||||||
/public/system
|
|
||||||
/public/vite*
|
|
||||||
|
|
||||||
# Ignore emoji map file
|
|
||||||
/app/javascript/mastodon/features/emoji/emoji_map.json
|
|
||||||
/app/javascript/mastodon/features/emoji/emoji_data.json
|
|
||||||
|
|
||||||
# Ignore locale files
|
|
||||||
/app/javascript/mastodon/locales/*.json
|
|
||||||
/config/locales
|
|
||||||
|
|
||||||
# Ignore vendored CSS reset
|
|
||||||
app/javascript/styles/mastodon/reset.scss
|
|
||||||
|
|
||||||
# Ignore Javascript pending https://github.com/mastodon/mastodon/pull/23631
|
|
||||||
*.js
|
|
||||||
*.jsx
|
|
||||||
|
|
||||||
# Ignore HTML till cleaned and included in CI
|
|
||||||
*.html
|
|
||||||
|
|
||||||
# Ignore the generated AUTHORS.md
|
|
||||||
AUTHORS.md
|
|
||||||
|
|
||||||
# Process a few selected JS files
|
|
||||||
!lint-staged.config.js
|
|
|
@ -1,4 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
singleQuote: true,
|
|
||||||
jsxSingleQuote: true
|
|
||||||
};
|
|
1
.rspec
1
.rspec
|
@ -1,2 +1,3 @@
|
||||||
--color
|
--color
|
||||||
--require spec_helper
|
--require spec_helper
|
||||||
|
--format Fuubar
|
||||||
|
|
44
.rubocop.yml
44
.rubocop.yml
|
@ -1,36 +1,14 @@
|
||||||
---
|
Rails:
|
||||||
AllCops:
|
Enabled: true
|
||||||
CacheRootDirectory: tmp
|
|
||||||
DisplayStyleGuide: true
|
|
||||||
Exclude:
|
|
||||||
- Vagrantfile
|
|
||||||
- config/initializers/json_ld*
|
|
||||||
- lib/mastodon/migration_helpers.rb
|
|
||||||
ExtraDetails: true
|
|
||||||
NewCops: enable
|
|
||||||
TargetRubyVersion: 3.2 # Oldest supported ruby version
|
|
||||||
|
|
||||||
inherit_from:
|
Metrics/LineLength:
|
||||||
- .rubocop/layout.yml
|
Enabled: false
|
||||||
- .rubocop/metrics.yml
|
|
||||||
- .rubocop/naming.yml
|
|
||||||
- .rubocop/rails.yml
|
|
||||||
- .rubocop/rspec_rails.yml
|
|
||||||
- .rubocop/rspec.yml
|
|
||||||
- .rubocop/style.yml
|
|
||||||
- .rubocop/i18n.yml
|
|
||||||
- .rubocop/custom.yml
|
|
||||||
- .rubocop_todo.yml
|
|
||||||
- .rubocop/strict.yml
|
|
||||||
|
|
||||||
inherit_mode:
|
Style/PerlBackrefs:
|
||||||
merge:
|
AutoCorrect: false
|
||||||
- Exclude
|
|
||||||
|
|
||||||
plugins:
|
Style/ClassAndModuleChildren:
|
||||||
- rubocop-capybara
|
Enabled: false
|
||||||
- rubocop-i18n
|
|
||||||
- rubocop-performance
|
Documentation:
|
||||||
- rubocop-rails
|
Enabled: false
|
||||||
- rubocop-rspec
|
|
||||||
- rubocop-rspec_rails
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
require:
|
|
||||||
- ../lib/linter/rubocop_middle_dot
|
|
||||||
|
|
||||||
Style/MiddleDot:
|
|
||||||
Enabled: true
|
|
|
@ -1,12 +0,0 @@
|
||||||
I18n/RailsI18n:
|
|
||||||
Enabled: true
|
|
||||||
Exclude:
|
|
||||||
- 'config/**/*'
|
|
||||||
- 'db/**/*'
|
|
||||||
- 'lib/**/*'
|
|
||||||
- 'spec/**/*'
|
|
||||||
I18n/GetText:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
I18n/RailsI18n/DecorateStringFormattingUsingInterpolation:
|
|
||||||
Enabled: false
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
Layout/FirstHashElementIndentation:
|
|
||||||
EnforcedStyle: consistent
|
|
||||||
|
|
||||||
Layout/LineLength:
|
|
||||||
Max: 300 # Default of 120 causes a duplicate entry in generated todo file
|
|
|
@ -1,23 +0,0 @@
|
||||||
---
|
|
||||||
Metrics/AbcSize:
|
|
||||||
Exclude:
|
|
||||||
- lib/mastodon/cli/*.rb
|
|
||||||
|
|
||||||
Metrics/BlockLength:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Metrics/ClassLength:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Metrics/CyclomaticComplexity:
|
|
||||||
Exclude:
|
|
||||||
- lib/mastodon/cli/*.rb
|
|
||||||
|
|
||||||
Metrics/MethodLength:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Metrics/ModuleLength:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Metrics/ParameterLists:
|
|
||||||
CountKeywordArgs: false
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
Naming/BlockForwarding:
|
|
||||||
EnforcedStyle: explicit
|
|
||||||
|
|
||||||
Naming/PredicateMethod:
|
|
||||||
Enabled: false
|
|
|
@ -1,26 +0,0 @@
|
||||||
---
|
|
||||||
Rails/BulkChangeTable:
|
|
||||||
Enabled: false # Conflicts with strong_migrations features
|
|
||||||
|
|
||||||
Rails/Delegate:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Rails/FilePath:
|
|
||||||
EnforcedStyle: arguments
|
|
||||||
|
|
||||||
Rails/HttpStatus:
|
|
||||||
EnforcedStyle: numeric
|
|
||||||
|
|
||||||
Rails/NegateInclude:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Rails/RakeEnvironment:
|
|
||||||
Exclude: # Tasks are doing local work which do not need full env loaded
|
|
||||||
- lib/tasks/auto_annotate_models.rake
|
|
||||||
- lib/tasks/emojis.rake
|
|
||||||
- lib/tasks/mastodon.rake
|
|
||||||
- lib/tasks/repo.rake
|
|
||||||
- lib/tasks/statistics.rake
|
|
||||||
|
|
||||||
Rails/SkipsModelValidations:
|
|
||||||
Enabled: false
|
|
|
@ -1,27 +0,0 @@
|
||||||
---
|
|
||||||
RSpec/ExampleLength:
|
|
||||||
CountAsOne: ['array', 'heredoc', 'method_call']
|
|
||||||
Max: 20 # Override default of 5
|
|
||||||
|
|
||||||
RSpec/MultipleExpectations:
|
|
||||||
Max: 10 # Overrides default of 1
|
|
||||||
|
|
||||||
RSpec/MultipleMemoizedHelpers:
|
|
||||||
Max: 20 # Overrides default of 5
|
|
||||||
|
|
||||||
RSpec/NamedSubject:
|
|
||||||
EnforcedStyle: named_only
|
|
||||||
|
|
||||||
RSpec/NestedGroups:
|
|
||||||
Max: 10 # Overrides default of 3
|
|
||||||
|
|
||||||
RSpec/NotToNot:
|
|
||||||
EnforcedStyle: to_not
|
|
||||||
|
|
||||||
RSpec/SpecFilePathFormat:
|
|
||||||
CustomTransform:
|
|
||||||
ActivityPub: activitypub
|
|
||||||
DeepL: deepl
|
|
||||||
FetchOEmbedService: fetch_oembed_service
|
|
||||||
OEmbedController: oembed_controller
|
|
||||||
OStatus: ostatus
|
|
|
@ -1,3 +0,0 @@
|
||||||
---
|
|
||||||
RSpecRails/HttpStatus:
|
|
||||||
EnforcedStyle: numeric
|
|
|
@ -1,24 +0,0 @@
|
||||||
Lint/Debugger: # Remove any `binding.pry`
|
|
||||||
Enabled: true
|
|
||||||
Exclude: []
|
|
||||||
|
|
||||||
RSpec/Focus: # Require full spec run on CI
|
|
||||||
Enabled: true
|
|
||||||
Exclude: []
|
|
||||||
|
|
||||||
Rails/Output: # Remove any `puts` debugging
|
|
||||||
inherit_mode:
|
|
||||||
merge:
|
|
||||||
- Include
|
|
||||||
Enabled: true
|
|
||||||
Exclude: []
|
|
||||||
Include:
|
|
||||||
- spec/**/*.rb
|
|
||||||
|
|
||||||
Rails/FindEach: # Using `each` could impact performance, use `find_each`
|
|
||||||
Enabled: true
|
|
||||||
Exclude: []
|
|
||||||
|
|
||||||
Rails/UniqBeforePluck: # Require `uniq.pluck` and not `pluck.uniq`
|
|
||||||
Enabled: true
|
|
||||||
Exclude: []
|
|
|
@ -1,63 +0,0 @@
|
||||||
---
|
|
||||||
Style/ArrayIntersect:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/ClassAndModuleChildren:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/Documentation:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/FormatStringToken:
|
|
||||||
AllowedMethods:
|
|
||||||
- redirect_with_vary # Route redirects are not token-formatted
|
|
||||||
inherit_mode:
|
|
||||||
merge:
|
|
||||||
- AllowedMethods
|
|
||||||
|
|
||||||
Style/HashAsLastArrayItem:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/HashSyntax:
|
|
||||||
EnforcedShorthandSyntax: either
|
|
||||||
EnforcedStyle: ruby19_no_mixed_keys
|
|
||||||
|
|
||||||
Style/IfUnlessModifier:
|
|
||||||
Exclude:
|
|
||||||
- '**/*.haml'
|
|
||||||
|
|
||||||
Style/KeywordArgumentsMerging:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/NumericLiterals:
|
|
||||||
AllowedPatterns:
|
|
||||||
- \d{4}_\d{2}_\d{2}_\d{6}
|
|
||||||
|
|
||||||
Style/PercentLiteralDelimiters:
|
|
||||||
PreferredDelimiters:
|
|
||||||
'%i': ()
|
|
||||||
'%w': ()
|
|
||||||
|
|
||||||
Style/RedundantBegin:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/RedundantFetchBlock:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/RescueStandardError:
|
|
||||||
EnforcedStyle: implicit
|
|
||||||
|
|
||||||
Style/SafeNavigationChainLength:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/SymbolArray:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/TrailingCommaInArrayLiteral:
|
|
||||||
EnforcedStyleForMultiline: comma
|
|
||||||
|
|
||||||
Style/TrailingCommaInHashLiteral:
|
|
||||||
EnforcedStyleForMultiline: comma
|
|
||||||
|
|
||||||
Style/WordArray:
|
|
||||||
MinSize: 3 # Override default of 2
|
|
|
@ -1,39 +0,0 @@
|
||||||
# This configuration was generated by
|
|
||||||
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-offense-counts --no-auto-gen-timestamp`
|
|
||||||
# using RuboCop version 1.76.1.
|
|
||||||
# The point is for the user to remove these configuration records
|
|
||||||
# one by one as the offenses are removed from the code base.
|
|
||||||
# Note that changes in the inspected code, or installation of new
|
|
||||||
# versions of RuboCop, may require this file to be generated again.
|
|
||||||
|
|
||||||
Lint/NonLocalExitFromIterator:
|
|
||||||
Exclude:
|
|
||||||
- 'app/helpers/json_ld_helper.rb'
|
|
||||||
|
|
||||||
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
||||||
Metrics/AbcSize:
|
|
||||||
Max: 82
|
|
||||||
|
|
||||||
# Configuration parameters: CountBlocks, CountModifierForms, Max.
|
|
||||||
Metrics/BlockNesting:
|
|
||||||
Exclude:
|
|
||||||
- 'lib/tasks/mastodon.rake'
|
|
||||||
|
|
||||||
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
||||||
Metrics/CyclomaticComplexity:
|
|
||||||
Max: 25
|
|
||||||
|
|
||||||
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
||||||
Metrics/PerceivedComplexity:
|
|
||||||
Max: 27
|
|
||||||
|
|
||||||
# This cop supports safe autocorrection (--autocorrect).
|
|
||||||
# Configuration parameters: AllowedVars.
|
|
||||||
Style/FetchEnvVar:
|
|
||||||
Exclude:
|
|
||||||
- 'config/initializers/paperclip.rb'
|
|
||||||
|
|
||||||
# This cop supports safe autocorrection (--autocorrect).
|
|
||||||
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
|
|
||||||
Style/GuardClause:
|
|
||||||
Enabled: false
|
|
|
@ -1 +0,0 @@
|
||||||
mastodon
|
|
|
@ -1 +1 @@
|
||||||
3.4.4
|
ruby-2.2.4
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
node_modules/
|
|
||||||
.cache/
|
|
||||||
docs/
|
|
||||||
spec/
|
|
|
@ -1,16 +0,0 @@
|
||||||
import type { StorybookConfig } from '@storybook/react-vite';
|
|
||||||
|
|
||||||
const config: StorybookConfig = {
|
|
||||||
stories: ['../app/javascript/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
||||||
addons: [
|
|
||||||
'@storybook/addon-docs',
|
|
||||||
'@storybook/addon-a11y',
|
|
||||||
'@storybook/addon-vitest',
|
|
||||||
],
|
|
||||||
framework: {
|
|
||||||
name: '@storybook/react-vite',
|
|
||||||
options: {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
|
@ -1,7 +0,0 @@
|
||||||
import { addons } from 'storybook/manager-api';
|
|
||||||
|
|
||||||
import theme from './storybook-theme';
|
|
||||||
|
|
||||||
addons.setConfig({
|
|
||||||
theme,
|
|
||||||
});
|
|
|
@ -1,18 +0,0 @@
|
||||||
<style>
|
|
||||||
/* Increase docs font size */
|
|
||||||
.sbdocs.sbdocs-content :where(p:not(.sb-anchor, .sb-unstyled, .sb-unstyled p)),
|
|
||||||
.sbdocs.sbdocs-content :where(li:not(.sb-anchor, .sb-unstyled, .sb-unstyled li)) {
|
|
||||||
font-size: 1.0666rem; /* 17px */
|
|
||||||
line-height: 1.585; /* 27px */
|
|
||||||
}
|
|
||||||
|
|
||||||
.sbdocs.sbdocs-content :where(p:not(.sb-anchor, .sb-unstyled, .sb-unstyled p)) code,
|
|
||||||
.sbdocs.sbdocs-content :where(li:not(.sb-anchor, .sb-unstyled, .sb-unstyled li)) code {
|
|
||||||
font-size: 0.875rem; /* ~15px */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Bring numbers back for ordered lists */
|
|
||||||
ol {
|
|
||||||
list-style: revert !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,29 +0,0 @@
|
||||||
import type { Preview } from '@storybook/react-vite';
|
|
||||||
|
|
||||||
// If you want to run the dark theme during development,
|
|
||||||
// you can change the below to `/application.scss`
|
|
||||||
import '../app/javascript/styles/mastodon-light.scss';
|
|
||||||
|
|
||||||
const preview: Preview = {
|
|
||||||
// Auto-generate docs: https://storybook.js.org/docs/writing-docs/autodocs
|
|
||||||
tags: ['autodocs'],
|
|
||||||
parameters: {
|
|
||||||
layout: 'centered',
|
|
||||||
|
|
||||||
controls: {
|
|
||||||
matchers: {
|
|
||||||
color: /(background|color)$/i,
|
|
||||||
date: /Date$/i,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
a11y: {
|
|
||||||
// 'todo' - show a11y violations in the test UI only
|
|
||||||
// 'error' - fail CI on a11y violations
|
|
||||||
// 'off' - skip a11y checks entirely
|
|
||||||
test: 'todo',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default preview;
|
|
7
.storybook/storybook-addon-vitest.d.ts
vendored
7
.storybook/storybook-addon-vitest.d.ts
vendored
|
@ -1,7 +0,0 @@
|
||||||
// The addon package.json incorrectly exports types, so we need to override them here.
|
|
||||||
// See: https://github.com/storybookjs/storybook/blob/v9.0.4/code/addons/vitest/package.json#L70-L76
|
|
||||||
declare module '@storybook/addon-vitest/vitest-plugin' {
|
|
||||||
export * from '@storybook/addon-vitest/dist/vitest-plugin/index';
|
|
||||||
}
|
|
||||||
|
|
||||||
export {};
|
|
|
@ -1,7 +0,0 @@
|
||||||
import { create } from 'storybook/theming';
|
|
||||||
|
|
||||||
export default create({
|
|
||||||
base: 'light',
|
|
||||||
brandTitle: 'Mastodon Storybook',
|
|
||||||
brandImage: 'https://joinmastodon.org/logos/wordmark-black-text.svg',
|
|
||||||
});
|
|
|
@ -1,8 +0,0 @@
|
||||||
import * as a11yAddonAnnotations from '@storybook/addon-a11y/preview';
|
|
||||||
import { setProjectAnnotations } from '@storybook/react-vite';
|
|
||||||
|
|
||||||
import * as projectAnnotations from './preview';
|
|
||||||
|
|
||||||
// This is an important step to apply the right configuration when testing your stories.
|
|
||||||
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
|
|
||||||
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
|
|
29
.travis.yml
Normal file
29
.travis.yml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
language: ruby
|
||||||
|
cache: bundler
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- LOCAL_DOMAIN=cb6e6126.ngrok.io
|
||||||
|
- LOCAL_HTTPS=true
|
||||||
|
- RAILS_ENV=test
|
||||||
|
|
||||||
|
addons:
|
||||||
|
postgresql: 9.4
|
||||||
|
|
||||||
|
rvm:
|
||||||
|
- 2.2.4
|
||||||
|
|
||||||
|
services:
|
||||||
|
- redis-server
|
||||||
|
|
||||||
|
bundler_args: --without development production --retry=3 --jobs=3
|
||||||
|
|
||||||
|
install:
|
||||||
|
- npm install -g npm@2
|
||||||
|
- npm install
|
||||||
|
- bundle install
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- bundle exec rails db:create db:migrate
|
||||||
|
|
||||||
|
script: bundle exec rspec
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"ignore_dirs": ["node_modules/", "public/"]
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
diff --git a/lib/index.js b/lib/index.js
|
|
||||||
index 16ed6be8be8f555cc99096c2ff60954b42dc313d..d009c069770d066ad0db7ad02de1ea473a29334e 100644
|
|
||||||
--- a/lib/index.js
|
|
||||||
+++ b/lib/index.js
|
|
||||||
@@ -99,7 +99,7 @@ function lodash(_ref) {
|
|
||||||
|
|
||||||
var node = _ref3;
|
|
||||||
|
|
||||||
- if ((0, _types.isModuleDeclaration)(node)) {
|
|
||||||
+ if ((0, _types.isImportDeclaration)(node) || (0, _types.isExportDeclaration)(node)) {
|
|
||||||
isModule = true;
|
|
||||||
break;
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
nodeLinker: node-modules
|
|
1889
AUTHORS.md
1889
AUTHORS.md
File diff suppressed because it is too large
Load Diff
5
Aptfile
5
Aptfile
|
@ -1,5 +0,0 @@
|
||||||
libidn12
|
|
||||||
# for idn-ruby on heroku-24 stack
|
|
||||||
|
|
||||||
# use https://github.com/heroku/heroku-buildpack-activestorage-preview
|
|
||||||
# in place for ffmpeg and its dependent packages to reduce slag size
|
|
1995
CHANGELOG.md
1995
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
|
@ -1,132 +0,0 @@
|
||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
## Our Pledge
|
|
||||||
|
|
||||||
We as members, contributors, and leaders pledge to make participation in our
|
|
||||||
community a harassment-free experience for everyone, regardless of age, body
|
|
||||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
||||||
identity and expression, level of experience, education, socio-economic status,
|
|
||||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
||||||
identity and orientation.
|
|
||||||
|
|
||||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
||||||
diverse, inclusive, and healthy community.
|
|
||||||
|
|
||||||
## Our Standards
|
|
||||||
|
|
||||||
Examples of behavior that contributes to a positive environment for our
|
|
||||||
community include:
|
|
||||||
|
|
||||||
- Demonstrating empathy and kindness toward other people
|
|
||||||
- Being respectful of differing opinions, viewpoints, and experiences
|
|
||||||
- Giving and gracefully accepting constructive feedback
|
|
||||||
- Accepting responsibility and apologizing to those affected by our mistakes,
|
|
||||||
and learning from the experience
|
|
||||||
- Focusing on what is best not just for us as individuals, but for the overall
|
|
||||||
community
|
|
||||||
|
|
||||||
Examples of unacceptable behavior include:
|
|
||||||
|
|
||||||
- The use of sexualized language or imagery, and sexual attention or advances of
|
|
||||||
any kind
|
|
||||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
||||||
- Public or private harassment
|
|
||||||
- Publishing others' private information, such as a physical or email address,
|
|
||||||
without their explicit permission
|
|
||||||
- Other conduct which could reasonably be considered inappropriate in a
|
|
||||||
professional setting
|
|
||||||
|
|
||||||
## Enforcement Responsibilities
|
|
||||||
|
|
||||||
Community leaders are responsible for clarifying and enforcing our standards of
|
|
||||||
acceptable behavior and will take appropriate and fair corrective action in
|
|
||||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
||||||
or harmful.
|
|
||||||
|
|
||||||
Community leaders have the right and responsibility to remove, edit, or reject
|
|
||||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
||||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
||||||
decisions when appropriate.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies within all community spaces, and also applies when
|
|
||||||
an individual is officially representing the community in public spaces.
|
|
||||||
Examples of representing our community include using an official e-mail address,
|
|
||||||
posting via an official social media account, or acting as an appointed
|
|
||||||
representative at an online or offline event.
|
|
||||||
|
|
||||||
## Enforcement
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
||||||
reported to the community leaders responsible for enforcement at
|
|
||||||
[hello@joinmastodon.org](mailto:hello@joinmastodon.org).
|
|
||||||
All complaints will be reviewed and investigated promptly and fairly.
|
|
||||||
|
|
||||||
All community leaders are obligated to respect the privacy and security of the
|
|
||||||
reporter of any incident.
|
|
||||||
|
|
||||||
## Enforcement Guidelines
|
|
||||||
|
|
||||||
Community leaders will follow these Community Impact Guidelines in determining
|
|
||||||
the consequences for any action they deem in violation of this Code of Conduct:
|
|
||||||
|
|
||||||
### 1. Correction
|
|
||||||
|
|
||||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
||||||
unprofessional or unwelcome in the community.
|
|
||||||
|
|
||||||
**Consequence**: A private, written warning from community leaders, providing
|
|
||||||
clarity around the nature of the violation and an explanation of why the
|
|
||||||
behavior was inappropriate. A public apology may be requested.
|
|
||||||
|
|
||||||
### 2. Warning
|
|
||||||
|
|
||||||
**Community Impact**: A violation through a single incident or series of
|
|
||||||
actions.
|
|
||||||
|
|
||||||
**Consequence**: A warning with consequences for continued behavior. No
|
|
||||||
interaction with the people involved, including unsolicited interaction with
|
|
||||||
those enforcing the Code of Conduct, for a specified period of time. This
|
|
||||||
includes avoiding interactions in community spaces as well as external channels
|
|
||||||
like social media. Violating these terms may lead to a temporary or permanent
|
|
||||||
ban.
|
|
||||||
|
|
||||||
### 3. Temporary Ban
|
|
||||||
|
|
||||||
**Community Impact**: A serious violation of community standards, including
|
|
||||||
sustained inappropriate behavior.
|
|
||||||
|
|
||||||
**Consequence**: A temporary ban from any sort of interaction or public
|
|
||||||
communication with the community for a specified period of time. No public or
|
|
||||||
private interaction with the people involved, including unsolicited interaction
|
|
||||||
with those enforcing the Code of Conduct, is allowed during this period.
|
|
||||||
Violating these terms may lead to a permanent ban.
|
|
||||||
|
|
||||||
### 4. Permanent Ban
|
|
||||||
|
|
||||||
**Community Impact**: Demonstrating a pattern of violation of community
|
|
||||||
standards, including sustained inappropriate behavior, harassment of an
|
|
||||||
individual, or aggression toward or disparagement of classes of individuals.
|
|
||||||
|
|
||||||
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
||||||
community.
|
|
||||||
|
|
||||||
## Attribution
|
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
||||||
version 2.1, available at
|
|
||||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
||||||
|
|
||||||
Community Impact Guidelines were inspired by
|
|
||||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
||||||
|
|
||||||
For answers to common questions about this code of conduct, see the FAQ at
|
|
||||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
||||||
[https://www.contributor-covenant.org/translations][translations].
|
|
||||||
|
|
||||||
[homepage]: https://www.contributor-covenant.org
|
|
||||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
||||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
||||||
[FAQ]: https://www.contributor-covenant.org/faq
|
|
||||||
[translations]: https://www.contributor-covenant.org/translations
|
|
|
@ -1,91 +0,0 @@
|
||||||
# Contributing
|
|
||||||
|
|
||||||
Thank you for considering contributing to Mastodon 🐘
|
|
||||||
|
|
||||||
You can contribute in the following ways:
|
|
||||||
|
|
||||||
- Finding and reporting bugs
|
|
||||||
- Translating the Mastodon interface into various languages
|
|
||||||
- Contributing code to Mastodon by fixing bugs or implementing features
|
|
||||||
- Improving the documentation
|
|
||||||
|
|
||||||
Please review the org-level [contribution guidelines] for high-level acceptance
|
|
||||||
criteria guidance and the [DEVELOPMENT] guide for environment-specific details.
|
|
||||||
|
|
||||||
## API Changes and Additions
|
|
||||||
|
|
||||||
Any changes or additions made to the API should have an accompanying pull
|
|
||||||
request on our [documentation repository].
|
|
||||||
|
|
||||||
## Bug Reports
|
|
||||||
|
|
||||||
Bug reports and feature suggestions must use descriptive and concise titles and
|
|
||||||
be submitted to [GitHub Issues]. Please use the search function to make sure
|
|
||||||
there are not duplicate bug reports or feature requests.
|
|
||||||
|
|
||||||
## Security Issues
|
|
||||||
|
|
||||||
If you believe you have identified a security issue in Mastodon or our own apps,
|
|
||||||
check [SECURITY].
|
|
||||||
|
|
||||||
## Translations
|
|
||||||
|
|
||||||
Translations are community contributed via [Crowdin]. They are periodically
|
|
||||||
reviewed and merged into the codebase.
|
|
||||||
|
|
||||||
[](https://crowdin.com/project/mastodon)
|
|
||||||
|
|
||||||
## Pull Requests
|
|
||||||
|
|
||||||
### Size and Scope
|
|
||||||
|
|
||||||
Our time is limited and PRs making large, unsolicited changes are unlikely to
|
|
||||||
get a response. Changes which link to an existing confirmed issue, or which come
|
|
||||||
from a "help wanted" issue or other request are more likely to be reviewed.
|
|
||||||
|
|
||||||
The smaller and more narrowly focused the changes in a PR are, the easier they
|
|
||||||
are to review and potentially merge. If the change only makes sense in some
|
|
||||||
larger context of future ongoing work, note that in the description, but still
|
|
||||||
aim to keep each distinct PR to a "smallest viable change" chunk of work.
|
|
||||||
|
|
||||||
### Description of Changes
|
|
||||||
|
|
||||||
Unless the Pull Request is about refactoring code, updating dependencies or
|
|
||||||
other internal tasks, assume that the audience are not developers, but a
|
|
||||||
Mastodon user or server admin, and try to describe it from their perspective.
|
|
||||||
|
|
||||||
The final commit in the main branch will carry the title from the PR. The main
|
|
||||||
branch is then fed into the changelog and ultimately into release notes. We try
|
|
||||||
to follow the [keepachangelog] spec, and while that does not prescribe how
|
|
||||||
exactly the entries ought to be named, starting titles using one of the verbs
|
|
||||||
"Add", "Change", "Deprecate", "Remove", or "Fix" (present tense) is helpful.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
| Not ideal | Better |
|
|
||||||
| ------------------------------------ | ------------------------------------------------------------- |
|
|
||||||
| Fixed NoMethodError in RemovalWorker | Fix nil error when removing statuses caused by race condition |
|
|
||||||
|
|
||||||
### Technical Requirements
|
|
||||||
|
|
||||||
Pull requests that do not pass automated checks on CI may not be reviewed. In
|
|
||||||
particular, please keep in mind:
|
|
||||||
|
|
||||||
- Unit and integration tests (rspec, vitest)
|
|
||||||
- Code style rules (rubocop, eslint)
|
|
||||||
- Normalization of locale files (i18n-tasks)
|
|
||||||
- Relevant accessibility or performance concerns
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
The [Mastodon documentation] is a statically generated site that contains guides
|
|
||||||
and API docs. Improvements are made via PRs to the [documentation repository].
|
|
||||||
|
|
||||||
[contribution guidelines]: https://github.com/mastodon/.github/blob/main/CONTRIBUTING.md
|
|
||||||
[Crowdin]: https://crowdin.com/project/mastodon
|
|
||||||
[DEVELOPMENT]: docs/DEVELOPMENT.md
|
|
||||||
[documentation repository]: https://github.com/mastodon/documentation
|
|
||||||
[GitHub Issues]: https://github.com/mastodon/mastodon/issues
|
|
||||||
[keepachangelog]: https://keepachangelog.com/en/1.0.0/
|
|
||||||
[Mastodon documentation]: https://docs.joinmastodon.org
|
|
||||||
[SECURITY]: SECURITY.md
|
|
410
Dockerfile
410
Dockerfile
|
@ -1,404 +1,20 @@
|
||||||
# syntax=docker/dockerfile:1.12
|
FROM ruby:2.2.4
|
||||||
|
|
||||||
# This file is designed for production server deployment, not local development work
|
ENV RAILS_ENV=production
|
||||||
# For a containerized local dev environment, see: https://github.com/mastodon/mastodon/blob/main/docs/DEVELOPMENT.md#docker
|
|
||||||
|
|
||||||
# Please see https://docs.docker.com/engine/reference/builder for information about
|
RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main contrib non-free' >> /etc/apt/sources.list
|
||||||
# the extended buildx capabilities used in this file.
|
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev libxml2-dev libxslt1-dev nodejs nodejs-legacy npm ffmpeg && rm -rf /var/lib/apt/lists/*
|
||||||
# Make sure multiarch TARGETPLATFORM is available for interpolation
|
RUN mkdir /mastodon
|
||||||
# See: https://docs.docker.com/build/building/multi-platform/
|
|
||||||
ARG TARGETPLATFORM=${TARGETPLATFORM}
|
|
||||||
ARG BUILDPLATFORM=${BUILDPLATFORM}
|
|
||||||
ARG BASE_REGISTRY="docker.io"
|
|
||||||
|
|
||||||
# Ruby image to use for base image, change with [--build-arg RUBY_VERSION="3.4.x"]
|
WORKDIR /mastodon
|
||||||
# renovate: datasource=docker depName=docker.io/ruby
|
|
||||||
ARG RUBY_VERSION="3.4.4"
|
|
||||||
# # Node.js version to use in base image, change with [--build-arg NODE_MAJOR_VERSION="20"]
|
|
||||||
# renovate: datasource=node-version depName=node
|
|
||||||
ARG NODE_MAJOR_VERSION="22"
|
|
||||||
# Debian image to use for base image, change with [--build-arg DEBIAN_VERSION="bookworm"]
|
|
||||||
ARG DEBIAN_VERSION="bookworm"
|
|
||||||
# Node.js image to use for base image based on combined variables (ex: 20-bookworm-slim)
|
|
||||||
FROM ${BASE_REGISTRY}/node:${NODE_MAJOR_VERSION}-${DEBIAN_VERSION}-slim AS node
|
|
||||||
# Ruby image to use for base image based on combined variables (ex: 3.4.x-slim-bookworm)
|
|
||||||
FROM ${BASE_REGISTRY}/ruby:${RUBY_VERSION}-slim-${DEBIAN_VERSION} AS ruby
|
|
||||||
|
|
||||||
# Resulting version string is vX.X.X-MASTODON_VERSION_PRERELEASE+MASTODON_VERSION_METADATA
|
ADD Gemfile /mastodon/Gemfile
|
||||||
# Example: v4.3.0-nightly.2023.11.09+pr-123456
|
ADD Gemfile.lock /mastodon/Gemfile.lock
|
||||||
# Overwrite existence of 'alpha.X' in version.rb [--build-arg MASTODON_VERSION_PRERELEASE="nightly.2023.11.09"]
|
RUN bundle install --deployment --without test development
|
||||||
ARG MASTODON_VERSION_PRERELEASE=""
|
|
||||||
# Append build metadata or fork information to version.rb [--build-arg MASTODON_VERSION_METADATA="pr-123456"]
|
|
||||||
ARG MASTODON_VERSION_METADATA=""
|
|
||||||
# Will be available as Mastodon::Version.source_commit
|
|
||||||
ARG SOURCE_COMMIT=""
|
|
||||||
|
|
||||||
# Allow Ruby on Rails to serve static files
|
ADD package.json /mastodon/package.json
|
||||||
# See: https://docs.joinmastodon.org/admin/config/#rails_serve_static_files
|
RUN npm install
|
||||||
ARG RAILS_SERVE_STATIC_FILES="true"
|
|
||||||
# Allow to use YJIT compiler
|
|
||||||
# See: https://github.com/ruby/ruby/blob/v3_2_4/doc/yjit/yjit.md
|
|
||||||
ARG RUBY_YJIT_ENABLE="1"
|
|
||||||
# Timezone used by the Docker container and runtime, change with [--build-arg TZ=Europe/Berlin]
|
|
||||||
ARG TZ="Etc/UTC"
|
|
||||||
# Linux UID (user id) for the mastodon user, change with [--build-arg UID=1234]
|
|
||||||
ARG UID="991"
|
|
||||||
# Linux GID (group id) for the mastodon user, change with [--build-arg GID=1234]
|
|
||||||
ARG GID="991"
|
|
||||||
|
|
||||||
# Apply Mastodon build options based on options above
|
ADD . /mastodon
|
||||||
ENV \
|
|
||||||
# Apply Mastodon version information
|
|
||||||
MASTODON_VERSION_PRERELEASE="${MASTODON_VERSION_PRERELEASE}" \
|
|
||||||
MASTODON_VERSION_METADATA="${MASTODON_VERSION_METADATA}" \
|
|
||||||
SOURCE_COMMIT="${SOURCE_COMMIT}" \
|
|
||||||
# Apply Mastodon static files and YJIT options
|
|
||||||
RAILS_SERVE_STATIC_FILES=${RAILS_SERVE_STATIC_FILES} \
|
|
||||||
RUBY_YJIT_ENABLE=${RUBY_YJIT_ENABLE} \
|
|
||||||
# Apply timezone
|
|
||||||
TZ=${TZ}
|
|
||||||
|
|
||||||
ENV \
|
VOLUME ["/mastodon/public/system", "/mastodon/public/assets"]
|
||||||
# Configure the IP to bind Mastodon to when serving traffic
|
|
||||||
BIND="0.0.0.0" \
|
|
||||||
# Use production settings for Yarn, Node.js and related tools
|
|
||||||
NODE_ENV="production" \
|
|
||||||
# Use production settings for Ruby on Rails
|
|
||||||
RAILS_ENV="production" \
|
|
||||||
# Add Ruby and Mastodon installation to the PATH
|
|
||||||
DEBIAN_FRONTEND="noninteractive" \
|
|
||||||
PATH="${PATH}:/opt/ruby/bin:/opt/mastodon/bin" \
|
|
||||||
# Optimize jemalloc 5.x performance
|
|
||||||
MALLOC_CONF="narenas:2,background_thread:true,thp:never,dirty_decay_ms:1000,muzzy_decay_ms:0" \
|
|
||||||
# Enable libvips, should not be changed
|
|
||||||
MASTODON_USE_LIBVIPS=true \
|
|
||||||
# Sidekiq will touch tmp/sidekiq_process_has_started_and_will_begin_processing_jobs to indicate it is ready. This can be used for a readiness check in Kubernetes
|
|
||||||
MASTODON_SIDEKIQ_READY_FILENAME=sidekiq_process_has_started_and_will_begin_processing_jobs
|
|
||||||
|
|
||||||
# Set default shell used for running commands
|
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-o", "errexit", "-c"]
|
|
||||||
|
|
||||||
ARG TARGETPLATFORM
|
|
||||||
|
|
||||||
RUN echo "Target platform is $TARGETPLATFORM"
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Remove automatic apt cache Docker cleanup scripts
|
|
||||||
rm -f /etc/apt/apt.conf.d/docker-clean; \
|
|
||||||
# Sets timezone
|
|
||||||
echo "${TZ}" > /etc/localtime; \
|
|
||||||
# Creates mastodon user/group and sets home directory
|
|
||||||
groupadd -g "${GID}" mastodon; \
|
|
||||||
useradd -l -u "${UID}" -g "${GID}" -m -d /opt/mastodon mastodon; \
|
|
||||||
# Creates /mastodon symlink to /opt/mastodon
|
|
||||||
ln -s /opt/mastodon /mastodon;
|
|
||||||
|
|
||||||
# Set /opt/mastodon as working directory
|
|
||||||
WORKDIR /opt/mastodon
|
|
||||||
|
|
||||||
# Add backport repository for some specific packages where we need the latest version
|
|
||||||
RUN echo 'deb http://deb.debian.org/debian bookworm-backports main' >> /etc/apt/sources.list
|
|
||||||
|
|
||||||
# hadolint ignore=DL3008,DL3005
|
|
||||||
RUN \
|
|
||||||
# Mount Apt cache and lib directories from Docker buildx caches
|
|
||||||
--mount=type=cache,id=apt-cache-${TARGETPLATFORM},target=/var/cache/apt,sharing=locked \
|
|
||||||
--mount=type=cache,id=apt-lib-${TARGETPLATFORM},target=/var/lib/apt,sharing=locked \
|
|
||||||
# Apt update & upgrade to check for security updates to Debian image
|
|
||||||
apt-get update; \
|
|
||||||
apt-get dist-upgrade -yq; \
|
|
||||||
# Install jemalloc, curl and other necessary components
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
curl \
|
|
||||||
file \
|
|
||||||
libjemalloc2 \
|
|
||||||
patchelf \
|
|
||||||
procps \
|
|
||||||
tini \
|
|
||||||
tzdata \
|
|
||||||
wget \
|
|
||||||
; \
|
|
||||||
# Patch Ruby to use jemalloc
|
|
||||||
patchelf --add-needed libjemalloc.so.2 /usr/local/bin/ruby; \
|
|
||||||
# Discard patchelf after use
|
|
||||||
apt-get purge -y \
|
|
||||||
patchelf \
|
|
||||||
;
|
|
||||||
|
|
||||||
# Create temporary build layer from base image
|
|
||||||
FROM ruby AS build
|
|
||||||
|
|
||||||
ARG TARGETPLATFORM
|
|
||||||
|
|
||||||
# hadolint ignore=DL3008
|
|
||||||
RUN \
|
|
||||||
# Mount Apt cache and lib directories from Docker buildx caches
|
|
||||||
--mount=type=cache,id=apt-cache-${TARGETPLATFORM},target=/var/cache/apt,sharing=locked \
|
|
||||||
--mount=type=cache,id=apt-lib-${TARGETPLATFORM},target=/var/lib/apt,sharing=locked \
|
|
||||||
# Install build tools and bundler dependencies from APT
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
autoconf \
|
|
||||||
automake \
|
|
||||||
build-essential \
|
|
||||||
cmake \
|
|
||||||
git \
|
|
||||||
libgdbm-dev \
|
|
||||||
libglib2.0-dev \
|
|
||||||
libgmp-dev \
|
|
||||||
libicu-dev \
|
|
||||||
libidn-dev \
|
|
||||||
libpq-dev \
|
|
||||||
libssl-dev \
|
|
||||||
libtool \
|
|
||||||
libyaml-dev \
|
|
||||||
meson \
|
|
||||||
nasm \
|
|
||||||
pkg-config \
|
|
||||||
shared-mime-info \
|
|
||||||
xz-utils \
|
|
||||||
# libvips components
|
|
||||||
libcgif-dev \
|
|
||||||
libexif-dev \
|
|
||||||
libexpat1-dev \
|
|
||||||
libgirepository1.0-dev \
|
|
||||||
libheif-dev/bookworm-backports \
|
|
||||||
libimagequant-dev \
|
|
||||||
libjpeg62-turbo-dev \
|
|
||||||
liblcms2-dev \
|
|
||||||
liborc-dev \
|
|
||||||
libspng-dev \
|
|
||||||
libtiff-dev \
|
|
||||||
libwebp-dev \
|
|
||||||
# ffmpeg components
|
|
||||||
libdav1d-dev \
|
|
||||||
liblzma-dev \
|
|
||||||
libmp3lame-dev \
|
|
||||||
libopus-dev \
|
|
||||||
libsnappy-dev \
|
|
||||||
libvorbis-dev \
|
|
||||||
libvpx-dev \
|
|
||||||
libx264-dev \
|
|
||||||
libx265-dev \
|
|
||||||
;
|
|
||||||
|
|
||||||
# Create temporary libvips specific build layer from build layer
|
|
||||||
FROM build AS libvips
|
|
||||||
|
|
||||||
# libvips version to compile, change with [--build-arg VIPS_VERSION="8.15.2"]
|
|
||||||
# renovate: datasource=github-releases depName=libvips packageName=libvips/libvips
|
|
||||||
ARG VIPS_VERSION=8.17.0
|
|
||||||
# libvips download URL, change with [--build-arg VIPS_URL="https://github.com/libvips/libvips/releases/download"]
|
|
||||||
ARG VIPS_URL=https://github.com/libvips/libvips/releases/download
|
|
||||||
|
|
||||||
WORKDIR /usr/local/libvips/src
|
|
||||||
# Download and extract libvips source code
|
|
||||||
ADD ${VIPS_URL}/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.xz /usr/local/libvips/src/
|
|
||||||
RUN tar xf vips-${VIPS_VERSION}.tar.xz;
|
|
||||||
|
|
||||||
WORKDIR /usr/local/libvips/src/vips-${VIPS_VERSION}
|
|
||||||
|
|
||||||
# Configure and compile libvips
|
|
||||||
RUN \
|
|
||||||
meson setup build --prefix /usr/local/libvips --libdir=lib -Ddeprecated=false -Dintrospection=disabled -Dmodules=disabled -Dexamples=false; \
|
|
||||||
cd build; \
|
|
||||||
ninja; \
|
|
||||||
ninja install;
|
|
||||||
|
|
||||||
# Create temporary ffmpeg specific build layer from build layer
|
|
||||||
FROM build AS ffmpeg
|
|
||||||
|
|
||||||
# ffmpeg version to compile, change with [--build-arg FFMPEG_VERSION="7.0.x"]
|
|
||||||
# renovate: datasource=repology depName=ffmpeg packageName=openpkg_current/ffmpeg
|
|
||||||
ARG FFMPEG_VERSION=7.1
|
|
||||||
# ffmpeg download URL, change with [--build-arg FFMPEG_URL="https://ffmpeg.org/releases"]
|
|
||||||
ARG FFMPEG_URL=https://ffmpeg.org/releases
|
|
||||||
|
|
||||||
WORKDIR /usr/local/ffmpeg/src
|
|
||||||
# Download and extract ffmpeg source code
|
|
||||||
ADD ${FFMPEG_URL}/ffmpeg-${FFMPEG_VERSION}.tar.xz /usr/local/ffmpeg/src/
|
|
||||||
RUN tar xf ffmpeg-${FFMPEG_VERSION}.tar.xz;
|
|
||||||
|
|
||||||
WORKDIR /usr/local/ffmpeg/src/ffmpeg-${FFMPEG_VERSION}
|
|
||||||
|
|
||||||
# Configure and compile ffmpeg
|
|
||||||
RUN \
|
|
||||||
./configure \
|
|
||||||
--prefix=/usr/local/ffmpeg \
|
|
||||||
--toolchain=hardened \
|
|
||||||
--disable-debug \
|
|
||||||
--disable-devices \
|
|
||||||
--disable-doc \
|
|
||||||
--disable-ffplay \
|
|
||||||
--disable-network \
|
|
||||||
--disable-static \
|
|
||||||
--enable-ffmpeg \
|
|
||||||
--enable-ffprobe \
|
|
||||||
--enable-gpl \
|
|
||||||
--enable-libdav1d \
|
|
||||||
--enable-libmp3lame \
|
|
||||||
--enable-libopus \
|
|
||||||
--enable-libsnappy \
|
|
||||||
--enable-libvorbis \
|
|
||||||
--enable-libvpx \
|
|
||||||
--enable-libwebp \
|
|
||||||
--enable-libx264 \
|
|
||||||
--enable-libx265 \
|
|
||||||
--enable-shared \
|
|
||||||
--enable-version3 \
|
|
||||||
; \
|
|
||||||
make -j$(nproc); \
|
|
||||||
make install;
|
|
||||||
|
|
||||||
# Create temporary bundler specific build layer from build layer
|
|
||||||
FROM build AS bundler
|
|
||||||
|
|
||||||
ARG TARGETPLATFORM
|
|
||||||
|
|
||||||
# Copy Gemfile config into working directory
|
|
||||||
COPY Gemfile* /opt/mastodon/
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Mount Ruby Gem caches
|
|
||||||
--mount=type=cache,id=gem-cache-${TARGETPLATFORM},target=/usr/local/bundle/cache/,sharing=locked \
|
|
||||||
# Configure bundle to prevent changes to Gemfile and Gemfile.lock
|
|
||||||
bundle config set --global frozen "true"; \
|
|
||||||
# Configure bundle to not cache downloaded Gems
|
|
||||||
bundle config set --global cache_all "false"; \
|
|
||||||
# Configure bundle to only process production Gems
|
|
||||||
bundle config set --local without "development test"; \
|
|
||||||
# Configure bundle to not warn about root user
|
|
||||||
bundle config set silence_root_warning "true"; \
|
|
||||||
# Download and install required Gems
|
|
||||||
bundle install -j"$(nproc)";
|
|
||||||
|
|
||||||
# Create temporary assets build layer from build layer
|
|
||||||
FROM build AS precompiler
|
|
||||||
|
|
||||||
ARG TARGETPLATFORM
|
|
||||||
|
|
||||||
# Copy Mastodon sources into layer
|
|
||||||
COPY . /opt/mastodon/
|
|
||||||
|
|
||||||
# Copy Node.js binaries/libraries into layer
|
|
||||||
COPY --from=node /usr/local/bin /usr/local/bin
|
|
||||||
COPY --from=node /usr/local/lib /usr/local/lib
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Configure Corepack
|
|
||||||
rm /usr/local/bin/yarn*; \
|
|
||||||
corepack enable; \
|
|
||||||
corepack prepare --activate;
|
|
||||||
|
|
||||||
# hadolint ignore=DL3008
|
|
||||||
RUN \
|
|
||||||
--mount=type=cache,id=corepack-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/corepack,sharing=locked \
|
|
||||||
--mount=type=cache,id=yarn-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/yarn,sharing=locked \
|
|
||||||
# Install Node.js packages
|
|
||||||
yarn workspaces focus --production @mastodon/mastodon;
|
|
||||||
|
|
||||||
# Copy libvips components into layer for precompiler
|
|
||||||
COPY --from=libvips /usr/local/libvips/bin /usr/local/bin
|
|
||||||
COPY --from=libvips /usr/local/libvips/lib /usr/local/lib
|
|
||||||
# Copy bundler packages into layer for precompiler
|
|
||||||
COPY --from=bundler /opt/mastodon /opt/mastodon/
|
|
||||||
COPY --from=bundler /usr/local/bundle/ /usr/local/bundle/
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
ldconfig; \
|
|
||||||
# Use Ruby on Rails to create Mastodon assets
|
|
||||||
SECRET_KEY_BASE_DUMMY=1 \
|
|
||||||
bundle exec rails assets:precompile; \
|
|
||||||
# Cleanup temporary files
|
|
||||||
rm -fr /opt/mastodon/tmp;
|
|
||||||
|
|
||||||
# Prep final Mastodon Ruby layer
|
|
||||||
FROM ruby AS mastodon
|
|
||||||
|
|
||||||
ARG TARGETPLATFORM
|
|
||||||
|
|
||||||
# hadolint ignore=DL3008
|
|
||||||
RUN \
|
|
||||||
# Mount Apt cache and lib directories from Docker buildx caches
|
|
||||||
--mount=type=cache,id=apt-cache-${TARGETPLATFORM},target=/var/cache/apt,sharing=locked \
|
|
||||||
--mount=type=cache,id=apt-lib-${TARGETPLATFORM},target=/var/lib/apt,sharing=locked \
|
|
||||||
# Mount Corepack and Yarn caches from Docker buildx caches
|
|
||||||
--mount=type=cache,id=corepack-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/corepack,sharing=locked \
|
|
||||||
--mount=type=cache,id=yarn-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/yarn,sharing=locked \
|
|
||||||
# Apt update install non-dev versions of necessary components
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
libexpat1 \
|
|
||||||
libglib2.0-0 \
|
|
||||||
libicu72 \
|
|
||||||
libidn12 \
|
|
||||||
libpq5 \
|
|
||||||
libreadline8 \
|
|
||||||
libssl3 \
|
|
||||||
libyaml-0-2 \
|
|
||||||
# libvips components
|
|
||||||
libcgif0 \
|
|
||||||
libexif12 \
|
|
||||||
libheif1/bookworm-backports \
|
|
||||||
libimagequant0 \
|
|
||||||
libjpeg62-turbo \
|
|
||||||
liblcms2-2 \
|
|
||||||
liborc-0.4-0 \
|
|
||||||
libspng0 \
|
|
||||||
libtiff6 \
|
|
||||||
libwebp7 \
|
|
||||||
libwebpdemux2 \
|
|
||||||
libwebpmux3 \
|
|
||||||
# ffmpeg components
|
|
||||||
libdav1d6 \
|
|
||||||
libmp3lame0 \
|
|
||||||
libopencore-amrnb0 \
|
|
||||||
libopencore-amrwb0 \
|
|
||||||
libopus0 \
|
|
||||||
libsnappy1v5 \
|
|
||||||
libtheora0 \
|
|
||||||
libvorbis0a \
|
|
||||||
libvorbisenc2 \
|
|
||||||
libvorbisfile3 \
|
|
||||||
libvpx7 \
|
|
||||||
libx264-164 \
|
|
||||||
libx265-199 \
|
|
||||||
;
|
|
||||||
|
|
||||||
# Copy Mastodon sources into final layer
|
|
||||||
COPY . /opt/mastodon/
|
|
||||||
|
|
||||||
# Copy compiled assets to layer
|
|
||||||
COPY --from=precompiler /opt/mastodon/public/packs /opt/mastodon/public/packs
|
|
||||||
COPY --from=precompiler /opt/mastodon/public/assets /opt/mastodon/public/assets
|
|
||||||
# Copy bundler components to layer
|
|
||||||
COPY --from=bundler /usr/local/bundle/ /usr/local/bundle/
|
|
||||||
# Copy libvips components to layer
|
|
||||||
COPY --from=libvips /usr/local/libvips/bin /usr/local/bin
|
|
||||||
COPY --from=libvips /usr/local/libvips/lib /usr/local/lib
|
|
||||||
# Copy ffpmeg components to layer
|
|
||||||
COPY --from=ffmpeg /usr/local/ffmpeg/bin /usr/local/bin
|
|
||||||
COPY --from=ffmpeg /usr/local/ffmpeg/lib /usr/local/lib
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
ldconfig; \
|
|
||||||
# Smoketest media processors
|
|
||||||
vips -v; \
|
|
||||||
ffmpeg -version; \
|
|
||||||
ffprobe -version;
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Precompile bootsnap code for faster Rails startup
|
|
||||||
bundle exec bootsnap precompile --gemfile app/ lib/;
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Pre-create and chown system volume to Mastodon user
|
|
||||||
mkdir -p /opt/mastodon/public/system; \
|
|
||||||
chown mastodon:mastodon /opt/mastodon/public/system; \
|
|
||||||
# Set Mastodon user as owner of tmp folder
|
|
||||||
chown -R mastodon:mastodon /opt/mastodon/tmp;
|
|
||||||
|
|
||||||
# Set the running user for resulting container
|
|
||||||
USER mastodon
|
|
||||||
# Expose default Puma ports
|
|
||||||
EXPOSE 3000
|
|
||||||
# Set container tini as default entry point
|
|
||||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
# Federation
|
|
||||||
|
|
||||||
## Supported federation protocols and standards
|
|
||||||
|
|
||||||
- [ActivityPub](https://www.w3.org/TR/activitypub/) (Server-to-Server)
|
|
||||||
- [WebFinger](https://webfinger.net/)
|
|
||||||
- [Http Signatures](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures)
|
|
||||||
- [NodeInfo](https://nodeinfo.diaspora.software/)
|
|
||||||
|
|
||||||
## Supported FEPs
|
|
||||||
|
|
||||||
- [FEP-67ff: FEDERATION.md](https://codeberg.org/fediverse/fep/src/branch/main/fep/67ff/fep-67ff.md)
|
|
||||||
- [FEP-f1d5: NodeInfo in Fediverse Software](https://codeberg.org/fediverse/fep/src/branch/main/fep/f1d5/fep-f1d5.md)
|
|
||||||
- [FEP-8fcf: Followers collection synchronization across servers](https://codeberg.org/fediverse/fep/src/branch/main/fep/8fcf/fep-8fcf.md)
|
|
||||||
- [FEP-5feb: Search indexing consent for actors](https://codeberg.org/fediverse/fep/src/branch/main/fep/5feb/fep-5feb.md)
|
|
||||||
- [FEP-044f: Consent-respecting quote posts](https://codeberg.org/fediverse/fep/src/branch/main/fep/044f/fep-044f.md): partial support for incoming quote-posts
|
|
||||||
|
|
||||||
## ActivityPub in Mastodon
|
|
||||||
|
|
||||||
Mastodon largely follows the ActivityPub server-to-server specification but it makes uses of some non-standard extensions, some of which are required for interacting with Mastodon at all.
|
|
||||||
|
|
||||||
- [Supported ActivityPub vocabulary](https://docs.joinmastodon.org/spec/activitypub/)
|
|
||||||
|
|
||||||
### Required extensions
|
|
||||||
|
|
||||||
#### WebFinger
|
|
||||||
|
|
||||||
In Mastodon, users are identified by a `username` and `domain` pair (e.g., `Gargron@mastodon.social`).
|
|
||||||
This is used both for discovery and for unambiguously mentioning users across the fediverse. Furthermore, this is part of Mastodon's database design from its very beginnings.
|
|
||||||
|
|
||||||
As a result, Mastodon requires that each ActivityPub actor uniquely maps back to an `acct:` URI that can be resolved via WebFinger.
|
|
||||||
|
|
||||||
- [WebFinger information and examples](https://docs.joinmastodon.org/spec/webfinger/)
|
|
||||||
|
|
||||||
#### HTTP Signatures
|
|
||||||
|
|
||||||
In order to authenticate activities, Mastodon relies on HTTP Signatures, signing every `POST` and `GET` request to other ActivityPub implementations on behalf of the user authoring an activity (for `POST` requests) or an actor representing the Mastodon server itself (for most `GET` requests).
|
|
||||||
|
|
||||||
Mastodon requires all `POST` requests to be signed, and MAY require `GET` requests to be signed, depending on the configuration of the Mastodon server.
|
|
||||||
|
|
||||||
- [HTTP Signatures information and examples](https://docs.joinmastodon.org/spec/security/#http)
|
|
||||||
|
|
||||||
### Optional extensions
|
|
||||||
|
|
||||||
- [Linked-Data Signatures](https://docs.joinmastodon.org/spec/security/#ld)
|
|
||||||
- [Bearcaps](https://docs.joinmastodon.org/spec/bearcaps/)
|
|
||||||
|
|
||||||
### Additional documentation
|
|
||||||
|
|
||||||
- [Mastodon documentation](https://docs.joinmastodon.org/)
|
|
266
Gemfile
266
Gemfile
|
@ -1,232 +1,70 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
ruby '>= 3.2.0', '< 3.5.0'
|
|
||||||
|
|
||||||
gem 'propshaft'
|
gem 'rails', '5.0.0.1'
|
||||||
gem 'puma', '~> 6.3'
|
gem 'sass-rails', '~> 5.0'
|
||||||
gem 'rails', '~> 8.0'
|
gem 'uglifier', '>= 1.3.0'
|
||||||
gem 'thor', '~> 1.2'
|
gem 'coffee-rails', '~> 4.1.0'
|
||||||
|
gem 'therubyracer', platforms: :ruby
|
||||||
|
gem 'jquery-rails'
|
||||||
|
gem 'jbuilder', '~> 2.0'
|
||||||
|
gem 'sdoc', '~> 0.4.0', group: :doc
|
||||||
|
gem 'puma'
|
||||||
|
|
||||||
gem 'dotenv'
|
gem 'hamlit-rails'
|
||||||
gem 'haml-rails', '~>2.0'
|
gem 'pg'
|
||||||
gem 'pg', '~> 1.5'
|
gem 'dotenv-rails'
|
||||||
gem 'pghero'
|
gem 'font-awesome-rails'
|
||||||
|
|
||||||
gem 'aws-sdk-core', '< 3.216.0', require: false # TODO: https://github.com/mastodon/mastodon/pull/34173#issuecomment-2733378873
|
gem 'paperclip', '~> 4.3'
|
||||||
gem 'aws-sdk-s3', '~> 1.123', require: false
|
gem 'paperclip-av-transcoder'
|
||||||
gem 'blurhash', '~> 0.1'
|
|
||||||
gem 'fog-core', '<= 2.6.0'
|
|
||||||
gem 'fog-openstack', '~> 1.0', require: false
|
|
||||||
gem 'jd-paperclip-azure', '~> 3.0', require: false
|
|
||||||
gem 'kt-paperclip', '~> 7.2'
|
|
||||||
gem 'ruby-vips', '~> 2.2', require: false
|
|
||||||
|
|
||||||
gem 'active_model_serializers', '~> 0.10'
|
gem 'http'
|
||||||
gem 'addressable', '~> 2.8'
|
gem 'httplog'
|
||||||
gem 'bootsnap', '~> 1.18.0', require: false
|
gem 'addressable'
|
||||||
gem 'browser'
|
gem 'nokogiri'
|
||||||
gem 'charlock_holmes', '~> 0.7.7'
|
gem 'link_header'
|
||||||
gem 'chewy', '~> 7.3'
|
gem 'ostatus2'
|
||||||
gem 'devise', '~> 4.9'
|
gem 'goldfinger'
|
||||||
gem 'devise-two-factor'
|
gem 'devise'
|
||||||
|
gem 'rails_autolink'
|
||||||
|
gem 'doorkeeper'
|
||||||
|
gem 'rabl'
|
||||||
|
gem 'oj'
|
||||||
|
gem 'hiredis'
|
||||||
|
gem 'redis', '~>3.2'
|
||||||
|
gem 'fast_blank'
|
||||||
|
gem 'htmlentities'
|
||||||
|
gem 'simple_form'
|
||||||
|
gem 'will_paginate'
|
||||||
|
gem 'rack-attack'
|
||||||
|
gem 'sidekiq'
|
||||||
|
|
||||||
group :pam_authentication, optional: true do
|
gem 'react-rails'
|
||||||
gem 'devise_pam_authenticatable2', '~> 9.2'
|
gem 'browserify-rails'
|
||||||
end
|
|
||||||
|
|
||||||
gem 'net-ldap', '~> 0.18'
|
group :development, :test do
|
||||||
|
gem 'rspec-rails'
|
||||||
gem 'omniauth', '~> 2.0'
|
gem 'pry-rails'
|
||||||
gem 'omniauth-cas', '~> 3.0.0.beta.1'
|
gem 'fuubar'
|
||||||
gem 'omniauth_openid_connect', '~> 0.8.0'
|
gem 'fabrication'
|
||||||
gem 'omniauth-rails_csrf_protection', '~> 1.0'
|
|
||||||
gem 'omniauth-saml', '~> 2.0'
|
|
||||||
|
|
||||||
gem 'color_diff', '~> 0.1'
|
|
||||||
gem 'csv', '~> 3.2'
|
|
||||||
gem 'discard', '~> 1.2'
|
|
||||||
gem 'doorkeeper', '~> 5.6'
|
|
||||||
gem 'faraday-httpclient'
|
|
||||||
gem 'fast_blank', '~> 1.0'
|
|
||||||
gem 'fastimage'
|
|
||||||
gem 'hiredis', '~> 0.6'
|
|
||||||
gem 'hiredis-client'
|
|
||||||
gem 'htmlentities', '~> 4.3'
|
|
||||||
gem 'http', '~> 5.3.0'
|
|
||||||
gem 'http_accept_language', '~> 2.1'
|
|
||||||
gem 'httplog', '~> 1.7.0', require: false
|
|
||||||
gem 'i18n'
|
|
||||||
gem 'idn-ruby', require: 'idn'
|
|
||||||
gem 'inline_svg'
|
|
||||||
gem 'irb', '~> 1.8'
|
|
||||||
gem 'kaminari', '~> 1.2'
|
|
||||||
gem 'link_header', '~> 0.0'
|
|
||||||
gem 'linzer', '~> 0.7.2'
|
|
||||||
gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock'
|
|
||||||
gem 'mime-types', '~> 3.7.0', require: 'mime/types/columnar'
|
|
||||||
gem 'mutex_m'
|
|
||||||
gem 'nokogiri', '~> 1.15'
|
|
||||||
gem 'oj', '~> 3.14'
|
|
||||||
gem 'ox', '~> 2.14'
|
|
||||||
gem 'parslet'
|
|
||||||
gem 'premailer-rails'
|
|
||||||
gem 'public_suffix', '~> 6.0'
|
|
||||||
gem 'pundit', '~> 2.3'
|
|
||||||
gem 'rack-attack', '~> 6.6'
|
|
||||||
gem 'rack-cors', require: 'rack/cors'
|
|
||||||
gem 'rails-i18n', '~> 8.0'
|
|
||||||
gem 'redcarpet', '~> 3.6'
|
|
||||||
gem 'redis', '~> 4.5', require: ['redis', 'redis/connection/hiredis']
|
|
||||||
gem 'rqrcode', '~> 3.0'
|
|
||||||
gem 'ruby-progressbar', '~> 1.13'
|
|
||||||
gem 'sanitize', '~> 7.0'
|
|
||||||
gem 'scenic', '~> 1.7'
|
|
||||||
gem 'sidekiq', '< 8'
|
|
||||||
gem 'sidekiq-bulk', '~> 0.2.0'
|
|
||||||
gem 'sidekiq-scheduler', '~> 5.0'
|
|
||||||
gem 'sidekiq-unique-jobs', '> 8'
|
|
||||||
gem 'simple_form', '~> 5.2'
|
|
||||||
gem 'simple-navigation', '~> 4.4'
|
|
||||||
gem 'stoplight', '~> 4.1'
|
|
||||||
gem 'strong_migrations'
|
|
||||||
gem 'tty-prompt', '~> 0.23', require: false
|
|
||||||
gem 'twitter-text', '~> 3.1.0'
|
|
||||||
gem 'tzinfo-data', '~> 1.2023'
|
|
||||||
gem 'webauthn', '~> 3.0'
|
|
||||||
gem 'webpush', github: 'mastodon/webpush', ref: '9631ac63045cfabddacc69fc06e919b4c13eb913'
|
|
||||||
|
|
||||||
gem 'json-ld'
|
|
||||||
gem 'json-ld-preloaded', '~> 3.2'
|
|
||||||
gem 'rdf-normalize', '~> 0.5'
|
|
||||||
|
|
||||||
gem 'prometheus_exporter', '~> 2.2', require: false
|
|
||||||
|
|
||||||
gem 'opentelemetry-api', '~> 1.5.0'
|
|
||||||
|
|
||||||
group :opentelemetry do
|
|
||||||
gem 'opentelemetry-exporter-otlp', '~> 0.30.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-active_job', '~> 0.8.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-active_model_serializers', '~> 0.22.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-concurrent_ruby', '~> 0.22.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-excon', '~> 0.23.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-faraday', '~> 0.27.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-http', '~> 0.24.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-http_client', '~> 0.23.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-net_http', '~> 0.23.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-pg', '~> 0.30.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-rack', '~> 0.26.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-rails', '~> 0.36.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-redis', '~> 0.26.0', require: false
|
|
||||||
gem 'opentelemetry-instrumentation-sidekiq', '~> 0.26.0', require: false
|
|
||||||
gem 'opentelemetry-sdk', '~> 1.4', require: false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
# Enable usage of all available CPUs/cores during spec runs
|
gem 'simplecov', require: false
|
||||||
gem 'flatware-rspec'
|
gem 'webmock'
|
||||||
|
gem 'rspec-sidekiq'
|
||||||
# Adds RSpec Error/Warning annotations to GitHub PRs on the Files tab
|
|
||||||
gem 'rspec-github', '~> 3.0', require: false
|
|
||||||
|
|
||||||
# RSpec helpers for email specs
|
|
||||||
gem 'email_spec'
|
|
||||||
|
|
||||||
# Extra RSpec extension methods and helpers for sidekiq
|
|
||||||
gem 'rspec-sidekiq', '~> 5.0'
|
|
||||||
|
|
||||||
# Browser integration testing
|
|
||||||
gem 'capybara', '~> 3.39'
|
|
||||||
gem 'capybara-playwright-driver'
|
|
||||||
|
|
||||||
# Used to reset the database between system tests
|
|
||||||
gem 'database_cleaner-active_record'
|
|
||||||
|
|
||||||
# Used to mock environment variables
|
|
||||||
gem 'climate_control'
|
|
||||||
|
|
||||||
# Validate schemas in specs
|
|
||||||
gem 'json-schema', '~> 5.0'
|
|
||||||
|
|
||||||
# Test harness fo rack components
|
|
||||||
gem 'rack-test', '~> 2.1'
|
|
||||||
|
|
||||||
gem 'shoulda-matchers'
|
|
||||||
|
|
||||||
# Coverage formatter for RSpec
|
|
||||||
gem 'simplecov', '~> 0.22', require: false
|
|
||||||
gem 'simplecov-lcov', '~> 0.8', require: false
|
|
||||||
|
|
||||||
# Stub web requests for specs
|
|
||||||
gem 'webmock', '~> 3.18'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
# Code linting CLI and plugins
|
|
||||||
gem 'rubocop', require: false
|
gem 'rubocop', require: false
|
||||||
gem 'rubocop-capybara', require: false
|
gem 'better_errors'
|
||||||
gem 'rubocop-i18n', require: false
|
gem 'binding_of_caller'
|
||||||
gem 'rubocop-performance', require: false
|
gem 'letter_opener'
|
||||||
gem 'rubocop-rails', require: false
|
gem 'bullet'
|
||||||
gem 'rubocop-rspec', require: false
|
gem 'active_record_query_trace'
|
||||||
gem 'rubocop-rspec_rails', require: false
|
|
||||||
|
|
||||||
# Annotates modules with schema
|
|
||||||
gem 'annotaterb', '~> 4.13', require: false
|
|
||||||
|
|
||||||
# Enhanced error message pages for development
|
|
||||||
gem 'better_errors', '~> 2.9'
|
|
||||||
gem 'binding_of_caller', '~> 1.0'
|
|
||||||
|
|
||||||
# Preview mail in the browser
|
|
||||||
gem 'letter_opener', '~> 1.8'
|
|
||||||
gem 'letter_opener_web', '~> 3.0'
|
|
||||||
|
|
||||||
# Security analysis CLI tools
|
|
||||||
gem 'brakeman', '~> 7.0', require: false
|
|
||||||
gem 'bundler-audit', '~> 0.9', require: false
|
|
||||||
|
|
||||||
# Linter CLI for HAML files
|
|
||||||
gem 'haml_lint', require: false
|
|
||||||
|
|
||||||
# Validate missing i18n keys
|
|
||||||
gem 'i18n-tasks', '~> 1.0', require: false
|
|
||||||
end
|
|
||||||
|
|
||||||
group :development, :test do
|
|
||||||
# Interactive Debugging tools
|
|
||||||
gem 'debug', '~> 1.8', require: false
|
|
||||||
|
|
||||||
# Generate fake data values
|
|
||||||
gem 'faker', '~> 3.2'
|
|
||||||
|
|
||||||
# Generate factory objects
|
|
||||||
gem 'fabrication'
|
|
||||||
|
|
||||||
# Profiling tools
|
|
||||||
gem 'memory_profiler', require: false
|
|
||||||
gem 'ruby-prof', require: false
|
|
||||||
gem 'stackprof', require: false
|
|
||||||
gem 'test-prof', require: false
|
|
||||||
|
|
||||||
# RSpec runner for rails
|
|
||||||
gem 'rspec-rails', '~> 8.0'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :production do
|
group :production do
|
||||||
gem 'lograge', '~> 0.12'
|
gem 'rails_12factor'
|
||||||
|
gem 'lograge'
|
||||||
end
|
end
|
||||||
|
|
||||||
gem 'cocoon', '~> 1.2'
|
|
||||||
gem 'concurrent-ruby', require: false
|
|
||||||
gem 'connection_pool', require: false
|
|
||||||
gem 'xorcist', '~> 1.1'
|
|
||||||
|
|
||||||
gem 'net-http', '~> 0.6.0'
|
|
||||||
gem 'rubyzip', '~> 2.3'
|
|
||||||
|
|
||||||
gem 'hcaptcha', '~> 7.1'
|
|
||||||
|
|
||||||
gem 'mail', '~> 2.8'
|
|
||||||
|
|
||||||
gem 'vite_rails', '~> 3.0.19'
|
|
||||||
|
|
1428
Gemfile.lock
1428
Gemfile.lock
File diff suppressed because it is too large
Load Diff
14
Procfile
14
Procfile
|
@ -1,14 +0,0 @@
|
||||||
web: bin/heroku-web
|
|
||||||
worker: bundle exec sidekiq
|
|
||||||
|
|
||||||
# For the streaming API, you need a separate app that shares Postgres and Redis:
|
|
||||||
#
|
|
||||||
# heroku create
|
|
||||||
# heroku buildpacks:add heroku/nodejs
|
|
||||||
# heroku config:set RUN_STREAMING=true
|
|
||||||
# heroku addons:attach <main-app>::DATABASE
|
|
||||||
# heroku addons:attach <main-app>::REDIS
|
|
||||||
#
|
|
||||||
# and let the main app use the separate app:
|
|
||||||
#
|
|
||||||
# heroku config:set STREAMING_API_BASE_URL=wss://<streaming-app-random>.herokuapp.com -a <main-app>
|
|
|
@ -1,4 +0,0 @@
|
||||||
web: env PORT=3000 RAILS_ENV=development bundle exec puma -C config/puma.rb
|
|
||||||
sidekiq: env PORT=3000 RAILS_ENV=development bundle exec sidekiq
|
|
||||||
stream: env PORT=4000 yarn workspace @mastodon/streaming start
|
|
||||||
vite: yarn dev
|
|
151
README.md
151
README.md
|
@ -1,103 +1,112 @@
|
||||||
> [!NOTE]
|
Mastodon
|
||||||
> Want to learn more about Mastodon?
|
========
|
||||||
> Click below to find out more in a video.
|
|
||||||
|
|
||||||
<p align="center">
|
[][travis]
|
||||||
<a style="text-decoration:none" href="https://www.youtube.com/watch?v=IPSbNdBmWKE">
|
[][code_climate]
|
||||||
<img alt="Mastodon hero image" src="https://github.com/user-attachments/assets/ef53f5e9-c0d8-484d-9f53-00efdebb92c3" />
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p align="center">
|
[travis]: https://travis-ci.org/Gargron/mastodon
|
||||||
<a style="text-decoration:none" href="https://github.com/mastodon/mastodon/releases">
|
[code_climate]: https://codeclimate.com/github/Gargron/mastodon
|
||||||
<img src="https://img.shields.io/github/release/mastodon/mastodon.svg" alt="Release" /></a>
|
|
||||||
<a style="text-decoration:none" href="https://github.com/mastodon/mastodon/actions/workflows/test-ruby.yml">
|
|
||||||
<img src="https://github.com/mastodon/mastodon/actions/workflows/test-ruby.yml/badge.svg" alt="Ruby Testing" /></a>
|
|
||||||
<a style="text-decoration:none" href="https://crowdin.com/project/mastodon">
|
|
||||||
<img src="https://d322cqt584bo4o.cloudfront.net/mastodon/localized.svg" alt="Crowdin" /></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
Mastodon is a **free, open-source social network server** based on ActivityPub where users can follow friends and discover new ones. On Mastodon, users can publish anything they want: links, pictures, text, and video. All Mastodon servers are interoperable as a federated network (users on one server can seamlessly communicate with users from another one, including non-Mastodon software that implements ActivityPub!)
|
Mastodon is a federated microblogging engine. An alternative implementation of the GNU social project. Based on ActivityStreams, Webfinger, PubsubHubbub and Salmon.
|
||||||
|
|
||||||
## Navigation
|
Click on the screenshot to watch a demo of the UI:
|
||||||
|
|
||||||
- [Project homepage 🐘](https://joinmastodon.org)
|
[][youtube_demo]
|
||||||
- [Support the development via Patreon][patreon]
|
|
||||||
- [View sponsors](https://joinmastodon.org/sponsors)
|
|
||||||
- [Blog](https://blog.joinmastodon.org)
|
|
||||||
- [Documentation](https://docs.joinmastodon.org)
|
|
||||||
- [Roadmap](https://joinmastodon.org/roadmap)
|
|
||||||
- [Official Docker image](https://github.com/mastodon/mastodon/pkgs/container/mastodon)
|
|
||||||
- [Browse Mastodon servers](https://joinmastodon.org/communities)
|
|
||||||
- [Browse Mastodon apps](https://joinmastodon.org/apps)
|
|
||||||
|
|
||||||
[patreon]: https://www.patreon.com/mastodon
|
[youtube_demo]: https://www.youtube.com/watch?v=YO1jQ8_rAMU
|
||||||
|
|
||||||
|
Focus of the project on a clean REST API and a good user interface. Ruby on Rails is used for the back-end, while React.js and Redux are used for the dynamic front-end. A static front-end for public resources (profiles and statuses) is also provided.
|
||||||
|
|
||||||
|
If you would like, you can [support the development of this project on Patreon][patreon]. Alternatively, you can donate to this BTC address: `17j2g7vpgHhLuXhN4bueZFCvdxxieyRVWd`
|
||||||
|
|
||||||
|
[patreon]: https://www.patreon.com/user?u=619786
|
||||||
|
|
||||||
|
**Current status of the project is early development**
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
- [API overview](https://github.com/Gargron/mastodon/wiki/API)
|
||||||
|
- [How to use the API via cURL/oAuth](https://github.com/Gargron/mastodon/wiki/Testing-with-cURL)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
<img src="/app/javascript/images/elephant_ui_working.svg?raw=true" align="right" width="30%" />
|
- **Fully interoperable with GNU social and any OStatus platform**
|
||||||
|
Whatever implements Atom feeds, ActivityStreams, Salmon, PubSubHubbub and Webfinger is part of the network
|
||||||
|
- **Real-time timeline updates**
|
||||||
|
See the updates of people you're following appear in real-time in the UI via WebSockets
|
||||||
|
- **Federated thread resolving**
|
||||||
|
If someone you follow replies to a user unknown to the server, the server fetches the full thread so you can view it without leaving the UI
|
||||||
|
- **Media attachments like images and WebM**
|
||||||
|
Upload and view images and WebM videos attached to the updates
|
||||||
|
- **OAuth2 and a straightforward REST API**
|
||||||
|
Mastodon acts as an OAuth2 provider so 3rd party apps can use the API, which is RESTful and simple
|
||||||
|
- **Background processing for long-running tasks**
|
||||||
|
Mastodon tries to be as fast and responsive as possible, so all long-running tasks that can be delegated to background processing, are
|
||||||
|
- **Deployable via Docker**
|
||||||
|
You don't need to mess with dependencies and configuration if you want to try Mastodon, if you have Docker and Docker Compose the deployment is extremely easy
|
||||||
|
|
||||||
**No vendor lock-in: Fully interoperable with any conforming platform** - It doesn't have to be Mastodon; whatever implements ActivityPub is part of the social network! [Learn more](https://blog.joinmastodon.org/2018/06/why-activitypub-is-the-future/)
|
## Configuration
|
||||||
|
|
||||||
**Real-time, chronological timeline updates** - updates of people you're following appear in real-time in the UI via WebSockets. There's a firehose view as well!
|
- `LOCAL_DOMAIN` should be the domain/hostname of your instance. This is **absolutely required** as it is used for generating unique IDs for everything federation-related
|
||||||
|
- `LOCAL_HTTPS` set it to `true` if HTTPS works on your website. This is used to generate canonical URLs, which is also important when generating and parsing federation-related IDs
|
||||||
|
- `HUB_URL` should be the URL of the PubsubHubbub service that your instance is going to use. By default it is the open service of Superfeedr
|
||||||
|
|
||||||
**Media attachments like images and short videos** - upload and view images and WebM/MP4 videos attached to the updates. Videos with no audio track are treated like GIFs; normal videos loop continuously!
|
Consult the example configuration file, `.env.production.sample` for the full list. Among other things you need to set details for the SMTP server you are going to use.
|
||||||
|
|
||||||
**Safety and moderation tools** - Mastodon includes private posts, locked accounts, phrase filtering, muting, blocking, and all sorts of other features, along with a reporting and moderation system. [Learn more](https://blog.joinmastodon.org/2018/07/cage-the-mastodon/)
|
## Requirements
|
||||||
|
|
||||||
**OAuth2 and a straightforward REST API** - Mastodon acts as an OAuth2 provider, so 3rd party apps can use the REST and Streaming APIs. This results in a rich app ecosystem with a lot of choices!
|
- PostgreSQL
|
||||||
|
- Redis
|
||||||
|
|
||||||
## Deployment
|
## Running with Docker and Docker-Compose
|
||||||
|
|
||||||
### Tech stack
|
The project now includes a `Dockerfile` and a `docker-compose.yml`. You need to turn `.env.production.sample` into `.env.production` with all the variables set before you can:
|
||||||
|
|
||||||
- **Ruby on Rails** powers the REST API and other web pages
|
docker-compose build
|
||||||
- **React.js** and **Redux** are used for the dynamic parts of the interface
|
|
||||||
- **Node.js** powers the streaming API
|
|
||||||
|
|
||||||
### Requirements
|
And finally
|
||||||
|
|
||||||
- **PostgreSQL** 13+
|
docker-compose up -d
|
||||||
- **Redis** 6.2+
|
|
||||||
- **Ruby** 3.2+
|
|
||||||
- **Node.js** 20+
|
|
||||||
|
|
||||||
The repository includes deployment configurations for **Docker and docker-compose** as well as specific platforms like **Heroku**, and **Scalingo**. For Helm charts, reference the [mastodon/chart repository](https://github.com/mastodon/chart). The [**standalone** installation guide](https://docs.joinmastodon.org/admin/install/) is available in the documentation.
|
As usual, the first thing you would need to do would be to run migrations:
|
||||||
|
|
||||||
## Contributing
|
docker-compose run --rm web rails db:migrate
|
||||||
|
|
||||||
Mastodon is **free, open-source software** licensed under **AGPLv3**.
|
And since the instance running in the container will be running in production mode, you need to pre-compile assets:
|
||||||
|
|
||||||
You can open issues for bugs you've found or features you think are missing. You
|
docker-compose run --rm web rails assets:precompile
|
||||||
can also submit pull requests to this repository or translations via Crowdin. To
|
|
||||||
get started, look at the [CONTRIBUTING] and [DEVELOPMENT] guides. For changes
|
|
||||||
accepted into Mastodon, you can request to be paid through our [OpenCollective].
|
|
||||||
|
|
||||||
**IRC channel**: #mastodon on [`irc.libera.chat`](https://libera.chat)
|
The container has two volumes, for the assets and for user uploads. The default docker-compose.yml maps them to the repository's `public/assets` and `public/system` directories, you may wish to put them somewhere else. Likewise, the PostgreSQL and Redis images have data containers that you may wish to map somewhere where you know how to find them and back them up.
|
||||||
|
|
||||||
## License
|
**Note**: The `--rm` option for docker-compose will remove the container that is created to run a one-off command after it completes. As data is stored in volumes it is not affected by that container clean-up.
|
||||||
|
|
||||||
Copyright (c) 2016-2025 Eugen Rochko (+ [`mastodon authors`](AUTHORS.md))
|
### Tasks
|
||||||
|
|
||||||
Licensed under GNU Affero General Public License as stated in the [LICENSE](LICENSE):
|
- `rake mastodon:media:clear` removes uploads that have not been attached to any status after a while, you would want to run this from a periodic cronjob
|
||||||
|
- `rake mastodon:push:clear` unsubscribes from PuSH notifications for remote users that have no local followers. You may not want to actually do that, to keep a fuller footprint of the fediverse or in case your users will soon re-follow
|
||||||
|
- `rake mastodon:push:refresh` re-subscribes PuSH for expiring remote users, this should be run periodically from a cronjob and quite often as the expiration time depends on the particular hub of the remote user
|
||||||
|
- `rake mastodon:feeds:clear` removes all timelines, which forces them to be re-built on the fly next time a user tries to fetch their home/mentions timeline. Only for troubleshooting
|
||||||
|
|
||||||
```
|
Running any of these tasks via docker-compose would look like this:
|
||||||
Copyright (c) 2016-2025 Eugen Rochko & other Mastodon contributors
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it under
|
docker-compose run --rm web rake mastodon:media:clear
|
||||||
the terms of the GNU Affero General Public License as published by the Free
|
|
||||||
Software Foundation, either version 3 of the License, or (at your option) any
|
|
||||||
later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
### Updating
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
||||||
details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License along
|
This approach makes updating to the latest version a real breeze.
|
||||||
with this program. If not, see https://www.gnu.org/licenses/
|
|
||||||
```
|
|
||||||
|
|
||||||
[CONTRIBUTING]: CONTRIBUTING.md
|
git pull
|
||||||
[DEVELOPMENT]: docs/DEVELOPMENT.md
|
|
||||||
[OpenCollective]: https://opencollective.com/mastodon
|
To pull down the updates, re-run
|
||||||
|
|
||||||
|
docker-compose build
|
||||||
|
|
||||||
|
And finally,
|
||||||
|
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
Which will re-create the updated containers, leaving databases and data as is. Depending on what files have been updated, you might need to re-run migrations and asset compilation.
|
||||||
|
|
||||||
|
### Contributing
|
||||||
|
|
||||||
|
You can open issues for bugs you've found or features you think are missing. You can also submit pull requests to this repository. This section may be updated with more details in the future.
|
||||||
|
|
4
Rakefile
4
Rakefile
|
@ -1,8 +1,6 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||||||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||||||
|
|
||||||
require_relative 'config/application'
|
require File.expand_path('../config/application', __FILE__)
|
||||||
|
|
||||||
Rails.application.load_tasks
|
Rails.application.load_tasks
|
||||||
|
|
20
SECURITY.md
20
SECURITY.md
|
@ -1,20 +0,0 @@
|
||||||
# Security Policy
|
|
||||||
|
|
||||||
If you believe you've identified a security vulnerability in Mastodon (a bug that allows something to happen that shouldn't be possible), you can either:
|
|
||||||
|
|
||||||
- open a [GitHub security issue on the Mastodon project](https://github.com/mastodon/mastodon/security/advisories/new)
|
|
||||||
- reach us at <security@joinmastodon.org>
|
|
||||||
|
|
||||||
You should _not_ report such issues on public GitHub issues or in other public spaces to give us time to publish a fix for the issue without exposing Mastodon's users to increased risk.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
A "vulnerability in Mastodon" is a vulnerability in the code distributed through our main source code repository on GitHub. Vulnerabilities that are specific to a given installation (e.g. misconfiguration) should be reported to the owner of that installation and not us.
|
|
||||||
|
|
||||||
## Supported Versions
|
|
||||||
|
|
||||||
| Version | Supported |
|
|
||||||
| ------- | --------- |
|
|
||||||
| 4.3.x | Yes |
|
|
||||||
| 4.2.x | Yes |
|
|
||||||
| < 4.2 | No |
|
|
201
Vagrantfile
vendored
201
Vagrantfile
vendored
|
@ -1,201 +0,0 @@
|
||||||
# -*- mode: ruby -*-
|
|
||||||
# vi: set ft=ruby :
|
|
||||||
|
|
||||||
ENV["PORT"] ||= "3000"
|
|
||||||
|
|
||||||
$provisionA = <<SCRIPT
|
|
||||||
|
|
||||||
# Add the yarn repo + yarn repo keys
|
|
||||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
|
||||||
sudo apt-add-repository 'deb https://dl.yarnpkg.com/debian/ stable main'
|
|
||||||
|
|
||||||
# Add repo for NodeJS
|
|
||||||
sudo mkdir -p /etc/apt/keyrings
|
|
||||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
|
||||||
NODE_MAJOR=20
|
|
||||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
|
|
||||||
sudo apt-get update
|
|
||||||
|
|
||||||
# Add firewall rule to redirect 80 to PORT and save
|
|
||||||
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port #{ENV["PORT"]}
|
|
||||||
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
|
|
||||||
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
|
|
||||||
sudo apt-get install iptables-persistent -y
|
|
||||||
|
|
||||||
# Add packages to build and run Mastodon
|
|
||||||
sudo apt-get install \
|
|
||||||
git-core \
|
|
||||||
g++ \
|
|
||||||
libpq-dev \
|
|
||||||
libxml2-dev \
|
|
||||||
libxslt1-dev \
|
|
||||||
imagemagick \
|
|
||||||
nodejs \
|
|
||||||
redis-server \
|
|
||||||
redis-tools \
|
|
||||||
postgresql \
|
|
||||||
postgresql-contrib \
|
|
||||||
libicu-dev \
|
|
||||||
libidn11-dev \
|
|
||||||
libreadline6-dev \
|
|
||||||
autoconf \
|
|
||||||
bison \
|
|
||||||
build-essential \
|
|
||||||
ffmpeg \
|
|
||||||
file \
|
|
||||||
gcc \
|
|
||||||
libffi-dev \
|
|
||||||
libgdbm-dev \
|
|
||||||
libjemalloc-dev \
|
|
||||||
libncurses5-dev \
|
|
||||||
libprotobuf-dev \
|
|
||||||
libssl-dev \
|
|
||||||
libyaml-dev \
|
|
||||||
pkg-config \
|
|
||||||
protobuf-compiler \
|
|
||||||
zlib1g-dev \
|
|
||||||
-y
|
|
||||||
|
|
||||||
# Install rvm
|
|
||||||
sudo apt-add-repository -y ppa:rael-gc/rvm
|
|
||||||
sudo apt-get install rvm -y
|
|
||||||
|
|
||||||
sudo usermod -a -G rvm $USER
|
|
||||||
|
|
||||||
SCRIPT
|
|
||||||
|
|
||||||
$provisionElasticsearch = <<SCRIPT
|
|
||||||
# Install Elastic Search
|
|
||||||
sudo apt install openjdk-17-jre-headless -y
|
|
||||||
sudo wget -O /usr/share/keyrings/elasticsearch.asc https://artifacts.elastic.co/GPG-KEY-elasticsearch
|
|
||||||
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/elasticsearch.asc] https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install elasticsearch -y
|
|
||||||
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable --now elasticsearch
|
|
||||||
|
|
||||||
echo 'path.data: /var/lib/elasticsearch
|
|
||||||
path.logs: /var/log/elasticsearch
|
|
||||||
network.host: 0.0.0.0
|
|
||||||
http.port: 9200
|
|
||||||
discovery.seed_hosts: ["localhost"]
|
|
||||||
cluster.initial_master_nodes: ["node-1"]
|
|
||||||
xpack.security.enabled: false' > /etc/elasticsearch/elasticsearch.yml
|
|
||||||
|
|
||||||
sudo systemctl restart elasticsearch
|
|
||||||
|
|
||||||
# Install Kibana
|
|
||||||
sudo apt install kibana -y
|
|
||||||
sudo systemctl enable --now kibana
|
|
||||||
|
|
||||||
echo 'server.host: "0.0.0.0"
|
|
||||||
elasticsearch.hosts: ["http://localhost:9200"]' > /etc/kibana/kibana.yml
|
|
||||||
|
|
||||||
sudo systemctl restart kibana
|
|
||||||
|
|
||||||
SCRIPT
|
|
||||||
|
|
||||||
$provisionB = <<SCRIPT
|
|
||||||
|
|
||||||
source "/etc/profile.d/rvm.sh"
|
|
||||||
|
|
||||||
# Install Ruby
|
|
||||||
read RUBY_VERSION < /vagrant/.ruby-version
|
|
||||||
rvm install ruby-$RUBY_VERSION --disable-binary
|
|
||||||
|
|
||||||
# Configure database
|
|
||||||
sudo -u postgres createuser -U postgres vagrant -s
|
|
||||||
sudo -u postgres createdb -U postgres mastodon_development
|
|
||||||
|
|
||||||
cd /vagrant # This is where the host folder/repo is mounted
|
|
||||||
|
|
||||||
# Install gems
|
|
||||||
gem install bundler foreman
|
|
||||||
bundle install
|
|
||||||
|
|
||||||
# Install node modules
|
|
||||||
sudo corepack enable
|
|
||||||
corepack prepare
|
|
||||||
yarn install
|
|
||||||
|
|
||||||
# Build Mastodon
|
|
||||||
export RAILS_ENV=development
|
|
||||||
export $(cat ".env.vagrant" | xargs)
|
|
||||||
bundle exec rails db:setup
|
|
||||||
|
|
||||||
# Configure automatic loading of environment variable
|
|
||||||
echo 'export RAILS_ENV=development' >> ~/.bash_profile
|
|
||||||
echo 'export $(cat "/vagrant/.env.vagrant" | xargs)' >> ~/.bash_profile
|
|
||||||
|
|
||||||
SCRIPT
|
|
||||||
|
|
||||||
VAGRANTFILE_API_VERSION = "2"
|
|
||||||
|
|
||||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
||||||
|
|
||||||
config.vm.box = "ubuntu/focal64"
|
|
||||||
|
|
||||||
config.vm.provider :virtualbox do |vb|
|
|
||||||
vb.name = "mastodon"
|
|
||||||
vb.customize ["modifyvm", :id, "--memory", "8192"]
|
|
||||||
vb.customize ["modifyvm", :id, "--cpus", "3"]
|
|
||||||
|
|
||||||
# Disable VirtualBox DNS proxy to skip long-delay IPv6 resolutions.
|
|
||||||
# https://github.com/mitchellh/vagrant/issues/1172
|
|
||||||
vb.customize ["modifyvm", :id, "--natdnsproxy1", "off"]
|
|
||||||
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "off"]
|
|
||||||
|
|
||||||
# Use "virtio" network interfaces for better performance.
|
|
||||||
vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
|
|
||||||
vb.customize ["modifyvm", :id, "--nictype2", "virtio"]
|
|
||||||
end
|
|
||||||
|
|
||||||
config.vm.provider :libvirt do |libvirt|
|
|
||||||
libvirt.cpus = 3
|
|
||||||
libvirt.memory = 8192
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# This uses the vagrant-hostsupdater plugin, and lets you
|
|
||||||
# access the development site at http://mastodon.local.
|
|
||||||
# If you change it, also change it in .env.vagrant before provisioning
|
|
||||||
# the vagrant server to update the development build.
|
|
||||||
#
|
|
||||||
# To install:
|
|
||||||
# $ vagrant plugin install vagrant-hostsupdater
|
|
||||||
config.vm.hostname = "mastodon.local"
|
|
||||||
|
|
||||||
if defined?(VagrantPlugins::HostsUpdater)
|
|
||||||
config.vm.network :private_network, ip: "192.168.42.42", nictype: "virtio"
|
|
||||||
config.hostsupdater.remove_on_suspend = false
|
|
||||||
end
|
|
||||||
|
|
||||||
if config.vm.networks.any? { |type, options| type == :private_network }
|
|
||||||
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['rw', 'actimeo=1']
|
|
||||||
else
|
|
||||||
config.vm.synced_folder ".", "/vagrant", type: "rsync", create: true, rsync__args: ["--verbose", "--archive", "--delete", "-z"]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Otherwise, you can access the site at http://localhost:3000 and http://localhost:4000 , http://localhost:8080
|
|
||||||
config.vm.network :forwarded_port, guest: 3000, host: 3000
|
|
||||||
config.vm.network :forwarded_port, guest: 3035, host: 3035
|
|
||||||
config.vm.network :forwarded_port, guest: 4000, host: 4000
|
|
||||||
config.vm.network :forwarded_port, guest: 8080, host: 8080
|
|
||||||
config.vm.network :forwarded_port, guest: 9200, host: 9200
|
|
||||||
config.vm.network :forwarded_port, guest: 9300, host: 9300
|
|
||||||
config.vm.network :forwarded_port, guest: 9243, host: 9243
|
|
||||||
config.vm.network :forwarded_port, guest: 5601, host: 5601
|
|
||||||
|
|
||||||
# Full provisioning script, only runs on first 'vagrant up' or with 'vagrant provision'
|
|
||||||
config.vm.provision :shell, inline: $provisionA, privileged: false, reset: true
|
|
||||||
# Run with elevated privileges for Elasticsearch installation
|
|
||||||
config.vm.provision :shell, inline: $provisionElasticsearch, privileged: true
|
|
||||||
config.vm.provision :shell, inline: $provisionB, privileged: false
|
|
||||||
|
|
||||||
config.vm.post_up_message = <<MESSAGE
|
|
||||||
To start server
|
|
||||||
$ vagrant ssh -c "cd /vagrant && bin/dev"
|
|
||||||
MESSAGE
|
|
||||||
|
|
||||||
end
|
|
107
app.json
107
app.json
|
@ -1,107 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Mastodon",
|
|
||||||
"description": "A GNU Social-compatible microblogging server",
|
|
||||||
"repository": "https://github.com/mastodon/mastodon",
|
|
||||||
"logo": "https://github.com/mastodon.png",
|
|
||||||
"env": {
|
|
||||||
"HEROKU": {
|
|
||||||
"description": "Leave this as true",
|
|
||||||
"value": "true",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
"LOCAL_DOMAIN": {
|
|
||||||
"description": "The domain that your Mastodon instance will run on (this can be appname.herokuapp.com or a custom domain)",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
"SECRET_KEY_BASE": {
|
|
||||||
"description": "The secret key base",
|
|
||||||
"generator": "secret"
|
|
||||||
},
|
|
||||||
"SINGLE_USER_MODE": {
|
|
||||||
"description": "Should the instance run in single user mode? (Disable registrations, redirect to front page)",
|
|
||||||
"value": "false",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
"S3_ENABLED": {
|
|
||||||
"description": "Should Mastodon use Amazon S3 for storage? This is highly recommended, as Heroku does not have persistent file storage (files will be lost).",
|
|
||||||
"value": "true",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"S3_BUCKET": {
|
|
||||||
"description": "Amazon S3 Bucket",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"S3_REGION": {
|
|
||||||
"description": "Amazon S3 region that the bucket is located in",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"AWS_ACCESS_KEY_ID": {
|
|
||||||
"description": "Amazon S3 Access Key",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"AWS_SECRET_ACCESS_KEY": {
|
|
||||||
"description": "Amazon S3 Secret Key",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_SERVER": {
|
|
||||||
"description": "Hostname for SMTP server, if you want to enable email",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_PORT": {
|
|
||||||
"description": "Port for SMTP server",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_LOGIN": {
|
|
||||||
"description": "Username for SMTP server",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_PASSWORD": {
|
|
||||||
"description": "Password for SMTP server",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_DOMAIN": {
|
|
||||||
"description": "Domain for SMTP server. Will default to instance domain if blank.",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_FROM_ADDRESS": {
|
|
||||||
"description": "Address to send emails from",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_AUTH_METHOD": {
|
|
||||||
"description": "Authentication method to use with SMTP server. Default is 'plain'.",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_OPENSSL_VERIFY_MODE": {
|
|
||||||
"description": "SMTP server certificate verification mode. Defaults is 'peer'.",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_ENABLE_STARTTLS": {
|
|
||||||
"description": "Enable STARTTLS? Default is 'auto'.",
|
|
||||||
"value": "auto",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_ENABLE_STARTTLS_AUTO": {
|
|
||||||
"description": "Enable STARTTLS if SMTP server supports it? Deprecated by SMTP_ENABLE_STARTTLS.",
|
|
||||||
"required": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"buildpacks": [
|
|
||||||
{
|
|
||||||
"url": "https://github.com/heroku/heroku-buildpack-activestorage-preview"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/heroku/heroku-buildpack-apt"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "heroku/nodejs"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "heroku/ruby"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"scripts": {
|
|
||||||
"postdeploy": "bundle exec rails db:migrate && bundle exec rails db:seed"
|
|
||||||
},
|
|
||||||
"addons": ["heroku-postgresql", "heroku-redis"],
|
|
||||||
"stack": "heroku-24"
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user