git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit1fb77e822b87b0ca729c007e63166c7d2d38e947 authortalyz <kim.lindberger@gmail.com> dateFri 22 Oct 2021, 23:38 (5 years ago) parentf78d434
2 files changed+18
pkgs/servers/web-apps/discourse/default.nix+5 pkgs/servers/web-apps/discourse/public_dir_path.patch+13
pkgs/servers/web-apps/discourse/default.nix+5
@@ -266,6 +266,11 @@ let
266266
267267 # Make sure the notification email setting applies
268268 ./notification_email.patch
269+
270+ # Change the path to the public directory reported by Discourse
271+ # to its real path instead of the symlink in the store, since
272+ # the store path won't be matched by any nginx rules
273+ ./public_dir_path.patch
269274 ];
270275
271276 postPatch = ''
pkgs/servers/web-apps/discourse/public_dir_path.patchnew file+13
@@ -0,0 +1,13 @@
1+diff --git a/lib/file_store/local_store.rb b/lib/file_store/local_store.rb
2+index 25649532c0..614e062dc1 100644
3+--- a/lib/file_store/local_store.rb
4++++ b/lib/file_store/local_store.rb
5+@@ -88,7 +88,7 @@ module FileStore
6+ end
7+
8+ def public_dir
9+- File.join(Rails.root, "public")
10++ "/run/discourse/public"
11+ end
12+
13+ def tombstone_dir