diff --git a/.buildpacks b/.buildpacks deleted file mode 100644 index 5e73304a5..000000000 --- a/.buildpacks +++ /dev/null @@ -1,3 +0,0 @@ -https://github.com/heroku/heroku-buildpack-apt -https://github.com/Scalingo/ffmpeg-buildpack -https://github.com/Scalingo/ruby-buildpack diff --git a/.env.test b/.env.test deleted file mode 100644 index 761d0d921..000000000 --- a/.env.test +++ /dev/null @@ -1,5 +0,0 @@ -# Node.js -NODE_ENV=tests -# Federation -LOCAL_DOMAIN=cb6e6126.ngrok.io -LOCAL_HTTPS=true diff --git a/.foreman b/.foreman deleted file mode 100644 index 722b491f7..000000000 --- a/.foreman +++ /dev/null @@ -1 +0,0 @@ -procfile: Procfile.dev diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index e69f2a0ad..000000000 --- a/.gitattributes +++ /dev/null @@ -1,14 +0,0 @@ -* text=auto eol=lf -*.eot -text -*.gif -text -*.gz -text -*.ico -text -*.jpg -text -*.mp3 -text -*.ogg -text -*.png -text -*.ttf -text -*.webm -text -*.woff -text -*.woff2 -text -spec/fixtures/requests/** -text !eol diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index d2ae35e84..000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -yarn lint-staged diff --git a/.profile b/.profile deleted file mode 100644 index f4826ea30..000000000 --- a/.profile +++ /dev/null @@ -1 +0,0 @@ -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/.apt/lib/x86_64-linux-gnu:/app/.apt/usr/lib/x86_64-linux-gnu/mesa:/app/.apt/usr/lib/x86_64-linux-gnu/pulseaudio:/app/.apt/usr/lib/x86_64-linux-gnu/openblas-pthread diff --git a/.rspec b/.rspec deleted file mode 100644 index 9a8e706d0..000000000 --- a/.rspec +++ /dev/null @@ -1,3 +0,0 @@ ---color ---require spec_helper ---format Fuubar diff --git a/.slugignore b/.slugignore deleted file mode 100644 index 5470f6e3f..000000000 --- a/.slugignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -.cache/ -docs/ -spec/ diff --git a/bin/bundle b/bin/bundle deleted file mode 100755 index f19acf5b5..000000000 --- a/bin/bundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) -load Gem.bin_path('bundler', 'bundle') diff --git a/bin/heroku-web b/bin/heroku-web deleted file mode 100755 index 219ef35b9..000000000 --- a/bin/heroku-web +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -if [ "$RUN_STREAMING" != "true" ]; then BIND=0.0.0.0 bundle exec puma -C config/puma.rb; else BIND=0.0.0.0 node ./streaming; fi \ No newline at end of file diff --git a/bin/rails b/bin/rails deleted file mode 100755 index 073966023..000000000 --- a/bin/rails +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path('../config/application', __dir__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/bin/rake b/bin/rake deleted file mode 100755 index 17240489f..000000000 --- a/bin/rake +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/bin/retry b/bin/retry deleted file mode 100755 index 419ece62a..000000000 --- a/bin/retry +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# https://github.com/travis-ci/travis-build/blob/cbe49ea239ab37b9b38b5b44d287b7ec7a108c16/lib/travis/build/templates/header.sh#L243-L260 -# -# MIT LICENSE -# -# Copyright (c) 2016 Travis CI GmbH -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -retry() { - local result=0 - local count=1 - - while [ $count -le 3 ]; do - if [ $result -ne 0 ]; then - echo -e "\n${ANSI_RED}The command \"$@\" failed. Retrying, $count of 3.${ANSI_RESET}\n" >&2 - fi - - "$@" && { result=0 && break; } || result=$? - count=$(($count + 1)) - sleep 1 - done - - if [ $count -gt 3 ]; then - echo -e "\n${ANSI_RED}The command \"$@\" failed 3 times.${ANSI_RESET}\n" >&2 - fi - - return $result -} - -retry $@ diff --git a/bin/rspec b/bin/rspec deleted file mode 100755 index d738b23c0..000000000 --- a/bin/rspec +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'rspec' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("rspec-core", "rspec") diff --git a/bin/setup b/bin/setup deleted file mode 100755 index 90700ac4f..000000000 --- a/bin/setup +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env ruby -require "fileutils" - -# path to your application root. -APP_ROOT = File.expand_path('..', __dir__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -FileUtils.chdir APP_ROOT do - # This script is a way to set up or update your development environment automatically. - # This script is idempotent, so that you can run it at any time and get an expectable outcome. - # Add necessary setup steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') - - # Install JavaScript dependencies - system! 'bin/yarn' - - # puts "\n== Copying sample files ==" - # unless File.exist?('config/database.yml') - # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' - # end - - puts "\n== Preparing database ==" - system! 'bin/rails db:prepare' - - puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'bin/rails restart' -end diff --git a/bin/tootctl b/bin/tootctl deleted file mode 100755 index b3311c6b2..000000000 --- a/bin/tootctl +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path('../config/application', __dir__) - -require_relative '../config/boot' -require_relative '../lib/mastodon/cli/main' - -begin - Chewy.strategy(:mastodon) do - Mastodon::CLI::Main.start(ARGV) - end -rescue Interrupt - exit(130) -end diff --git a/bin/update b/bin/update deleted file mode 100755 index 6d73559a3..000000000 --- a/bin/update +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ruby -require 'fileutils' -include FileUtils - -# path to your application root. -APP_ROOT = File.expand_path('..', __dir__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -chdir APP_ROOT do - # This script is a way to update your development environment automatically. - # Add necessary update steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') - - # Install JavaScript dependencies if using Yarn - system('bin/yarn') - - puts "\n== Updating database ==" - system! 'bin/rails db:migrate' - - puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'bin/rails restart' -end diff --git a/bin/webpack b/bin/webpack deleted file mode 100755 index 008ecb22f..000000000 --- a/bin/webpack +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env ruby - -ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" -ENV["NODE_ENV"] ||= "development" - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -require "webpacker" -require "webpacker/webpack_runner" - -APP_ROOT = File.expand_path("..", __dir__) -Dir.chdir(APP_ROOT) do - Webpacker::WebpackRunner.run(ARGV) -end diff --git a/bin/webpack-dev-server b/bin/webpack-dev-server deleted file mode 100755 index a931a9b7f..000000000 --- a/bin/webpack-dev-server +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env ruby - -ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" -ENV["NODE_ENV"] ||= "development" - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -require "webpacker" -require "webpacker/dev_server_runner" - -APP_ROOT = File.expand_path("..", __dir__) -Dir.chdir(APP_ROOT) do - Webpacker::DevServerRunner.run(ARGV) -end diff --git a/bin/yarn b/bin/yarn deleted file mode 100755 index 9fab2c350..000000000 --- a/bin/yarn +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -APP_ROOT = File.expand_path('..', __dir__) -Dir.chdir(APP_ROOT) do - yarn = ENV["PATH"].split(File::PATH_SEPARATOR). - select { |dir| File.expand_path(dir) != __dir__ }. - product(["yarn", "yarn.cmd", "yarn.ps1"]). - map { |dir, file| File.expand_path(file, dir) }. - find { |file| File.executable?(file) } - - if yarn - exec yarn, *ARGV - else - $stderr.puts "Yarn executable was not detected in the system." - $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" - exit 1 - end -end diff --git a/config/brakeman.ignore b/config/brakeman.ignore deleted file mode 100644 index 02ce23a07..000000000 --- a/config/brakeman.ignore +++ /dev/null @@ -1,96 +0,0 @@ -{ - "ignored_warnings": [ - { - "warning_type": "Cross-Site Scripting", - "warning_code": 2, - "fingerprint": "71cf98c8235b5cfa9946b5db8fdc1a2f3a862566abb34e4542be6f3acae78233", - "check_name": "CrossSiteScripting", - "message": "Unescaped model attribute", - "file": "app/views/admin/disputes/appeals/_appeal.html.haml", - "line": 7, - "link": "https://brakemanscanner.org/docs/warning_types/cross_site_scripting", - "code": "t((Unresolved Model).new.strike.action, :scope => \"admin.strikes.actions\", :name => content_tag(:span, (Unresolved Model).new.strike.account.username, :class => \"username\"), :target => content_tag(:span, (Unresolved Model).new.account.username, :class => \"target\"))", - "render_path": [ - { - "type": "template", - "name": "admin/disputes/appeals/index", - "line": 20, - "file": "app/views/admin/disputes/appeals/index.html.haml", - "rendered": { - "name": "admin/disputes/appeals/_appeal", - "file": "app/views/admin/disputes/appeals/_appeal.html.haml" - } - } - ], - "location": { - "type": "template", - "template": "admin/disputes/appeals/_appeal" - }, - "user_input": "(Unresolved Model).new.strike", - "confidence": "Weak", - "cwe_id": [ - 79 - ], - "note": "" - }, - { - "warning_type": "Denial of Service", - "warning_code": 76, - "fingerprint": "7b6abba5699755348e7ee82a4694bfbf574b41c7cce2d0db0f7c11ae3f983c72", - "check_name": "RegexDoS", - "message": "Model attribute used in regular expression", - "file": "lib/mastodon/cli/domains.rb", - "line": 128, - "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/", - "code": "/\\.?(#{DomainBlock.where(:severity => 1).pluck(:domain).map do\n Regexp.escape(domain)\n end.join(\"|\")})$/", - "render_path": null, - "location": { - "type": "method", - "class": "Mastodon::CLI::Domains", - "method": "crawl" - }, - "user_input": "DomainBlock.where(:severity => 1).pluck(:domain)", - "confidence": "Weak", - "cwe_id": [ - 20, - 185 - ], - "note": "" - }, - { - "warning_type": "Cross-Site Scripting", - "warning_code": 4, - "fingerprint": "cd5cfd7f40037fbfa753e494d7129df16e358bfc43ef0da3febafbf4ee1ed3ac", - "check_name": "LinkToHref", - "message": "Potentially unsafe model attribute in `link_to` href", - "file": "app/views/admin/trends/links/_preview_card.html.haml", - "line": 7, - "link": "https://brakemanscanner.org/docs/warning_types/link_to_href", - "code": "link_to((Unresolved Model).new.title, (Unresolved Model).new.url)", - "render_path": [ - { - "type": "template", - "name": "admin/trends/links/index", - "line": 49, - "file": "app/views/admin/trends/links/index.html.haml", - "rendered": { - "name": "admin/trends/links/_preview_card", - "file": "app/views/admin/trends/links/_preview_card.html.haml" - } - } - ], - "location": { - "type": "template", - "template": "admin/trends/links/_preview_card" - }, - "user_input": "(Unresolved Model).new.url", - "confidence": "Weak", - "cwe_id": [ - 79 - ], - "note": "" - } - ], - "updated": "2023-07-12 11:20:51 -0400", - "brakeman_version": "6.0.0" -} diff --git a/config/brakeman.yml b/config/brakeman.yml deleted file mode 100644 index 95ebc1386..000000000 --- a/config/brakeman.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -:skip_checks: - - CheckPermitAttributes diff --git a/config/database.yml b/config/database.yml deleted file mode 100644 index b995f2317..000000000 --- a/config/database.yml +++ /dev/null @@ -1,64 +0,0 @@ -default: &default - adapter: postgresql - pool: <%= ENV["DB_POOL"] || ENV['MAX_THREADS'] || 5 %> - timeout: 5000 - connect_timeout: 15 - encoding: unicode - sslmode: <%= ENV['DB_SSLMODE'] || "prefer" %> - application_name: '' - -development: - primary: - <<: *default - database: <%= ENV['DB_NAME'] || 'mastodon_development' %> - username: <%= ENV['DB_USER'] %> - password: <%= (ENV['DB_PASS'] || '').to_json %> - host: <%= ENV['DB_HOST'] %> - port: <%= ENV['DB_PORT'] %> - replica: - <<: *default - database: <%= ENV['DB_NAME'] || 'mastodon_development' %> - username: <%= ENV['DB_USER'] %> - password: <%= (ENV['DB_PASS'] || '').to_json %> - host: <%= ENV['DB_HOST'] %> - port: <%= ENV['DB_PORT'] %> - replica: true - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - primary: - <<: *default - database: <%= ENV['DB_NAME'] || 'mastodon' %>_test<%= ENV['TEST_ENV_NUMBER'] %> - username: <%= ENV['DB_USER'] %> - password: <%= (ENV['DB_PASS'] || '').to_json %> - host: <%= ENV['DB_HOST'] %> - port: <%= ENV['DB_PORT'] %> - replica: - <<: *default - database: <%= ENV['DB_NAME'] || 'mastodon' %>_test<%= ENV['TEST_ENV_NUMBER'] %> - username: <%= ENV['DB_USER'] %> - password: <%= (ENV['DB_PASS'] || '').to_json %> - host: <%= ENV['DB_HOST'] %> - port: <%= ENV['DB_PORT'] %> - replica: true - -production: - primary: - <<: *default - database: <%= ENV['DB_NAME'] || 'mastodon_production' %> - username: <%= ENV['DB_USER'] || 'mastodon' %> - password: <%= (ENV['DB_PASS'] || '').to_json %> - host: <%= ENV['DB_HOST'] || 'localhost' %> - port: <%= ENV['DB_PORT'] || 5432 %> - prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %> - replica: - <<: *default - database: <%= ENV['REPLICA_DB_NAME'] ||ENV['DB_NAME'] || 'mastodon_production' %> - username: <%= ENV['REPLICA_DB_USER'] ||ENV['DB_USER'] || 'mastodon' %> - password: <%= (ENV['REPLICA_DB_PASS'] || ENV['DB_PASS'] || '').to_json %> - host: <%= ENV['REPLICA_DB_HOST'] ||ENV['DB_HOST'] || 'localhost' %> - port: <%= ENV['REPLICA_DB_PORT'] ||ENV['DB_PORT'] || 5432 %> - prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %> - replica: true diff --git a/config/roles.yml b/config/roles.yml deleted file mode 100644 index f443250d1..000000000 --- a/config/roles.yml +++ /dev/null @@ -1,35 +0,0 @@ -moderator: - name: Moderator - position: 10 - permissions: - - view_dashboard - - view_audit_log - - manage_users - - manage_reports - - manage_taxonomies -admin: - name: Admin - position: 100 - permissions: - - view_dashboard - - view_audit_log - - manage_users - - manage_user_access - - delete_user_data - - manage_reports - - manage_taxonomies - - manage_federation - - manage_settings - - manage_blocks - - manage_appeals - - manage_rules - - manage_invites - - manage_announcements - - manage_custom_emojis - - manage_webhooks - - manage_roles -owner: - name: Owner - position: 1000 - permissions: - - administrator diff --git a/config/settings.yml b/config/settings.yml deleted file mode 100644 index c9c37a6f7..000000000 --- a/config/settings.yml +++ /dev/null @@ -1,56 +0,0 @@ -# This file contains default values, and does not need to be edited. All -# important settings can be changed from the admin interface. - -defaults: &defaults - site_title: 'Mastodon Glitch Edition' - site_short_description: '' - site_description: '' - site_extended_description: '' - site_terms: '' - site_contact_username: '' - site_contact_email: '' - registrations_mode: 'open' - profile_directory: true - closed_registrations_message: '' - timeline_preview: false - show_staff_badge: true - preview_sensitive_media: false - noindex: false - flavour: 'glitch' - skin: 'default' - trends: true - trends_as_landing_page: true - trendable_by_default: false - trending_status_cw: true - hide_followers_count: false - reserved_usernames: - - admin - - support - - help - - root - - webmaster - - administrator - - mod - - moderator - disallowed_hashtags: # space separated string or list of hashtags without the hash - bootstrap_timeline_accounts: '' - activity_api_enabled: true - peers_api_enabled: true - show_reblogs_in_public_timelines: false - show_replies_in_public_timelines: false - default_content_type: 'text/plain' - show_domain_blocks: 'disabled' - show_domain_blocks_rationale: 'disabled' - outgoing_spoilers: '' - require_invite_text: false - backups_retention_period: 7 - captcha_enabled: false - -development: - <<: *defaults - -test: - <<: *defaults - -production: - <<: *defaults diff --git a/ide-helper.js b/ide-helper.js deleted file mode 100644 index 9e645cb0e..000000000 --- a/ide-helper.js +++ /dev/null @@ -1,12 +0,0 @@ -/* global path */ -/* -Preferences | Languages & Frameworks | JavaScript | Webpack | webpack configuration file -jetbrains://WebStorm/settings?name=Languages+%26+Frameworks--JavaScript--Webpack -*/ -module.exports = { - resolve: { - alias: { - 'mastodon': path.resolve(__dirname, 'app/javascript/mastodon'), - }, - }, -}; diff --git a/lib/assets/.keep b/lib/assets/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/assets/wordmark.dark.css b/lib/assets/wordmark.dark.css deleted file mode 100644 index db3355f59..000000000 --- a/lib/assets/wordmark.dark.css +++ /dev/null @@ -1 +0,0 @@ -/* Not needed */ diff --git a/lib/assets/wordmark.dark.png b/lib/assets/wordmark.dark.png deleted file mode 100644 index 6772b3318..000000000 Binary files a/lib/assets/wordmark.dark.png and /dev/null differ diff --git a/lib/assets/wordmark.light.css b/lib/assets/wordmark.light.css deleted file mode 100644 index b8c9993fd..000000000 --- a/lib/assets/wordmark.light.css +++ /dev/null @@ -1,3 +0,0 @@ -use { - color: #000 !important; -} diff --git a/lib/assets/wordmark.light.png b/lib/assets/wordmark.light.png deleted file mode 100644 index 6d95088a4..000000000 Binary files a/lib/assets/wordmark.light.png and /dev/null differ