diff --git a/conf/vroom.conf.sample b/conf/vroom.conf.sample index be163b8..be5da27 100644 --- a/conf/vroom.conf.sample +++ b/conf/vroom.conf.sample @@ -41,8 +41,11 @@ chromeExtensionId => 'ecicdpoejfllflombfanbhfpgcimjddn', # For etherpad integration, set the etherpad base url # and API Key -etherpadUri => '', -etherpadApiKey => '', +#etherpadUri => '', +#etherpadApiKey => '', +# You can also set the base domain common to both vroom and etherpad +# For example, if you use vroom.example.com and pad.example.com, the base domain is example.com +#etherpadBaseDomaine => '', # Various sendmail => '/sbin/sendmail' diff --git a/public/vroom.pl b/public/vroom.pl index c06d830..6a2c174 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -126,6 +126,7 @@ our $config = plugin Config => { chromeExtensionId => 'ecicdpoejfllflombfanbhfpgcimjddn', etherpadUri => '', etherpadApiKey => '', + etherpadBaseDomain => '', sendmail => '/sbin/sendmail' } }; @@ -862,7 +863,11 @@ get '/(*room)' => sub { $self->session($room)->{etherpadAuthorId} = $id; my $etherpadSession = $ec->create_session($data->{etherpad_group}, $id, time + 86400); $self->session($room)->{etherpadSessionId} = $etherpadSession; - $self->cookie(sessionID => $etherpadSession); + my $etherpadCookieParam = {}; + if ($config->{etherpadBaseDomain} && $config->{etherpadBaseDomain} ne ''){ + $etherpadCookieParam->{domain} = $config->{etherpadBaseDomain}; + } + $self->cookie(sessionID => $etherpadSession, $etherpadCookieParam); } # Short life cookie to negociate a session with the signaling server $self->cookie(vroomsession => encode_base64($self->session('name') . ':' . $data->{name} . ':' . $data->{token}, ''), {expires => time + 60, path => '/'});