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