Fix #104 Use config->prefix to set cookie path
This commit is dedicated to Michael Kozma, who is supporting me with Ğ1. Many thanks :-)
This commit is contained in:
parent
a2a578cdfe
commit
7c8ac69ffe
|
@ -3,6 +3,7 @@ package Lufi;
|
||||||
use Mojo::Base 'Mojolicious';
|
use Mojo::Base 'Mojolicious';
|
||||||
use Net::LDAP;
|
use Net::LDAP;
|
||||||
use Apache::Htpasswd;
|
use Apache::Htpasswd;
|
||||||
|
use Mojolicious::Sessions;
|
||||||
|
|
||||||
$ENV{MOJO_MAX_WEBSOCKET_SIZE} = 100485760; # 10 * 1024 * 1024 = 10MiB
|
$ENV{MOJO_MAX_WEBSOCKET_SIZE} = 100485760; # 10 * 1024 * 1024 = 10MiB
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ sub startup {
|
||||||
|
|
||||||
my $config = $self->plugin('Config' => {
|
my $config = $self->plugin('Config' => {
|
||||||
default => {
|
default => {
|
||||||
|
prefix => '/',
|
||||||
provisioning => 100,
|
provisioning => 100,
|
||||||
provis_step => 5,
|
provis_step => 5,
|
||||||
length => 10,
|
length => 10,
|
||||||
|
@ -153,6 +155,12 @@ sub startup {
|
||||||
mkdir($self->config('upload_dir'), 0700) unless (-d $self->config('upload_dir'));
|
mkdir($self->config('upload_dir'), 0700) unless (-d $self->config('upload_dir'));
|
||||||
die ('The upload directory ('.$self->config('upload_dir').') is not writable') unless (-w $self->config('upload_dir'));
|
die ('The upload directory ('.$self->config('upload_dir').') is not writable') unless (-w $self->config('upload_dir'));
|
||||||
|
|
||||||
|
# Configure sessions
|
||||||
|
my $sessions = Mojolicious::Sessions->new;
|
||||||
|
$sessions->cookie_name('lufi');
|
||||||
|
$sessions->cookie_path($self->config('prefix'));
|
||||||
|
$self->sessions($sessions);
|
||||||
|
|
||||||
# Default layout
|
# Default layout
|
||||||
$self->defaults(layout => 'default');
|
$self->defaults(layout => 'default');
|
||||||
|
|
||||||
|
|
|
@ -304,7 +304,7 @@ msgstr "Si us plau contacteu amb l'administrador: %1"
|
||||||
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
||||||
msgstr "Si us plau, espereu mentre obtenim el fitxer. Abans que el tingueu disponible primer cal descarregar i desxifrar tots els trossos."
|
msgstr "Si us plau, espereu mentre obtenim el fitxer. Abans que el tingueu disponible primer cal descarregar i desxifrar tots els trossos."
|
||||||
|
|
||||||
#: lib/Lufi.pm:191
|
#: lib/Lufi.pm:199
|
||||||
msgid "Please, check your credentials: unable to authenticate."
|
msgid "Please, check your credentials: unable to authenticate."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ msgstr "Compartiu fitxers amb total privacitat a %1"
|
||||||
msgid "Signin"
|
msgid "Signin"
|
||||||
msgstr "Autenticació"
|
msgstr "Autenticació"
|
||||||
|
|
||||||
#: lib/Lufi.pm:194
|
#: lib/Lufi.pm:202
|
||||||
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,7 @@ msgstr ""
|
||||||
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/Lufi.pm:191
|
#: lib/Lufi.pm:199
|
||||||
msgid "Please, check your credentials: unable to authenticate."
|
msgid "Please, check your credentials: unable to authenticate."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ msgstr ""
|
||||||
msgid "Signin"
|
msgid "Signin"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/Lufi.pm:194
|
#: lib/Lufi.pm:202
|
||||||
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,7 @@ msgstr "Veuillez contacter l’administrateur : %1"
|
||||||
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
||||||
msgstr "Veuillez patientez pendant la récupération de votre fichier. Nous devons d’abord récupérer et déchiffrer tous les fragments avant que vous puissiez le télécharger."
|
msgstr "Veuillez patientez pendant la récupération de votre fichier. Nous devons d’abord récupérer et déchiffrer tous les fragments avant que vous puissiez le télécharger."
|
||||||
|
|
||||||
#: lib/Lufi.pm:191
|
#: lib/Lufi.pm:199
|
||||||
msgid "Please, check your credentials: unable to authenticate."
|
msgid "Please, check your credentials: unable to authenticate."
|
||||||
msgstr "Veuillez vérifier vos identifiants : impossible de vous authentifier."
|
msgstr "Veuillez vérifier vos identifiants : impossible de vous authentifier."
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ msgstr "Partagez vos fichiers en toute confidentialité sur %1"
|
||||||
msgid "Signin"
|
msgid "Signin"
|
||||||
msgstr "Connexion"
|
msgstr "Connexion"
|
||||||
|
|
||||||
#: lib/Lufi.pm:194
|
#: lib/Lufi.pm:202
|
||||||
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
||||||
msgstr "Désolé, vous n’êtes pas autorisé à utiliser ce service. Contactez votre administrateur si vous pensez qu’il s’agit d’une erreur."
|
msgstr "Désolé, vous n’êtes pas autorisé à utiliser ce service. Contactez votre administrateur si vous pensez qu’il s’agit d’une erreur."
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,7 @@ msgstr "Contattare l'amministratore : %1"
|
||||||
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
||||||
msgstr "Attendere mentre otteniamo il vostro file. Dobbiamo prima scaricare e decifrare tutte le parti prima che possiate averlo."
|
msgstr "Attendere mentre otteniamo il vostro file. Dobbiamo prima scaricare e decifrare tutte le parti prima che possiate averlo."
|
||||||
|
|
||||||
#: lib/Lufi.pm:191
|
#: lib/Lufi.pm:199
|
||||||
msgid "Please, check your credentials: unable to authenticate."
|
msgid "Please, check your credentials: unable to authenticate."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ msgstr "Condividi tutti i file in totale riservatezza su %1"
|
||||||
msgid "Signin"
|
msgid "Signin"
|
||||||
msgstr "Autenticazione"
|
msgstr "Autenticazione"
|
||||||
|
|
||||||
#: lib/Lufi.pm:194
|
#: lib/Lufi.pm:202
|
||||||
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
@ -289,7 +289,7 @@ msgstr "Neem contact op met administrator: %1"
|
||||||
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
||||||
msgstr "Een ogenblik geduld, we pakken je bestand er bij. We moeten alle delen downloaden en decrypten voordat je het kan downloaden."
|
msgstr "Een ogenblik geduld, we pakken je bestand er bij. We moeten alle delen downloaden en decrypten voordat je het kan downloaden."
|
||||||
|
|
||||||
#: lib/Lufi.pm:191
|
#: lib/Lufi.pm:199
|
||||||
msgid "Please, check your credentials: unable to authenticate."
|
msgid "Please, check your credentials: unable to authenticate."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ msgstr "Deel je bestanden met volledige privacy op %1"
|
||||||
msgid "Signin"
|
msgid "Signin"
|
||||||
msgstr "Inloggen"
|
msgstr "Inloggen"
|
||||||
|
|
||||||
#: lib/Lufi.pm:194
|
#: lib/Lufi.pm:202
|
||||||
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,7 @@ msgstr "Mercés de contactar l’administrator : %1"
|
||||||
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
||||||
msgstr "Mercés d’esperar pendent la recuperacion de vòstre fichièr. Nos cal d’en primièr recuperar e deschifrar totes los fragaments abans que poscatz o telecargar."
|
msgstr "Mercés d’esperar pendent la recuperacion de vòstre fichièr. Nos cal d’en primièr recuperar e deschifrar totes los fragaments abans que poscatz o telecargar."
|
||||||
|
|
||||||
#: lib/Lufi.pm:191
|
#: lib/Lufi.pm:199
|
||||||
msgid "Please, check your credentials: unable to authenticate."
|
msgid "Please, check your credentials: unable to authenticate."
|
||||||
msgstr "Mercés de verificar vòstres identificants : impossible de vos autentificar."
|
msgstr "Mercés de verificar vòstres identificants : impossible de vos autentificar."
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ msgstr "Partejatz vòstres fichièrs en tota confidencialitat sus %1"
|
||||||
msgid "Signin"
|
msgid "Signin"
|
||||||
msgstr "Connexion"
|
msgstr "Connexion"
|
||||||
|
|
||||||
#: lib/Lufi.pm:194
|
#: lib/Lufi.pm:202
|
||||||
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
||||||
msgstr "O planhèm collèga, sètz pas autorizat a utilizar aqueste servici. Contactatz vòstre administrator sistèma se pensatz que i a un problèma."
|
msgstr "O planhèm collèga, sètz pas autorizat a utilizar aqueste servici. Contactatz vòstre administrator sistèma se pensatz que i a un problèma."
|
||||||
|
|
||||||
|
|
|
@ -311,7 +311,7 @@ msgstr "Contacte o administrador: %1"
|
||||||
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it."
|
||||||
msgstr "Por favor aguarde durante a recuperação do seu ficheiro. Primeiro devemos recuperar e descodificar todos os fragmentos e depois poderá descarregar o ficheiro."
|
msgstr "Por favor aguarde durante a recuperação do seu ficheiro. Primeiro devemos recuperar e descodificar todos os fragmentos e depois poderá descarregar o ficheiro."
|
||||||
|
|
||||||
#: lib/Lufi.pm:191
|
#: lib/Lufi.pm:199
|
||||||
msgid "Please, check your credentials: unable to authenticate."
|
msgid "Please, check your credentials: unable to authenticate."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ msgstr "Partilhe os seus ficheiros com toda a privacidade em %1"
|
||||||
msgid "Signin"
|
msgid "Signin"
|
||||||
msgstr "Conexão"
|
msgstr "Conexão"
|
||||||
|
|
||||||
#: lib/Lufi.pm:194
|
#: lib/Lufi.pm:202
|
||||||
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue