diff --git a/.circleci/config.yml b/.circleci/config.yml index a373d685e..2a60ae684 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,8 @@ version: 2.1 orbs: - ruby: circleci/ruby@2.0.0 - node: circleci/node@5.0.3 + ruby: circleci/ruby@1.4.1 + node: circleci/node@5.0.1 executors: default: @@ -19,11 +19,11 @@ executors: DB_USER: root DISABLE_SIMPLECOV: true RAILS_ENV: test - - image: cimg/postgres:14.5 + - image: cimg/postgres:14.0 environment: POSTGRES_USER: root POSTGRES_HOST_AUTH_METHOD: trust - - image: cimg/redis:7.0 + - image: cimg/redis:6.2 commands: install-system-dependencies: @@ -45,7 +45,7 @@ commands: bundle config without 'development production' name: Set bundler settings - ruby/install-deps: - bundler-version: '2.3.26' + bundler-version: '2.3.8' key: ruby<< parameters.ruby-version >>-gems-v1 wait-db: steps: @@ -68,9 +68,7 @@ jobs: cache-version: v1 pkg-manager: yarn - run: - command: | - export NODE_OPTIONS=--openssl-legacy-provider - ./bin/rails assets:precompile + command: ./bin/rails assets:precompile name: Precompile assets - persist_to_workspace: paths: @@ -221,5 +219,5 @@ workflows: pkg-manager: yarn requires: - build - version: '16.18' + version: lts yarn-run: test:jest diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 425b86a6b..ac495e1c9 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,7 +9,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT} # The value is a comma-separated list of allowed domains 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/*" RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 01941a9d3..47497794f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "name": "Mastodon", "dockerComposeFile": "docker-compose.yml", "service": "app", - "workspaceFolder": "/mastodon", + "workspaceFolder": "/workspaces/mastodon", // Set *default* container specific settings.json values on container create. "settings": {}, @@ -20,7 +20,7 @@ "forwardPorts": [3000, 4000], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": ".devcontainer/post-create.sh", + "postCreateCommand": "bundle install --path vendor/bundle && yarn install && git checkout -- Gemfile.lock && ./bin/rails db:setup", // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode" diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 95f401379..46f42c454 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -11,9 +11,9 @@ services: # Use -bullseye variants on local arm64/Apple Silicon. VARIANT: '3.0-bullseye' # Optional Node.js version to install - NODE_VERSION: '16' + NODE_VERSION: '14' volumes: - - ..:/mastodon:cached + - ..:/workspaces/mastodon:cached environment: RAILS_ENV: development NODE_ENV: development diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh deleted file mode 100755 index 02f488f12..000000000 --- a/.devcontainer/post-create.sh +++ /dev/null @@ -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 diff --git a/.env.production.sample b/.env.production.sample index 0bf01bdc3..5eecb8bde 100644 --- a/.env.production.sample +++ b/.env.production.sample @@ -54,7 +54,7 @@ VAPID_PUBLIC_KEY= # Sending mail # ------------ -SMTP_SERVER= +SMTP_SERVER=smtp.mailgun.org SMTP_PORT=587 SMTP_LOGIN= SMTP_PASSWORD= diff --git a/.eslintrc.js b/.eslintrc.js index 03af2975b..e4ada6fe0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,6 @@ module.exports = { root: true, - extends: [ - 'eslint:recommended', - ], - env: { browser: true, node: true, @@ -68,8 +64,8 @@ module.exports = { eqeqeq: 'error', indent: ['warn', 2], 'jsx-quotes': ['error', 'prefer-single'], - 'no-case-declarations': 'off', 'no-catch-shadow': 'error', + 'no-cond-assign': 'error', 'no-console': [ '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-prototype-builtins': 'off', 'no-restricted-properties': [ 'error', { property: 'substring', message: 'Use .slice instead of .substring.' }, { property: 'substr', message: 'Use .slice instead of .substr.' }, ], - 'no-self-assign': 'off', 'no-trailing-spaces': 'warn', + 'no-undef': 'error', + 'no-unreachable': 'error', 'no-unused-expressions': 'error', 'no-unused-vars': [ 'error', @@ -98,7 +96,6 @@ module.exports = { ignoreRestSiblings: true, }, ], - 'no-useless-escape': 'off', 'object-curly-spacing': ['error', 'always'], 'padded-blocks': [ 'error', @@ -108,6 +105,7 @@ module.exports = { ], quotes: ['error', 'single'], semi: 'error', + strict: 'off', 'valid-typeof': 'error', 'react/jsx-boolean-value': 'error', diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml index 22f51f7bd..cdd08d2b0 100644 --- a/.github/ISSUE_TEMPLATE/1.bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -1,6 +1,6 @@ name: Bug Report description: If something isn't working as expected -labels: [bug] +labels: bug body: - type: markdown attributes: @@ -50,7 +50,7 @@ body: Google Chrome 106.0.5249.119 Firefox 105.0.3 - + etc... validations: required: true diff --git a/.github/ISSUE_TEMPLATE/2.feature_request.yml b/.github/ISSUE_TEMPLATE/2.feature_request.yml index 2cabcf61e..6626c2876 100644 --- a/.github/ISSUE_TEMPLATE/2.feature_request.yml +++ b/.github/ISSUE_TEMPLATE/2.feature_request.yml @@ -1,6 +1,6 @@ name: Feature Request description: I have a suggestion -labels: [suggestion] +labels: suggestion body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index f5d319652..fd62889d0 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,4 +2,4 @@ blank_issues_enabled: false contact_links: - name: GitHub Discussions url: https://github.com/mastodon/mastodon/discussions - about: Please ask and answer questions here. + about: Please ask and answer questions here. \ No newline at end of file diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index c161cbf3d..39fe1bd0b 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -18,7 +18,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: hadolint/hadolint-action@v3.0.0 - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 - uses: docker/login-action@v2 @@ -41,8 +40,7 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 - builder: ${{ steps.buildx.outputs.name }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=tootsuite/mastodon:edge + cache-to: type=inline diff --git a/.github/workflows/check-i18n.yml b/.github/workflows/check-i18n.yml index 9a7463060..a9d8ea2ea 100644 --- a/.github/workflows/check-i18n.yml +++ b/.github/workflows/check-i18n.yml @@ -25,7 +25,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: .ruby-version + ruby-version: '3.0' bundler-cache: true - name: Check locale file normalization run: bundle exec i18n-tasks check-normalized diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 8534501d4..000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -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}}' diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 319152e93..cd8cb12c4 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -53,18 +53,16 @@ jobs: - name: Set-up Node.js uses: actions/setup-node@v3 with: - node-version-file: .nvmrc + node-version: 16.x 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: echo "::add-matcher::.github/stylelint-matcher.json" ################################ # Run Linter against code base # diff --git a/.github/workflows/rebase-needed.yml b/.github/workflows/rebase-needed.yml deleted file mode 100644 index 6f903ee61..000000000 --- a/.github/workflows/rebase-needed.yml +++ /dev/null @@ -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. diff --git a/.github/workflows/test-chart.yml b/.github/workflows/test-chart.yml new file mode 100644 index 000000000..b9ff80855 --- /dev/null +++ b/.github/workflows/test-chart.yml @@ -0,0 +1,138 @@ +# This is a GitHub workflow defining a set of jobs with a set of steps. +# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions +# +name: Test chart + +on: + pull_request: + paths: + - "chart/**" + - "!**.md" + - ".github/workflows/test-chart.yml" + push: + paths: + - "chart/**" + - "!**.md" + - ".github/workflows/test-chart.yml" + branches-ignore: + - "dependabot/**" + workflow_dispatch: + +permissions: + contents: read + +defaults: + run: + working-directory: chart + +jobs: + lint-templates: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install dependencies (yamllint) + run: pip install yamllint + + - run: helm dependency update + + - name: helm lint + run: | + helm lint . \ + --values dev-values.yaml + + - name: helm template + run: | + helm template . \ + --values dev-values.yaml \ + --output-dir rendered-templates + + - name: yamllint (only on templates we manage) + run: | + rm -rf rendered-templates/mastodon/charts + + yamllint rendered-templates \ + --config-data "{rules: {indentation: {spaces: 2}, line-length: disable}}" + + # This job helps us validate that rendered templates are valid k8s resources + # against a k8s api-server, via "helm template --validate", but also that a + # basic configuration can be used to successfully startup mastodon. + # + test-install: + runs-on: ubuntu-22.04 + timeout-minutes: 15 + + strategy: + fail-fast: false + matrix: + include: + # k3s-channel reference: https://update.k3s.io/v1-release/channels + - k3s-channel: latest + - k3s-channel: stable + + # This represents the oldest configuration we test against. + # + # The k8s version chosen is based on the oldest still supported k8s + # version among two managed k8s services, GKE, EKS. + # - GKE: https://endoflife.date/google-kubernetes-engine + # - EKS: https://endoflife.date/amazon-eks + # + # The helm client's version can influence what helper functions is + # available for use in the templates, currently we need v3.6.0 or + # higher. + # + - k3s-channel: v1.21 + helm-version: v3.6.0 + + steps: + - uses: actions/checkout@v3 + + # This action starts a k8s cluster with NetworkPolicy enforcement and + # installs both kubectl and helm. + # + # ref: https://github.com/jupyterhub/action-k3s-helm#readme + # + - uses: jupyterhub/action-k3s-helm@v3 + with: + k3s-channel: ${{ matrix.k3s-channel }} + helm-version: ${{ matrix.helm-version }} + metrics-enabled: false + traefik-enabled: false + docker-enabled: false + + - run: helm dependency update + + # Validate rendered helm templates against the k8s api-server + - name: helm template --validate + run: | + helm template --validate mastodon . \ + --values dev-values.yaml + + - name: helm install + run: | + helm install mastodon . \ + --values dev-values.yaml \ + --timeout 10m + + # This actions provides a report about the state of the k8s cluster, + # providing logs etc on anything that has failed and workloads marked as + # important. + # + # ref: https://github.com/jupyterhub/action-k8s-namespace-report#readme + # + - name: Kubernetes namespace report + uses: jupyterhub/action-k8s-namespace-report@v1 + if: always() + with: + important-workloads: >- + deploy/mastodon-sidekiq + deploy/mastodon-streaming + deploy/mastodon-web + job/mastodon-assets-precompile + job/mastodon-chewy-upgrade + job/mastodon-create-admin + job/mastodon-db-migrate diff --git a/.gitignore b/.gitignore index 2bc8b18c8..7d76b8275 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,12 @@ /redis /elasticsearch +# ignore Helm charts +/chart/*.tgz + +# ignore Helm dependency charts +/chart/charts/*.tgz + # Ignore Apple files .DS_Store diff --git a/.nvmrc b/.nvmrc index b6a7d89c6..8351c1939 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 +14 diff --git a/.prettierignore b/.prettierignore index f72354a42..de7673eb6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -44,6 +44,9 @@ /redis /elasticsearch +# ignore Helm dependency charts +/chart/charts/*.tgz + # Ignore Apple files .DS_Store @@ -64,6 +67,9 @@ yarn-debug.log # Ignore Docker option files docker-compose.override.yml +# Ignore Helm files +/chart + # Ignore emoji map file /app/javascript/mastodon/features/emoji/emoji_map.json diff --git a/.rubocop.yml b/.rubocop.yml index 3c9223470..8dc2d1c47 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,18 +1,12 @@ require: - rubocop-rails - - rubocop-rspec - - rubocop-performance AllCops: - TargetRubyVersion: 2.7 - DisplayCopNames: true - DisplayStyleGuide: true - ExtraDetails: true - UseCache: true - CacheRootDirectory: tmp - NewCops: enable + TargetRubyVersion: 2.5 + NewCops: disable Exclude: - - db/schema.rb + - 'spec/**/*' + - 'db/**/*' - 'app/views/**/*' - 'config/**/*' - 'bin/*' @@ -73,57 +67,15 @@ Lint/UselessAccessModifier: - class_methods Metrics/AbcSize: - Max: 34 # RuboCop default 17 + Max: 115 Exclude: - - 'lib/**/*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! + - 'lib/mastodon/*_cli.rb' Metrics/BlockLength: Max: 55 Exclude: + - 'lib/tasks/**/*' - 'lib/mastodon/*_cli.rb' - CountComments: false - CountAsOne: [array, heredoc] - AllowedMethods: - - task - - namespace - - class_methods - - included Metrics/BlockNesting: Max: 3 @@ -133,144 +85,34 @@ Metrics/BlockNesting: Metrics/ClassLength: CountComments: false Max: 500 - CountAsOne: [array, heredoc] Exclude: - 'lib/mastodon/*_cli.rb' Metrics/CyclomaticComplexity: - Max: 12 + Max: 25 Exclude: - - 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! + - 'lib/mastodon/*_cli.rb' Layout/LineLength: - Max: 140 # RuboCop default 120 - AllowHeredoc: true AllowURI: true - IgnoreCopDirectives: true - AllowedPatterns: - # Allow comments to be long lines - - !ruby/regexp / \# .*$/ - - !ruby/regexp /^\# .*$/ - Exclude: - - lib/**/*cli*.rb - - db/*migrate/**/* - - db/seeds/**/* + Enabled: false Metrics/MethodLength: CountComments: false - CountAsOne: [array, heredoc] - Max: 25 # RuboCop default 10 + Max: 65 Exclude: - '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: CountComments: false Max: 200 - CountAsOne: [array, heredoc] Metrics/ParameterLists: - Max: 5 # RuboCop default 5 - CountKeywordArgs: true # RuboCop default 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 + Max: 5 + CountKeywordArgs: true Metrics/PerceivedComplexity: - Max: 16 # RuboCop default 8 - 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! + Max: 25 Naming/MemoizedInstanceVariableName: Enabled: false @@ -401,10 +243,6 @@ Style/HashTransformKeys: Style/HashTransformValues: Enabled: false -Style/HashSyntax: - Enabled: true - EnforcedStyle: ruby19_no_mixed_keys - Style/IfUnlessModifier: Enabled: false @@ -425,6 +263,9 @@ Style/PercentLiteralDelimiters: Style/PerlBackrefs: AutoCorrect: false +Style/RedundantAssignment: + Enabled: false + Style/RedundantFetchBlock: Enabled: true @@ -447,7 +288,7 @@ Style/RegexpLiteral: Enabled: false Style/RescueStandardError: - Enabled: true + Enabled: false Style/SignalException: Enabled: false @@ -466,14 +307,3 @@ Style/TrailingCommaInHashLiteral: Style/UnpackFirst: Enabled: false - -RSpec/ScatteredSetup: - Enabled: false -RSpec/ImplicitExpect: - Enabled: false -RSpec/NamedSubject: - Enabled: false -RSpec/DescribeClass: - Enabled: false -RSpec/LetSetup: - Enabled: false diff --git a/Aptfile b/Aptfile index 8f5bb72a2..a52eef4e1 100644 --- a/Aptfile +++ b/Aptfile @@ -1,4 +1,26 @@ ffmpeg +libicu[0-9][0-9] +libicu-dev +libidn12 +libidn-dev libpq-dev libxdamage1 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 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index ea5f64b0b..7cec57180 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai ## 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 -[version]: https://contributor-covenant.org/version/1/4/ +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/Dockerfile b/Dockerfile index ce7f4d718..cf311fef2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,99 +1,121 @@ -# syntax=docker/dockerfile:1.4 -# This needs to be bullseye-slim because the Ruby image is built on bullseye-slim -ARG NODE_VERSION="16.18.1-bullseye-slim" +FROM ubuntu:20.04 as build-dep -FROM ghcr.io/moritzheiber/ruby-jemalloc:3.0.4-slim as ruby -FROM node:${NODE_VERSION} as build +# Use bash for the shell +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.17.1" +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 python3 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" \ - PATH="${PATH}:/opt/ruby/bin" +# Install Ruby 3.0 +ENV RUBY_VER="3.0.4" +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/ -# hadolint ignore=DL3008 -RUN apt-get update && \ - apt-get install -y --no-install-recommends build-essential \ - ca-certificates \ - git \ - libicu-dev \ - 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 +RUN cd /opt/mastodon && \ + 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 -FROM node:${NODE_VERSION} +FROM ubuntu:20.04 -ARG UID="991" -ARG GID="991" +# Copy over all the langs needed for runtime +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"] - -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 && \ - echo "Etc/UTC" > /etc/localtime && \ - groupadd -g "${GID}" mastodon && \ - useradd -l -u "$UID" -g "${GID}" -m -d /opt/mastodon mastodon && \ - apt-get -y --no-install-recommends install whois \ - wget \ - procps \ - libssl1.1 \ - libpq5 \ - imagemagick \ - ffmpeg \ - libjemalloc2 \ - libicu67 \ - libidn11 \ - libyaml-0-2 \ - file \ - ca-certificates \ - tzdata \ - libreadline8 \ - tini && \ - ln -s /opt/mastodon /mastodon + echo "Etc/UTC" > /etc/localtime && \ + apt-get install -y --no-install-recommends whois wget && \ + addgroup --gid $GID mastodon && \ + useradd -m -u $UID -g $GID -d /opt/mastodon mastodon && \ + echo "mastodon:$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 24 | mkpasswd -s -m sha-256)" | chpasswd && \ + rm -rf /var/lib/apt/lists/* -# Note: no, cleaning here since Debian does this automatically -# See the file /etc/apt/apt.conf.d/docker-clean within the Docker image's filesystem +# Install mastodon runtime deps +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 --from=build /opt/mastodon /opt/mastodon +COPY --from=build-dep --chown=mastodon:mastodon /opt/mastodon /opt/mastodon -ENV RAILS_ENV="production" \ - NODE_ENV="production" \ - RAILS_SERVE_STATIC_FILES="true" \ - BIND="0.0.0.0" +# Run mastodon services in prod mode +ENV RAILS_ENV="production" +ENV NODE_ENV="production" + +# Tell rails to serve static files +ENV RAILS_SERVE_STATIC_FILES="true" +ENV BIND="0.0.0.0" # Set the run user USER mastodon -WORKDIR /opt/mastodon # Precompile assets -RUN OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile && \ - yarn cache clean +RUN cd ~ && \ + OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile && \ + yarn cache clean # Set the work dir and the container entry point +WORKDIR /opt/mastodon ENTRYPOINT ["/usr/bin/tini", "--"] EXPOSE 3000 4000 diff --git a/Gemfile b/Gemfile index bfbb14f08..355b7e43f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,9 @@ # frozen_string_literal: true 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 'puma', '~> 5.6' @@ -18,15 +18,15 @@ gem 'makara', '~> 0.5' gem 'pghero', '~> 2.8' gem 'dotenv-rails', '~> 2.8' -gem 'aws-sdk-s3', '~> 1.117', require: false -gem 'fog-core', '<= 2.4.0' +gem 'aws-sdk-s3', '~> 1.114', require: false +gem 'fog-core', '<= 2.1.0' gem 'fog-openstack', '~> 0.3', require: false gem 'kt-paperclip', '~> 7.1' gem 'blurhash', '~> 0.1' gem 'active_model_serializers', '~> 0.10' gem 'addressable', '~> 2.8' -gem 'bootsnap', '~> 1.15.0', require: false +gem 'bootsnap', '~> 1.13.0', require: false gem 'browser' gem 'charlock_holmes', '~> 0.7.7' gem 'chewy', '~> 7.2' @@ -55,7 +55,7 @@ gem 'redis-namespace', '~> 1.9' gem 'htmlentities', '~> 4.3' gem 'http', '~> 5.1' gem 'http_accept_language', '~> 2.1' -gem 'httplog', '~> 1.6.2' +gem 'httplog', '~> 1.6.0' gem 'idn-ruby', require: 'idn' gem 'kaminari', '~> 1.2' gem 'link_header', '~> 0.0' @@ -66,8 +66,7 @@ gem 'oj', '~> 3.13' gem 'ox', '~> 2.14' gem 'parslet' gem 'posix-spawn' -gem 'public_suffix', '~> 5.0' -gem 'pundit', '~> 2.3' +gem 'pundit', '~> 2.2' gem 'premailer-rails' gem 'rack-attack', '~> 6.6' gem 'rack-cors', '~> 1.1', require: 'rack/cors' @@ -79,7 +78,7 @@ gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock' gem 'rqrcode', '~> 2.1' gem 'ruby-progressbar', '~> 1.11' gem 'sanitize', '~> 6.0' -gem 'scenic', '~> 1.7' +gem 'scenic', '~> 1.6' gem 'sidekiq', '~> 6.5' gem 'sidekiq-scheduler', '~> 4.0' gem 'sidekiq-unique-jobs', '~> 7.1' @@ -87,7 +86,7 @@ gem 'sidekiq-bulk', '~> 0.2.0' gem 'simple-navigation', '~> 4.4' gem 'simple_form', '~> 5.1' gem 'sprockets-rails', '~> 3.4', require: 'sprockets/railtie' -gem 'stoplight', '~> 3.0.1' +gem 'stoplight', '~> 3.0.0' gem 'strong_migrations', '~> 0.7' gem 'tty-prompt', '~> 0.23', require: false gem 'twitter-text', '~> 3.1.0' @@ -107,10 +106,6 @@ group :development, :test do gem 'pry-byebug', '~> 3.10' gem 'pry-rails', '~> 0.3' 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 group :production, :test do @@ -118,17 +113,16 @@ group :production, :test do end group :test do - gem 'capybara', '~> 3.38' + gem 'capybara', '~> 3.37' gem 'climate_control', '~> 0.2' - gem 'faker', '~> 3.0' - gem 'json-schema', '~> 3.0' + gem 'faker', '~> 2.23' gem 'microformats', '~> 4.4' - gem 'rack-test', '~> 2.0' gem 'rails-controller-testing', '~> 1.0' - gem 'rspec_junit_formatter', '~> 0.6' gem 'rspec-sidekiq', '~> 3.1' gem 'simplecov', '~> 0.21', require: false gem 'webmock', '~> 3.18' + gem 'rspec_junit_formatter', '~> 0.6' + gem 'rack-test', '~> 2.0' end group :development do @@ -140,7 +134,9 @@ group :development do gem 'letter_opener', '~> 1.8' gem 'letter_opener_web', '~> 2.0' gem 'memory_profiler' - gem 'brakeman', '~> 5.4', require: false + gem 'rubocop', '~> 1.30', require: false + gem 'rubocop-rails', '~> 2.15', require: false + gem 'brakeman', '~> 5.3', require: false gem 'bundler-audit', '~> 0.9', require: false gem 'capistrano', '~> 3.17' diff --git a/Gemfile.lock b/Gemfile.lock index 00e8dcfd9..b6e09e5df 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -90,20 +90,20 @@ GEM attr_required (1.0.1) awrence (1.2.1) aws-eventstream (1.2.0) - aws-partitions (1.670.0) - aws-sdk-core (3.168.2) + aws-partitions (1.587.0) + aws-sdk-core (3.130.2) aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.5) - jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.60.0) - aws-sdk-core (~> 3, >= 3.165.0) + aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.117.2) - aws-sdk-core (~> 3, >= 3.165.0) + jmespath (~> 1.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-sigv4 (~> 1.4) - aws-sigv4 (1.5.2) + aws-sigv4 (1.5.0) aws-eventstream (~> 1, >= 1.0.2) bcrypt (3.1.17) better_errors (2.9.1) @@ -122,15 +122,15 @@ GEM debug_inspector (>= 0.0.1) blurhash (0.1.6) ffi (~> 1.14) - bootsnap (1.15.0) + bootsnap (1.13.0) msgpack (~> 1.2) - brakeman (5.4.0) + brakeman (5.3.1) browser (4.2.0) - brpoplpush-redis_script (0.1.3) + brpoplpush-redis_script (0.1.2) concurrent-ruby (~> 1.0, >= 1.0.5) - redis (>= 1.0, < 6) + redis (>= 1.0, <= 5.0) builder (3.2.4) - bullet (7.0.4) + bullet (7.0.3) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) bundler-audit (0.9.1) @@ -152,7 +152,7 @@ GEM sshkit (~> 1.3) capistrano-yarn (2.0.2) capistrano (~> 3.0) - capybara (3.38.0) + capybara (3.37.1) addressable matrix mini_mime (>= 0.1.3) @@ -182,7 +182,7 @@ GEM crack (0.4.5) rexml crass (1.0.6) - css_parser (1.12.0) + css_parser (1.7.1) addressable debug_inspector (1.0.0) devise (4.8.1) @@ -206,7 +206,7 @@ GEM docile (1.3.4) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - doorkeeper (5.6.2) + doorkeeper (5.6.0) railties (>= 5) dotenv (2.8.1) dotenv-rails (2.8.1) @@ -226,9 +226,9 @@ GEM erubi (1.11.0) et-orbi (1.2.7) tzinfo - excon (0.95.0) + excon (0.76.0) fabrication (2.30.0) - faker (3.0.0) + faker (2.23.0) i18n (>= 1.8.11, < 2) faraday (1.9.3) faraday-em_http (~> 1.0) @@ -271,7 +271,7 @@ GEM fog-core (>= 1.45, <= 2.1.0) fog-json (>= 1.0) ipaddress (>= 0.8) - formatador (0.3.0) + formatador (0.2.5) fugit (1.7.1) et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) @@ -299,7 +299,7 @@ GEM hiredis (0.6.3) hkdf (0.3.0) htmlentities (4.3.4) - http (5.1.1) + http (5.1.0) addressable (~> 2.8) http-cookie (~> 1.0) http-form_data (~> 2.2) @@ -309,7 +309,7 @@ GEM http-form_data (2.3.0) http_accept_language (2.1.1) httpclient (2.8.3) - httplog (1.6.2) + httplog (1.6.0) rack (>= 2.0) rainbow (>= 2.0.0) i18n (1.12.0) @@ -325,9 +325,9 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - idn-ruby (0.1.5) + idn-ruby (0.1.4) ipaddress (0.8.3) - jmespath (1.6.2) + jmespath (1.6.1) json (2.6.2) json-canonicalization (0.3.0) json-jwt (1.13.0) @@ -341,11 +341,9 @@ GEM multi_json (~> 1.15) rack (~> 2.2) rdf (~> 3.2, >= 3.2.9) - json-ld-preloaded (3.2.2) + json-ld-preloaded (3.2.0) json-ld (~> 3.2) rdf (~> 3.2) - json-schema (3.0.0) - addressable (>= 2.8) jsonapi-renderer (0.2.2) jwt (2.4.1) kaminari (1.2.2) @@ -384,7 +382,7 @@ GEM activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.19.1) + loofah (2.19.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) @@ -395,7 +393,7 @@ GEM mario-redis-lock (1.2.1) redis (>= 3.0.5) matrix (0.4.2) - memory_profiler (1.0.1) + memory_profiler (1.0.0) method_source (1.0.0) microformats (4.4.1) json (~> 2.2) @@ -406,19 +404,15 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.16.3) - msgpack (1.6.0) + msgpack (1.5.4) multi_json (1.15.0) multipart-post (2.1.1) net-ldap (0.17.1) - net-protocol (0.1.3) - timeout net-scp (4.0.0.rc1) net-ssh (>= 2.6.5, < 8.0.0) - net-smtp (0.3.3) - net-protocol net-ssh (7.0.1) nio4r (2.5.8) - nokogiri (1.13.10) + nokogiri (1.13.9) mini_portile2 (~> 2.8.0) racc (~> 1.4) nsa (0.2.8) @@ -426,7 +420,7 @@ GEM concurrent-ruby (~> 1.0, >= 1.0.2) sidekiq (>= 3.5) statsd-ruby (~> 1.4, >= 1.4.0) - oj (3.13.23) + oj (3.13.21) omniauth (1.9.2) hashie (>= 3.4.6) rack (>= 1.6.2, < 3) @@ -461,18 +455,17 @@ GEM parslet (2.0.0) pastel (0.8.0) tty-color (~> 0.5) - pg (1.4.5) + pg (1.4.3) pghero (2.8.3) activerecord (>= 5) - pkg-config (1.5.1) + pkg-config (1.4.9) posix-spawn (0.3.15) - premailer (1.18.0) + premailer (1.14.2) addressable - css_parser (>= 1.12.0) + css_parser (>= 1.6.0) htmlentities (>= 4.0.0) - premailer-rails (1.12.0) + premailer-rails (1.11.1) actionmailer (>= 3) - net-smtp premailer (~> 1.7, >= 1.7.9) private_address_check (0.5.0) pry (0.14.1) @@ -483,13 +476,13 @@ GEM pry (>= 0.13, < 0.15) pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (5.0.1) + public_suffix (5.0.0) puma (5.6.5) nio4r (~> 2.0) - pundit (2.3.0) + pundit (2.2.0) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.6.1) + racc (1.6.0) rack (2.2.4) rack-attack (6.6.1) rack (>= 1.0, < 3) @@ -527,8 +520,8 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.4.3) + loofah (~> 2.3) rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) @@ -544,15 +537,13 @@ GEM rake (13.0.6) rdf (3.2.9) link_header (~> 0.0, >= 0.0.8) - rdf-normalize (0.5.1) + rdf-normalize (0.5.0) rdf (~> 3.2) redcarpet (3.5.1) redis (4.5.1) redis-namespace (1.9.0) redis (>= 4) - redlock (1.3.2) - redis (>= 3.0.0, < 6.0) - regexp_parser (2.6.0) + regexp_parser (2.5.0) request_store (1.5.1) rack (>= 1.4) responders (3.0.1) @@ -587,27 +578,21 @@ GEM rspec-support (3.11.1) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.39.0) - json (~> 2.3) + rubocop (1.30.1) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + rubocop-ast (>= 1.18.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.23.0) + rubocop-ast (1.18.0) parser (>= 3.1.1.0) - rubocop-performance (1.15.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.17.2) + rubocop-rails (2.15.0) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.15.0) - rubocop (~> 1.33) + rubocop (>= 1.7.0, < 2.0) ruby-progressbar (1.11.0) ruby-saml (1.13.0) nokogiri (>= 1.10.5) @@ -620,12 +605,12 @@ GEM sanitize (6.0.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - scenic (1.7.0) + scenic (1.6.0) activerecord (>= 4.0.0) railties (>= 4.0.0) semantic_range (3.0.0) - sidekiq (6.5.8) - connection_pool (>= 2.2.5, < 3) + sidekiq (6.5.7) + connection_pool (>= 2.2.5) rack (~> 2.0) redis (>= 4.5.0, < 5) sidekiq-bulk (0.2.0) @@ -635,11 +620,10 @@ GEM rufus-scheduler (~> 3.2) sidekiq (>= 4, < 7) tilt (>= 1.4.0) - sidekiq-unique-jobs (7.1.29) + sidekiq-unique-jobs (7.1.27) brpoplpush-redis_script (> 0.1.1, <= 2.0.0) concurrent-ruby (~> 1.0, >= 1.0.5) - redis (< 5.0) - sidekiq (>= 5.0, < 7.0) + sidekiq (>= 5.0, < 8.0) thor (>= 0.20, < 3.0) simple-navigation (4.4.0) activesupport (>= 2.3.2) @@ -663,10 +647,9 @@ GEM sshkit (1.21.2) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) - stackprof (0.2.23) + stackprof (0.2.22) statsd-ruby (1.5.0) - stoplight (3.0.1) - redlock (~> 1.0) + stoplight (3.0.0) strong_migrations (0.7.9) activerecord (>= 5) swd (1.3.0) @@ -680,7 +663,6 @@ GEM climate_control (>= 0.0.3, < 1.0) thor (1.2.1) tilt (2.0.11) - timeout (0.3.0) tpm-key_attestation (0.11.0) bindata (~> 2.4) openssl (> 2.0, < 3.1) @@ -700,7 +682,7 @@ GEM unf (~> 0.1.0) tzinfo (2.0.5) concurrent-ruby (~> 1.0) - tzinfo-data (1.2022.7) + tzinfo-data (1.2022.4) tzinfo (>= 1.0.0) unf (0.1.4) unf_ext @@ -743,7 +725,7 @@ GEM xorcist (1.1.3) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.6) + zeitwerk (2.6.0) PLATFORMS ruby @@ -753,12 +735,12 @@ DEPENDENCIES active_record_query_trace (~> 1.8) addressable (~> 2.8) annotate (~> 3.2) - aws-sdk-s3 (~> 1.117) + aws-sdk-s3 (~> 1.114) better_errors (~> 2.9) binding_of_caller (~> 1.0) blurhash (~> 0.1) - bootsnap (~> 1.15.0) - brakeman (~> 5.4) + bootsnap (~> 1.13.0) + brakeman (~> 5.3) browser bullet (~> 7.0) bundler-audit (~> 0.9) @@ -766,7 +748,7 @@ DEPENDENCIES capistrano-rails (~> 1.6) capistrano-rbenv (~> 2.2) capistrano-yarn (~> 2.0) - capybara (~> 3.38) + capybara (~> 3.37) charlock_holmes (~> 0.7.7) chewy (~> 7.2) climate_control (~> 0.2) @@ -782,10 +764,10 @@ DEPENDENCIES dotenv-rails (~> 2.8) ed25519 (~> 1.3) fabrication (~> 2.30) - faker (~> 3.0) + faker (~> 2.23) fast_blank (~> 1.0) fastimage - fog-core (<= 2.4.0) + fog-core (<= 2.1.0) fog-openstack (~> 0.3) fuubar (~> 2.5) gitlab-omniauth-openid-connect (~> 0.10.0) @@ -794,12 +776,11 @@ DEPENDENCIES htmlentities (~> 4.3) http (~> 5.1) http_accept_language (~> 2.1) - httplog (~> 1.6.2) + httplog (~> 1.6.0) i18n-tasks (~> 1.0) idn-ruby json-ld json-ld-preloaded (~> 3.2) - json-schema (~> 3.0) kaminari (~> 1.2) kt-paperclip (~> 7.1) letter_opener (~> 1.8) @@ -823,15 +804,14 @@ DEPENDENCIES parslet pg (~> 1.4) pghero (~> 2.8) - pkg-config (~> 1.5) + pkg-config (~> 1.4) posix-spawn premailer-rails private_address_check (~> 0.5) pry-byebug (~> 3.10) pry-rails (~> 0.3) - public_suffix (~> 5.0) puma (~> 5.6) - pundit (~> 2.3) + pundit (~> 2.2) rack (~> 2.2.4) rack-attack (~> 6.6) rack-cors (~> 1.1) @@ -849,13 +829,11 @@ DEPENDENCIES rspec-rails (~> 5.1) rspec-sidekiq (~> 3.1) rspec_junit_formatter (~> 0.6) - rubocop - rubocop-performance - rubocop-rails - rubocop-rspec + rubocop (~> 1.30) + rubocop-rails (~> 2.15) ruby-progressbar (~> 1.11) sanitize (~> 6.0) - scenic (~> 1.7) + scenic (~> 1.6) sidekiq (~> 6.5) sidekiq-bulk (~> 0.2.0) sidekiq-scheduler (~> 4.0) @@ -866,7 +844,7 @@ DEPENDENCIES sprockets (~> 3.7.2) sprockets-rails (~> 3.4) stackprof - stoplight (~> 3.0.1) + stoplight (~> 3.0.0) strong_migrations (~> 0.7) thor (~> 1.2) tty-prompt (~> 0.23) @@ -877,9 +855,3 @@ DEPENDENCIES webpacker (~> 5.4) webpush! xorcist (~> 1.1) - -RUBY VERSION - ruby 3.0.4p208 - -BUNDLED WITH - 2.2.33 diff --git a/README.md b/README.md index ddd5e2c64..5019bd097 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,8 @@ Mastodon acts as an OAuth2 provider, so 3rd party apps can use the REST and Stre - **PostgreSQL** 9.5+ - **Redis** 4+ -- **Ruby** 2.7+ -- **Node.js** 16+ +- **Ruby** 2.6+ +- **Node.js** 14+ 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. diff --git a/Vagrantfile b/Vagrantfile index 880cc1849..3e73d9e47 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -3,14 +3,16 @@ ENV["PORT"] ||= "3000" -$provisionA = <