about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-08-24 04:33:27 +0200
committerGitHub <noreply@github.com>2018-08-24 04:33:27 +0200
commita2cabf3f4af9271d8bfdb13c1ae2b7a8b4e6fb88 (patch)
treeb47c76434e800374b628a1dfeff7b8475dbbc006 /app/controllers
parent23752639b20abd26eefb199172da9fc3ceae172e (diff)
Add admin custom CSS setting (#8399)
Fix #3894
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/settings_controller.rb1
-rw-r--r--app/controllers/custom_css_controller.rb10
2 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb
index 23e0444d0..7d38f76ae 100644
--- a/app/controllers/admin/settings_controller.rb
+++ b/app/controllers/admin/settings_controller.rb
@@ -24,6 +24,7 @@ module Admin
       peers_api_enabled
       show_known_fediverse_at_about_page
       preview_sensitive_media
+      custom_css
     ).freeze
 
     BOOLEAN_SETTINGS = %w(
diff --git a/app/controllers/custom_css_controller.rb b/app/controllers/custom_css_controller.rb
new file mode 100644
index 000000000..31e501609
--- /dev/null
+++ b/app/controllers/custom_css_controller.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+class CustomCssController < ApplicationController
+  before_action :set_cache_headers
+
+  def show
+    skip_session!
+    render plain: Setting.custom_css || '', content_type: 'text/css'
+  end
+end