Merge pull request #142615 from NixOS/backport-142607-to-release-21.05

[Backport release-21.05] discourse: Fix the public directory path reported by Discourse
This commit is contained in:
Ryan Mulligan 2021-10-22 20:18:00 -07:00 committed by GitHub
commit 605dc2af25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -265,6 +265,11 @@ let
# Make sure the notification email setting applies
./notification_email.patch
# Change the path to the public directory reported by Discourse
# to its real path instead of the symlink in the store, since
# the store path won't be matched by any nginx rules
./public_dir_path.patch
];
postPatch = ''

View File

@ -0,0 +1,13 @@
diff --git a/lib/file_store/local_store.rb b/lib/file_store/local_store.rb
index 25649532c0..614e062dc1 100644
--- a/lib/file_store/local_store.rb
+++ b/lib/file_store/local_store.rb
@@ -88,7 +88,7 @@ module FileStore
end
def public_dir
- File.join(Rails.root, "public")
+ "/run/discourse/public"
end
def tombstone_dir