Compare commits
13 commits
main
...
nolan/butt
Author | SHA1 | Date | |
---|---|---|---|
|
c088c35271 | ||
|
519da06d32 | ||
|
0e9db8267a | ||
|
e7f24a0e71 | ||
|
a1befe3e21 | ||
|
a788bdf532 | ||
|
d69f05beba | ||
|
64951cf24f | ||
|
5c98479d1a | ||
|
4370a273b3 | ||
|
c050add235 | ||
|
d5621067bd | ||
|
7a2db7a396 |
1857 changed files with 49992 additions and 94035 deletions
|
@ -1,8 +1,8 @@
|
||||||
version: 2.1
|
version: 2.1
|
||||||
|
|
||||||
orbs:
|
orbs:
|
||||||
ruby: circleci/ruby@2.0.0
|
ruby: circleci/ruby@1.4.1
|
||||||
node: circleci/node@5.0.3
|
node: circleci/node@5.0.1
|
||||||
|
|
||||||
executors:
|
executors:
|
||||||
default:
|
default:
|
||||||
|
@ -19,11 +19,11 @@ executors:
|
||||||
DB_USER: root
|
DB_USER: root
|
||||||
DISABLE_SIMPLECOV: true
|
DISABLE_SIMPLECOV: true
|
||||||
RAILS_ENV: test
|
RAILS_ENV: test
|
||||||
- image: cimg/postgres:14.5
|
- image: cimg/postgres:14.0
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: root
|
POSTGRES_USER: root
|
||||||
POSTGRES_HOST_AUTH_METHOD: trust
|
POSTGRES_HOST_AUTH_METHOD: trust
|
||||||
- image: cimg/redis:7.0
|
- image: cimg/redis:6.2
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
install-system-dependencies:
|
install-system-dependencies:
|
||||||
|
@ -45,7 +45,7 @@ commands:
|
||||||
bundle config without 'development production'
|
bundle config without 'development production'
|
||||||
name: Set bundler settings
|
name: Set bundler settings
|
||||||
- ruby/install-deps:
|
- ruby/install-deps:
|
||||||
bundler-version: '2.3.26'
|
bundler-version: '2.3.8'
|
||||||
key: ruby<< parameters.ruby-version >>-gems-v1
|
key: ruby<< parameters.ruby-version >>-gems-v1
|
||||||
wait-db:
|
wait-db:
|
||||||
steps:
|
steps:
|
||||||
|
@ -68,9 +68,7 @@ jobs:
|
||||||
cache-version: v1
|
cache-version: v1
|
||||||
pkg-manager: yarn
|
pkg-manager: yarn
|
||||||
- run:
|
- run:
|
||||||
command: |
|
command: ./bin/rails assets:precompile
|
||||||
export NODE_OPTIONS=--openssl-legacy-provider
|
|
||||||
./bin/rails assets:precompile
|
|
||||||
name: Precompile assets
|
name: Precompile assets
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
paths:
|
paths:
|
||||||
|
@ -135,12 +133,6 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
command: ./bin/rails tests:migrations:populate_v2_4
|
command: ./bin/rails tests:migrations:populate_v2_4
|
||||||
name: Populate database with test data
|
name: Populate database with test data
|
||||||
- run:
|
|
||||||
command: ./bin/rails db:migrate VERSION=20180707154237
|
|
||||||
name: Run migrations up to v2.4.3
|
|
||||||
- run:
|
|
||||||
command: ./bin/rails tests:migrations:populate_v2_4_3
|
|
||||||
name: Populate database with test data
|
|
||||||
- run:
|
- run:
|
||||||
command: ./bin/rails db:migrate
|
command: ./bin/rails db:migrate
|
||||||
name: Run all remaining migrations
|
name: Run all remaining migrations
|
||||||
|
@ -175,22 +167,14 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
command: ./bin/rails tests:migrations:populate_v2_4
|
command: ./bin/rails tests:migrations:populate_v2_4
|
||||||
name: Populate database with test data
|
name: Populate database with test data
|
||||||
- run:
|
|
||||||
command: ./bin/rails db:migrate VERSION=20180707154237
|
|
||||||
name: Run migrations up to v2.4.3
|
|
||||||
environment:
|
|
||||||
SKIP_POST_DEPLOYMENT_MIGRATIONS: true
|
|
||||||
- run:
|
|
||||||
command: ./bin/rails tests:migrations:populate_v2_4_3
|
|
||||||
name: Populate database with test data
|
|
||||||
- run:
|
- run:
|
||||||
command: ./bin/rails db:migrate
|
command: ./bin/rails db:migrate
|
||||||
name: Run all remaining pre-deployment migrations
|
name: Run all pre-deployment migrations
|
||||||
environment:
|
environment:
|
||||||
SKIP_POST_DEPLOYMENT_MIGRATIONS: true
|
SKIP_POST_DEPLOYMENT_MIGRATIONS: true
|
||||||
- run:
|
- run:
|
||||||
command: ./bin/rails db:migrate
|
command: ./bin/rails db:migrate
|
||||||
name: Run all post-deployment migrations
|
name: Run all post-deployment remaining migrations
|
||||||
- run:
|
- run:
|
||||||
command: ./bin/rails tests:migrations:check_database
|
command: ./bin/rails tests:migrations:check_database
|
||||||
name: Check migration result
|
name: Check migration result
|
||||||
|
@ -221,5 +205,5 @@ workflows:
|
||||||
pkg-manager: yarn
|
pkg-manager: yarn
|
||||||
requires:
|
requires:
|
||||||
- build
|
- build
|
||||||
version: '16.18'
|
version: lts
|
||||||
yarn-run: test:jest
|
yarn-run: test:jest
|
||||||
|
|
|
@ -26,11 +26,13 @@ plugins:
|
||||||
bundler-audit:
|
bundler-audit:
|
||||||
enabled: true
|
enabled: true
|
||||||
eslint:
|
eslint:
|
||||||
enabled: false
|
enabled: true
|
||||||
|
channel: eslint-7
|
||||||
rubocop:
|
rubocop:
|
||||||
enabled: false
|
enabled: true
|
||||||
|
channel: rubocop-1-9-1
|
||||||
sass-lint:
|
sass-lint:
|
||||||
enabled: false
|
enabled: true
|
||||||
exclude_patterns:
|
exclude_patterns:
|
||||||
- spec/
|
- spec/
|
||||||
- vendor/asset/
|
- vendor/asset/
|
||||||
|
|
|
@ -9,7 +9,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT}
|
||||||
# The value is a comma-separated list of allowed domains
|
# The value is a comma-separated list of allowed domains
|
||||||
ENV RAILS_DEVELOPMENT_HOSTS=".githubpreview.dev"
|
ENV RAILS_DEVELOPMENT_HOSTS=".githubpreview.dev"
|
||||||
|
|
||||||
# [Choice] Node.js version: lts/*, 18, 16, 14
|
# [Choice] Node.js version: lts/*, 16, 14, 12, 10
|
||||||
ARG NODE_VERSION="lts/*"
|
ARG NODE_VERSION="lts/*"
|
||||||
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"
|
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "Mastodon",
|
"name": "Mastodon",
|
||||||
"dockerComposeFile": "docker-compose.yml",
|
"dockerComposeFile": "docker-compose.yml",
|
||||||
"service": "app",
|
"service": "app",
|
||||||
"workspaceFolder": "/mastodon",
|
"workspaceFolder": "/workspaces/mastodon",
|
||||||
|
|
||||||
// Set *default* container specific settings.json values on container create.
|
// Set *default* container specific settings.json values on container create.
|
||||||
"settings": {},
|
"settings": {},
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
"forwardPorts": [3000, 4000],
|
"forwardPorts": [3000, 4000],
|
||||||
|
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
"postCreateCommand": ".devcontainer/post-create.sh",
|
"postCreateCommand": "bundle install --path vendor/bundle && yarn install && ./bin/rails db:setup",
|
||||||
|
|
||||||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||||
"remoteUser": "vscode"
|
"remoteUser": "vscode"
|
||||||
|
|
|
@ -11,9 +11,9 @@ services:
|
||||||
# Use -bullseye variants on local arm64/Apple Silicon.
|
# Use -bullseye variants on local arm64/Apple Silicon.
|
||||||
VARIANT: '3.0-bullseye'
|
VARIANT: '3.0-bullseye'
|
||||||
# Optional Node.js version to install
|
# Optional Node.js version to install
|
||||||
NODE_VERSION: '16'
|
NODE_VERSION: '14'
|
||||||
volumes:
|
volumes:
|
||||||
- ..:/mastodon:cached
|
- ..:/workspaces/mastodon:cached
|
||||||
environment:
|
environment:
|
||||||
RAILS_ENV: development
|
RAILS_ENV: development
|
||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
|
@ -27,7 +27,6 @@ services:
|
||||||
ES_ENABLED: 'true'
|
ES_ENABLED: 'true'
|
||||||
ES_HOST: es
|
ES_HOST: es
|
||||||
ES_PORT: '9200'
|
ES_PORT: '9200'
|
||||||
LIBRE_TRANSLATE_ENDPOINT: http://libretranslate:5000
|
|
||||||
# Overrides default command so things don't shut down after the process ends.
|
# Overrides default command so things don't shut down after the process ends.
|
||||||
command: sleep infinity
|
command: sleep infinity
|
||||||
networks:
|
networks:
|
||||||
|
@ -73,12 +72,6 @@ services:
|
||||||
soft: -1
|
soft: -1
|
||||||
hard: -1
|
hard: -1
|
||||||
|
|
||||||
libretranslate:
|
|
||||||
image: libretranslate/libretranslate:v1.2.9
|
|
||||||
restart: unless-stopped
|
|
||||||
networks:
|
|
||||||
- internal_network
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres-data:
|
postgres-data:
|
||||||
redis-data:
|
redis-data:
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e # Fail the whole script on first error
|
|
||||||
|
|
||||||
# Fetch Ruby gem dependencies
|
|
||||||
bundle install --path vendor/bundle --with='development test'
|
|
||||||
|
|
||||||
# Fetch Javascript dependencies
|
|
||||||
yarn install
|
|
||||||
|
|
||||||
# Make Gemfile.lock pristine again
|
|
||||||
git checkout -- Gemfile.lock
|
|
||||||
|
|
||||||
# [re]create, migrate, and seed the test database
|
|
||||||
RAILS_ENV=test ./bin/rails db:setup
|
|
||||||
|
|
||||||
# Precompile assets for development
|
|
||||||
RAILS_ENV=development ./bin/rails assets:precompile
|
|
||||||
|
|
||||||
# Precompile assets for test
|
|
||||||
RAILS_ENV=test NODE_ENV=tests ./bin/rails assets:precompile
|
|
254
.env.nanobox
Normal file
254
.env.nanobox
Normal file
|
@ -0,0 +1,254 @@
|
||||||
|
# Service dependencies
|
||||||
|
# You may set REDIS_URL instead for more advanced options
|
||||||
|
REDIS_HOST=$DATA_REDIS_HOST
|
||||||
|
REDIS_PORT=6379
|
||||||
|
# REDIS_DB=0
|
||||||
|
|
||||||
|
# You may set DATABASE_URL instead for more advanced options
|
||||||
|
DB_HOST=$DATA_DB_HOST
|
||||||
|
DB_USER=$DATA_DB_USER
|
||||||
|
DB_NAME=gonano
|
||||||
|
DB_PASS=$DATA_DB_PASS
|
||||||
|
DB_PORT=5432
|
||||||
|
|
||||||
|
# DATABASE_URL=postgresql://$DATA_DB_USER:$DATA_DB_PASS@$DATA_DB_HOST/gonano
|
||||||
|
|
||||||
|
# Optional Elasticsearch configuration
|
||||||
|
ES_ENABLED=true
|
||||||
|
ES_HOST=$DATA_ELASTIC_HOST
|
||||||
|
ES_PORT=9200
|
||||||
|
|
||||||
|
BIND=0.0.0.0
|
||||||
|
|
||||||
|
# Federation
|
||||||
|
# Note: Changing LOCAL_DOMAIN at a later time will cause unwanted side effects, including breaking all existing federation.
|
||||||
|
# LOCAL_DOMAIN should *NOT* contain the protocol part of the domain e.g https://example.com.
|
||||||
|
LOCAL_DOMAIN=${APP_NAME}.nanoapp.io
|
||||||
|
|
||||||
|
# Changing LOCAL_HTTPS in production is no longer supported. (Mastodon will always serve https:// links)
|
||||||
|
|
||||||
|
# Use this only if you need to run mastodon on a different domain than the one used for federation.
|
||||||
|
# You can read more about this option on https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Serving_a_different_domain.md
|
||||||
|
# DO *NOT* USE THIS UNLESS YOU KNOW *EXACTLY* WHAT YOU ARE DOING.
|
||||||
|
# WEB_DOMAIN=mastodon.example.com
|
||||||
|
|
||||||
|
# Use this if you want to have several aliases handler@example1.com
|
||||||
|
# handler@example2.com etc. for the same user. LOCAL_DOMAIN should not
|
||||||
|
# be added. Comma separated values
|
||||||
|
# ALTERNATE_DOMAINS=example1.com,example2.com
|
||||||
|
|
||||||
|
# Application secrets
|
||||||
|
# Generate each with the `rake secret` task (`nanobox run bundle exec rake secret`)
|
||||||
|
SECRET_KEY_BASE=$SECRET_KEY_BASE
|
||||||
|
OTP_SECRET=$OTP_SECRET
|
||||||
|
|
||||||
|
# VAPID keys (used for push notifications)
|
||||||
|
# You can generate the keys using the following command (first is the private key, second is the public one)
|
||||||
|
# You should only generate this once per instance. If you later decide to change it, all push subscription will
|
||||||
|
# be invalidated, requiring the users to access the website again to resubscribe.
|
||||||
|
#
|
||||||
|
# Generate with `rake mastodon:webpush:generate_vapid_key` task (`nanobox run bundle exec rake mastodon:webpush:generate_vapid_key`)
|
||||||
|
#
|
||||||
|
# For more information visit https://rossta.net/blog/using-the-web-push-api-with-vapid.html
|
||||||
|
VAPID_PRIVATE_KEY=$VAPID_PRIVATE_KEY
|
||||||
|
VAPID_PUBLIC_KEY=$VAPID_PUBLIC_KEY
|
||||||
|
|
||||||
|
# Registrations
|
||||||
|
# Single user mode will disable registrations and redirect frontpage to the first profile
|
||||||
|
# SINGLE_USER_MODE=true
|
||||||
|
# Prevent registrations with following e-mail domains
|
||||||
|
# EMAIL_DOMAIN_BLACKLIST=example1.com|example2.de|etc
|
||||||
|
# Only allow registrations with the following e-mail domains
|
||||||
|
# EMAIL_DOMAIN_WHITELIST=example1.com|example2.de|etc
|
||||||
|
|
||||||
|
# Optionally change default language
|
||||||
|
# DEFAULT_LOCALE=de
|
||||||
|
|
||||||
|
# E-mail configuration
|
||||||
|
# Note: Mailgun and SparkPost (https://sparkpo.st/smtp) each have good free tiers
|
||||||
|
# If you want to use an SMTP server without authentication (e.g local Postfix relay)
|
||||||
|
# then set SMTP_AUTH_METHOD and SMTP_OPENSSL_VERIFY_MODE to 'none' and
|
||||||
|
# *comment* SMTP_LOGIN and SMTP_PASSWORD (leaving them blank is not enough).
|
||||||
|
SMTP_SERVER=$SMTP_SERVER
|
||||||
|
SMTP_PORT=587
|
||||||
|
SMTP_LOGIN=$SMTP_LOGIN
|
||||||
|
SMTP_PASSWORD=$SMTP_PASSWORD
|
||||||
|
SMTP_FROM_ADDRESS=notifications@${APP_NAME}.nanoapp.io
|
||||||
|
#SMTP_REPLY_TO=
|
||||||
|
#SMTP_DOMAIN= # defaults to LOCAL_DOMAIN
|
||||||
|
#SMTP_DELIVERY_METHOD=smtp # delivery method can also be sendmail
|
||||||
|
#SMTP_AUTH_METHOD=plain
|
||||||
|
#SMTP_CA_FILE=/etc/ssl/certs/ca-certificates.crt
|
||||||
|
#SMTP_OPENSSL_VERIFY_MODE=peer
|
||||||
|
#SMTP_ENABLE_STARTTLS_AUTO=true
|
||||||
|
#SMTP_TLS=true
|
||||||
|
|
||||||
|
# Optional user upload path and URL (images, avatars). Default is :rails_root/public/system. If you set this variable, you are responsible for making your HTTP server (eg. nginx) serve these files.
|
||||||
|
# PAPERCLIP_ROOT_PATH=/var/lib/mastodon/public-system
|
||||||
|
# PAPERCLIP_ROOT_URL=/system
|
||||||
|
|
||||||
|
# Optional asset host for multi-server setups
|
||||||
|
# The asset host must allow cross origin request from WEB_DOMAIN or LOCAL_DOMAIN
|
||||||
|
# if WEB_DOMAIN is not set. For example, the server may have the
|
||||||
|
# following header field:
|
||||||
|
# Access-Control-Allow-Origin: https://example.com/
|
||||||
|
# CDN_HOST=https://assets.example.com
|
||||||
|
|
||||||
|
# S3 (optional)
|
||||||
|
# The attachment host must allow cross origin request from WEB_DOMAIN or
|
||||||
|
# LOCAL_DOMAIN if WEB_DOMAIN is not set. For example, the server may have the
|
||||||
|
# following header field:
|
||||||
|
# Access-Control-Allow-Origin: https://192.168.1.123:9000/
|
||||||
|
# S3_ENABLED=true
|
||||||
|
# S3_BUCKET=
|
||||||
|
# AWS_ACCESS_KEY_ID=
|
||||||
|
# AWS_SECRET_ACCESS_KEY=
|
||||||
|
# S3_REGION=
|
||||||
|
# S3_PROTOCOL=http
|
||||||
|
# S3_HOSTNAME=192.168.1.123:9000
|
||||||
|
|
||||||
|
# S3 (Minio Config (optional) Please check Minio instance for details)
|
||||||
|
# The attachment host must allow cross origin request - see the description
|
||||||
|
# above.
|
||||||
|
# S3_ENABLED=true
|
||||||
|
# S3_BUCKET=
|
||||||
|
# AWS_ACCESS_KEY_ID=
|
||||||
|
# AWS_SECRET_ACCESS_KEY=
|
||||||
|
# S3_REGION=
|
||||||
|
# S3_PROTOCOL=https
|
||||||
|
# S3_HOSTNAME=
|
||||||
|
# S3_ENDPOINT=
|
||||||
|
# S3_SIGNATURE_VERSION=
|
||||||
|
|
||||||
|
# Google Cloud Storage (optional)
|
||||||
|
# Use S3 compatible API. Since GCS does not support Multipart Upload,
|
||||||
|
# increase the value of S3_MULTIPART_THRESHOLD to disable Multipart Upload.
|
||||||
|
# The attachment host must allow cross origin request - see the description
|
||||||
|
# above.
|
||||||
|
# S3_ENABLED=true
|
||||||
|
# AWS_ACCESS_KEY_ID=
|
||||||
|
# AWS_SECRET_ACCESS_KEY=
|
||||||
|
# S3_REGION=
|
||||||
|
# S3_PROTOCOL=https
|
||||||
|
# S3_HOSTNAME=storage.googleapis.com
|
||||||
|
# S3_ENDPOINT=https://storage.googleapis.com
|
||||||
|
# S3_MULTIPART_THRESHOLD=52428801 # 50.megabytes
|
||||||
|
|
||||||
|
# Swift (optional)
|
||||||
|
# The attachment host must allow cross origin request - see the description
|
||||||
|
# above.
|
||||||
|
# SWIFT_ENABLED=true
|
||||||
|
# SWIFT_USERNAME=
|
||||||
|
# For Keystone V3, the value for SWIFT_TENANT should be the project name
|
||||||
|
# SWIFT_TENANT=
|
||||||
|
# SWIFT_PASSWORD=
|
||||||
|
# Some OpenStack V3 providers require PROJECT_ID (optional)
|
||||||
|
# SWIFT_PROJECT_ID=
|
||||||
|
# Keystone V2 and V3 URLs are supported. Use a V3 URL if possible to avoid
|
||||||
|
# issues with token rate-limiting during high load.
|
||||||
|
# SWIFT_AUTH_URL=
|
||||||
|
# SWIFT_CONTAINER=
|
||||||
|
# SWIFT_OBJECT_URL=
|
||||||
|
# SWIFT_REGION=
|
||||||
|
# Defaults to 'default'
|
||||||
|
# SWIFT_DOMAIN_NAME=
|
||||||
|
# Defaults to 60 seconds. Set to 0 to disable
|
||||||
|
# SWIFT_CACHE_TTL=
|
||||||
|
|
||||||
|
# Optional alias for S3 (e.g. to serve files on a custom domain, possibly using Cloudfront or Cloudflare)
|
||||||
|
# S3_ALIAS_HOST=
|
||||||
|
|
||||||
|
# Streaming API integration
|
||||||
|
# STREAMING_API_BASE_URL=
|
||||||
|
|
||||||
|
# Advanced settings
|
||||||
|
# If you need to use pgBouncer, you need to disable prepared statements:
|
||||||
|
# PREPARED_STATEMENTS=false
|
||||||
|
|
||||||
|
# Cluster number setting for streaming API server.
|
||||||
|
# If you comment out following line, cluster number will be `numOfCpuCores - 1`.
|
||||||
|
# STREAMING_CLUSTER_NUM=1
|
||||||
|
|
||||||
|
# Docker mastodon user
|
||||||
|
# If you use Docker, you may want to assign UID/GID manually.
|
||||||
|
# UID=1000
|
||||||
|
# GID=1000
|
||||||
|
|
||||||
|
# LDAP authentication (optional)
|
||||||
|
# LDAP_ENABLED=true
|
||||||
|
# LDAP_HOST=localhost
|
||||||
|
# LDAP_PORT=389
|
||||||
|
# LDAP_METHOD=simple_tls
|
||||||
|
# LDAP_BASE=
|
||||||
|
# LDAP_BIND_DN=
|
||||||
|
# LDAP_PASSWORD=
|
||||||
|
# LDAP_UID=cn
|
||||||
|
# LDAP_MAIL=mail
|
||||||
|
# LDAP_SEARCH_FILTER=(|(%{uid}=%{email})(%{mail}=%{email}))
|
||||||
|
# LDAP_UID_CONVERSION_ENABLED=true
|
||||||
|
# LDAP_UID_CONVERSION_SEARCH=., -
|
||||||
|
# LDAP_UID_CONVERSION_REPLACE=_
|
||||||
|
|
||||||
|
# PAM authentication (optional)
|
||||||
|
# PAM authentication uses for the email generation the "email" pam variable
|
||||||
|
# and optional as fallback PAM_DEFAULT_SUFFIX
|
||||||
|
# The pam environment variable "email" is provided by:
|
||||||
|
# https://github.com/devkral/pam_email_extractor
|
||||||
|
# PAM_ENABLED=true
|
||||||
|
# Fallback email domain for email address generation (LOCAL_DOMAIN by default)
|
||||||
|
# PAM_EMAIL_DOMAIN=example.com
|
||||||
|
# Name of the pam service (pam "auth" section is evaluated)
|
||||||
|
# PAM_DEFAULT_SERVICE=rpam
|
||||||
|
# Name of the pam service used for checking if an user can register (pam "account" section is evaluated) (nil (disabled) by default)
|
||||||
|
# PAM_CONTROLLED_SERVICE=rpam
|
||||||
|
|
||||||
|
# Optional CAS authentication (cf. omniauth-cas) :
|
||||||
|
# CAS_ENABLED=true
|
||||||
|
# CAS_URL=https://sso.myserver.com/
|
||||||
|
# CAS_HOST=sso.myserver.com/
|
||||||
|
# CAS_PORT=443
|
||||||
|
# CAS_SSL=true
|
||||||
|
# CAS_VALIDATE_URL=
|
||||||
|
# CAS_CALLBACK_URL=
|
||||||
|
# CAS_LOGOUT_URL=
|
||||||
|
# CAS_LOGIN_URL=
|
||||||
|
# CAS_UID_FIELD='user'
|
||||||
|
# CAS_CA_PATH=
|
||||||
|
# CAS_DISABLE_SSL_VERIFICATION=false
|
||||||
|
# CAS_UID_KEY='user'
|
||||||
|
# CAS_NAME_KEY='name'
|
||||||
|
# CAS_EMAIL_KEY='email'
|
||||||
|
# CAS_NICKNAME_KEY='nickname'
|
||||||
|
# CAS_FIRST_NAME_KEY='firstname'
|
||||||
|
# CAS_LAST_NAME_KEY='lastname'
|
||||||
|
# CAS_LOCATION_KEY='location'
|
||||||
|
# CAS_IMAGE_KEY='image'
|
||||||
|
# CAS_PHONE_KEY='phone'
|
||||||
|
# CAS_SECURITY_ASSUME_EMAIL_IS_VERIFIED=true
|
||||||
|
|
||||||
|
# Optional SAML authentication (cf. omniauth-saml)
|
||||||
|
# SAML_ENABLED=true
|
||||||
|
# SAML_ACS_URL=http://localhost:3000/auth/auth/saml/callback
|
||||||
|
# SAML_ISSUER=https://example.com
|
||||||
|
# SAML_IDP_SSO_TARGET_URL=https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO
|
||||||
|
# SAML_IDP_CERT=
|
||||||
|
# SAML_IDP_CERT_FINGERPRINT=
|
||||||
|
# SAML_NAME_IDENTIFIER_FORMAT=
|
||||||
|
# SAML_CERT=
|
||||||
|
# SAML_PRIVATE_KEY=
|
||||||
|
# SAML_SECURITY_WANT_ASSERTION_SIGNED=true
|
||||||
|
# SAML_SECURITY_WANT_ASSERTION_ENCRYPTED=true
|
||||||
|
# SAML_SECURITY_ASSUME_EMAIL_IS_VERIFIED=true
|
||||||
|
# SAML_ATTRIBUTES_STATEMENTS_UID="urn:oid:0.9.2342.19200300.100.1.1"
|
||||||
|
# SAML_ATTRIBUTES_STATEMENTS_EMAIL="urn:oid:1.3.6.1.4.1.5923.1.1.1.6"
|
||||||
|
# SAML_ATTRIBUTES_STATEMENTS_FULL_NAME="urn:oid:2.16.840.1.113730.3.1.241"
|
||||||
|
# SAML_ATTRIBUTES_STATEMENTS_FIRST_NAME="urn:oid:2.5.4.42"
|
||||||
|
# SAML_ATTRIBUTES_STATEMENTS_LAST_NAME="urn:oid:2.5.4.4"
|
||||||
|
# SAML_UID_ATTRIBUTE="urn:oid:0.9.2342.19200300.100.1.1"
|
||||||
|
# SAML_ATTRIBUTES_STATEMENTS_VERIFIED=
|
||||||
|
# SAML_ATTRIBUTES_STATEMENTS_VERIFIED_EMAIL=
|
||||||
|
|
||||||
|
# Use HTTP proxy for outgoing request (optional)
|
||||||
|
# http_proxy=http://gateway.local:8118
|
||||||
|
# Access control for hidden service.
|
||||||
|
# ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
|
|
@ -54,7 +54,7 @@ VAPID_PUBLIC_KEY=
|
||||||
|
|
||||||
# Sending mail
|
# Sending mail
|
||||||
# ------------
|
# ------------
|
||||||
SMTP_SERVER=
|
SMTP_SERVER=smtp.mailgun.org
|
||||||
SMTP_PORT=587
|
SMTP_PORT=587
|
||||||
SMTP_LOGIN=
|
SMTP_LOGIN=
|
||||||
SMTP_PASSWORD=
|
SMTP_PASSWORD=
|
||||||
|
@ -67,11 +67,3 @@ S3_BUCKET=files.example.com
|
||||||
AWS_ACCESS_KEY_ID=
|
AWS_ACCESS_KEY_ID=
|
||||||
AWS_SECRET_ACCESS_KEY=
|
AWS_SECRET_ACCESS_KEY=
|
||||||
S3_ALIAS_HOST=files.example.com
|
S3_ALIAS_HOST=files.example.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
|
|
||||||
|
|
20
.eslintrc.js
20
.eslintrc.js
|
@ -1,10 +1,6 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
|
|
||||||
extends: [
|
|
||||||
'eslint:recommended',
|
|
||||||
],
|
|
||||||
|
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
node: true,
|
node: true,
|
||||||
|
@ -16,7 +12,7 @@ module.exports = {
|
||||||
ATTACHMENT_HOST: false,
|
ATTACHMENT_HOST: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
parser: '@babel/eslint-parser',
|
parser: 'babel-eslint',
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
'react',
|
'react',
|
||||||
|
@ -31,7 +27,7 @@ module.exports = {
|
||||||
experimentalObjectRestSpread: true,
|
experimentalObjectRestSpread: true,
|
||||||
jsx: true,
|
jsx: true,
|
||||||
},
|
},
|
||||||
ecmaVersion: 2021,
|
ecmaVersion: 2018,
|
||||||
},
|
},
|
||||||
|
|
||||||
settings: {
|
settings: {
|
||||||
|
@ -68,8 +64,8 @@ module.exports = {
|
||||||
eqeqeq: 'error',
|
eqeqeq: 'error',
|
||||||
indent: ['warn', 2],
|
indent: ['warn', 2],
|
||||||
'jsx-quotes': ['error', 'prefer-single'],
|
'jsx-quotes': ['error', 'prefer-single'],
|
||||||
'no-case-declarations': 'off',
|
|
||||||
'no-catch-shadow': 'error',
|
'no-catch-shadow': 'error',
|
||||||
|
'no-cond-assign': 'error',
|
||||||
'no-console': [
|
'no-console': [
|
||||||
'warn',
|
'warn',
|
||||||
{
|
{
|
||||||
|
@ -79,16 +75,18 @@ module.exports = {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'no-empty': 'off',
|
'no-fallthrough': 'error',
|
||||||
|
'no-irregular-whitespace': 'error',
|
||||||
|
'no-mixed-spaces-and-tabs': 'warn',
|
||||||
'no-nested-ternary': 'warn',
|
'no-nested-ternary': 'warn',
|
||||||
'no-prototype-builtins': 'off',
|
|
||||||
'no-restricted-properties': [
|
'no-restricted-properties': [
|
||||||
'error',
|
'error',
|
||||||
{ property: 'substring', message: 'Use .slice instead of .substring.' },
|
{ property: 'substring', message: 'Use .slice instead of .substring.' },
|
||||||
{ property: 'substr', message: 'Use .slice instead of .substr.' },
|
{ property: 'substr', message: 'Use .slice instead of .substr.' },
|
||||||
],
|
],
|
||||||
'no-self-assign': 'off',
|
|
||||||
'no-trailing-spaces': 'warn',
|
'no-trailing-spaces': 'warn',
|
||||||
|
'no-undef': 'error',
|
||||||
|
'no-unreachable': 'error',
|
||||||
'no-unused-expressions': 'error',
|
'no-unused-expressions': 'error',
|
||||||
'no-unused-vars': [
|
'no-unused-vars': [
|
||||||
'error',
|
'error',
|
||||||
|
@ -98,7 +96,6 @@ module.exports = {
|
||||||
ignoreRestSiblings: true,
|
ignoreRestSiblings: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'no-useless-escape': 'off',
|
|
||||||
'object-curly-spacing': ['error', 'always'],
|
'object-curly-spacing': ['error', 'always'],
|
||||||
'padded-blocks': [
|
'padded-blocks': [
|
||||||
'error',
|
'error',
|
||||||
|
@ -108,6 +105,7 @@ module.exports = {
|
||||||
],
|
],
|
||||||
quotes: ['error', 'single'],
|
quotes: ['error', 'single'],
|
||||||
semi: 'error',
|
semi: 'error',
|
||||||
|
strict: 'off',
|
||||||
'valid-typeof': 'error',
|
'valid-typeof': 'error',
|
||||||
|
|
||||||
'react/jsx-boolean-value': 'error',
|
'react/jsx-boolean-value': 'error',
|
||||||
|
|
16
.github/ISSUE_TEMPLATE/1.bug_report.yml
vendored
16
.github/ISSUE_TEMPLATE/1.bug_report.yml
vendored
|
@ -1,6 +1,6 @@
|
||||||
name: Bug Report
|
name: Bug Report
|
||||||
description: If something isn't working as expected
|
description: If something isn't working as expected
|
||||||
labels: [bug]
|
labels: bug
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
@ -31,11 +31,6 @@ body:
|
||||||
description: What happened?
|
description: What happened?
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Detailed description
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Specifications
|
label: Specifications
|
||||||
|
@ -43,14 +38,5 @@ body:
|
||||||
What version or commit hash of Mastodon did you find this bug in?
|
What version or commit hash of Mastodon did you find this bug in?
|
||||||
|
|
||||||
If a front-end issue, what browser and operating systems were you using?
|
If a front-end issue, what browser and operating systems were you using?
|
||||||
placeholder: |
|
|
||||||
Mastodon 3.5.3 (or Edge)
|
|
||||||
Ruby 2.7.6 (or v3.1.2)
|
|
||||||
Node.js 16.18.0
|
|
||||||
|
|
||||||
Google Chrome 106.0.5249.119
|
|
||||||
Firefox 105.0.3
|
|
||||||
|
|
||||||
etc...
|
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
2
.github/ISSUE_TEMPLATE/2.feature_request.yml
vendored
2
.github/ISSUE_TEMPLATE/2.feature_request.yml
vendored
|
@ -1,6 +1,6 @@
|
||||||
name: Feature Request
|
name: Feature Request
|
||||||
description: I have a suggestion
|
description: I have a suggestion
|
||||||
labels: [suggestion]
|
labels: suggestion
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
|
3
.github/ISSUE_TEMPLATE/config.yml
vendored
3
.github/ISSUE_TEMPLATE/config.yml
vendored
|
@ -3,3 +3,6 @@ contact_links:
|
||||||
- name: GitHub Discussions
|
- name: GitHub Discussions
|
||||||
url: https://github.com/mastodon/mastodon/discussions
|
url: https://github.com/mastodon/mastodon/discussions
|
||||||
about: Please ask and answer questions here.
|
about: Please ask and answer questions here.
|
||||||
|
- name: Bug Bounty Program
|
||||||
|
url: https://app.intigriti.com/programs/mastodon/mastodonio/detail
|
||||||
|
about: Please report security vulnerabilities here.
|
||||||
|
|
30
.github/dependabot.yml
vendored
30
.github/dependabot.yml
vendored
|
@ -1,30 +0,0 @@
|
||||||
# To get started with Dependabot version updates, you'll need to specify which
|
|
||||||
# package ecosystems to update and where the package manifests are located.
|
|
||||||
# Please see the documentation for all configuration options:
|
|
||||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: npm
|
|
||||||
directory: '/'
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
open-pull-requests-limit: 99
|
|
||||||
allow:
|
|
||||||
- dependency-type: direct
|
|
||||||
|
|
||||||
- package-ecosystem: bundler
|
|
||||||
directory: '/'
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
open-pull-requests-limit: 99
|
|
||||||
allow:
|
|
||||||
- dependency-type: direct
|
|
||||||
|
|
||||||
- package-ecosystem: github-actions
|
|
||||||
directory: '/'
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
open-pull-requests-limit: 99
|
|
||||||
allow:
|
|
||||||
- dependency-type: direct
|
|
21
.github/stylelint-matcher.json
vendored
21
.github/stylelint-matcher.json
vendored
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "stylelint",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^([^\\s].*)$",
|
|
||||||
"file": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"regexp": "^\\s+((\\d+):(\\d+))?\\s+(✖|×)\\s+(.*)\\s{2,}(.*)$",
|
|
||||||
"line": 2,
|
|
||||||
"column": 3,
|
|
||||||
"message": 5,
|
|
||||||
"code": 6,
|
|
||||||
"loop": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
24
.github/workflows/build-image.yml
vendored
24
.github/workflows/build-image.yml
vendored
|
@ -10,23 +10,19 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/build-image.yml
|
- .github/workflows/build-image.yml
|
||||||
- Dockerfile
|
- Dockerfile
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-image:
|
build-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
- uses: hadolint/hadolint-action@v3.0.0
|
- uses: docker/setup-qemu-action@v1
|
||||||
- uses: docker/setup-qemu-action@v2
|
- uses: docker/setup-buildx-action@v1
|
||||||
- uses: docker/setup-buildx-action@v2
|
- uses: docker/login-action@v1
|
||||||
- uses: docker/login-action@v2
|
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
- uses: docker/metadata-action@v4
|
- uses: docker/metadata-action@v3
|
||||||
id: meta
|
id: meta
|
||||||
with:
|
with:
|
||||||
images: tootsuite/mastodon
|
images: tootsuite/mastodon
|
||||||
|
@ -34,15 +30,13 @@ jobs:
|
||||||
latest=auto
|
latest=auto
|
||||||
tags: |
|
tags: |
|
||||||
type=edge,branch=main
|
type=edge,branch=main
|
||||||
type=pep440,pattern={{raw}}
|
type=match,pattern=v(.*),group=0
|
||||||
type=pep440,pattern=v{{major}}.{{minor}}
|
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
- uses: docker/build-push-action@v3
|
- uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
cache-from: type=gha
|
cache-from: type=registry,ref=tootsuite/mastodon:latest
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=inline
|
||||||
|
|
7
.github/workflows/check-i18n.yml
vendored
7
.github/workflows/check-i18n.yml
vendored
|
@ -9,15 +9,12 @@ on:
|
||||||
env:
|
env:
|
||||||
RAILS_ENV: test
|
RAILS_ENV: test
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-i18n:
|
check-i18n:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
@ -25,7 +22,7 @@ jobs:
|
||||||
- name: Set up Ruby
|
- name: Set up Ruby
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: .ruby-version
|
ruby-version: '3.0'
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
- name: Check locale file normalization
|
- name: Check locale file normalization
|
||||||
run: bundle exec i18n-tasks check-normalized
|
run: bundle exec i18n-tasks check-normalized
|
||||||
|
|
62
.github/workflows/codeql.yml
vendored
62
.github/workflows/codeql.yml
vendored
|
@ -1,62 +0,0 @@
|
||||||
name: 'CodeQL'
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ['main']
|
|
||||||
pull_request:
|
|
||||||
# The branches below must be a subset of the branches above
|
|
||||||
branches: ['main']
|
|
||||||
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@v3
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v2
|
|
||||||
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@v2
|
|
||||||
|
|
||||||
# ℹ️ 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@v2
|
|
||||||
with:
|
|
||||||
category: '/language:${{matrix.language}}'
|
|
85
.github/workflows/linter.yml
vendored
85
.github/workflows/linter.yml
vendored
|
@ -1,85 +0,0 @@
|
||||||
---
|
|
||||||
#################################
|
|
||||||
#################################
|
|
||||||
## Super Linter GitHub Actions ##
|
|
||||||
#################################
|
|
||||||
#################################
|
|
||||||
name: Lint Code Base
|
|
||||||
|
|
||||||
#
|
|
||||||
# Documentation:
|
|
||||||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
|
|
||||||
#
|
|
||||||
|
|
||||||
#############################
|
|
||||||
# Start the job on all push #
|
|
||||||
#############################
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches-ignore: [main]
|
|
||||||
# Remove the line above to run when pushing to master
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
###############
|
|
||||||
# Set the Job #
|
|
||||||
###############
|
|
||||||
permissions:
|
|
||||||
checks: write
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
statuses: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
# Name the Job
|
|
||||||
name: Lint Code Base
|
|
||||||
# Set the agent to run on
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
##################
|
|
||||||
# Load all steps #
|
|
||||||
##################
|
|
||||||
steps:
|
|
||||||
##########################
|
|
||||||
# Checkout the code base #
|
|
||||||
##########################
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
# Full git history is needed to get a proper list of changed files within `super-linter`
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set-up Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version-file: .nvmrc
|
|
||||||
cache: yarn
|
|
||||||
- name: Install dependencies
|
|
||||||
run: yarn install --frozen-lockfile
|
|
||||||
- name: Check prettier formatting
|
|
||||||
run: yarn format-check
|
|
||||||
- name: Set-up RuboCop Problem Mathcher
|
|
||||||
uses: r7kamura/rubocop-problem-matchers-action@v1
|
|
||||||
- name: Set-up Stylelint Problem Matcher
|
|
||||||
uses: xt0rted/stylelint-problem-matcher@v1
|
|
||||||
# https://github.com/xt0rted/stylelint-problem-matcher/issues/360
|
|
||||||
- run: echo "::add-matcher::.github/stylelint-matcher.json"
|
|
||||||
|
|
||||||
################################
|
|
||||||
# Run Linter against code base #
|
|
||||||
################################
|
|
||||||
- name: Lint Code Base
|
|
||||||
uses: github/super-linter@v4
|
|
||||||
env:
|
|
||||||
CSS_FILE_NAME: stylelint.config.js
|
|
||||||
DEFAULT_BRANCH: main
|
|
||||||
NO_COLOR: 1 # https://github.com/xt0rted/stylelint-problem-matcher/issues/360
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.js
|
|
||||||
LINTER_RULES_PATH: .
|
|
||||||
RUBY_CONFIG_FILE: .rubocop.yml
|
|
||||||
VALIDATE_ALL_CODEBASE: false
|
|
||||||
VALIDATE_CSS: true
|
|
||||||
VALIDATE_JAVASCRIPT_ES: true
|
|
||||||
VALIDATE_RUBY: true
|
|
17
.github/workflows/rebase-needed.yml
vendored
17
.github/workflows/rebase-needed.yml
vendored
|
@ -1,17 +0,0 @@
|
||||||
name: PR Needs Rebase
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request_target:
|
|
||||||
types: [synchronize]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
label-rebase-needed:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check for merge conflicts
|
|
||||||
uses: eps1lon/actions-label-merge-conflict@releases/2.x
|
|
||||||
with:
|
|
||||||
dirtyLabel: 'rebase needed :construction:'
|
|
||||||
repoToken: '${{ secrets.GITHUB_TOKEN }}'
|
|
||||||
commentOnDirty: This pull request has merge conflicts that must be resolved before it can be merged.
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -44,6 +44,9 @@
|
||||||
/redis
|
/redis
|
||||||
/elasticsearch
|
/elasticsearch
|
||||||
|
|
||||||
|
# ignore Helm dependency charts
|
||||||
|
/chart/charts/*.tgz
|
||||||
|
|
||||||
# Ignore Apple files
|
# Ignore Apple files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
|
2
.nvmrc
2
.nvmrc
|
@ -1 +1 @@
|
||||||
16
|
14
|
||||||
|
|
|
@ -44,6 +44,9 @@
|
||||||
/redis
|
/redis
|
||||||
/elasticsearch
|
/elasticsearch
|
||||||
|
|
||||||
|
# ignore Helm dependency charts
|
||||||
|
/chart/charts/*.tgz
|
||||||
|
|
||||||
# Ignore Apple files
|
# Ignore Apple files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
@ -64,6 +67,9 @@ yarn-debug.log
|
||||||
# Ignore Docker option files
|
# Ignore Docker option files
|
||||||
docker-compose.override.yml
|
docker-compose.override.yml
|
||||||
|
|
||||||
|
# Ignore Helm files
|
||||||
|
/chart
|
||||||
|
|
||||||
# Ignore emoji map file
|
# Ignore emoji map file
|
||||||
/app/javascript/mastodon/features/emoji/emoji_map.json
|
/app/javascript/mastodon/features/emoji/emoji_map.json
|
||||||
|
|
||||||
|
|
211
.rubocop.yml
211
.rubocop.yml
|
@ -1,18 +1,12 @@
|
||||||
require:
|
require:
|
||||||
- rubocop-rails
|
- rubocop-rails
|
||||||
- rubocop-rspec
|
|
||||||
- rubocop-performance
|
|
||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
TargetRubyVersion: 2.7
|
TargetRubyVersion: 2.5
|
||||||
DisplayCopNames: true
|
NewCops: disable
|
||||||
DisplayStyleGuide: true
|
|
||||||
ExtraDetails: true
|
|
||||||
UseCache: true
|
|
||||||
CacheRootDirectory: tmp
|
|
||||||
NewCops: enable
|
|
||||||
Exclude:
|
Exclude:
|
||||||
- db/schema.rb
|
- 'spec/**/*'
|
||||||
|
- 'db/**/*'
|
||||||
- 'app/views/**/*'
|
- 'app/views/**/*'
|
||||||
- 'config/**/*'
|
- 'config/**/*'
|
||||||
- 'bin/*'
|
- 'bin/*'
|
||||||
|
@ -73,57 +67,15 @@ Lint/UselessAccessModifier:
|
||||||
- class_methods
|
- class_methods
|
||||||
|
|
||||||
Metrics/AbcSize:
|
Metrics/AbcSize:
|
||||||
Max: 34 # RuboCop default 17
|
Max: 100
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'lib/**/*cli*.rb'
|
- 'lib/mastodon/*_cli.rb'
|
||||||
- db/*migrate/**/*
|
|
||||||
- lib/paperclip/color_extractor.rb
|
|
||||||
- app/workers/scheduler/follow_recommendations_scheduler.rb
|
|
||||||
- app/services/activitypub/fetch*_service.rb
|
|
||||||
- lib/paperclip/**/*
|
|
||||||
CountRepeatedAttributes: false
|
|
||||||
AllowedMethods:
|
|
||||||
- update_media_attachments!
|
|
||||||
- account_link_to
|
|
||||||
- attempt_oembed
|
|
||||||
- build_crutches
|
|
||||||
- calculate_scores
|
|
||||||
- cc
|
|
||||||
- dump_actor!
|
|
||||||
- filter_from_home?
|
|
||||||
- hydrate
|
|
||||||
- import_bookmarks!
|
|
||||||
- import_relationships!
|
|
||||||
- initialize
|
|
||||||
- link_to_mention
|
|
||||||
- log_target
|
|
||||||
- matches_time_window?
|
|
||||||
- parse_metadata
|
|
||||||
- perform_statuses_search!
|
|
||||||
- privatize_media_attachments!
|
|
||||||
- process_update
|
|
||||||
- publish_media_attachments!
|
|
||||||
- remotable_attachment
|
|
||||||
- render_initial_state
|
|
||||||
- render_with_cache
|
|
||||||
- searchable_by
|
|
||||||
- self.cached_filters_for
|
|
||||||
- set_fetchable_attributes!
|
|
||||||
- signed_request_actor
|
|
||||||
- statuses_to_delete
|
|
||||||
- update_poll!
|
|
||||||
|
|
||||||
Metrics/BlockLength:
|
Metrics/BlockLength:
|
||||||
Max: 55
|
Max: 55
|
||||||
Exclude:
|
Exclude:
|
||||||
|
- 'lib/tasks/**/*'
|
||||||
- 'lib/mastodon/*_cli.rb'
|
- 'lib/mastodon/*_cli.rb'
|
||||||
CountComments: false
|
|
||||||
CountAsOne: [array, heredoc]
|
|
||||||
AllowedMethods:
|
|
||||||
- task
|
|
||||||
- namespace
|
|
||||||
- class_methods
|
|
||||||
- included
|
|
||||||
|
|
||||||
Metrics/BlockNesting:
|
Metrics/BlockNesting:
|
||||||
Max: 3
|
Max: 3
|
||||||
|
@ -132,145 +84,35 @@ Metrics/BlockNesting:
|
||||||
|
|
||||||
Metrics/ClassLength:
|
Metrics/ClassLength:
|
||||||
CountComments: false
|
CountComments: false
|
||||||
Max: 500
|
Max: 400
|
||||||
CountAsOne: [array, heredoc]
|
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'lib/mastodon/*_cli.rb'
|
- 'lib/mastodon/*_cli.rb'
|
||||||
|
|
||||||
Metrics/CyclomaticComplexity:
|
Metrics/CyclomaticComplexity:
|
||||||
Max: 12
|
Max: 25
|
||||||
Exclude:
|
Exclude:
|
||||||
- lib/mastodon/*cli*.rb
|
- 'lib/mastodon/*_cli.rb'
|
||||||
- db/*migrate/**/*
|
|
||||||
AllowedMethods:
|
|
||||||
- attempt_oembed
|
|
||||||
- blocked?
|
|
||||||
- build_crutches
|
|
||||||
- calculate_scores
|
|
||||||
- cc
|
|
||||||
- discover_endpoint!
|
|
||||||
- filter_from_home?
|
|
||||||
- hydrate
|
|
||||||
- klass
|
|
||||||
- link_to_mention
|
|
||||||
- log_target
|
|
||||||
- matches_time_window?
|
|
||||||
- patch_for_forwarding!
|
|
||||||
- preprocess_attributes!
|
|
||||||
- process_update
|
|
||||||
- remotable_attachment
|
|
||||||
- scan_text!
|
|
||||||
- self.cached_filters_for
|
|
||||||
- set_fetchable_attributes!
|
|
||||||
- setup_redis_env_url
|
|
||||||
- update_media_attachments!
|
|
||||||
|
|
||||||
Layout/LineLength:
|
Layout/LineLength:
|
||||||
Max: 140 # RuboCop default 120
|
|
||||||
AllowHeredoc: true
|
|
||||||
AllowURI: true
|
AllowURI: true
|
||||||
IgnoreCopDirectives: true
|
Enabled: false
|
||||||
AllowedPatterns:
|
|
||||||
# Allow comments to be long lines
|
|
||||||
- !ruby/regexp / \# .*$/
|
|
||||||
- !ruby/regexp /^\# .*$/
|
|
||||||
Exclude:
|
|
||||||
- lib/**/*cli*.rb
|
|
||||||
- db/*migrate/**/*
|
|
||||||
- db/seeds/**/*
|
|
||||||
|
|
||||||
Metrics/MethodLength:
|
Metrics/MethodLength:
|
||||||
CountComments: false
|
CountComments: false
|
||||||
CountAsOne: [array, heredoc]
|
Max: 65
|
||||||
Max: 25 # RuboCop default 10
|
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'lib/mastodon/*_cli.rb'
|
- 'lib/mastodon/*_cli.rb'
|
||||||
AllowedMethods:
|
|
||||||
- account_link_to
|
|
||||||
- attempt_oembed
|
|
||||||
- body_with_limit
|
|
||||||
- build_crutches
|
|
||||||
- cached_filters_for
|
|
||||||
- calculate_scores
|
|
||||||
- check_webfinger!
|
|
||||||
- clean_feeds!
|
|
||||||
- collection_items
|
|
||||||
- collection_presenter
|
|
||||||
- copy_account_notes!
|
|
||||||
- deduplicate_accounts!
|
|
||||||
- deduplicate_conversations!
|
|
||||||
- deduplicate_local_accounts!
|
|
||||||
- deduplicate_statuses!
|
|
||||||
- deduplicate_tags!
|
|
||||||
- deduplicate_users!
|
|
||||||
- discover_endpoint!
|
|
||||||
- extract_extra_uris_with_indices
|
|
||||||
- extract_hashtags_with_indices
|
|
||||||
- extract_mentions_or_lists_with_indices
|
|
||||||
- filter_from_home?
|
|
||||||
- from_elasticsearch
|
|
||||||
- handle_explicit_update!
|
|
||||||
- handle_mark_as_sensitive!
|
|
||||||
- hsl_to_rgb
|
|
||||||
- import_bookmarks!
|
|
||||||
- import_domain_blocks!
|
|
||||||
- import_relationships!
|
|
||||||
- ldap_options
|
|
||||||
- matches_time_window?
|
|
||||||
- outbox_presenter
|
|
||||||
- pam_get_user
|
|
||||||
- parallelize_with_progress
|
|
||||||
- parse_and_transform
|
|
||||||
- patch_for_forwarding!
|
|
||||||
- populate_home
|
|
||||||
- post_process_style
|
|
||||||
- preload_cache_collection_target_statuses
|
|
||||||
- privatize_media_attachments!
|
|
||||||
- provides_callback_for
|
|
||||||
- publish_media_attachments!
|
|
||||||
- relevant_account_timestamp
|
|
||||||
- remotable_attachment
|
|
||||||
- rgb_to_hsl
|
|
||||||
- rss_status_content_format
|
|
||||||
- set_fetchable_attributes!
|
|
||||||
- setup_redis_env_url
|
|
||||||
- signed_request_actor
|
|
||||||
- to_preview_card_attributes
|
|
||||||
- upgrade_storage_filesystem
|
|
||||||
- upgrade_storage_s3
|
|
||||||
- user_settings_params
|
|
||||||
- hydrate
|
|
||||||
- cc
|
|
||||||
- self_destruct
|
|
||||||
|
|
||||||
Metrics/ModuleLength:
|
Metrics/ModuleLength:
|
||||||
CountComments: false
|
CountComments: false
|
||||||
Max: 200
|
Max: 200
|
||||||
CountAsOne: [array, heredoc]
|
|
||||||
|
|
||||||
Metrics/ParameterLists:
|
Metrics/ParameterLists:
|
||||||
Max: 5 # RuboCop default 5
|
Max: 5
|
||||||
CountKeywordArgs: true # RuboCop default true
|
CountKeywordArgs: true
|
||||||
MaxOptionalParameters: 3 # RuboCop default 3
|
|
||||||
Exclude:
|
|
||||||
- app/models/concerns/account_interactions.rb
|
|
||||||
- app/services/activitypub/fetch_remote_account_service.rb
|
|
||||||
- app/services/activitypub/fetch_remote_actor_service.rb
|
|
||||||
|
|
||||||
Metrics/PerceivedComplexity:
|
Metrics/PerceivedComplexity:
|
||||||
Max: 16 # RuboCop default 8
|
Max: 25
|
||||||
AllowedMethods:
|
|
||||||
- attempt_oembed
|
|
||||||
- build_crutches
|
|
||||||
- calculate_scores
|
|
||||||
- deduplicate_users!
|
|
||||||
- discover_endpoint!
|
|
||||||
- filter_from_home?
|
|
||||||
- hydrate
|
|
||||||
- patch_for_forwarding!
|
|
||||||
- process_update
|
|
||||||
- remove_orphans
|
|
||||||
- update_media_attachments!
|
|
||||||
|
|
||||||
Naming/MemoizedInstanceVariableName:
|
Naming/MemoizedInstanceVariableName:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -401,10 +243,6 @@ Style/HashTransformKeys:
|
||||||
Style/HashTransformValues:
|
Style/HashTransformValues:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Style/HashSyntax:
|
|
||||||
Enabled: true
|
|
||||||
EnforcedStyle: ruby19_no_mixed_keys
|
|
||||||
|
|
||||||
Style/IfUnlessModifier:
|
Style/IfUnlessModifier:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -425,6 +263,9 @@ Style/PercentLiteralDelimiters:
|
||||||
Style/PerlBackrefs:
|
Style/PerlBackrefs:
|
||||||
AutoCorrect: false
|
AutoCorrect: false
|
||||||
|
|
||||||
|
Style/RedundantAssignment:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Style/RedundantFetchBlock:
|
Style/RedundantFetchBlock:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
@ -440,14 +281,11 @@ Style/RedundantRegexpEscape:
|
||||||
Style/RedundantReturn:
|
Style/RedundantReturn:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Style/RedundantBegin:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/RegexpLiteral:
|
Style/RegexpLiteral:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Style/RescueStandardError:
|
Style/RescueStandardError:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
|
|
||||||
Style/SignalException:
|
Style/SignalException:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -466,14 +304,3 @@ Style/TrailingCommaInHashLiteral:
|
||||||
|
|
||||||
Style/UnpackFirst:
|
Style/UnpackFirst:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
RSpec/ScatteredSetup:
|
|
||||||
Enabled: false
|
|
||||||
RSpec/ImplicitExpect:
|
|
||||||
Enabled: false
|
|
||||||
RSpec/NamedSubject:
|
|
||||||
Enabled: false
|
|
||||||
RSpec/DescribeClass:
|
|
||||||
Enabled: false
|
|
||||||
RSpec/LetSetup:
|
|
||||||
Enabled: false
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
mastodon
|
|
|
@ -1 +1 @@
|
||||||
3.0.4
|
3.0.3
|
||||||
|
|
37
.sass-lint.yml
Normal file
37
.sass-lint.yml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# Linter Documentation:
|
||||||
|
# https://github.com/sasstools/sass-lint/tree/v1.13.1/docs/options
|
||||||
|
|
||||||
|
files:
|
||||||
|
include: app/javascript/styles/**/*.scss
|
||||||
|
ignore:
|
||||||
|
- app/javascript/styles/mastodon/reset.scss
|
||||||
|
|
||||||
|
rules:
|
||||||
|
# Disallows
|
||||||
|
no-color-literals: 0
|
||||||
|
no-css-comments: 0
|
||||||
|
no-duplicate-properties: 0
|
||||||
|
no-ids: 0
|
||||||
|
no-important: 0
|
||||||
|
no-mergeable-selectors: 0
|
||||||
|
no-misspelled-properties: 0
|
||||||
|
no-qualifying-elements: 0
|
||||||
|
no-transition-all: 0
|
||||||
|
no-vendor-prefixes: 0
|
||||||
|
|
||||||
|
# Nesting
|
||||||
|
force-element-nesting: 0
|
||||||
|
force-attribute-nesting: 0
|
||||||
|
force-pseudo-nesting: 0
|
||||||
|
|
||||||
|
# Name Formats
|
||||||
|
class-name-format: 0
|
||||||
|
leading-zero: 0
|
||||||
|
|
||||||
|
# Style Guide
|
||||||
|
attribute-quotes: 0
|
||||||
|
hex-length: 0
|
||||||
|
indentation: 0
|
||||||
|
nesting-depth: 0
|
||||||
|
property-sort-order: 0
|
||||||
|
quotes: 0
|
1103
AUTHORS.md
1103
AUTHORS.md
File diff suppressed because it is too large
Load diff
22
Aptfile
22
Aptfile
|
@ -1,4 +1,26 @@
|
||||||
ffmpeg
|
ffmpeg
|
||||||
|
libicu[0-9][0-9]
|
||||||
|
libicu-dev
|
||||||
|
libidn11
|
||||||
|
libidn11-dev
|
||||||
libpq-dev
|
libpq-dev
|
||||||
libxdamage1
|
libxdamage1
|
||||||
libxfixes3
|
libxfixes3
|
||||||
|
zlib1g-dev
|
||||||
|
libcairo2
|
||||||
|
libcroco3
|
||||||
|
libdatrie1
|
||||||
|
libgdk-pixbuf2.0-0
|
||||||
|
libgraphite2-3
|
||||||
|
libharfbuzz0b
|
||||||
|
libpango-1.0-0
|
||||||
|
libpangocairo-1.0-0
|
||||||
|
libpangoft2-1.0-0
|
||||||
|
libpixman-1-0
|
||||||
|
librsvg2-2
|
||||||
|
libthai-data
|
||||||
|
libthai0
|
||||||
|
libvpx[5-9]
|
||||||
|
libxcb-render0
|
||||||
|
libxcb-shm0
|
||||||
|
libxrender1
|
||||||
|
|
216
CHANGELOG.md
216
CHANGELOG.md
|
@ -3,216 +3,6 @@ Changelog
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## [4.0.2] - 2022-11-15
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix wrong color on mentions hidden behind content warning in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/20724))
|
|
||||||
- Fix filters from other users being used in the streaming service ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20719))
|
|
||||||
- Fix `unsafe-eval` being used when `wasm-unsafe-eval` is enough in Content Security Policy ([Gargron](https://github.com/mastodon/mastodon/pull/20729), [prplecake](https://github.com/mastodon/mastodon/pull/20606))
|
|
||||||
|
|
||||||
## [4.0.1] - 2022-11-14
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix nodes order being sometimes mangled when rewriting emoji ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20677))
|
|
||||||
|
|
||||||
## [4.0.0] - 2022-11-14
|
|
||||||
|
|
||||||
Some of the features in this release have been funded through the [NGI0 Discovery](https://nlnet.nl/discovery) Fund, a fund established by [NLnet](https://nlnet.nl/) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 825322.
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Add ability to filter followed accounts' posts by language ([Gargron](https://github.com/mastodon/mastodon/pull/19095), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19268))
|
|
||||||
- **Add ability to follow hashtags** ([Gargron](https://github.com/mastodon/mastodon/pull/18809), [Gargron](https://github.com/mastodon/mastodon/pull/18862), [Gargron](https://github.com/mastodon/mastodon/pull/19472), [noellabo](https://github.com/mastodon/mastodon/pull/18924))
|
|
||||||
- Add ability to filter individual posts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18945))
|
|
||||||
- **Add ability to translate posts** ([Gargron](https://github.com/mastodon/mastodon/pull/19218), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19433), [Gargron](https://github.com/mastodon/mastodon/pull/19453), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19434), [Gargron](https://github.com/mastodon/mastodon/pull/19388), [ykzts](https://github.com/mastodon/mastodon/pull/19244), [Gargron](https://github.com/mastodon/mastodon/pull/19245))
|
|
||||||
- Add featured tags to web UI ([noellabo](https://github.com/mastodon/mastodon/pull/19408), [noellabo](https://github.com/mastodon/mastodon/pull/19380), [noellabo](https://github.com/mastodon/mastodon/pull/19358), [noellabo](https://github.com/mastodon/mastodon/pull/19409), [Gargron](https://github.com/mastodon/mastodon/pull/19382), [ykzts](https://github.com/mastodon/mastodon/pull/19418), [noellabo](https://github.com/mastodon/mastodon/pull/19403), [noellabo](https://github.com/mastodon/mastodon/pull/19404), [Gargron](https://github.com/mastodon/mastodon/pull/19398), [Gargron](https://github.com/mastodon/mastodon/pull/19712), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/20018))
|
|
||||||
- **Add support for language preferences for trending statuses and links** ([Gargron](https://github.com/mastodon/mastodon/pull/18288), [Gargron](https://github.com/mastodon/mastodon/pull/19349), [ykzts](https://github.com/mastodon/mastodon/pull/19335))
|
|
||||||
- Previously, you could only see trends in your current language
|
|
||||||
- For less popular languages, that meant empty trends
|
|
||||||
- Now, trends in your preferred languages' are shown on top, with others beneath
|
|
||||||
- Add server rules to sign-up flow ([Gargron](https://github.com/mastodon/mastodon/pull/19296))
|
|
||||||
- Add privacy icons to report modal in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19190))
|
|
||||||
- Add `noopener` to links to remote profiles in web UI ([shleeable](https://github.com/mastodon/mastodon/pull/19014))
|
|
||||||
- Add option to open original page in dropdowns of remote content in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/20299))
|
|
||||||
- Add warning for sensitive audio posts in web UI ([rgroothuijsen](https://github.com/mastodon/mastodon/pull/17885))
|
|
||||||
- Add language attribute to posts in web UI ([tribela](https://github.com/mastodon/mastodon/pull/18544))
|
|
||||||
- Add support for uploading WebP files ([Saiv46](https://github.com/mastodon/mastodon/pull/18506))
|
|
||||||
- Add support for uploading `audio/vnd.wave` files ([tribela](https://github.com/mastodon/mastodon/pull/18737))
|
|
||||||
- Add support for uploading AVIF files ([txt-file](https://github.com/mastodon/mastodon/pull/19647))
|
|
||||||
- Add support for uploading HEIC files ([Gargron](https://github.com/mastodon/mastodon/pull/19618))
|
|
||||||
- Add more debug information when processing remote accounts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/15605), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19209))
|
|
||||||
- **Add retention policy for cached content and media** ([Gargron](https://github.com/mastodon/mastodon/pull/19232), [zunda](https://github.com/mastodon/mastodon/pull/19478), [Gargron](https://github.com/mastodon/mastodon/pull/19458), [Gargron](https://github.com/mastodon/mastodon/pull/19248))
|
|
||||||
- Set for how long remote posts or media should be cached on your server
|
|
||||||
- Hands-off alternative to `tootctl` commands
|
|
||||||
- **Add customizable user roles** ([Gargron](https://github.com/mastodon/mastodon/pull/18641), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18812), [Gargron](https://github.com/mastodon/mastodon/pull/19040), [tribela](https://github.com/mastodon/mastodon/pull/18825), [tribela](https://github.com/mastodon/mastodon/pull/18826), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18776), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18777), [unextro](https://github.com/mastodon/mastodon/pull/18786), [tribela](https://github.com/mastodon/mastodon/pull/18824), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19436))
|
|
||||||
- Previously, there were 3 hard-coded roles, user, moderator, and admin
|
|
||||||
- Create your own roles and decide which permissions they should have
|
|
||||||
- Add notifications for new reports ([Gargron](https://github.com/mastodon/mastodon/pull/18697), [Gargron](https://github.com/mastodon/mastodon/pull/19475))
|
|
||||||
- Add ability to select all accounts matching search for batch actions in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/19053), [Gargron](https://github.com/mastodon/mastodon/pull/19054))
|
|
||||||
- Add ability to view previous edits of a status in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/19462))
|
|
||||||
- Add ability to block sign-ups from IP ([Gargron](https://github.com/mastodon/mastodon/pull/19037))
|
|
||||||
- **Add webhooks to admin UI** ([Gargron](https://github.com/mastodon/mastodon/pull/18510))
|
|
||||||
- Add admin API for managing domain allows ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18668))
|
|
||||||
- Add admin API for managing domain blocks ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18247))
|
|
||||||
- Add admin API for managing e-mail domain blocks ([Gargron](https://github.com/mastodon/mastodon/pull/19066))
|
|
||||||
- Add admin API for managing canonical e-mail blocks ([Gargron](https://github.com/mastodon/mastodon/pull/19067))
|
|
||||||
- Add admin API for managing IP blocks ([Gargron](https://github.com/mastodon/mastodon/pull/19065), [trwnh](https://github.com/mastodon/mastodon/pull/20207))
|
|
||||||
- Add `sensitized` attribute to accounts in admin REST API ([trwnh](https://github.com/mastodon/mastodon/pull/20094))
|
|
||||||
- Add `services` and `metadata` to the NodeInfo endpoint ([MFTabriz](https://github.com/mastodon/mastodon/pull/18563))
|
|
||||||
- Add `--remove-role` option to `tootctl accounts modify` ([Gargron](https://github.com/mastodon/mastodon/pull/19477))
|
|
||||||
- Add `--days` option to `tootctl media refresh` ([tribela](https://github.com/mastodon/mastodon/pull/18425))
|
|
||||||
- Add `EMAIL_DOMAIN_LISTS_APPLY_AFTER_CONFIRMATION` environment variable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18642))
|
|
||||||
- Add `IP_RETENTION_PERIOD` and `SESSION_RETENTION_PERIOD` environment variables ([kescherCode](https://github.com/mastodon/mastodon/pull/18757))
|
|
||||||
- Add `http_hidden_proxy` environment variable ([tribela](https://github.com/mastodon/mastodon/pull/18427))
|
|
||||||
- Add `ENABLE_STARTTLS` environment variable ([erbridge](https://github.com/mastodon/mastodon/pull/20321))
|
|
||||||
- Add caching for payload serialization during fan-out ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19637), [Gargron](https://github.com/mastodon/mastodon/pull/19642), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19746), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19747), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19963))
|
|
||||||
- Add assets from Twemoji 14.0 ([Gargron](https://github.com/mastodon/mastodon/pull/19733))
|
|
||||||
- Add reputation and followers score boost to SQL-only account search ([Gargron](https://github.com/mastodon/mastodon/pull/19251))
|
|
||||||
- Add Scots, Balaibalan, Láadan, Lingua Franca Nova, Lojban, Toki Pona to languages list ([VyrCossont](https://github.com/mastodon/mastodon/pull/20168))
|
|
||||||
- Set autocomplete hints for e-mail, password and OTP fields ([rcombs](https://github.com/mastodon/mastodon/pull/19833), [offbyone](https://github.com/mastodon/mastodon/pull/19946), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/20071))
|
|
||||||
- Add support for DigitalOcean Spaces in setup wizard ([v-aisac](https://github.com/mastodon/mastodon/pull/20573))
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- **Change brand color and logotypes** ([Gargron](https://github.com/mastodon/mastodon/pull/18592), [Gargron](https://github.com/mastodon/mastodon/pull/18639), [Gargron](https://github.com/mastodon/mastodon/pull/18691), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18634), [Gargron](https://github.com/mastodon/mastodon/pull/19254), [mayaeh](https://github.com/mastodon/mastodon/pull/18710))
|
|
||||||
- **Change post editing to be enabled in web UI** ([Gargron](https://github.com/mastodon/mastodon/pull/19103))
|
|
||||||
- **Change web UI to work for logged-out users** ([Gargron](https://github.com/mastodon/mastodon/pull/18961), [Gargron](https://github.com/mastodon/mastodon/pull/19250), [Gargron](https://github.com/mastodon/mastodon/pull/19294), [Gargron](https://github.com/mastodon/mastodon/pull/19306), [Gargron](https://github.com/mastodon/mastodon/pull/19315), [ykzts](https://github.com/mastodon/mastodon/pull/19322), [Gargron](https://github.com/mastodon/mastodon/pull/19412), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19437), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19415), [Gargron](https://github.com/mastodon/mastodon/pull/19348), [Gargron](https://github.com/mastodon/mastodon/pull/19295), [Gargron](https://github.com/mastodon/mastodon/pull/19422), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19414), [Gargron](https://github.com/mastodon/mastodon/pull/19319), [Gargron](https://github.com/mastodon/mastodon/pull/19345), [Gargron](https://github.com/mastodon/mastodon/pull/19310), [Gargron](https://github.com/mastodon/mastodon/pull/19301), [Gargron](https://github.com/mastodon/mastodon/pull/19423), [ykzts](https://github.com/mastodon/mastodon/pull/19471), [ykzts](https://github.com/mastodon/mastodon/pull/19333), [ykzts](https://github.com/mastodon/mastodon/pull/19337), [ykzts](https://github.com/mastodon/mastodon/pull/19272), [ykzts](https://github.com/mastodon/mastodon/pull/19468), [Gargron](https://github.com/mastodon/mastodon/pull/19466), [Gargron](https://github.com/mastodon/mastodon/pull/19457), [Gargron](https://github.com/mastodon/mastodon/pull/19426), [Gargron](https://github.com/mastodon/mastodon/pull/19427), [Gargron](https://github.com/mastodon/mastodon/pull/19421), [Gargron](https://github.com/mastodon/mastodon/pull/19417), [Gargron](https://github.com/mastodon/mastodon/pull/19413), [Gargron](https://github.com/mastodon/mastodon/pull/19397), [Gargron](https://github.com/mastodon/mastodon/pull/19387), [Gargron](https://github.com/mastodon/mastodon/pull/19396), [Gargron](https://github.com/mastodon/mastodon/pull/19385), [ykzts](https://github.com/mastodon/mastodon/pull/19334), [ykzts](https://github.com/mastodon/mastodon/pull/19329), [Gargron](https://github.com/mastodon/mastodon/pull/19324), [Gargron](https://github.com/mastodon/mastodon/pull/19318), [Gargron](https://github.com/mastodon/mastodon/pull/19316), [Gargron](https://github.com/mastodon/mastodon/pull/19263), [trwnh](https://github.com/mastodon/mastodon/pull/19305), [ykzts](https://github.com/mastodon/mastodon/pull/19273), [Gargron](https://github.com/mastodon/mastodon/pull/19801), [Gargron](https://github.com/mastodon/mastodon/pull/19790), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19773), [Gargron](https://github.com/mastodon/mastodon/pull/19798), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19724), [Gargron](https://github.com/mastodon/mastodon/pull/19709), [Gargron](https://github.com/mastodon/mastodon/pull/19514), [Gargron](https://github.com/mastodon/mastodon/pull/19562), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19981), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19978), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/20148), [Gargron](https://github.com/mastodon/mastodon/pull/20302), [cutls](https://github.com/mastodon/mastodon/pull/20400))
|
|
||||||
- The web app can now be accessed without being logged in
|
|
||||||
- No more `/web` prefix on web app paths
|
|
||||||
- Profiles, posts, and other public pages now use the same interface for logged in and logged out users
|
|
||||||
- The web app displays a server information banner
|
|
||||||
- Pop-up windows for remote interaction have been replaced with a modal window
|
|
||||||
- No need to type in your username for remote interaction, copy-paste-to-search method explained
|
|
||||||
- Various hints throughout the app explain what the different timelines are
|
|
||||||
- New about page design
|
|
||||||
- New privacy policy page design shows when the policy was last updated
|
|
||||||
- All sections of the web app now have appropriate window titles
|
|
||||||
- The layout of the interface has been streamlined between different screen sizes
|
|
||||||
- Posts now use more horizontal space
|
|
||||||
- Change label of publish button to be "Publish" again in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/18583))
|
|
||||||
- Change language to be carried over on reply in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18557))
|
|
||||||
- Change "Unfollow" to "Cancel follow request" when request still pending in web UI ([prplecake](https://github.com/mastodon/mastodon/pull/19363))
|
|
||||||
- **Change post filtering system** ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18058), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19050), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18894), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19051), [noellabo](https://github.com/mastodon/mastodon/pull/18923), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18956), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18744), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/19878), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/20567))
|
|
||||||
- Filtered keywords and phrases can now be grouped into named categories
|
|
||||||
- Filtered posts show which exact filter was hit
|
|
||||||
- Individual posts can be added to a filter
|
|
||||||
- You can peek inside filtered posts anyway
|
|
||||||
- Change path of privacy policy page from `/terms` to `/privacy-policy` ([Gargron](https://github.com/mastodon/mastodon/pull/19249))
|
|
||||||
- Change how hashtags are normalized ([Gargron](https://github.com/mastodon/mastodon/pull/18795), [Gargron](https://github.com/mastodon/mastodon/pull/18863), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18854))
|
|
||||||
- Change settings area to be separated into categories in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/19407), [Gargron](https://github.com/mastodon/mastodon/pull/19533))
|
|
||||||
- Change "No accounts selected" errors to use the appropriate noun in admin UI ([prplecake](https://github.com/mastodon/mastodon/pull/19356))
|
|
||||||
- Change e-mail domain blocks to match subdomains of blocked domains ([Gargron](https://github.com/mastodon/mastodon/pull/18979))
|
|
||||||
- Change custom emoji file size limit from 50 KB to 256 KB ([Gargron](https://github.com/mastodon/mastodon/pull/18788))
|
|
||||||
- Change "Allow trends without prior review" setting to also work for trending posts ([Gargron](https://github.com/mastodon/mastodon/pull/17977))
|
|
||||||
- Change admin announcements form to use single inputs for date and time in admin UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18321))
|
|
||||||
- Change search API to be accessible without being logged in ([Gargron](https://github.com/mastodon/mastodon/pull/18963), [Gargron](https://github.com/mastodon/mastodon/pull/19326))
|
|
||||||
- Change following and followers API to be accessible without being logged in ([Gargron](https://github.com/mastodon/mastodon/pull/18964))
|
|
||||||
- Change `AUTHORIZED_FETCH` to not block unauthenticated REST API access ([Gargron](https://github.com/mastodon/mastodon/pull/19803))
|
|
||||||
- Change Helm configuration ([deepy](https://github.com/mastodon/mastodon/pull/18997), [jgsmith](https://github.com/mastodon/mastodon/pull/18415), [deepy](https://github.com/mastodon/mastodon/pull/18941))
|
|
||||||
- Change mentions of blocked users to not be processed ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19725))
|
|
||||||
- Change max. thumbnail dimensions to 640x360px (360p) ([Gargron](https://github.com/mastodon/mastodon/pull/19619))
|
|
||||||
- Change post-processing to be deferred only for large media types ([Gargron](https://github.com/mastodon/mastodon/pull/19617))
|
|
||||||
- Change link verification to only work for https links without unicode ([Gargron](https://github.com/mastodon/mastodon/pull/20304), [Gargron](https://github.com/mastodon/mastodon/pull/20295))
|
|
||||||
- Change account deletion requests to spread out over time ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20222))
|
|
||||||
- Change larger reblogs/favourites numbers to be shortened in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/20303))
|
|
||||||
- Change incoming activity processing to happen in `ingress` queue ([Gargron](https://github.com/mastodon/mastodon/pull/20264))
|
|
||||||
- Change notifications to not link show preview cards in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20335))
|
|
||||||
- Change amount of replies returned for logged out users in REST API ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20355))
|
|
||||||
- Change in-app links to keep you in-app in web UI ([trwnh](https://github.com/mastodon/mastodon/pull/20540), [Gargron](https://github.com/mastodon/mastodon/pull/20628))
|
|
||||||
- Change table header to be sticky in admin UI ([sk22](https://github.com/mastodon/mastodon/pull/20442))
|
|
||||||
|
|
||||||
### Removed
|
|
||||||
|
|
||||||
- Remove setting that disables account deletes ([Gargron](https://github.com/mastodon/mastodon/pull/17683))
|
|
||||||
- Remove digest e-mails ([Gargron](https://github.com/mastodon/mastodon/pull/17985))
|
|
||||||
- Remove unnecessary sections from welcome e-mail ([Gargron](https://github.com/mastodon/mastodon/pull/19299))
|
|
||||||
- Remove item titles from RSS feeds ([Gargron](https://github.com/mastodon/mastodon/pull/18640))
|
|
||||||
- Remove volume number from hashtags in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/19253))
|
|
||||||
- Remove Nanobox configuration ([tonyjiang](https://github.com/mastodon/mastodon/pull/17881))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix rules with same priority being sorted non-deterministically ([Gargron](https://github.com/mastodon/mastodon/pull/20623))
|
|
||||||
- Fix error when invalid domain name is submitted ([Gargron](https://github.com/mastodon/mastodon/pull/19474))
|
|
||||||
- Fix icons having an image role ([Gargron](https://github.com/mastodon/mastodon/pull/20600))
|
|
||||||
- Fix connections to IPv6-only servers ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20108))
|
|
||||||
- Fix unnecessary service worker registration and preloading when logged out in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20341))
|
|
||||||
- Fix unnecessary and slow regex construction ([raggi](https://github.com/mastodon/mastodon/pull/20215))
|
|
||||||
- Fix `mailers` queue not being used for mailers ([Gargron](https://github.com/mastodon/mastodon/pull/20274))
|
|
||||||
- Fix error in webfinger redirect handling ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20260))
|
|
||||||
- Fix report category not being set to `violation` if rule IDs are provided ([trwnh](https://github.com/mastodon/mastodon/pull/20137))
|
|
||||||
- Fix nodeinfo metadata attribute being an array instead of an object ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20114))
|
|
||||||
- Fix account endorsements not being idempotent ([trwnh](https://github.com/mastodon/mastodon/pull/20118))
|
|
||||||
- Fix status and rule IDs not being strings in admin reports REST API ([trwnh](https://github.com/mastodon/mastodon/pull/20122))
|
|
||||||
- Fix error on invalid `replies_policy` in REST API ([trwnh](https://github.com/mastodon/mastodon/pull/20126))
|
|
||||||
- Fix redrafting a currently-editing post not leaving edit mode in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20023))
|
|
||||||
- Fix performance by avoiding method cache busts ([raggi](https://github.com/mastodon/mastodon/pull/19957))
|
|
||||||
- Fix opening the language picker scrolling the single-column view to the top in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19983))
|
|
||||||
- Fix content warning button missing `aria-expanded` attribute in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19975))
|
|
||||||
- Fix redundant `aria-pressed` attributes in web UI ([Brawaru](https://github.com/mastodon/mastodon/pull/19912))
|
|
||||||
- Fix crash when external auth provider has no display name set ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19962))
|
|
||||||
- Fix followers count not being updated when migrating follows ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19998))
|
|
||||||
- Fix double button to clear emoji search input in web UI ([sunny](https://github.com/mastodon/mastodon/pull/19888))
|
|
||||||
- Fix missing null check on applications on strike disputes ([kescherCode](https://github.com/mastodon/mastodon/pull/19851))
|
|
||||||
- Fix featured tags not saving preferred casing ([Gargron](https://github.com/mastodon/mastodon/pull/19732))
|
|
||||||
- Fix language not being saved when editing status ([Gargron](https://github.com/mastodon/mastodon/pull/19543))
|
|
||||||
- Fix not being able to input featured tag with hash symbol ([Gargron](https://github.com/mastodon/mastodon/pull/19535))
|
|
||||||
- Fix user clean-up scheduler crash when an unconfirmed account has a moderation note ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19629))
|
|
||||||
- Fix being unable to withdraw follow request when confirmation modal is disabled in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19687))
|
|
||||||
- Fix inaccurate admin log entry for re-sending confirmation e-mails ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19674))
|
|
||||||
- Fix edits not being immediately reflected ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19673))
|
|
||||||
- Fix bookmark import stopping at the first failure ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19669))
|
|
||||||
- Fix account action type validation ([Gargron](https://github.com/mastodon/mastodon/pull/19476))
|
|
||||||
- Fix upload progress not communicating processing phase in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/19530))
|
|
||||||
- Fix wrong host being used for custom.css when asset host configured ([Gargron](https://github.com/mastodon/mastodon/pull/19521))
|
|
||||||
- Fix account migration form ever using outdated account data ([Gargron](https://github.com/mastodon/mastodon/pull/18429), [nightpool](https://github.com/mastodon/mastodon/pull/19883))
|
|
||||||
- Fix error when uploading malformed CSV import ([Gargron](https://github.com/mastodon/mastodon/pull/19509))
|
|
||||||
- Fix avatars not using image tags in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/19488))
|
|
||||||
- Fix handling of duplicate and out-of-order notifications in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19693))
|
|
||||||
- Fix reblogs being discarded after the reblogged status ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19731))
|
|
||||||
- Fix indexing scheduler trying to index when Elasticsearch is disabled ([Gargron](https://github.com/mastodon/mastodon/pull/19805))
|
|
||||||
- Fix n+1 queries when rendering initial state JSON ([Gargron](https://github.com/mastodon/mastodon/pull/19795))
|
|
||||||
- Fix n+1 query during status removal ([Gargron](https://github.com/mastodon/mastodon/pull/19753))
|
|
||||||
- Fix OCR not working due to Content Security Policy in web UI ([prplecake](https://github.com/mastodon/mastodon/pull/18817))
|
|
||||||
- Fix `nofollow` rel being removed in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/19455))
|
|
||||||
- Fix language dropdown causing zoom on mobile devices in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/19428))
|
|
||||||
- Fix button to dismiss suggestions not showing up in search results in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19325))
|
|
||||||
- Fix language dropdown sometimes not appearing in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/19246))
|
|
||||||
- Fix quickly switching notification filters resulting in empty or incorrect list in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19052), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18960))
|
|
||||||
- Fix media modal link button in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18877))
|
|
||||||
- Fix error upon successful account migration ([Gargron](https://github.com/mastodon/mastodon/pull/19386))
|
|
||||||
- Fix negatives values in search index causing queries to fail ([Gargron](https://github.com/mastodon/mastodon/pull/19464), [Gargron](https://github.com/mastodon/mastodon/pull/19481))
|
|
||||||
- Fix error when searching for invalid URL ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18580))
|
|
||||||
- Fix IP blocks not having a unique index ([Gargron](https://github.com/mastodon/mastodon/pull/19456))
|
|
||||||
- Fix remote account in contact account setting not being used ([Gargron](https://github.com/mastodon/mastodon/pull/19351))
|
|
||||||
- Fix swallowing mentions of unconfirmed/unapproved users ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19191))
|
|
||||||
- Fix incorrect and slow cache invalidation when blocking domain and removing media attachments ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19062))
|
|
||||||
- Fix HTTPs redirect behaviour when running as I2P service ([gi-yt](https://github.com/mastodon/mastodon/pull/18929))
|
|
||||||
- Fix deleted pinned posts potentially counting towards the pinned posts limit ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19005))
|
|
||||||
- Fix compatibility with OpenSSL 3.0 ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18449))
|
|
||||||
- Fix error when a remote report includes a private post the server has no access to ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18760))
|
|
||||||
- Fix suspicious sign-in mails never being sent ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18599))
|
|
||||||
- Fix fallback locale when somehow user's locale is an empty string ([tribela](https://github.com/mastodon/mastodon/pull/18543))
|
|
||||||
- Fix avatar/header not being deleted locally when deleted on remote account ([tribela](https://github.com/mastodon/mastodon/pull/18973))
|
|
||||||
- Fix missing `,` in Blurhash validation ([noellabo](https://github.com/mastodon/mastodon/pull/18660))
|
|
||||||
- Fix order by most recent not working for relationships page in admin UI ([tribela](https://github.com/mastodon/mastodon/pull/18996))
|
|
||||||
- Fix uncaught error when invalid date is supplied to API ([Gargron](https://github.com/mastodon/mastodon/pull/19480))
|
|
||||||
- Fix REST API sometimes returning HTML on error ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/19135))
|
|
||||||
- Fix ambiguous column names in `tootctl media refresh` ([tribela](https://github.com/mastodon/mastodon/pull/19206))
|
|
||||||
- Fix ambiguous column names in `tootctl search deploy` ([mashirozx](https://github.com/mastodon/mastodon/pull/18993))
|
|
||||||
- Fix `CDN_HOST` not being used in some asset URLs ([tribela](https://github.com/mastodon/mastodon/pull/18662))
|
|
||||||
- Fix `CAS_DISPLAY_NAME`, `SAML_DISPLAY_NAME` and `OIDC_DISPLAY_NAME` being ignored ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18568))
|
|
||||||
- Fix various typos in comments throughout the codebase ([luzpaz](https://github.com/mastodon/mastodon/pull/18604))
|
|
||||||
- Fix CSV import error when rows include unicode characters ([HamptonMakes](https://github.com/mastodon/mastodon/pull/20592))
|
|
||||||
|
|
||||||
### Security
|
|
||||||
|
|
||||||
- Fix being able to spoof link verification ([Gargron](https://github.com/mastodon/mastodon/pull/20217))
|
|
||||||
- Fix emoji substitution not applying only to text nodes in backend code ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20641))
|
|
||||||
- Fix emoji substitution not applying only to text nodes in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20640))
|
|
||||||
- Fix rate limiting for paths with formats ([Gargron](https://github.com/mastodon/mastodon/pull/20675))
|
|
||||||
- Fix out-of-bound reads in blurhash transcoder ([delroth](https://github.com/mastodon/mastodon/pull/20388))
|
|
||||||
|
|
||||||
## [3.5.3] - 2022-05-26
|
## [3.5.3] - 2022-05-26
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
@ -285,7 +75,7 @@ Some of the features in this release have been funded through the [NGI0 Discover
|
||||||
- Remove IP matching from e-mail domain blocks ([Gargron](https://github.com/mastodon/mastodon/pull/18190))
|
- Remove IP matching from e-mail domain blocks ([Gargron](https://github.com/mastodon/mastodon/pull/18190))
|
||||||
- The IPs of the blocked e-mail domain or its MX records are no longer checked
|
- The IPs of the blocked e-mail domain or its MX records are no longer checked
|
||||||
- Previously it was too easy to block e-mail providers by mistake
|
- Previously it was too easy to block e-mail providers by mistake
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
- Fix compatibility with Friendica's pinned posts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18254), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18260))
|
- Fix compatibility with Friendica's pinned posts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/18254), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/18260))
|
||||||
|
@ -332,7 +122,7 @@ Some of the features in this release have been funded through the [NGI0 Discover
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fix error responses for `from` search prefix ([single-right-quote](https://github.com/mastodon/mastodon/pull/17963))
|
- Fix error resposes for `from` search prefix ([single-right-quote](https://github.com/mastodon/mastodon/pull/17963))
|
||||||
- Fix dangling language-specific trends ([Gargron](https://github.com/mastodon/mastodon/pull/17997))
|
- Fix dangling language-specific trends ([Gargron](https://github.com/mastodon/mastodon/pull/17997))
|
||||||
- Fix extremely rare race condition when deleting a status or account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17994))
|
- Fix extremely rare race condition when deleting a status or account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17994))
|
||||||
- Fix trends returning less results per page when filtered in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17996))
|
- Fix trends returning less results per page when filtered in REST API ([Gargron](https://github.com/mastodon/mastodon/pull/17996))
|
||||||
|
@ -467,7 +257,7 @@ Some of the features in this release have been funded through the [NGI0 Discover
|
||||||
- Remove profile directory link from main navigation panel in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/17688))
|
- Remove profile directory link from main navigation panel in web UI ([Gargron](https://github.com/mastodon/mastodon/pull/17688))
|
||||||
- **Remove language detection through cld3** ([Gargron](https://github.com/mastodon/mastodon/pull/17478), [ykzts](https://github.com/mastodon/mastodon/pull/17539), [Gargron](https://github.com/mastodon/mastodon/pull/17496), [Gargron](https://github.com/mastodon/mastodon/pull/17722))
|
- **Remove language detection through cld3** ([Gargron](https://github.com/mastodon/mastodon/pull/17478), [ykzts](https://github.com/mastodon/mastodon/pull/17539), [Gargron](https://github.com/mastodon/mastodon/pull/17496), [Gargron](https://github.com/mastodon/mastodon/pull/17722))
|
||||||
- cld3 is very inaccurate on short-form content even with unique alphabets
|
- cld3 is very inaccurate on short-form content even with unique alphabets
|
||||||
- Post language can be overridden individually using `language` param
|
- Post language can be overriden individually using `language` param
|
||||||
- Otherwise, it defaults to the user's interface language
|
- Otherwise, it defaults to the user's interface language
|
||||||
- Remove support for `OAUTH_REDIRECT_AT_SIGN_IN` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17287))
|
- Remove support for `OAUTH_REDIRECT_AT_SIGN_IN` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/17287))
|
||||||
- Use `OMNIAUTH_ONLY` instead
|
- Use `OMNIAUTH_ONLY` instead
|
||||||
|
|
|
@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
|
||||||
|
|
||||||
## Attribution
|
## Attribution
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||||
|
|
||||||
[homepage]: https://contributor-covenant.org
|
[homepage]: http://contributor-covenant.org
|
||||||
[version]: https://contributor-covenant.org/version/1/4/
|
[version]: http://contributor-covenant.org/version/1/4/
|
||||||
|
|
|
@ -42,8 +42,6 @@ It is not always possible to phrase every change in such a manner, but it is des
|
||||||
- Code style rules (rubocop, eslint)
|
- Code style rules (rubocop, eslint)
|
||||||
- Normalization of locale files (i18n-tasks)
|
- Normalization of locale files (i18n-tasks)
|
||||||
|
|
||||||
**Note**: You may need to log in and authorise the GitHub account your fork of this repository belongs to with CircleCI to enable some of the automated checks to run.
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
The [Mastodon documentation](https://docs.joinmastodon.org) is a statically generated site. You can [submit merge requests to mastodon/documentation](https://github.com/mastodon/documentation).
|
The [Mastodon documentation](https://docs.joinmastodon.org) is a statically generated site. You can [submit merge requests to mastodon/documentation](https://github.com/mastodon/documentation).
|
||||||
|
|
168
Dockerfile
168
Dockerfile
|
@ -1,99 +1,121 @@
|
||||||
# syntax=docker/dockerfile:1.4
|
FROM ubuntu:20.04 as build-dep
|
||||||
# This needs to be bullseye-slim because the Ruby image is built on bullseye-slim
|
|
||||||
ARG NODE_VERSION="16.18.1-bullseye-slim"
|
|
||||||
|
|
||||||
FROM ghcr.io/moritzheiber/ruby-jemalloc:3.0.4-slim as ruby
|
# Use bash for the shell
|
||||||
FROM node:${NODE_VERSION} as build
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
||||||
|
|
||||||
COPY --link --from=ruby /opt/ruby /opt/ruby
|
# Install Node v16 (LTS)
|
||||||
|
ENV NODE_VER="16.14.2"
|
||||||
|
RUN ARCH= && \
|
||||||
|
dpkgArch="$(dpkg --print-architecture)" && \
|
||||||
|
case "${dpkgArch##*-}" in \
|
||||||
|
amd64) ARCH='x64';; \
|
||||||
|
ppc64el) ARCH='ppc64le';; \
|
||||||
|
s390x) ARCH='s390x';; \
|
||||||
|
arm64) ARCH='arm64';; \
|
||||||
|
armhf) ARCH='armv7l';; \
|
||||||
|
i386) ARCH='x86';; \
|
||||||
|
*) echo "unsupported architecture"; exit 1 ;; \
|
||||||
|
esac && \
|
||||||
|
echo "Etc/UTC" > /etc/localtime && \
|
||||||
|
apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends ca-certificates wget python apt-utils && \
|
||||||
|
cd ~ && \
|
||||||
|
wget -q https://nodejs.org/download/release/v$NODE_VER/node-v$NODE_VER-linux-$ARCH.tar.gz && \
|
||||||
|
tar xf node-v$NODE_VER-linux-$ARCH.tar.gz && \
|
||||||
|
rm node-v$NODE_VER-linux-$ARCH.tar.gz && \
|
||||||
|
mv node-v$NODE_VER-linux-$ARCH /opt/node
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND="noninteractive" \
|
# Install Ruby 3.0
|
||||||
PATH="${PATH}:/opt/ruby/bin"
|
ENV RUBY_VER="3.0.3"
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends build-essential \
|
||||||
|
bison libyaml-dev libgdbm-dev libreadline-dev libjemalloc-dev \
|
||||||
|
libncurses5-dev libffi-dev zlib1g-dev libssl-dev && \
|
||||||
|
cd ~ && \
|
||||||
|
wget https://cache.ruby-lang.org/pub/ruby/${RUBY_VER%.*}/ruby-$RUBY_VER.tar.gz && \
|
||||||
|
tar xf ruby-$RUBY_VER.tar.gz && \
|
||||||
|
cd ruby-$RUBY_VER && \
|
||||||
|
./configure --prefix=/opt/ruby \
|
||||||
|
--with-jemalloc \
|
||||||
|
--with-shared \
|
||||||
|
--disable-install-doc && \
|
||||||
|
make -j"$(nproc)" > /dev/null && \
|
||||||
|
make install && \
|
||||||
|
rm -rf ../ruby-$RUBY_VER.tar.gz ../ruby-$RUBY_VER
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
ENV PATH="${PATH}:/opt/ruby/bin:/opt/node/bin"
|
||||||
|
|
||||||
|
RUN npm install -g npm@latest && \
|
||||||
|
npm install -g yarn && \
|
||||||
|
gem install bundler && \
|
||||||
|
apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends git libicu-dev libidn11-dev \
|
||||||
|
libpq-dev shared-mime-info
|
||||||
|
|
||||||
WORKDIR /opt/mastodon
|
|
||||||
COPY Gemfile* package.json yarn.lock /opt/mastodon/
|
COPY Gemfile* package.json yarn.lock /opt/mastodon/
|
||||||
|
|
||||||
# hadolint ignore=DL3008
|
RUN cd /opt/mastodon && \
|
||||||
RUN apt-get update && \
|
bundle config set --local deployment 'true' && \
|
||||||
apt-get install -y --no-install-recommends build-essential \
|
bundle config set --local without 'development test' && \
|
||||||
ca-certificates \
|
bundle config set silence_root_warning true && \
|
||||||
git \
|
bundle install -j"$(nproc)" && \
|
||||||
libicu-dev \
|
yarn install --pure-lockfile
|
||||||
libidn11-dev \
|
|
||||||
libpq-dev \
|
|
||||||
libjemalloc-dev \
|
|
||||||
zlib1g-dev \
|
|
||||||
libgdbm-dev \
|
|
||||||
libgmp-dev \
|
|
||||||
libssl-dev \
|
|
||||||
libyaml-0-2 \
|
|
||||||
ca-certificates \
|
|
||||||
libreadline8 \
|
|
||||||
python3 \
|
|
||||||
shared-mime-info && \
|
|
||||||
bundle config set --local deployment 'true' && \
|
|
||||||
bundle config set --local without 'development test' && \
|
|
||||||
bundle config set silence_root_warning true && \
|
|
||||||
bundle install -j"$(nproc)" && \
|
|
||||||
yarn install --pure-lockfile --network-timeout 600000
|
|
||||||
|
|
||||||
FROM node:${NODE_VERSION}
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
ARG UID="991"
|
# Copy over all the langs needed for runtime
|
||||||
ARG GID="991"
|
COPY --from=build-dep /opt/node /opt/node
|
||||||
|
COPY --from=build-dep /opt/ruby /opt/ruby
|
||||||
|
|
||||||
COPY --link --from=ruby /opt/ruby /opt/ruby
|
# Add more PATHs to the PATH
|
||||||
|
ENV PATH="${PATH}:/opt/ruby/bin:/opt/node/bin:/opt/mastodon/bin"
|
||||||
|
|
||||||
|
# Create the mastodon user
|
||||||
|
ARG UID=991
|
||||||
|
ARG GID=991
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND="noninteractive" \
|
|
||||||
PATH="${PATH}:/opt/ruby/bin:/opt/mastodon/bin"
|
|
||||||
|
|
||||||
# Ignoreing these here since we don't want to pin any versions and the Debian image removes apt-get content after use
|
|
||||||
# hadolint ignore=DL3008,DL3009
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
echo "Etc/UTC" > /etc/localtime && \
|
echo "Etc/UTC" > /etc/localtime && \
|
||||||
groupadd -g "${GID}" mastodon && \
|
apt-get install -y --no-install-recommends whois wget && \
|
||||||
useradd -l -u "$UID" -g "${GID}" -m -d /opt/mastodon mastodon && \
|
addgroup --gid $GID mastodon && \
|
||||||
apt-get -y --no-install-recommends install whois \
|
useradd -m -u $UID -g $GID -d /opt/mastodon mastodon && \
|
||||||
wget \
|
echo "mastodon:$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 24 | mkpasswd -s -m sha-256)" | chpasswd && \
|
||||||
procps \
|
rm -rf /var/lib/apt/lists/*
|
||||||
libssl1.1 \
|
|
||||||
libpq5 \
|
|
||||||
imagemagick \
|
|
||||||
ffmpeg \
|
|
||||||
libjemalloc2 \
|
|
||||||
libicu67 \
|
|
||||||
libidn11 \
|
|
||||||
libyaml-0-2 \
|
|
||||||
file \
|
|
||||||
ca-certificates \
|
|
||||||
tzdata \
|
|
||||||
libreadline8 \
|
|
||||||
tini && \
|
|
||||||
ln -s /opt/mastodon /mastodon
|
|
||||||
|
|
||||||
# Note: no, cleaning here since Debian does this automatically
|
# Install mastodon runtime deps
|
||||||
# See the file /etc/apt/apt.conf.d/docker-clean within the Docker image's filesystem
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get -y --no-install-recommends install \
|
||||||
|
libssl1.1 libpq5 imagemagick ffmpeg libjemalloc2 \
|
||||||
|
libicu66 libidn11 libyaml-0-2 \
|
||||||
|
file ca-certificates tzdata libreadline8 gcc tini apt-utils && \
|
||||||
|
ln -s /opt/mastodon /mastodon && \
|
||||||
|
gem install bundler && \
|
||||||
|
rm -rf /var/cache && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Copy over mastodon source, and dependencies from building, and set permissions
|
||||||
COPY --chown=mastodon:mastodon . /opt/mastodon
|
COPY --chown=mastodon:mastodon . /opt/mastodon
|
||||||
COPY --chown=mastodon:mastodon --from=build /opt/mastodon /opt/mastodon
|
COPY --from=build-dep --chown=mastodon:mastodon /opt/mastodon /opt/mastodon
|
||||||
|
|
||||||
ENV RAILS_ENV="production" \
|
# Run mastodon services in prod mode
|
||||||
NODE_ENV="production" \
|
ENV RAILS_ENV="production"
|
||||||
RAILS_SERVE_STATIC_FILES="true" \
|
ENV NODE_ENV="production"
|
||||||
BIND="0.0.0.0"
|
|
||||||
|
# Tell rails to serve static files
|
||||||
|
ENV RAILS_SERVE_STATIC_FILES="true"
|
||||||
|
ENV BIND="0.0.0.0"
|
||||||
|
|
||||||
# Set the run user
|
# Set the run user
|
||||||
USER mastodon
|
USER mastodon
|
||||||
WORKDIR /opt/mastodon
|
|
||||||
|
|
||||||
# Precompile assets
|
# Precompile assets
|
||||||
RUN OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile && \
|
RUN cd ~ && \
|
||||||
yarn cache clean
|
OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile && \
|
||||||
|
yarn cache clean
|
||||||
|
|
||||||
# Set the work dir and the container entry point
|
# Set the work dir and the container entry point
|
||||||
|
WORKDIR /opt/mastodon
|
||||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||||||
EXPOSE 3000 4000
|
EXPOSE 3000 4000
|
||||||
|
|
70
Gemfile
70
Gemfile
|
@ -1,32 +1,32 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
ruby '>= 2.7.0', '< 3.1.0'
|
ruby '>= 2.6.0', '< 3.1.0'
|
||||||
|
|
||||||
gem 'pkg-config', '~> 1.5'
|
gem 'pkg-config', '~> 1.4'
|
||||||
gem 'rexml', '~> 3.2'
|
gem 'rexml', '~> 3.2'
|
||||||
|
|
||||||
gem 'puma', '~> 5.6'
|
gem 'puma', '~> 5.6'
|
||||||
gem 'rails', '~> 6.1.7'
|
gem 'rails', '~> 6.1.6'
|
||||||
gem 'sprockets', '~> 3.7.2'
|
gem 'sprockets', '~> 3.7.2'
|
||||||
gem 'thor', '~> 1.2'
|
gem 'thor', '~> 1.2'
|
||||||
gem 'rack', '~> 2.2.4'
|
gem 'rack', '~> 2.2.3'
|
||||||
|
|
||||||
gem 'hamlit-rails', '~> 0.2'
|
gem 'hamlit-rails', '~> 0.2'
|
||||||
gem 'pg', '~> 1.4'
|
gem 'pg', '~> 1.3'
|
||||||
gem 'makara', '~> 0.5'
|
gem 'makara', '~> 0.5'
|
||||||
gem 'pghero', '~> 2.8'
|
gem 'pghero', '~> 2.8'
|
||||||
gem 'dotenv-rails', '~> 2.8'
|
gem 'dotenv-rails', '~> 2.7'
|
||||||
|
|
||||||
gem 'aws-sdk-s3', '~> 1.117', require: false
|
gem 'aws-sdk-s3', '~> 1.114', require: false
|
||||||
gem 'fog-core', '<= 2.4.0'
|
gem 'fog-core', '<= 2.1.0'
|
||||||
gem 'fog-openstack', '~> 0.3', require: false
|
gem 'fog-openstack', '~> 0.3', require: false
|
||||||
gem 'kt-paperclip', '~> 7.1'
|
gem 'kt-paperclip', '~> 7.1'
|
||||||
gem 'blurhash', '~> 0.1'
|
gem 'blurhash', '~> 0.1'
|
||||||
|
|
||||||
gem 'active_model_serializers', '~> 0.10'
|
gem 'active_model_serializers', '~> 0.10'
|
||||||
gem 'addressable', '~> 2.8'
|
gem 'addressable', '~> 2.8'
|
||||||
gem 'bootsnap', '~> 1.15.0', require: false
|
gem 'bootsnap', '~> 1.11.1', require: false
|
||||||
gem 'browser'
|
gem 'browser'
|
||||||
gem 'charlock_holmes', '~> 0.7.7'
|
gem 'charlock_holmes', '~> 0.7.7'
|
||||||
gem 'chewy', '~> 7.2'
|
gem 'chewy', '~> 7.2'
|
||||||
|
@ -40,22 +40,22 @@ end
|
||||||
gem 'net-ldap', '~> 0.17'
|
gem 'net-ldap', '~> 0.17'
|
||||||
gem 'omniauth-cas', '~> 2.0'
|
gem 'omniauth-cas', '~> 2.0'
|
||||||
gem 'omniauth-saml', '~> 1.10'
|
gem 'omniauth-saml', '~> 1.10'
|
||||||
gem 'gitlab-omniauth-openid-connect', '~>0.10.0', require: 'omniauth_openid_connect'
|
gem 'gitlab-omniauth-openid-connect', '~>0.9.1', require: 'omniauth_openid_connect'
|
||||||
gem 'omniauth', '~> 1.9'
|
gem 'omniauth', '~> 1.9'
|
||||||
gem 'omniauth-rails_csrf_protection', '~> 0.1'
|
gem 'omniauth-rails_csrf_protection', '~> 0.1'
|
||||||
|
|
||||||
gem 'color_diff', '~> 0.1'
|
gem 'color_diff', '~> 0.1'
|
||||||
gem 'discard', '~> 1.2'
|
gem 'discard', '~> 1.2'
|
||||||
gem 'doorkeeper', '~> 5.6'
|
gem 'doorkeeper', '~> 5.5'
|
||||||
gem 'ed25519', '~> 1.3'
|
gem 'ed25519', '~> 1.3'
|
||||||
gem 'fast_blank', '~> 1.0'
|
gem 'fast_blank', '~> 1.0'
|
||||||
gem 'fastimage'
|
gem 'fastimage'
|
||||||
gem 'hiredis', '~> 0.6'
|
gem 'hiredis', '~> 0.6'
|
||||||
gem 'redis-namespace', '~> 1.9'
|
gem 'redis-namespace', '~> 1.8'
|
||||||
gem 'htmlentities', '~> 4.3'
|
gem 'htmlentities', '~> 4.3'
|
||||||
gem 'http', '~> 5.1'
|
gem 'http', '~> 5.0'
|
||||||
gem 'http_accept_language', '~> 2.1'
|
gem 'http_accept_language', '~> 2.1'
|
||||||
gem 'httplog', '~> 1.6.2'
|
gem 'httplog', '~> 1.5.0'
|
||||||
gem 'idn-ruby', require: 'idn'
|
gem 'idn-ruby', require: 'idn'
|
||||||
gem 'kaminari', '~> 1.2'
|
gem 'kaminari', '~> 1.2'
|
||||||
gem 'link_header', '~> 0.0'
|
gem 'link_header', '~> 0.0'
|
||||||
|
@ -66,51 +66,45 @@ gem 'oj', '~> 3.13'
|
||||||
gem 'ox', '~> 2.14'
|
gem 'ox', '~> 2.14'
|
||||||
gem 'parslet'
|
gem 'parslet'
|
||||||
gem 'posix-spawn'
|
gem 'posix-spawn'
|
||||||
gem 'public_suffix', '~> 5.0'
|
gem 'pundit', '~> 2.2'
|
||||||
gem 'pundit', '~> 2.3'
|
|
||||||
gem 'premailer-rails'
|
gem 'premailer-rails'
|
||||||
gem 'rack-attack', '~> 6.6'
|
gem 'rack-attack', '~> 6.6'
|
||||||
gem 'rack-cors', '~> 1.1', require: 'rack/cors'
|
gem 'rack-cors', '~> 1.1', require: 'rack/cors'
|
||||||
gem 'rails-i18n', '~> 6.0'
|
gem 'rails-i18n', '~> 6.0'
|
||||||
gem 'rails-settings-cached', '~> 0.6'
|
gem 'rails-settings-cached', '~> 0.6'
|
||||||
gem 'redcarpet', '~> 3.5'
|
|
||||||
gem 'redis', '~> 4.5', require: ['redis', 'redis/connection/hiredis']
|
gem 'redis', '~> 4.5', require: ['redis', 'redis/connection/hiredis']
|
||||||
gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock'
|
gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock'
|
||||||
gem 'rqrcode', '~> 2.1'
|
gem 'rqrcode', '~> 2.1'
|
||||||
gem 'ruby-progressbar', '~> 1.11'
|
gem 'ruby-progressbar', '~> 1.11'
|
||||||
gem 'sanitize', '~> 6.0'
|
gem 'sanitize', '~> 6.0'
|
||||||
gem 'scenic', '~> 1.7'
|
gem 'scenic', '~> 1.6'
|
||||||
gem 'sidekiq', '~> 6.5'
|
gem 'sidekiq', '~> 6.4'
|
||||||
gem 'sidekiq-scheduler', '~> 4.0'
|
gem 'sidekiq-scheduler', '~> 4.0'
|
||||||
gem 'sidekiq-unique-jobs', '~> 7.1'
|
gem 'sidekiq-unique-jobs', '~> 7.1'
|
||||||
gem 'sidekiq-bulk', '~> 0.2.0'
|
gem 'sidekiq-bulk', '~> 0.2.0'
|
||||||
gem 'simple-navigation', '~> 4.4'
|
gem 'simple-navigation', '~> 4.3'
|
||||||
gem 'simple_form', '~> 5.1'
|
gem 'simple_form', '~> 5.1'
|
||||||
gem 'sprockets-rails', '~> 3.4', require: 'sprockets/railtie'
|
gem 'sprockets-rails', '~> 3.4', require: 'sprockets/railtie'
|
||||||
gem 'stoplight', '~> 3.0.1'
|
gem 'stoplight', '~> 3.0.0'
|
||||||
gem 'strong_migrations', '~> 0.7'
|
gem 'strong_migrations', '~> 0.7'
|
||||||
gem 'tty-prompt', '~> 0.23', require: false
|
gem 'tty-prompt', '~> 0.23', require: false
|
||||||
gem 'twitter-text', '~> 3.1.0'
|
gem 'twitter-text', '~> 3.1.0'
|
||||||
gem 'tzinfo-data', '~> 1.2022'
|
gem 'tzinfo-data', '~> 1.2022'
|
||||||
gem 'webpacker', '~> 5.4'
|
gem 'webpacker', '~> 5.4'
|
||||||
gem 'webpush', github: 'ClearlyClaire/webpush', ref: 'f14a4d52e201128b1b00245d11b6de80d6cfdcd9'
|
gem 'webpush', '~> 0.3'
|
||||||
gem 'webauthn', '~> 2.5'
|
gem 'webauthn', '~> 3.0.0.alpha1'
|
||||||
|
|
||||||
gem 'json-ld'
|
gem 'json-ld'
|
||||||
gem 'json-ld-preloaded', '~> 3.2'
|
gem 'json-ld-preloaded', '~> 3.2'
|
||||||
gem 'rdf-normalize', '~> 0.5'
|
gem 'rdf-normalize', '~> 0.5'
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'fabrication', '~> 2.30'
|
gem 'fabrication', '~> 2.28'
|
||||||
gem 'fuubar', '~> 2.5'
|
gem 'fuubar', '~> 2.5'
|
||||||
gem 'i18n-tasks', '~> 1.0', require: false
|
gem 'i18n-tasks', '~> 1.0', require: false
|
||||||
gem 'pry-byebug', '~> 3.10'
|
gem 'pry-byebug', '~> 3.9'
|
||||||
gem 'pry-rails', '~> 0.3'
|
gem 'pry-rails', '~> 0.3'
|
||||||
gem 'rspec-rails', '~> 5.1'
|
gem 'rspec-rails', '~> 5.1'
|
||||||
gem 'rubocop-performance', require: false
|
|
||||||
gem 'rubocop-rails', require: false
|
|
||||||
gem 'rubocop-rspec', require: false
|
|
||||||
gem 'rubocop', require: false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :production, :test do
|
group :production, :test do
|
||||||
|
@ -118,17 +112,15 @@ group :production, :test do
|
||||||
end
|
end
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'capybara', '~> 3.38'
|
gem 'capybara', '~> 3.37'
|
||||||
gem 'climate_control', '~> 0.2'
|
gem 'climate_control', '~> 0.2'
|
||||||
gem 'faker', '~> 3.0'
|
gem 'faker', '~> 2.21'
|
||||||
gem 'json-schema', '~> 3.0'
|
gem 'microformats', '~> 4.2'
|
||||||
gem 'microformats', '~> 4.4'
|
|
||||||
gem 'rack-test', '~> 2.0'
|
|
||||||
gem 'rails-controller-testing', '~> 1.0'
|
gem 'rails-controller-testing', '~> 1.0'
|
||||||
gem 'rspec_junit_formatter', '~> 0.6'
|
|
||||||
gem 'rspec-sidekiq', '~> 3.1'
|
gem 'rspec-sidekiq', '~> 3.1'
|
||||||
gem 'simplecov', '~> 0.21', require: false
|
gem 'simplecov', '~> 0.21', require: false
|
||||||
gem 'webmock', '~> 3.18'
|
gem 'webmock', '~> 3.14'
|
||||||
|
gem 'rspec_junit_formatter', '~> 0.5'
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
|
@ -140,7 +132,9 @@ group :development do
|
||||||
gem 'letter_opener', '~> 1.8'
|
gem 'letter_opener', '~> 1.8'
|
||||||
gem 'letter_opener_web', '~> 2.0'
|
gem 'letter_opener_web', '~> 2.0'
|
||||||
gem 'memory_profiler'
|
gem 'memory_profiler'
|
||||||
gem 'brakeman', '~> 5.4', require: false
|
gem 'rubocop', '~> 1.29', require: false
|
||||||
|
gem 'rubocop-rails', '~> 2.14', require: false
|
||||||
|
gem 'brakeman', '~> 5.2', require: false
|
||||||
gem 'bundler-audit', '~> 0.9', require: false
|
gem 'bundler-audit', '~> 0.9', require: false
|
||||||
|
|
||||||
gem 'capistrano', '~> 3.17'
|
gem 'capistrano', '~> 3.17'
|
||||||
|
@ -157,5 +151,5 @@ end
|
||||||
|
|
||||||
gem 'concurrent-ruby', require: false
|
gem 'concurrent-ruby', require: false
|
||||||
gem 'connection_pool', require: false
|
gem 'connection_pool', require: false
|
||||||
|
|
||||||
gem 'xorcist', '~> 1.1'
|
gem 'xorcist', '~> 1.1'
|
||||||
gem 'cocoon', '~> 1.2'
|
|
||||||
|
|
475
Gemfile.lock
475
Gemfile.lock
|
@ -1,49 +1,40 @@
|
||||||
GIT
|
|
||||||
remote: https://github.com/ClearlyClaire/webpush.git
|
|
||||||
revision: f14a4d52e201128b1b00245d11b6de80d6cfdcd9
|
|
||||||
ref: f14a4d52e201128b1b00245d11b6de80d6cfdcd9
|
|
||||||
specs:
|
|
||||||
webpush (0.3.8)
|
|
||||||
hkdf (~> 0.2)
|
|
||||||
jwt (~> 2.0)
|
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (6.1.7)
|
actioncable (6.1.6)
|
||||||
actionpack (= 6.1.7)
|
actionpack (= 6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailbox (6.1.7)
|
actionmailbox (6.1.6)
|
||||||
actionpack (= 6.1.7)
|
actionpack (= 6.1.6)
|
||||||
activejob (= 6.1.7)
|
activejob (= 6.1.6)
|
||||||
activerecord (= 6.1.7)
|
activerecord (= 6.1.6)
|
||||||
activestorage (= 6.1.7)
|
activestorage (= 6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
actionmailer (6.1.7)
|
actionmailer (6.1.6)
|
||||||
actionpack (= 6.1.7)
|
actionpack (= 6.1.6)
|
||||||
actionview (= 6.1.7)
|
actionview (= 6.1.6)
|
||||||
activejob (= 6.1.7)
|
activejob (= 6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (6.1.7)
|
actionpack (6.1.6)
|
||||||
actionview (= 6.1.7)
|
actionview (= 6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
rack (~> 2.0, >= 2.0.9)
|
rack (~> 2.0, >= 2.0.9)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||||
actiontext (6.1.7)
|
actiontext (6.1.6)
|
||||||
actionpack (= 6.1.7)
|
actionpack (= 6.1.6)
|
||||||
activerecord (= 6.1.7)
|
activerecord (= 6.1.6)
|
||||||
activestorage (= 6.1.7)
|
activestorage (= 6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (6.1.7)
|
actionview (6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
|
@ -54,31 +45,31 @@ GEM
|
||||||
case_transform (>= 0.2)
|
case_transform (>= 0.2)
|
||||||
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
||||||
active_record_query_trace (1.8)
|
active_record_query_trace (1.8)
|
||||||
activejob (6.1.7)
|
activejob (6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (6.1.7)
|
activemodel (6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
activerecord (6.1.7)
|
activerecord (6.1.6)
|
||||||
activemodel (= 6.1.7)
|
activemodel (= 6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
activestorage (6.1.7)
|
activestorage (6.1.6)
|
||||||
actionpack (= 6.1.7)
|
actionpack (= 6.1.6)
|
||||||
activejob (= 6.1.7)
|
activejob (= 6.1.6)
|
||||||
activerecord (= 6.1.7)
|
activerecord (= 6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
mini_mime (>= 1.1.0)
|
mini_mime (>= 1.1.0)
|
||||||
activesupport (6.1.7)
|
activesupport (6.1.6)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
minitest (>= 5.1)
|
minitest (>= 5.1)
|
||||||
tzinfo (~> 2.0)
|
tzinfo (~> 2.0)
|
||||||
zeitwerk (~> 2.3)
|
zeitwerk (~> 2.3)
|
||||||
addressable (2.8.1)
|
addressable (2.8.0)
|
||||||
public_suffix (>= 2.0.2, < 6.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
aes_key_wrap (1.1.0)
|
aes_key_wrap (1.1.0)
|
||||||
airbrussh (1.4.1)
|
airbrussh (1.4.0)
|
||||||
sshkit (>= 1.6.1, != 1.7.0)
|
sshkit (>= 1.6.1, != 1.7.0)
|
||||||
android_key_attestation (0.3.0)
|
android_key_attestation (0.3.0)
|
||||||
annotate (3.2.0)
|
annotate (3.2.0)
|
||||||
|
@ -88,33 +79,34 @@ GEM
|
||||||
attr_encrypted (3.1.0)
|
attr_encrypted (3.1.0)
|
||||||
encryptor (~> 3.0.0)
|
encryptor (~> 3.0.0)
|
||||||
attr_required (1.0.1)
|
attr_required (1.0.1)
|
||||||
awrence (1.2.1)
|
awrence (1.1.1)
|
||||||
aws-eventstream (1.2.0)
|
aws-eventstream (1.2.0)
|
||||||
aws-partitions (1.670.0)
|
aws-partitions (1.587.0)
|
||||||
aws-sdk-core (3.168.2)
|
aws-sdk-core (3.130.2)
|
||||||
aws-eventstream (~> 1, >= 1.0.2)
|
aws-eventstream (~> 1, >= 1.0.2)
|
||||||
aws-partitions (~> 1, >= 1.651.0)
|
aws-partitions (~> 1, >= 1.525.0)
|
||||||
aws-sigv4 (~> 1.5)
|
|
||||||
jmespath (~> 1, >= 1.6.1)
|
|
||||||
aws-sdk-kms (1.60.0)
|
|
||||||
aws-sdk-core (~> 3, >= 3.165.0)
|
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
aws-sdk-s3 (1.117.2)
|
jmespath (~> 1.0)
|
||||||
aws-sdk-core (~> 3, >= 3.165.0)
|
aws-sdk-kms (1.56.0)
|
||||||
|
aws-sdk-core (~> 3, >= 3.127.0)
|
||||||
|
aws-sigv4 (~> 1.1)
|
||||||
|
aws-sdk-s3 (1.114.0)
|
||||||
|
aws-sdk-core (~> 3, >= 3.127.0)
|
||||||
aws-sdk-kms (~> 1)
|
aws-sdk-kms (~> 1)
|
||||||
aws-sigv4 (~> 1.4)
|
aws-sigv4 (~> 1.4)
|
||||||
aws-sigv4 (1.5.2)
|
aws-sigv4 (1.5.0)
|
||||||
aws-eventstream (~> 1, >= 1.0.2)
|
aws-eventstream (~> 1, >= 1.0.2)
|
||||||
bcrypt (3.1.17)
|
bcrypt (3.1.17)
|
||||||
better_errors (2.9.1)
|
better_errors (2.9.1)
|
||||||
coderay (>= 1.0.0)
|
coderay (>= 1.0.0)
|
||||||
erubi (>= 1.0.0)
|
erubi (>= 1.0.0)
|
||||||
rack (>= 0.9.0)
|
rack (>= 0.9.0)
|
||||||
better_html (2.0.1)
|
better_html (1.0.16)
|
||||||
actionview (>= 6.0)
|
actionview (>= 4.0)
|
||||||
activesupport (>= 6.0)
|
activesupport (>= 4.0)
|
||||||
ast (~> 2.0)
|
ast (~> 2.0)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
|
html_tokenizer (~> 0.0.6)
|
||||||
parser (>= 2.4)
|
parser (>= 2.4)
|
||||||
smart_properties
|
smart_properties
|
||||||
bindata (2.4.10)
|
bindata (2.4.10)
|
||||||
|
@ -122,22 +114,22 @@ GEM
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
blurhash (0.1.6)
|
blurhash (0.1.6)
|
||||||
ffi (~> 1.14)
|
ffi (~> 1.14)
|
||||||
bootsnap (1.15.0)
|
bootsnap (1.11.1)
|
||||||
msgpack (~> 1.2)
|
msgpack (~> 1.2)
|
||||||
brakeman (5.4.0)
|
brakeman (5.2.3)
|
||||||
browser (4.2.0)
|
browser (4.2.0)
|
||||||
brpoplpush-redis_script (0.1.3)
|
brpoplpush-redis_script (0.1.2)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.5)
|
concurrent-ruby (~> 1.0, >= 1.0.5)
|
||||||
redis (>= 1.0, < 6)
|
redis (>= 1.0, <= 5.0)
|
||||||
builder (3.2.4)
|
builder (3.2.4)
|
||||||
bullet (7.0.4)
|
bullet (7.0.1)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
uniform_notifier (~> 1.11)
|
uniform_notifier (~> 1.11)
|
||||||
bundler-audit (0.9.1)
|
bundler-audit (0.9.0.1)
|
||||||
bundler (>= 1.2.0, < 3)
|
bundler (>= 1.2.0, < 3)
|
||||||
thor (~> 1.0)
|
thor (~> 1.0)
|
||||||
byebug (11.1.3)
|
byebug (11.1.3)
|
||||||
capistrano (3.17.1)
|
capistrano (3.17.0)
|
||||||
airbrussh (>= 1.0.0)
|
airbrussh (>= 1.0.0)
|
||||||
i18n
|
i18n
|
||||||
rake (>= 10.0.0)
|
rake (>= 10.0.0)
|
||||||
|
@ -152,7 +144,7 @@ GEM
|
||||||
sshkit (~> 1.3)
|
sshkit (~> 1.3)
|
||||||
capistrano-yarn (2.0.2)
|
capistrano-yarn (2.0.2)
|
||||||
capistrano (~> 3.0)
|
capistrano (~> 3.0)
|
||||||
capybara (3.38.0)
|
capybara (3.37.1)
|
||||||
addressable
|
addressable
|
||||||
matrix
|
matrix
|
||||||
mini_mime (>= 0.1.3)
|
mini_mime (>= 0.1.3)
|
||||||
|
@ -171,18 +163,17 @@ GEM
|
||||||
elasticsearch-dsl
|
elasticsearch-dsl
|
||||||
chunky_png (1.4.0)
|
chunky_png (1.4.0)
|
||||||
climate_control (0.2.0)
|
climate_control (0.2.0)
|
||||||
cocoon (1.2.15)
|
|
||||||
coderay (1.1.3)
|
coderay (1.1.3)
|
||||||
color_diff (0.1)
|
color_diff (0.1)
|
||||||
concurrent-ruby (1.1.10)
|
concurrent-ruby (1.1.10)
|
||||||
connection_pool (2.3.0)
|
connection_pool (2.2.5)
|
||||||
cose (1.2.1)
|
cose (1.0.0)
|
||||||
cbor (~> 0.5.9)
|
cbor (~> 0.5.9)
|
||||||
openssl-signature_algorithm (~> 1.0)
|
openssl-signature_algorithm (~> 0.4.0)
|
||||||
crack (0.4.5)
|
crack (0.4.5)
|
||||||
rexml
|
rexml
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
css_parser (1.12.0)
|
css_parser (1.7.1)
|
||||||
addressable
|
addressable
|
||||||
debug_inspector (1.0.0)
|
debug_inspector (1.0.0)
|
||||||
devise (4.8.1)
|
devise (4.8.1)
|
||||||
|
@ -206,11 +197,11 @@ GEM
|
||||||
docile (1.3.4)
|
docile (1.3.4)
|
||||||
domain_name (0.5.20190701)
|
domain_name (0.5.20190701)
|
||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
doorkeeper (5.6.2)
|
doorkeeper (5.5.4)
|
||||||
railties (>= 5)
|
railties (>= 5)
|
||||||
dotenv (2.8.1)
|
dotenv (2.7.6)
|
||||||
dotenv-rails (2.8.1)
|
dotenv-rails (2.7.6)
|
||||||
dotenv (= 2.8.1)
|
dotenv (= 2.7.6)
|
||||||
railties (>= 3.2)
|
railties (>= 3.2)
|
||||||
ed25519 (1.3.0)
|
ed25519 (1.3.0)
|
||||||
elasticsearch (7.13.3)
|
elasticsearch (7.13.3)
|
||||||
|
@ -223,12 +214,12 @@ GEM
|
||||||
faraday (~> 1)
|
faraday (~> 1)
|
||||||
multi_json
|
multi_json
|
||||||
encryptor (3.0.0)
|
encryptor (3.0.0)
|
||||||
erubi (1.11.0)
|
erubi (1.10.0)
|
||||||
et-orbi (1.2.7)
|
et-orbi (1.2.7)
|
||||||
tzinfo
|
tzinfo
|
||||||
excon (0.95.0)
|
excon (0.76.0)
|
||||||
fabrication (2.30.0)
|
fabrication (2.28.0)
|
||||||
faker (3.0.0)
|
faker (2.21.0)
|
||||||
i18n (>= 1.8.11, < 2)
|
i18n (>= 1.8.11, < 2)
|
||||||
faraday (1.9.3)
|
faraday (1.9.3)
|
||||||
faraday-em_http (~> 1.0)
|
faraday-em_http (~> 1.0)
|
||||||
|
@ -271,16 +262,16 @@ GEM
|
||||||
fog-core (>= 1.45, <= 2.1.0)
|
fog-core (>= 1.45, <= 2.1.0)
|
||||||
fog-json (>= 1.0)
|
fog-json (>= 1.0)
|
||||||
ipaddress (>= 0.8)
|
ipaddress (>= 0.8)
|
||||||
formatador (0.3.0)
|
formatador (0.2.5)
|
||||||
fugit (1.7.1)
|
fugit (1.5.3)
|
||||||
et-orbi (~> 1, >= 1.2.7)
|
et-orbi (~> 1, >= 1.2.7)
|
||||||
raabro (~> 1.4)
|
raabro (~> 1.4)
|
||||||
fuubar (2.5.1)
|
fuubar (2.5.1)
|
||||||
rspec-core (~> 3.0)
|
rspec-core (~> 3.0)
|
||||||
ruby-progressbar (~> 1.4)
|
ruby-progressbar (~> 1.4)
|
||||||
gitlab-omniauth-openid-connect (0.10.0)
|
gitlab-omniauth-openid-connect (0.9.1)
|
||||||
addressable (~> 2.7)
|
addressable (~> 2.7)
|
||||||
omniauth (>= 1.9, < 3)
|
omniauth (~> 1.9)
|
||||||
openid_connect (~> 1.2)
|
openid_connect (~> 1.2)
|
||||||
globalid (1.0.0)
|
globalid (1.0.0)
|
||||||
activesupport (>= 5.0)
|
activesupport (>= 5.0)
|
||||||
|
@ -298,26 +289,27 @@ GEM
|
||||||
highline (2.0.3)
|
highline (2.0.3)
|
||||||
hiredis (0.6.3)
|
hiredis (0.6.3)
|
||||||
hkdf (0.3.0)
|
hkdf (0.3.0)
|
||||||
|
html_tokenizer (0.0.7)
|
||||||
htmlentities (4.3.4)
|
htmlentities (4.3.4)
|
||||||
http (5.1.1)
|
http (5.0.4)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
http-cookie (~> 1.0)
|
http-cookie (~> 1.0)
|
||||||
http-form_data (~> 2.2)
|
http-form_data (~> 2.2)
|
||||||
llhttp-ffi (~> 0.4.0)
|
llhttp-ffi (~> 0.4.0)
|
||||||
http-cookie (1.0.5)
|
http-cookie (1.0.4)
|
||||||
domain_name (~> 0.5)
|
domain_name (~> 0.5)
|
||||||
http-form_data (2.3.0)
|
http-form_data (2.3.0)
|
||||||
http_accept_language (2.1.1)
|
http_accept_language (2.1.1)
|
||||||
httpclient (2.8.3)
|
httpclient (2.8.3)
|
||||||
httplog (1.6.2)
|
httplog (1.5.0)
|
||||||
rack (>= 2.0)
|
rack (>= 1.0)
|
||||||
rainbow (>= 2.0.0)
|
rainbow (>= 2.0.0)
|
||||||
i18n (1.12.0)
|
i18n (1.10.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
i18n-tasks (1.0.12)
|
i18n-tasks (1.0.10)
|
||||||
activesupport (>= 4.0.2)
|
activesupport (>= 4.0.2)
|
||||||
ast (>= 2.1.0)
|
ast (>= 2.1.0)
|
||||||
better_html (>= 1.0, < 3.0)
|
better_html (~> 1.0)
|
||||||
erubi
|
erubi
|
||||||
highline (>= 2.0.0)
|
highline (>= 2.0.0)
|
||||||
i18n
|
i18n
|
||||||
|
@ -325,29 +317,27 @@ GEM
|
||||||
rails-i18n
|
rails-i18n
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
terminal-table (>= 1.5.1)
|
terminal-table (>= 1.5.1)
|
||||||
idn-ruby (0.1.5)
|
idn-ruby (0.1.4)
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jmespath (1.6.2)
|
jmespath (1.6.1)
|
||||||
json (2.6.2)
|
json (2.5.1)
|
||||||
json-canonicalization (0.3.0)
|
json-canonicalization (0.3.0)
|
||||||
json-jwt (1.13.0)
|
json-jwt (1.13.0)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
aes_key_wrap
|
aes_key_wrap
|
||||||
bindata
|
bindata
|
||||||
json-ld (3.2.3)
|
json-ld (3.2.0)
|
||||||
htmlentities (~> 4.3)
|
htmlentities (~> 4.3)
|
||||||
json-canonicalization (~> 0.3)
|
json-canonicalization (~> 0.3)
|
||||||
link_header (~> 0.0, >= 0.0.8)
|
link_header (~> 0.0, >= 0.0.8)
|
||||||
multi_json (~> 1.15)
|
multi_json (~> 1.15)
|
||||||
rack (~> 2.2)
|
rack (~> 2.2)
|
||||||
rdf (~> 3.2, >= 3.2.9)
|
rdf (~> 3.2)
|
||||||
json-ld-preloaded (3.2.2)
|
json-ld-preloaded (3.2.0)
|
||||||
json-ld (~> 3.2)
|
json-ld (~> 3.2)
|
||||||
rdf (~> 3.2)
|
rdf (~> 3.2)
|
||||||
json-schema (3.0.0)
|
|
||||||
addressable (>= 2.8)
|
|
||||||
jsonapi-renderer (0.2.2)
|
jsonapi-renderer (0.2.2)
|
||||||
jwt (2.4.1)
|
jwt (2.2.2)
|
||||||
kaminari (1.2.2)
|
kaminari (1.2.2)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
kaminari-actionview (= 1.2.2)
|
kaminari-actionview (= 1.2.2)
|
||||||
|
@ -384,7 +374,7 @@ GEM
|
||||||
activesupport (>= 4)
|
activesupport (>= 4)
|
||||||
railties (>= 4)
|
railties (>= 4)
|
||||||
request_store (~> 1.0)
|
request_store (~> 1.0)
|
||||||
loofah (2.19.1)
|
loofah (2.18.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.7.1)
|
mail (2.7.1)
|
||||||
|
@ -395,9 +385,9 @@ GEM
|
||||||
mario-redis-lock (1.2.1)
|
mario-redis-lock (1.2.1)
|
||||||
redis (>= 3.0.5)
|
redis (>= 3.0.5)
|
||||||
matrix (0.4.2)
|
matrix (0.4.2)
|
||||||
memory_profiler (1.0.1)
|
memory_profiler (1.0.0)
|
||||||
method_source (1.0.0)
|
method_source (1.0.0)
|
||||||
microformats (4.4.1)
|
microformats (4.3.1)
|
||||||
json (~> 2.2)
|
json (~> 2.2)
|
||||||
nokogiri (~> 1.10)
|
nokogiri (~> 1.10)
|
||||||
mime-types (3.4.1)
|
mime-types (3.4.1)
|
||||||
|
@ -405,20 +395,16 @@ GEM
|
||||||
mime-types-data (3.2022.0105)
|
mime-types-data (3.2022.0105)
|
||||||
mini_mime (1.1.2)
|
mini_mime (1.1.2)
|
||||||
mini_portile2 (2.8.0)
|
mini_portile2 (2.8.0)
|
||||||
minitest (5.16.3)
|
minitest (5.15.0)
|
||||||
msgpack (1.6.0)
|
msgpack (1.5.1)
|
||||||
multi_json (1.15.0)
|
multi_json (1.15.0)
|
||||||
multipart-post (2.1.1)
|
multipart-post (2.1.1)
|
||||||
net-ldap (0.17.1)
|
net-ldap (0.17.0)
|
||||||
net-protocol (0.1.3)
|
net-scp (3.0.0)
|
||||||
timeout
|
net-ssh (>= 2.6.5, < 7.0.0)
|
||||||
net-scp (4.0.0.rc1)
|
net-ssh (6.1.0)
|
||||||
net-ssh (>= 2.6.5, < 8.0.0)
|
|
||||||
net-smtp (0.3.3)
|
|
||||||
net-protocol
|
|
||||||
net-ssh (7.0.1)
|
|
||||||
nio4r (2.5.8)
|
nio4r (2.5.8)
|
||||||
nokogiri (1.13.10)
|
nokogiri (1.13.6)
|
||||||
mini_portile2 (~> 2.8.0)
|
mini_portile2 (~> 2.8.0)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nsa (0.2.8)
|
nsa (0.2.8)
|
||||||
|
@ -426,8 +412,8 @@ GEM
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
sidekiq (>= 3.5)
|
sidekiq (>= 3.5)
|
||||||
statsd-ruby (~> 1.4, >= 1.4.0)
|
statsd-ruby (~> 1.4, >= 1.4.0)
|
||||||
oj (3.13.23)
|
oj (3.13.11)
|
||||||
omniauth (1.9.2)
|
omniauth (1.9.1)
|
||||||
hashie (>= 3.4.6)
|
hashie (>= 3.4.6)
|
||||||
rack (>= 1.6.2, < 3)
|
rack (>= 1.6.2, < 3)
|
||||||
omniauth-cas (2.0.0)
|
omniauth-cas (2.0.0)
|
||||||
|
@ -450,47 +436,45 @@ GEM
|
||||||
validate_email
|
validate_email
|
||||||
validate_url
|
validate_url
|
||||||
webfinger (>= 1.0.1)
|
webfinger (>= 1.0.1)
|
||||||
openssl (3.0.0)
|
openssl (2.2.0)
|
||||||
openssl-signature_algorithm (1.2.1)
|
openssl-signature_algorithm (0.4.0)
|
||||||
openssl (> 2.0, < 3.1)
|
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
ox (2.14.11)
|
ox (2.14.11)
|
||||||
parallel (1.22.1)
|
parallel (1.22.1)
|
||||||
parser (3.1.2.1)
|
parser (3.1.2.0)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
parslet (2.0.0)
|
parslet (2.0.0)
|
||||||
pastel (0.8.0)
|
pastel (0.8.0)
|
||||||
tty-color (~> 0.5)
|
tty-color (~> 0.5)
|
||||||
pg (1.4.5)
|
pg (1.3.5)
|
||||||
pghero (2.8.3)
|
pghero (2.8.3)
|
||||||
activerecord (>= 5)
|
activerecord (>= 5)
|
||||||
pkg-config (1.5.1)
|
pkg-config (1.4.7)
|
||||||
posix-spawn (0.3.15)
|
posix-spawn (0.3.15)
|
||||||
premailer (1.18.0)
|
premailer (1.14.2)
|
||||||
addressable
|
addressable
|
||||||
css_parser (>= 1.12.0)
|
css_parser (>= 1.6.0)
|
||||||
htmlentities (>= 4.0.0)
|
htmlentities (>= 4.0.0)
|
||||||
premailer-rails (1.12.0)
|
premailer-rails (1.11.1)
|
||||||
actionmailer (>= 3)
|
actionmailer (>= 3)
|
||||||
net-smtp
|
|
||||||
premailer (~> 1.7, >= 1.7.9)
|
premailer (~> 1.7, >= 1.7.9)
|
||||||
private_address_check (0.5.0)
|
private_address_check (0.5.0)
|
||||||
pry (0.14.1)
|
pry (0.13.1)
|
||||||
coderay (~> 1.1)
|
coderay (~> 1.1)
|
||||||
method_source (~> 1.0)
|
method_source (~> 1.0)
|
||||||
pry-byebug (3.10.1)
|
pry-byebug (3.9.0)
|
||||||
byebug (~> 11.0)
|
byebug (~> 11.0)
|
||||||
pry (>= 0.13, < 0.15)
|
pry (~> 0.13.0)
|
||||||
pry-rails (0.3.9)
|
pry-rails (0.3.9)
|
||||||
pry (>= 0.10.4)
|
pry (>= 0.10.4)
|
||||||
public_suffix (5.0.1)
|
public_suffix (4.0.7)
|
||||||
puma (5.6.5)
|
puma (5.6.4)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
pundit (2.3.0)
|
pundit (2.2.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
raabro (1.4.0)
|
raabro (1.4.0)
|
||||||
racc (1.6.1)
|
racc (1.6.0)
|
||||||
rack (2.2.4)
|
rack (2.2.3)
|
||||||
rack-attack (6.6.1)
|
rack-attack (6.6.1)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
rack-cors (1.1.1)
|
rack-cors (1.1.1)
|
||||||
|
@ -503,22 +487,22 @@ GEM
|
||||||
rack (>= 2.1.0)
|
rack (>= 2.1.0)
|
||||||
rack-proxy (0.7.0)
|
rack-proxy (0.7.0)
|
||||||
rack
|
rack
|
||||||
rack-test (2.0.2)
|
rack-test (1.1.0)
|
||||||
rack (>= 1.3)
|
rack (>= 1.0, < 3)
|
||||||
rails (6.1.7)
|
rails (6.1.6)
|
||||||
actioncable (= 6.1.7)
|
actioncable (= 6.1.6)
|
||||||
actionmailbox (= 6.1.7)
|
actionmailbox (= 6.1.6)
|
||||||
actionmailer (= 6.1.7)
|
actionmailer (= 6.1.6)
|
||||||
actionpack (= 6.1.7)
|
actionpack (= 6.1.6)
|
||||||
actiontext (= 6.1.7)
|
actiontext (= 6.1.6)
|
||||||
actionview (= 6.1.7)
|
actionview (= 6.1.6)
|
||||||
activejob (= 6.1.7)
|
activejob (= 6.1.6)
|
||||||
activemodel (= 6.1.7)
|
activemodel (= 6.1.6)
|
||||||
activerecord (= 6.1.7)
|
activerecord (= 6.1.6)
|
||||||
activestorage (= 6.1.7)
|
activestorage (= 6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 6.1.7)
|
railties (= 6.1.6)
|
||||||
sprockets-rails (>= 2.0.0)
|
sprockets-rails (>= 2.0.0)
|
||||||
rails-controller-testing (1.0.5)
|
rails-controller-testing (1.0.5)
|
||||||
actionpack (>= 5.0.1.rc1)
|
actionpack (>= 5.0.1.rc1)
|
||||||
|
@ -527,32 +511,29 @@ GEM
|
||||||
rails-dom-testing (2.0.3)
|
rails-dom-testing (2.0.3)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
nokogiri (>= 1.6)
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.4.4)
|
rails-html-sanitizer (1.4.2)
|
||||||
loofah (~> 2.19, >= 2.19.1)
|
loofah (~> 2.3)
|
||||||
rails-i18n (6.0.0)
|
rails-i18n (6.0.0)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
railties (>= 6.0.0, < 7)
|
railties (>= 6.0.0, < 7)
|
||||||
rails-settings-cached (0.6.6)
|
rails-settings-cached (0.6.6)
|
||||||
rails (>= 4.2.0)
|
rails (>= 4.2.0)
|
||||||
railties (6.1.7)
|
railties (6.1.6)
|
||||||
actionpack (= 6.1.7)
|
actionpack (= 6.1.6)
|
||||||
activesupport (= 6.1.7)
|
activesupport (= 6.1.6)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
thor (~> 1.0)
|
thor (~> 1.0)
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
rake (13.0.6)
|
rake (13.0.6)
|
||||||
rdf (3.2.9)
|
rdf (3.2.3)
|
||||||
link_header (~> 0.0, >= 0.0.8)
|
link_header (~> 0.0, >= 0.0.8)
|
||||||
rdf-normalize (0.5.1)
|
rdf-normalize (0.5.0)
|
||||||
rdf (~> 3.2)
|
rdf (~> 3.2)
|
||||||
redcarpet (3.5.1)
|
|
||||||
redis (4.5.1)
|
redis (4.5.1)
|
||||||
redis-namespace (1.9.0)
|
redis-namespace (1.8.2)
|
||||||
redis (>= 4)
|
redis (>= 3.0.4)
|
||||||
redlock (1.3.2)
|
regexp_parser (2.4.0)
|
||||||
redis (>= 3.0.0, < 6.0)
|
|
||||||
regexp_parser (2.6.0)
|
|
||||||
request_store (1.5.1)
|
request_store (1.5.1)
|
||||||
rack (>= 1.4)
|
rack (>= 1.4)
|
||||||
responders (3.0.1)
|
responders (3.0.1)
|
||||||
|
@ -561,7 +542,7 @@ GEM
|
||||||
rexml (3.2.5)
|
rexml (3.2.5)
|
||||||
rotp (6.2.0)
|
rotp (6.2.0)
|
||||||
rpam2 (4.0.2)
|
rpam2 (4.0.2)
|
||||||
rqrcode (2.1.2)
|
rqrcode (2.1.1)
|
||||||
chunky_png (~> 1.0)
|
chunky_png (~> 1.0)
|
||||||
rqrcode_core (~> 1.0)
|
rqrcode_core (~> 1.0)
|
||||||
rqrcode_core (1.2.0)
|
rqrcode_core (1.2.0)
|
||||||
|
@ -584,64 +565,58 @@ GEM
|
||||||
rspec-sidekiq (3.1.0)
|
rspec-sidekiq (3.1.0)
|
||||||
rspec-core (~> 3.0, >= 3.0.0)
|
rspec-core (~> 3.0, >= 3.0.0)
|
||||||
sidekiq (>= 2.4.0)
|
sidekiq (>= 2.4.0)
|
||||||
rspec-support (3.11.1)
|
rspec-support (3.11.0)
|
||||||
rspec_junit_formatter (0.6.0)
|
rspec_junit_formatter (0.5.1)
|
||||||
rspec-core (>= 2, < 4, != 2.12.0)
|
rspec-core (>= 2, < 4, != 2.12.0)
|
||||||
rubocop (1.39.0)
|
rubocop (1.29.1)
|
||||||
json (~> 2.3)
|
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 3.1.2.1)
|
parser (>= 3.1.0.0)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 1.8, < 3.0)
|
regexp_parser (>= 1.8, < 3.0)
|
||||||
rexml (>= 3.2.5, < 4.0)
|
rexml (>= 3.2.5, < 4.0)
|
||||||
rubocop-ast (>= 1.23.0, < 2.0)
|
rubocop-ast (>= 1.17.0, < 2.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 1.4.0, < 3.0)
|
unicode-display_width (>= 1.4.0, < 3.0)
|
||||||
rubocop-ast (1.23.0)
|
rubocop-ast (1.18.0)
|
||||||
parser (>= 3.1.1.0)
|
parser (>= 3.1.1.0)
|
||||||
rubocop-performance (1.15.1)
|
rubocop-rails (2.14.2)
|
||||||
rubocop (>= 1.7.0, < 2.0)
|
|
||||||
rubocop-ast (>= 0.4.0)
|
|
||||||
rubocop-rails (2.17.2)
|
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
rubocop (>= 1.33.0, < 2.0)
|
rubocop (>= 1.7.0, < 2.0)
|
||||||
rubocop-rspec (2.15.0)
|
|
||||||
rubocop (~> 1.33)
|
|
||||||
ruby-progressbar (1.11.0)
|
ruby-progressbar (1.11.0)
|
||||||
ruby-saml (1.13.0)
|
ruby-saml (1.13.0)
|
||||||
nokogiri (>= 1.10.5)
|
nokogiri (>= 1.10.5)
|
||||||
rexml
|
rexml
|
||||||
ruby2_keywords (0.0.5)
|
ruby2_keywords (0.0.5)
|
||||||
rufus-scheduler (3.8.2)
|
rufus-scheduler (3.8.1)
|
||||||
fugit (~> 1.1, >= 1.1.6)
|
fugit (~> 1.1, >= 1.1.6)
|
||||||
safety_net_attestation (0.4.0)
|
safety_net_attestation (0.4.0)
|
||||||
jwt (~> 2.0)
|
jwt (~> 2.0)
|
||||||
sanitize (6.0.0)
|
sanitize (6.0.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.12.0)
|
nokogiri (>= 1.12.0)
|
||||||
scenic (1.7.0)
|
scenic (1.6.0)
|
||||||
activerecord (>= 4.0.0)
|
activerecord (>= 4.0.0)
|
||||||
railties (>= 4.0.0)
|
railties (>= 4.0.0)
|
||||||
|
securecompare (1.0.0)
|
||||||
semantic_range (3.0.0)
|
semantic_range (3.0.0)
|
||||||
sidekiq (6.5.8)
|
sidekiq (6.4.2)
|
||||||
connection_pool (>= 2.2.5, < 3)
|
connection_pool (>= 2.2.2)
|
||||||
rack (~> 2.0)
|
rack (~> 2.0)
|
||||||
redis (>= 4.5.0, < 5)
|
redis (>= 4.2.0)
|
||||||
sidekiq-bulk (0.2.0)
|
sidekiq-bulk (0.2.0)
|
||||||
sidekiq
|
sidekiq
|
||||||
sidekiq-scheduler (4.0.3)
|
sidekiq-scheduler (4.0.0)
|
||||||
redis (>= 4.2.0)
|
redis (>= 4.2.0)
|
||||||
rufus-scheduler (~> 3.2)
|
rufus-scheduler (~> 3.2)
|
||||||
sidekiq (>= 4, < 7)
|
sidekiq (>= 4)
|
||||||
tilt (>= 1.4.0)
|
tilt (>= 1.4.0)
|
||||||
sidekiq-unique-jobs (7.1.29)
|
sidekiq-unique-jobs (7.1.22)
|
||||||
brpoplpush-redis_script (> 0.1.1, <= 2.0.0)
|
brpoplpush-redis_script (> 0.1.1, <= 2.0.0)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.5)
|
concurrent-ruby (~> 1.0, >= 1.0.5)
|
||||||
redis (< 5.0)
|
sidekiq (>= 5.0, < 8.0)
|
||||||
sidekiq (>= 5.0, < 7.0)
|
|
||||||
thor (>= 0.20, < 3.0)
|
thor (>= 0.20, < 3.0)
|
||||||
simple-navigation (4.4.0)
|
simple-navigation (4.3.0)
|
||||||
activesupport (>= 2.3.2)
|
activesupport (>= 2.3.2)
|
||||||
simple_form (5.1.0)
|
simple_form (5.1.0)
|
||||||
actionpack (>= 5.2)
|
actionpack (>= 5.2)
|
||||||
|
@ -663,10 +638,9 @@ GEM
|
||||||
sshkit (1.21.2)
|
sshkit (1.21.2)
|
||||||
net-scp (>= 1.1.2)
|
net-scp (>= 1.1.2)
|
||||||
net-ssh (>= 2.8.0)
|
net-ssh (>= 2.8.0)
|
||||||
stackprof (0.2.23)
|
stackprof (0.2.19)
|
||||||
statsd-ruby (1.5.0)
|
statsd-ruby (1.5.0)
|
||||||
stoplight (3.0.1)
|
stoplight (3.0.0)
|
||||||
redlock (~> 1.0)
|
|
||||||
strong_migrations (0.7.9)
|
strong_migrations (0.7.9)
|
||||||
activerecord (>= 5)
|
activerecord (>= 5)
|
||||||
swd (1.3.0)
|
swd (1.3.0)
|
||||||
|
@ -679,12 +653,10 @@ GEM
|
||||||
terrapin (0.6.0)
|
terrapin (0.6.0)
|
||||||
climate_control (>= 0.0.3, < 1.0)
|
climate_control (>= 0.0.3, < 1.0)
|
||||||
thor (1.2.1)
|
thor (1.2.1)
|
||||||
tilt (2.0.11)
|
tilt (2.0.10)
|
||||||
timeout (0.3.0)
|
tpm-key_attestation (0.9.0)
|
||||||
tpm-key_attestation (0.11.0)
|
|
||||||
bindata (~> 2.4)
|
bindata (~> 2.4)
|
||||||
openssl (> 2.0, < 3.1)
|
openssl-signature_algorithm (~> 0.4.0)
|
||||||
openssl-signature_algorithm (~> 1.0)
|
|
||||||
tty-color (0.6.0)
|
tty-color (0.6.0)
|
||||||
tty-cursor (0.7.1)
|
tty-cursor (0.7.1)
|
||||||
tty-prompt (0.23.1)
|
tty-prompt (0.23.1)
|
||||||
|
@ -698,36 +670,37 @@ GEM
|
||||||
twitter-text (3.1.0)
|
twitter-text (3.1.0)
|
||||||
idn-ruby
|
idn-ruby
|
||||||
unf (~> 0.1.0)
|
unf (~> 0.1.0)
|
||||||
tzinfo (2.0.5)
|
tzinfo (2.0.4)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
tzinfo-data (1.2022.7)
|
tzinfo-data (1.2022.1)
|
||||||
tzinfo (>= 1.0.0)
|
tzinfo (>= 1.0.0)
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
unf_ext (0.0.8.2)
|
unf_ext (0.0.8)
|
||||||
unicode-display_width (2.3.0)
|
unicode-display_width (2.1.0)
|
||||||
uniform_notifier (1.16.0)
|
uniform_notifier (1.14.2)
|
||||||
validate_email (0.1.6)
|
validate_email (0.1.6)
|
||||||
activemodel (>= 3.0)
|
activemodel (>= 3.0)
|
||||||
mail (>= 2.2.5)
|
mail (>= 2.2.5)
|
||||||
validate_url (1.0.15)
|
validate_url (1.0.13)
|
||||||
activemodel (>= 3.0.0)
|
activemodel (>= 3.0.0)
|
||||||
public_suffix
|
public_suffix
|
||||||
warden (1.2.9)
|
warden (1.2.9)
|
||||||
rack (>= 2.0.9)
|
rack (>= 2.0.9)
|
||||||
webauthn (2.5.2)
|
webauthn (3.0.0.alpha1)
|
||||||
android_key_attestation (~> 0.3.0)
|
android_key_attestation (~> 0.3.0)
|
||||||
awrence (~> 1.1)
|
awrence (~> 1.1)
|
||||||
bindata (~> 2.4)
|
bindata (~> 2.4)
|
||||||
cbor (~> 0.5.9)
|
cbor (~> 0.5.9)
|
||||||
cose (~> 1.1)
|
cose (~> 1.0)
|
||||||
openssl (>= 2.2, < 3.1)
|
openssl (~> 2.0)
|
||||||
safety_net_attestation (~> 0.4.0)
|
safety_net_attestation (~> 0.4.0)
|
||||||
tpm-key_attestation (~> 0.11.0)
|
securecompare (~> 1.0)
|
||||||
|
tpm-key_attestation (~> 0.9.0)
|
||||||
webfinger (1.2.0)
|
webfinger (1.2.0)
|
||||||
activesupport
|
activesupport
|
||||||
httpclient (>= 2.4)
|
httpclient (>= 2.4)
|
||||||
webmock (3.18.1)
|
webmock (3.14.0)
|
||||||
addressable (>= 2.8.0)
|
addressable (>= 2.8.0)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
hashdiff (>= 0.4.0, < 2.0.0)
|
hashdiff (>= 0.4.0, < 2.0.0)
|
||||||
|
@ -736,14 +709,17 @@ GEM
|
||||||
rack-proxy (>= 0.6.1)
|
rack-proxy (>= 0.6.1)
|
||||||
railties (>= 5.2)
|
railties (>= 5.2)
|
||||||
semantic_range (>= 2.3.0)
|
semantic_range (>= 2.3.0)
|
||||||
|
webpush (0.3.8)
|
||||||
|
hkdf (~> 0.2)
|
||||||
|
jwt (~> 2.0)
|
||||||
websocket-driver (0.7.5)
|
websocket-driver (0.7.5)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.5)
|
websocket-extensions (0.1.5)
|
||||||
wisper (2.0.1)
|
wisper (2.0.1)
|
||||||
xorcist (1.1.3)
|
xorcist (1.1.2)
|
||||||
xpath (3.2.0)
|
xpath (3.2.0)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
zeitwerk (2.6.6)
|
zeitwerk (2.5.4)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
@ -753,12 +729,12 @@ DEPENDENCIES
|
||||||
active_record_query_trace (~> 1.8)
|
active_record_query_trace (~> 1.8)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
annotate (~> 3.2)
|
annotate (~> 3.2)
|
||||||
aws-sdk-s3 (~> 1.117)
|
aws-sdk-s3 (~> 1.114)
|
||||||
better_errors (~> 2.9)
|
better_errors (~> 2.9)
|
||||||
binding_of_caller (~> 1.0)
|
binding_of_caller (~> 1.0)
|
||||||
blurhash (~> 0.1)
|
blurhash (~> 0.1)
|
||||||
bootsnap (~> 1.15.0)
|
bootsnap (~> 1.11.1)
|
||||||
brakeman (~> 5.4)
|
brakeman (~> 5.2)
|
||||||
browser
|
browser
|
||||||
bullet (~> 7.0)
|
bullet (~> 7.0)
|
||||||
bundler-audit (~> 0.9)
|
bundler-audit (~> 0.9)
|
||||||
|
@ -766,11 +742,10 @@ DEPENDENCIES
|
||||||
capistrano-rails (~> 1.6)
|
capistrano-rails (~> 1.6)
|
||||||
capistrano-rbenv (~> 2.2)
|
capistrano-rbenv (~> 2.2)
|
||||||
capistrano-yarn (~> 2.0)
|
capistrano-yarn (~> 2.0)
|
||||||
capybara (~> 3.38)
|
capybara (~> 3.37)
|
||||||
charlock_holmes (~> 0.7.7)
|
charlock_holmes (~> 0.7.7)
|
||||||
chewy (~> 7.2)
|
chewy (~> 7.2)
|
||||||
climate_control (~> 0.2)
|
climate_control (~> 0.2)
|
||||||
cocoon (~> 1.2)
|
|
||||||
color_diff (~> 0.1)
|
color_diff (~> 0.1)
|
||||||
concurrent-ruby
|
concurrent-ruby
|
||||||
connection_pool
|
connection_pool
|
||||||
|
@ -778,28 +753,27 @@ DEPENDENCIES
|
||||||
devise-two-factor (~> 4.0)
|
devise-two-factor (~> 4.0)
|
||||||
devise_pam_authenticatable2 (~> 9.2)
|
devise_pam_authenticatable2 (~> 9.2)
|
||||||
discard (~> 1.2)
|
discard (~> 1.2)
|
||||||
doorkeeper (~> 5.6)
|
doorkeeper (~> 5.5)
|
||||||
dotenv-rails (~> 2.8)
|
dotenv-rails (~> 2.7)
|
||||||
ed25519 (~> 1.3)
|
ed25519 (~> 1.3)
|
||||||
fabrication (~> 2.30)
|
fabrication (~> 2.28)
|
||||||
faker (~> 3.0)
|
faker (~> 2.21)
|
||||||
fast_blank (~> 1.0)
|
fast_blank (~> 1.0)
|
||||||
fastimage
|
fastimage
|
||||||
fog-core (<= 2.4.0)
|
fog-core (<= 2.1.0)
|
||||||
fog-openstack (~> 0.3)
|
fog-openstack (~> 0.3)
|
||||||
fuubar (~> 2.5)
|
fuubar (~> 2.5)
|
||||||
gitlab-omniauth-openid-connect (~> 0.10.0)
|
gitlab-omniauth-openid-connect (~> 0.9.1)
|
||||||
hamlit-rails (~> 0.2)
|
hamlit-rails (~> 0.2)
|
||||||
hiredis (~> 0.6)
|
hiredis (~> 0.6)
|
||||||
htmlentities (~> 4.3)
|
htmlentities (~> 4.3)
|
||||||
http (~> 5.1)
|
http (~> 5.0)
|
||||||
http_accept_language (~> 2.1)
|
http_accept_language (~> 2.1)
|
||||||
httplog (~> 1.6.2)
|
httplog (~> 1.5.0)
|
||||||
i18n-tasks (~> 1.0)
|
i18n-tasks (~> 1.0)
|
||||||
idn-ruby
|
idn-ruby
|
||||||
json-ld
|
json-ld
|
||||||
json-ld-preloaded (~> 3.2)
|
json-ld-preloaded (~> 3.2)
|
||||||
json-schema (~> 3.0)
|
|
||||||
kaminari (~> 1.2)
|
kaminari (~> 1.2)
|
||||||
kt-paperclip (~> 7.1)
|
kt-paperclip (~> 7.1)
|
||||||
letter_opener (~> 1.8)
|
letter_opener (~> 1.8)
|
||||||
|
@ -809,7 +783,7 @@ DEPENDENCIES
|
||||||
makara (~> 0.5)
|
makara (~> 0.5)
|
||||||
mario-redis-lock (~> 1.2)
|
mario-redis-lock (~> 1.2)
|
||||||
memory_profiler
|
memory_profiler
|
||||||
microformats (~> 4.4)
|
microformats (~> 4.2)
|
||||||
mime-types (~> 3.4.1)
|
mime-types (~> 3.4.1)
|
||||||
net-ldap (~> 0.17)
|
net-ldap (~> 0.17)
|
||||||
nokogiri (~> 1.13)
|
nokogiri (~> 1.13)
|
||||||
|
@ -821,65 +795,54 @@ DEPENDENCIES
|
||||||
omniauth-saml (~> 1.10)
|
omniauth-saml (~> 1.10)
|
||||||
ox (~> 2.14)
|
ox (~> 2.14)
|
||||||
parslet
|
parslet
|
||||||
pg (~> 1.4)
|
pg (~> 1.3)
|
||||||
pghero (~> 2.8)
|
pghero (~> 2.8)
|
||||||
pkg-config (~> 1.5)
|
pkg-config (~> 1.4)
|
||||||
posix-spawn
|
posix-spawn
|
||||||
premailer-rails
|
premailer-rails
|
||||||
private_address_check (~> 0.5)
|
private_address_check (~> 0.5)
|
||||||
pry-byebug (~> 3.10)
|
pry-byebug (~> 3.9)
|
||||||
pry-rails (~> 0.3)
|
pry-rails (~> 0.3)
|
||||||
public_suffix (~> 5.0)
|
|
||||||
puma (~> 5.6)
|
puma (~> 5.6)
|
||||||
pundit (~> 2.3)
|
pundit (~> 2.2)
|
||||||
rack (~> 2.2.4)
|
rack (~> 2.2.3)
|
||||||
rack-attack (~> 6.6)
|
rack-attack (~> 6.6)
|
||||||
rack-cors (~> 1.1)
|
rack-cors (~> 1.1)
|
||||||
rack-test (~> 2.0)
|
rails (~> 6.1.6)
|
||||||
rails (~> 6.1.7)
|
|
||||||
rails-controller-testing (~> 1.0)
|
rails-controller-testing (~> 1.0)
|
||||||
rails-i18n (~> 6.0)
|
rails-i18n (~> 6.0)
|
||||||
rails-settings-cached (~> 0.6)
|
rails-settings-cached (~> 0.6)
|
||||||
rdf-normalize (~> 0.5)
|
rdf-normalize (~> 0.5)
|
||||||
redcarpet (~> 3.5)
|
|
||||||
redis (~> 4.5)
|
redis (~> 4.5)
|
||||||
redis-namespace (~> 1.9)
|
redis-namespace (~> 1.8)
|
||||||
rexml (~> 3.2)
|
rexml (~> 3.2)
|
||||||
rqrcode (~> 2.1)
|
rqrcode (~> 2.1)
|
||||||
rspec-rails (~> 5.1)
|
rspec-rails (~> 5.1)
|
||||||
rspec-sidekiq (~> 3.1)
|
rspec-sidekiq (~> 3.1)
|
||||||
rspec_junit_formatter (~> 0.6)
|
rspec_junit_formatter (~> 0.5)
|
||||||
rubocop
|
rubocop (~> 1.29)
|
||||||
rubocop-performance
|
rubocop-rails (~> 2.14)
|
||||||
rubocop-rails
|
|
||||||
rubocop-rspec
|
|
||||||
ruby-progressbar (~> 1.11)
|
ruby-progressbar (~> 1.11)
|
||||||
sanitize (~> 6.0)
|
sanitize (~> 6.0)
|
||||||
scenic (~> 1.7)
|
scenic (~> 1.6)
|
||||||
sidekiq (~> 6.5)
|
sidekiq (~> 6.4)
|
||||||
sidekiq-bulk (~> 0.2.0)
|
sidekiq-bulk (~> 0.2.0)
|
||||||
sidekiq-scheduler (~> 4.0)
|
sidekiq-scheduler (~> 4.0)
|
||||||
sidekiq-unique-jobs (~> 7.1)
|
sidekiq-unique-jobs (~> 7.1)
|
||||||
simple-navigation (~> 4.4)
|
simple-navigation (~> 4.3)
|
||||||
simple_form (~> 5.1)
|
simple_form (~> 5.1)
|
||||||
simplecov (~> 0.21)
|
simplecov (~> 0.21)
|
||||||
sprockets (~> 3.7.2)
|
sprockets (~> 3.7.2)
|
||||||
sprockets-rails (~> 3.4)
|
sprockets-rails (~> 3.4)
|
||||||
stackprof
|
stackprof
|
||||||
stoplight (~> 3.0.1)
|
stoplight (~> 3.0.0)
|
||||||
strong_migrations (~> 0.7)
|
strong_migrations (~> 0.7)
|
||||||
thor (~> 1.2)
|
thor (~> 1.2)
|
||||||
tty-prompt (~> 0.23)
|
tty-prompt (~> 0.23)
|
||||||
twitter-text (~> 3.1.0)
|
twitter-text (~> 3.1.0)
|
||||||
tzinfo-data (~> 1.2022)
|
tzinfo-data (~> 1.2022)
|
||||||
webauthn (~> 2.5)
|
webauthn (~> 3.0.0.alpha1)
|
||||||
webmock (~> 3.18)
|
webmock (~> 3.14)
|
||||||
webpacker (~> 5.4)
|
webpacker (~> 5.4)
|
||||||
webpush!
|
webpush (~> 0.3)
|
||||||
xorcist (~> 1.1)
|
xorcist (~> 1.1)
|
||||||
|
|
||||||
RUBY VERSION
|
|
||||||
ruby 3.0.4p208
|
|
||||||
|
|
||||||
BUNDLED WITH
|
|
||||||
2.2.33
|
|
||||||
|
|
13
README.md
13
README.md
|
@ -1,8 +1,5 @@
|
||||||
<h1><picture>
|
![Mastodon](https://i.imgur.com/NhZc40l.png)
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="./lib/assets/wordmark.dark.png?raw=true">
|
========
|
||||||
<source media="(prefers-color-scheme: light)" srcset="./lib/assets/wordmark.light.png?raw=true">
|
|
||||||
<img alt="Mastodon" src="./lib/assets/wordmark.light.png?raw=true" height="34">
|
|
||||||
</picture></h1>
|
|
||||||
|
|
||||||
[![GitHub release](https://img.shields.io/github/release/mastodon/mastodon.svg)][releases]
|
[![GitHub release](https://img.shields.io/github/release/mastodon/mastodon.svg)][releases]
|
||||||
[![Build Status](https://img.shields.io/circleci/project/github/mastodon/mastodon.svg)][circleci]
|
[![Build Status](https://img.shields.io/circleci/project/github/mastodon/mastodon.svg)][circleci]
|
||||||
|
@ -38,7 +35,7 @@ Click below to **learn more** in a video:
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
<img src="/app/javascript/images/elephant_ui_working.svg?raw=true" align="right" width="30%" />
|
<img src="https://docs.joinmastodon.org/elephant.svg" align="right" width="30%" />
|
||||||
|
|
||||||
### No vendor lock-in: Fully interoperable with any conforming platform
|
### No vendor lock-in: Fully interoperable with any conforming platform
|
||||||
|
|
||||||
|
@ -72,8 +69,8 @@ Mastodon acts as an OAuth2 provider, so 3rd party apps can use the REST and Stre
|
||||||
|
|
||||||
- **PostgreSQL** 9.5+
|
- **PostgreSQL** 9.5+
|
||||||
- **Redis** 4+
|
- **Redis** 4+
|
||||||
- **Ruby** 2.7+
|
- **Ruby** 2.5+
|
||||||
- **Node.js** 16+
|
- **Node.js** 12+
|
||||||
|
|
||||||
The repository includes deployment configurations for **Docker and docker-compose** as well as specific platforms like **Heroku**, **Scalingo**, and **Nanobox**. The [**standalone** installation guide](https://docs.joinmastodon.org/admin/install/) is available in the documentation.
|
The repository includes deployment configurations for **Docker and docker-compose** as well as specific platforms like **Heroku**, **Scalingo**, and **Nanobox**. The [**standalone** installation guide](https://docs.joinmastodon.org/admin/install/) is available in the documentation.
|
||||||
|
|
||||||
|
|
15
SECURITY.md
15
SECURITY.md
|
@ -1,6 +1,6 @@
|
||||||
# Security Policy
|
# 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 reach us at <security@joinmastodon.org>.
|
If you believe you've identified a security vulnerability in Mastodon (a bug that allows something to happen that shouldn't be possible), you should submit the report through our [Bug Bounty Program][bug-bounty]. Alternatively, you can reach us at <hello@joinmastodon.org>.
|
||||||
|
|
||||||
You should *not* report such issues on GitHub or in other public spaces to give us time to publish a fix for the issue without exposing Mastodon's users to increased risk.
|
You should *not* report such issues on GitHub or in other public spaces to give us time to publish a fix for the issue without exposing Mastodon's users to increased risk.
|
||||||
|
|
||||||
|
@ -10,8 +10,11 @@ A "vulnerability in Mastodon" is a vulnerability in the code distributed through
|
||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
|
|
||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| ------- | ----------|
|
| ------- | ------------------ |
|
||||||
| 4.0.x | Yes |
|
| 3.5.x | Yes |
|
||||||
| 3.5.x | Yes |
|
| 3.4.x | Yes |
|
||||||
| < 3.5 | No |
|
| 3.3.x | No |
|
||||||
|
| < 3.3 | No |
|
||||||
|
|
||||||
|
[bug-bounty]: https://app.intigriti.com/programs/mastodon/mastodonio/detail
|
||||||
|
|
71
Vagrantfile
vendored
71
Vagrantfile
vendored
|
@ -3,14 +3,16 @@
|
||||||
|
|
||||||
ENV["PORT"] ||= "3000"
|
ENV["PORT"] ||= "3000"
|
||||||
|
|
||||||
$provisionA = <<SCRIPT
|
$provision = <<SCRIPT
|
||||||
|
|
||||||
|
cd /vagrant # This is where the host folder/repo is mounted
|
||||||
|
|
||||||
# Add the yarn repo + yarn repo keys
|
# Add the yarn repo + yarn repo keys
|
||||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
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'
|
sudo apt-add-repository 'deb https://dl.yarnpkg.com/debian/ stable main'
|
||||||
|
|
||||||
# Add repo for NodeJS
|
# Add repo for NodeJS
|
||||||
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
|
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
|
||||||
|
|
||||||
# Add firewall rule to redirect 80 to PORT and save
|
# 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"]}
|
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port #{ENV["PORT"]}
|
||||||
|
@ -31,56 +33,32 @@ sudo apt-get install \
|
||||||
redis-tools \
|
redis-tools \
|
||||||
postgresql \
|
postgresql \
|
||||||
postgresql-contrib \
|
postgresql-contrib \
|
||||||
|
yarn \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
libidn11-dev \
|
libidn11-dev \
|
||||||
libreadline6-dev \
|
libreadline-dev \
|
||||||
autoconf \
|
libpam0g-dev \
|
||||||
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
|
-y
|
||||||
|
|
||||||
# Install rvm
|
# Install rvm
|
||||||
sudo apt-add-repository -y ppa:rael-gc/rvm
|
read RUBY_VERSION < .ruby-version
|
||||||
sudo apt-get install rvm -y
|
|
||||||
|
|
||||||
sudo usermod -a -G rvm $USER
|
curl -sSL https://rvm.io/mpapis.asc | gpg --import
|
||||||
|
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import
|
||||||
|
|
||||||
SCRIPT
|
curl -sSL https://raw.githubusercontent.com/rvm/rvm/stable/binscripts/rvm-installer | bash -s stable --ruby=$RUBY_VERSION
|
||||||
|
source /home/vagrant/.rvm/scripts/rvm
|
||||||
$provisionB = <<SCRIPT
|
|
||||||
|
|
||||||
source "/etc/profile.d/rvm.sh"
|
|
||||||
|
|
||||||
# Install Ruby
|
# Install Ruby
|
||||||
read RUBY_VERSION < /vagrant/.ruby-version
|
rvm reinstall ruby-$RUBY_VERSION --disable-binary
|
||||||
rvm install ruby-$RUBY_VERSION --disable-binary
|
|
||||||
|
|
||||||
# Configure database
|
# Configure database
|
||||||
sudo -u postgres createuser -U postgres vagrant -s
|
sudo -u postgres createuser -U postgres vagrant -s
|
||||||
sudo -u postgres createdb -U postgres mastodon_development
|
sudo -u postgres createdb -U postgres mastodon_development
|
||||||
|
|
||||||
cd /vagrant # This is where the host folder/repo is mounted
|
# Install gems and node modules
|
||||||
|
|
||||||
# Install gems
|
|
||||||
gem install bundler foreman
|
gem install bundler foreman
|
||||||
bundle install
|
bundle install
|
||||||
|
|
||||||
# Install node modules
|
|
||||||
sudo corepack enable
|
|
||||||
yarn set version classic
|
|
||||||
yarn install
|
yarn install
|
||||||
|
|
||||||
# Build Mastodon
|
# Build Mastodon
|
||||||
|
@ -94,11 +72,18 @@ echo 'export $(cat "/vagrant/.env.vagrant" | xargs)' >> ~/.bash_profile
|
||||||
|
|
||||||
SCRIPT
|
SCRIPT
|
||||||
|
|
||||||
|
$start = <<SCRIPT
|
||||||
|
|
||||||
|
echo 'To start server'
|
||||||
|
echo ' $ vagrant ssh -c "cd /vagrant && foreman start"'
|
||||||
|
|
||||||
|
SCRIPT
|
||||||
|
|
||||||
VAGRANTFILE_API_VERSION = "2"
|
VAGRANTFILE_API_VERSION = "2"
|
||||||
|
|
||||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
|
|
||||||
config.vm.box = "ubuntu/focal64"
|
config.vm.box = "ubuntu/bionic64"
|
||||||
|
|
||||||
config.vm.provider :virtualbox do |vb|
|
config.vm.provider :virtualbox do |vb|
|
||||||
vb.name = "mastodon"
|
vb.name = "mastodon"
|
||||||
|
@ -115,6 +100,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
# Use "virtio" network interfaces for better performance.
|
# Use "virtio" network interfaces for better performance.
|
||||||
vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
|
vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
|
||||||
vb.customize ["modifyvm", :id, "--nictype2", "virtio"]
|
vb.customize ["modifyvm", :id, "--nictype2", "virtio"]
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# This uses the vagrant-hostsupdater plugin, and lets you
|
# This uses the vagrant-hostsupdater plugin, and lets you
|
||||||
|
@ -132,7 +118,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
end
|
end
|
||||||
|
|
||||||
if config.vm.networks.any? { |type, options| type == :private_network }
|
if config.vm.networks.any? { |type, options| type == :private_network }
|
||||||
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['rw', 'actimeo=1']
|
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['rw', 'vers=3', 'tcp', 'actimeo=1']
|
||||||
else
|
else
|
||||||
config.vm.synced_folder ".", "/vagrant"
|
config.vm.synced_folder ".", "/vagrant"
|
||||||
end
|
end
|
||||||
|
@ -143,12 +129,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
config.vm.network :forwarded_port, guest: 8080, host: 8080
|
config.vm.network :forwarded_port, guest: 8080, host: 8080
|
||||||
|
|
||||||
# Full provisioning script, only runs on first 'vagrant up' or with 'vagrant provision'
|
# Full provisioning script, only runs on first 'vagrant up' or with 'vagrant provision'
|
||||||
config.vm.provision :shell, inline: $provisionA, privileged: false, reset: true
|
config.vm.provision :shell, inline: $provision, privileged: false
|
||||||
config.vm.provision :shell, inline: $provisionB, privileged: false
|
|
||||||
|
|
||||||
config.vm.post_up_message = <<MESSAGE
|
# Start up script, runs on every 'vagrant up'
|
||||||
To start server
|
config.vm.provision :shell, inline: $start, run: 'always', privileged: false
|
||||||
$ vagrant ssh -c "cd /vagrant && foreman start"
|
|
||||||
MESSAGE
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
7
app.json
7
app.json
|
@ -79,13 +79,8 @@
|
||||||
"description": "SMTP server certificate verification mode. Defaults is 'peer'.",
|
"description": "SMTP server certificate verification mode. Defaults is 'peer'.",
|
||||||
"required": false
|
"required": false
|
||||||
},
|
},
|
||||||
"SMTP_ENABLE_STARTTLS": {
|
|
||||||
"description": "Enable STARTTLS? Default is 'auto'.",
|
|
||||||
"value": "auto",
|
|
||||||
"required": false
|
|
||||||
},
|
|
||||||
"SMTP_ENABLE_STARTTLS_AUTO": {
|
"SMTP_ENABLE_STARTTLS_AUTO": {
|
||||||
"description": "Enable STARTTLS if SMTP server supports it? Deprecated by SMTP_ENABLE_STARTTLS.",
|
"description": "Enable STARTTLS if SMTP server supports it? Default is true.",
|
||||||
"required": false
|
"required": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,19 +1,68 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class AboutController < ApplicationController
|
class AboutController < ApplicationController
|
||||||
include WebAppControllerConcern
|
include RegistrationSpamConcern
|
||||||
|
|
||||||
skip_before_action :require_functional!
|
layout 'public'
|
||||||
|
|
||||||
|
before_action :require_open_federation!, only: [:show, :more]
|
||||||
|
before_action :set_body_classes, only: :show
|
||||||
before_action :set_instance_presenter
|
before_action :set_instance_presenter
|
||||||
|
before_action :set_expires_in, only: [:more, :terms]
|
||||||
|
before_action :set_registration_form_time, only: :show
|
||||||
|
|
||||||
def show
|
skip_before_action :require_functional!, only: [:more, :terms]
|
||||||
expires_in 0, public: true unless user_signed_in?
|
|
||||||
|
def show; end
|
||||||
|
|
||||||
|
def more
|
||||||
|
flash.now[:notice] = I18n.t('about.instance_actor_flash') if params[:instance_actor]
|
||||||
|
|
||||||
|
toc_generator = TOCGenerator.new(@instance_presenter.site_extended_description)
|
||||||
|
|
||||||
|
@rules = Rule.ordered
|
||||||
|
@contents = toc_generator.html
|
||||||
|
@table_of_contents = toc_generator.toc
|
||||||
|
@blocks = DomainBlock.with_user_facing_limitations.by_severity if display_blocks?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def terms; end
|
||||||
|
|
||||||
|
helper_method :display_blocks?
|
||||||
|
helper_method :display_blocks_rationale?
|
||||||
|
helper_method :public_fetch_mode?
|
||||||
|
helper_method :new_user
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def require_open_federation!
|
||||||
|
not_found if whitelist_mode?
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_blocks?
|
||||||
|
Setting.show_domain_blocks == 'all' || (Setting.show_domain_blocks == 'users' && user_signed_in?)
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_blocks_rationale?
|
||||||
|
Setting.show_domain_blocks_rationale == 'all' || (Setting.show_domain_blocks_rationale == 'users' && user_signed_in?)
|
||||||
|
end
|
||||||
|
|
||||||
|
def new_user
|
||||||
|
User.new.tap do |user|
|
||||||
|
user.build_account
|
||||||
|
user.build_invite_request
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def set_instance_presenter
|
def set_instance_presenter
|
||||||
@instance_presenter = InstancePresenter.new
|
@instance_presenter = InstancePresenter.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_body_classes
|
||||||
|
@hide_navbar = true
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_expires_in
|
||||||
|
expires_in 0, public: true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
12
app/controllers/account_follow_controller.rb
Normal file
12
app/controllers/account_follow_controller.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class AccountFollowController < ApplicationController
|
||||||
|
include AccountControllerConcern
|
||||||
|
|
||||||
|
before_action :authenticate_user!
|
||||||
|
|
||||||
|
def create
|
||||||
|
FollowService.new.call(current_user.account, @account, with_rate_limit: true)
|
||||||
|
redirect_to account_path(@account)
|
||||||
|
end
|
||||||
|
end
|
12
app/controllers/account_unfollow_controller.rb
Normal file
12
app/controllers/account_unfollow_controller.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class AccountUnfollowController < ApplicationController
|
||||||
|
include AccountControllerConcern
|
||||||
|
|
||||||
|
before_action :authenticate_user!
|
||||||
|
|
||||||
|
def create
|
||||||
|
UnfollowService.new.call(current_user.account, @account)
|
||||||
|
redirect_to account_path(@account)
|
||||||
|
end
|
||||||
|
end
|
|
@ -7,8 +7,9 @@ class AccountsController < ApplicationController
|
||||||
include AccountControllerConcern
|
include AccountControllerConcern
|
||||||
include SignatureAuthentication
|
include SignatureAuthentication
|
||||||
|
|
||||||
before_action :require_account_signature!, if: -> { request.format == :json && authorized_fetch_mode? }
|
before_action :require_signature!, if: -> { request.format == :json && authorized_fetch_mode? }
|
||||||
before_action :set_cache_headers
|
before_action :set_cache_headers
|
||||||
|
before_action :set_body_classes
|
||||||
|
|
||||||
skip_around_action :set_locale, if: -> { [:json, :rss].include?(request.format&.to_sym) }
|
skip_around_action :set_locale, if: -> { [:json, :rss].include?(request.format&.to_sym) }
|
||||||
skip_before_action :require_functional!, unless: :whitelist_mode?
|
skip_before_action :require_functional!, unless: :whitelist_mode?
|
||||||
|
@ -18,7 +19,23 @@ class AccountsController < ApplicationController
|
||||||
format.html do
|
format.html do
|
||||||
expires_in 0, public: true unless user_signed_in?
|
expires_in 0, public: true unless user_signed_in?
|
||||||
|
|
||||||
@rss_url = rss_url
|
@pinned_statuses = []
|
||||||
|
@endorsed_accounts = @account.endorsed_accounts.to_a.sample(4)
|
||||||
|
@featured_hashtags = @account.featured_tags.order(statuses_count: :desc)
|
||||||
|
|
||||||
|
if current_account && @account.blocking?(current_account)
|
||||||
|
@statuses = []
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
@pinned_statuses = cached_filtered_status_pins if show_pinned_statuses?
|
||||||
|
@statuses = cached_filtered_status_page
|
||||||
|
@rss_url = rss_url
|
||||||
|
|
||||||
|
unless @statuses.empty?
|
||||||
|
@older_url = older_url if @statuses.last.id > filtered_statuses.last.id
|
||||||
|
@newer_url = newer_url if @statuses.first.id < filtered_statuses.first.id
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
format.rss do
|
format.rss do
|
||||||
|
@ -38,6 +55,18 @@ class AccountsController < ApplicationController
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def set_body_classes
|
||||||
|
@body_classes = 'with-modals'
|
||||||
|
end
|
||||||
|
|
||||||
|
def show_pinned_statuses?
|
||||||
|
[replies_requested?, media_requested?, tag_requested?, params[:max_id].present?, params[:min_id].present?].none?
|
||||||
|
end
|
||||||
|
|
||||||
|
def filtered_pinned_statuses
|
||||||
|
@account.pinned_statuses.where(visibility: [:public, :unlisted])
|
||||||
|
end
|
||||||
|
|
||||||
def filtered_statuses
|
def filtered_statuses
|
||||||
default_statuses.tap do |statuses|
|
default_statuses.tap do |statuses|
|
||||||
statuses.merge!(hashtag_scope) if tag_requested?
|
statuses.merge!(hashtag_scope) if tag_requested?
|
||||||
|
@ -84,6 +113,26 @@ class AccountsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def older_url
|
||||||
|
pagination_url(max_id: @statuses.last.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
def newer_url
|
||||||
|
pagination_url(min_id: @statuses.first.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
def pagination_url(max_id: nil, min_id: nil)
|
||||||
|
if tag_requested?
|
||||||
|
short_account_tag_url(@account, params[:tag], max_id: max_id, min_id: min_id)
|
||||||
|
elsif media_requested?
|
||||||
|
short_account_media_url(@account, max_id: max_id, min_id: min_id)
|
||||||
|
elsif replies_requested?
|
||||||
|
short_account_with_replies_url(@account, max_id: max_id, min_id: min_id)
|
||||||
|
else
|
||||||
|
short_account_url(@account, max_id: max_id, min_id: min_id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def media_requested?
|
def media_requested?
|
||||||
request.path.split('.').first.end_with?('/media') && !tag_requested?
|
request.path.split('.').first.end_with?('/media') && !tag_requested?
|
||||||
end
|
end
|
||||||
|
@ -96,6 +145,13 @@ class AccountsController < ApplicationController
|
||||||
request.path.split('.').first.end_with?(Addressable::URI.parse("/tagged/#{params[:tag]}").normalize)
|
request.path.split('.').first.end_with?(Addressable::URI.parse("/tagged/#{params[:tag]}").normalize)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cached_filtered_status_pins
|
||||||
|
cache_collection(
|
||||||
|
filtered_pinned_statuses,
|
||||||
|
Status
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def cached_filtered_status_page
|
def cached_filtered_status_page
|
||||||
cache_collection_paginated_by_id(
|
cache_collection_paginated_by_id(
|
||||||
filtered_statuses,
|
filtered_statuses,
|
||||||
|
|
|
@ -6,7 +6,7 @@ class ActivityPub::ClaimsController < ActivityPub::BaseController
|
||||||
|
|
||||||
skip_before_action :authenticate_user!
|
skip_before_action :authenticate_user!
|
||||||
|
|
||||||
before_action :require_account_signature!
|
before_action :require_signature!
|
||||||
before_action :set_claim_result
|
before_action :set_claim_result
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
@ -4,7 +4,7 @@ class ActivityPub::CollectionsController < ActivityPub::BaseController
|
||||||
include SignatureVerification
|
include SignatureVerification
|
||||||
include AccountOwnedConcern
|
include AccountOwnedConcern
|
||||||
|
|
||||||
before_action :require_account_signature!, if: :authorized_fetch_mode?
|
before_action :require_signature!, if: :authorized_fetch_mode?
|
||||||
before_action :set_items
|
before_action :set_items
|
||||||
before_action :set_size
|
before_action :set_size
|
||||||
before_action :set_type
|
before_action :set_type
|
||||||
|
|
|
@ -4,7 +4,7 @@ class ActivityPub::FollowersSynchronizationsController < ActivityPub::BaseContro
|
||||||
include SignatureVerification
|
include SignatureVerification
|
||||||
include AccountOwnedConcern
|
include AccountOwnedConcern
|
||||||
|
|
||||||
before_action :require_account_signature!
|
before_action :require_signature!
|
||||||
before_action :set_items
|
before_action :set_items
|
||||||
before_action :set_cache_headers
|
before_action :set_cache_headers
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ class ActivityPub::InboxesController < ActivityPub::BaseController
|
||||||
include AccountOwnedConcern
|
include AccountOwnedConcern
|
||||||
|
|
||||||
before_action :skip_unknown_actor_activity
|
before_action :skip_unknown_actor_activity
|
||||||
before_action :require_actor_signature!
|
before_action :require_signature!
|
||||||
skip_before_action :authenticate_user!
|
skip_before_action :authenticate_user!
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
@ -49,17 +49,17 @@ class ActivityPub::InboxesController < ActivityPub::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def upgrade_account
|
def upgrade_account
|
||||||
if signed_request_account&.ostatus?
|
if signed_request_account.ostatus?
|
||||||
signed_request_account.update(last_webfingered_at: nil)
|
signed_request_account.update(last_webfingered_at: nil)
|
||||||
ResolveAccountWorker.perform_async(signed_request_account.acct)
|
ResolveAccountWorker.perform_async(signed_request_account.acct)
|
||||||
end
|
end
|
||||||
|
|
||||||
DeliveryFailureTracker.reset!(signed_request_actor.inbox_url)
|
DeliveryFailureTracker.reset!(signed_request_account.inbox_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_collection_synchronization
|
def process_collection_synchronization
|
||||||
raw_params = request.headers['Collection-Synchronization']
|
raw_params = request.headers['Collection-Synchronization']
|
||||||
return if raw_params.blank? || ENV['DISABLE_FOLLOWERS_SYNCHRONIZATION'] == 'true' || signed_request_account.nil?
|
return if raw_params.blank? || ENV['DISABLE_FOLLOWERS_SYNCHRONIZATION'] == 'true'
|
||||||
|
|
||||||
# Re-using the syntax for signature parameters
|
# Re-using the syntax for signature parameters
|
||||||
tree = SignatureParamsParser.new.parse(raw_params)
|
tree = SignatureParamsParser.new.parse(raw_params)
|
||||||
|
@ -71,6 +71,6 @@ class ActivityPub::InboxesController < ActivityPub::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_payload
|
def process_payload
|
||||||
ActivityPub::ProcessingWorker.perform_async(signed_request_actor.id, body, @account&.id, signed_request_actor.class.name)
|
ActivityPub::ProcessingWorker.perform_async(signed_request_account.id, body, @account&.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ class ActivityPub::OutboxesController < ActivityPub::BaseController
|
||||||
include SignatureVerification
|
include SignatureVerification
|
||||||
include AccountOwnedConcern
|
include AccountOwnedConcern
|
||||||
|
|
||||||
before_action :require_account_signature!, if: :authorized_fetch_mode?
|
before_action :require_signature!, if: :authorized_fetch_mode?
|
||||||
before_action :set_statuses
|
before_action :set_statuses
|
||||||
before_action :set_cache_headers
|
before_action :set_cache_headers
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ class ActivityPub::RepliesController < ActivityPub::BaseController
|
||||||
|
|
||||||
DESCENDANTS_LIMIT = 60
|
DESCENDANTS_LIMIT = 60
|
||||||
|
|
||||||
before_action :require_account_signature!, if: :authorized_fetch_mode?
|
before_action :require_signature!, if: :authorized_fetch_mode?
|
||||||
before_action :set_status
|
before_action :set_status
|
||||||
before_action :set_cache_headers
|
before_action :set_cache_headers
|
||||||
before_action :set_replies
|
before_action :set_replies
|
||||||
|
|
|
@ -5,15 +5,11 @@ module Admin
|
||||||
before_action :set_account
|
before_action :set_account
|
||||||
|
|
||||||
def new
|
def new
|
||||||
authorize @account, :show?
|
|
||||||
|
|
||||||
@account_action = Admin::AccountAction.new(type: params[:type], report_id: params[:report_id], send_email_notification: true, include_statuses: true)
|
@account_action = Admin::AccountAction.new(type: params[:type], report_id: params[:report_id], send_email_notification: true, include_statuses: true)
|
||||||
@warning_presets = AccountWarningPreset.all
|
@warning_presets = AccountWarningPreset.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
authorize @account, :show?
|
|
||||||
|
|
||||||
account_action = Admin::AccountAction.new(resource_params)
|
account_action = Admin::AccountAction.new(resource_params)
|
||||||
account_action.target_account = @account
|
account_action.target_account = @account
|
||||||
account_action.current_account = current_account
|
account_action.current_account = current_account
|
||||||
|
|
|
@ -14,13 +14,7 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def batch
|
def batch
|
||||||
authorize :account, :index?
|
@form = Form::AccountBatch.new(form_account_batch_params.merge(current_account: current_account, action: action_from_button))
|
||||||
|
|
||||||
@form = Form::AccountBatch.new(form_account_batch_params)
|
|
||||||
@form.current_account = current_account
|
|
||||||
@form.action = action_from_button
|
|
||||||
@form.select_all_matching = params[:select_all_matching]
|
|
||||||
@form.query = filtered_accounts
|
|
||||||
@form.save
|
@form.save
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
flash[:alert] = I18n.t('admin.accounts.no_account_selected')
|
flash[:alert] = I18n.t('admin.accounts.no_account_selected')
|
||||||
|
@ -55,14 +49,12 @@ module Admin
|
||||||
def approve
|
def approve
|
||||||
authorize @account.user, :approve?
|
authorize @account.user, :approve?
|
||||||
@account.user.approve!
|
@account.user.approve!
|
||||||
log_action :approve, @account.user
|
|
||||||
redirect_to admin_accounts_path(status: 'pending'), notice: I18n.t('admin.accounts.approved_msg', username: @account.acct)
|
redirect_to admin_accounts_path(status: 'pending'), notice: I18n.t('admin.accounts.approved_msg', username: @account.acct)
|
||||||
end
|
end
|
||||||
|
|
||||||
def reject
|
def reject
|
||||||
authorize @account.user, :reject?
|
authorize @account.user, :reject?
|
||||||
DeleteAccountService.new.call(@account, reserve_email: false, reserve_username: false)
|
DeleteAccountService.new.call(@account, reserve_email: false, reserve_username: false)
|
||||||
log_action :reject, @account.user
|
|
||||||
redirect_to admin_accounts_path(status: 'pending'), notice: I18n.t('admin.accounts.rejected_msg', username: @account.acct)
|
redirect_to admin_accounts_path(status: 'pending'), notice: I18n.t('admin.accounts.rejected_msg', username: @account.acct)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,7 @@ module Admin
|
||||||
class ActionLogsController < BaseController
|
class ActionLogsController < BaseController
|
||||||
before_action :set_action_logs
|
before_action :set_action_logs
|
||||||
|
|
||||||
def index
|
def index; end
|
||||||
authorize :audit_log, :index?
|
|
||||||
@auditable_accounts = Account.where(id: Admin::ActionLog.reorder(nil).select('distinct account_id')).select(:id, :username)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ module Admin
|
||||||
|
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
|
||||||
|
before_action :require_staff!
|
||||||
before_action :set_body_classes
|
before_action :set_body_classes
|
||||||
after_action :verify_authorized
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ module Admin
|
||||||
|
|
||||||
@user.resend_confirmation_instructions
|
@user.resend_confirmation_instructions
|
||||||
|
|
||||||
log_action :resend, @user
|
log_action :confirm, @user
|
||||||
|
|
||||||
flash[:notice] = I18n.t('admin.accounts.resend_confirmation.success')
|
flash[:notice] = I18n.t('admin.accounts.resend_confirmation.success')
|
||||||
redirect_to admin_accounts_path
|
redirect_to admin_accounts_path
|
||||||
|
|
|
@ -29,12 +29,10 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def batch
|
def batch
|
||||||
authorize :custom_emoji, :index?
|
|
||||||
|
|
||||||
@form = Form::CustomEmojiBatch.new(form_custom_emoji_batch_params.merge(current_account: current_account, action: action_from_button))
|
@form = Form::CustomEmojiBatch.new(form_custom_emoji_batch_params.merge(current_account: current_account, action: action_from_button))
|
||||||
@form.save
|
@form.save
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
flash[:alert] = I18n.t('admin.custom_emojis.no_emoji_selected')
|
flash[:alert] = I18n.t('admin.accounts.no_account_selected')
|
||||||
rescue Mastodon::NotPermittedError
|
rescue Mastodon::NotPermittedError
|
||||||
flash[:alert] = I18n.t('admin.custom_emojis.not_permitted')
|
flash[:alert] = I18n.t('admin.custom_emojis.not_permitted')
|
||||||
ensure
|
ensure
|
||||||
|
|
|
@ -5,9 +5,7 @@ module Admin
|
||||||
include Redisable
|
include Redisable
|
||||||
|
|
||||||
def index
|
def index
|
||||||
authorize :dashboard, :index?
|
@system_checks = Admin::SystemCheck.perform
|
||||||
|
|
||||||
@system_checks = Admin::SystemCheck.perform(current_user)
|
|
||||||
@time_period = (29.days.ago.to_date...Time.now.utc.to_date)
|
@time_period = (29.days.ago.to_date...Time.now.utc.to_date)
|
||||||
@pending_users_count = User.pending.count
|
@pending_users_count = User.pending.count
|
||||||
@pending_reports_count = Report.unresolved.count
|
@pending_reports_count = Report.unresolved.count
|
||||||
|
|
|
@ -4,18 +4,6 @@ module Admin
|
||||||
class DomainBlocksController < BaseController
|
class DomainBlocksController < BaseController
|
||||||
before_action :set_domain_block, only: [:show, :destroy, :edit, :update]
|
before_action :set_domain_block, only: [:show, :destroy, :edit, :update]
|
||||||
|
|
||||||
def batch
|
|
||||||
authorize :domain_block, :create?
|
|
||||||
@form = Form::DomainBlockBatch.new(form_domain_block_batch_params.merge(current_account: current_account, action: action_from_button))
|
|
||||||
@form.save
|
|
||||||
rescue ActionController::ParameterMissing
|
|
||||||
flash[:alert] = I18n.t('admin.domain_blocks.no_domain_block_selected')
|
|
||||||
rescue Mastodon::NotPermittedError
|
|
||||||
flash[:alert] = I18n.t('admin.domain_blocks.not_permitted')
|
|
||||||
else
|
|
||||||
redirect_to admin_instances_path(limited: '1'), notice: I18n.t('admin.domain_blocks.created_msg')
|
|
||||||
end
|
|
||||||
|
|
||||||
def new
|
def new
|
||||||
authorize :domain_block, :create?
|
authorize :domain_block, :create?
|
||||||
@domain_block = DomainBlock.new(domain: params[:_domain])
|
@domain_block = DomainBlock.new(domain: params[:_domain])
|
||||||
|
@ -55,8 +43,12 @@ module Admin
|
||||||
def update
|
def update
|
||||||
authorize :domain_block, :update?
|
authorize :domain_block, :update?
|
||||||
|
|
||||||
if @domain_block.update(update_params)
|
@domain_block.update(update_params)
|
||||||
DomainBlockWorker.perform_async(@domain_block.id, @domain_block.severity_previously_changed?)
|
|
||||||
|
severity_changed = @domain_block.severity_changed?
|
||||||
|
|
||||||
|
if @domain_block.save
|
||||||
|
DomainBlockWorker.perform_async(@domain_block.id, severity_changed)
|
||||||
log_action :update, @domain_block
|
log_action :update, @domain_block
|
||||||
redirect_to admin_instances_path(limited: '1'), notice: I18n.t('admin.domain_blocks.created_msg')
|
redirect_to admin_instances_path(limited: '1'), notice: I18n.t('admin.domain_blocks.created_msg')
|
||||||
else
|
else
|
||||||
|
@ -84,15 +76,5 @@ module Admin
|
||||||
def resource_params
|
def resource_params
|
||||||
params.require(:domain_block).permit(:domain, :severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate)
|
params.require(:domain_block).permit(:domain, :severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate)
|
||||||
end
|
end
|
||||||
|
|
||||||
def form_domain_block_batch_params
|
|
||||||
params.require(:form_domain_block_batch).permit(domain_blocks_attributes: [:enabled, :domain, :severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate])
|
|
||||||
end
|
|
||||||
|
|
||||||
def action_from_button
|
|
||||||
if params[:save]
|
|
||||||
'save'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,14 +12,12 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def batch
|
def batch
|
||||||
authorize :email_domain_block, :index?
|
|
||||||
|
|
||||||
@form = Form::EmailDomainBlockBatch.new(form_email_domain_block_batch_params.merge(current_account: current_account, action: action_from_button))
|
@form = Form::EmailDomainBlockBatch.new(form_email_domain_block_batch_params.merge(current_account: current_account, action: action_from_button))
|
||||||
@form.save
|
@form.save
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
flash[:alert] = I18n.t('admin.email_domain_blocks.no_email_domain_block_selected')
|
flash[:alert] = I18n.t('admin.email_domain_blocks.no_email_domain_block_selected')
|
||||||
rescue Mastodon::NotPermittedError
|
rescue Mastodon::NotPermittedError
|
||||||
flash[:alert] = I18n.t('admin.email_domain_blocks.not_permitted')
|
flash[:alert] = I18n.t('admin.custom_emojis.not_permitted')
|
||||||
ensure
|
ensure
|
||||||
redirect_to admin_email_domain_blocks_path
|
redirect_to admin_email_domain_blocks_path
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require 'csv'
|
|
||||||
|
|
||||||
module Admin
|
|
||||||
class ExportDomainAllowsController < BaseController
|
|
||||||
include AdminExportControllerConcern
|
|
||||||
|
|
||||||
before_action :set_dummy_import!, only: [:new]
|
|
||||||
|
|
||||||
def new
|
|
||||||
authorize :domain_allow, :create?
|
|
||||||
end
|
|
||||||
|
|
||||||
def export
|
|
||||||
authorize :instance, :index?
|
|
||||||
send_export_file
|
|
||||||
end
|
|
||||||
|
|
||||||
def import
|
|
||||||
authorize :domain_allow, :create?
|
|
||||||
begin
|
|
||||||
@import = Admin::Import.new(import_params)
|
|
||||||
return render :new unless @import.validate
|
|
||||||
|
|
||||||
parse_import_data!(export_headers)
|
|
||||||
|
|
||||||
@data.take(Admin::Import::ROWS_PROCESSING_LIMIT).each do |row|
|
|
||||||
domain = row['#domain'].strip
|
|
||||||
next if DomainAllow.allowed?(domain)
|
|
||||||
|
|
||||||
domain_allow = DomainAllow.new(domain: domain)
|
|
||||||
log_action :create, domain_allow if domain_allow.save
|
|
||||||
end
|
|
||||||
flash[:notice] = I18n.t('admin.domain_allows.created_msg')
|
|
||||||
rescue ActionController::ParameterMissing
|
|
||||||
flash[:error] = I18n.t('admin.export_domain_allows.no_file')
|
|
||||||
end
|
|
||||||
redirect_to admin_instances_path
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def export_filename
|
|
||||||
'domain_allows.csv'
|
|
||||||
end
|
|
||||||
|
|
||||||
def export_headers
|
|
||||||
%w(#domain)
|
|
||||||
end
|
|
||||||
|
|
||||||
def export_data
|
|
||||||
CSV.generate(headers: export_headers, write_headers: true) do |content|
|
|
||||||
DomainAllow.allowed_domains.each do |instance|
|
|
||||||
content << [instance.domain]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,71 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require 'csv'
|
|
||||||
|
|
||||||
module Admin
|
|
||||||
class ExportDomainBlocksController < BaseController
|
|
||||||
include AdminExportControllerConcern
|
|
||||||
|
|
||||||
before_action :set_dummy_import!, only: [:new]
|
|
||||||
|
|
||||||
def new
|
|
||||||
authorize :domain_block, :create?
|
|
||||||
end
|
|
||||||
|
|
||||||
def export
|
|
||||||
authorize :instance, :index?
|
|
||||||
send_export_file
|
|
||||||
end
|
|
||||||
|
|
||||||
def import
|
|
||||||
authorize :domain_block, :create?
|
|
||||||
|
|
||||||
@import = Admin::Import.new(import_params)
|
|
||||||
return render :new unless @import.validate
|
|
||||||
|
|
||||||
parse_import_data!(export_headers)
|
|
||||||
|
|
||||||
@global_private_comment = I18n.t('admin.export_domain_blocks.import.private_comment_template', source: @import.data_file_name, date: I18n.l(Time.now.utc))
|
|
||||||
|
|
||||||
@form = Form::DomainBlockBatch.new
|
|
||||||
@domain_blocks = @data.take(Admin::Import::ROWS_PROCESSING_LIMIT).filter_map do |row|
|
|
||||||
domain = row['#domain'].strip
|
|
||||||
next if DomainBlock.rule_for(domain).present?
|
|
||||||
|
|
||||||
domain_block = DomainBlock.new(domain: domain,
|
|
||||||
severity: row['#severity'].strip,
|
|
||||||
reject_media: row['#reject_media'].strip,
|
|
||||||
reject_reports: row['#reject_reports'].strip,
|
|
||||||
private_comment: @global_private_comment,
|
|
||||||
public_comment: row['#public_comment']&.strip,
|
|
||||||
obfuscate: row['#obfuscate'].strip)
|
|
||||||
|
|
||||||
domain_block if domain_block.valid?
|
|
||||||
end
|
|
||||||
|
|
||||||
@warning_domains = Instance.where(domain: @domain_blocks.map(&:domain)).where('EXISTS (SELECT 1 FROM follows JOIN accounts ON follows.account_id = accounts.id OR follows.target_account_id = accounts.id WHERE accounts.domain = instances.domain)').pluck(:domain)
|
|
||||||
rescue ActionController::ParameterMissing
|
|
||||||
flash.now[:alert] = I18n.t('admin.export_domain_blocks.no_file')
|
|
||||||
set_dummy_import!
|
|
||||||
render :new
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def export_filename
|
|
||||||
'domain_blocks.csv'
|
|
||||||
end
|
|
||||||
|
|
||||||
def export_headers
|
|
||||||
%w(#domain #severity #reject_media #reject_reports #public_comment #obfuscate)
|
|
||||||
end
|
|
||||||
|
|
||||||
def export_data
|
|
||||||
CSV.generate(headers: export_headers, write_headers: true) do |content|
|
|
||||||
DomainBlock.with_limitations.each do |instance|
|
|
||||||
content << [instance.domain, instance.severity, instance.reject_media, instance.reject_reports, instance.public_comment, instance.obfuscate]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -12,8 +12,6 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
authorize :follow_recommendation, :show?
|
|
||||||
|
|
||||||
@form = Form::AccountBatch.new(form_account_batch_params.merge(current_account: current_account, action: action_from_button))
|
@form = Form::AccountBatch.new(form_account_batch_params.merge(current_account: current_account, action: action_from_button))
|
||||||
@form.save
|
@form.save
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
|
|
|
@ -57,7 +57,7 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def preload_delivery_failures!
|
def preload_delivery_failures!
|
||||||
warning_domains_map = DeliveryFailureTracker.warning_domains_map(@instances.map(&:domain))
|
warning_domains_map = DeliveryFailureTracker.warning_domains_map
|
||||||
|
|
||||||
@instances.each do |instance|
|
@instances.each do |instance|
|
||||||
instance.failure_days = warning_domains_map[instance.domain]
|
instance.failure_days = warning_domains_map[instance.domain]
|
||||||
|
|
|
@ -5,7 +5,7 @@ module Admin
|
||||||
def index
|
def index
|
||||||
authorize :ip_block, :index?
|
authorize :ip_block, :index?
|
||||||
|
|
||||||
@ip_blocks = IpBlock.order(ip: :asc).page(params[:page])
|
@ip_blocks = IpBlock.page(params[:page])
|
||||||
@form = Form::IpBlockBatch.new
|
@form = Form::IpBlockBatch.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -29,8 +29,6 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def batch
|
def batch
|
||||||
authorize :ip_block, :index?
|
|
||||||
|
|
||||||
@form = Form::IpBlockBatch.new(form_ip_block_batch_params.merge(current_account: current_account, action: action_from_button))
|
@form = Form::IpBlockBatch.new(form_ip_block_batch_params.merge(current_account: current_account, action: action_from_button))
|
||||||
@form.save
|
@form.save
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
|
|
|
@ -7,7 +7,7 @@ module Admin
|
||||||
PER_PAGE = 40
|
PER_PAGE = 40
|
||||||
|
|
||||||
def index
|
def index
|
||||||
authorize @account, :show?
|
authorize :account, :index?
|
||||||
|
|
||||||
@accounts = RelationshipFilter.new(@account, filter_params).results.includes(:account_stat, user: [:ips, :invite_request]).page(params[:page]).per(PER_PAGE)
|
@accounts = RelationshipFilter.new(@account, filter_params).results.includes(:account_stat, user: [:ips, :invite_request]).page(params[:page]).per(PER_PAGE)
|
||||||
@form = Form::AccountBatch.new
|
@form = Form::AccountBatch.new
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
module Admin
|
module Admin
|
||||||
class RelaysController < BaseController
|
class RelaysController < BaseController
|
||||||
before_action :set_relay, except: [:index, :new, :create]
|
before_action :set_relay, except: [:index, :new, :create]
|
||||||
before_action :warn_signatures_not_enabled!, only: [:new, :create, :enable]
|
before_action :require_signatures_enabled!, only: [:new, :create, :enable]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
authorize :relay, :update?
|
authorize :relay, :update?
|
||||||
|
@ -56,8 +56,8 @@ module Admin
|
||||||
params.require(:relay).permit(:inbox_url)
|
params.require(:relay).permit(:inbox_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
def warn_signatures_not_enabled!
|
def require_signatures_enabled!
|
||||||
flash.now[:error] = I18n.t('admin.relays.signatures_not_enabled') if authorized_fetch_mode?
|
redirect_to admin_relays_path, alert: I18n.t('admin.relays.signatures_not_enabled') if authorized_fetch_mode?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,66 +2,20 @@
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class RolesController < BaseController
|
class RolesController < BaseController
|
||||||
before_action :set_role, except: [:index, :new, :create]
|
before_action :set_user
|
||||||
|
|
||||||
def index
|
def promote
|
||||||
authorize :user_role, :index?
|
authorize @user, :promote?
|
||||||
|
@user.promote!
|
||||||
@roles = UserRole.order(position: :desc).page(params[:page])
|
log_action :promote, @user
|
||||||
|
redirect_to admin_account_path(@user.account_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def demote
|
||||||
authorize :user_role, :create?
|
authorize @user, :demote?
|
||||||
|
@user.demote!
|
||||||
@role = UserRole.new
|
log_action :demote, @user
|
||||||
end
|
redirect_to admin_account_path(@user.account_id)
|
||||||
|
|
||||||
def create
|
|
||||||
authorize :user_role, :create?
|
|
||||||
|
|
||||||
@role = UserRole.new(resource_params)
|
|
||||||
@role.current_account = current_account
|
|
||||||
|
|
||||||
if @role.save
|
|
||||||
log_action :create, @role
|
|
||||||
redirect_to admin_roles_path
|
|
||||||
else
|
|
||||||
render :new
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def edit
|
|
||||||
authorize @role, :update?
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
authorize @role, :update?
|
|
||||||
|
|
||||||
@role.current_account = current_account
|
|
||||||
|
|
||||||
if @role.update(resource_params)
|
|
||||||
log_action :update, @role
|
|
||||||
redirect_to admin_roles_path
|
|
||||||
else
|
|
||||||
render :edit
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
authorize @role, :destroy?
|
|
||||||
@role.destroy!
|
|
||||||
log_action :destroy, @role
|
|
||||||
redirect_to admin_roles_path
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_role
|
|
||||||
@role = UserRole.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def resource_params
|
|
||||||
params.require(:user_role).permit(:name, :color, :highlighted, :position, permissions_as_keys: [])
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Admin::Settings::AboutController < Admin::SettingsController
|
|
||||||
private
|
|
||||||
|
|
||||||
def after_update_redirect_path
|
|
||||||
admin_settings_about_path
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,9 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Admin::Settings::AppearanceController < Admin::SettingsController
|
|
||||||
private
|
|
||||||
|
|
||||||
def after_update_redirect_path
|
|
||||||
admin_settings_appearance_path
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,9 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Admin::Settings::BrandingController < Admin::SettingsController
|
|
||||||
private
|
|
||||||
|
|
||||||
def after_update_redirect_path
|
|
||||||
admin_settings_branding_path
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,9 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Admin::Settings::ContentRetentionController < Admin::SettingsController
|
|
||||||
private
|
|
||||||
|
|
||||||
def after_update_redirect_path
|
|
||||||
admin_settings_content_retention_path
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,9 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Admin::Settings::DiscoveryController < Admin::SettingsController
|
|
||||||
private
|
|
||||||
|
|
||||||
def after_update_redirect_path
|
|
||||||
admin_settings_discovery_path
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,9 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Admin::Settings::RegistrationsController < Admin::SettingsController
|
|
||||||
private
|
|
||||||
|
|
||||||
def after_update_redirect_path
|
|
||||||
admin_settings_registrations_path
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class SettingsController < BaseController
|
class SettingsController < BaseController
|
||||||
def show
|
def edit
|
||||||
authorize :settings, :show?
|
authorize :settings, :show?
|
||||||
|
|
||||||
@admin_settings = Form::AdminSettings.new
|
@admin_settings = Form::AdminSettings.new
|
||||||
|
@ -15,18 +15,14 @@ module Admin
|
||||||
|
|
||||||
if @admin_settings.save
|
if @admin_settings.save
|
||||||
flash[:notice] = I18n.t('generic.changes_saved_msg')
|
flash[:notice] = I18n.t('generic.changes_saved_msg')
|
||||||
redirect_to after_update_redirect_path
|
redirect_to edit_admin_settings_path
|
||||||
else
|
else
|
||||||
render :show
|
render :edit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def after_update_redirect_path
|
|
||||||
raise NotImplementedError
|
|
||||||
end
|
|
||||||
|
|
||||||
def settings_params
|
def settings_params
|
||||||
params.require(:form_admin_settings).permit(*Form::AdminSettings::KEYS)
|
params.require(:form_admin_settings).permit(*Form::AdminSettings::KEYS)
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Admin
|
||||||
|
|
||||||
@site_upload.destroy!
|
@site_upload.destroy!
|
||||||
|
|
||||||
redirect_to admin_settings_path, notice: I18n.t('admin.site_uploads.destroyed_msg')
|
redirect_to edit_admin_settings_path, notice: I18n.t('admin.site_uploads.destroyed_msg')
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -3,24 +3,17 @@
|
||||||
module Admin
|
module Admin
|
||||||
class StatusesController < BaseController
|
class StatusesController < BaseController
|
||||||
before_action :set_account
|
before_action :set_account
|
||||||
before_action :set_statuses, except: :show
|
before_action :set_statuses
|
||||||
before_action :set_status, only: :show
|
|
||||||
|
|
||||||
PER_PAGE = 20
|
PER_PAGE = 20
|
||||||
|
|
||||||
def index
|
def index
|
||||||
authorize [:admin, :status], :index?
|
authorize :status, :index?
|
||||||
|
|
||||||
@status_batch_action = Admin::StatusBatchAction.new
|
@status_batch_action = Admin::StatusBatchAction.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
|
||||||
authorize [:admin, @status], :show?
|
|
||||||
end
|
|
||||||
|
|
||||||
def batch
|
def batch
|
||||||
authorize [:admin, :status], :index?
|
|
||||||
|
|
||||||
@status_batch_action = Admin::StatusBatchAction.new(admin_status_batch_action_params.merge(current_account: current_account, report_id: params[:report_id], type: action_from_button))
|
@status_batch_action = Admin::StatusBatchAction.new(admin_status_batch_action_params.merge(current_account: current_account, report_id: params[:report_id], type: action_from_button))
|
||||||
@status_batch_action.save!
|
@status_batch_action.save!
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
|
@ -37,7 +30,6 @@ module Admin
|
||||||
|
|
||||||
def after_create_redirect_path
|
def after_create_redirect_path
|
||||||
report_id = @status_batch_action&.report_id || params[:report_id]
|
report_id = @status_batch_action&.report_id || params[:report_id]
|
||||||
|
|
||||||
if report_id.present?
|
if report_id.present?
|
||||||
admin_report_path(report_id)
|
admin_report_path(report_id)
|
||||||
else
|
else
|
||||||
|
@ -49,10 +41,6 @@ module Admin
|
||||||
@account = Account.find(params[:account_id])
|
@account = Account.find(params[:account_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_status
|
|
||||||
@status = @account.statuses.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_statuses
|
def set_statuses
|
||||||
@statuses = Admin::StatusFilter.new(@account, filter_params).results.preload(:application, :preloadable_poll, :media_attachments, active_mentions: :account, reblog: [:account, :application, :preloadable_poll, :media_attachments, active_mentions: :account]).page(params[:page]).per(PER_PAGE)
|
@statuses = Admin::StatusFilter.new(@account, filter_params).results.preload(:application, :preloadable_poll, :media_attachments, active_mentions: :account, reblog: [:account, :application, :preloadable_poll, :media_attachments, active_mentions: :account]).page(params[:page]).per(PER_PAGE)
|
||||||
end
|
end
|
||||||
|
|
20
app/controllers/admin/subscriptions_controller.rb
Normal file
20
app/controllers/admin/subscriptions_controller.rb
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Admin
|
||||||
|
class SubscriptionsController < BaseController
|
||||||
|
def index
|
||||||
|
authorize :subscription, :index?
|
||||||
|
@subscriptions = ordered_subscriptions.page(requested_page)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def ordered_subscriptions
|
||||||
|
Subscription.order(id: :desc).includes(:account)
|
||||||
|
end
|
||||||
|
|
||||||
|
def requested_page
|
||||||
|
params[:page].to_i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -16,8 +16,6 @@ module Admin
|
||||||
if @tag.update(tag_params.merge(reviewed_at: Time.now.utc))
|
if @tag.update(tag_params.merge(reviewed_at: Time.now.utc))
|
||||||
redirect_to admin_tag_path(@tag.id), notice: I18n.t('admin.tags.updated_msg')
|
redirect_to admin_tag_path(@tag.id), notice: I18n.t('admin.tags.updated_msg')
|
||||||
else
|
else
|
||||||
@time_period = (6.days.ago.to_date...Time.now.utc.to_date)
|
|
||||||
|
|
||||||
render :show
|
render :show
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -29,7 +27,7 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def tag_params
|
def tag_params
|
||||||
params.require(:tag).permit(:name, :display_name, :trendable, :usable, :listable)
|
params.require(:tag).permit(:name, :trendable, :usable, :listable)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,19 +2,17 @@
|
||||||
|
|
||||||
class Admin::Trends::Links::PreviewCardProvidersController < Admin::BaseController
|
class Admin::Trends::Links::PreviewCardProvidersController < Admin::BaseController
|
||||||
def index
|
def index
|
||||||
authorize :preview_card_provider, :review?
|
authorize :preview_card_provider, :index?
|
||||||
|
|
||||||
@preview_card_providers = filtered_preview_card_providers.page(params[:page])
|
@preview_card_providers = filtered_preview_card_providers.page(params[:page])
|
||||||
@form = Trends::PreviewCardProviderBatch.new
|
@form = Trends::PreviewCardProviderBatch.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def batch
|
def batch
|
||||||
authorize :preview_card_provider, :review?
|
|
||||||
|
|
||||||
@form = Trends::PreviewCardProviderBatch.new(trends_preview_card_provider_batch_params.merge(current_account: current_account, action: action_from_button))
|
@form = Trends::PreviewCardProviderBatch.new(trends_preview_card_provider_batch_params.merge(current_account: current_account, action: action_from_button))
|
||||||
@form.save
|
@form.save
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
flash[:alert] = I18n.t('admin.trends.links.publishers.no_publisher_selected')
|
flash[:alert] = I18n.t('admin.accounts.no_account_selected')
|
||||||
ensure
|
ensure
|
||||||
redirect_to admin_trends_links_preview_card_providers_path(filter_params)
|
redirect_to admin_trends_links_preview_card_providers_path(filter_params)
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,20 +2,17 @@
|
||||||
|
|
||||||
class Admin::Trends::LinksController < Admin::BaseController
|
class Admin::Trends::LinksController < Admin::BaseController
|
||||||
def index
|
def index
|
||||||
authorize :preview_card, :review?
|
authorize :preview_card, :index?
|
||||||
|
|
||||||
@locales = PreviewCardTrend.pluck('distinct language')
|
|
||||||
@preview_cards = filtered_preview_cards.page(params[:page])
|
@preview_cards = filtered_preview_cards.page(params[:page])
|
||||||
@form = Trends::PreviewCardBatch.new
|
@form = Trends::PreviewCardBatch.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def batch
|
def batch
|
||||||
authorize :preview_card, :review?
|
|
||||||
|
|
||||||
@form = Trends::PreviewCardBatch.new(trends_preview_card_batch_params.merge(current_account: current_account, action: action_from_button))
|
@form = Trends::PreviewCardBatch.new(trends_preview_card_batch_params.merge(current_account: current_account, action: action_from_button))
|
||||||
@form.save
|
@form.save
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
flash[:alert] = I18n.t('admin.trends.links.no_link_selected')
|
flash[:alert] = I18n.t('admin.accounts.no_account_selected')
|
||||||
ensure
|
ensure
|
||||||
redirect_to admin_trends_links_path(filter_params)
|
redirect_to admin_trends_links_path(filter_params)
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,20 +2,17 @@
|
||||||
|
|
||||||
class Admin::Trends::StatusesController < Admin::BaseController
|
class Admin::Trends::StatusesController < Admin::BaseController
|
||||||
def index
|
def index
|
||||||
authorize [:admin, :status], :review?
|
authorize :status, :index?
|
||||||
|
|
||||||
@locales = StatusTrend.pluck('distinct language')
|
|
||||||
@statuses = filtered_statuses.page(params[:page])
|
@statuses = filtered_statuses.page(params[:page])
|
||||||
@form = Trends::StatusBatch.new
|
@form = Trends::StatusBatch.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def batch
|
def batch
|
||||||
authorize [:admin, :status], :review?
|
|
||||||
|
|
||||||
@form = Trends::StatusBatch.new(trends_status_batch_params.merge(current_account: current_account, action: action_from_button))
|
@form = Trends::StatusBatch.new(trends_status_batch_params.merge(current_account: current_account, action: action_from_button))
|
||||||
@form.save
|
@form.save
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
flash[:alert] = I18n.t('admin.trends.statuses.no_status_selected')
|
flash[:alert] = I18n.t('admin.accounts.no_account_selected')
|
||||||
ensure
|
ensure
|
||||||
redirect_to admin_trends_statuses_path(filter_params)
|
redirect_to admin_trends_statuses_path(filter_params)
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,19 +2,17 @@
|
||||||
|
|
||||||
class Admin::Trends::TagsController < Admin::BaseController
|
class Admin::Trends::TagsController < Admin::BaseController
|
||||||
def index
|
def index
|
||||||
authorize :tag, :review?
|
authorize :tag, :index?
|
||||||
|
|
||||||
@tags = filtered_tags.page(params[:page])
|
@tags = filtered_tags.page(params[:page])
|
||||||
@form = Trends::TagBatch.new
|
@form = Trends::TagBatch.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def batch
|
def batch
|
||||||
authorize :tag, :review?
|
|
||||||
|
|
||||||
@form = Trends::TagBatch.new(trends_tag_batch_params.merge(current_account: current_account, action: action_from_button))
|
@form = Trends::TagBatch.new(trends_tag_batch_params.merge(current_account: current_account, action: action_from_button))
|
||||||
@form.save
|
@form.save
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
flash[:alert] = I18n.t('admin.trends.tags.no_tag_selected')
|
flash[:alert] = I18n.t('admin.accounts.no_account_selected')
|
||||||
ensure
|
ensure
|
||||||
redirect_to admin_trends_tags_path(filter_params)
|
redirect_to admin_trends_tags_path(filter_params)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class Users::TwoFactorAuthenticationsController < BaseController
|
class TwoFactorAuthenticationsController < BaseController
|
||||||
before_action :set_target_user
|
before_action :set_target_user
|
||||||
|
|
||||||
def destroy
|
def destroy
|
|
@ -1,34 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Admin
|
|
||||||
class Users::RolesController < BaseController
|
|
||||||
before_action :set_user
|
|
||||||
|
|
||||||
def show
|
|
||||||
authorize @user, :change_role?
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
authorize @user, :change_role?
|
|
||||||
|
|
||||||
@user.current_account = current_account
|
|
||||||
|
|
||||||
if @user.update(resource_params)
|
|
||||||
log_action :change_role, @user
|
|
||||||
redirect_to admin_account_path(@user.account_id), notice: I18n.t('admin.accounts.change_role.changed_msg')
|
|
||||||
else
|
|
||||||
render :show
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_user
|
|
||||||
@user = User.find(params[:user_id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def resource_params
|
|
||||||
params.require(:user).permit(:role_id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,19 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Admin
|
|
||||||
class Webhooks::SecretsController < BaseController
|
|
||||||
before_action :set_webhook
|
|
||||||
|
|
||||||
def rotate
|
|
||||||
authorize @webhook, :rotate_secret?
|
|
||||||
@webhook.rotate_secret!
|
|
||||||
redirect_to admin_webhook_path(@webhook)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_webhook
|
|
||||||
@webhook = Webhook.find(params[:webhook_id])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,77 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Admin
|
|
||||||
class WebhooksController < BaseController
|
|
||||||
before_action :set_webhook, except: [:index, :new, :create]
|
|
||||||
|
|
||||||
def index
|
|
||||||
authorize :webhook, :index?
|
|
||||||
|
|
||||||
@webhooks = Webhook.page(params[:page])
|
|
||||||
end
|
|
||||||
|
|
||||||
def new
|
|
||||||
authorize :webhook, :create?
|
|
||||||
|
|
||||||
@webhook = Webhook.new
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
|
||||||
authorize :webhook, :create?
|
|
||||||
|
|
||||||
@webhook = Webhook.new(resource_params)
|
|
||||||
|
|
||||||
if @webhook.save
|
|
||||||
redirect_to admin_webhook_path(@webhook)
|
|
||||||
else
|
|
||||||
render :new
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
authorize @webhook, :show?
|
|
||||||
end
|
|
||||||
|
|
||||||
def edit
|
|
||||||
authorize @webhook, :update?
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
authorize @webhook, :update?
|
|
||||||
|
|
||||||
if @webhook.update(resource_params)
|
|
||||||
redirect_to admin_webhook_path(@webhook)
|
|
||||||
else
|
|
||||||
render :show
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def enable
|
|
||||||
authorize @webhook, :enable?
|
|
||||||
@webhook.enable!
|
|
||||||
redirect_to admin_webhook_path(@webhook)
|
|
||||||
end
|
|
||||||
|
|
||||||
def disable
|
|
||||||
authorize @webhook, :disable?
|
|
||||||
@webhook.disable!
|
|
||||||
redirect_to admin_webhook_path(@webhook)
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
authorize @webhook, :destroy?
|
|
||||||
@webhook.destroy!
|
|
||||||
redirect_to admin_webhooks_path
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_webhook
|
|
||||||
@webhook = Webhook.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def resource_params
|
|
||||||
params.require(:webhook).permit(:url, events: [])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -16,26 +16,6 @@ class Api::BaseController < ApplicationController
|
||||||
|
|
||||||
protect_from_forgery with: :null_session
|
protect_from_forgery with: :null_session
|
||||||
|
|
||||||
content_security_policy do |p|
|
|
||||||
# Set every directive that does not have a fallback
|
|
||||||
p.default_src :none
|
|
||||||
p.frame_ancestors :none
|
|
||||||
p.form_action :none
|
|
||||||
|
|
||||||
# Disable every directive with a fallback to cut on response size
|
|
||||||
p.base_uri false
|
|
||||||
p.font_src false
|
|
||||||
p.img_src false
|
|
||||||
p.style_src false
|
|
||||||
p.media_src false
|
|
||||||
p.frame_src false
|
|
||||||
p.manifest_src false
|
|
||||||
p.connect_src false
|
|
||||||
p.script_src false
|
|
||||||
p.child_src false
|
|
||||||
p.worker_src false
|
|
||||||
end
|
|
||||||
|
|
||||||
rescue_from ActiveRecord::RecordInvalid, Mastodon::ValidationError do |e|
|
rescue_from ActiveRecord::RecordInvalid, Mastodon::ValidationError do |e|
|
||||||
render json: { error: e.to_s }, status: 422
|
render json: { error: e.to_s }, status: 422
|
||||||
end
|
end
|
||||||
|
@ -44,10 +24,6 @@ class Api::BaseController < ApplicationController
|
||||||
render json: { error: 'Duplicate record' }, status: 422
|
render json: { error: 'Duplicate record' }, status: 422
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue_from Date::Error do
|
|
||||||
render json: { error: 'Invalid date supplied' }, status: 422
|
|
||||||
end
|
|
||||||
|
|
||||||
rescue_from ActiveRecord::RecordNotFound do
|
rescue_from ActiveRecord::RecordNotFound do
|
||||||
render json: { error: 'Record not found' }, status: 404
|
render json: { error: 'Record not found' }, status: 404
|
||||||
end
|
end
|
||||||
|
@ -77,7 +53,7 @@ class Api::BaseController < ApplicationController
|
||||||
render json: { error: I18n.t('errors.429') }, status: 429
|
render json: { error: I18n.t('errors.429') }, status: 429
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue_from ActionController::ParameterMissing, Mastodon::InvalidParameterError do |e|
|
rescue_from ActionController::ParameterMissing do |e|
|
||||||
render json: { error: e.to_s }, status: 400
|
render json: { error: e.to_s }, status: 400
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -149,16 +125,10 @@ class Api::BaseController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_cache_headers
|
def set_cache_headers
|
||||||
response.headers['Cache-Control'] = 'private, no-store'
|
response.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
|
||||||
end
|
end
|
||||||
|
|
||||||
def disallow_unauthenticated_api_access?
|
def disallow_unauthenticated_api_access?
|
||||||
ENV['DISALLOW_UNAUTHENTICATED_API_ACCESS'] == 'true' || Rails.configuration.x.whitelist_mode
|
authorized_fetch_mode?
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def respond_with_error(code)
|
|
||||||
render json: { error: Rack::Utils::HTTP_STATUS_CODES[code] }, status: code
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::Accounts::FollowerAccountsController < Api::BaseController
|
class Api::V1::Accounts::FollowerAccountsController < Api::BaseController
|
||||||
before_action -> { authorize_if_got_token! :read, :'read:accounts' }
|
before_action -> { doorkeeper_authorize! :read, :'read:accounts' }
|
||||||
before_action :set_account
|
before_action :set_account
|
||||||
after_action :insert_pagination_headers
|
after_action :insert_pagination_headers
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::Accounts::FollowingAccountsController < Api::BaseController
|
class Api::V1::Accounts::FollowingAccountsController < Api::BaseController
|
||||||
before_action -> { authorize_if_got_token! :read, :'read:accounts' }
|
before_action -> { doorkeeper_authorize! :read, :'read:accounts' }
|
||||||
before_action :set_account
|
before_action :set_account
|
||||||
after_action :insert_pagination_headers
|
after_action :insert_pagination_headers
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ class Api::V1::Accounts::PinsController < Api::BaseController
|
||||||
before_action :set_account
|
before_action :set_account
|
||||||
|
|
||||||
def create
|
def create
|
||||||
AccountPin.find_or_create_by!(account: current_account, target_account: @account)
|
AccountPin.create!(account: current_account, target_account: @account)
|
||||||
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships_presenter
|
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships_presenter
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -30,12 +30,12 @@ class Api::V1::AccountsController < Api::BaseController
|
||||||
self.response_body = Oj.dump(response.body)
|
self.response_body = Oj.dump(response.body)
|
||||||
self.status = response.status
|
self.status = response.status
|
||||||
rescue ActiveRecord::RecordInvalid => e
|
rescue ActiveRecord::RecordInvalid => e
|
||||||
render json: ValidationErrorFormatter.new(e, 'account.username': :username, 'invite_request.text': :reason).as_json, status: :unprocessable_entity
|
render json: ValidationErrorFormatter.new(e, :'account.username' => :username, :'invite_request.text' => :reason).as_json, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
|
|
||||||
def follow
|
def follow
|
||||||
follow = FollowService.new.call(current_user.account, @account, reblogs: params.key?(:reblogs) ? truthy_param?(:reblogs) : nil, notify: params.key?(:notify) ? truthy_param?(:notify) : nil, languages: params.key?(:languages) ? params[:languages] : nil, with_rate_limit: true)
|
follow = FollowService.new.call(current_user.account, @account, reblogs: params.key?(:reblogs) ? truthy_param?(:reblogs) : nil, notify: params.key?(:notify) ? truthy_param?(:notify) : nil, with_rate_limit: true)
|
||||||
options = @account.locked? || current_user.account.silenced? ? {} : { following_map: { @account.id => { reblogs: follow.show_reblogs?, notify: follow.notify?, languages: follow.languages } }, requested_map: { @account.id => false } }
|
options = @account.locked? || current_user.account.silenced? ? {} : { following_map: { @account.id => { reblogs: follow.show_reblogs?, notify: follow.notify? } }, requested_map: { @account.id => false } }
|
||||||
|
|
||||||
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships(**options)
|
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships(**options)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::Admin::AccountActionsController < Api::BaseController
|
class Api::V1::Admin::AccountActionsController < Api::BaseController
|
||||||
include Authorization
|
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:accounts' }
|
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:accounts' }
|
||||||
|
before_action :require_staff!
|
||||||
before_action :set_account
|
before_action :set_account
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
authorize @account, :show?
|
|
||||||
|
|
||||||
account_action = Admin::AccountAction.new(resource_params)
|
account_action = Admin::AccountAction.new(resource_params)
|
||||||
account_action.target_account = @account
|
account_action.target_account = @account
|
||||||
account_action.current_account = current_account
|
account_action.current_account = current_account
|
||||||
|
|
|
@ -8,11 +8,11 @@ class Api::V1::Admin::AccountsController < Api::BaseController
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:read', :'admin:read:accounts' }, only: [:index, :show]
|
before_action -> { authorize_if_got_token! :'admin:read', :'admin:read:accounts' }, only: [:index, :show]
|
||||||
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:accounts' }, except: [:index, :show]
|
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:accounts' }, except: [:index, :show]
|
||||||
|
before_action :require_staff!
|
||||||
before_action :set_accounts, only: :index
|
before_action :set_accounts, only: :index
|
||||||
before_action :set_account, except: :index
|
before_action :set_account, except: :index
|
||||||
before_action :require_local_account!, only: [:enable, :approve, :reject]
|
before_action :require_local_account!, only: [:enable, :approve, :reject]
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
after_action :insert_pagination_headers, only: :index
|
after_action :insert_pagination_headers, only: :index
|
||||||
|
|
||||||
FILTER_PARAMS = %i(
|
FILTER_PARAMS = %i(
|
||||||
|
@ -54,21 +54,20 @@ class Api::V1::Admin::AccountsController < Api::BaseController
|
||||||
def approve
|
def approve
|
||||||
authorize @account.user, :approve?
|
authorize @account.user, :approve?
|
||||||
@account.user.approve!
|
@account.user.approve!
|
||||||
log_action :approve, @account.user
|
|
||||||
render json: @account, serializer: REST::Admin::AccountSerializer
|
render json: @account, serializer: REST::Admin::AccountSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def reject
|
def reject
|
||||||
authorize @account.user, :reject?
|
authorize @account.user, :reject?
|
||||||
DeleteAccountService.new.call(@account, reserve_email: false, reserve_username: false)
|
DeleteAccountService.new.call(@account, reserve_email: false, reserve_username: false)
|
||||||
log_action :reject, @account.user
|
render json: @account, serializer: REST::Admin::AccountSerializer
|
||||||
render_empty
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
authorize @account, :destroy?
|
authorize @account, :destroy?
|
||||||
|
json = render_to_body json: @account, serializer: REST::Admin::AccountSerializer
|
||||||
Admin::AccountDeletionWorker.perform_async(@account.id)
|
Admin::AccountDeletionWorker.perform_async(@account.id)
|
||||||
render_empty
|
render json: json
|
||||||
end
|
end
|
||||||
|
|
||||||
def unsensitive
|
def unsensitive
|
||||||
|
@ -120,9 +119,7 @@ class Api::V1::Admin::AccountsController < Api::BaseController
|
||||||
translated_params[:status] = status.to_s if params[status].present?
|
translated_params[:status] = status.to_s if params[status].present?
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:staff].present?
|
translated_params[:permissions] = 'staff' if params[:staff].present?
|
||||||
translated_params[:role_ids] = UserRole.that_can(:manage_reports).map(&:id)
|
|
||||||
end
|
|
||||||
|
|
||||||
translated_params
|
translated_params
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,95 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Api::V1::Admin::CanonicalEmailBlocksController < Api::BaseController
|
|
||||||
include Authorization
|
|
||||||
include AccountableConcern
|
|
||||||
|
|
||||||
LIMIT = 100
|
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:read', :'admin:read:canonical_email_blocks' }, only: [:index, :show, :test]
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:canonical_email_blocks' }, except: [:index, :show, :test]
|
|
||||||
|
|
||||||
before_action :set_canonical_email_blocks, only: :index
|
|
||||||
before_action :set_canonical_email_blocks_from_test, only: [:test]
|
|
||||||
before_action :set_canonical_email_block, only: [:show, :destroy]
|
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
after_action :insert_pagination_headers, only: :index
|
|
||||||
|
|
||||||
PAGINATION_PARAMS = %i(limit).freeze
|
|
||||||
|
|
||||||
def index
|
|
||||||
authorize :canonical_email_block, :index?
|
|
||||||
render json: @canonical_email_blocks, each_serializer: REST::Admin::CanonicalEmailBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
authorize @canonical_email_block, :show?
|
|
||||||
render json: @canonical_email_block, serializer: REST::Admin::CanonicalEmailBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def test
|
|
||||||
authorize :canonical_email_block, :test?
|
|
||||||
render json: @canonical_email_blocks, each_serializer: REST::Admin::CanonicalEmailBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
|
||||||
authorize :canonical_email_block, :create?
|
|
||||||
@canonical_email_block = CanonicalEmailBlock.create!(resource_params)
|
|
||||||
log_action :create, @canonical_email_block
|
|
||||||
render json: @canonical_email_block, serializer: REST::Admin::CanonicalEmailBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
authorize @canonical_email_block, :destroy?
|
|
||||||
@canonical_email_block.destroy!
|
|
||||||
log_action :destroy, @canonical_email_block
|
|
||||||
render_empty
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def resource_params
|
|
||||||
params.permit(:canonical_email_hash, :email)
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_canonical_email_blocks
|
|
||||||
@canonical_email_blocks = CanonicalEmailBlock.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_canonical_email_blocks_from_test
|
|
||||||
@canonical_email_blocks = CanonicalEmailBlock.matching_email(params[:email])
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_canonical_email_block
|
|
||||||
@canonical_email_block = CanonicalEmailBlock.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def insert_pagination_headers
|
|
||||||
set_pagination_headers(next_path, prev_path)
|
|
||||||
end
|
|
||||||
|
|
||||||
def next_path
|
|
||||||
api_v1_admin_canonical_email_blocks_url(pagination_params(max_id: pagination_max_id)) if records_continue?
|
|
||||||
end
|
|
||||||
|
|
||||||
def prev_path
|
|
||||||
api_v1_admin_canonical_email_blocks_url(pagination_params(min_id: pagination_since_id)) unless @canonical_email_blocks.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_max_id
|
|
||||||
@canonical_email_blocks.last.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_since_id
|
|
||||||
@canonical_email_blocks.first.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def records_continue?
|
|
||||||
@canonical_email_blocks.size == limit_param(LIMIT)
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_params(core_params)
|
|
||||||
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,15 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::Admin::DimensionsController < Api::BaseController
|
class Api::V1::Admin::DimensionsController < Api::BaseController
|
||||||
include Authorization
|
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:read' }
|
before_action -> { authorize_if_got_token! :'admin:read' }
|
||||||
|
before_action :require_staff!
|
||||||
before_action :set_dimensions
|
before_action :set_dimensions
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
authorize :dashboard, :index?
|
|
||||||
render json: @dimensions, each_serializer: REST::Admin::DimensionSerializer
|
render json: @dimensions, each_serializer: REST::Admin::DimensionSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,95 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Api::V1::Admin::DomainAllowsController < Api::BaseController
|
|
||||||
include Authorization
|
|
||||||
include AccountableConcern
|
|
||||||
|
|
||||||
LIMIT = 100
|
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:read', :'admin:read:domain_allows' }, only: [:index, :show]
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:domain_allows' }, except: [:index, :show]
|
|
||||||
before_action :set_domain_allows, only: :index
|
|
||||||
before_action :set_domain_allow, only: [:show, :destroy]
|
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
after_action :insert_pagination_headers, only: :index
|
|
||||||
|
|
||||||
PAGINATION_PARAMS = %i(limit).freeze
|
|
||||||
|
|
||||||
def create
|
|
||||||
authorize :domain_allow, :create?
|
|
||||||
|
|
||||||
@domain_allow = DomainAllow.find_by(resource_params)
|
|
||||||
|
|
||||||
if @domain_allow.nil?
|
|
||||||
@domain_allow = DomainAllow.create!(resource_params)
|
|
||||||
log_action :create, @domain_allow
|
|
||||||
end
|
|
||||||
|
|
||||||
render json: @domain_allow, serializer: REST::Admin::DomainAllowSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def index
|
|
||||||
authorize :domain_allow, :index?
|
|
||||||
render json: @domain_allows, each_serializer: REST::Admin::DomainAllowSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
authorize @domain_allow, :show?
|
|
||||||
render json: @domain_allow, serializer: REST::Admin::DomainAllowSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
authorize @domain_allow, :destroy?
|
|
||||||
UnallowDomainService.new.call(@domain_allow)
|
|
||||||
log_action :destroy, @domain_allow
|
|
||||||
render_empty
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_domain_allows
|
|
||||||
@domain_allows = filtered_domain_allows.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_domain_allow
|
|
||||||
@domain_allow = DomainAllow.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def filtered_domain_allows
|
|
||||||
# TODO: no filtering yet
|
|
||||||
DomainAllow.all
|
|
||||||
end
|
|
||||||
|
|
||||||
def insert_pagination_headers
|
|
||||||
set_pagination_headers(next_path, prev_path)
|
|
||||||
end
|
|
||||||
|
|
||||||
def next_path
|
|
||||||
api_v1_admin_domain_allows_url(pagination_params(max_id: pagination_max_id)) if records_continue?
|
|
||||||
end
|
|
||||||
|
|
||||||
def prev_path
|
|
||||||
api_v1_admin_domain_allows_url(pagination_params(min_id: pagination_since_id)) unless @domain_allows.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_max_id
|
|
||||||
@domain_allows.last.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_since_id
|
|
||||||
@domain_allows.first.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def records_continue?
|
|
||||||
@domain_allows.size == limit_param(LIMIT)
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_params(core_params)
|
|
||||||
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
|
|
||||||
end
|
|
||||||
|
|
||||||
def resource_params
|
|
||||||
params.permit(:domain)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,106 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Api::V1::Admin::DomainBlocksController < Api::BaseController
|
|
||||||
include Authorization
|
|
||||||
include AccountableConcern
|
|
||||||
|
|
||||||
LIMIT = 100
|
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:read', :'admin:read:domain_blocks' }, only: [:index, :show]
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:domain_blocks' }, except: [:index, :show]
|
|
||||||
before_action :set_domain_blocks, only: :index
|
|
||||||
before_action :set_domain_block, only: [:show, :update, :destroy]
|
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
after_action :insert_pagination_headers, only: :index
|
|
||||||
|
|
||||||
PAGINATION_PARAMS = %i(limit).freeze
|
|
||||||
|
|
||||||
def create
|
|
||||||
authorize :domain_block, :create?
|
|
||||||
|
|
||||||
existing_domain_block = resource_params[:domain].present? ? DomainBlock.rule_for(resource_params[:domain]) : nil
|
|
||||||
return render json: existing_domain_block, serializer: REST::Admin::ExistingDomainBlockErrorSerializer, status: 422 if existing_domain_block.present?
|
|
||||||
|
|
||||||
@domain_block = DomainBlock.create!(resource_params)
|
|
||||||
DomainBlockWorker.perform_async(@domain_block.id)
|
|
||||||
log_action :create, @domain_block
|
|
||||||
render json: @domain_block, serializer: REST::Admin::DomainBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def index
|
|
||||||
authorize :domain_block, :index?
|
|
||||||
render json: @domain_blocks, each_serializer: REST::Admin::DomainBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
authorize @domain_block, :show?
|
|
||||||
render json: @domain_block, serializer: REST::Admin::DomainBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
authorize @domain_block, :update?
|
|
||||||
@domain_block.update!(domain_block_params)
|
|
||||||
DomainBlockWorker.perform_async(@domain_block.id, @domain_block.severity_previously_changed?)
|
|
||||||
log_action :update, @domain_block
|
|
||||||
render json: @domain_block, serializer: REST::Admin::DomainBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
authorize @domain_block, :destroy?
|
|
||||||
UnblockDomainService.new.call(@domain_block)
|
|
||||||
log_action :destroy, @domain_block
|
|
||||||
render_empty
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_domain_blocks
|
|
||||||
@domain_blocks = filtered_domain_blocks.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_domain_block
|
|
||||||
@domain_block = DomainBlock.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def filtered_domain_blocks
|
|
||||||
# TODO: no filtering yet
|
|
||||||
DomainBlock.all
|
|
||||||
end
|
|
||||||
|
|
||||||
def domain_block_params
|
|
||||||
params.permit(:severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate)
|
|
||||||
end
|
|
||||||
|
|
||||||
def insert_pagination_headers
|
|
||||||
set_pagination_headers(next_path, prev_path)
|
|
||||||
end
|
|
||||||
|
|
||||||
def next_path
|
|
||||||
api_v1_admin_domain_blocks_url(pagination_params(max_id: pagination_max_id)) if records_continue?
|
|
||||||
end
|
|
||||||
|
|
||||||
def prev_path
|
|
||||||
api_v1_admin_domain_blocks_url(pagination_params(min_id: pagination_since_id)) unless @domain_blocks.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_max_id
|
|
||||||
@domain_blocks.last.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_since_id
|
|
||||||
@domain_blocks.first.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def records_continue?
|
|
||||||
@domain_blocks.size == limit_param(LIMIT)
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_params(core_params)
|
|
||||||
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
|
|
||||||
end
|
|
||||||
|
|
||||||
def resource_params
|
|
||||||
params.permit(:domain, :severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,88 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Api::V1::Admin::EmailDomainBlocksController < Api::BaseController
|
|
||||||
include Authorization
|
|
||||||
include AccountableConcern
|
|
||||||
|
|
||||||
LIMIT = 100
|
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:read', :'admin:read:email_domain_blocks' }, only: [:index, :show]
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:email_domain_blocks' }, except: [:index, :show]
|
|
||||||
before_action :set_email_domain_blocks, only: :index
|
|
||||||
before_action :set_email_domain_block, only: [:show, :destroy]
|
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
after_action :insert_pagination_headers, only: :index
|
|
||||||
|
|
||||||
PAGINATION_PARAMS = %i(
|
|
||||||
limit
|
|
||||||
).freeze
|
|
||||||
|
|
||||||
def create
|
|
||||||
authorize :email_domain_block, :create?
|
|
||||||
|
|
||||||
@email_domain_block = EmailDomainBlock.create!(resource_params)
|
|
||||||
log_action :create, @email_domain_block
|
|
||||||
|
|
||||||
render json: @email_domain_block, serializer: REST::Admin::EmailDomainBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def index
|
|
||||||
authorize :email_domain_block, :index?
|
|
||||||
render json: @email_domain_blocks, each_serializer: REST::Admin::EmailDomainBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
authorize @email_domain_block, :show?
|
|
||||||
render json: @email_domain_block, serializer: REST::Admin::EmailDomainBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
authorize @email_domain_block, :destroy?
|
|
||||||
@email_domain_block.destroy!
|
|
||||||
log_action :destroy, @email_domain_block
|
|
||||||
render_empty
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_email_domain_blocks
|
|
||||||
@email_domain_blocks = EmailDomainBlock.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_email_domain_block
|
|
||||||
@email_domain_block = EmailDomainBlock.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def resource_params
|
|
||||||
params.permit(:domain)
|
|
||||||
end
|
|
||||||
|
|
||||||
def insert_pagination_headers
|
|
||||||
set_pagination_headers(next_path, prev_path)
|
|
||||||
end
|
|
||||||
|
|
||||||
def next_path
|
|
||||||
api_v1_admin_email_domain_blocks_url(pagination_params(max_id: pagination_max_id)) if records_continue?
|
|
||||||
end
|
|
||||||
|
|
||||||
def prev_path
|
|
||||||
api_v1_admin_email_domain_blocks_url(pagination_params(min_id: pagination_since_id)) unless @email_domain_blocks.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_max_id
|
|
||||||
@email_domain_blocks.last.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_since_id
|
|
||||||
@email_domain_blocks.first.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def records_continue?
|
|
||||||
@email_domain_blocks.size == limit_param(LIMIT)
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_params(core_params)
|
|
||||||
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,93 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Api::V1::Admin::IpBlocksController < Api::BaseController
|
|
||||||
include Authorization
|
|
||||||
include AccountableConcern
|
|
||||||
|
|
||||||
LIMIT = 100
|
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:read', :'admin:read:ip_blocks' }, only: [:index, :show]
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:ip_blocks' }, except: [:index, :show]
|
|
||||||
before_action :set_ip_blocks, only: :index
|
|
||||||
before_action :set_ip_block, only: [:show, :update, :destroy]
|
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
after_action :insert_pagination_headers, only: :index
|
|
||||||
|
|
||||||
PAGINATION_PARAMS = %i(
|
|
||||||
limit
|
|
||||||
).freeze
|
|
||||||
|
|
||||||
def create
|
|
||||||
authorize :ip_block, :create?
|
|
||||||
@ip_block = IpBlock.create!(resource_params)
|
|
||||||
log_action :create, @ip_block
|
|
||||||
render json: @ip_block, serializer: REST::Admin::IpBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def index
|
|
||||||
authorize :ip_block, :index?
|
|
||||||
render json: @ip_blocks, each_serializer: REST::Admin::IpBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
authorize @ip_block, :show?
|
|
||||||
render json: @ip_block, serializer: REST::Admin::IpBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
authorize @ip_block, :update?
|
|
||||||
@ip_block.update(resource_params)
|
|
||||||
log_action :update, @ip_block
|
|
||||||
render json: @ip_block, serializer: REST::Admin::IpBlockSerializer
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
authorize @ip_block, :destroy?
|
|
||||||
@ip_block.destroy!
|
|
||||||
log_action :destroy, @ip_block
|
|
||||||
render_empty
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_ip_blocks
|
|
||||||
@ip_blocks = IpBlock.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_ip_block
|
|
||||||
@ip_block = IpBlock.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def resource_params
|
|
||||||
params.permit(:ip, :severity, :comment, :expires_in)
|
|
||||||
end
|
|
||||||
|
|
||||||
def insert_pagination_headers
|
|
||||||
set_pagination_headers(next_path, prev_path)
|
|
||||||
end
|
|
||||||
|
|
||||||
def next_path
|
|
||||||
api_v1_admin_ip_blocks_url(pagination_params(max_id: pagination_max_id)) if records_continue?
|
|
||||||
end
|
|
||||||
|
|
||||||
def prev_path
|
|
||||||
api_v1_admin_ip_blocks_url(pagination_params(min_id: pagination_since_id)) unless @ip_blocks.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_max_id
|
|
||||||
@ip_blocks.last.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_since_id
|
|
||||||
@ip_blocks.first.id
|
|
||||||
end
|
|
||||||
|
|
||||||
def records_continue?
|
|
||||||
@ip_blocks.size == limit_param(LIMIT)
|
|
||||||
end
|
|
||||||
|
|
||||||
def pagination_params(core_params)
|
|
||||||
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,15 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::Admin::MeasuresController < Api::BaseController
|
class Api::V1::Admin::MeasuresController < Api::BaseController
|
||||||
include Authorization
|
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:read' }
|
before_action -> { authorize_if_got_token! :'admin:read' }
|
||||||
|
before_action :require_staff!
|
||||||
before_action :set_measures
|
before_action :set_measures
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
authorize :dashboard, :index?
|
|
||||||
render json: @measures, each_serializer: REST::Admin::MeasureSerializer
|
render json: @measures, each_serializer: REST::Admin::MeasureSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,10 @@ class Api::V1::Admin::ReportsController < Api::BaseController
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:read', :'admin:read:reports' }, only: [:index, :show]
|
before_action -> { authorize_if_got_token! :'admin:read', :'admin:read:reports' }, only: [:index, :show]
|
||||||
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:reports' }, except: [:index, :show]
|
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:reports' }, except: [:index, :show]
|
||||||
|
before_action :require_staff!
|
||||||
before_action :set_reports, only: :index
|
before_action :set_reports, only: :index
|
||||||
before_action :set_report, except: :index
|
before_action :set_report, except: :index
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
after_action :insert_pagination_headers, only: :index
|
after_action :insert_pagination_headers, only: :index
|
||||||
|
|
||||||
FILTER_PARAMS = %i(
|
FILTER_PARAMS = %i(
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::Admin::RetentionController < Api::BaseController
|
class Api::V1::Admin::RetentionController < Api::BaseController
|
||||||
include Authorization
|
|
||||||
|
|
||||||
before_action -> { authorize_if_got_token! :'admin:read' }
|
before_action -> { authorize_if_got_token! :'admin:read' }
|
||||||
|
before_action :require_staff!
|
||||||
before_action :set_cohorts
|
before_action :set_cohorts
|
||||||
|
|
||||||
after_action :verify_authorized
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
authorize :dashboard, :index?
|
|
||||||
render json: @cohorts, each_serializer: REST::Admin::CohortSerializer
|
render json: @cohorts, each_serializer: REST::Admin::CohortSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue