forked from xfalcox/discourse-backups-to-dropbox
-
Notifications
You must be signed in to change notification settings - Fork 1
/
plugin.rb
34 lines (29 loc) · 1.3 KB
/
plugin.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# name: discourse-sync-to-dropbox
# about: Backups discourse backups in dropbox
# version: 0.0.2
# authors: Rafael dos Santos Silva <[email protected]>
# url: https://github.com/xfalcox/discourse-backups-to-dropbox
gem 'public_suffix', '2.0.5', {require: false }
gem 'domain_name', '0.5.20170404', {require: false }
gem 'addressable', '2.5.1', {require: false }
gem 'http_parser.rb', '0.6.0', {require: false }
gem 'http-cookie', '1.0.3', {require: false }
gem 'http-form_data', '1.0.1', {require: false }
gem 'http', '2.0.3', {require: false }
gem 'dropbox-sdk-v2', '0.0.3', { require: false }
require 'dropbox'
require 'sidekiq'
enabled_site_setting :discourse_sync_to_dropbox_enabled
after_initialize do
load File.expand_path("../app/jobs/regular/sync_backups_to_dropbox.rb", __FILE__)
load File.expand_path("../lib/dropbox_synchronizer.rb", __FILE__)
load File.expand_path("../lib/dropbox_downloader.rb", __FILE__)
load File.expand_path("../app/controllers/downloaders_controller.rb", __FILE__)
DiscourseEvent.on(:backup_created) do
Jobs.enqueue(:sync_backups_to_dropbox)
end
Discourse::Application.routes.append do
get "/admin/plugins/discourse-sync-to-dropbox/downloader" => "downloaders#index"
put "/admin/plugins/discourse-sync-to-dropbox/downloader/:file_id" => "downloaders#create"
end
end