A platform for community discussion. Free, open, simple.
DEV: Drop landlock problem-check (#42059)
David Taylor8b552f97d29f
diff --git a/app/models/problem_check.rb b/app/models/problem_check.rbindex 6b39535cc72..becaa627c31 100644--- a/app/models/problem_check.rb+++ b/app/models/problem_check.rb@@ -80,7 +80,6 @@ class ProblemCheckProblemCheck::GroupEmailCredentials,ProblemCheck::HostNames,ProblemCheck::ImageMagick,- ProblemCheck::Landlock,ProblemCheck::MissingAwsSnsTopicArn,ProblemCheck::MissingMailgunApiKey,ProblemCheck::OutOfDateThemes,diff --git a/app/services/problem_check/landlock.rb b/app/services/problem_check/landlock.rbdeleted file mode 100644index 316249be097..00000000000--- a/app/services/problem_check/landlock.rb+++ /dev/null@@ -1,14 +0,0 @@-# frozen_string_literal: true--require "discourse/safe_exec"--class ProblemCheck::Landlock < ProblemCheck- self.priority = "high"-- def call- return no_problem if !Rails.env.production?- return no_problem if Discourse::SafeExec.landlock_supported?-- problem- end-enddiff --git a/spec/services/problem_check/landlock_spec.rb b/spec/services/problem_check/landlock_spec.rbdeleted file mode 100644index 049afc8a24a..00000000000--- a/spec/services/problem_check/landlock_spec.rb+++ /dev/null@@ -1,39 +0,0 @@-# frozen_string_literal: true--RSpec.describe ProblemCheck::Landlock do- subject(:check) { described_class.new }-- describe ".call" do- before do- Rails.stubs(env: ActiveSupport::StringInquirer.new(environment))- Discourse::SafeExec.stubs(landlock_supported?: supported)- end-- context "when running in production" do- let(:environment) { "production" }-- context "when Landlock is supported" do- let(:supported) { true }-- it { expect(check).to be_chill_about_it }- end-- context "when Landlock is not supported" do- let(:supported) { false }-- it do- expect(check).to have_a_problem.with_priority("high").with_message(- "Landlock sandboxing is unavailable in this hosting environment, so external commands run without filesystem and network isolation. This is an important security protection that should not be missing in production. Use a Linux kernel with Landlock support (5.13 or later) to restore it.",- )- end- end- end-- context "when not running in production" do- let(:environment) { "development" }- let(:supported) { false }-- it { expect(check).to be_chill_about_it }- end- end-end