]> cat aescling's git repositories - mastodon.git/commitdiff
Allow access to the instance through subdomains of glitch.cat.family
authorsingle-right-quote <34298117+single-right-quote@users.noreply.github.com>
Wed, 1 Sep 2021 00:19:01 +0000 (00:19 +0000)
committersingle-right-quote <34298117+single-right-quote@users.noreply.github.com>
Wed, 1 Sep 2021 00:30:27 +0000 (00:30 +0000)
Rails 6 forces you to whitelist what domain names an application
may be accessed from. while it is possible to supply a regular
expression, it is not clear how to do this when mastodon parses the
environment variable you supply the regex from. meanwhile, disabling
whitelisting entirely DOES work

this is theoretically less secure; if we can find a way to supply a
regex, that would be preferable.

--- yr cat

config/initializers/1_hosts.rb

index 6ff0845c4665cfbd691991a0decb9f8ae0ae6fae..cbb1c3deea29a5f9fe7aeffc0e8a769dbad08e2f 100644 (file)
@@ -32,5 +32,10 @@ Rails.application.configure do
     config.hosts << web_host if web_host.present?
     config.hosts.concat(alternate_domains) if alternate_domains.present?
     config.host_authorization = { exclude: ->(request) { request.path == '/health' } }
+
+    # actually, don't whitelist at all
+    # it may be possible to use regexes in ALTERNATE_DOMAINS but it seems not to work
+    #     ---yr cat
+    config.hosts.clear
   end
 end