diff --git a/assets/javascripts/app/config.coffee.erb b/assets/javascripts/app/config.coffee.erb index a822f7e2..97e91ace 100644 --- a/assets/javascripts/app/config.coffee.erb +++ b/assets/javascripts/app/config.coffee.erb @@ -12,7 +12,7 @@ app.config = sentry_dsn: '<%= App.sentry_dsn %>' version: <%= Time.now.to_i %> release: <%= Time.now.utc.httpdate.to_json %> - mathml_stylesheet: '<%= App.cdn_origin %>/mathml.css' + mathml_stylesheet: '/mathml.css' favicon_spritesheet: '<%= image_path('sprites/docs.png') %>' service_worker_path: '/service-worker.js' service_worker_enabled: <%= App.environment == :production || ENV['ENABLE_SERVICE_WORKER'] == 'true' %> diff --git a/lib/app.rb b/lib/app.rb index c1198f86..917d1a03 100644 --- a/lib/app.rb +++ b/lib/app.rb @@ -20,8 +20,6 @@ class App < Sinatra::Application set :root, Pathname.new(File.expand_path('../..', __FILE__)) set :sprockets, Sprockets::Environment.new(root) - set :cdn_origin, '' - set :assets_prefix, 'assets' set :assets_path, File.join(public_folder, assets_prefix) set :assets_manifest_path, File.join(assets_path, 'manifest.json') @@ -75,9 +73,8 @@ class App < Sinatra::Application configure :production do set :static, false - set :cdn_origin, 'https://cdn.devdocs.io' set :docs_origin, '//docs.devdocs.io' - set :csp, "default-src 'self' *; script-src 'self' 'nonce-devdocs' https://cdn.devdocs.io https://www.google-analytics.com https://secure.gaug.es https://*.jquery.com; font-src 'none'; style-src 'self' 'unsafe-inline' *; img-src 'self' * data:;" + set :csp, "default-src 'self' *; script-src 'self' 'nonce-devdocs' https://www.google-analytics.com https://secure.gaug.es https://*.jquery.com; font-src 'none'; style-src 'self' 'unsafe-inline' *; img-src 'self' * data:;" use Rack::ConditionalGet use Rack::ETag @@ -102,7 +99,6 @@ class App < Sinatra::Application Sprockets::Helpers.configure do |config| config.digest = true - config.asset_host = 'cdn.devdocs.io' config.manifest = Sprockets::Manifest.new(sprockets, assets_manifest_path) end end @@ -202,7 +198,7 @@ class App < Sinatra::Application def service_worker_asset_urls @@service_worker_asset_urls ||= [ - javascript_path('application', asset_host: false), + javascript_path('application'), stylesheet_path('application'), image_path('sprites/docs.png'), image_path('sprites/docs@2x.png'), diff --git a/lib/tasks/docs.thor b/lib/tasks/docs.thor index 5ed3f5cf..4c41a1be 100644 --- a/lib/tasks/docs.thor +++ b/lib/tasks/docs.thor @@ -198,6 +198,7 @@ class DocsCLI < Thor puts '[S3] Done syncing.' # Upload packages to dl.devdocs.io (used by the "thor docs:download" command) + # TODO(MIGRATION): replace this with an S3 bucket upload. puts '[MaxCDN] Begin uploading.' Net::SFTP.start('ftp.devdocs-dl.devdocs.netdna-cdn.com', ENV['DEVDOCS_DL_USERNAME'], password: ENV['DEVDOCS_DL_PASSWORD']) do |sftp| docs.each do |doc| diff --git a/public/opensearch.xml b/public/opensearch.xml index 734c4249..9c78ffdb 100644 --- a/public/opensearch.xml +++ b/public/opensearch.xml @@ -4,8 +4,8 @@ Search API documentation devdocs - https://cdn.devdocs.io/favicon.ico - https://cdn.devdocs.io/images/icon-64.png + https://devdocs.io/favicon.ico + https://devdocs.io/images/icon-64.png UTF-8 https://devdocs.io diff --git a/views/index.erb b/views/index.erb index 4fb96153..ce0cb887 100644 --- a/views/index.erb +++ b/views/index.erb @@ -9,7 +9,7 @@ - + @@ -21,22 +21,22 @@ - - - - - - - - - - + + + + + + + + + + <%= stylesheet_tag 'application' %> <%= erb :app -%> -<%= javascript_tag 'application', asset_host: false %> +<%= javascript_tag 'application' %> <%= javascript_tag 'docs' %><% unless App.production? %> <%= javascript_tag 'debug' %><% end %> diff --git a/views/other.erb b/views/other.erb index 45cab943..abd8bc20 100644 --- a/views/other.erb +++ b/views/other.erb @@ -6,18 +6,18 @@ <% if doc_index_page? %><% else %><% end %> - + DevDocs<%= " — #{@doc['full_name']} documentation" if doc_index_page? %> - + <%= stylesheet_tag 'application' %> <%= erb :app -%> -<%= javascript_tag 'application', asset_host: false %><% unless App.production? %> +<%= javascript_tag 'application' %><% unless App.production? %> <%= javascript_tag 'debug' %><% end %>