~cytrogen/masto-fe

9f520d3608917c20cf6ebd69d5426061c3976abc — tobi 1 year, 3 months ago 86fa133
[chore] Remove more unused files (#3)

Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/3
Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Co-committed-by: tobi <tobi.smethurst@protonmail.com>
31 files changed, 0 insertions(+), 516 deletions(-)

D .buildpacks
D .env.test
D .foreman
D .gitattributes
D .husky/pre-commit
D .profile
D .rspec
D .slugignore
D bin/bundle
D bin/heroku-web
D bin/rails
D bin/rake
D bin/retry
D bin/rspec
D bin/setup
D bin/tootctl
D bin/update
D bin/webpack
D bin/webpack-dev-server
D bin/yarn
D config/brakeman.ignore
D config/brakeman.yml
D config/database.yml
D config/roles.yml
D config/settings.yml
D ide-helper.js
D lib/assets/.keep
D lib/assets/wordmark.dark.css
D lib/assets/wordmark.dark.png
D lib/assets/wordmark.light.css
D lib/assets/wordmark.light.png
D .buildpacks => .buildpacks +0 -3
@@ 1,3 0,0 @@
https://github.com/heroku/heroku-buildpack-apt
https://github.com/Scalingo/ffmpeg-buildpack
https://github.com/Scalingo/ruby-buildpack

D .env.test => .env.test +0 -5
@@ 1,5 0,0 @@
# Node.js
NODE_ENV=tests
# Federation
LOCAL_DOMAIN=cb6e6126.ngrok.io
LOCAL_HTTPS=true

D .foreman => .foreman +0 -1
@@ 1,1 0,0 @@
procfile: Procfile.dev

D .gitattributes => .gitattributes +0 -14
@@ 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

D .husky/pre-commit => .husky/pre-commit +0 -4
@@ 1,4 0,0 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged

D .profile => .profile +0 -1
@@ 1,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

D .rspec => .rspec +0 -3
@@ 1,3 0,0 @@
--color
--require spec_helper
--format Fuubar

D .slugignore => .slugignore +0 -4
@@ 1,4 0,0 @@
node_modules/
.cache/
docs/
spec/

D bin/bundle => bin/bundle +0 -3
@@ 1,3 0,0 @@
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
load Gem.bin_path('bundler', 'bundle')

D bin/heroku-web => bin/heroku-web +0 -2
@@ 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

D bin/rails => bin/rails +0 -4
@@ 1,4 0,0 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'

D bin/rake => bin/rake +0 -4
@@ 1,4 0,0 @@
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
Rake.application.run

D bin/retry => bin/retry +0 -46
@@ 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 <contact@travis-ci.org>
#
# 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 $@

D bin/rspec => bin/rspec +0 -17
@@ 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")

D bin/setup => bin/setup +0 -36
@@ 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

D bin/tootctl => bin/tootctl +0 -13
@@ 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

D bin/update => bin/update +0 -31
@@ 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

D bin/webpack => bin/webpack +0 -19
@@ 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

D bin/webpack-dev-server => bin/webpack-dev-server +0 -19
@@ 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

D bin/yarn => bin/yarn +0 -17
@@ 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

D config/brakeman.ignore => config/brakeman.ignore +0 -96
@@ 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"
}

D config/brakeman.yml => config/brakeman.yml +0 -3
@@ 1,3 0,0 @@
---
:skip_checks:
  - CheckPermitAttributes

D config/database.yml => config/database.yml +0 -64
@@ 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

D config/roles.yml => config/roles.yml +0 -35
@@ 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

D config/settings.yml => config/settings.yml +0 -56
@@ 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

D ide-helper.js => ide-helper.js +0 -12
@@ 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'),
    },
  },
};

D lib/assets/.keep => lib/assets/.keep +0 -0
D lib/assets/wordmark.dark.css => lib/assets/wordmark.dark.css +0 -1
@@ 1,1 0,0 @@
/* Not needed */

D lib/assets/wordmark.dark.png => lib/assets/wordmark.dark.png +0 -0
D lib/assets/wordmark.light.css => lib/assets/wordmark.light.css +0 -3
@@ 1,3 0,0 @@
use {
  color: #000 !important;
}

D lib/assets/wordmark.light.png => lib/assets/wordmark.light.png +0 -0