Assetify favicons and set correct url scheme
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 671 B After Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -41,7 +41,7 @@ module Post::ImageStore::Local2
|
||||
|
||||
def preview_url
|
||||
if status == "deleted"
|
||||
ApplicationController.helpers.image_path 'deleted-preview.png', host: base_url(:assets)
|
||||
ApplicationController.helpers.image_url 'deleted-preview.png'
|
||||
elsif image?
|
||||
"#{base_url :assets}/data/preview/#{file_hierarchy}/#{md5}.jpg"
|
||||
else
|
||||
|
@ -54,8 +54,9 @@ module Moebooru
|
||||
# This one is never reliable because there's no standard controlling this.
|
||||
config.action_dispatch.ip_spoofing_check = false
|
||||
|
||||
config.action_controller.asset_host = CONFIG[:file_hosts][:assets] if CONFIG[:file_hosts]
|
||||
config.action_mailer.default_url_options = { :host => CONFIG["server_host"] }
|
||||
scheme = "#{CONFIG['secure'] ? 'https' : 'http'}://"
|
||||
config.action_controller.asset_host = "#{scheme}#{CONFIG[:file_hosts][:assets]}" if CONFIG[:file_hosts]
|
||||
config.action_mailer.default_url_options = { :host => "#{scheme}#{CONFIG["server_host"]}" }
|
||||
|
||||
config.ssl_options = { hsts: false }
|
||||
|
||||
|
@ -4,13 +4,20 @@ class ExternalPost
|
||||
|
||||
class << self
|
||||
def get_service_icon(service)
|
||||
case service
|
||||
when CONFIG["local_image_service"]
|
||||
"/favicon.ico"
|
||||
when "gelbooru.com" # hack
|
||||
"/favicon-#{service}.png"
|
||||
filename =
|
||||
case service
|
||||
when CONFIG["local_image_service"]
|
||||
nil
|
||||
when "gelbooru.com" # hack
|
||||
"#{service}.png"
|
||||
else
|
||||
"#{service}.ico"
|
||||
end
|
||||
|
||||
if filename.present?
|
||||
ApplicationController.helpers.image_url "favicons/#{filename}"
|
||||
else
|
||||
"/favicon-#{service}.ico"
|
||||
"/favicon.ico"
|
||||
end
|
||||
end
|
||||
end
|
||||
|