git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #142607 from talyz/discourse-public-path

discourse: Fix the public directory path reported by Discourse

commit1493854481b895f0f91d1af92a8f7bdf41424d87 authorRyan Mulligan <ryan@ryantm.com> dateFri 22 Oct 2021, 16:25 (5 years ago) parent8a4a0a71fb77e8
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