diff --git a/CHANGELOG b/CHANGELOG index 7cc6399..da507bb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,7 +5,7 @@ Revision history for Lufi - Use Weblate instead of Zanata for translations (https://weblate.framasoft.org/projects/lufi/development/) - Add config API endpoint (#183) - Show latest tag and commit of the instance in about page and config API endpoint (#174) - - Add support for Swift object storage + - Add support for Swift object storage (EXPERIMENTAL) 0.04.6 2019-11-07 - Now can send large files (>2Gio) while using a DB other than SQLite (#165) diff --git a/lib/Lufi.pm b/lib/Lufi.pm index 832cf31..4f961f3 100644 --- a/lib/Lufi.pm +++ b/lib/Lufi.pm @@ -69,6 +69,7 @@ sub startup { # Now helpers has been loaded, time to check Swift container if ($config->{swift}) { $self->check_swift_container(); + $self->log->info('EXPERIMENTAL Using Swift object storage'); } # Recurrent task diff --git a/lib/Lufi/Command/copyFilesToSwift.pm b/lib/Lufi/Command/copyFilesToSwift.pm index 91b7564..860538e 100644 --- a/lib/Lufi/Command/copyFilesToSwift.pm +++ b/lib/Lufi/Command/copyFilesToSwift.pm @@ -13,6 +13,10 @@ sub run { $c->app->check_swift_container(); my @dirs = glob(File::Spec->catdir($c->app->config('upload_dir'), '*')); + unless (scalar(@dirs)) { + say sprintf('The configured upload_dir (%s) seems to be empty. Is `upload_dir` configured in lufi.conf?', $c->app->config('upload_dir')); + exit 1; + } say sprintf('%d folders to upload to Swift (can\'t say how many files, or the total size, sorry). This can take some time.', scalar(@dirs)); print 'Do you want to continue? [Y/n] '; my $confirm = ; diff --git a/lufi.conf.template b/lufi.conf.template index e72c890..b7fd9fe 100644 --- a/lufi.conf.template +++ b/lufi.conf.template @@ -107,9 +107,14 @@ # optional, default is 'files' #upload_dir => 'files', + #!!!!!!!!!!!!!!! + # EXPERIMENTAL ! + #!!!!!!!!!!!!!!! # You can store files on Swift object storage (https://en.wikipedia.org/wiki/OpenStack#Swift) instead of filesystem # Please read https://metacpan.org/pod/Net::OpenStack::Swift#SYNOPSIS to know how to configure this setting # IMPORTANT: add a `container` key in it, to let Lufi know which container to use. This is not a regular Net::OpenStack::Swift setting, but Lufi need it. + # EXPERIMENTAL: if the upload or download of files are stucked, reload Lufi and create a cron task to reload Lufi once a day + # You can copy Lufi files to Swift object storage by launching the command `carton exec script/lufi copyFilesToSwift` (can take a long time) # optional, no default #swift => { # auth_url => 'https://auth-endpoint-url/v2.0',