summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortalyz <kim.lindberger@gmail.com>2021-10-22 23:38:53 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2021-10-22 23:29:50 +0000
commit23e841c5b724169f90d507f851f6bc3bc01315b1 (patch)
tree3d0a3a88dd8dc5dc85e2ce5901e1847fd6ab716b
parentMerge pull request #142572 from NixOS/backport-140343-to-release-21.05 (diff)
downloadnixpkgs-23e841c5b724169f90d507f851f6bc3bc01315b1.tar.gz
discourse: Fix the public directory path reported by Discourse
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. Fixes #142528. (cherry picked from commit 1fb77e822b87b0ca729c007e63166c7d2d38e947)
-rw-r--r--pkgs/servers/web-apps/discourse/default.nix5
-rw-r--r--pkgs/servers/web-apps/discourse/public_dir_path.patch13
2 files changed, 18 insertions, 0 deletions
diff --git a/pkgs/servers/web-apps/discourse/default.nix b/pkgs/servers/web-apps/discourse/default.nix
index 91ec15f15573..c032c79b1cce 100644
--- a/pkgs/servers/web-apps/discourse/default.nix
+++ b/pkgs/servers/web-apps/discourse/default.nix
@@ -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 = ''
diff --git a/pkgs/servers/web-apps/discourse/public_dir_path.patch b/pkgs/servers/web-apps/discourse/public_dir_path.patch
new file mode 100644
index 000000000000..0c6579736e22
--- /dev/null
+++ b/pkgs/servers/web-apps/discourse/public_dir_path.patch
@@ -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