|
|
@ -16,7 +16,6 @@ use Digest::HMAC_SHA1 qw(hmac_sha1); |
|
|
|
use MIME::Base64; |
|
|
|
use MIME::Base64; |
|
|
|
use File::stat; |
|
|
|
use File::stat; |
|
|
|
use File::Basename; |
|
|
|
use File::Basename; |
|
|
|
use Etherpad::API; |
|
|
|
|
|
|
|
use Session::Token; |
|
|
|
use Session::Token; |
|
|
|
use Email::Valid; |
|
|
|
use Email::Valid; |
|
|
|
use Protocol::SocketIO::Handshake; |
|
|
|
use Protocol::SocketIO::Handshake; |
|
|
@ -42,7 +41,10 @@ foreach my $dir (qw/assets/){ |
|
|
|
|
|
|
|
|
|
|
|
# Create etherpad api client if enabled |
|
|
|
# Create etherpad api client if enabled |
|
|
|
our $ec = undef; |
|
|
|
our $ec = undef; |
|
|
|
|
|
|
|
my $etherpad = eval { require Etherpad::API }; |
|
|
|
if ($config->{'etherpad.uri'} =~ m/https?:\/\/.*/ && $config->{'etherpad.api_key'} ne ''){ |
|
|
|
if ($config->{'etherpad.uri'} =~ m/https?:\/\/.*/ && $config->{'etherpad.api_key'} ne ''){ |
|
|
|
|
|
|
|
if ($etherpad){ |
|
|
|
|
|
|
|
import Etherpad::API; |
|
|
|
$ec = Etherpad::API->new({ |
|
|
|
$ec = Etherpad::API->new({ |
|
|
|
url => $config->{'etherpad.uri'}, |
|
|
|
url => $config->{'etherpad.uri'}, |
|
|
|
apikey => $config->{'etherpad.api_key'} |
|
|
|
apikey => $config->{'etherpad.api_key'} |
|
|
@ -51,6 +53,10 @@ if ($config->{'etherpad.uri'} =~ m/https?:\/\/.*/ && $config->{'etherpad.api_key |
|
|
|
app->log->info("Can't connect to Etherpad-Lite API, check your API key and uri"); |
|
|
|
app->log->info("Can't connect to Etherpad-Lite API, check your API key and uri"); |
|
|
|
$ec = undef; |
|
|
|
$ec = undef; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
app->log->info("Etherpad::API not found, disabling Etherpad-Lite support"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Global error check |
|
|
|
# Global error check |
|
|
|