Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
This commit is contained in:
@ -1,10 +1,30 @@
|
||||
import './web_push_notifications';
|
||||
|
||||
function fetchRoot() {
|
||||
return fetch('/', { credentials: 'include' });
|
||||
}
|
||||
|
||||
// Cause a new version of a registered Service Worker to replace an existing one
|
||||
// that is already installed, and replace the currently active worker on open pages.
|
||||
self.addEventListener('install', function(event) {
|
||||
event.waitUntil(self.skipWaiting());
|
||||
const promises = Promise.all([caches.open('mastodon-web'), fetchRoot()]);
|
||||
const asyncAdd = promises.then(([cache, root]) => cache.put('/', root));
|
||||
|
||||
event.waitUntil(asyncAdd);
|
||||
});
|
||||
self.addEventListener('activate', function(event) {
|
||||
event.waitUntil(self.clients.claim());
|
||||
});
|
||||
self.addEventListener('fetch', function(event) {
|
||||
const url = new URL(event.request.url);
|
||||
|
||||
if (url.pathname.startsWith('/web/')) {
|
||||
event.respondWith(fetchRoot().then(response => {
|
||||
if (response.ok) {
|
||||
return response;
|
||||
}
|
||||
|
||||
throw null;
|
||||
}).catch(() => caches.match('/')));
|
||||
}
|
||||
});
|
||||
|
@ -440,6 +440,7 @@
|
||||
text-align: center;
|
||||
padding: 60px 0;
|
||||
padding-top: 55px;
|
||||
margin: 0 auto;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ module Remotable
|
||||
send("#{attachment_name}_file_name=", basename + extname)
|
||||
|
||||
self[attribute_name] = url if has_attribute?(attribute_name)
|
||||
rescue HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError, Addressable::URI::InvalidURIError => e
|
||||
rescue HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError, Addressable::URI::InvalidURIError, Mastodon::HostValidationError => e
|
||||
Rails.logger.debug "Error fetching remote #{attachment_name}: #{e}"
|
||||
nil
|
||||
end
|
||||
|
@ -49,7 +49,7 @@ class BackupService < BaseService
|
||||
end
|
||||
end
|
||||
|
||||
archive_filename = ['archive', Time.now.utc.strftime('%Y%m%d%H%M%S'), SecureRandom.hex(2)].join('-') + '.tar.gz'
|
||||
archive_filename = ['archive', Time.now.utc.strftime('%Y%m%d%H%M%S'), SecureRandom.hex(16)].join('-') + '.tar.gz'
|
||||
|
||||
@backup.dump = ActionDispatch::Http::UploadedFile.new(tempfile: tmp_file, filename: archive_filename)
|
||||
@backup.processed = true
|
||||
|
Reference in New Issue
Block a user