diff --git a/AUTHORS.md b/AUTHORS.md index c252548..6fa6d7a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -13,3 +13,4 @@ * Quentin Pagès (occitan translation) * Yann Le Brech (htpasswd file support) * Jéssica Da Cunha (portuguese translation) +* Ilker Kulgu (fix IE11 compatibility, Dutch translation) diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..060c1eb --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,22 @@ +Revision history for Lufi + +0.02 2017-09-13 + - Database abstraction layer + - PostgreSQL support + - IE 11 and Edge support + - Fix encoding error (#83) + - Htpassword authentication support + - Ability to add a password to a file + - Portuguese translation + - Catalan translation + - Dutch translation + - IE 11 support + - Deleting files from "My files" is now done with Ajax (#23) + - Allow bulk files deletion from "My files" (#24) + - Bugfixes + +0.01 2017-01-09 + - Upload files + - Download files + - Preview files in browser depending on mimetype (images and videos) + - LDAP authentication support diff --git a/Makefile b/Makefile index 76d377b..d56ddf4 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,27 @@ -EXTRACTFILES=utilities/locales_files.txt +EXTRACTDIR=-D lib -D themes/default/templates EN=themes/default/lib/Lufi/I18N/en.po FR=themes/default/lib/Lufi/I18N/fr.po IT=themes/default/lib/Lufi/I18N/it.po OC=themes/default/lib/Lufi/I18N/oc.po +CA=themes/default/lib/Lufi/I18N/ca.po +PT=themes/default/lib/Lufi/I18N/pt.po +NL=themes/default/lib/Lufi/I18N/nl.po XGETTEXT=carton exec local/bin/xgettext.pl CARTON=carton exec REAL_LUFI=script/application LUFI=script/lufi locales: - $(XGETTEXT) -f $(EXTRACTFILES) -o $(EN) 2>/dev/null - $(XGETTEXT) -f $(EXTRACTFILES) -o $(FR) 2>/dev/null - $(XGETTEXT) -f $(EXTRACTFILES) -o $(IT) 2>/dev/null - $(XGETTEXT) -f $(EXTRACTFILES) -o $(OC) 2>/dev/null + $(XGETTEXT) $(EXTRACTDIR) -o $(EN) 2>/dev/null + $(XGETTEXT) $(EXTRACTDIR) -o $(FR) 2>/dev/null + $(XGETTEXT) $(EXTRACTDIR) -o $(IT) 2>/dev/null + $(XGETTEXT) $(EXTRACTDIR) -o $(OC) 2>/dev/null + $(XGETTEXT) $(EXTRACTDIR) -o $(CA) 2>/dev/null + $(XGETTEXT) $(EXTRACTDIR) -o $(PT) 2>/dev/null + $(XGETTEXT) $(EXTRACTDIR) -o $(NL) 2>/dev/null + +podcheck: + podchecker lib/Lufi/DB/File.pm lib/Lufi/DB/Slice.pm test: $(CARTON) $(REAL_LUFI) test diff --git a/README.md b/README.md index 076e6a3..82c6348 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,17 @@ Lufi means Let's Upload that FIle. +## Which browsers are compatible? + +Lufi is tested and working on the following browsers / devices : + - Firefox + - Chrome + - Internet Explorer 11 + - Microsoft Edge + - Safari + - iOS devices (ipad, iphone) + - Android devices (Galaxy tab, Galaxy S8) + ## What does it do? It stores files and allows you to download them. @@ -45,6 +56,10 @@ However please note that some metadata are sent unencrypted: * its size * its mimetype +## Client + +There is the web interface, but you can use a CLI client too! Have a look at or install it directly with `sudo npm install -g lufi-cli`. + ## Internationalization Lufi comes with English and French languages. It will choose the language to display from the browser's settings. diff --git a/cpanfile b/cpanfile index 65e249a..ed14502 100644 --- a/cpanfile +++ b/cpanfile @@ -1,9 +1,11 @@ -requires 'Mojolicious', '< 7.31'; +requires 'Mojolicious', '>= 7.31'; requires 'ORLite'; requires 'Mojolicious::Plugin::DebugDumperHelper'; +requires 'Mojolicious::Plugin::PgURLHelper'; requires 'Mojolicious::Plugin::I18N'; requires 'Mojolicious::Plugin::Mail'; requires 'Mojolicious::Plugin::Authentication'; +requires 'Mojo::Pg'; requires 'EV'; requires 'Filesys::DiskUsage'; requires 'Switch'; @@ -15,4 +17,5 @@ requires 'Filesys::DfPortable'; requires 'Switch'; requires 'Data::Entropy'; requires 'Net::LDAP'; -requires 'Apache::Htpasswd'; \ No newline at end of file +requires 'Crypt::SaltedHash'; +requires 'Apache::Htpasswd'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 38d6810..19226ce 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -1,5 +1,14 @@ # carton snapshot format: version 1.0 DISTRIBUTIONS + Apache-Htpasswd-1.9 + pathname: K/KM/KMELTZ/Apache-Htpasswd-1.9.tar.gz + provides: + Apache::Htpasswd 1.9 + requirements: + Crypt::PasswdMD5 0 + Digest::SHA 2 + ExtUtils::MakeMaker 0 + MIME::Base64 0 Authen-SASL-2.16 pathname: G/GB/GBARR/Authen-SASL-2.16.tar.gz provides: @@ -21,35 +30,47 @@ DISTRIBUTIONS ExtUtils::MakeMaker 6.42 Test::More 0 perl 5.005 - CPAN-Meta-2.150005 - pathname: D/DA/DAGOLDEN/CPAN-Meta-2.150005.tar.gz - provides: - CPAN::Meta 2.150005 - CPAN::Meta::Converter 2.150005 - CPAN::Meta::Feature 2.150005 - CPAN::Meta::History 2.150005 - CPAN::Meta::Merge 2.150005 - CPAN::Meta::Prereqs 2.150005 - CPAN::Meta::Spec 2.150005 - CPAN::Meta::Validator 2.150005 - requirements: - CPAN::Meta::Requirements 2.121 - CPAN::Meta::YAML 0.008 + Canary-Stability-2012 + pathname: M/ML/MLEHMANN/Canary-Stability-2012.tar.gz + provides: + Canary::Stability 2012 + requirements: + ExtUtils::MakeMaker 0 + Capture-Tiny-0.46 + pathname: D/DA/DAGOLDEN/Capture-Tiny-0.46.tar.gz + provides: + Capture::Tiny 0.46 + requirements: Carp 0 + Exporter 0 ExtUtils::MakeMaker 6.17 - JSON::PP 2.27200 - Parse::CPAN::Meta 1.4414 + File::Spec 0 + File::Temp 0 + IO::Handle 0 Scalar::Util 0 - perl 5.008 + perl 5.006 + strict 0 + warnings 0 + Class-Method-Modifiers-2.12 + pathname: E/ET/ETHER/Class-Method-Modifiers-2.12.tar.gz + provides: + Class::Method::Modifiers 2.12 + requirements: + B 0 + Carp 0 + Exporter 0 + ExtUtils::MakeMaker 0 + base 0 + perl 5.006 strict 0 - version 0.88 warnings 0 - Canary-Stability-2006 - pathname: M/ML/MLEHMANN/Canary-Stability-2006.tar.gz + Clone-0.39 + pathname: G/GA/GARU/Clone-0.39.tar.gz provides: - Canary::Stability 2006 + Clone 0.39 requirements: ExtUtils::MakeMaker 0 + Test::More 0 Convert-ASN1-0.27 pathname: G/GB/GBARR/Convert-ASN1-0.27.tar.gz provides: @@ -58,6 +79,16 @@ DISTRIBUTIONS ExtUtils::MakeMaker 6.30 Math::BigInt 1.997 Test::More 0.90 + Crypt-PasswdMD5-1.40 + pathname: R/RS/RSAVAGE/Crypt-PasswdMD5-1.40.tgz + provides: + Crypt::PasswdMD5 1.40 + requirements: + Digest::MD5 2.53 + Module::Build 0 + Test::More 0.94 + strict 0 + warnings 0 Crypt-Rijndael-1.13 pathname: L/LE/LEONT/Crypt-Rijndael-1.13.tar.gz provides: @@ -65,13 +96,33 @@ DISTRIBUTIONS requirements: ExtUtils::MakeMaker 0 perl 5.006 - DBD-SQLite-1.48 - pathname: I/IS/ISHIGAKI/DBD-SQLite-1.48.tar.gz + Crypt-SaltedHash-0.09 + pathname: G/GS/GSHANK/Crypt-SaltedHash-0.09.tar.gz provides: - DBD::SQLite 1.48 + Crypt::SaltedHash 0.09 + requirements: + Digest 0 + ExtUtils::MakeMaker 6.30 + Test::Fatal 0 + Test::More 0 + DBD-Pg-3.6.2 + pathname: T/TU/TURNSTEP/DBD-Pg-3.6.2.tar.gz + provides: + Bundle::DBD::Pg v3.6.2 + DBD::Pg v3.6.2 + requirements: + DBI 1.614 + ExtUtils::MakeMaker 6.11 + Test::More 0.88 + Time::HiRes 0 + version 0 + DBD-SQLite-1.54 + pathname: I/IS/ISHIGAKI/DBD-SQLite-1.54.tar.gz + provides: + DBD::SQLite 1.54 DBD::SQLite::Constants undef - DBD::SQLite::VirtualTable 1.48 - DBD::SQLite::VirtualTable::Cursor 1.48 + DBD::SQLite::VirtualTable 1.54 + DBD::SQLite::VirtualTable::Cursor 1.54 DBD::SQLite::VirtualTable::FileContent undef DBD::SQLite::VirtualTable::FileContent::Cursor undef DBD::SQLite::VirtualTable::PerlData undef @@ -84,8 +135,8 @@ DISTRIBUTIONS Test::More 0.47 Tie::Hash 0 perl 5.006 - DBI-1.634 - pathname: T/TI/TIMB/DBI-1.634.tar.gz + DBI-1.636 + pathname: T/TI/TIMB/DBI-1.636.tar.gz provides: Bundle::DBI 12.008696 DBD::DBM 0.08 @@ -134,7 +185,7 @@ DISTRIBUTIONS DBD::Sponge::dr 12.010003 DBD::Sponge::st 12.010003 DBDI 12.015129 - DBI 1.634 + DBI 1.636 DBI::Const::GetInfo::ANSI 2.008697 DBI::Const::GetInfo::ODBC 2.011374 DBI::Const::GetInfoReturn 2.008697 @@ -151,7 +202,6 @@ DISTRIBUTIONS DBI::DBD::SqlEngine::db 0.06 DBI::DBD::SqlEngine::dr 0.06 DBI::DBD::SqlEngine::st 0.06 - DBI::FAQ 1.014935 DBI::Gofer::Execute 0.014283 DBI::Gofer::Request 0.012537 DBI::Gofer::Response 0.011566 @@ -175,7 +225,7 @@ DISTRIBUTIONS DBI::SQL::Nano::Table_ 1.015544 DBI::Util::CacheMemory 0.010315 DBI::Util::_accessor 0.009479 - DBI::common 1.634 + DBI::common 1.636 requirements: ExtUtils::MakeMaker 6.48 Test::Simple 0.90 @@ -222,6 +272,14 @@ DISTRIBUTIONS perl 5.006 strict 0 warnings 0 + Devel-GlobalDestruction-0.14 + pathname: H/HA/HAARG/Devel-GlobalDestruction-0.14.tar.gz + provides: + Devel::GlobalDestruction 0.14 + requirements: + ExtUtils::MakeMaker 0 + Sub::Exporter::Progressive 0.001011 + perl 5.006 Digest-HMAC-1.03 pathname: G/GA/GAAS/Digest-HMAC-1.03.tar.gz provides: @@ -252,10 +310,10 @@ DISTRIBUTIONS Time::Local 0 strict 0 warnings 0 - Email-Valid-1.200 - pathname: R/RJ/RJBS/Email-Valid-1.200.tar.gz + Email-Valid-1.202 + pathname: R/RJ/RJBS/Email-Valid-1.202.tar.gz provides: - Email::Valid 1.200 + Email::Valid 1.202 requirements: ExtUtils::MakeMaker 0 Mail::Address 0 @@ -284,26 +342,31 @@ DISTRIBUTIONS ExtUtils::MakeMaker 0 HTTP::Date 6 perl 5.006002 - File-Remove-1.52 - pathname: A/AD/ADAMK/File-Remove-1.52.tar.gz + File-Remove-1.57 + pathname: S/SH/SHLOMIF/File-Remove-1.57.tar.gz provides: - File::Remove 1.52 + File::Remove 1.57 requirements: Cwd 3.29 - ExtUtils::MakeMaker 6.36 + ExtUtils::MakeMaker 0 + File::Glob 0 + File::Path 0 File::Spec 3.29 - Test::More 0.42 - perl 5.00503 + constant 0 + perl 5.006 + strict 0 + vars 0 + warnings 0 Filesys-DfPortable-0.85 pathname: I/IG/IGUTHRIE/Filesys-DfPortable-0.85.tar.gz provides: Filesys::DfPortable 0.85 requirements: ExtUtils::MakeMaker 0 - Filesys-DiskUsage-0.08 - pathname: S/SZ/SZABGAB/Filesys-DiskUsage-0.08.tar.gz + Filesys-DiskUsage-0.10 + pathname: M/MA/MANWAR/Filesys-DiskUsage-0.10.tar.gz provides: - Filesys::DiskUsage 0.08 + Filesys::DiskUsage 0.10 requirements: ExtUtils::MakeMaker 0 File::Basename 0 @@ -311,6 +374,7 @@ DISTRIBUTIONS File::Temp 0 Test::More 0 Test::Warn 0 + perl 5.006 HTML-Parser-3.72 pathname: G/GA/GAAS/HTML-Parser-3.72.tar.gz provides: @@ -332,18 +396,23 @@ DISTRIBUTIONS HTML::Tagset 3.20 requirements: ExtUtils::MakeMaker 0 - HTTP-Cookies-6.01 - pathname: G/GA/GAAS/HTTP-Cookies-6.01.tar.gz + HTTP-Cookies-6.03 + pathname: O/OA/OALDERS/HTTP-Cookies-6.03.tar.gz provides: - HTTP::Cookies 6.01 - HTTP::Cookies::Microsoft 6.00 - HTTP::Cookies::Netscape 6.00 + HTTP::Cookies 6.03 + HTTP::Cookies::Microsoft 6.03 + HTTP::Cookies::Netscape 6.03 requirements: + Carp 0 ExtUtils::MakeMaker 0 HTTP::Date 6 HTTP::Headers::Util 6 + HTTP::Request 0 Time::Local 0 + locale 0 perl 5.008001 + strict 0 + vars 0 HTTP-Daemon-6.01 pathname: G/GA/GAAS/HTTP-Daemon-6.01.tar.gz provides: @@ -378,20 +447,21 @@ DISTRIBUTIONS perl 5.005 strict 0 warnings 0 - HTTP-Message-6.11 - pathname: E/ET/ETHER/HTTP-Message-6.11.tar.gz - provides: - HTTP::Config 6.11 - HTTP::Headers 6.11 - HTTP::Headers::Auth 6.11 - HTTP::Headers::ETag 6.11 - HTTP::Headers::Util 6.11 - HTTP::Message 6.11 - HTTP::Request 6.11 - HTTP::Request::Common 6.11 - HTTP::Response 6.11 - HTTP::Status 6.11 + HTTP-Message-6.13 + pathname: O/OA/OALDERS/HTTP-Message-6.13.tar.gz + provides: + HTTP::Config 6.13 + HTTP::Headers 6.13 + HTTP::Headers::Auth 6.13 + HTTP::Headers::ETag 6.13 + HTTP::Headers::Util 6.13 + HTTP::Message 6.13 + HTTP::Request 6.13 + HTTP::Request::Common 6.13 + HTTP::Response 6.13 + HTTP::Status 6.13 requirements: + Carp 0 Compress::Raw::Zlib 0 Encode 2.21 Encode::Locale 1 @@ -409,8 +479,12 @@ DISTRIBUTIONS LWP::MediaTypes 6 MIME::Base64 2.1 MIME::QuotedPrint 0 + Storable 0 URI 1.10 + base 0 perl 5.008001 + strict 0 + warnings 0 HTTP-Negotiate-6.01 pathname: G/GA/GAAS/HTTP-Negotiate-6.01.tar.gz provides: @@ -419,6 +493,14 @@ DISTRIBUTIONS ExtUtils::MakeMaker 0 HTTP::Headers 6 perl 5.008001 + Hash-Merge-0.200 + pathname: R/RE/REHSACK/Hash-Merge-0.200.tar.gz + provides: + Hash::Merge 0.200 + requirements: + Clone 0 + ExtUtils::MakeMaker 0 + perl 5.008001 IO-HTML-1.001 pathname: C/CJ/CJM/IO-HTML-1.001.tar.gz provides: @@ -428,44 +510,28 @@ DISTRIBUTIONS Encode 2.10 Exporter 5.57 ExtUtils::MakeMaker 6.30 - IO-Socket-IP-0.37 - pathname: P/PE/PEVANS/IO-Socket-IP-0.37.tar.gz - provides: - IO::Socket::IP 0.37 - requirements: - IO::Socket 0 - Socket 1.97 - Test::More 0.88 - IO-Socket-SSL-2.027 - pathname: S/SU/SULLR/IO-Socket-SSL-2.027.tar.gz + IO-Socket-SSL-2.049 + pathname: S/SU/SULLR/IO-Socket-SSL-2.049.tar.gz provides: - IO::Socket::SSL 2.027 + IO::Socket::SSL 2.049 IO::Socket::SSL::Intercept 2.014 - IO::Socket::SSL::OCSP_Cache 2.027 - IO::Socket::SSL::OCSP_Resolver 2.027 + IO::Socket::SSL::OCSP_Cache 2.049 + IO::Socket::SSL::OCSP_Resolver 2.049 IO::Socket::SSL::PublicSuffix undef - IO::Socket::SSL::SSL_Context 2.027 - IO::Socket::SSL::SSL_HANDLE 2.027 - IO::Socket::SSL::Session_Cache 2.027 + IO::Socket::SSL::SSL_Context 2.049 + IO::Socket::SSL::SSL_HANDLE 2.049 + IO::Socket::SSL::Session_Cache 2.049 IO::Socket::SSL::Utils 2.014 requirements: ExtUtils::MakeMaker 0 + Mozilla::CA 0 Net::SSLeay 1.46 Scalar::Util 0 - IPC-Run3-0.048 - pathname: R/RJ/RJBS/IPC-Run3-0.048.tar.gz + JSON-2.94 + pathname: I/IS/ISHIGAKI/JSON-2.94.tar.gz provides: - IPC::Run3 0.048 - requirements: - ExtUtils::MakeMaker 0 - Test::More 0.31 - Time::HiRes 0 - JSON-2.90 - pathname: M/MA/MAKAMAKA/JSON-2.90.tar.gz - provides: - JSON 2.90 - JSON::Backend::PP 2.90 - JSON::Boolean 2.90 + JSON 2.94 + JSON::Backend::PP 2.94 requirements: ExtUtils::MakeMaker 0 Test::More 0 @@ -504,10 +570,10 @@ DISTRIBUTIONS requirements: ExtUtils::MakeMaker 6.30 Locale::Maketext 1.17 - MIME-Charset-1.012 - pathname: N/NE/NEZUMI/MIME-Charset-1.012.tar.gz + MIME-Charset-1.012.2 + pathname: N/NE/NEZUMI/MIME-Charset-1.012.2.tar.gz provides: - MIME::Charset 1.012 + MIME::Charset v1.12.2 requirements: CPAN 0 Encode 1.98 @@ -540,43 +606,50 @@ DISTRIBUTIONS File::Basename 0 File::Spec 0 MIME::Types 1.28 - MIME-Types-2.11 - pathname: M/MA/MARKOV/MIME-Types-2.11.tar.gz + MIME-Types-2.13 + pathname: M/MA/MARKOV/MIME-Types-2.13.tar.gz provides: - MIME::Type 2.11 - MIME::Types 2.11 - MojoX::MIME::Types 2.11 + MIME::Type 2.13 + MIME::Types 2.13 + MojoX::MIME::Types 2.13 requirements: ExtUtils::MakeMaker 0 File::Basename 0 File::Spec 0 List::Util 0 Test::More 0.47 - MailTools-2.14 - pathname: M/MA/MARKOV/MailTools-2.14.tar.gz + MRO-Compat-0.13 + pathname: H/HA/HAARG/MRO-Compat-0.13.tar.gz + provides: + MRO::Compat 0.13 + requirements: + ExtUtils::MakeMaker 0 + perl 5.006 + MailTools-2.18 + pathname: M/MA/MARKOV/MailTools-2.18.tar.gz provides: Mail undef - Mail::Address 2.14 - Mail::Cap 2.14 - Mail::Field 2.14 - Mail::Field::AddrList 2.14 - Mail::Field::Date 2.14 - Mail::Field::Generic 2.14 - Mail::Filter 2.14 - Mail::Header 2.14 - Mail::Internet 2.14 - Mail::Mailer 2.14 - Mail::Mailer::qmail 2.14 - Mail::Mailer::rfc822 2.14 - Mail::Mailer::sendmail 2.14 - Mail::Mailer::smtp 2.14 - Mail::Mailer::smtp::pipe 2.14 - Mail::Mailer::smtps 2.14 - Mail::Mailer::smtps::pipe 2.14 - Mail::Mailer::testfile 2.14 - Mail::Mailer::testfile::pipe 2.14 - Mail::Send 2.14 - Mail::Util 2.14 + Mail::Address 2.18 + Mail::Cap 2.18 + Mail::Field 2.18 + Mail::Field::AddrList 2.18 + Mail::Field::Date 2.18 + Mail::Field::Generic 2.18 + Mail::Filter 2.18 + Mail::Header 2.18 + Mail::Internet 2.18 + Mail::Mailer 2.18 + Mail::Mailer::qmail 2.18 + Mail::Mailer::rfc822 2.18 + Mail::Mailer::sendmail 2.18 + Mail::Mailer::smtp 2.18 + Mail::Mailer::smtp::pipe 2.18 + Mail::Mailer::smtps 2.18 + Mail::Mailer::smtps::pipe 2.18 + Mail::Mailer::testfile 2.18 + Mail::Mailer::testfile::pipe 2.18 + Mail::Send 2.18 + Mail::Util 2.18 requirements: Date::Format 0 Date::Parse 0 @@ -585,28 +658,28 @@ DISTRIBUTIONS Net::Domain 1.05 Net::SMTP 1.03 Test::More 0 - Module-Build-0.4214 - pathname: L/LE/LEONT/Module-Build-0.4214.tar.gz - provides: - Module::Build 0.4214 - Module::Build::Base 0.4214 - Module::Build::Compat 0.4214 - Module::Build::Config 0.4214 - Module::Build::Cookbook 0.4214 - Module::Build::Dumper 0.4214 - Module::Build::Notes 0.4214 - Module::Build::PPMMaker 0.4214 - Module::Build::Platform::Default 0.4214 - Module::Build::Platform::MacOS 0.4214 - Module::Build::Platform::Unix 0.4214 - Module::Build::Platform::VMS 0.4214 - Module::Build::Platform::VOS 0.4214 - Module::Build::Platform::Windows 0.4214 - Module::Build::Platform::aix 0.4214 - Module::Build::Platform::cygwin 0.4214 - Module::Build::Platform::darwin 0.4214 - Module::Build::Platform::os2 0.4214 - Module::Build::PodParser 0.4214 + Module-Build-0.4224 + pathname: L/LE/LEONT/Module-Build-0.4224.tar.gz + provides: + Module::Build 0.4224 + Module::Build::Base 0.4224 + Module::Build::Compat 0.4224 + Module::Build::Config 0.4224 + Module::Build::Cookbook 0.4224 + Module::Build::Dumper 0.4224 + Module::Build::Notes 0.4224 + Module::Build::PPMMaker 0.4224 + Module::Build::Platform::Default 0.4224 + Module::Build::Platform::MacOS 0.4224 + Module::Build::Platform::Unix 0.4224 + Module::Build::Platform::VMS 0.4224 + Module::Build::Platform::VOS 0.4224 + Module::Build::Platform::Windows 0.4224 + Module::Build::Platform::aix 0.4224 + Module::Build::Platform::cygwin 0.4224 + Module::Build::Platform::darwin 0.4224 + Module::Build::Platform::os2 0.4224 + Module::Build::PodParser 0.4224 requirements: CPAN::Meta 2.142060 CPAN::Meta::YAML 0.003 @@ -629,14 +702,39 @@ DISTRIBUTIONS Parse::CPAN::Meta 1.4401 Perl::OSType 1 Pod::Man 2.17 - Test::Harness 3.16 + TAP::Harness 3.29 Test::More 0.49 Text::Abbrev 0 Text::ParseWords 0 - perl 5.008000 + perl 5.006001 version 0.87 - Mojolicious-6.62 - pathname: S/SR/SRI/Mojolicious-6.62.tar.gz + Module-Runtime-0.015 + pathname: Z/ZE/ZEFRAM/Module-Runtime-0.015.tar.gz + provides: + Module::Runtime 0.015 + requirements: + Module::Build 0 + Test::More 0.41 + perl 5.006 + strict 0 + warnings 0 + Mojo-Pg-4.0 + pathname: S/SR/SRI/Mojo-Pg-4.0.tar.gz + provides: + Mojo::Pg 4.0 + Mojo::Pg::Database undef + Mojo::Pg::Migrations undef + Mojo::Pg::PubSub undef + Mojo::Pg::Results undef + Mojo::Pg::Transaction undef + requirements: + DBD::Pg 3.005001 + ExtUtils::MakeMaker 0 + Mojolicious 7.32 + SQL::Abstract 1.81 + perl 5.010001 + Mojolicious-7.36 + pathname: S/SR/SRI/Mojolicious-7.36.tar.gz provides: Mojo undef Mojo::Asset undef @@ -658,6 +756,7 @@ DISTRIBUTIONS Mojo::Date undef Mojo::EventEmitter undef Mojo::Exception undef + Mojo::File undef Mojo::Headers undef Mojo::HelloWorld undef Mojo::Home undef @@ -666,6 +765,8 @@ DISTRIBUTIONS Mojo::IOLoop::Delay undef Mojo::IOLoop::Server undef Mojo::IOLoop::Stream undef + Mojo::IOLoop::Subprocess undef + Mojo::IOLoop::TLS undef Mojo::JSON undef Mojo::JSON::Pointer undef Mojo::Loader undef @@ -683,6 +784,8 @@ DISTRIBUTIONS Mojo::Server::Daemon undef Mojo::Server::Hypnotoad undef Mojo::Server::Morbo undef + Mojo::Server::Morbo::Backend undef + Mojo::Server::Morbo::Backend::Poll undef Mojo::Server::PSGI undef Mojo::Server::PSGI::_IO undef Mojo::Server::Prefork undef @@ -699,7 +802,7 @@ DISTRIBUTIONS Mojo::UserAgent::Transactor undef Mojo::Util undef Mojo::WebSocket undef - Mojolicious 6.62 + Mojolicious 7.36 Mojolicious::Command undef Mojolicious::Command::cgi undef Mojolicious::Command::cpanify undef @@ -721,7 +824,6 @@ DISTRIBUTIONS Mojolicious::Controller undef Mojolicious::Lite undef Mojolicious::Plugin undef - Mojolicious::Plugin::Charset undef Mojolicious::Plugin::Config undef Mojolicious::Plugin::Config::Sandbox undef Mojolicious::Plugin::DefaultHelpers undef @@ -751,19 +853,21 @@ DISTRIBUTIONS JSON::PP 2.27103 Pod::Simple 3.09 Time::Local 1.2 - Mojolicious-Plugin-Authentication-1.29 - pathname: M/MA/MADCAT/Mojolicious-Plugin-Authentication-1.29.tar.gz + perl 5.010001 + Mojolicious-Plugin-Authentication-1.32 + pathname: J/JJ/JJATRIA/Mojolicious-Plugin-Authentication-1.32.tar.gz provides: - Mojolicious::Plugin::Authentication 1.29 + Mojolicious::Plugin::Authentication 1.32 requirements: ExtUtils::MakeMaker 0 Mojo::Base 0 + perl 5.010 strict 0 warnings 0 - Mojolicious-Plugin-DebugDumperHelper-0.02 - pathname: L/LD/LDIDRY/Mojolicious-Plugin-DebugDumperHelper-0.02.tar.gz + Mojolicious-Plugin-DebugDumperHelper-0.03 + pathname: L/LD/LDIDRY/Mojolicious-Plugin-DebugDumperHelper-0.03.tar.gz provides: - Mojolicious::Plugin::DebugDumperHelper 0.02 + Mojolicious::Plugin::DebugDumperHelper 0.03 requirements: ExtUtils::MakeMaker 0 Mojolicious 6.11 @@ -788,35 +892,84 @@ DISTRIBUTIONS Mojolicious 5 Test::More 0 perl 5.001001 - Net-HTTP-6.09 - pathname: E/ET/ETHER/Net-HTTP-6.09.tar.gz + Mojolicious-Plugin-PgURLHelper-0.03 + pathname: L/LD/LDIDRY/Mojolicious-Plugin-PgURLHelper-0.03.tar.gz + provides: + Mojolicious::Plugin::PgURLHelper 0.03 + requirements: + ExtUtils::MakeMaker 0 + Mojolicious 7.23 + Moo-2.003002 + pathname: H/HA/HAARG/Moo-2.003002.tar.gz + provides: + Method::Generate::Accessor undef + Method::Generate::BuildAll undef + Method::Generate::Constructor undef + Method::Generate::DemolishAll undef + Moo 2.003002 + Moo::HandleMoose undef + Moo::HandleMoose::FakeConstructor undef + Moo::HandleMoose::FakeMetaClass undef + Moo::HandleMoose::_TypeMap undef + Moo::Object undef + Moo::Role 2.003002 + Moo::_Utils undef + Moo::_mro undef + Moo::_strictures undef + Moo::sification undef + oo undef + requirements: + Class::Method::Modifiers 1.1 + Devel::GlobalDestruction 0.11 + Exporter 5.57 + ExtUtils::MakeMaker 0 + Module::Runtime 0.014 + Role::Tiny 2.000004 + Scalar::Util 0 + Sub::Defer 2.003001 + Sub::Quote 2.003001 + perl 5.006 + Mozilla-CA-20160104 + pathname: A/AB/ABH/Mozilla-CA-20160104.tar.gz + provides: + Mozilla::CA 20160104 + requirements: + ExtUtils::MakeMaker 0 + Test 0 + perl 5.006 + Net-HTTP-6.16 + pathname: O/OA/OALDERS/Net-HTTP-6.16.tar.gz provides: - Net::HTTP 6.09 - Net::HTTP::Methods 6.09 - Net::HTTP::NB 6.09 - Net::HTTPS 6.09 + Net::HTTP 6.16 + Net::HTTP::Methods 6.16 + Net::HTTP::NB 6.16 + Net::HTTPS 6.16 requirements: + Carp 0 Compress::Raw::Zlib 0 ExtUtils::MakeMaker 0 - IO::Select 0 IO::Socket::INET 0 IO::Uncompress::Gunzip 0 URI 0 + base 0 perl 5.006002 - Net-SSLeay-1.74 - pathname: M/MI/MIKEM/Net-SSLeay-1.74.tar.gz + strict 0 + vars 0 + warnings 0 + Net-SSLeay-1.81 + pathname: M/MI/MIKEM/Net-SSLeay-1.81.tar.gz provides: - Net::SSLeay 1.74 + Net::SSLeay 1.81 Net::SSLeay::Handle 0.61 requirements: ExtUtils::MakeMaker 6.36 MIME::Base64 0 Test::More 0.60_01 perl 5.005 - Number-Bytes-Human-0.10 - pathname: D/DA/DAGOBERT/Number-Bytes-Human-0.10.tar.gz + Number-Bytes-Human-0.11 + pathname: F/FE/FERREIRA/Number-Bytes-Human-0.11.tar.gz provides: - Number::Bytes::Human 0.10 + Number::Bytes::Human 0.11 requirements: Carp 0 ExtUtils::MakeMaker 0 @@ -872,10 +1025,49 @@ DISTRIBUTIONS ExtUtils::MakeMaker 6.30 File::Spec 0 strict 0 - Sub-Uplevel-0.25 - pathname: D/DA/DAGOLDEN/Sub-Uplevel-0.25.tar.gz + Role-Tiny-2.000005 + pathname: H/HA/HAARG/Role-Tiny-2.000005.tar.gz provides: - Sub::Uplevel 0.25 + Role::Tiny 2.000005 + Role::Tiny::With 2.000005 + requirements: + Exporter 5.57 + perl 5.006 + SQL-Abstract-1.84 + pathname: I/IL/ILMARI/SQL-Abstract-1.84.tar.gz + provides: + SQL::Abstract 1.84 + SQL::Abstract::Test undef + SQL::Abstract::Tree undef + requirements: + Exporter 5.57 + ExtUtils::MakeMaker 0 + Hash::Merge 0.12 + List::Util 0 + MRO::Compat 0.12 + Moo 2.000001 + Scalar::Util 0 + Sub::Quote 2.000001 + Text::Balanced 2.00 + Sub-Exporter-Progressive-0.001013 + pathname: F/FR/FREW/Sub-Exporter-Progressive-0.001013.tar.gz + provides: + Sub::Exporter::Progressive 0.001013 + requirements: + ExtUtils::MakeMaker 0 + Sub-Quote-2.004000 + pathname: H/HA/HAARG/Sub-Quote-2.004000.tar.gz + provides: + Sub::Defer 2.004000 + Sub::Quote 2.004000 + requirements: + ExtUtils::MakeMaker 0 + Scalar::Util 0 + perl 5.006 + Sub-Uplevel-0.2800 + pathname: D/DA/DAGOLDEN/Sub-Uplevel-0.2800.tar.gz + provides: + Sub::Uplevel 0.2800 requirements: Carp 0 ExtUtils::MakeMaker 6.17 @@ -893,31 +1085,42 @@ DISTRIBUTIONS Text::Balanced 2 if 0 perl 5.005 - Test-Script-1.10 - pathname: P/PL/PLICEASE/Test-Script-1.10.tar.gz + Test-Fatal-0.014 + pathname: R/RJ/RJBS/Test-Fatal-0.014.tar.gz provides: - Test::Script 1.10 + Test::Fatal 0.014 requirements: + Carp 0 + Exporter 5.57 + ExtUtils::MakeMaker 0 + Test::Builder 0 + Try::Tiny 0.07 + strict 0 + warnings 0 + Test-Script-1.20 + pathname: P/PL/PLICEASE/Test-Script-1.20.tar.gz + provides: + Test::Script 1.20 + requirements: + Capture::Tiny 0 ExtUtils::MakeMaker 0 File::Spec 0.80 - IPC::Run3 0.034 + IO::Handle 0 Probe::Perl 0.01 Test::Builder 0.32 Test::More 0.96 - perl 5.006 - Test-Warn-0.30 - pathname: C/CH/CHORNY/Test-Warn-0.30.tar.gz + perl 5.008001 + Test-Warn-0.32 + pathname: B/BI/BIGJ/Test-Warn-0.32.tar.gz provides: - Test::Warn 0.30 - Test::Warn::Categorization 0.30 + Test::Warn 0.32 + Test::Warn::Categorization 0.32 requirements: Carp 1.22 ExtUtils::MakeMaker 0 - File::Spec 0 Sub::Uplevel 0.12 Test::Builder 0.13 Test::Builder::Tester 1.02 - Test::More 0 perl 5.006 Text-Soundex-3.05 pathname: R/RJ/RJBS/Text-Soundex-3.05.tar.gz @@ -969,6 +1172,18 @@ DISTRIBUTIONS Time::Zone 2.24 requirements: ExtUtils::MakeMaker 0 + Try-Tiny-0.28 + pathname: E/ET/ETHER/Try-Tiny-0.28.tar.gz + provides: + Try::Tiny 0.28 + requirements: + Carp 0 + Exporter 5.57 + ExtUtils::MakeMaker 0 + constant 0 + perl 5.006 + strict 0 + warnings 0 URI-1.71 pathname: E/ET/ETHER/URI-1.71.tar.gz provides: @@ -1045,50 +1260,52 @@ DISTRIBUTIONS Fcntl 0 URI 1.10 perl 5.008001 - XML-SAX-Base-1.08 - pathname: G/GR/GRANTM/XML-SAX-Base-1.08.tar.gz + XML-SAX-Base-1.09 + pathname: G/GR/GRANTM/XML-SAX-Base-1.09.tar.gz provides: - XML::SAX::Base 1.08 - XML::SAX::Base::NoHandler 1.08 - XML::SAX::Exception 1.08 + XML::SAX::Base 1.09 + XML::SAX::Base::NoHandler 1.09 + XML::SAX::Exception 1.09 requirements: - ExtUtils::MakeMaker 6.31 - Test::More 0.88 + ExtUtils::MakeMaker 0 + perl 5.008 common-sense-3.74 pathname: M/ML/MLEHMANN/common-sense-3.74.tar.gz provides: common::sense 3.74 requirements: ExtUtils::MakeMaker 0 - libwww-perl-6.15 - pathname: E/ET/ETHER/libwww-perl-6.15.tar.gz - provides: - LWP 6.15 - LWP::Authen::Basic undef - LWP::Authen::Digest undef - LWP::Authen::Ntlm 6.15 - LWP::ConnCache 6.15 - LWP::Debug undef - LWP::DebugFile undef - LWP::MemberMixin undef - LWP::Protocol 6.15 - LWP::Protocol::GHTTP undef - LWP::Protocol::MyFTP undef - LWP::Protocol::cpan undef - LWP::Protocol::data undef - LWP::Protocol::file undef - LWP::Protocol::ftp undef - LWP::Protocol::gopher undef - LWP::Protocol::http undef - LWP::Protocol::http::Socket undef - LWP::Protocol::http::SocketMethods undef - LWP::Protocol::loopback undef - LWP::Protocol::mailto undef - LWP::Protocol::nntp undef - LWP::Protocol::nogo undef - LWP::RobotUA 6.15 - LWP::Simple 6.15 - LWP::UserAgent 6.15 + libwww-perl-6.26 + pathname: O/OA/OALDERS/libwww-perl-6.26.tar.gz + provides: + LWP 6.26 + LWP::Authen::Basic 6.26 + LWP::Authen::Digest 6.26 + LWP::Authen::Ntlm 6.26 + LWP::ConnCache 6.26 + LWP::Debug 6.26 + LWP::Debug::TraceHTTP 6.26 + LWP::Debug::TraceHTTP::Socket 6.26 + LWP::DebugFile 6.26 + LWP::MemberMixin 6.26 + LWP::Protocol 6.26 + LWP::Protocol::MyFTP 6.26 + LWP::Protocol::cpan 6.26 + LWP::Protocol::data 6.26 + LWP::Protocol::file 6.26 + LWP::Protocol::ftp 6.26 + LWP::Protocol::gopher 6.26 + LWP::Protocol::http 6.26 + LWP::Protocol::http::Socket 6.26 + LWP::Protocol::http::SocketMethods 6.26 + LWP::Protocol::loopback 6.26 + LWP::Protocol::mailto 6.26 + LWP::Protocol::nntp 6.26 + LWP::Protocol::nogo 6.26 + LWP::RobotUA 6.26 + LWP::Simple 6.26 + LWP::UserAgent 6.26 + libwww::perl undef requirements: Digest::MD5 0 Encode 2.12 @@ -1113,10 +1330,15 @@ DISTRIBUTIONS MIME::Base64 2.1 Net::FTP 2.58 Net::HTTP 6.07 + Scalar::Util 0 + Try::Tiny 0 URI 1.10 URI::Escape 0 WWW::RobotRules 6 + base 0 perl 5.008001 + strict 0 + warnings 0 perl-ldap-0.65 pathname: M/MA/MARSCHAP/perl-ldap-0.65.tar.gz provides: diff --git a/lib/Lufi.pm b/lib/Lufi.pm old mode 100755 new mode 100644 index f489373..e703ec4 --- a/lib/Lufi.pm +++ b/lib/Lufi.pm @@ -1,8 +1,6 @@ # vim:set sw=4 ts=4 sts=4 ft=perl expandtab: package Lufi; use Mojo::Base 'Mojolicious'; -use LufiDB; -use Data::Entropy qw(entropy_source); use Net::LDAP; use Apache::Htpasswd; @@ -11,23 +9,26 @@ $ENV{MOJO_MAX_WEBSOCKET_SIZE} = 100485760; # 10 * 1024 * 1024 = 10MiB # This method will run once at server start sub startup { my $self = shift; + my $entry; my $config = $self->plugin('Config' => { default => { - provisioning => 100, - provis_step => 5, - length => 10, - token_length => 32, - secrets => ['hfudsifdsih'], - default_delay => 0, - max_delay => 0, - mail => { + provisioning => 100, + provis_step => 5, + length => 10, + token_length => 32, + secrets => ['hfudsifdsih'], + default_delay => 0, + max_delay => 0, + mail => { how => 'sendmail' }, - mail_sender => 'no-reply@lufi.io', - theme => 'default', - upload_dir => 'files', - session_duration => 3600, + mail_sender => 'no-reply@lufi.io', + theme => 'default', + upload_dir => 'files', + session_duration => 3600, + allow_pwd_on_files => 0, + dbtype => 'sqlite', } }); @@ -83,34 +84,41 @@ sub startup { my $mesg = $ldap->bind($c->config->{ldap}->{bind_user}.$c->config->{ldap}->{bind_dn}, password => $c->config->{ldap}->{bind_pwd} ); - + $mesg->code && die $mesg->error; - + $mesg = $ldap->search( base => $c->config->{ldap}->{user_tree}, filter => "(&(uid=$username)".$c->config->{ldap}->{user_filter}.")" ); - + if ($mesg->code) { $c->app->log->error($mesg->error); return undef; } - - # Now we know that the user exists + + # we filtered out, but did we actually get a non-empty result? + $entry = $mesg->shift_entry; + if (!defined $entry) { + $c->app->log->info("[LDAP authentication failed] - User $username filtered out, IP: ".$c->ip); + return undef; + } + + # Now we know that the user exists, and that he is authorized by the filter $mesg = $ldap->bind('uid='.$username.$c->config->{ldap}->{bind_dn}, password => $password ); - + if ($mesg->code) { $c->app->log->info("[LDAP authentication failed] login: $username, IP: ".$c->ip); $c->app->log->error("[LDAP authentication failed] ".$mesg->error); return undef; } - + $c->app->log->info("[LDAP authentication successful] login: $username, IP: ".$c->ip); } elsif (defined($c->config('htpasswd'))) { my $htpasswd = new Apache::Htpasswd({passwdFile => $c->config->{htpasswd}, - ReadOnly => 1} + ReadOnly => 1} ); if (!$htpasswd->htCheckPassword($username, $password)) { return undef; @@ -130,105 +138,7 @@ sub startup { $self->secrets($self->config('secrets')); # Helpers - $self->helper( - provisioning => sub { - my $c = shift; - - # Create some short patterns for provisioning - if (LufiDB::Files->count('WHERE created_at IS NULL') < $c->config('provisioning')) { - for (my $i = 0; $i < $c->config('provis_step'); $i++) { - if (LufiDB->begin) { - my $short; - do { - $short= $c->shortener($c->config('length')); - } while (LufiDB::Files->count('WHERE short = ?', $short)); - - LufiDB::Files->create( - short => $short - ); - LufiDB->commit; - } - } - } - } - ); - - $self->helper( - get_empty => sub { - my $c = shift; - - my @records = LufiDB::Files->select('WHERE created_at IS NULL LIMIT 1'); - return $records[0]; - } - ); - - $self->helper( - shortener => sub { - my $c = shift; - my $length = shift; - - my @chars = ('a'..'z','A'..'Z','0'..'9', '-', '_'); - my $result = ''; - foreach (1..$length) { - $result .= $chars[entropy_source->get_int(scalar(@chars))]; - } - return $result; - } - ); - - $self->helper( - ip => sub { - my $c = shift; - my $proxy = $c->req->headers->header('X-Forwarded-For'); - my $ip = ($proxy) ? $proxy : $c->tx->remote_address; - my $remote_port = (defined($c->req->headers->header('X-Remote-Port'))) ? $c->req->headers->header('X-Remote-Port') : $c->tx->remote_port; - - return "$ip remote port:$remote_port"; - } - ); - - $self->helper( - default_delay => sub { - my $c = shift; - - return $c->config('default_delay') if ($c->config('default_delay') >= 0); - - warn "default_delay set to a negative value. Default to 0."; - return 0; - } - ); - - $self->helper( - max_delay => sub { - my $c = shift; - - return $c->config('max_delay') if ($c->config('max_delay') >= 0); - - warn "max_delay set to a negative value. Default to 0."; - return 0; - } - ); - - $self->helper( - is_selected => sub { - my $c = shift; - my $num = shift; - - return ($num == $c->max_delay) ? 'selected="selected"' : '' if ($c->max_delay && !$c->default_delay); - return ($num == $c->default_delay) ? 'selected="selected"' : ''; - } - ); - - $self->helper( - stop_upload => sub { - my $c = shift; - - if (-f 'stop-upload' || -f 'stop-upload.manual') { - return 1; - } - return 0; - } - ); + $self->plugin('Lufi::Plugin::Helpers'); # Hooks $self->hook( after_dispatch => sub { @@ -277,9 +187,12 @@ sub startup { if($c->authenticate($login, $pwd)) { $c->redirect_to('index'); - } else { - $c->stash(msg => $c->l('Please, check your credentials: unable to authenticate.')); - $c->render(template => 'login'); + } elsif (defined $entry) { + $c->stash(msg => $c->l('Please, check your credentials: unable to authenticate.')); + $c->render(template => 'login'); + } else { + $c->stash(msg => $c->l('Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there\'s a glitch in the matrix.')); + $c->render(template => 'login'); } }); # Logout page @@ -297,6 +210,11 @@ sub startup { shift->render(template => 'about'); })->name('about'); + # Get instance stats + $r->get('/fullstats') + ->to('Misc#fullstats') + ->name('fullstats'); + # Get a file $r->get('/r/:short')-> to('Files#r')-> diff --git a/lib/Lufi/Command/cron/cleanbdd.pm b/lib/Lufi/Command/cron/cleanbdd.pm index a6c32ca..4a3e326 100644 --- a/lib/Lufi/Command/cron/cleanbdd.pm +++ b/lib/Lufi/Command/cron/cleanbdd.pm @@ -1,9 +1,8 @@ # vim:set sw=4 ts=4 sts=4 ft=perl expandtab: package Lufi::Command::cron::cleanbdd; use Mojo::Base 'Mojolicious::Command'; -use LufiDB; +use Lufi::DB::File; use FindBin qw($Bin); -use File::Spec qw(catfile); has description => 'Delete IP addresses from database after configured delay.'; has usage => sub { shift->extract_usage }; @@ -11,20 +10,24 @@ has usage => sub { shift->extract_usage }; sub run { my $c = shift; + my $cfile = Mojo::File->new($Bin, '..' , 'lufi.conf'); + if (defined $ENV{MOJO_CONFIG}) { + $cfile = Mojo::File->new($ENV{MOJO_CONFIG}); + unless (-e $cfile->to_abs) { + $cfile = Mojo::File->new($Bin, '..', $ENV{MOJO_CONFIG}); + } + } my $config = $c->app->plugin('Config', { - file => File::Spec->catfile($Bin, '..' ,'lufi.conf'), + file => $cfile, default => { + dbtype => 'sqlite', keep_ip_during => 365, } }); my $separation = time() - $config->{keep_ip_during} * 86400; - LufiDB->do( - 'UPDATE files SET created_by = NULL WHERE created_by IS NOT NULL AND created_at < ?', - {}, - $separation - ); + Lufi::DB::File->new(app => $c->app)->delete_creator_before($separation); } =encoding utf8 diff --git a/lib/Lufi/Command/cron/cleanfiles.pm b/lib/Lufi/Command/cron/cleanfiles.pm index 912d715..c9d0ba0 100644 --- a/lib/Lufi/Command/cron/cleanfiles.pm +++ b/lib/Lufi/Command/cron/cleanfiles.pm @@ -1,10 +1,8 @@ # vim:set sw=4 ts=4 sts=4 ft=perl expandtab: package Lufi::Command::cron::cleanfiles; use Mojo::Base 'Mojolicious::Command'; -use LufiDB; -use Lufi::File; +use Lufi::DB::File; use FindBin qw($Bin); -use File::Spec qw(catfile); has description => 'Delete expired files.'; has usage => sub { shift->extract_usage }; @@ -12,28 +10,39 @@ has usage => sub { shift->extract_usage }; sub run { my $c = shift; - my $time = time(); - - ## Select only files expired since two days, to be sure that nobody is still downloading it - my @files = LufiDB::Files->select('WHERE deleted = 0 AND ((delete_at_day + 2) * 86400) < (? - created_at) AND delete_at_day != 0', $time); - - for my $file (@files) { - my $f = Lufi::File->new(record => $file); - $file->delete; + my $cfile = Mojo::File->new($Bin, '..' , 'lufi.conf'); + if (defined $ENV{MOJO_CONFIG}) { + $cfile = Mojo::File->new($ENV{MOJO_CONFIG}); + unless (-e $cfile->to_abs) { + $cfile = Mojo::File->new($Bin, '..', $ENV{MOJO_CONFIG}); + } } - my $config = $c->app->plugin('Config', { - file => File::Spec->catfile($Bin, '..' ,'lufi.conf'), + file => $cfile, + default => { + dbtype => 'sqlite', + } }); - if (defined($config->{delete_no_longer_viewed_files}) && $config->{delete_no_longer_viewed_files} > 0) { - $time = time() - $config->{delete_no_longer_viewed_files} * 86400; - @files = LufiDB::Files->select('WHERE deleted = 0 AND last_access_at < ?', $time); + my $time = time(); - for my $file (@files) { - my $f = Lufi::File->new(record => $file); - $file->delete; + my $ldfile = Lufi::DB::File->new(app => $c->app); + $ldfile->get_expired($time)->each( + sub { + my ($f, $num) = @_; + $f->delete; } + ); + + if (defined($config->{delete_no_longer_viewed_files}) && $config->{delete_no_longer_viewed_files} > 0) { + $time = time() - $config->{delete_no_longer_viewed_files} * 86400; + my $ldfile = Lufi::DB::File->new(app => $c->app); + $ldfile->get_no_longer_viewed($time)->each( + sub { + my ($f, $num) = @_; + $f->delete; + } + ); } } diff --git a/lib/Lufi/Command/cron/watch.pm b/lib/Lufi/Command/cron/watch.pm index ebb2fec..af4134e 100644 --- a/lib/Lufi/Command/cron/watch.pm +++ b/lib/Lufi/Command/cron/watch.pm @@ -1,11 +1,9 @@ package Lufi::Command::cron::watch; use Mojo::Base 'Mojolicious::Command'; use Filesys::DiskUsage qw/du/; -use LufiDB; -use Lufi::File; +use Lufi::DB::File; use Switch; use FindBin qw($Bin); -use File::Spec qw(catfile); has description => 'Watch the files directory and take action when over quota'; has usage => sub { shift->extract_usage }; @@ -13,9 +11,17 @@ has usage => sub { shift->extract_usage }; sub run { my $c = shift; + my $cfile = Mojo::File->new($Bin, '..' , 'lufi.conf'); + if (defined $ENV{MOJO_CONFIG}) { + $cfile = Mojo::File->new($ENV{MOJO_CONFIG}); + unless (-e $cfile->to_abs) { + $cfile = Mojo::File->new($Bin, '..', $ENV{MOJO_CONFIG}); + } + } my $config = $c->app->plugin('Config', { - file => File::Spec->catfile($Bin, '..' ,'lufi.conf'), + file => $cfile, default => { + dbtype => 'sqlite', policy_when_full => 'warn' } }); @@ -36,11 +42,14 @@ sub run { } case 'delete' { say '[Lufi cron job watch] Older files are being deleted'; + my $ldfile = Lufi::DB::File->new(app => $c->app); do { - for my $file (LufiDB::Files->select('WHERE deleted = 0 ORDER BY created_at ASC LIMIT 50')) { - my $f = Lufi::File->new(record => $file); - $file->delete; - } + $ldfile->get_oldest_undeleted_files(50)->each( + sub { + my ($f, $num) = @_; + $f->delete; + } + ); } while (du(qw/files/) > $config->{max_total_size}); } else { diff --git a/lib/Lufi/Command/theme.pm b/lib/Lufi/Command/theme.pm index 96a3ca3..185e5d5 100644 --- a/lib/Lufi/Command/theme.pm +++ b/lib/Lufi/Command/theme.pm @@ -62,7 +62,7 @@ SEDOPTS=-e "s\@SOME DESCRIPTIVE TITLE\@Lufi language file\@" \\ -e "s\@CHARSET\@utf8\@" \\ -e "s\@the PACKAGE package\@the Lufi package\@" \\ -e '/^\\#\\. (/{N;/\\n\\#\\. (/{N;/\\n.*\\.\\.\\/default\\//{s/\\#\\..*\\n.*\\#\\./\\#. (/g}}}' \\ - -e '/^\\#\\. (/{N;/\\n.*\\.\\.\\/default\\//{s/\\n/ /}}' + -e '/^\\#\\. (/{N;/\\n.*\\.\\.\\/default\\//{s/\\n/ /}}' SEDOPTS2=-e '/^\\#.*\\.\\.\\/default\\//,+3d' XGETTEXT=carton exec ../../local/bin/xgettext.pl CARTON=carton exec diff --git a/lib/Lufi/Controller/Files.pm b/lib/Lufi/Controller/Files.pm index 071be49..7841268 100644 --- a/lib/Lufi/Controller/Files.pm +++ b/lib/Lufi/Controller/Files.pm @@ -2,13 +2,14 @@ package Lufi::Controller::Files; use Mojo::Base 'Mojolicious::Controller'; use Mojo::JSON qw(encode_json decode_json to_json true false); -use Mojo::Util qw(slurp spurt encode decode); -use LufiDB; -use Lufi::File; -use Lufi::Slice; +use Mojo::Util qw(encode decode); +use Mojo::File; +use Lufi::DB::File; +use Lufi::DB::Slice; use File::Spec::Functions; use Number::Bytes::Human qw(format_bytes); use Filesys::DfPortable; +use Crypt::SaltedHash; sub upload { my $c = shift; @@ -36,47 +37,46 @@ sub upload { # Check if stop_upload file is present if ($c->stop_upload) { $stop = 1; - $c->send(encode_json( + $c->send(decode('UTF-8', encode_json( { success => false, msg => $c->l('Sorry, uploading is disabled.'), sent_delay => $json->{delay}, i => $json->{i} } - )); + ))); } # Check against max_size elsif (defined $c->config('max_file_size')) { if ($json->{size} > $c->config('max_file_size')) { $stop = 1; - $c->send(encode_json( + $c->send(decode('UTF-8', encode_json( { success => false, msg => $c->l('Your file is too big: %1 (maximum size allowed: %2)', format_bytes($json->{size}), format_bytes($c->config('max_file_size'))), sent_delay => $json->{delay}, i => $json->{i} } - )); + ))); } } # Check that we have enough space (multiplying by 2 since it's encrypted, it takes more place that the original file) elsif ($json->{part} == 0 && ($json->{size} * 2) >= dfportable($c->config('upload_dir'))->{bavail}) { $stop = 1; - $c->send(encode_json( + $c->send(decode('UTF-8', encode_json( { success => false, msg => $c->l('No enough space available on the server for this file (size: %1).', format_bytes($json->{size})), sent_delay => $json->{delay}, i => $json->{i} } - )); + ))); } unless ($stop) { my $f; if (defined($json->{id})) { - my @records = LufiDB::Files->select('WHERE short = ?', $json->{id}); - $f = Lufi::File->new(record => $records[0]) if scalar @records; + $f = Lufi::DB::File->new(app => $c->app)->from_short($json->{id}); } else { my $delay; unless (defined $json->{delay}) { @@ -98,23 +98,30 @@ sub upload { unless (defined $delay) { $delay = (($json->{delay} > 0 && $json->{delay} <= $c->max_delay) || $c->max_delay == 0) ? $json->{delay} : $c->max_delay; } + # If we have a password + my $salted_pwd; + if ($c->config('allow_pwd_on_files') && defined($json->{file_pwd}) && $json->{file_pwd} ne '') { + my $csh = Crypt::SaltedHash->new(algorithm => 'SHA-256', salt_len => 8); + $csh->add($json->{file_pwd}); + + $salted_pwd = $csh->generate(); + } my $creator = $c->ip; if (defined($c->config('ldap')) || defined($c->config('htpasswd'))) { $creator = 'User: '.$c->current_user.', IP: '.$creator; } - $f = Lufi::File->new( - record => $c->get_empty, - created_by => $creator, - delete_at_first_view => ($json->{del_at_first_view}) ? 1 : 0, - delete_at_day => $delay, - mediatype => $json->{type}, - filename => $json->{name}, - filesize => $json->{size}, - nbslices => $json->{total}, - mod_token => $c->shortener($c->config('token_length')) - ); - $f->write; + $f = Lufi::DB::File->new(app => $c->app)->get_empty() + ->created_by($creator) + ->delete_at_first_view(($json->{del_at_first_view}) ? 1 : 0) + ->delete_at_day($delay) + ->mediatype($json->{type}) + ->filename($json->{name}) + ->filesize($json->{size}) + ->nbslices($json->{total}) + ->mod_token($c->shortener($c->config('token_length'))) + ->passwd($salted_pwd) + ->write; } # This check is just in case we didn't succeed to find a corresponding record @@ -129,12 +136,13 @@ sub upload { # Create slice file my $file = catfile($dir, $json->{part}.'.part'); - my $s = Lufi::Slice->new( + my $s = Lufi::DB::Slice->new( + app => $c->app, short => $f->short, j => $json->{part}, path => $file ); - spurt $text, $file; + Mojo::File->new($file)->spurt($text); push @{$f->slices}, $s; $s->write; @@ -165,14 +173,14 @@ sub upload { } )); } else { - $ws->send(encode_json( + $ws->send(decode('UTF-8', encode_json( { success => false, msg => $c->l('The server was unable to find the file record to add your file part to. Please, contact the administrator.'), sent_delay => $json->{delay}, i => $json->{i} } - )); + ))); } } } @@ -192,65 +200,79 @@ sub download { $c->inactivity_timeout(300000); $c->app->log->debug('Client connected'); - my @records = LufiDB::Files->select('WHERE short = ?', $short); + my $ldfile = Lufi::DB::File->new(app => $c->app)->from_short($short); # Do we have a file? - if (scalar @records) { - my $record = $records[0]; + if (defined $ldfile) { # Is the file fully uploaded? - if ($record->deleted + if ($ldfile->deleted || ( - $record->delete_at_day != 0 + $ldfile->delete_at_day != 0 && ( - ($record->created_at + $record->delete_at_day * 86400) < time() + ($ldfile->created_at + $ldfile->delete_at_day * 86400) < time() ) ) ) { - unless ($record->deleted) { - my $f = Lufi::File->new(record => $record); - $f->delete; + unless ($ldfile->deleted) { + $ldfile->delete; } $c->on( message => sub { my ($ws, $json) = @_; - $c->send(encode_json( + $c->send(decode('UTF-8', encode_json( { success => false, msg => $c->l('Error: the file existed but was deleted.') } - )); + ))); } ); - } elsif ($record->complete) { - my $f = Lufi::File->new(record => $record); + } elsif ($ldfile->complete) { + my $f = $ldfile; $c->on( message => sub { my ($ws, $json) = @_; $json = decode_json $json; - if (defined($json->{part})) { - # Make $num an integer instead of a string - my $num = $json->{part} + 0; - - # Get the slice - my $e = $f->slices->[$num]; - my $text = slurp $e->path; - - my ($json2) = split('XXMOJOXX', $text, 2); - $json2 = decode 'UTF-8', $json2; - $text =~ s/^.*?XXMOJOXX/${json2}XXMOJOXX/; - - # Send the slice - $c->send($text); - } elsif (defined($json->{ended}) && $json->{ended}) { - $f->counter($f->counter + 1); - $f->last_access_at(time); - - if ($f->delete_at_first_view) { - $f->delete; - } else { - $f->write; + + # Do we need a password? + my $valid = 1; + if ($c->config('allow_pwd_on_files') && defined($f->{passwd})) { + my $pwd = $json->{file_pwd}; + $valid = Crypt::SaltedHash->validate($f->{passwd}, $json->{file_pwd}, 8); + } + + if ($valid) { + if (defined($json->{part})) { + # Make $num an integer instead of a string + my $num = $json->{part} + 0; + + # Get the slice + my $e = $f->slices->[$num]; + my $text = Mojo::File->new($e->path)->slurp; + + my ($json2) = split('XXMOJOXX', $text, 2); + $json2 = decode 'UTF-8', $json2; + $text =~ s/^.*?XXMOJOXX/${json2}XXMOJOXX/; + + # Send the slice + $c->send($text); + } elsif (defined($json->{ended}) && $json->{ended}) { + $f->counter($f->counter + 1); + $f->last_access_at(time); + + if ($f->delete_at_first_view) { + $f->delete; + } else { + $f->write; + } } + } else { + $c->send(decode('UTF-8', encode_json( + { + msg => $c->l('Your password is not valid. Please refresh the page to retry.') + } + ))); } } ); @@ -263,22 +285,22 @@ sub download { $c->on( message => sub { my ($ws, $json) = @_; - $c->send(encode_json( + $c->send(decode('UTF-8', encode_json( { success => false, msg => $c->l('Error: the file has not been sent entirely.') } - )); + ))); } ); } } else { - $c->send(encode_json( + $c->send(decode('UTF-8', encode_json( { success => false, msg => $c->l('Error: unable to find the file. Are you sure of your URL?') } - )); + ))); } } @@ -286,12 +308,13 @@ sub r { my $c = shift; my $short = $c->param('short'); - my @records = LufiDB::Files->select('WHERE short = ?', $short); - if (scalar @records) { - my $f = Lufi::File->new(record => $records[0]); + my $ldfile = Lufi::DB::File->new(app => $c->app)->from_short($short); + + if (defined $ldfile) { return $c->render( template => 'render', - f => $f + f => $ldfile, + file_pwd => ($c->config('allow_pwd_on_files') && defined($ldfile->passwd)) ); } else { return $c->render( @@ -307,15 +330,16 @@ sub get_counter { my $token = $c->param('token'); if ((!defined($c->config('ldap')) && !defined($c->config('htpasswd'))) || $c->is_user_authenticated) { - my @records = LufiDB::Files->select('WHERE short = ?', $short); - if (scalar(@records)) { - if ($records[0]->mod_token eq $token) { + my $ldfile = Lufi::DB::File->new(app => $c->app)->from_short($short); + + if (defined $ldfile) { + if ($ldfile->mod_token eq $token) { return $c->render( json => { success => true, short => $short, - counter => $records[0]->counter, - deleted => ($records[0]->deleted) ? true : false + counter => $ldfile->counter, + deleted => ($ldfile->deleted) ? true : false } ); } else { @@ -356,25 +380,29 @@ sub delete { my $token = $c->param('token'); if ((!defined($c->config('ldap')) && !defined($c->config('htpasswd'))) || $c->is_user_authenticated) { - my @records = LufiDB::Files->select('WHERE short = ? AND mod_token = ?', ($short, $token)); - if (scalar(@records)) { - my $f = Lufi::File->new(record => $records[0]); + my $ldfile = Lufi::DB::File->new(app => $c->app)->from_short($short); + + $ldfile = undef unless (defined($ldfile) && $ldfile->mod_token eq $token); + + if (defined $ldfile) { my $msg; - if ($f->deleted) { + if ($ldfile->deleted) { $msg = $c->l('The file has already been deleted'); } else { - $f->delete; + $ldfile->delete; $msg = $c->l('File deleted'); } return $c->respond_to( json => { - success => true, - msg => $msg + json => { + success => true, + msg => $msg + } }, any => sub { $c->render( template => 'msg', - f => $f, + f => $ldfile, msg => $msg ); } @@ -383,8 +411,10 @@ sub delete { my $msg = $c->l('Could not find the file. Are you sure of the URL and the token?'); return $c->respond_to( json => { - success => false, - msg => $msg + json => { + success => false, + msg => $msg + } }, any => sub { $c->render( @@ -399,8 +429,10 @@ sub delete { my $msg = $c->l('Could not delete the file. You are not authenticated.'); return $c->respond_to( json => { - success => false, - msg => $msg + json => { + success => false, + msg => $msg + } }, any => sub { $c->render( diff --git a/lib/Lufi/Controller/Mail.pm b/lib/Lufi/Controller/Mail.pm index b004919..bbfbfbe 100644 --- a/lib/Lufi/Controller/Mail.pm +++ b/lib/Lufi/Controller/Mail.pm @@ -6,10 +6,11 @@ use Mojo::JSON qw(decode_json); sub render_mail { my $c = shift; + my $links = (defined($c->param('links'))) ? decode_json($c->param('links')) : []; $c->render( template => 'mail', - links => decode_json($c->param('links')) + links => $links ); } diff --git a/lib/Lufi/Controller/Misc.pm b/lib/Lufi/Controller/Misc.pm new file mode 100644 index 0000000..1783d61 --- /dev/null +++ b/lib/Lufi/Controller/Misc.pm @@ -0,0 +1,22 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: +package Lufi::Controller::Misc; +use Mojo::Base 'Mojolicious::Controller'; +use Mojo::File; +use Lufi::DB::File; + +sub fullstats { + my $c = shift; + + my $stats = Lufi::DB::File->new(app => $c->app)->get_stats; + + return $c->render( + json => { + files => $stats->{files}, + deleted => $stats->{deleted}, + empty => $stats->{empty}, + timestamp => time, + } + ); +} + +1; diff --git a/lib/Lufi/DB/File.pm b/lib/Lufi/DB/File.pm new file mode 100644 index 0000000..d323b9e --- /dev/null +++ b/lib/Lufi/DB/File.pm @@ -0,0 +1,291 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: +package Lufi::DB::File; +use Mojo::Base -base; +use Mojo::Collection; + +has 'short'; +has 'deleted' => 0; +has 'mediatype'; +has 'filename'; +has 'filesize'; +has 'counter' => 0; +has 'delete_at_first_view' => 0; +has 'delete_at_day'; +has 'created_at' => sub { + return time; +}; +has 'created_by'; +has 'last_access_at'; +has 'mod_token'; +has 'nbslices'; +has 'complete' => 0; +has 'slices' => sub { + return Mojo::Collection->new(); +}; +has 'passwd'; +has 'app'; + +=head1 NAME + +Lufi::DB::File - DB abstraction layer for Lufi file + +=head1 Contributing + +When creating a new database accessor, make sure that it provides the following subroutines. +After that, modify this file and modify the C subroutine to allow to use your accessor. + +Have a look at Lufi::DB::File::SQLite's code: it's simple and may be more understandable that this doc. + +=head1 Attributes + +=over 1 + +=item B : string + +=item B : boolean + +=item B : string + +=item B : string + +=item B : integer + +=item B : integer + +=item B : boolean + +=item B : integer + +=item B : unix timestamp + +=item B : string + +=item B : unix timestamp + +=item B : string + +=item B : integer + +=item B : boolean + +=item B : Mojo::Collection of Lufi::DB::Slice + +=item B : string + +=item B : a Mojolicious object + +=back + +=head1 Sub routines + +=head2 new + +=over 1 + +=item B : C<$c = Lufi::DB::File-Enew(app =E $self);> + +=item B : any of the attribute above + +=item B : construct a new db accessor object. If the C attribute is provided, it have to load the informations from the database. + +=item B : the db accessor object + +=item B : the app argument is used by Lufi::DB::File to choose which db accessor will be used, you don't need to use it in new(), but you can use it to access helpers or configuration settings in the other subroutines + +=back + +=cut + +sub new { + my $c = shift; + + $c = $c->SUPER::new(@_); + + if (ref($c) eq 'Lufi::DB::File') { + my $dbtype = $c->app->config('dbtype'); + if ($dbtype eq 'sqlite') { + use Lufi::DB::File::SQLite; + $c = Lufi::DB::File::SQLite->new(@_); + } elsif ($dbtype eq 'postgresql') { + use Lufi::DB::File::Pg; + $c = Lufi::DB::File::Pg->new(@_); + } + } + + return $c; +} + +=head2 delete + +=over 1 + +=item B : C<$c-Edelet> + +=item B : none + +=item B : delete the files of the slices and the directory containing those files, then update the object by setting the deleted attribute to 1 (true) + +=item B : the db accessor object + +=back + +=cut + +sub delete { + my $c = shift; + + $c->slices->each(sub { + my ($e, $num) = @_; + unlink $e->path; + }); + rmdir Mojo::File->new($c->app->config('upload_dir'), $c->short); + $c->deleted(1); + + $c->write; + + return $c; +} + +=head2 write + +=over 1 + +=item B : C<$c-Ewrite> + +=item B : none + +=item B : create or update a record in the database, with the values of the object's attributes + +=item B : the db accessor object + +=back + +=head2 count_empty + +=over 1 + +=item B : C<$c-Ecount_empty> + +=item B : none + +=item B : count how many records have a null created_at column + +=item B : integer + +=back + +=head2 already_exists + +=over 1 + +=item B : C<$c-Ealready_exists($short)> + +=item B : a string + +=item B : check if the given string is already used as short attribute for a file + +=item B : 1 or 0 + +=back + +=head2 get_empty + +=over 1 + +=item B : C<$c-Eget_empty> + +=item B : none + +=item B : select an empty ready-to-use record from the database + +=item B : a db accessor object + +=back + +=head2 get_stats + +=over 1 + +=item B : C<$c-Eget_stats> + +=item B : none + +=item B : get stats about how many empty files, deleted files and non-deleted files there is in the database + +=item B : a hash table reference containing three keys: files, deleted and empty + +=back + +=head2 from_short + +=over 1 + +=item B : C<$c-Efrom_short($short)> + +=item B : string + +=item B : find a file in the database from its short attribute + +=item B : a db accessor object + +=back + +=head2 get_oldest_undeleted_files + +=over 1 + +=item B : C<$c-Eget_oldest_undeleted_files($num)> + +=item B : integer + +=item B : get the X oldest non-deleted files + +=item B : a Mojo::Collection of Lufi::DB::File objects + +=back + +=head2 get_expired + +=over 1 + +=item B : C<$c-Eget_expired($time)> + +=item B : unix timestamp + +=item B : get the non-deleted files that are expired at the given timestamp minus 2 days + +=item B : a Mojo::Collection of Lufi::DB::File objects + +=back + +=head2 get_no_longer_viewed + +=over 1 + +=item B : C<$c-Eget_no_longer_viewed($time)> + +=item B : unix timestamp + +=item B : get the files that have not been viewed after the given timestamp + +=item B : a Mojo::Collection of Lufi::DB::File objects + +=back + +=head2 delete_creator_before + +=over 1 + +=item B : C<$c-Edelete_creator_before($time)> + +=item B : unix timestamp + +=item B : empty the created_by column for files created before the given timestamp + +=item B : nothing + +=back + +=cut + +1; diff --git a/lib/Lufi/DB/File/Pg.pm b/lib/Lufi/DB/File/Pg.pm new file mode 100644 index 0000000..62967f7 --- /dev/null +++ b/lib/Lufi/DB/File/Pg.pm @@ -0,0 +1,177 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: +package Lufi::DB::File::Pg; +use Mojo::Base 'Lufi::DB::File'; +use Mojo::File; +use Mojo::Collection 'c'; +use Lufi::DB::Slice; + +has 'record' => 0; + +sub new { + my $c = shift; + + $c = $c->SUPER::new(@_); + + return $c; +} + +sub write { + my $c = shift; + + if ($c->record) { + $c->app->pg->db->query('UPDATE files SET short = ?, deleted = ?, mediatype = ?, filename = ?, filesize = ?, counter = ?, delete_at_first_view = ?, delete_at_day = ?, created_at = ?, created_by = ?, last_access_at = ?, mod_token = ?, nbslices = ?, complete = ?, passwd = ? WHERE short = ?', $c->short, $c->deleted, $c->mediatype, $c->filename, $c->filesize, $c->counter, $c->delete_at_first_view, $c->delete_at_day, $c->created_at, $c->created_by, $c->last_access_at, $c->mod_token, $c->nbslices, $c->complete, $c->passwd, $c->short); + } else { + $c->app->pg->db->query('INSERT INTO files (short, deleted, mediatype, filename, filesize, counter, delete_at_first_view, delete_at_day, created_at, created_by, last_access_at, mod_token, nbslices, complete, passwd) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $c->short, $c->deleted, $c->mediatype, $c->filename, $c->filesize, $c->counter, $c->delete_at_first_view, $c->delete_at_day, $c->created_at, $c->created_by, $c->last_access_at, $c->mod_token, $c->nbslices, $c->complete, $c->passwd); + $c->record(1); + } + + return $c; +} + +sub count_empty { + my $c = shift; + + return $c->app->pg->db->query('SELECT count(short) FROM files WHERE created_at IS NULL')->hashes->first->{count}; +} + +sub already_exists { + my $c = shift; + my $short = shift; + + return $c->app->pg->db->query('SELECT count(short) FROM files WHERE short = ?', $short)->hashes->first->{count}; +} + +sub get_empty { + my $c = shift; + + my $r = $c->app->pg->db->query('SELECT * FROM files WHERE created_at IS NULL')->hashes->shuffle->first; + + return $c->_slurp($r)->created_at(time)->write; +} + +sub get_stats { + my $c = shift; + + my $files = $c->app->pg->db->query('SELECT count(short) FROM files WHERE created_at IS NOT null AND deleted = false')->hashes->first->{count}; + my $deleted = $c->app->pg->db->query('SELECT count(short) FROM files WHERE created_at IS NOT null AND deleted = true')->hashes->first->{count}; + my $empty = $c->app->pg->db->query('SELECT count(short) FROM files WHERE created_at IS null')->hashes->first->{count}; + + return { files => $files, deleted => $deleted, empty => $empty }; +} + +sub from_short { + my $c = shift; + my $short = shift; + + my $r = $c->app->pg->db->query('SELECT * FROM files WHERE short = ?', $short)->hashes; + + if ($r->size) { + return $c->_slurp($r->first)->record(1); + } else { + return undef; + } +} + +sub get_oldest_undeleted_files { + my $c = shift; + my $num = shift; + + my @files; + my $records = $c->app->pg->db->query('SELECT * FROM files WHERE deleted = false ORDER BY created_at ASC LIMIT ?', $num)->hashes; + $records->each( + sub { + my ($e, $num) = @_; + my $i = Lufi::DB::File->new(app => $c->app); + + push @files, $i->_slurp($e); + } + ); + + return c(@files); +} + +sub get_expired { + my $c = shift; + my $time = shift; + + my @files; + ## Select only files expired since two days, to be sure that nobody is still downloading it + my $records = $c->app->pg->db->query('SELECT * FROM files WHERE deleted = false AND ((delete_at_day + 2) * 86400) < (? - created_at) AND delete_at_day != 0', $time)->hashes; + $records->each( + sub { + my ($e, $num) = @_; + my $i = Lufi::DB::File->new(app => $c->app); + + push @files, $i->_slurp($e); + } + ); + + return c(@files); +} + +sub get_no_longer_viewed { + my $c = shift; + my $time = shift; + + my @files; + my $records = $c->app->pg->db->query('SELECT * FROM files WHERE deleted = false AND last_access_at < ?', $time)->hashes; + $records->each( + sub { + my ($e, $num) = @_; + my $i = Lufi::DB::File->new(app => $c->app); + + push @files, $i->_slurp($e); + } + ); + + return c(@files); +} + +sub delete_creator_before { + my $c = shift; + my $separation = shift; + + $c->app->pg->db->query('UPDATE files SET created_by = NULL WHERE created_by IS NOT NULL AND created_at < ?', $separation); +} + +sub _slurp { + my $c = shift; + my $r = shift; + + my $file; + if (defined $r) { + $file = $r; + } else { + my $files = $c->app->pg->db->query('SELECT * FROM files WHERE short = ?', $c->short)->hashes; + + if ($files->size) { + $file = $files->first; + } + } + + if ($file) { + $c->short($file->{short}); + $c->deleted($file->{deleted}); + $c->mediatype($file->{mediatype}); + $c->filename($file->{filename}); + $c->filesize($file->{filesize}); + $c->counter($file->{counter}); + $c->delete_at_first_view($file->{delete_at_first_view}); + $c->delete_at_day($file->{delete_at_day}); + $c->created_at($file->{created_at}); + $c->created_by($file->{created_by}); + $c->last_access_at($file->{last_access_at}); + $c->mod_token($file->{mod_token}); + $c->nbslices($file->{nbslices}); + $c->complete($file->{complete}); + $c->passwd($file->{passwd}); + + $c->record(1) unless $c->record; + } + + $c->slices(Lufi::DB::Slice->new(app => $c->app)->get_slices_of_file($c->short)); + + return $c; +} + +1; diff --git a/lib/Lufi/DB/File/SQLite.pm b/lib/Lufi/DB/File/SQLite.pm new file mode 100644 index 0000000..a62e710 --- /dev/null +++ b/lib/Lufi/DB/File/SQLite.pm @@ -0,0 +1,188 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: +package Lufi::DB::File::SQLite; +use Mojo::Base 'Lufi::DB::File'; +use Mojo::File; +use Mojo::Collection 'c'; +use Lufi::DB::SQLite; +use Lufi::DB::Slice; + +has 'record'; + +sub new { + my $c = shift; + + $c = $c->SUPER::new(@_); + $c = $c->_slurp if defined $c->record; + + return $c; +} + +sub write { + my $c = shift; + + if (defined $c->record) { + $c->record->update( + short => $c->short, + deleted => $c->deleted, + mediatype => $c->mediatype, + filename => $c->filename, + filesize => $c->filesize, + counter => $c->counter, + delete_at_first_view => $c->delete_at_first_view, + delete_at_day => $c->delete_at_day, + created_at => $c->created_at, + created_by => $c->created_by, + last_access_at => $c->last_access_at, + mod_token => $c->mod_token, + nbslices => $c->nbslices, + complete => $c->complete, + passwd => $c->passwd, + ); + } else { + my $record = Lufi::DB::SQLite::Files->create( + short => $c->short, + deleted => $c->deleted, + mediatype => $c->mediatype, + filename => $c->filename, + filesize => $c->filesize, + counter => $c->counter, + delete_at_first_view => $c->delete_at_first_view, + delete_at_day => $c->delete_at_day, + created_at => $c->created_at, + created_by => $c->created_by, + last_access_at => $c->last_access_at, + mod_token => $c->mod_token, + nbslices => $c->nbslices, + complete => $c->complete, + passwd => $c->passwd, + ); + $c->record($record); + } + + return $c; +} + +sub count_empty { + my $c = shift; + + return Lufi::DB::SQLite::Files->count('WHERE created_at IS NULL'); +} + +sub already_exists { + my $c = shift; + my $short = shift; + + return Lufi::DB::SQLite::Files->count('WHERE short = ?', $short); +} + +sub get_empty { + my $c = shift; + + my @records = Lufi::DB::SQLite::Files->select('WHERE created_at IS NULL LIMIT 1'); + + return $c->record($records[0])->_slurp->created_at(time)->write; +} + +sub get_stats { + my $c = shift; + + my $files = Lufi::DB::SQLite::Files->count('WHERE created_at IS NOT null AND deleted = 0'); + my $deleted = Lufi::DB::SQLite::Files->count('WHERE created_at IS NOT null AND deleted = 1'); + my $empty = Lufi::DB::SQLite::Files->count('WHERE created_at IS null'); + + return { files => $files, deleted => $deleted, empty => $empty }; +} + +sub from_short { + my $c = shift; + my $short = shift; + + my @records = Lufi::DB::SQLite::Files->select('WHERE short = ?', $short); + + if (scalar @records) { + $c->record($records[0]); + $c->_slurp; + + return $c; + } else { + return undef; + } +} + +sub get_oldest_undeleted_files { + my $c = shift; + my $num = shift; + + my @files = Lufi::DB::SQLite::Files->select('WHERE deleted = 0 ORDER BY created_at ASC LIMIT ?', $num); + + return c(map { Lufi::DB::File->new(app => $c->app, record => $_) } @files); +} + +sub get_expired { + my $c = shift; + my $time = shift; + + ## Select only files expired since two days, to be sure that nobody is still downloading it + my @files = LufiDB::Files->select('WHERE deleted = 0 AND ((delete_at_day + 2) * 86400) < (? - created_at) AND delete_at_day != 0', $time); + + return c(map { Lufi::DB::File->new(app => $c->app, record => $_) } @files); +} + +sub get_no_longer_viewed { + my $c = shift; + my $time = shift; + + my @files = LufiDB::Files->select('WHERE deleted = 0 AND last_access_at < ?', $time); + + return c(map { Lufi::DB::File->new(app => $c->app, record => $_) } @files); +} + +sub delete_creator_before { + my $c = shift; + my $separation = shift; + + Lufi::DB::SQLite->do( + 'UPDATE files SET created_by = NULL WHERE created_by IS NOT NULL AND created_at < ?', + {}, + $separation + ); +} + +sub _slurp { + my $c = shift; + + my @files; + if ($c->record) { + @files = ($c->record); + } elsif ($c->short) { + @files = Lufi::DB::SQLite::Files->select('WHERE short = ?', $c->short); + } + + if (scalar @files) { + my $file = $files[0]; + + $c->short($file->short); + $c->deleted($file->deleted) if defined $file->deleted; + $c->mediatype($file->mediatype) if defined $file->mediatype; + $c->filename($file->filename) if defined $file->filename; + $c->filesize($file->filesize) if defined $file->filesize; + $c->counter($file->counter) if defined $file->counter; + $c->delete_at_first_view($file->delete_at_first_view) if defined $file->delete_at_first_view; + $c->delete_at_day($file->delete_at_day) if defined $file->delete_at_day; + $c->created_at($file->created_at) if defined $file->created_at; + $c->created_by($file->created_by) if defined $file->created_by; + $c->last_access_at($file->last_access_at) if defined $file->last_access_at; + $c->mod_token($file->mod_token) if defined $file->mod_token; + $c->nbslices($file->nbslices) if defined $file->nbslices; + $c->complete($file->complete) if defined $file->complete; + $c->passwd($file->passwd) if defined $file->passwd; + + $c->record($file) unless $c->record; + } + + $c->slices(Lufi::DB::Slice->new(app => $c->app)->get_slices_of_file($c->short)); + + return $c; +} + +1; diff --git a/lib/Lufi/DB/SQLite.pm b/lib/Lufi/DB/SQLite.pm new file mode 100644 index 0000000..4553f56 --- /dev/null +++ b/lib/Lufi/DB/SQLite.pm @@ -0,0 +1,64 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: +package Lufi::DB::SQLite; +use Mojolicious; +use Mojo::File; +use FindBin qw($Bin); + +BEGIN { + my $m = Mojolicious->new; + my $cfile = Mojo::File->new($Bin, '..' , 'lufi.conf'); + if (defined $ENV{MOJO_CONFIG}) { + $cfile = Mojo::File->new($ENV{MOJO_CONFIG}); + unless (-e $cfile->to_abs) { + $cfile = Mojo::File->new($Bin, '..', $ENV{MOJO_CONFIG}); + } + } + our $config = $m->plugin('Config' => + { + file => $cfile->to_abs->to_string, + default => { + db_path => 'lufi.db' + } + } + ); +} + +# Create database +use ORLite { + file => $config->{db_path}, + unicode => 1, + create => sub { + my $dbh = shift; + $dbh->do( + 'CREATE TABLE files ( + short TEXT PRIMARY KEY, + deleted INTEGER, + mediatype TEXT, + filename TEXT, + filesize INTEGER, + counter INTEGER, + delete_at_first_view INTEGER, + delete_at_day INTEGER, + created_at INTEGER, + created_by TEXT, + last_access_at INTEGER, + mod_token TEXT, + nbslices INTEGER, + complete INTEGER, + passwd TEXT)' + ); + $dbh->do( + 'CREATE TABLE slices ( + short TEXT, + j INTEGER, + path TEXT, + FOREIGN KEY (short) REFERENCES files(short))' + ); + $dbh->do( + 'CREATE INDEX slices_idx ON slices(short)' + ); + return 1; + } +}; + +1; diff --git a/lib/Lufi/DB/Slice.pm b/lib/Lufi/DB/Slice.pm new file mode 100644 index 0000000..b350071 --- /dev/null +++ b/lib/Lufi/DB/Slice.pm @@ -0,0 +1,104 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: +package Lufi::DB::Slice; +use Mojo::Base -base; + +has 'short'; +has 'j'; +has 'path'; +has 'app'; + +=head1 NAME + +Lufi::DB::Slice - DB abstraction layer for Lufi file + +=head1 Contributing + +When creating a new database accessor, make sure that it provides the following subroutines. +After that, modify this file and modify the C subroutine to allow to use your accessor. + +Have a look at Lufi::DB::Slice::SQLite's code: it's simple and may be more understandable that this doc. + +=head1 Attributes + +=over 1 + +=item B : string + +=item B : integer + +=item B : string + +=item B : A mojolicious object + +=back + +=head1 Sub routines + +=head2 new + +=over 1 + +=item B : C<$c = Lufi::DB::Slice-Enew(app =E $self);> + +=item B : any of the attribute above + +=item B : construct a new db accessor object. If the C attribute is provided, it have to load the informations from the database. + +=item B : the db accessor object + +=item B : the app argument is used by Lufi::DB::Slice to choose which db accessor will be used, you don't need to use it in new(), but you can use it to access helpers or configuration settings in the other subroutines + +=back + +=cut + +sub new { + my $c = shift; + + $c = $c->SUPER::new(@_); + + if (ref($c) eq 'Lufi::DB::Slice') { + my $dbtype = $c->app->config('dbtype'); + if ($dbtype eq 'sqlite') { + use Lufi::DB::Slice::SQLite; + $c = Lufi::DB::Slice::SQLite->new(@_); + } elsif ($dbtype eq 'postgresql') { + use Lufi::DB::Slice::Pg; + $c = Lufi::DB::Slice::Pg->new(@_); + } + } + + return $c; +} + +=head2 write + +=over 1 + +=item B : C<$c-Ewrite> + +=item B : none + +=item B : create or update a record in the database, with the values of the object's attributes + +=item B : the db accessor object + +=back + +=head2 get_slices_of_file + +=over 1 + +=item B : C<$c-Eget_slices_of_file($short)> + +=item B : string + +=item B : get all Lufi::DB::Slice objects related to a file + +=item B : a Mojo::Collection of Lufi::DB::Slice objects + +=back + +=cut + +1; diff --git a/lib/Lufi/DB/Slice/Pg.pm b/lib/Lufi/DB/Slice/Pg.pm new file mode 100644 index 0000000..5744b49 --- /dev/null +++ b/lib/Lufi/DB/Slice/Pg.pm @@ -0,0 +1,73 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: +package Lufi::DB::Slice::Pg; +use Mojo::Base 'Lufi::DB::Slice'; +use Mojo::Collection 'c'; + +has 'record' => 0; + +sub new { + my $c = shift; + + $c = $c->SUPER::new(@_); + + return $c; +} + +sub write { + my $c = shift; + + if ($c->record) { + $c->app->pg->db->query('UPDATE slices SET short = ?, j = ?, path = ? WHERE short = ? AND j = ?', $c->short, $c->j, $c->path, $c->short, $c->j); + } else { + $c->app->pg->db->query('INSERT INTO slices (short, j, path) VALUES (?, ?, ?)', $c->short, $c->j, $c->path); + $c->record(1); + } + + return $c; +} + +sub get_slices_of_file { + my $c = shift; + my $short = shift; + + my @slices; + my $records = $c->app->pg->db->query('SELECT * FROM slices WHERE short = ? ORDER BY j ASC', $short)->hashes; + $records->each( + sub { + my ($e, $num) = @_; + my $i = Lufi::DB::Slice->new(app => $c->app); + + push @slices, $i->_slurp($e); + } + ); + + return c(@slices); +} + +sub _slurp { + my $c = shift; + my $r = shift; + + my $slice; + if (defined $r) { + $slice = $r; + } else { + my $slices = $c->app->pg->db->query('SELECT * FROM slices WHERE short = ? AND j = ?', $c->short, $c->j)->hashes; + + if ($slices->size) { + $slice = $slices->first; + } + } + + if ($slice) { + $c->short($slice->{short}); + $c->j($slice->{j}); + $c->path($slice->{path}); + + $c->record(1); + } + + return $c; +} + +1; diff --git a/lib/Lufi/DB/Slice/SQLite.pm b/lib/Lufi/DB/Slice/SQLite.pm new file mode 100644 index 0000000..5927f9b --- /dev/null +++ b/lib/Lufi/DB/Slice/SQLite.pm @@ -0,0 +1,59 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: +package Lufi::DB::Slice::SQLite; +use Mojo::Base 'Lufi::DB::Slice'; +use Lufi::DB::SQLite; +use Mojo::Collection 'c'; + +has 'record'; + +sub new { + my $c = shift; + + $c = $c->SUPER::new(@_); + + $c = $c->_slurp if defined $c->record; + + return $c; +} + +sub write { + my $c = shift; + + if (defined $c->record) { + $c->record->update( + short => $c->short, + j => $c->j, + path => $c->path + ); + } else { + my $record = Lufi::DB::SQLite::Slices->create( + short => $c->short, + j => $c->j, + path => $c->path + ); + $c->record($record); + } + + return $c; +} + +sub get_slices_of_file { + my $c = shift; + my $short = shift; + + my @slices = Lufi::DB::SQLite::Slices->select('WHERE short = ? ORDER BY j ASC', $short); + + return c(map { Lufi::DB::Slice->new(app => $c->app, record => $_) } @slices); +} + +sub _slurp { + my $c = shift; + + $c->short($c->record->short) if defined $c->record->short; + $c->j($c->record->j) if defined $c->record->j; + $c->path($c->record->path) if defined $c->record->path; + + return $c; +} + +1; diff --git a/lib/Lufi/File.pm b/lib/Lufi/File.pm deleted file mode 100644 index 584eda4..0000000 --- a/lib/Lufi/File.pm +++ /dev/null @@ -1,100 +0,0 @@ -# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: -package Lufi::File; -use Mojo::Base -base; -use Mojo::Collection; -use LufiDB; -use Lufi::Slice; - -has 'record'; -has 'short'; -has 'deleted' => 0; -has 'mediatype'; -has 'filename'; -has 'filesize'; -has 'counter' => 0; -has 'delete_at_first_view' => 0; -has 'delete_at_day'; -has 'created_at' => sub { - return time; -}; -has 'created_by'; -has 'last_access_at'; -has 'mod_token'; -has 'nbslices'; -has 'complete' => 0; -has 'slices' => sub { - return Mojo::Collection->new(); -}; - -sub new { - my $c = shift; - - $c = $c->SUPER::new(@_); - - $c = $c->_slurp if defined $c->record; - - return $c; -} - -sub write { - my $c = shift; - - $c->record->update( - deleted => $c->deleted, - mediatype => $c->mediatype, - filename => $c->filename, - filesize => $c->filesize, - counter => $c->counter, - delete_at_first_view => $c->delete_at_first_view, - delete_at_day => $c->delete_at_day, - created_at => $c->created_at, - created_by => $c->created_by, - last_access_at => $c->last_access_at, - mod_token => $c->mod_token, - nbslices => $c->nbslices, - complete => $c->complete, - ); - - return $c; -} - -sub delete { - my $c = shift; - - $c->slices->each(sub { - my ($e, $num) = @_; - unlink $e->path; - }); - $c->deleted(1); - - $c->write; - - return $c; -} - -sub _slurp { - my $c = shift; - - $c->short($c->record->short); - $c->deleted($c->record->deleted) if defined $c->record->deleted; - $c->mediatype($c->record->mediatype) if defined $c->record->mediatype; - $c->filename($c->record->filename) if defined $c->record->filename; - $c->filesize($c->record->filesize) if defined $c->record->filesize; - $c->counter($c->record->counter) if defined $c->record->counter; - $c->delete_at_first_view($c->record->delete_at_first_view) if defined $c->record->delete_at_first_view; - $c->delete_at_day($c->record->delete_at_day) if defined $c->record->delete_at_day; - $c->created_at($c->record->created_at) if defined $c->record->created_at; - $c->created_by($c->record->created_by) if defined $c->record->created_by; - $c->last_access_at($c->record->last_access_at) if defined $c->record->last_access_at; - $c->mod_token($c->record->mod_token) if defined $c->record->mod_token; - $c->nbslices($c->record->nbslices) if defined $c->record->nbslices; - $c->complete($c->record->complete) if defined $c->record->complete; - - my @slices = LufiDB::Slices->select('WHERE short = ? ORDER BY j ASC', $c->short); - - $c->slices(Mojo::Collection->new(map { Lufi::Slice->new(record => $_) } @slices)); - - return $c; -} - -1; diff --git a/lib/Lufi/Plugin/Helpers.pm b/lib/Lufi/Plugin/Helpers.pm new file mode 100644 index 0000000..518f3fe --- /dev/null +++ b/lib/Lufi/Plugin/Helpers.pm @@ -0,0 +1,134 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: +package Lufi::Plugin::Helpers; +use Mojo::Base 'Mojolicious::Plugin'; +use Lufi::DB::File; +use Data::Entropy qw(entropy_source); + +sub register { + my ($self, $app) = @_; + + $app->plugin('PgURLHelper'); + + if ($app->config('dbtype') eq 'postgresql') { + use Mojo::Pg; + $app->helper(pg => \&_pg); + + # Database migration + my $migrations = Mojo::Pg::Migrations->new(pg => $app->pg); + if ($app->mode eq 'development' && $ENV{LUFI_DEV}) { + $migrations->from_file('utilities/migrations_pg.sql')->migrate(0)->migrate(1); + } else { + $migrations->from_file('utilities/migrations_pg.sql')->migrate(1); + } + } elsif ($app->config('dbtype') eq 'sqlite') { + # SQLite database migration if needed + use Lufi::DB::SQLite; + my $columns = Lufi::DB::SQLite::Files->table_info; + my $pwd_col = 0; + foreach my $col (@{$columns}) { + $pwd_col = 1 if $col->{name} eq 'passwd'; + } + unless ($pwd_col) { + Lufi::DB::SQLite->do('ALTER TABLE files ADD COLUMN passwd TEXT;'); + } + } + + $app->helper(provisioning => \&_provisioning); + $app->helper(get_empty => \&_get_empty); + $app->helper(shortener => \&_shortener); + $app->helper(ip => \&_ip); + $app->helper(default_delay => \&_default_delay); + $app->helper(max_delay => \&_max_delay); + $app->helper(is_selected => \&_is_selected); + $app->helper(stop_upload => \&_stop_upload); +} + +sub _pg { + my $c = shift; + + state $pg = Mojo::Pg->new($c->app->pg_url($c->app->config('pgdb'))); + return $pg; +} + +sub _provisioning { + my $c = shift; + + # Create some short patterns for provisioning + my $ldfile = Lufi::DB::File->new(app => $c->app); + if ($ldfile->count_empty < $c->app->config('provisioning')) { + for (my $i = 0; $i < $c->app->config('provis_step'); $i++) { + my $short; + do { + $short = $c->shortener($c->app->config('length')); + } while ($ldfile->already_exists($short)); + + $ldfile->created_at(undef)->short($short)->write; + } + } +} + +sub _get_empty { + my $c = shift; + + my $ldfile = Lufi::DB::File->new(app => $c->app)->get_empty; + + return $ldfile; +} + +sub _shortener { + my $c = shift; + my $length = shift; + + my @chars = ('a'..'z','A'..'Z','0'..'9', '-', '_'); + my $result = ''; + foreach (1..$length) { + $result .= $chars[entropy_source->get_int(scalar(@chars))]; + } + return $result; +} + +sub _ip { + my $c = shift; + my $proxy = $c->req->headers->header('X-Forwarded-For'); + my $ip = ($proxy) ? $proxy : $c->tx->remote_address; + my $remote_port = (defined($c->req->headers->header('X-Remote-Port'))) ? $c->req->headers->header('X-Remote-Port') : $c->tx->remote_port; + + return "$ip remote port:$remote_port"; +} + +sub _default_delay { + my $c = shift; + + return $c->app->config('default_delay') if ($c->app->config('default_delay') >= 0); + + warn "default_delay set to a negative value. Default to 0."; + return 0; +} + +sub _max_delay { + my $c = shift; + + return $c->app->config('max_delay') if ($c->app->config('max_delay') >= 0); + + warn "max_delay set to a negative value. Default to 0."; + return 0; +} + +sub _is_selected { + my $c = shift; + my $num = shift; + + return ($num == $c->max_delay) ? 'selected="selected"' : '' if ($c->max_delay && !$c->default_delay); + return ($num == $c->default_delay) ? 'selected="selected"' : ''; +} + +sub _stop_upload { + my $c = shift; + + if (-f 'stop-upload' || -f 'stop-upload.manual') { + return 1; + } + return 0; +} + +1; diff --git a/lib/Lufi/Slice.pm b/lib/Lufi/Slice.pm deleted file mode 100644 index 2821032..0000000 --- a/lib/Lufi/Slice.pm +++ /dev/null @@ -1,52 +0,0 @@ -# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: -package Lufi::Slice; -use Mojo::Base -base; -use LufiDB; - -has 'record'; -has 'short'; -has 'j'; -has 'path'; - -sub new { - my $c = shift; - - $c = $c->SUPER::new(@_); - - $c = $c->_slurp if defined $c->record; - - return $c; -} - -sub write { - my $c = shift; - - if (defined $c->record) { - $c->record->update( - short => $c->short, - j => $c->j, - path => $c->path - ); - } else { - my $record = LufiDB::Slices->create( - short => $c->short, - j => $c->j, - path => $c->path - ); - $c->record($record); - } - - return $c; -} - -sub _slurp { - my $c = shift; - - $c->short($c->record->short) if defined $c->record->short; - $c->j($c->record->j) if defined $c->record->j; - $c->path($c->record->path) if defined $c->record->path; - - return $c; -} - -1; diff --git a/lib/LufiDB.pm b/lib/LufiDB.pm deleted file mode 100644 index 6d35470..0000000 --- a/lib/LufiDB.pm +++ /dev/null @@ -1,56 +0,0 @@ -# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: -package LufiDB; -use Mojolicious; -use FindBin qw($Bin); -use File::Spec::Functions; - -BEGIN { - my $m = Mojolicious->new; - our $config = $m->plugin('Config' => - { - file => catfile($Bin, '..' ,'lufi.conf'), - default => { - db_path => 'lufi.db' - } - } - ); -} - -# Create database -use ORLite { - file => $config->{db_path}, - unicode => 1, - create => sub { - my $dbh = shift; - $dbh->do( - 'CREATE TABLE files ( - short TEXT PRIMARY KEY, - deleted INTEGER, - mediatype TEXT, - filename TEXT, - filesize INTEGER, - counter INTEGER, - delete_at_first_view INTEGER, - delete_at_day INTEGER, - created_at INTEGER, - created_by TEXT, - last_access_at INTEGER, - mod_token TEXT, - nbslices INTEGER, - complete INTEGER)' - ); - $dbh->do( - 'CREATE TABLE slices ( - short TEXT, - j INTEGER, - path TEXT, - FOREIGN KEY (short) REFERENCES files(short))' - ); - $dbh->do( - 'CREATE INDEX slices_idx ON slices(short)' - ); - return 1; - } -}; - -1; diff --git a/lib/Mounter.pm b/lib/Mounter.pm index 9860253..ab2d6fc 100644 --- a/lib/Mounter.pm +++ b/lib/Mounter.pm @@ -19,6 +19,9 @@ sub startup { } ); + # Helpers + $self->plugin('Lufi::Plugin::Helpers'); + # Themes handling shift @{$self->static->paths}; if ($config->{theme} ne 'default') { diff --git a/lufi.conf.template b/lufi.conf.template old mode 100755 new mode 100644 index e07139d..ac0b7f2 --- a/lufi.conf.template +++ b/lufi.conf.template @@ -107,12 +107,28 @@ # Optional, default to no-reply@lufi.io #mail_sender => 'no-reply@lufi.io', + # choose what database you want to use + # valid choices are sqlite and postgresql (all lowercase) + # optional, default is sqlite + #dbtype => 'sqlite', + + # SQLite ONLY - only used if dbtype is set to sqlite # define a path to the SQLite database # you can define it relative to lufi directory or set an absolute path # remember that it has to be in a directory writable by Lufi user # optional, default is lufi.db #db_path => 'lufi.db', + # PostgreSQL ONLY - only used if dbtype is set to postgresql + # these are the credentials to access the PostgreSQL database + # mandatory if you choosed postgresql as dbtype + #pgdb => { + # database => 'lufi', + # host => 'localhost', + # #user => 'DBUSER', + # #pwd => 'DBPASSWORD' + #}, + # define a path to the upload directory, where the uploaded files will be stored # you can define it relative to lufi directory or set an absolute path # remember that it has to be in a directory writable by Lufi user @@ -141,6 +157,10 @@ # optional, default is 3600 #session_duration => 3600, + # allow to add a password on files, asked before allowing to download files + # optional, default to 0 + #allow_pwd_on_files => 0, + ######################### # Lufi cron jobs settings ######################### diff --git a/themes/default/lib/Lufi/I18N/ca.po b/themes/default/lib/Lufi/I18N/ca.po index d5602b3..85ff22c 100644 --- a/themes/default/lib/Lufi/I18N/ca.po +++ b/themes/default/lib/Lufi/I18N/ca.po @@ -20,9 +20,7 @@ msgstr "" #. ($delay) #. (max_delay) -#: themes/default/templates/index.html.ep:40 -#: themes/default/templates/index.html.ep:49 -#: themes/default/templates/index.html.ep:50 +#: themes/default/templates/index.html.ep:40 themes/default/templates/index.html.ep:49 themes/default/templates/index.html.ep:50 msgid "%1 days" msgstr "%1 dies" @@ -30,8 +28,7 @@ msgstr "%1 dies" msgid "1 year" msgstr "1 any" -#: themes/default/templates/index.html.ep:4 -#: themes/default/templates/index.html.ep:49 +#: themes/default/templates/index.html.ep:4 themes/default/templates/index.html.ep:49 msgid "24 hours" msgstr "24 hores" @@ -40,41 +37,27 @@ msgid ":" msgstr ":" #: themes/default/templates/about.html.ep:16 -msgid "" -"A thank you with a photo of kitten on Diaspora* or " -"Twitter is " -"cool too ;-)" -msgstr "" -"Un agraïment amb la foto d'un gatet a Diaspora* o " -"a Twitter " -"també fa goig ;-)" +msgid "A thank you with a photo of kitten on Diaspora* or Mastodon is cool too ;-)" +msgstr "Un agraïment amb la foto d'un gatet a Diaspora* o a Mastodon també fa goig ;-)" -#: themes/default/templates/render.html.ep:34 +#: themes/default/templates/render.html.ep:42 msgid "Abort" msgstr "Avorta" -#: themes/default/templates/layouts/default.html.ep:40 -#: themes/default/templates/layouts/default.html.ep:52 +#: themes/default/templates/layouts/default.html.ep:65 themes/default/templates/layouts/default.html.ep:77 msgid "About" msgstr "Quant a" -#: themes/default/templates/about.html.ep:18 -msgid "" -"As Lufi is a free software licensed under of the terms of the AGPLv3, you can " -"install it on you own server. Have a look on the Wiki for the procedure." +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" msgstr "" -"Com que Lufi és programari lliure, autoritzat sota els termes de l'AGPLv3, el " -"podeu instal·lar al vostre propi servidor. Pel que fa a com fer-ho, feu un " -"cop d'ull al Wiki." + +#: themes/default/templates/about.html.ep:18 +msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." +msgstr "Com que Lufi és programari lliure, autoritzat sota els termes de l'AGPLv3, el podeu instal·lar al vostre propi servidor. Pel que fa a com fer-ho, feu un cop d'ull al Wiki." #. (stash('f') -#: themes/default/templates/render.html.ep:44 +#: themes/default/templates/render.html.ep:52 msgid "Asking for file part XX1 of %1" msgstr "Demanem la part XX1 de %1 del fitxer" @@ -82,15 +65,15 @@ msgstr "Demanem la part XX1 de %1 del fitxer" msgid "Back to homepage" msgstr "Retorna a la pàgina d'inici" -#: lib/Lufi/Controller/Mail.pm:20 +#: lib/Lufi/Controller/Mail.pm:21 msgid "Bad CSRF token!" msgstr "Mal testimoni CSRF!" -#: themes/default/templates/render.html.ep:40 +#: themes/default/templates/render.html.ep:48 msgid "Click here to refresh the page and restart the download." msgstr "Premeu aquí per tal de refrescar la pàgina i reiniciar la descàrrega" -#: themes/default/templates/index.html.ep:72 +#: themes/default/templates/index.html.ep:80 msgid "Click to open the file browser" msgstr "Premeu per obrir la selecció de fitxer." @@ -102,78 +85,63 @@ msgstr "Tanca" msgid "Comma-separated email addresses" msgstr "Adreces de correu electrònic separades per comes" -#: themes/default/templates/index.html.ep:92 +#: themes/default/templates/index.html.ep:100 msgid "Copy all links to clipboard" msgstr "Copia tots els enllaços al porta-retalls" -#: themes/default/templates/index.html.ep:95 +#: themes/default/templates/index.html.ep:103 msgid "Copy to clipboard" msgstr "Copia al porta-retalls" -#: lib/Lufi/Controller/Files.pm:396 +#: lib/Lufi/Controller/Files.pm:429 msgid "Could not delete the file. You are not authenticated." msgstr "No es pot esborrar el fitxer. No esteu autenticat." -#: lib/Lufi/Controller/Files.pm:380 +#: lib/Lufi/Controller/Files.pm:411 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "No es troba el fitxer. Esteu segur de la URL i el testimoni?" -#: lib/Lufi/Controller/Files.pm:296 +#: lib/Lufi/Controller/Files.pm:322 msgid "Could not find the file. Are you sure of the URL?" msgstr "No trobo el fitxer. Esteu segurs de la URL?" -#: themes/default/templates/files.html.ep:26 +#: themes/default/templates/files.html.ep:28 msgid "Counter" msgstr "Comptador" -#: themes/default/templates/files.html.ep:27 -#: themes/default/templates/index.html.ep:64 +#: themes/default/templates/files.html.ep:29 themes/default/templates/index.html.ep:64 msgid "Delete at first download?" msgstr "Eliminar-lo a la primera descàrrega?" -#: themes/default/templates/files.html.ep:30 -#: themes/default/templates/index.html.ep:96 +#: themes/default/templates/files.html.ep:18 +msgid "Delete selected files" +msgstr "" + +#: themes/default/templates/files.html.ep:32 themes/default/templates/index.html.ep:104 msgid "Deletion link" msgstr "Enllaç per a eliminació" #: themes/default/templates/delays.html.ep:8 -msgid "" -"Don't worry: if a user begins to download the file before the expiration and " -"the download ends after the expiration, he will be able to get the file." -msgstr "" -"No patiu per si un usuari comença a descarregar el fitxer abans de " -"l'expiració i la descàrrega acaba després de l'expiració, encara podrà " -"obtenir el fitxer." +msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." +msgstr "No patiu per si un usuari comença a descarregar el fitxer abans de l'expiració i la descàrrega acaba després de l'expiració, encara podrà obtenir el fitxer." -#: themes/default/templates/index.html.ep:98 +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 msgid "Download" msgstr "Descàrrega" -#: themes/default/templates/render.html.ep:39 +#: themes/default/templates/render.html.ep:47 msgid "Download aborted." msgstr "Descàrrega avortada." -#: themes/default/templates/files.html.ep:25 -#: themes/default/templates/index.html.ep:97 +#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:105 msgid "Download link" msgstr "Enllaç per a descàrrega" #: themes/default/templates/about.html.ep:10 -msgid "" -"Drag and drop files in the appropriate area or use the traditional way to " -"send files and the files will be chunked, encrypted and sent to the server. " -"You will get two links per file: a download link, that you give to the " -"people you want to share the file with and a deletion link, allowing you to " -"delete the file whenever you want." -msgstr "" -"Arrossegueu i deixeu anar fitxers a l'àrea apropiada o useu el sistema " -"tradicional per enviar fitxers, i seran trossejats, xifrats i enviats al " -"servidor. Obtindreu dos enllaços per a cada fitxer: un enllaç per a la " -"descàrrega, que doneu a la gent amb qui voleu compartir el fitxer, i un " -"enllaç per a l'eliminació, que us permet eliminar el fitxer del servidor " -"quan vulgueu. " - -#: themes/default/templates/index.html.ep:69 +msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." +msgstr "Arrossegueu i deixeu anar fitxers a l'àrea apropiada o useu el sistema tradicional per enviar fitxers, i seran trossejats, xifrats i enviats al servidor. Obtindreu dos enllaços per a cada fitxer: un enllaç per a la descàrrega, que doneu a la gent amb qui voleu compartir el fitxer, i un enllaç per a l'eliminació, que us permet eliminar el fitxer del servidor quan vulgueu. " + +#: themes/default/templates/index.html.ep:77 msgid "Drop files here" msgstr "Deixeu anar aquí fitxers." @@ -185,32 +153,31 @@ msgstr "Cos del correu electrònic" msgid "Email subject" msgstr "Assumpte del correu electrònic" -#: themes/default/templates/mail.html.ep:24 -#: themes/default/templates/mail.html.ep:26 +#: themes/default/templates/mail.html.ep:24 themes/default/templates/mail.html.ep:26 msgid "Emails" msgstr "correus electrònics" -#: themes/default/templates/index.html.ep:99 +#: themes/default/templates/index.html.ep:107 msgid "Encrypting part XX1 of XX2" msgstr "S'està xifrant la part XX1 de XX2" -#: lib/Lufi/Controller/Files.pm:216 +#: lib/Lufi/Controller/Files.pm:225 msgid "Error: the file existed but was deleted." msgstr "Error: el fitxer existia però va ser eliminat." -#: lib/Lufi/Controller/Files.pm:266 +#: lib/Lufi/Controller/Files.pm:291 msgid "Error: the file has not been sent entirely." msgstr "Error: el fitxer no s'ha enviat del tot." -#: lib/Lufi/Controller/Files.pm:276 +#: lib/Lufi/Controller/Files.pm:301 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Error: no trobo el fitxer. Esteu segur de la URL ?" -#: themes/default/templates/index.html.ep:100 +#: themes/default/templates/index.html.ep:108 msgid "Expiration:" msgstr "Expiració:" -#: themes/default/templates/files.html.ep:29 +#: themes/default/templates/files.html.ep:31 msgid "Expires at" msgstr "Expira el" @@ -218,27 +185,21 @@ msgstr "Expira el" msgid "Export localStorage data" msgstr "Exporta dades a l'emmagatzematge local" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:393 msgid "File deleted" msgstr "Fitxer eliminat" -#: themes/default/templates/files.html.ep:24 +#: themes/default/templates/files.html.ep:26 msgid "File name" msgstr "Nom de fitxer" -#: themes/default/templates/render.html.ep:43 +#: themes/default/templates/render.html.ep:51 msgid "Get the file" msgstr "Obté el fitxer" #: themes/default/templates/about.html.ep:19 -msgid "" -"Get the source code on the official repository or on its Github mirror" -msgstr "" -"Obteniu el codi font al repositori oficial o a la seva rèplica a Github" +msgid "Get the source code on the official repository or on its Github mirror" +msgstr "Obteniu el codi font al repositori oficial o a la seva rèplica a Github" #: themes/default/templates/mail.html.ep:78 msgid "Hello,\\n\\nHere's some files I want to share with you:\\n" @@ -248,12 +209,11 @@ msgstr "Hola,\\n\\nVe't aquí uns fitxers que vull compartir amb tu:" msgid "Here's some files" msgstr "Ve't aquí uns fitxers" -#: themes/default/templates/index.html.ep:102 +#: themes/default/templates/index.html.ep:110 msgid "Hit Enter, then Ctrl+C to copy all the download links" -msgstr "" -"Prem Retorn, i després Ctrl+C per copiar tots els enllaços de descàrrega" +msgstr "Prem Retorn, i després Ctrl+C per copiar tots els enllaços de descàrrega" -#: themes/default/templates/index.html.ep:101 +#: themes/default/templates/index.html.ep:109 msgid "Hit Enter, then Ctrl+C to copy the download link" msgstr "Prem Retorn, i després Ctrl+C per copiar l'enllaç de descàrrega" @@ -272,16 +232,11 @@ msgstr "Com informo d'un fitxer iŀlegal?" # delay=temps/retard/dilació/demora/moratòria ? #: themes/default/templates/delays.html.ep:7 msgid "If you choose a delay, the file will be deleted after that delay." -msgstr "" -"Si seleccioneu una moratòria, el fitxer s'eliminarà passada la moratòria." +msgstr "Si seleccioneu una moratòria, el fitxer s'eliminarà passada la moratòria." #: themes/default/templates/mail.html.ep:15 -msgid "" -"If you send the mail from this server, the links will be sent to the server, " -"which may lower your privacy protection." -msgstr "" -"Si envieu el correu des d'aquest servidor, els enllaços s'enviaran al " -"servidor, i això pot minvar la protecció de la vostra privacitat." +msgid "If you send the mail from this server, the links will be sent to the server, which may lower your privacy protection." +msgstr "Si envieu el correu des d'aquest servidor, els enllaços s'enviaran al servidor, i això pot minvar la protecció de la vostra privacitat." #: themes/default/templates/files.html.ep:14 msgid "Import localStorage data" @@ -295,11 +250,9 @@ msgstr "Importat: més informació sobre moratòries" msgid "Information about delays" msgstr "Informació sobre moratòries" -#: themes/default/templates/render.html.ep:41 -msgid "" -"It seems that the key in your URL is incorrect. Please, verify your URL." -msgstr "" -"Sembla que la clau a l'URL és incorrecta. Si us plau, verifiqueu l'URL." +#: themes/default/templates/render.html.ep:49 +msgid "It seems that the key in your URL is incorrect. Please, verify your URL." +msgstr "Sembla que la clau a l'URL és incorrecta. Si us plau, verifiqueu l'URL." #: themes/default/templates/index.html.ep:12 msgid "Javascript is disabled. You won't be able to use Lufi." @@ -309,8 +262,7 @@ msgstr "Teniu el javascript deactivat. No podreu usar Lufi." msgid "Login" msgstr "Entrada" -#: themes/default/templates/layouts/default.html.ep:42 -#: themes/default/templates/layouts/default.html.ep:54 +#: themes/default/templates/layouts/default.html.ep:67 themes/default/templates/layouts/default.html.ep:79 msgid "Logout" msgstr "Sortida" @@ -318,33 +270,28 @@ msgstr "Sortida" msgid "Lufi is a free (as in free speech) file hosting software." msgstr "Lufi és programari lliure d'allotjament de fitxers." -#: themes/default/templates/files.html.ep:3 -#: themes/default/templates/layouts/default.html.ep:36 -#: themes/default/templates/layouts/default.html.ep:48 +#: themes/default/templates/files.html.ep:33 +msgid "Mail" +msgstr "" + +#: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:61 themes/default/templates/layouts/default.html.ep:73 msgid "My files" msgstr "Els meus fitxers" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:68 +#: lib/Lufi/Controller/Files.pm:69 msgid "No enough space available on the server for this file (size: %1)." msgstr "No hi ha prou espai al servidor per a aquest fitxer (mida: %1)" -#: themes/default/templates/files.html.ep:42 -#: themes/default/templates/index.html.ep:104 +#: themes/default/templates/files.html.ep:45 themes/default/templates/index.html.ep:112 msgid "No expiration delay" msgstr "Sense moratòria d'expiració" #: themes/default/templates/files.html.ep:8 -msgid "" -"Only the files sent with this browser will be listed here. This list is " -"stored in localStorage: if you delete your localStorage data, you'll lose " -"this list." -msgstr "" -"Aquí només apareixen els fitxers enviats amb aquest navegador. La llista es " -"desa en emmagatzematge local: si netegeu l'emmagatzematge local perdreu " -"aquesta llista." +msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." +msgstr "Aquí només apareixen els fitxers enviats amb aquest navegador. La llista es desa en emmagatzematge local: si netegeu l'emmagatzematge local perdreu aquesta llista." -#: themes/default/templates/login.html.ep:21 +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 msgid "Password" msgstr "Contrasenya" @@ -353,13 +300,13 @@ msgstr "Contrasenya" msgid "Please contact the administrator: %1" msgstr "Si us plau contacteu amb l'administrador: %1" -#: themes/default/templates/render.html.ep:25 -msgid "" -"Please wait while we are getting your file. We first need to download and " -"decrypt all parts before you can get it." +#: themes/default/templates/render.html.ep:33 +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." + +#: lib/Lufi.pm:191 +msgid "Please, check your credentials: unable to authenticate." msgstr "" -"Si us plau, espereu mentre obtenim el fitxer. Abans que el tingueu " -"disponible primer cal descarregar i desxifrar tots els trossos." #: themes/default/templates/about.html.ep:5 msgid "Privacy" @@ -370,13 +317,10 @@ msgid "Purge expired files from localStorage" msgstr "Netegeu els fitxers expirats de l'emmagatzematge local." #: themes/default/templates/files.html.ep:9 -msgid "" -"Rows in red mean that the files have expired and are no longer available." -msgstr "" -"Les files en vermell indiquen que els fitxers han expirat i ja no són " -"disponibles." +msgid "Rows in red mean that the files have expired and are no longer available." +msgstr "Les files en vermell indiquen que els fitxers han expirat i ja no són disponibles." -#: themes/default/templates/index.html.ep:103 +#: themes/default/templates/index.html.ep:111 msgid "Send all links by email" msgstr "Envia tots els enllaços per correu electrònic" @@ -388,150 +332,114 @@ msgstr "Envia amb aquest servidor" msgid "Send with your own mail software" msgstr "Envia amb el vostre propi programa de correu" -#: themes/default/templates/index.html.ep:105 -msgid "" -"Sending part XX1 of XX2. Please, be patient, the progress bar can take a " -"while to move." -msgstr "" -"S'està enviant el tros XX1 de XX2. Si us plau, paciència; la barra de " -"progrés pot trigar una mica a bellugar-se. " +#: themes/default/templates/index.html.ep:113 +msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." +msgstr "S'està enviant el tros XX1 de XX2. Si us plau, paciència; la barra de progrés pot trigar una mica a bellugar-se. " #. (url_for('/') #: themes/default/templates/mail.html.ep:91 msgid "Share your files in total privacy on %1" msgstr "Compartiu fitxers amb total privacitat a %1" -#: themes/default/templates/layouts/default.html.ep:38 -#: themes/default/templates/layouts/default.html.ep:50 -#: themes/default/templates/login.html.ep:26 -#: themes/default/templates/logout.html.ep:8 +#: themes/default/templates/layouts/default.html.ep:63 themes/default/templates/layouts/default.html.ep:75 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 msgid "Signin" msgstr "Autenticació" +#: lib/Lufi.pm:194 +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 "" + #: themes/default/templates/index.html.ep:30 msgid "Sorry, the uploading is currently disabled. Please try again later." -msgstr "" -"Disculpeu, les pujades estan actualment desactivades. Si us plau proveu-ho " -"més tard." +msgstr "Disculpeu, les pujades estan actualment desactivades. Si us plau proveu-ho més tard." -#: lib/Lufi/Controller/Files.pm:42 +#: lib/Lufi/Controller/Files.pm:43 msgid "Sorry, uploading is disabled." msgstr "Disculpeu, les pujades estan deshabilitades" #: themes/default/templates/about.html.ep:7 -msgid "" -"The administrator can only see the file's name, its size and its mimetype " -"(what kind of file it is: video, text, etc.)." +msgid "The administrator can only see the file's name, its size and its mimetype (what kind of file it is: video, text, etc.)." msgstr "" "L'administrador només pot veure el nom del fitxer, la seva mida i el seu\n" "mimetype (quina mena de fitxer és: vídeo, text, etc.)" -#: themes/default/templates/files.html.ep:43 +#: themes/default/templates/files.html.ep:46 msgid "The data has been successfully imported." msgstr "La importació de les dades ha reeixit." -#: lib/Lufi/Controller/Mail.pm:42 +#: lib/Lufi/Controller/Mail.pm:43 msgid "The email body can't be empty." msgstr "El cos del correu no pot estar buit." -#: lib/Lufi/Controller/Mail.pm:41 +#: lib/Lufi/Controller/Mail.pm:42 msgid "The email subject can't be empty." msgstr "L'assumpte dle correu no pot estar buit." -#: lib/Lufi/Controller/Files.pm:361 +#: lib/Lufi/Controller/Files.pm:390 msgid "The file has already been deleted" msgstr "El fitxer ja ha estat esborrat" #: themes/default/templates/about.html.ep:6 -msgid "" -"The files uploaded on a Lufi instance are encrypted before the upload to the " -"server: the administrator of the server can not see the file's content." -msgstr "" -"Els fitxers que es pugen a una instaŀlació de Lufi són xifrats abans de " -"pujar-los al servidor i l'administrador del servidor no pot veure el " -"contingut del fitxer." +msgid "The files uploaded on a Lufi instance are encrypted before the upload to the server: the administrator of the server can not see the file's content." +msgstr "Els fitxers que es pugen a una instaŀlació de Lufi són xifrats abans de pujar-los al servidor i l'administrador del servidor no pot veure el contingut del fitxer." #. (join(', ', @bad) -#: lib/Lufi/Controller/Mail.pm:37 +#: lib/Lufi/Controller/Mail.pm:38 msgid "The following email addresses are not valid: %1" msgstr "Les següents adreces de correu electrònic no són vàlides: %1" -#: themes/default/templates/index.html.ep:93 +#: themes/default/templates/index.html.ep:101 msgid "The link(s) has been copied to your clipboard" msgstr "L'enllaç/ els enllaços ja estan copiats al portaretalls" -#: lib/Lufi/Controller/Mail.pm:65 +#: lib/Lufi/Controller/Mail.pm:66 msgid "The mail has been sent." msgstr "El correu ja està enviat." #: themes/default/templates/about.html.ep:15 -msgid "" -"The original (and only for now) author is Luc Didry. If you want to support him, you can do it " -"via Tipeee " -"or via Liberapay." -msgstr "" -"L'autor original (i per ara l'únic) és Luc Didry. Si voleu fer una contribució podeu fer-ho via Tipeee o via " -"Liberapay." +msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." +msgstr "L'autor original (i per ara l'únic) és Luc Didry. Si voleu fer una contribució podeu fer-ho via Tipeee o via Liberapay." -#: lib/Lufi/Controller/Files.pm:168 -msgid "" -"The server was unable to find the file record to add your file part to. " -"Please, contact the administrator." -msgstr "" -"El servidor no ha pogut trobar el registre del fitxer per afegir-hi el tros " -"del fitxer. Si us plau, contacteu l'administrador." +#: lib/Lufi/Controller/Files.pm:179 +msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." +msgstr "El servidor no ha pogut trobar el registre del fitxer per afegir-hi el tros del fitxer. Si us plau, contacteu l'administrador." #: themes/default/templates/delays.html.ep:10 -msgid "" -"This server sets limitations according to the file size. The expiration " -"delay of your file will be the minimum between what you choose and the " -"following limitations:" -msgstr "" -"Aquest servidor estableix limitacions segons la mida del fitxer. La " -"moratòria d'expiració del fitxer serà el mínim de l'escollida i aquestes " -"limitacions:" +msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" +msgstr "Aquest servidor estableix limitacions segons la mida del fitxer. La moratòria d'expiració del fitxer serà el mínim de l'escollida i aquestes limitacions:" -#: themes/default/templates/index.html.ep:94 +#: themes/default/templates/index.html.ep:102 msgid "Unable to copy the link(s) to your clipboard" msgstr "No s'han pogut copiar l'enllaç o els enllaços al porta-retalls." #. ($short) -#: lib/Lufi/Controller/Files.pm:334 -msgid "" -"Unable to get counter for %1. The file does not exists. It will be removed " -"from your localStorage." -msgstr "" -"No he pogut obtenir el comptador de %1. El fitxer no existeix. Serà eliminat " -"del teu emmagatzematge local." +#: lib/Lufi/Controller/Files.pm:361 +msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." +msgstr "No he pogut obtenir el comptador de %1. El fitxer no existeix. Serà eliminat del teu emmagatzematge local." #. ($short) -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:351 msgid "Unable to get counter for %1. The token is invalid." msgstr "No he pogut obtenir el comptador de %1. El testimoni no és vàlid." #. ($short) -#: lib/Lufi/Controller/Files.pm:344 +#: lib/Lufi/Controller/Files.pm:371 msgid "Unable to get counter for %1. You are not authenticated." msgstr "No he pogut obtenir el comptador de %1. No esteu autenticat." -#: themes/default/templates/layouts/default.html.ep:35 -#: themes/default/templates/layouts/default.html.ep:47 +#: themes/default/templates/layouts/default.html.ep:60 themes/default/templates/layouts/default.html.ep:72 msgid "Upload files" msgstr "Pujar fitxers" -#: themes/default/templates/files.html.ep:28 +#: themes/default/templates/files.html.ep:30 msgid "Uploaded at" msgstr "Pujat a les" -#: themes/default/templates/index.html.ep:77 +#: themes/default/templates/index.html.ep:85 msgid "Uploaded files" msgstr "Fitxers pujats" -#: themes/default/templates/index.html.ep:106 +#: themes/default/templates/index.html.ep:114 msgid "Websocket communication error" msgstr "Error de comunicacions del websocket" @@ -544,60 +452,42 @@ msgid "Who wrote this software?" msgstr "Qui va escriure aquest programa?" #: themes/default/templates/about.html.ep:11 -msgid "" -"You can see the list of your files by clicking on the \"My files\" link at " -"the top right of this page." -msgstr "" -"Podeu veure la llista dels vostres fitxers amb a l'enllaç \"Els meus fitxers" -"\" a dalt a la dreta d'aquesta pàgina." +msgid "You can see the list of your files by clicking on the \"My files\" link at the top right of this page." +msgstr "Podeu veure la llista dels vostres fitxers amb a l'enllaç \"Els meus fitxers\" a dalt a la dreta d'aquesta pàgina." #: themes/default/templates/about.html.ep:8 -msgid "" -"You don't need to register yourself to upload files but be aware that, for " -"legal reasons, your IP address will be stored when you send a file. Don't " -"panic, this is normally the case for all sites on which you send files." -msgstr "" -"No cal que us inscriviu per a pujar fitxers però tingueu en compte, que per " -"raons legals, s'enregistrarà la vostra adreça IP quan envieu un fitxer. No " -"us espanteu, això és el que normalment passa a tots els webs on pugeu " -"fitxers." +msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." +msgstr "No cal que us inscriviu per a pujar fitxers però tingueu en compte, que per raons legals, s'enregistrarà la vostra adreça IP quan envieu un fitxer. No us espanteu, això és el que normalment passa a tots els webs on pugeu fitxers." -#: themes/default/templates/render.html.ep:45 -msgid "" -"You don't seem to have a key in your URL. You won't be able to decrypt the " -"file. Download canceled." -msgstr "" -"No sembla que hi hagi una clau a la URL. No podreu desxifrar el fitxer. " -"Descàrrega canceŀlada." +#: themes/default/templates/render.html.ep:53 +msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." +msgstr "No sembla que hi hagi una clau a la URL. No podreu desxifrar el fitxer. Descàrrega canceŀlada." -#: themes/default/templates/render.html.ep:42 -msgid "" -"You have attempted to leave this page. The download will be canceled. Are " -"you sure?" -msgstr "" -"Heu intentat deixar aquesta pàgina. Es canceŀlarà la descàrrega. N'esteu " -"segur?" +#: themes/default/templates/render.html.ep:50 +msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" +msgstr "Heu intentat deixar aquesta pàgina. Es canceŀlarà la descàrrega. N'esteu segur?" -#: themes/default/templates/index.html.ep:91 -msgid "" -"You have attempted to leave this page. The upload will be canceled. Are you " -"sure?" -msgstr "" -"Heu intentat deixar aquesta pàgina. Es canceŀlarà la pujada. N'esteu segur?" +#: themes/default/templates/index.html.ep:99 +msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" +msgstr "Heu intentat deixar aquesta pàgina. Es canceŀlarà la pujada. N'esteu segur?" #: themes/default/templates/logout.html.ep:5 msgid "You have been successfully logged out." msgstr "Heu sortit correctament." -#: lib/Lufi/Controller/Mail.pm:40 +#: lib/Lufi/Controller/Mail.pm:41 msgid "You must give email addresses." msgstr "Heu de donar l'adreça de correu electrònic." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:55 +#: lib/Lufi/Controller/Files.pm:56 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "El fitxer és massa gran: %1 (mida màxima admesa: %2)" +#: lib/Lufi/Controller/Files.pm:273 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "" + #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:20 msgid "between %1 and %2, the file will be kept %3 day(s)." @@ -626,6 +516,6 @@ msgstr "a partir de %1, el fitxer es mantindrà per sempre al servidor." msgid "no time limit" msgstr "no hi ha límit de temps" -#: themes/default/templates/index.html.ep:70 +#: themes/default/templates/index.html.ep:78 msgid "or" msgstr "o" diff --git a/themes/default/lib/Lufi/I18N/en.po b/themes/default/lib/Lufi/I18N/en.po index d3bdec0..f1f284c 100644 --- a/themes/default/lib/Lufi/I18N/en.po +++ b/themes/default/lib/Lufi/I18N/en.po @@ -34,23 +34,27 @@ msgid ":" msgstr "" #: themes/default/templates/about.html.ep:16 -msgid "A thank you with a photo of kitten on Diaspora* or Twitter is cool too ;-)" +msgid "A thank you with a photo of kitten on Diaspora* or Mastodon is cool too ;-)" msgstr "" -#: themes/default/templates/render.html.ep:34 +#: themes/default/templates/render.html.ep:42 msgid "Abort" msgstr "" -#: themes/default/templates/layouts/default.html.ep:40 themes/default/templates/layouts/default.html.ep:52 +#: themes/default/templates/layouts/default.html.ep:65 themes/default/templates/layouts/default.html.ep:77 msgid "About" msgstr "" +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" +msgstr "" + #: themes/default/templates/about.html.ep:18 msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." msgstr "" #. (stash('f') -#: themes/default/templates/render.html.ep:44 +#: themes/default/templates/render.html.ep:52 msgid "Asking for file part XX1 of %1" msgstr "" @@ -58,15 +62,15 @@ msgstr "" msgid "Back to homepage" msgstr "" -#: lib/Lufi/Controller/Mail.pm:20 +#: lib/Lufi/Controller/Mail.pm:21 msgid "Bad CSRF token!" msgstr "" -#: themes/default/templates/render.html.ep:40 +#: themes/default/templates/render.html.ep:48 msgid "Click here to refresh the page and restart the download." msgstr "" -#: themes/default/templates/index.html.ep:72 +#: themes/default/templates/index.html.ep:80 msgid "Click to open the file browser" msgstr "" @@ -78,35 +82,39 @@ msgstr "" msgid "Comma-separated email addresses" msgstr "" -#: themes/default/templates/index.html.ep:92 +#: themes/default/templates/index.html.ep:100 msgid "Copy all links to clipboard" msgstr "" -#: themes/default/templates/index.html.ep:95 +#: themes/default/templates/index.html.ep:103 msgid "Copy to clipboard" msgstr "" -#: lib/Lufi/Controller/Files.pm:396 +#: lib/Lufi/Controller/Files.pm:429 msgid "Could not delete the file. You are not authenticated." msgstr "" -#: lib/Lufi/Controller/Files.pm:380 +#: lib/Lufi/Controller/Files.pm:411 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "" -#: lib/Lufi/Controller/Files.pm:296 +#: lib/Lufi/Controller/Files.pm:322 msgid "Could not find the file. Are you sure of the URL?" msgstr "" -#: themes/default/templates/files.html.ep:26 +#: themes/default/templates/files.html.ep:28 msgid "Counter" msgstr "" -#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:64 +#: themes/default/templates/files.html.ep:29 themes/default/templates/index.html.ep:64 msgid "Delete at first download?" msgstr "" -#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:96 +#: themes/default/templates/files.html.ep:18 +msgid "Delete selected files" +msgstr "" + +#: themes/default/templates/files.html.ep:32 themes/default/templates/index.html.ep:104 msgid "Deletion link" msgstr "" @@ -114,15 +122,15 @@ msgstr "" msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." msgstr "" -#: themes/default/templates/index.html.ep:98 +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 msgid "Download" msgstr "" -#: themes/default/templates/render.html.ep:39 +#: themes/default/templates/render.html.ep:47 msgid "Download aborted." msgstr "" -#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:97 +#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:105 msgid "Download link" msgstr "" @@ -130,7 +138,7 @@ msgstr "" msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." msgstr "" -#: themes/default/templates/index.html.ep:69 +#: themes/default/templates/index.html.ep:77 msgid "Drop files here" msgstr "" @@ -146,27 +154,27 @@ msgstr "" msgid "Emails" msgstr "" -#: themes/default/templates/index.html.ep:99 +#: themes/default/templates/index.html.ep:107 msgid "Encrypting part XX1 of XX2" msgstr "" -#: lib/Lufi/Controller/Files.pm:216 +#: lib/Lufi/Controller/Files.pm:225 msgid "Error: the file existed but was deleted." msgstr "" -#: lib/Lufi/Controller/Files.pm:266 +#: lib/Lufi/Controller/Files.pm:291 msgid "Error: the file has not been sent entirely." msgstr "" -#: lib/Lufi/Controller/Files.pm:276 +#: lib/Lufi/Controller/Files.pm:301 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "" -#: themes/default/templates/index.html.ep:100 +#: themes/default/templates/index.html.ep:108 msgid "Expiration:" msgstr "" -#: themes/default/templates/files.html.ep:29 +#: themes/default/templates/files.html.ep:31 msgid "Expires at" msgstr "" @@ -174,15 +182,15 @@ msgstr "" msgid "Export localStorage data" msgstr "" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:393 msgid "File deleted" msgstr "" -#: themes/default/templates/files.html.ep:24 +#: themes/default/templates/files.html.ep:26 msgid "File name" msgstr "" -#: themes/default/templates/render.html.ep:43 +#: themes/default/templates/render.html.ep:51 msgid "Get the file" msgstr "" @@ -198,11 +206,11 @@ msgstr "" msgid "Here's some files" msgstr "" -#: themes/default/templates/index.html.ep:102 +#: themes/default/templates/index.html.ep:110 msgid "Hit Enter, then Ctrl+C to copy all the download links" msgstr "" -#: themes/default/templates/index.html.ep:101 +#: themes/default/templates/index.html.ep:109 msgid "Hit Enter, then Ctrl+C to copy the download link" msgstr "" @@ -238,7 +246,7 @@ msgstr "" msgid "Information about delays" msgstr "" -#: themes/default/templates/render.html.ep:41 +#: themes/default/templates/render.html.ep:49 msgid "It seems that the key in your URL is incorrect. Please, verify your URL." msgstr "" @@ -250,7 +258,7 @@ msgstr "" msgid "Login" msgstr "" -#: themes/default/templates/layouts/default.html.ep:42 themes/default/templates/layouts/default.html.ep:54 +#: themes/default/templates/layouts/default.html.ep:67 themes/default/templates/layouts/default.html.ep:79 msgid "Logout" msgstr "" @@ -258,16 +266,20 @@ msgstr "" msgid "Lufi is a free (as in free speech) file hosting software." msgstr "" -#: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:36 themes/default/templates/layouts/default.html.ep:48 +#: themes/default/templates/files.html.ep:33 +msgid "Mail" +msgstr "" + +#: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:61 themes/default/templates/layouts/default.html.ep:73 msgid "My files" msgstr "" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:68 +#: lib/Lufi/Controller/Files.pm:69 msgid "No enough space available on the server for this file (size: %1)." msgstr "" -#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:104 +#: themes/default/templates/files.html.ep:45 themes/default/templates/index.html.ep:112 msgid "No expiration delay" msgstr "" @@ -275,7 +287,7 @@ msgstr "" msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." msgstr "" -#: themes/default/templates/login.html.ep:21 +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 msgid "Password" msgstr "" @@ -284,10 +296,14 @@ msgstr "" msgid "Please contact the administrator: %1" msgstr "" -#: themes/default/templates/render.html.ep:25 +#: themes/default/templates/render.html.ep:33 msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it." msgstr "" +#: lib/Lufi.pm:191 +msgid "Please, check your credentials: unable to authenticate." +msgstr "" + #: themes/default/templates/about.html.ep:5 msgid "Privacy" msgstr "" @@ -300,7 +316,7 @@ msgstr "" msgid "Rows in red mean that the files have expired and are no longer available." msgstr "" -#: themes/default/templates/index.html.ep:103 +#: themes/default/templates/index.html.ep:111 msgid "Send all links by email" msgstr "" @@ -312,7 +328,7 @@ msgstr "" msgid "Send with your own mail software" msgstr "" -#: themes/default/templates/index.html.ep:105 +#: themes/default/templates/index.html.ep:113 msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." msgstr "" @@ -321,15 +337,19 @@ msgstr "" msgid "Share your files in total privacy on %1" msgstr "" -#: themes/default/templates/layouts/default.html.ep:38 themes/default/templates/layouts/default.html.ep:50 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 +#: themes/default/templates/layouts/default.html.ep:63 themes/default/templates/layouts/default.html.ep:75 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 msgid "Signin" msgstr "" +#: lib/Lufi.pm:194 +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 "" + #: themes/default/templates/index.html.ep:30 msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "" -#: lib/Lufi/Controller/Files.pm:42 +#: lib/Lufi/Controller/Files.pm:43 msgid "Sorry, uploading is disabled." msgstr "" @@ -337,19 +357,19 @@ msgstr "" msgid "The administrator can only see the file's name, its size and its mimetype (what kind of file it is: video, text, etc.)." msgstr "" -#: themes/default/templates/files.html.ep:43 +#: themes/default/templates/files.html.ep:46 msgid "The data has been successfully imported." msgstr "" -#: lib/Lufi/Controller/Mail.pm:42 +#: lib/Lufi/Controller/Mail.pm:43 msgid "The email body can't be empty." msgstr "" -#: lib/Lufi/Controller/Mail.pm:41 +#: lib/Lufi/Controller/Mail.pm:42 msgid "The email subject can't be empty." msgstr "" -#: lib/Lufi/Controller/Files.pm:361 +#: lib/Lufi/Controller/Files.pm:390 msgid "The file has already been deleted" msgstr "" @@ -358,15 +378,15 @@ msgid "The files uploaded on a Lufi instance are encrypted before the upload to msgstr "" #. (join(', ', @bad) -#: lib/Lufi/Controller/Mail.pm:37 +#: lib/Lufi/Controller/Mail.pm:38 msgid "The following email addresses are not valid: %1" msgstr "" -#: themes/default/templates/index.html.ep:93 +#: themes/default/templates/index.html.ep:101 msgid "The link(s) has been copied to your clipboard" msgstr "" -#: lib/Lufi/Controller/Mail.pm:65 +#: lib/Lufi/Controller/Mail.pm:66 msgid "The mail has been sent." msgstr "" @@ -374,7 +394,7 @@ msgstr "" msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." msgstr "" -#: lib/Lufi/Controller/Files.pm:168 +#: lib/Lufi/Controller/Files.pm:179 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "" @@ -382,38 +402,38 @@ msgstr "" msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" msgstr "" -#: themes/default/templates/index.html.ep:94 +#: themes/default/templates/index.html.ep:102 msgid "Unable to copy the link(s) to your clipboard" msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:334 +#: lib/Lufi/Controller/Files.pm:361 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:351 msgid "Unable to get counter for %1. The token is invalid." msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:344 +#: lib/Lufi/Controller/Files.pm:371 msgid "Unable to get counter for %1. You are not authenticated." msgstr "" -#: themes/default/templates/layouts/default.html.ep:35 themes/default/templates/layouts/default.html.ep:47 +#: themes/default/templates/layouts/default.html.ep:60 themes/default/templates/layouts/default.html.ep:72 msgid "Upload files" msgstr "" -#: themes/default/templates/files.html.ep:28 +#: themes/default/templates/files.html.ep:30 msgid "Uploaded at" msgstr "" -#: themes/default/templates/index.html.ep:77 +#: themes/default/templates/index.html.ep:85 msgid "Uploaded files" msgstr "" -#: themes/default/templates/index.html.ep:106 +#: themes/default/templates/index.html.ep:114 msgid "Websocket communication error" msgstr "" @@ -433,15 +453,15 @@ msgstr "" msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." msgstr "" -#: themes/default/templates/render.html.ep:45 +#: themes/default/templates/render.html.ep:53 msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." msgstr "" -#: themes/default/templates/render.html.ep:42 +#: themes/default/templates/render.html.ep:50 msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" msgstr "" -#: themes/default/templates/index.html.ep:91 +#: themes/default/templates/index.html.ep:99 msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" msgstr "" @@ -449,15 +469,19 @@ msgstr "" msgid "You have been successfully logged out." msgstr "" -#: lib/Lufi/Controller/Mail.pm:40 +#: lib/Lufi/Controller/Mail.pm:41 msgid "You must give email addresses." msgstr "" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:55 +#: lib/Lufi/Controller/Files.pm:56 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "" +#: lib/Lufi/Controller/Files.pm:273 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "" + #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:20 msgid "between %1 and %2, the file will be kept %3 day(s)." @@ -486,6 +510,6 @@ msgstr "" msgid "no time limit" msgstr "" -#: themes/default/templates/index.html.ep:70 +#: themes/default/templates/index.html.ep:78 msgid "or" msgstr "" diff --git a/themes/default/lib/Lufi/I18N/fr.po b/themes/default/lib/Lufi/I18N/fr.po index 4f4e386..4efb92c 100644 --- a/themes/default/lib/Lufi/I18N/fr.po +++ b/themes/default/lib/Lufi/I18N/fr.po @@ -36,23 +36,27 @@ msgid ":" msgstr " :" #: themes/default/templates/about.html.ep:16 -msgid "A thank you with a photo of kitten on Diaspora* or Twitter is cool too ;-)" -msgstr "Un merci avec une photo de chaton sur Diaspora* ou Twitter fait aussi l’affaire ;-)" +msgid "A thank you with a photo of kitten on Diaspora* or Mastodon is cool too ;-)" +msgstr "Un merci avec une photo de chaton sur Diaspora* ou Mastodon fait aussi l’affaire ;-)" -#: themes/default/templates/render.html.ep:34 +#: themes/default/templates/render.html.ep:42 msgid "Abort" msgstr "Abandonner" -#: themes/default/templates/layouts/default.html.ep:40 themes/default/templates/layouts/default.html.ep:52 +#: themes/default/templates/layouts/default.html.ep:65 themes/default/templates/layouts/default.html.ep:77 msgid "About" msgstr "À propos" +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" +msgstr "Ajouter un mot de passe au(x) fichier(s)" + #: themes/default/templates/about.html.ep:18 msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." msgstr "Comme Lufi est un logiciel libre soumis aux termes de la license AGPLv3, vous pouvez l’installer sur votre propre serveur. Veuillez consulter le Wiki pour voir la procédure." #. (stash('f') -#: themes/default/templates/render.html.ep:44 +#: themes/default/templates/render.html.ep:52 msgid "Asking for file part XX1 of %1" msgstr "Demande de récupération du fragment de fichier XX1 sur %1" @@ -60,15 +64,15 @@ msgstr "Demande de récupération du fragment de fichier XX1 sur %1" msgid "Back to homepage" msgstr "Retour à la page d’accueil" -#: lib/Lufi/Controller/Mail.pm:20 +#: lib/Lufi/Controller/Mail.pm:21 msgid "Bad CSRF token!" msgstr "Mauvais jeton CSRF !" -#: themes/default/templates/render.html.ep:40 +#: themes/default/templates/render.html.ep:48 msgid "Click here to refresh the page and restart the download." msgstr "Cliquez ici pour rafraîchir la page et redémarrer le téléchargement." -#: themes/default/templates/index.html.ep:72 +#: themes/default/templates/index.html.ep:80 msgid "Click to open the file browser" msgstr "Cliquez pour ouvrir le navigateur de fichiers" @@ -80,35 +84,39 @@ msgstr "Fermer" msgid "Comma-separated email addresses" msgstr "Adresses mails séparées par des virgules" -#: themes/default/templates/index.html.ep:92 +#: themes/default/templates/index.html.ep:100 msgid "Copy all links to clipboard" msgstr "Copier tous les liens dans le presse-papier" -#: themes/default/templates/index.html.ep:95 +#: themes/default/templates/index.html.ep:103 msgid "Copy to clipboard" msgstr "Copier dans le presse-papier" -#: lib/Lufi/Controller/Files.pm:396 +#: lib/Lufi/Controller/Files.pm:429 msgid "Could not delete the file. You are not authenticated." msgstr "Impossible de supprimer le fichier. Vous n’êtes pas connecté·e." -#: lib/Lufi/Controller/Files.pm:380 +#: lib/Lufi/Controller/Files.pm:411 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "Impossible de retrouver le fichier. Êtes-vous sûr(e) que l’URL et le jeton sont les bons ?" -#: lib/Lufi/Controller/Files.pm:296 +#: lib/Lufi/Controller/Files.pm:322 msgid "Could not find the file. Are you sure of the URL?" msgstr "Impossible de retrouver le fichier. Êtes-vous sûr(e) que l’URL est la bonne ?" -#: themes/default/templates/files.html.ep:26 +#: themes/default/templates/files.html.ep:28 msgid "Counter" msgstr "Compteur" -#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:64 +#: themes/default/templates/files.html.ep:29 themes/default/templates/index.html.ep:64 msgid "Delete at first download?" msgstr "Supprimer après le premier téléchargement ?" -#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:96 +#: themes/default/templates/files.html.ep:18 +msgid "Delete selected files" +msgstr "Supprimer les fichiers sélectionnés" + +#: themes/default/templates/files.html.ep:32 themes/default/templates/index.html.ep:104 msgid "Deletion link" msgstr "Lien de suppression" @@ -116,15 +124,15 @@ msgstr "Lien de suppression" msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." msgstr "Ne vous inquiétez pas : si un utilisateur commence à télécharger le fichier avant son expiration et que le téléchargement se termine après l’expiration, l’utilisateur pourra quand même récupérer le fichier." -#: themes/default/templates/index.html.ep:98 +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 msgid "Download" msgstr "Télécharger" -#: themes/default/templates/render.html.ep:39 +#: themes/default/templates/render.html.ep:47 msgid "Download aborted." msgstr "Téléchargement abandonné." -#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:97 +#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:105 msgid "Download link" msgstr "Lien de téléchargement" @@ -132,7 +140,7 @@ msgstr "Lien de téléchargement" msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." msgstr "Faites glisser des fichiers dans la zone prévue à cet effet ou sélectionnez un fichier de façon classique et les fichiers seront découpés en morceaux, chiffrés et envoyés au serveur. Vous récupérerez deux liens par fichier : un lien de téléchargement et un lien pour supprimer le fichier quand vous le souhaitez." -#: themes/default/templates/index.html.ep:69 +#: themes/default/templates/index.html.ep:77 msgid "Drop files here" msgstr "Glissez vos fichiers ici" @@ -148,27 +156,27 @@ msgstr "Sujet du mail" msgid "Emails" msgstr "Mails" -#: themes/default/templates/index.html.ep:99 +#: themes/default/templates/index.html.ep:107 msgid "Encrypting part XX1 of XX2" msgstr "Chiffrement du fragment XX1 sur XX2" -#: lib/Lufi/Controller/Files.pm:216 +#: lib/Lufi/Controller/Files.pm:225 msgid "Error: the file existed but was deleted." msgstr "Erreur : le fichier existait mais a été supprimé" -#: lib/Lufi/Controller/Files.pm:266 +#: lib/Lufi/Controller/Files.pm:291 msgid "Error: the file has not been sent entirely." msgstr "Erreur : le fichier n’a pas été envoyé dans son intégralité" -#: lib/Lufi/Controller/Files.pm:276 +#: lib/Lufi/Controller/Files.pm:301 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Erreur : impossible de retrouver le fichier. Êtes-vous sûr(e) de l’URL ?" -#: themes/default/templates/index.html.ep:100 +#: themes/default/templates/index.html.ep:108 msgid "Expiration:" msgstr "Expiration :" -#: themes/default/templates/files.html.ep:29 +#: themes/default/templates/files.html.ep:31 msgid "Expires at" msgstr "Expire le" @@ -176,15 +184,15 @@ msgstr "Expire le" msgid "Export localStorage data" msgstr "Exporter les données localStorage" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:393 msgid "File deleted" msgstr "Fichier supprimé" -#: themes/default/templates/files.html.ep:24 +#: themes/default/templates/files.html.ep:26 msgid "File name" msgstr "Nom du fichier" -#: themes/default/templates/render.html.ep:43 +#: themes/default/templates/render.html.ep:51 msgid "Get the file" msgstr "Récupérer le fichier" @@ -200,11 +208,11 @@ msgstr "Bonjour,\\n\\nVoici quelques fichiers que je souhaite partager avec toi msgid "Here's some files" msgstr "Voici quelques fichiers" -#: themes/default/templates/index.html.ep:102 +#: themes/default/templates/index.html.ep:110 msgid "Hit Enter, then Ctrl+C to copy all the download links" msgstr "Appuyez sur la touche Entrée puis faites Ctrl+C pour copier tous les liens de téléchargement" -#: themes/default/templates/index.html.ep:101 +#: themes/default/templates/index.html.ep:109 msgid "Hit Enter, then Ctrl+C to copy the download link" msgstr "Appuyez sur la touche Entrée puis faites Ctrl+C pour copier le lien de téléchargement" @@ -240,7 +248,7 @@ msgstr "Important : plus d’informations sur les délais" msgid "Information about delays" msgstr "Information sur les délais" -#: themes/default/templates/render.html.ep:41 +#: themes/default/templates/render.html.ep:49 msgid "It seems that the key in your URL is incorrect. Please, verify your URL." msgstr "Il semble que la clé dans votre URL soit incorrecte. Veuillez vérifier votre URL." @@ -252,7 +260,7 @@ msgstr "Javascript est désactivé. Lufi ne fonctionnera pas." msgid "Login" msgstr "Identifiant" -#: themes/default/templates/layouts/default.html.ep:42 themes/default/templates/layouts/default.html.ep:54 +#: themes/default/templates/layouts/default.html.ep:67 themes/default/templates/layouts/default.html.ep:79 msgid "Logout" msgstr "Déconnexion" @@ -260,16 +268,20 @@ msgstr "Déconnexion" msgid "Lufi is a free (as in free speech) file hosting software." msgstr "Lufi est un logiciel libre d’hébergement de fichiers." -#: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:36 themes/default/templates/layouts/default.html.ep:48 +#: themes/default/templates/files.html.ep:33 +msgid "Mail" +msgstr "" + +#: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:61 themes/default/templates/layouts/default.html.ep:73 msgid "My files" msgstr "Mes fichiers" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:68 +#: lib/Lufi/Controller/Files.pm:69 msgid "No enough space available on the server for this file (size: %1)." msgstr "Espace disque insuffisant sur le serveur pour ce fichier (taille du fichier : %1)." -#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:104 +#: themes/default/templates/files.html.ep:45 themes/default/templates/index.html.ep:112 msgid "No expiration delay" msgstr "Pas de délai d’expiration" @@ -277,7 +289,7 @@ msgstr "Pas de délai d’expiration" msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." msgstr "Seuls les fichiers envoyés avec ce navigateur web sont listés ici. Les informations sont stockées en localStorage : si vous supprimez vos données localStorage, vous perdrez ces informations." -#: themes/default/templates/login.html.ep:21 +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 msgid "Password" msgstr "Mot de passe" @@ -286,10 +298,14 @@ msgstr "Mot de passe" msgid "Please contact the administrator: %1" msgstr "Veuillez contacter l’administrateur : %1" -#: themes/default/templates/render.html.ep:25 +#: themes/default/templates/render.html.ep:33 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." +#: lib/Lufi.pm:191 +msgid "Please, check your credentials: unable to authenticate." +msgstr "Veuillez vérifier vos identifiants : impossible de vous authentifier." + #: themes/default/templates/about.html.ep:5 msgid "Privacy" msgstr "Confidentialité" @@ -302,7 +318,7 @@ msgstr "Supprimer du localStorage les fichiers expirés" msgid "Rows in red mean that the files have expired and are no longer available." msgstr "Les lignes en rouge indiquent que le fichier a expiré et n’est plus disponible." -#: themes/default/templates/index.html.ep:103 +#: themes/default/templates/index.html.ep:111 msgid "Send all links by email" msgstr "Envoyer tous les liens par mail" @@ -314,7 +330,7 @@ msgstr "Envoyer avec ce serveur" msgid "Send with your own mail software" msgstr "Envoyer avec votre propre logiciel de mail" -#: themes/default/templates/index.html.ep:105 +#: themes/default/templates/index.html.ep:113 msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." msgstr "Envoi du fragment XX1 sur XX2. Veuillez patienter, la barre de progression peut mettre du temps avant d’avancer." @@ -323,15 +339,19 @@ msgstr "Envoi du fragment XX1 sur XX2. Veuillez patienter, la barre de progressi msgid "Share your files in total privacy on %1" msgstr "Partagez vos fichiers en toute confidentialité sur %1" -#: themes/default/templates/layouts/default.html.ep:38 themes/default/templates/layouts/default.html.ep:50 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 +#: themes/default/templates/layouts/default.html.ep:63 themes/default/templates/layouts/default.html.ep:75 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 msgid "Signin" msgstr "Connexion" +#: lib/Lufi.pm:194 +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." + #: themes/default/templates/index.html.ep:30 msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "Désolé, l’envoi de fichier est actuellement désactivé. Veuillez réessayer plus tard." -#: lib/Lufi/Controller/Files.pm:42 +#: lib/Lufi/Controller/Files.pm:43 msgid "Sorry, uploading is disabled." msgstr "Désolé, l’envoi de fichier est désactivé." @@ -339,19 +359,19 @@ msgstr "Désolé, l’envoi de fichier est désactivé." msgid "The administrator can only see the file's name, its size and its mimetype (what kind of file it is: video, text, etc.)." msgstr "L’administrateur ne peut voir que le nom du fichier, sa taille et son type mime (son type de fichier : vidéo, texte, etc.)." -#: themes/default/templates/files.html.ep:43 +#: themes/default/templates/files.html.ep:46 msgid "The data has been successfully imported." msgstr "Les données ont été importées avec succès." -#: lib/Lufi/Controller/Mail.pm:42 +#: lib/Lufi/Controller/Mail.pm:43 msgid "The email body can't be empty." msgstr "Le corps du mail ne peut être vide." -#: lib/Lufi/Controller/Mail.pm:41 +#: lib/Lufi/Controller/Mail.pm:42 msgid "The email subject can't be empty." msgstr "Le sujet du mail ne peut être vide." -#: lib/Lufi/Controller/Files.pm:361 +#: lib/Lufi/Controller/Files.pm:390 msgid "The file has already been deleted" msgstr "Le fichier a déjà été supprimé" @@ -360,15 +380,15 @@ msgid "The files uploaded on a Lufi instance are encrypted before the upload to msgstr "Les fichiers envoyés sur une instance de Lufi sont chiffrés avant l’envoi au serveur : l’administrateur du serveur ne peut pas voir le contenu de vos fichiers." #. (join(', ', @bad) -#: lib/Lufi/Controller/Mail.pm:37 +#: lib/Lufi/Controller/Mail.pm:38 msgid "The following email addresses are not valid: %1" msgstr "Les adresses mail suivantes ne sont pas valides : %1" -#: themes/default/templates/index.html.ep:93 +#: themes/default/templates/index.html.ep:101 msgid "The link(s) has been copied to your clipboard" msgstr "Le(s) lien(s) a/ont été copié dans votre presse-papier" -#: lib/Lufi/Controller/Mail.pm:65 +#: lib/Lufi/Controller/Mail.pm:66 msgid "The mail has been sent." msgstr "Le mail a été envoyé." @@ -376,7 +396,7 @@ msgstr "Le mail a été envoyé." msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." msgstr "L’auteur originel (et pour l’instant, le seul) est Luc Didry. Si vous avez envie de le supporter, vous pouvez le faire via Tipeee ou via Liberapay." -#: lib/Lufi/Controller/Files.pm:168 +#: lib/Lufi/Controller/Files.pm:179 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "Le serveur a été incapable de retrouver l’enregistrement du fichier auquel ajouter votre fragment de fichier. Veuillez contacter l’administrateur." @@ -384,38 +404,38 @@ msgstr "Le serveur a été incapable de retrouver l’enregistrement du fichier msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" msgstr "Ce serveur impose des limitations selon la taille des fichiers. Le délai d’expiration de votre fichier sera le minimum entre ce que vous avez choisi et les limites suivantes :" -#: themes/default/templates/index.html.ep:94 +#: themes/default/templates/index.html.ep:102 msgid "Unable to copy the link(s) to your clipboard" msgstr "Impossible de copier le(s) lien(s) dans votre presse-papier" #. ($short) -#: lib/Lufi/Controller/Files.pm:334 +#: lib/Lufi/Controller/Files.pm:361 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "Impossible de récupérer le compteur pour %1. Le fichier n’existe pas. Il va être supprimé de votre localStorage." #. ($short) -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:351 msgid "Unable to get counter for %1. The token is invalid." msgstr "Impossible de récupérer le compteur pour %1. Le jeton est invalide." #. ($short) -#: lib/Lufi/Controller/Files.pm:344 +#: lib/Lufi/Controller/Files.pm:371 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Impossible de récupérer le compteur pour %1. Vous n’êtes pas connecté·e." -#: themes/default/templates/layouts/default.html.ep:35 themes/default/templates/layouts/default.html.ep:47 +#: themes/default/templates/layouts/default.html.ep:60 themes/default/templates/layouts/default.html.ep:72 msgid "Upload files" msgstr "Envoyer des fichiers" -#: themes/default/templates/files.html.ep:28 +#: themes/default/templates/files.html.ep:30 msgid "Uploaded at" msgstr "Envoyé le" -#: themes/default/templates/index.html.ep:77 +#: themes/default/templates/index.html.ep:85 msgid "Uploaded files" msgstr "Fichiers envoyés" -#: themes/default/templates/index.html.ep:106 +#: themes/default/templates/index.html.ep:114 msgid "Websocket communication error" msgstr "Erreur de communication WebSocket" @@ -435,15 +455,15 @@ msgstr "Vous pouvez voir la liste de vos fichiers en cliquant sur le lien « Mes msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." msgstr "Vous n’avez pas besoin de vous enregistrer pour envoyer des fichiers mais notez que, pour des raisons légales, votre adresse IP sera enregistrée quand vous envoyez un fichier. Ne paniquez pas, c’est normalement le cas pour tous les sites où vous envoyez des fichiers." -#: themes/default/templates/render.html.ep:45 +#: themes/default/templates/render.html.ep:53 msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." msgstr "Il semble que vous n’ayez pas de clé dans votre URL. Vous ne serez pas capable de déchiffrer le fichier. Téléchargement annulé." -#: themes/default/templates/render.html.ep:42 +#: themes/default/templates/render.html.ep:50 msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" msgstr "Vous essayez de quitter la page. Le téléchargement sera annulé. Êtes-vous sûr(e) ?" -#: themes/default/templates/index.html.ep:91 +#: themes/default/templates/index.html.ep:99 msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" msgstr "Vous essayez de quitter la page. L’envoi sera annulé. Êtes-vous sûr(e) ?" @@ -451,15 +471,19 @@ msgstr "Vous essayez de quitter la page. L’envoi sera annulé. Êtes-vous sûr msgid "You have been successfully logged out." msgstr "Vous avez été déconnecté·e avec succès." -#: lib/Lufi/Controller/Mail.pm:40 +#: lib/Lufi/Controller/Mail.pm:41 msgid "You must give email addresses." msgstr "Vous devez envoyer des adresses mail." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:55 +#: lib/Lufi/Controller/Files.pm:56 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "Votre fichier est trop volumineux : %1 (la taille maximum autorisée est %2)" +#: lib/Lufi/Controller/Files.pm:273 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "Votre mot de passe est invalide. Veuillez rafraîchir la page pour réessayer." + #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:20 msgid "between %1 and %2, the file will be kept %3 day(s)." @@ -488,6 +512,6 @@ msgstr "pour %1 et plus, le fichier sera conservé indéfiniment." msgid "no time limit" msgstr "Pas de délai d'expiration" -#: themes/default/templates/index.html.ep:70 +#: themes/default/templates/index.html.ep:78 msgid "or" msgstr "ou" diff --git a/themes/default/lib/Lufi/I18N/it.po b/themes/default/lib/Lufi/I18N/it.po index 9432e61..9bc5eec 100644 --- a/themes/default/lib/Lufi/I18N/it.po +++ b/themes/default/lib/Lufi/I18N/it.po @@ -33,26 +33,30 @@ msgstr "24 ore" #: themes/default/templates/mail.html.ep:83 msgid ":" -msgstr " :" +msgstr "A :" #: themes/default/templates/about.html.ep:16 -msgid "A thank you with a photo of kitten on Diaspora* or Twitter is cool too ;-)" -msgstr "Un grazie con una foto di un gattino sur Diaspora* o Twitter è forte;-)" +msgid "A thank you with a photo of kitten on Diaspora* or Mastodon is cool too ;-)" +msgstr "Un grazie con una foto di un gattino sur Diaspora* o Mastodon è forte;-)" -#: themes/default/templates/render.html.ep:34 +#: themes/default/templates/render.html.ep:42 msgid "Abort" msgstr "Annulla" -#: themes/default/templates/layouts/default.html.ep:40 themes/default/templates/layouts/default.html.ep:52 +#: themes/default/templates/layouts/default.html.ep:65 themes/default/templates/layouts/default.html.ep:77 msgid "About" msgstr "A proposito" +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" +msgstr "" + #: themes/default/templates/about.html.ep:18 msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." -msgstr "Poiché Lufi è un software libero soggetto ai termini della licenza AGPLv3, potete installarlo sul vostro server. Si consulti Wiki per vedere la procedura." +msgstr "Poiché Lufi è un software libero soggetto ai termini della licenza AGPLv3, potete installarlo sul vostro server. Si consulti Wiki per vedere la procedura." #. (stash('f') -#: themes/default/templates/render.html.ep:44 +#: themes/default/templates/render.html.ep:52 msgid "Asking for file part XX1 of %1" msgstr "Recupero della porzione del file XX1 su %1" @@ -60,15 +64,15 @@ msgstr "Recupero della porzione del file XX1 su %1" msgid "Back to homepage" msgstr "Ritorna all'homepage" -#: lib/Lufi/Controller/Mail.pm:20 +#: lib/Lufi/Controller/Mail.pm:21 msgid "Bad CSRF token!" -msgstr "Torken CSRF errato!" +msgstr "Token CSRF errato!" -#: themes/default/templates/render.html.ep:40 +#: themes/default/templates/render.html.ep:48 msgid "Click here to refresh the page and restart the download." msgstr "Click qui per aggiornare la pagina e ricominciare il download." -#: themes/default/templates/index.html.ep:72 +#: themes/default/templates/index.html.ep:80 msgid "Click to open the file browser" msgstr "Click per aprire il file browser" @@ -80,35 +84,39 @@ msgstr "Chiudi" msgid "Comma-separated email addresses" msgstr "Indirizzi email separati da virgole" -#: themes/default/templates/index.html.ep:92 +#: themes/default/templates/index.html.ep:100 msgid "Copy all links to clipboard" msgstr "Copiare tutti i link negli appunti" -#: themes/default/templates/index.html.ep:95 +#: themes/default/templates/index.html.ep:103 msgid "Copy to clipboard" msgstr "Copiare negli appunti" -#: lib/Lufi/Controller/Files.pm:396 +#: lib/Lufi/Controller/Files.pm:429 msgid "Could not delete the file. You are not authenticated." msgstr "Impossibile cancellare il file. Non siete autenticati." -#: lib/Lufi/Controller/Files.pm:380 +#: lib/Lufi/Controller/Files.pm:411 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "Impossibile trovare il file. Sei sicuro che URL e token siano corretti ?" -#: lib/Lufi/Controller/Files.pm:296 +#: lib/Lufi/Controller/Files.pm:322 msgid "Could not find the file. Are you sure of the URL?" msgstr "Impossibile trovare il file. Sei sicuro che l'URL sia corretto?" -#: themes/default/templates/files.html.ep:26 +#: themes/default/templates/files.html.ep:28 msgid "Counter" msgstr "Contatore" -#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:64 +#: themes/default/templates/files.html.ep:29 themes/default/templates/index.html.ep:64 msgid "Delete at first download?" msgstr "Cancellare al primo download?" -#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:96 +#: themes/default/templates/files.html.ep:18 +msgid "Delete selected files" +msgstr "" + +#: themes/default/templates/files.html.ep:32 themes/default/templates/index.html.ep:104 msgid "Deletion link" msgstr "Link per l'eliminazione" @@ -116,15 +124,15 @@ msgstr "Link per l'eliminazione" msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." msgstr "Non preoccuparti: se un utente cominciasse il download del file prima della scadenza ed il download terminasse dopo la scadenza, potrebbe ottenere il file." -#: themes/default/templates/index.html.ep:98 +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 msgid "Download" msgstr "Download" -#: themes/default/templates/render.html.ep:39 +#: themes/default/templates/render.html.ep:47 msgid "Download aborted." msgstr "Download annullato." -#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:97 +#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:105 msgid "Download link" msgstr "Link per il download" @@ -132,7 +140,7 @@ msgstr "Link per il download" msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." msgstr "Trascinare e lasciare il file nell'are prevista o selezionare i file nel modo classico ed i file saranno divisi,cifrati ed inviati al server. Otterrete 2 link per ogni file : uno per il download ed uno per eliminare il file quando vorrete." -#: themes/default/templates/index.html.ep:69 +#: themes/default/templates/index.html.ep:77 msgid "Drop files here" msgstr "Lasciare i file qui" @@ -148,43 +156,43 @@ msgstr "Oggetto dell'email" msgid "Emails" msgstr "Email" -#: themes/default/templates/index.html.ep:99 +#: themes/default/templates/index.html.ep:107 msgid "Encrypting part XX1 of XX2" msgstr "Cifratura della parte XX1 di XX2" -#: lib/Lufi/Controller/Files.pm:216 +#: lib/Lufi/Controller/Files.pm:225 msgid "Error: the file existed but was deleted." msgstr "Errore: il file esisteva ma è stato eliminato" -#: lib/Lufi/Controller/Files.pm:266 +#: lib/Lufi/Controller/Files.pm:291 msgid "Error: the file has not been sent entirely." msgstr "Errore: il file non è stato inviato completamente" -#: lib/Lufi/Controller/Files.pm:276 +#: lib/Lufi/Controller/Files.pm:301 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Errore: impossibile trovare il file. Sei certo dell'URL ?" -#: themes/default/templates/index.html.ep:100 +#: themes/default/templates/index.html.ep:108 msgid "Expiration:" msgstr "Scadenza:" -#: themes/default/templates/files.html.ep:29 +#: themes/default/templates/files.html.ep:31 msgid "Expires at" -msgstr "Scade il" +msgstr "Scadrà il" #: themes/default/templates/files.html.ep:12 msgid "Export localStorage data" msgstr "Esportare i dati del localStorage" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:393 msgid "File deleted" msgstr "File cancellato" -#: themes/default/templates/files.html.ep:24 +#: themes/default/templates/files.html.ep:26 msgid "File name" msgstr "Nome del file" -#: themes/default/templates/render.html.ep:43 +#: themes/default/templates/render.html.ep:51 msgid "Get the file" msgstr "Ottenere il file" @@ -200,11 +208,11 @@ msgstr "Buongiorno,\\n\\necco qualche file che vorrei condividere con te:\\n" msgid "Here's some files" msgstr "Ecco qualche file" -#: themes/default/templates/index.html.ep:102 +#: themes/default/templates/index.html.ep:110 msgid "Hit Enter, then Ctrl+C to copy all the download links" msgstr "Premere Enter, poi Ctrl+C per copiare tutti i link di download" -#: themes/default/templates/index.html.ep:101 +#: themes/default/templates/index.html.ep:109 msgid "Hit Enter, then Ctrl+C to copy the download link" msgstr "Premere Enter, poi Ctrl+C per copiare il link di download" @@ -240,7 +248,7 @@ msgstr "Importante : più informazioni sulle scadenze" msgid "Information about delays" msgstr "Informazione sulle scadenze" -#: themes/default/templates/render.html.ep:41 +#: themes/default/templates/render.html.ep:49 msgid "It seems that the key in your URL is incorrect. Please, verify your URL." msgstr "Sembra che la chiave nel tuo URL sia errata. Controllare il tuo URL." @@ -252,7 +260,7 @@ msgstr "Javascript è disattivato. Lufi non può funzionare." msgid "Login" msgstr "Login" -#: themes/default/templates/layouts/default.html.ep:42 themes/default/templates/layouts/default.html.ep:54 +#: themes/default/templates/layouts/default.html.ep:67 themes/default/templates/layouts/default.html.ep:79 msgid "Logout" msgstr "Logout" @@ -260,16 +268,20 @@ msgstr "Logout" msgid "Lufi is a free (as in free speech) file hosting software." msgstr "Lufi è un software libero di file hosting." -#: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:36 themes/default/templates/layouts/default.html.ep:48 +#: themes/default/templates/files.html.ep:33 +msgid "Mail" +msgstr "" + +#: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:61 themes/default/templates/layouts/default.html.ep:73 msgid "My files" msgstr "I miei file" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:68 +#: lib/Lufi/Controller/Files.pm:69 msgid "No enough space available on the server for this file (size: %1)." msgstr "Spazio disco insufficiente sul server per questo file (dimensione: %1)." -#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:104 +#: themes/default/templates/files.html.ep:45 themes/default/templates/index.html.ep:112 msgid "No expiration delay" msgstr "Nessun ritardo per la scadenza" @@ -277,7 +289,7 @@ msgstr "Nessun ritardo per la scadenza" msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." msgstr "Solo i file inviati con questo browser web sono nella lista. Le informazioni sono memorizzate nel localStorage: se cancellaste i dati dal vostro localStorage, perdereste questa lista." -#: themes/default/templates/login.html.ep:21 +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 msgid "Password" msgstr "Password" @@ -286,10 +298,14 @@ msgstr "Password" msgid "Please contact the administrator: %1" msgstr "Contattare l'amministratore : %1" -#: themes/default/templates/render.html.ep:25 +#: themes/default/templates/render.html.ep:33 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." +#: lib/Lufi.pm:191 +msgid "Please, check your credentials: unable to authenticate." +msgstr "" + #: themes/default/templates/about.html.ep:5 msgid "Privacy" msgstr "Riservatezza" @@ -298,11 +314,15 @@ msgstr "Riservatezza" msgid "Purge expired files from localStorage" msgstr "Eliminare dal localStorage i file scaduti" +#: +msgid "Rows in purple mean that the files have expired and are no longer available." +msgstr "Le righe in viola indicano che il file è scaduto e non è più disponibile." + #: themes/default/templates/files.html.ep:9 msgid "Rows in red mean that the files have expired and are no longer available." -msgstr "Le righe in rosso indicano che il file è scaduto e non è più disponibile." +msgstr "" -#: themes/default/templates/index.html.ep:103 +#: themes/default/templates/index.html.ep:111 msgid "Send all links by email" msgstr "Inviare tutti i link tramite email" @@ -314,44 +334,52 @@ msgstr "Inviare tramite questo server" msgid "Send with your own mail software" msgstr "Inviare tramite il vostro programma di posta" -#: themes/default/templates/index.html.ep:105 +#: themes/default/templates/index.html.ep:113 msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." -msgstr "Invio della parte XX1 su XX2. Prego attendere, la barra di avanzamento può impiagare del tempo prima di avanzare." +msgstr "Invio della parte XX1 su XX2. Prego attendere, la barra di avanzamento può impiegare del tempo prima di colorarsi." #. (url_for('/') #: themes/default/templates/mail.html.ep:91 msgid "Share your files in total privacy on %1" msgstr "Condividi tutti i file in totale riservatezza su %1" -#: themes/default/templates/layouts/default.html.ep:38 themes/default/templates/layouts/default.html.ep:50 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 +#: themes/default/templates/layouts/default.html.ep:63 themes/default/templates/layouts/default.html.ep:75 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 msgid "Signin" msgstr "Autenticazione" +#: lib/Lufi.pm:194 +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 "" + #: themes/default/templates/index.html.ep:30 msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "L'invio del file è attualemente disattivato. Riprovare più tardi." -#: lib/Lufi/Controller/Files.pm:42 +#: lib/Lufi/Controller/Files.pm:43 msgid "Sorry, uploading is disabled." msgstr "L'invio del file è attualemente disattivato." +#: +msgid "The administrator can only see the file's name, its size and its mimetype (what kind of file it is: video, text, etc)." +msgstr "L'amministratore pu vedere solo il nome del file, la sua dimensione e il suo mimetype (video, testo, etc)." + #: themes/default/templates/about.html.ep:7 msgid "The administrator can only see the file's name, its size and its mimetype (what kind of file it is: video, text, etc.)." -msgstr "L'amministratore pu vedere solo il nome del file, la sua dimensione e il suo mimetype (video, testo, etc.)." +msgstr "" -#: themes/default/templates/files.html.ep:43 +#: themes/default/templates/files.html.ep:46 msgid "The data has been successfully imported." msgstr "I dati sono stati importati correttamente." -#: lib/Lufi/Controller/Mail.pm:42 +#: lib/Lufi/Controller/Mail.pm:43 msgid "The email body can't be empty." msgstr "Il corpo dell'email non può essere vuoto." -#: lib/Lufi/Controller/Mail.pm:41 +#: lib/Lufi/Controller/Mail.pm:42 msgid "The email subject can't be empty." msgstr "Il soggetto dell'email non può essere vuoto." -#: lib/Lufi/Controller/Files.pm:361 +#: lib/Lufi/Controller/Files.pm:390 msgid "The file has already been deleted" msgstr "Il file è già stato cancellato" @@ -360,15 +388,15 @@ msgid "The files uploaded on a Lufi instance are encrypted before the upload to msgstr "I file inviati su un istanza di Lufi sono cifrati prima dell'invio al server: l'amministratore del server non può vedere il contenuto dei vostri file." #. (join(', ', @bad) -#: lib/Lufi/Controller/Mail.pm:37 +#: lib/Lufi/Controller/Mail.pm:38 msgid "The following email addresses are not valid: %1" msgstr "I seguenti indirizzi email non sono validi: %1" -#: themes/default/templates/index.html.ep:93 +#: themes/default/templates/index.html.ep:101 msgid "The link(s) has been copied to your clipboard" msgstr "I link sono stati copiati negli appunti" -#: lib/Lufi/Controller/Mail.pm:65 +#: lib/Lufi/Controller/Mail.pm:66 msgid "The mail has been sent." msgstr "Email inviata." @@ -376,7 +404,7 @@ msgstr "Email inviata." msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." msgstr "L'autore ( e per ora l'unico) è Luc Didry. Se aveste voglia di aiutarlo, potreste farlo tramite Tipeee ou via Liberapay." -#: lib/Lufi/Controller/Files.pm:168 +#: lib/Lufi/Controller/Files.pm:179 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "Il server non è stato in grado di trovare il file record a cui aggiungere la vostra porzione di file. Prego contattare l'amministratore." @@ -384,38 +412,38 @@ msgstr "Il server non è stato in grado di trovare il file record a cui aggiunge msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" msgstr "Questo server pone delle limitazioni in base alla dimensione del file.La data di scadenza del tuo file sarà la minore tra quella scelta e queste limitazioni:" -#: themes/default/templates/index.html.ep:94 +#: themes/default/templates/index.html.ep:102 msgid "Unable to copy the link(s) to your clipboard" msgstr "Impossibile copiare i link negli appunti" #. ($short) -#: lib/Lufi/Controller/Files.pm:334 +#: lib/Lufi/Controller/Files.pm:361 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "Impossibile recuperare il contatore per %1. Il file non esiste. Il file sarà eliminato dal tuo localStorage." #. ($short) -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:351 msgid "Unable to get counter for %1. The token is invalid." msgstr "Impossibile recuperare il contatore per %1. Il token non è valido." #. ($short) -#: lib/Lufi/Controller/Files.pm:344 +#: lib/Lufi/Controller/Files.pm:371 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Impossibile recuperare il contatore per %1. Non sei autenticato." -#: themes/default/templates/layouts/default.html.ep:35 themes/default/templates/layouts/default.html.ep:47 +#: themes/default/templates/layouts/default.html.ep:60 themes/default/templates/layouts/default.html.ep:72 msgid "Upload files" msgstr "Invio dei file" -#: themes/default/templates/files.html.ep:28 +#: themes/default/templates/files.html.ep:30 msgid "Uploaded at" msgstr "Invio il" -#: themes/default/templates/index.html.ep:77 +#: themes/default/templates/index.html.ep:85 msgid "Uploaded files" msgstr "File inviati" -#: themes/default/templates/index.html.ep:106 +#: themes/default/templates/index.html.ep:114 msgid "Websocket communication error" msgstr "Errore di comunicazione WebSocket" @@ -435,15 +463,15 @@ msgstr "Puoi consultare la lista dei vostri file cliccando sul link « I miei fi msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." msgstr "Non hai bisogno di registrarti per inviare i file ma devi essere consapevole che, per motivi legali, il tuo indirizzo IP sarà registrato quando invierai un file. Non ti preoccupare, avviene in tutti i siti su cui invii dei file." -#: themes/default/templates/render.html.ep:45 +#: themes/default/templates/render.html.ep:53 msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." msgstr "Sembra che non ci sia una chiave nel tuo URL. Non sarai in grado di decifrare il file. Download annullato." -#: themes/default/templates/render.html.ep:42 +#: themes/default/templates/render.html.ep:50 msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" msgstr "Hai cercato di uscire da questa pagina. Il download sarà cancellato. Sei sicuro?" -#: themes/default/templates/index.html.ep:91 +#: themes/default/templates/index.html.ep:99 msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" msgstr "Hai cercato di uscire da questa pagina. L'invio sarà cancellato. Sei sicuro?" @@ -451,15 +479,19 @@ msgstr "Hai cercato di uscire da questa pagina. L'invio sarà cancellato. Sei si msgid "You have been successfully logged out." msgstr "Logout avvenuto con successo." -#: lib/Lufi/Controller/Mail.pm:40 +#: lib/Lufi/Controller/Mail.pm:41 msgid "You must give email addresses." msgstr "Devi fornire gli indirizzi email." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:55 +#: lib/Lufi/Controller/Files.pm:56 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "Il vostro file è troppo grande : %1 (la dimensione massima permessa è %2)" +#: lib/Lufi/Controller/Files.pm:273 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "" + #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:20 msgid "between %1 and %2, the file will be kept %3 day(s)." @@ -488,6 +520,6 @@ msgstr "per %1 e più, il file sarà conservato per sempre." msgid "no time limit" msgstr "nessuna limitazione temporale" -#: themes/default/templates/index.html.ep:70 +#: themes/default/templates/index.html.ep:78 msgid "or" msgstr "o" diff --git a/themes/default/lib/Lufi/I18N/nl.po b/themes/default/lib/Lufi/I18N/nl.po new file mode 100644 index 0000000..21e0078 --- /dev/null +++ b/themes/default/lib/Lufi/I18N/nl.po @@ -0,0 +1,540 @@ +# Lufi Dutch translation. +# Copyright (C) 2015 Luc Didry +# This file is distributed under the same license as the LUFI package. +# Ilker Kulgu , 2017. +# + +#. ($delay) +#. (max_delay) +#: themes/default/templates/index.html.ep:40 themes/default/templates/index.html.ep:49 themes/default/templates/index.html.ep:50 +msgid "%1 days" +msgstr "%1 dagen" + +#: themes/default/templates/index.html.ep:5 +msgid "1 year" +msgstr "1 jaar" + +#: themes/default/templates/index.html.ep:4 themes/default/templates/index.html.ep:49 +msgid "24 hours" +msgstr "24 uur" + +#: themes/default/templates/mail.html.ep:83 +msgid ":" +msgstr ":" + +#: themes/default/templates/about.html.ep:16 +msgid "A thank you with a photo of kitten on Diaspora* or Mastodon is cool too ;-)" +msgstr "Een bedankt foto met een katje op Diaspora* of Mastodon is ook goed ;-)" + +#: themes/default/templates/render.html.ep:42 +msgid "Abort" +msgstr "Annuleren" + +#: themes/default/templates/layouts/default.html.ep:65 themes/default/templates/layouts/default.html.ep:77 +msgid "About" +msgstr "Over" + +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" +msgstr "" + +#: themes/default/templates/about.html.ep:18 +msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." +msgstr "Aangezien Lufi een gratis software id die gelicentieerd staat onder de voorwaarden van AGPLv3, kan je het installeren op je eigen server. Bekijk Wiki voor de procedure." + +#. (stash('f') +#: themes/default/templates/render.html.ep:52 +msgid "Asking for file part XX1 of %1" +msgstr "Deel XX1 van %1 wordt opgehaald" + +#: themes/default/templates/about.html.ep:21 +msgid "Back to homepage" +msgstr "Terug naar home" + +#: lib/Lufi/Controller/Mail.pm:21 +msgid "Bad CSRF token!" +msgstr "Verkeerde CSRF token!" + +#: themes/default/templates/render.html.ep:48 +msgid "Click here to refresh the page and restart the download." +msgstr "Klik hier om de pagina te verversen en opnieuw te downloaden." + +#: themes/default/templates/index.html.ep:80 +msgid "Click to open the file browser" +msgstr "Klik voor bestandbrowser" + +#: themes/default/templates/delays.html.ep:38 +msgid "Close" +msgstr "Sluiten" + +#: themes/default/templates/mail.html.ep:22 +msgid "Comma-separated email addresses" +msgstr "Komma gescheiden email adressen" + +#: themes/default/templates/index.html.ep:100 +msgid "Copy all links to clipboard" +msgstr "Kopieer alle links naar klembord" + +#: themes/default/templates/index.html.ep:103 +msgid "Copy to clipboard" +msgstr "Kopieer naar klembord" + +#: lib/Lufi/Controller/Files.pm:429 +msgid "Could not delete the file. You are not authenticated." +msgstr "Kan het bestand niet verwijderen. Je bent niet geautoriseerd." + +#: lib/Lufi/Controller/Files.pm:411 +msgid "Could not find the file. Are you sure of the URL and the token?" +msgstr "Kan het bestand niet vinden. Klopt de URL en token wel?" + +#: lib/Lufi/Controller/Files.pm:322 +msgid "Could not find the file. Are you sure of the URL?" +msgstr "Kan het bestand niet vinden. Klopt de URL?" + +#: themes/default/templates/files.html.ep:28 +msgid "Counter" +msgstr "Teller" + +#: themes/default/templates/files.html.ep:29 themes/default/templates/index.html.ep:64 +msgid "Delete at first download?" +msgstr "Verwijder na eerste download?" + +#: themes/default/templates/files.html.ep:18 +msgid "Delete selected files" +msgstr "" + +#: themes/default/templates/files.html.ep:32 themes/default/templates/index.html.ep:104 +msgid "Deletion link" +msgstr "Verwijderingslink" + +#: themes/default/templates/delays.html.ep:8 +msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." +msgstr "Geen zorgen: als een gebruiker de download start voor de vervaldatum, dan zal die het bestand kunnen binnenhalen." + +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 +msgid "Download" +msgstr "Download" + +#: themes/default/templates/render.html.ep:47 +msgid "Download aborted." +msgstr "Download geannuleerd." + +#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:105 +msgid "Download link" +msgstr "Download link" + +#: themes/default/templates/about.html.ep:10 +msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." +msgstr "Drag and drop bestanden in de daarvoor bestemde locatie of gebruik de traditionele weg om bestanden encrypted op te sturen naar server. Je zal 2 linkjes per bestand krijgen: een download link, die stuur je naar personen waarmee je het bestand wilt delen en een verwijderings link, waarmee je het bestand kan verwijderen wanneer je dat wilt." + +#: themes/default/templates/index.html.ep:77 +msgid "Drop files here" +msgstr "Sleep bestand(en) naar dit venster" + +#: themes/default/templates/mail.html.ep:38 +msgid "Email body" +msgstr "Email inhoud" + +#: themes/default/templates/mail.html.ep:30 +msgid "Email subject" +msgstr "Onderwerp" + +#: themes/default/templates/mail.html.ep:24 themes/default/templates/mail.html.ep:26 +msgid "Emails" +msgstr "Emails" + +#: themes/default/templates/index.html.ep:107 +msgid "Encrypting part XX1 of XX2" +msgstr "Encrypten deel XX1 van XX2 " + +#: lib/Lufi/Controller/Files.pm:225 +msgid "Error: the file existed but was deleted." +msgstr "Fout: het bestand bestond wel maar is verwijderd." + +#: lib/Lufi/Controller/Files.pm:291 +msgid "Error: the file has not been sent entirely." +msgstr "Fout: het bestand is niet volledig opgestuurd." + +#: lib/Lufi/Controller/Files.pm:301 +msgid "Error: unable to find the file. Are you sure of your URL?" +msgstr "Fout: kan het bestand niet vinden. Is de URL juist?" + +#: themes/default/templates/index.html.ep:108 +msgid "Expiration:" +msgstr "Vervaldatum:" + +#: themes/default/templates/files.html.ep:31 +msgid "Expires at" +msgstr "Vervalt op" + +#: themes/default/templates/files.html.ep:12 +msgid "Export localStorage data" +msgstr "Exporteer opgeslagen data" + +#: lib/Lufi/Controller/Files.pm:393 +msgid "File deleted" +msgstr "Bestand verwijderd" + +#: themes/default/templates/files.html.ep:26 +msgid "File name" +msgstr "Bestandsnaam" + +#: themes/default/templates/render.html.ep:51 +msgid "Get the file" +msgstr "Download bestand" + +#: themes/default/templates/about.html.ep:19 +msgid "Get the source code on the official repository or on its Github mirror" +msgstr "Krijg de broncode op de officiële repository of op Github mirror" + +#: themes/default/templates/mail.html.ep:78 +msgid "Hello,\\n\\nHere's some files I want to share with you:\\n" +msgstr "Hallo,\\n\\nHier zijn enkele bestanden die ik met je wil delen:\\n\\n" + +#: themes/default/templates/mail.html.ep:34 +msgid "Here's some files" +msgstr "Hier zijn enkele bestanden" + +#: themes/default/templates/index.html.ep:110 +msgid "Hit Enter, then Ctrl+C to copy all the download links" +msgstr "Druk Enter, vervolgens CTRL+C om alle download links te kopieeren" + +#: themes/default/templates/index.html.ep:109 +msgid "Hit Enter, then Ctrl+C to copy the download link" +msgstr "Druk Enter, vervolgens CTRL+C om de download link te kopieeren" + +#: themes/default/templates/about.html.ep:9 +msgid "How does it work?" +msgstr "Hoe werkt het?" + +#: themes/default/templates/about.html.ep:17 +msgid "How to install the software on my server?" +msgstr "Hoe installeer ik de software op mijn server?" + +#: themes/default/templates/about.html.ep:12 +msgid "How to report an illegal file?" +msgstr "Hoe rapporteer ik een verdachte bestand?" + +#: themes/default/templates/delays.html.ep:7 +msgid "If you choose a delay, the file will be deleted after that delay." +msgstr "Als je een uitstel kiest, zal het bestand na die uitstel tijd verwijderd worden." + +#: themes/default/templates/mail.html.ep:15 +msgid "If you send the mail from this server, the links will be sent to the server, which may lower your privacy protection." +msgstr "Als je een mail via de server verstuurt, zullen links naar de server verstuurd worden waardoor je lagere privacy protection zal hebben." + +#: themes/default/templates/files.html.ep:14 +msgid "Import localStorage data" +msgstr "Importeer opgeslagen data" + +#: themes/default/templates/index.html.ep:37 +msgid "Important: more information on delays" +msgstr "Belangrijk: meer informatie over uitstel" + +#: themes/default/templates/delays.html.ep:5 +msgid "Information about delays" +msgstr "Informatie over uitstel" + +#: themes/default/templates/render.html.ep:49 +msgid "It seems that the key in your URL is incorrect. Please, verify your URL." +msgstr "Het lijkt er op dat de sleutel in je URL niet klopt. Controleer je URL." + +#: themes/default/templates/index.html.ep:12 +msgid "Javascript is disabled. You won't be able to use Lufi." +msgstr "Javascript is uitgeschakeld. Je kan geen gebruik maken van Lufi." + +#: themes/default/templates/login.html.ep:15 +msgid "Login" +msgstr "Login" + +#: themes/default/templates/layouts/default.html.ep:67 themes/default/templates/layouts/default.html.ep:79 +msgid "Logout" +msgstr "Logout" + +#: themes/default/templates/about.html.ep:4 +msgid "Lufi is a free (as in free speech) file hosting software." +msgstr "Lufi is een gratis bestand hosting software." + +#: themes/default/templates/files.html.ep:33 +msgid "Mail" +msgstr "" + +#: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:61 themes/default/templates/layouts/default.html.ep:73 +msgid "My files" +msgstr "Mijn bestanden" + +#. (format_bytes($json->{size}) +#: lib/Lufi/Controller/Files.pm:69 +msgid "No enough space available on the server for this file (size: %1)." +msgstr "Geen genoeg ruimte op de server voor deze bestand (grootte: %1)." + +#: themes/default/templates/files.html.ep:45 themes/default/templates/index.html.ep:112 +msgid "No expiration delay" +msgstr "Geen verloop uitstel" + +#: themes/default/templates/files.html.ep:8 +msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." +msgstr "Alleen bestanden die via deze browser zijn verstuurd zijn hier zichtbaar. Deze lijst is opgeslagen: als je opgeslagen data verwijderd, zal je deze lijst verlizen." + +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 +msgid "Password" +msgstr "Wachtwoord" + +#. (config('contact') +#: themes/default/templates/about.html.ep:13 +msgid "Please contact the administrator: %1" +msgstr "Neem contact op met administrator: %1" + +#: themes/default/templates/render.html.ep:33 +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." + +#: lib/Lufi.pm:191 +msgid "Please, check your credentials: unable to authenticate." +msgstr "" + +#: themes/default/templates/about.html.ep:5 +msgid "Privacy" +msgstr "Privacy" + +#: themes/default/templates/files.html.ep:13 +msgid "Purge expired files from localStorage" +msgstr "Verwijder verlopen data" + +#: +msgid "Register" +msgstr "Registreer" + +#: themes/default/templates/files.html.ep:9 +msgid "Rows in red mean that the files have expired and are no longer available." +msgstr "Rode rijen betekenen dat deze bestanden verlopen en verwijderd zijn." + +#: themes/default/templates/index.html.ep:111 +msgid "Send all links by email" +msgstr "Verstuur alle links via mail" + +#: themes/default/templates/mail.html.ep:45 +msgid "Send with this server" +msgstr "Verstuur via deze server" + +#: themes/default/templates/mail.html.ep:46 +msgid "Send with your own mail software" +msgstr "Verstuur via eigen mail software" + +#: themes/default/templates/index.html.ep:113 +msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." +msgstr "Versturen deel XX1 van XX2. Een ogenblik geduld..." + +#. (url_for('/') +#: themes/default/templates/mail.html.ep:91 +msgid "Share your files in total privacy on %1" +msgstr "Deel je bestanden met volledige privacy op %1" + +#: themes/default/templates/layouts/default.html.ep:63 themes/default/templates/layouts/default.html.ep:75 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 +msgid "Signin" +msgstr "Inloggen" + +#: lib/Lufi.pm:194 +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 "" + +#: themes/default/templates/index.html.ep:30 +msgid "Sorry, the uploading is currently disabled. Please try again later." +msgstr "Sorry, uploaden is momenteel uitgeschakeld. Probeer het later nogmaals." + +#: lib/Lufi/Controller/Files.pm:43 +msgid "Sorry, uploading is disabled." +msgstr "SOrry, uploaden is uitgeschakeld." + +#: themes/default/templates/about.html.ep:7 +msgid "The administrator can only see the file's name, its size and its mimetype (what kind of file it is: video, text, etc.)." +msgstr "Beheerders zien alleen bestandsnamen, grootte en mimetype (wat voor soort bestand het is: video, tekst etc.)." + +#: themes/default/templates/files.html.ep:46 +msgid "The data has been successfully imported." +msgstr "Data is succesvol geimporteerd." + +#: lib/Lufi/Controller/Mail.pm:43 +msgid "The email body can't be empty." +msgstr "Mail inhoud kan niet leeg zijn." + +#: lib/Lufi/Controller/Mail.pm:42 +msgid "The email subject can't be empty." +msgstr "Onderwerp kan niet leeg zijn." + +#: lib/Lufi/Controller/Files.pm:390 +msgid "The file has already been deleted" +msgstr "Bestand is reeds verwijderd" + +#: themes/default/templates/about.html.ep:6 +msgid "The files uploaded on a Lufi instance are encrypted before the upload to the server: the administrator of the server can not see the file's content." +msgstr "Bestanden die geupload zijn naar Lufi worden voor de upload versleuteld: beheerders van de server kunnen de inhoud van het bestand niet zien." + +#. (join(', ', @bad) +#: lib/Lufi/Controller/Mail.pm:38 +msgid "The following email addresses are not valid: %1" +msgstr "Volgende email adressen zijn niet geldig: %1" + +#: themes/default/templates/index.html.ep:101 +msgid "The link(s) has been copied to your clipboard" +msgstr "De link is gekopieerd naar je klembord" + +#: lib/Lufi/Controller/Mail.pm:66 +msgid "The mail has been sent." +msgstr "Email is verzonden." + +#: themes/default/templates/about.html.ep:15 +msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." +msgstr "De oorspronkelijke auteur is Luc Didry. Als je hem wilt ondersteunen, dan kan dat via Tipeee of via Liberapay." + +#: lib/Lufi/Controller/Files.pm:179 +msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." +msgstr "Server kon een deel van het bestand niet vinden. Neem contact op met beheerder." + +#: themes/default/templates/delays.html.ep:10 +msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" +msgstr "Deze server stelt beperkingen vast volgens de bestandsgrootte. De vervaldatum van uw bestand zal het minimum zijn tussen wat u kiest en de volgende beperkingen:" + +#: themes/default/templates/index.html.ep:102 +msgid "Unable to copy the link(s) to your clipboard" +msgstr "Kan de link(s) niet naar je klembord kopieeren" + +#. ($short) +#: lib/Lufi/Controller/Files.pm:361 +msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." +msgstr "Kan geen teller verkrijgen voor %1. Bestand bestaat niet. Het zal verwijderd worden van opgeslagen data." + +#. ($short) +#: lib/Lufi/Controller/Files.pm:351 +msgid "Unable to get counter for %1. The token is invalid." +msgstr "Kan geen teller verkrijgen voor %1. De token is ongeldig." + +#. ($short) +#: lib/Lufi/Controller/Files.pm:371 +msgid "Unable to get counter for %1. You are not authenticated." +msgstr "Kan geen teller verkrijgen voor %1. Je bent niet geauthenticeerd." + +#: themes/default/templates/layouts/default.html.ep:60 themes/default/templates/layouts/default.html.ep:72 +msgid "Upload files" +msgstr "Upload bestanden" + +#: themes/default/templates/files.html.ep:30 +msgid "Uploaded at" +msgstr "Geupload op" + +#: themes/default/templates/index.html.ep:85 +msgid "Uploaded files" +msgstr "Geuploade bestanden" + +#: themes/default/templates/index.html.ep:114 +msgid "Websocket communication error" +msgstr "Websocket communicatie fout" + +#: themes/default/templates/about.html.ep:3 +msgid "What is Lufi?" +msgstr "Wat is Lufi?" + +#: themes/default/templates/about.html.ep:14 +msgid "Who wrote this software?" +msgstr "Wie heeft deze software geschreven?" + +#: themes/default/templates/about.html.ep:11 +msgid "You can see the list of your files by clicking on the \"My files\" link at the top right of this page." +msgstr "Je kan een lijst van je eigen bestanden zien door op \"Mijn bestanden\" link rechts boven te klikken." + +#: themes/default/templates/about.html.ep:8 +msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." +msgstr "U hoeft zich niet te registreren om bestanden te uploaden, maar wees ervan bewust dat uw IP-adres om juridische redenen zal worden opgeslagen wanneer u een bestand verzendt. Geen paniek, dit is normaal gesproken het geval voor alle sites waarnaar u bestanden verzendt." + +#: themes/default/templates/render.html.ep:53 +msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." +msgstr "Je hebt geen sleutel in je URL. Je kan het bestand niet decrypten. Download geannuleerd." + +#: themes/default/templates/render.html.ep:50 +msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" +msgstr "Je verlaat deze pagina. Download zal geannuleerd worden. Weet je het zeker?" + +#: themes/default/templates/index.html.ep:99 +msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" +msgstr "Je verlaat deze pagina. Upload zal geannuleerd worden. Weet je het zeker? " + +#: themes/default/templates/logout.html.ep:5 +msgid "You have been successfully logged out." +msgstr "Je bent succesvol uitgelogd." + +#: lib/Lufi/Controller/Mail.pm:41 +msgid "You must give email addresses." +msgstr "Je moet een mail adres opgeven." + +#. (format_bytes($json->{size}) +#: lib/Lufi/Controller/Files.pm:56 +msgid "Your file is too big: %1 (maximum size allowed: %2)" +msgstr "Je bestand is te groot: %1 (max: %2)" + +#: lib/Lufi/Controller/Files.pm:273 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "" + +#: +msgid "__Content-Transfer-Encoding" +msgstr "8bit" + +#: +msgid "__Content-Type" +msgstr "text/plain; charset=utf8" + +#: +msgid "__Language-Team" +msgstr "LANGUAGE " + +#: +msgid "__Last-Translator" +msgstr "FULL NAME " + +#: +msgid "__MIME-Version" +msgstr "1.0" + +#: +msgid "__PO-Revision-Date" +msgstr "YEAR-MO-DA HO:MI+ZONE" + +#: +msgid "__POT-Creation-Date" +msgstr "YEAR-MO-DA HO:MI+ZONE" + +#: +msgid "__Project-Id-Version" +msgstr "PACKAGE VERSION" + +#. (format_bytes($keys[$i]) +#: themes/default/templates/delays.html.ep:20 +msgid "between %1 and %2, the file will be kept %3 day(s)." +msgstr "tussen %1 en %1, bestand zal bewaard worden voor %3 dag(en)." + +#. (format_bytes($keys[$i]) +#: themes/default/templates/delays.html.ep:22 +msgid "between %1 and %2, the file will be kept forever." +msgstr "tussen %1 en %2, bestand zal voor altijd bewaard worden." + +#: themes/default/templates/mail.html.ep:85 +msgid "deadline: " +msgstr "deadline: " + +#. (format_bytes($keys[$i]) +#: themes/default/templates/delays.html.ep:26 +msgid "for %1 and more, the file will be kept %2 day(s)" +msgstr "voor %1 en meer, bestand zal bewaard worden voor %2 dag(en)" + +#. (format_bytes($keys[$i]) +#: themes/default/templates/delays.html.ep:28 +msgid "for %1 and more, the file will be kept forever." +msgstr "voor %1 en meer, bestand zal voor altijd bewaard worden." + +#: themes/default/templates/index.html.ep:3 +msgid "no time limit" +msgstr "geen tijdslimiet" + +#: themes/default/templates/index.html.ep:78 +msgid "or" +msgstr "of" diff --git a/themes/default/lib/Lufi/I18N/oc.po b/themes/default/lib/Lufi/I18N/oc.po index c9fdfa7..861a413 100644 --- a/themes/default/lib/Lufi/I18N/oc.po +++ b/themes/default/lib/Lufi/I18N/oc.po @@ -1,4 +1,4 @@ -# Lufi FR translation +# Lufi OC translation # Copyright (C) 2015 Luc Didry # This file is distributed under the same license as the Lufi package. # Luc Didry , 2015. @@ -33,26 +33,30 @@ msgstr "24 oras" #: themes/default/templates/mail.html.ep:83 msgid ":" -msgstr " :" +msgstr " :" #: themes/default/templates/about.html.ep:16 -msgid "A thank you with a photo of kitten on Diaspora* or Twitter is cool too ;-)" -msgstr "Un mercé amb una foto de caton sus Diaspora* o Twitter conven tanben ;-)" +msgid "A thank you with a photo of kitten on Diaspora* or Mastodon is cool too ;-)" +msgstr "Un mercé amb una fotografia de caton sus Diaspora* o Mastodon conven tanben ;-)" -#: themes/default/templates/render.html.ep:34 +#: themes/default/templates/render.html.ep:42 msgid "Abort" msgstr "Anullar" -#: themes/default/templates/layouts/default.html.ep:40 themes/default/templates/layouts/default.html.ep:52 +#: themes/default/templates/layouts/default.html.ep:65 themes/default/templates/layouts/default.html.ep:77 msgid "About" msgstr "A prepaus" +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" +msgstr "Apondre un senhal al(s) fichièr(s)" + #: themes/default/templates/about.html.ep:18 msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." -msgstr "Ja que Lufi es un logicial liure somés als tèrmes de la licéncia AGPLv3, podètz l’installer sus vòstre pròpri servidor. Mercés de consultar lo Wiki per veire la procedura." +msgstr "Ja que Lufi es un logicial liure somés als tèrmes de la licéncia AGPLv3, podètz l’installar sus vòstre pròpri servidor. Mercés de consultar lo Wiki per veire la procedura." #. (stash('f') -#: themes/default/templates/render.html.ep:44 +#: themes/default/templates/render.html.ep:52 msgid "Asking for file part XX1 of %1" msgstr "Demanda del tròç XX1 sus %1 del fichièr" @@ -60,17 +64,17 @@ msgstr "Demanda del tròç XX1 sus %1 del fichièr" msgid "Back to homepage" msgstr "Retorn a la pagina d’acuèlh" -#: lib/Lufi/Controller/Mail.pm:20 +#: lib/Lufi/Controller/Mail.pm:21 msgid "Bad CSRF token!" -msgstr "Marrit geton CSRF !" +msgstr "Marrit geton CSRF !" -#: themes/default/templates/render.html.ep:40 +#: themes/default/templates/render.html.ep:48 msgid "Click here to refresh the page and restart the download." msgstr "Clicatz aquí per actualizar la pagina e tornar començar lo telecargament." -#: themes/default/templates/index.html.ep:72 +#: themes/default/templates/index.html.ep:80 msgid "Click to open the file browser" -msgstr "Clicatz per dobrir lo navigador de fichièr" +msgstr "Clicatz per dobrir lo navigator de fichièr" #: themes/default/templates/delays.html.ep:38 msgid "Close" @@ -80,95 +84,99 @@ msgstr "Tampar" msgid "Comma-separated email addresses" msgstr "Adreças de corrièl separadas per de virgulas" -#: themes/default/templates/index.html.ep:92 +#: themes/default/templates/index.html.ep:100 msgid "Copy all links to clipboard" -msgstr "Copiar totes los ligams dins lo quichapapièrs" +msgstr "Copiar totes los ligams al quicha-papièrs" -#: themes/default/templates/index.html.ep:95 +#: themes/default/templates/index.html.ep:103 msgid "Copy to clipboard" -msgstr "Copiar dins lo quichapapièrs" +msgstr "Copiar al quicha-papièrs" -#: lib/Lufi/Controller/Files.pm:396 +#: lib/Lufi/Controller/Files.pm:429 msgid "Could not delete the file. You are not authenticated." msgstr "Impossible de suprimir lo fichièr. Sètz pas connectat-ada." -#: lib/Lufi/Controller/Files.pm:380 +#: lib/Lufi/Controller/Files.pm:411 msgid "Could not find the file. Are you sure of the URL and the token?" -msgstr "Impossible de trobar lo fichièr. Sètz segur-a que l’URL e lo geton son bons ?" +msgstr "Impossible de trobar lo fichièr. Sètz segur-a que l’URL e lo geton son bons ?" -#: lib/Lufi/Controller/Files.pm:296 +#: lib/Lufi/Controller/Files.pm:322 msgid "Could not find the file. Are you sure of the URL?" -msgstr "Impossible de trobar lo fichièr. Sètz segur-a que l’URL es bona ?" +msgstr "Impossible de trobar lo fichièr. Sètz segur-a que l’URL es bona ?" -#: themes/default/templates/files.html.ep:26 +#: themes/default/templates/files.html.ep:28 msgid "Counter" msgstr "Comptador" -#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:64 +#: themes/default/templates/files.html.ep:29 themes/default/templates/index.html.ep:64 msgid "Delete at first download?" -msgstr "Suprimir aprèp lo primièr telecargament ?" +msgstr "Suprimir aprèp lo primièr telecargament ?" -#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:96 +#: themes/default/templates/files.html.ep:18 +msgid "Delete selected files" +msgstr "Suprimir los fichièrs seleccionats" + +#: themes/default/templates/files.html.ep:32 themes/default/templates/index.html.ep:104 msgid "Deletion link" msgstr "Ligam de supression" #: themes/default/templates/delays.html.ep:8 msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." -msgstr "Vos copetz pas lo cap : se un utilizaire comença a telecagar lo fichièr abans son expiracion e que lo telecargament s’acaba aprèp l’expiracion, utilizaire poirà recuperar lo fichièr." +msgstr "Vos copetz pas lo cap : se un utilizaire comença a telecargar lo fichièr abans son expiracion e que lo telecargament s’acaba aprèp l’expiracion, utilizaire poirà recuperar lo fichièr." -#: themes/default/templates/index.html.ep:98 +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 msgid "Download" msgstr "Telecargar" -#: themes/default/templates/render.html.ep:39 +#: themes/default/templates/render.html.ep:47 msgid "Download aborted." msgstr "Telecargament abandonat." -#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:97 +#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:105 msgid "Download link" msgstr "Ligam de telecargament" #: themes/default/templates/about.html.ep:10 msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." -msgstr "Fasètz lisar de fichièrs dins la zòna prevista per aquò far o seleccionatz un fichièr de faiçon classica e los fichièrs seràn decopats a tròces, chifrats e mandats al servidor. Recuperaretz dos ligams per fichièr : un ligam de telecargament e un ligam per suprimir lo fichièr quand o volètz." +msgstr "Fasètz lisar de fichièrs dins la zòna prevista per aquò far o seleccionatz un fichièr de faiçon classica e los fichièrs seràn descopats a tròces, chifrats e mandats al servidor. Recuperaretz dos ligams per fichièr : un ligam de telecargament e un ligam per suprimir lo fichièr quand o volètz." -#: themes/default/templates/index.html.ep:69 +#: themes/default/templates/index.html.ep:77 msgid "Drop files here" msgstr "Lisatz vòstres fichièrs aquí" #: themes/default/templates/mail.html.ep:38 msgid "Email body" -msgstr "Còs del mail" +msgstr "Còs del corrièl" #: themes/default/templates/mail.html.ep:30 msgid "Email subject" -msgstr "Subjècte del mail" +msgstr "Subjècte del corrièl" #: themes/default/templates/mail.html.ep:24 themes/default/templates/mail.html.ep:26 msgid "Emails" msgstr "Corrièl" -#: themes/default/templates/index.html.ep:99 +#: themes/default/templates/index.html.ep:107 msgid "Encrypting part XX1 of XX2" msgstr "Chiframent del tròç XX1 sus XX2" -#: lib/Lufi/Controller/Files.pm:216 +#: lib/Lufi/Controller/Files.pm:225 msgid "Error: the file existed but was deleted." -msgstr "Error : lo fichièr existissiá mas es estat suprimit" +msgstr "Error : lo fichièr existissiá mas es estat suprimit" -#: lib/Lufi/Controller/Files.pm:266 +#: lib/Lufi/Controller/Files.pm:291 msgid "Error: the file has not been sent entirely." -msgstr "Error : lo fichièr es pas estat mandat completament" +msgstr "Error : lo fichièr es pas estat mandat completament" -#: lib/Lufi/Controller/Files.pm:276 +#: lib/Lufi/Controller/Files.pm:301 msgid "Error: unable to find the file. Are you sure of your URL?" -msgstr "Error : impossible de trobar lo fichièr. Sètz segur-a de l’URL ?" +msgstr "Error : impossible de trobar lo fichièr. Sètz segur-a de l’URL ?" -#: themes/default/templates/index.html.ep:100 +#: themes/default/templates/index.html.ep:108 msgid "Expiration:" -msgstr "Expiracion :" +msgstr "Expiracion :" -#: themes/default/templates/files.html.ep:29 +#: themes/default/templates/files.html.ep:31 msgid "Expires at" msgstr "Expira lo" @@ -176,15 +184,15 @@ msgstr "Expira lo" msgid "Export localStorage data" msgstr "Exportar las donadas localStorage" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:393 msgid "File deleted" msgstr "Fichièr suprimit" -#: themes/default/templates/files.html.ep:24 +#: themes/default/templates/files.html.ep:26 msgid "File name" msgstr "Nom del fichièr" -#: themes/default/templates/render.html.ep:43 +#: themes/default/templates/render.html.ep:51 msgid "Get the file" msgstr "Recuperar lo fichièr" @@ -194,31 +202,31 @@ msgstr "Recuperatz lo còdi font sul {size}) -#: lib/Lufi/Controller/Files.pm:68 +#: lib/Lufi/Controller/Files.pm:69 msgid "No enough space available on the server for this file (size: %1)." -msgstr "Espaci disc insufisent sul servidor per aqueste fichièr (talha del fichièr : \"%1)." +msgstr "Espaci disc insufisent sul servidor per aqueste fichièr (talha del fichièr : \"%1)." -#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:104 +#: themes/default/templates/files.html.ep:45 themes/default/templates/index.html.ep:112 msgid "No expiration delay" msgstr "Pas cap de relambi d’expiracion" #: themes/default/templates/files.html.ep:8 msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." -msgstr "Sols los fichièrs mandats amb aqueste navigador web son listats aicí. Las informacions son gardadas en localStorage : se suprimissètz vòstras donadas localStorage, perdretz aquelas informacions." +msgstr "Sols los fichièrs mandats amb aqueste navigador web son listats aicí. Las informacions son gardadas en localStorage : se suprimissètz vòstras donadas localStorage, perdretz aquelas informacions." -#: themes/default/templates/login.html.ep:21 +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 msgid "Password" msgstr "Senhal" #. (config('contact') #: themes/default/templates/about.html.ep:13 msgid "Please contact the administrator: %1" -msgstr "Mercés de contactar l’administrator : %1" +msgstr "Mercés de contactar l’administrator : %1" -#: themes/default/templates/render.html.ep:25 +#: themes/default/templates/render.html.ep:33 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." +#: lib/Lufi.pm:191 +msgid "Please, check your credentials: unable to authenticate." +msgstr "Mercés de verificar vòstres identificants : impossible de vos autentificar." + #: themes/default/templates/about.html.ep:5 msgid "Privacy" msgstr "Confidencialitat" @@ -302,7 +318,7 @@ msgstr "Suprimir del localStorage los fichièrs expirats" msgid "Rows in red mean that the files have expired and are no longer available." msgstr "Las linhas en roge indican que lo fichièr a expirat e es pas mai disponible." -#: themes/default/templates/index.html.ep:103 +#: themes/default/templates/index.html.ep:111 msgid "Send all links by email" msgstr "Mandar totes los ligams per corrièl" @@ -314,7 +330,7 @@ msgstr "Mandar amb aqueste servidor" msgid "Send with your own mail software" msgstr "Mandar amb vòstre pròpri logicial de corrièl" -#: themes/default/templates/index.html.ep:105 +#: themes/default/templates/index.html.ep:113 msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." msgstr "Mandadís del fragment XX1 sus XX2. Pacientatz, la barra de progression pòt metre de temps abans d’avançar." @@ -323,52 +339,56 @@ msgstr "Mandadís del fragment XX1 sus XX2. Pacientatz, la barra de progression msgid "Share your files in total privacy on %1" msgstr "Partejatz vòstres fichièrs en tota confidencialitat sus %1" -#: themes/default/templates/layouts/default.html.ep:38 themes/default/templates/layouts/default.html.ep:50 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 +#: themes/default/templates/layouts/default.html.ep:63 themes/default/templates/layouts/default.html.ep:75 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 msgid "Signin" msgstr "Connexion" +#: lib/Lufi.pm:194 +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." + #: themes/default/templates/index.html.ep:30 msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "O planhèm, la foncion per mandar de fichièr es desactivada pel moment. Mercés de tornar ensajar mai tard." -#: lib/Lufi/Controller/Files.pm:42 +#: lib/Lufi/Controller/Files.pm:43 msgid "Sorry, uploading is disabled." msgstr "O planhèm, la foncion per mandar de fichièr es desactivada." #: themes/default/templates/about.html.ep:7 msgid "The administrator can only see the file's name, its size and its mimetype (what kind of file it is: video, text, etc.)." -msgstr "L’administrator pòt pas que veire lo nom del fichièr, sa talha e son mimetype (Quina mena de fichièr es : vidèo, tèxte, etc.)." +msgstr "L’administrator pòt pas que veire lo nom del fichièr, sa talha e son mimetype (Quina mena de fichièr es : vidèo, tèxte, etc.)." -#: themes/default/templates/files.html.ep:43 +#: themes/default/templates/files.html.ep:46 msgid "The data has been successfully imported." msgstr "Las donadas son ben estadas importadas." -#: lib/Lufi/Controller/Mail.pm:42 +#: lib/Lufi/Controller/Mail.pm:43 msgid "The email body can't be empty." msgstr "Lo contengut del corrièl pòt pas èsser void." -#: lib/Lufi/Controller/Mail.pm:41 +#: lib/Lufi/Controller/Mail.pm:42 msgid "The email subject can't be empty." msgstr "Lo sujècte del corrièl pòt pas èsser void." -#: lib/Lufi/Controller/Files.pm:361 +#: lib/Lufi/Controller/Files.pm:390 msgid "The file has already been deleted" msgstr "Lo fichièr es ja estat suprimit" #: themes/default/templates/about.html.ep:6 msgid "The files uploaded on a Lufi instance are encrypted before the upload to the server: the administrator of the server can not see the file's content." -msgstr "Los fichièrs mandats amb una instància Lufi son chifrats abans la mandadís al servidor : l’administrator del servidor pòt pas veire lo contengut dels fichièrs." +msgstr "Los fichièrs mandats amb una instància Lufi son chifrats abans la mandadís al servidor : l’administrator del servidor pòt pas veire lo contengut dels fichièrs." #. (join(', ', @bad) -#: lib/Lufi/Controller/Mail.pm:37 +#: lib/Lufi/Controller/Mail.pm:38 msgid "The following email addresses are not valid: %1" -msgstr "Las adreças de corrièl seguentas son pas validas : %1" +msgstr "Las adreças de corrièl seguentas son pas validas : %1" -#: themes/default/templates/index.html.ep:93 +#: themes/default/templates/index.html.ep:101 msgid "The link(s) has been copied to your clipboard" -msgstr "Lo(s) ligam(s) es/son estat(s) copiat(s) dins vòstre quichapapièrs" +msgstr "Lo(s) ligam(s) es/son estat(s) copiat(s) dins vòstre quicha-papièrs" -#: lib/Lufi/Controller/Mail.pm:65 +#: lib/Lufi/Controller/Mail.pm:66 msgid "The mail has been sent." msgstr "Lo corrièl es estat mandat." @@ -376,56 +396,56 @@ msgstr "Lo corrièl es estat mandat." msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." msgstr "L’autor original (e pel moment, lo sol) es Luc Didry. S’avètz enveja de lo sostenir, podètz o far via Tipeee o via Liberapay." -#: lib/Lufi/Controller/Files.pm:168 +#: lib/Lufi/Controller/Files.pm:179 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "Lo servidor es pas estat capable de retrobar l’enregistrament del fichièr que li cal ajustar vòstre tròç de fichièr. Mercés de contactar l’administrator." #: themes/default/templates/delays.html.ep:10 msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" -msgstr "Aqueste servidor impausa de limitacions segon la tailha dels fichièrs. Lo relambi d’expiracion de vòstre fichièr serà lo minimum entre çò qu’avètz causit e los limits seguents :" +msgstr "Aqueste servidor impausa de limitacions segon la talha dels fichièrs. Lo relambi d’expiracion de vòstre fichièr serà lo minimum entre çò qu’avètz causit e los limits seguents :" -#: themes/default/templates/index.html.ep:94 +#: themes/default/templates/index.html.ep:102 msgid "Unable to copy the link(s) to your clipboard" -msgstr "Impossible de copiar lo(s) ligams(s) dins vòstre quichapapièrs" +msgstr "Impossible de copiar lo(s) ligams(s) dins vòstre quicha-papièrs" #. ($short) -#: lib/Lufi/Controller/Files.pm:334 +#: lib/Lufi/Controller/Files.pm:361 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "Impossible de recuperar lo comptador per %1. Lo fichièr existís pas. Serà levat de vòstre localStorage." #. ($short) -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:351 msgid "Unable to get counter for %1. The token is invalid." msgstr "Impossible de recuperar lo comptador per %1. Lo geton es invalid." #. ($short) -#: lib/Lufi/Controller/Files.pm:344 +#: lib/Lufi/Controller/Files.pm:371 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Impossible de recuperar lo comptador per %1. Sètz pas connectat·ada." -#: themes/default/templates/layouts/default.html.ep:35 themes/default/templates/layouts/default.html.ep:47 +#: themes/default/templates/layouts/default.html.ep:60 themes/default/templates/layouts/default.html.ep:72 msgid "Upload files" msgstr "Mandar de fichièrs" -#: themes/default/templates/files.html.ep:28 +#: themes/default/templates/files.html.ep:30 msgid "Uploaded at" msgstr "Mandat lo" -#: themes/default/templates/index.html.ep:77 +#: themes/default/templates/index.html.ep:85 msgid "Uploaded files" msgstr "Fichièrs mandats" -#: themes/default/templates/index.html.ep:106 +#: themes/default/templates/index.html.ep:114 msgid "Websocket communication error" msgstr "Error de comunicacion WebSocket" #: themes/default/templates/about.html.ep:3 msgid "What is Lufi?" -msgstr "Qu’es aquò Lufi ?" +msgstr "Qu’es aquò Lufi ?" #: themes/default/templates/about.html.ep:14 msgid "Who wrote this software?" -msgstr "Qual escriguèt aqueste logicial ?" +msgstr "Qual escriguèt aqueste logicial ?" #: themes/default/templates/about.html.ep:11 msgid "You can see the list of your files by clicking on the \"My files\" link at the top right of this page." @@ -435,30 +455,34 @@ msgstr "Podètz veire la lista de vòstres fichièrs en clicant sul ligam « Mos msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." msgstr "Avètz pas besonh de vos enregistrar per mandar de fichièrs mas notatz que, per de rasons legalas, vòstra adreça IP serà enregistrada quand mandatz un fichièr. Paniquetz pas, es normalament lo cas per totes los sites ont mandatz de fichièrs." -#: themes/default/templates/render.html.ep:45 +#: themes/default/templates/render.html.ep:53 msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." msgstr "Sembla qu’avètz pas la bona clau dins l’URL. Poiretz pas deschifrar lo fichièr. Telecargament anullat." -#: themes/default/templates/render.html.ep:42 +#: themes/default/templates/render.html.ep:50 msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" -msgstr "Ensajatz de partir de la pagina. Lo telecargament serà anullat. Sètz segur-a ?" +msgstr "Ensajatz de partir de la pagina. Lo telecargament serà anullat. Sètz segur-a ?" -#: themes/default/templates/index.html.ep:91 +#: themes/default/templates/index.html.ep:99 msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" -msgstr "Ensajatz de partir de la pagina. Lo mandadís serà anullat. Sètz segur-a ?" +msgstr "Ensajatz de partir de la pagina. Lo mandadís serà anullat. Sètz segur-a ?" #: themes/default/templates/logout.html.ep:5 msgid "You have been successfully logged out." msgstr "Sètz ben estat desconnectat." -#: lib/Lufi/Controller/Mail.pm:40 +#: lib/Lufi/Controller/Mail.pm:41 msgid "You must give email addresses." msgstr "Vos cal donar d’adreças." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:55 +#: lib/Lufi/Controller/Files.pm:56 msgid "Your file is too big: %1 (maximum size allowed: %2)" -msgstr "Vòstre fichièr es tròp voluminós : %1 (la talha maximum autorizada es %2)" +msgstr "Vòstre fichièr es tròp voluminós : %1 (la talha maximum autorizada es %2)" + +#: lib/Lufi/Controller/Files.pm:273 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "Lo senhal es pas valid. Mercés d’actualizar la pagina e ensajar tornamai." #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:20 @@ -472,7 +496,7 @@ msgstr "entre %1 e %2, lo fichièr serà gardat per totjorn. ;" #: themes/default/templates/mail.html.ep:85 msgid "deadline: " -msgstr "darrièr relambi per telecargar :" +msgstr "darrièr relambi per telecargar :" #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:26 @@ -488,6 +512,6 @@ msgstr "per %1 e mai, lo fichièr serà gardat per totjorn." msgid "no time limit" msgstr "Pas cap de relambi d’expiracion" -#: themes/default/templates/index.html.ep:70 +#: themes/default/templates/index.html.ep:78 msgid "or" msgstr "o" diff --git a/themes/default/lib/Lufi/I18N/pt.po b/themes/default/lib/Lufi/I18N/pt.po index e449e96..851ebcb 100644 --- a/themes/default/lib/Lufi/I18N/pt.po +++ b/themes/default/lib/Lufi/I18N/pt.po @@ -37,23 +37,27 @@ msgid ":" msgstr " :" #: themes/default/templates/about.html.ep:16 -msgid "A thank you with a photo of kitten on Diaspora* or Twitter is cool too ;-)" -msgstr "Um obrigado com a foto de um gatinho no Diaspora* ou Twitter é também porreiro ;-)" +msgid "A thank you with a photo of kitten on Diaspora* or Mastodon is cool too ;-)" +msgstr "Um obrigado com a foto de um gatinho no Diaspora* ou Mastodon é também porreiro ;-)" -#: themes/default/templates/render.html.ep:34 +#: themes/default/templates/render.html.ep:42 msgid "Abort" msgstr "Interromper" -#: themes/default/templates/layouts/default.html.ep:40 themes/default/templates/layouts/default.html.ep:52 +#: themes/default/templates/layouts/default.html.ep:65 themes/default/templates/layouts/default.html.ep:77 msgid "About" msgstr "Sobre" +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" +msgstr "" + #: themes/default/templates/about.html.ep:18 msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." msgstr "Como Lufi é um programa livre sob os termos da licença AGPLv3, pode instalar-lo no seu prórpio servidor. Para saber mais clique aqui Wiki para ver o procedimento." #. (stash('f') -#: themes/default/templates/render.html.ep:44 +#: themes/default/templates/render.html.ep:52 msgid "Asking for file part XX1 of %1" msgstr "Pedido de recuperação de um fragmento do ficheiro XX1 de %1" @@ -61,15 +65,15 @@ msgstr "Pedido de recuperação de um fragmento do ficheiro XX1 de %1" msgid "Back to homepage" msgstr "Voltar à página inicial" -#: lib/Lufi/Controller/Mail.pm:20 +#: lib/Lufi/Controller/Mail.pm:21 msgid "Bad CSRF token!" msgstr "Símbolo errado CSRF !" -#: themes/default/templates/render.html.ep:40 +#: themes/default/templates/render.html.ep:48 msgid "Click here to refresh the page and restart the download." msgstr "Clique aqui para atualizar a página e começar o download." -#: themes/default/templates/index.html.ep:72 +#: themes/default/templates/index.html.ep:80 msgid "Click to open the file browser" msgstr "Clique para abrir o navegador de ficheiros" @@ -81,35 +85,39 @@ msgstr "Fechar" msgid "Comma-separated email addresses" msgstr "Os e-mails devem ser separados por vírgulas" -#: themes/default/templates/index.html.ep:92 +#: themes/default/templates/index.html.ep:100 msgid "Copy all links to clipboard" msgstr "Copiar todos os links para a área de transferência" -#: themes/default/templates/index.html.ep:95 +#: themes/default/templates/index.html.ep:103 msgid "Copy to clipboard" msgstr "Copiar para a área de transferência" -#: lib/Lufi/Controller/Files.pm:396 +#: lib/Lufi/Controller/Files.pm:429 msgid "Could not delete the file. You are not authenticated." msgstr "Impossível apagar o ficheiro. Não está conectado." -#: lib/Lufi/Controller/Files.pm:380 +#: lib/Lufi/Controller/Files.pm:411 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "Impossível encontrar o ficheiro.Tem a certeza que o URL e os símbolos estão corretos?" -#: lib/Lufi/Controller/Files.pm:296 +#: lib/Lufi/Controller/Files.pm:322 msgid "Could not find the file. Are you sure of the URL?" msgstr "Impossível encontar o ficheiro. Tem a certeza de que o URL está correto?" -#: themes/default/templates/files.html.ep:26 +#: themes/default/templates/files.html.ep:28 msgid "Counter" msgstr "Contador" -#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:64 +#: themes/default/templates/files.html.ep:29 themes/default/templates/index.html.ep:64 msgid "Delete at first download?" msgstr "Apagar após o primeiro download?" -#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:96 +#: themes/default/templates/files.html.ep:18 +msgid "Delete selected files" +msgstr "" + +#: themes/default/templates/files.html.ep:32 themes/default/templates/index.html.ep:104 msgid "Deletion link" msgstr "Eliminar o link" @@ -117,15 +125,15 @@ msgstr "Eliminar o link" msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." msgstr "Não se preocupe: se um utilizador começa a descarregar um ficheiro antes a sua expiração e que o descarregamento acaba após a sua expiração, o utilizador pode ainda assim recuperar o ficheiro." -#: themes/default/templates/index.html.ep:98 +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 msgid "Download" msgstr "Download" -#: themes/default/templates/render.html.ep:39 +#: themes/default/templates/render.html.ep:47 msgid "Download aborted." msgstr "Download interrompido." -#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:97 +#: themes/default/templates/files.html.ep:27 themes/default/templates/index.html.ep:105 msgid "Download link" msgstr "Link para o download" @@ -133,7 +141,11 @@ msgstr "Link para o download" msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." msgstr "Deslize os ficheiros na zona própria e esse efeito ou selecione um ficheiro de forma tradicional, e os ficheiros serão fragmentados, codificados e enviados ao servidor. Vai receber dois links por ficheiro: um é de download e o outro para poder apagar o ficheiro quando quiser." -#: themes/default/templates/index.html.ep:69 +#: themes/default/templates/index.html.ep:77 +msgid "Drop files here" +msgstr "" + +#: msgid "Drop files here (max. 4 Gb/file)" msgstr "Deslize os ficheiros aqui (max. 4 Gb/ficheiro)" @@ -149,27 +161,27 @@ msgstr "Assunto do e-mail" msgid "Emails" msgstr "E-mails" -#: themes/default/templates/index.html.ep:99 +#: themes/default/templates/index.html.ep:107 msgid "Encrypting part XX1 of XX2" msgstr "Codificação do fragmento XX1 de XX2" -#: lib/Lufi/Controller/Files.pm:216 +#: lib/Lufi/Controller/Files.pm:225 msgid "Error: the file existed but was deleted." msgstr "Erro: o ficheiro existia mas foi apagado." -#: lib/Lufi/Controller/Files.pm:266 +#: lib/Lufi/Controller/Files.pm:291 msgid "Error: the file has not been sent entirely." msgstr "Erro: o ficheiro não foi enviado na totalidade." -#: lib/Lufi/Controller/Files.pm:276 +#: lib/Lufi/Controller/Files.pm:301 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Erro: impossível encontrar o ficheiro. Tem a certeza do URL?" -#: themes/default/templates/index.html.ep:100 +#: themes/default/templates/index.html.ep:108 msgid "Expiration:" msgstr "Expiração:" -#: themes/default/templates/files.html.ep:29 +#: themes/default/templates/files.html.ep:31 msgid "Expires at" msgstr "Expira no" @@ -177,15 +189,15 @@ msgstr "Expira no" msgid "Export localStorage data" msgstr "Exportar os dados localStorage" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:393 msgid "File deleted" msgstr "Ficheiro apagado" -#: themes/default/templates/files.html.ep:24 +#: themes/default/templates/files.html.ep:26 msgid "File name" msgstr "Nome do ficheiro" -#: themes/default/templates/render.html.ep:43 +#: themes/default/templates/render.html.ep:51 msgid "Get the file" msgstr "Recuperar o ficheiro" @@ -201,11 +213,11 @@ msgstr "Olá,\\n\\nAqui estão alguns ficheiros que gostaria de partilhar contig msgid "Here's some files" msgstr "Aqui estão alguns ficheiros" -#: themes/default/templates/index.html.ep:102 +#: themes/default/templates/index.html.ep:110 msgid "Hit Enter, then Ctrl+C to copy all the download links" msgstr "Clique no Enter e depois Ctrl+C para copiar todos os links de download" -#: themes/default/templates/index.html.ep:101 +#: themes/default/templates/index.html.ep:109 msgid "Hit Enter, then Ctrl+C to copy the download link" msgstr "Clique no Enter e depois Ctrl+C para copiar o link de download" @@ -213,10 +225,14 @@ msgstr "Clique no Enter e depois Ctrl+C para copiar o link de download" msgid "How does it work?" msgstr "Como funciona?" -#: themes/default/templates/about.html.ep:17 +#: msgid "How to install Lufi on my server?" msgstr "Como instalar Lufi no meu servidor?" +#: themes/default/templates/about.html.ep:17 +msgid "How to install the software on my server?" +msgstr "" + #: themes/default/templates/about.html.ep:12 msgid "How to report an illegal file?" msgstr "Como assinalar um ficheiro ilegal?" @@ -241,7 +257,7 @@ msgstr "Importante: mais informações sobre os prazos" msgid "Information about delays" msgstr "Informação sobre os prazos" -#: themes/default/templates/render.html.ep:41 +#: themes/default/templates/render.html.ep:49 msgid "It seems that the key in your URL is incorrect. Please, verify your URL." msgstr "Parece que a chave do seu URL está incorreta.Por favor, verifique o seu URL." @@ -253,7 +269,7 @@ msgstr "Javascript está desativado. Lufi não funcionará." msgid "Login" msgstr "Utilizador" -#: themes/default/templates/layouts/default.html.ep:42 themes/default/templates/layouts/default.html.ep:54 +#: themes/default/templates/layouts/default.html.ep:67 themes/default/templates/layouts/default.html.ep:79 msgid "Logout" msgstr "Encerrar sessão" @@ -261,16 +277,20 @@ msgstr "Encerrar sessão" msgid "Lufi is a free (as in free speech) file hosting software." msgstr "Lufi é um programa de reserva gratuita (como na liberdade de expressão) de ficheiros." -#: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:36 themes/default/templates/layouts/default.html.ep:48 +#: themes/default/templates/files.html.ep:33 +msgid "Mail" +msgstr "" + +#: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:61 themes/default/templates/layouts/default.html.ep:73 msgid "My files" msgstr "Meus ficheiros" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:68 +#: lib/Lufi/Controller/Files.pm:69 msgid "No enough space available on the server for this file (size: %1)." msgstr "O servidor não tem espaço suficiente para este ficheiro (tamanho: %1)." -#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:104 +#: themes/default/templates/files.html.ep:45 themes/default/templates/index.html.ep:112 msgid "No expiration delay" msgstr "Não tem prazo de expiração" @@ -278,7 +298,7 @@ msgstr "Não tem prazo de expiração" msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." msgstr "Apenas os ficheiros enviados com este navegador web estão listados aqui. As informações são armazenadas no localStorage : se apagar os seus dados no LocalStorage, poedrá perder essa informação." -#: themes/default/templates/login.html.ep:21 +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 msgid "Password" msgstr "Palavra-passe" @@ -287,10 +307,14 @@ msgstr "Palavra-passe" msgid "Please contact the administrator: %1" msgstr "Contacte o administrador: %1" -#: themes/default/templates/render.html.ep:25 +#: themes/default/templates/render.html.ep:33 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." +#: lib/Lufi.pm:191 +msgid "Please, check your credentials: unable to authenticate." +msgstr "" + #: themes/default/templates/about.html.ep:5 msgid "Privacy" msgstr "Privacidade" @@ -303,7 +327,7 @@ msgstr "Apagar do localStorage os ficheiros expirados" msgid "Rows in red mean that the files have expired and are no longer available." msgstr "As linhas a vermelho indicam que o ficheiro expirou e já não está disponível." -#: themes/default/templates/index.html.ep:103 +#: themes/default/templates/index.html.ep:111 msgid "Send all links by email" msgstr "Enviar todos os links por e-mail" @@ -315,7 +339,7 @@ msgstr "Enviar com este servidor" msgid "Send with your own mail software" msgstr "Enviar com o seu e-mail pessoal" -#: themes/default/templates/index.html.ep:105 +#: themes/default/templates/index.html.ep:113 msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." msgstr "Envio do fragmento XX1 de XX2. Por favor aguarde, a barra de progressão pode levar algum tempo antes de avançar." @@ -324,15 +348,19 @@ msgstr "Envio do fragmento XX1 de XX2. Por favor aguarde, a barra de progressão msgid "Share your files in total privacy on %1" msgstr "Partilhe os seus ficheiros com toda a privacidade em %1" -#: themes/default/templates/layouts/default.html.ep:38 themes/default/templates/layouts/default.html.ep:50 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 +#: themes/default/templates/layouts/default.html.ep:63 themes/default/templates/layouts/default.html.ep:75 themes/default/templates/login.html.ep:26 themes/default/templates/logout.html.ep:8 msgid "Signin" msgstr "Conexão" +#: lib/Lufi.pm:194 +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 "" + #: themes/default/templates/index.html.ep:30 msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "Desculpe, o envio do ficheiro está atualmente desativado. Tente mais tarde." -#: lib/Lufi/Controller/Files.pm:42 +#: lib/Lufi/Controller/Files.pm:43 msgid "Sorry, uploading is disabled." msgstr "Desculpe, o envio do ficheiro está desativado." @@ -340,19 +368,19 @@ msgstr "Desculpe, o envio do ficheiro está desativado." msgid "The administrator can only see the file's name, its size and its mimetype (what kind of file it is: video, text, etc.)." msgstr "O administrador pode apenas ver o nome do ficheiro, o seu tamanho e o tipo de mime (o tipo de ficheiro: texto, vídeo, etc.)." -#: themes/default/templates/files.html.ep:43 +#: themes/default/templates/files.html.ep:46 msgid "The data has been successfully imported." msgstr "Os dados foram importados com sucesso." -#: lib/Lufi/Controller/Mail.pm:42 +#: lib/Lufi/Controller/Mail.pm:43 msgid "The email body can't be empty." msgstr "A mensagem do e-mail não pode estar vazia." -#: lib/Lufi/Controller/Mail.pm:41 +#: lib/Lufi/Controller/Mail.pm:42 msgid "The email subject can't be empty." msgstr "O assunto do e-mail não pode estar vazio." -#: lib/Lufi/Controller/Files.pm:361 +#: lib/Lufi/Controller/Files.pm:390 msgid "The file has already been deleted" msgstr "O ficheiro já foi apagado" @@ -361,15 +389,15 @@ msgid "The files uploaded on a Lufi instance are encrypted before the upload to msgstr "Os ficheiros enviados no Lufi são codificados antes de serem enviados ao servidor: o administrador do servidor não pode ver o conteúdo dos ficheiros." #. (join(', ', @bad) -#: lib/Lufi/Controller/Mail.pm:37 +#: lib/Lufi/Controller/Mail.pm:38 msgid "The following email addresses are not valid: %1" msgstr "Os e-mails seguintes não são válidos: %1" -#: themes/default/templates/index.html.ep:93 +#: themes/default/templates/index.html.ep:101 msgid "The link(s) has been copied to your clipboard" msgstr "O(s) link(s) foi/foram copiados para a área de transferência" -#: lib/Lufi/Controller/Mail.pm:65 +#: lib/Lufi/Controller/Mail.pm:66 msgid "The mail has been sent." msgstr "O e-mail foi enviado." @@ -377,7 +405,7 @@ msgstr "O e-mail foi enviado." msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." msgstr "O autor original (e por agora, o único) é Luc Didry. Se o desejar apoiar pode fazer-lo via Tipeee ou via Liberapay." -#: lib/Lufi/Controller/Files.pm:168 +#: lib/Lufi/Controller/Files.pm:179 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "O servidor foi incapaz de encontrar o registo do ficheiro no qual devia-se juntar o fragmento do seu ficheiro. Contacte o administrador." @@ -385,38 +413,38 @@ msgstr "O servidor foi incapaz de encontrar o registo do ficheiro no qual devia- msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" msgstr "O servidor exige limites segundo o tamanho dos ficheiros. O prazo de expiração dos seu ficheiro sera o minimo entre o que você escolheu e os limites seguintes:" -#: themes/default/templates/index.html.ep:94 +#: themes/default/templates/index.html.ep:102 msgid "Unable to copy the link(s) to your clipboard" msgstr "Impossível copiar o(s) link(s) na sua área de transferência" #. ($short) -#: lib/Lufi/Controller/Files.pm:334 +#: lib/Lufi/Controller/Files.pm:361 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "Impossível recuperar o contador para %1. O ficheiro não existe. Isso vai apagar a sua localStorage." #. ($short) -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:351 msgid "Unable to get counter for %1. The token is invalid." msgstr "Impossível recuperar o contador para %1. O símbolo é inválido." #. ($short) -#: lib/Lufi/Controller/Files.pm:344 +#: lib/Lufi/Controller/Files.pm:371 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Impossível recuperar o contador para %1. Não está conectado." -#: themes/default/templates/layouts/default.html.ep:35 themes/default/templates/layouts/default.html.ep:47 +#: themes/default/templates/layouts/default.html.ep:60 themes/default/templates/layouts/default.html.ep:72 msgid "Upload files" msgstr "Enviar os ficheiros" -#: themes/default/templates/files.html.ep:28 +#: themes/default/templates/files.html.ep:30 msgid "Uploaded at" msgstr "Enviar a" -#: themes/default/templates/index.html.ep:77 +#: themes/default/templates/index.html.ep:85 msgid "Uploaded files" msgstr "Ficheiros enviados" -#: themes/default/templates/index.html.ep:106 +#: themes/default/templates/index.html.ep:114 msgid "Websocket communication error" msgstr "Erro de comunicação com WebSocket" @@ -424,10 +452,14 @@ msgstr "Erro de comunicação com WebSocket" msgid "What is Lufi?" msgstr "O que é o Lufi?" -#: themes/default/templates/about.html.ep:14 +#: msgid "Who wrote Lufi?" msgstr "Quem escreveu Lufi?" +#: themes/default/templates/about.html.ep:14 +msgid "Who wrote this software?" +msgstr "" + #: themes/default/templates/about.html.ep:11 msgid "You can see the list of your files by clicking on the \"My files\" link at the top right of this page." msgstr "Pode ver a lista dos seus ficheiros clicando no link « Meus ficheiros » em cima da página à direita." @@ -436,15 +468,15 @@ msgstr "Pode ver a lista dos seus ficheiros clicando no link « Meus ficheiros msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." msgstr "Não precisa registar-se para enviar ficheiros mas saiba que, por razões legais, o seu endereço IP ficará registrado quando envia um ficheiro. Não entre em pânico, é algo comum a todos os sites onde envia ficheiros." -#: themes/default/templates/render.html.ep:45 +#: themes/default/templates/render.html.ep:53 msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." msgstr "Parece que não tem a chave no seu URL. Não poderá descodificar o ficheiro. Download anulado." -#: themes/default/templates/render.html.ep:42 +#: themes/default/templates/render.html.ep:50 msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" msgstr "Está a tentar sair da página. O download será anulado. Tem a certeza?" -#: themes/default/templates/index.html.ep:91 +#: themes/default/templates/index.html.ep:99 msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" msgstr "Está a tentar sair da página. O envio será anulado. Tem a certeza?" @@ -452,15 +484,19 @@ msgstr "Está a tentar sair da página. O envio será anulado. Tem a certeza?" msgid "You have been successfully logged out." msgstr "Foi desconectado com sucesso." -#: lib/Lufi/Controller/Mail.pm:40 +#: lib/Lufi/Controller/Mail.pm:41 msgid "You must give email addresses." msgstr "Deve escrever os e-mails." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:55 +#: lib/Lufi/Controller/Files.pm:56 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "O seu ficheiro é grande de mais: %1 (o tamanho máximo autorizado é de %2)" +#: lib/Lufi/Controller/Files.pm:273 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "" + #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:20 msgid "between %1 and %2, the file will be kept %3 day(s)." @@ -489,6 +525,6 @@ msgstr "para %1 e mais, o ficheiro será conservado por um tempo indeterminado." msgid "no time limit" msgstr "Não tem limite de expiração" -#: themes/default/templates/index.html.ep:70 +#: themes/default/templates/index.html.ep:78 msgid "or" msgstr "ou" diff --git a/themes/default/public/css/lufi.css b/themes/default/public/css/lufi.css index 9506862..496901a 100644 --- a/themes/default/public/css/lufi.css +++ b/themes/default/public/css/lufi.css @@ -6,7 +6,6 @@ color: #888; } #files label { - background-color: #5A7BC2; padding: 6px 0; color: #FFF; font-weight: bold; @@ -17,7 +16,16 @@ cursor: pointer; } #files input { - display:none; + width: 100%; + background: rgba(150,225,150,0.0); + vertical-align: middle; + text-align: center; + padding: 0 50%; + margin-top: -206px; + color: #FFF; + font-weight: bold; + font-size: 200px; + opacity: 0; } .progress-info { text-shadow: initial; @@ -86,3 +94,11 @@ a.classic:focus { .hiddendiv.common { min-height: 170px; } +.title-filename { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.files-buttons a { + margin-bottom: 10px; +} diff --git a/themes/default/public/js/lufi-down.js b/themes/default/public/js/lufi-down.js index 62405e1..671c302 100644 --- a/themes/default/public/js/lufi-down.js +++ b/themes/default/public/js/lufi-down.js @@ -35,7 +35,7 @@ function base64ToArrayBuffer(base64) { function addAlert(msg) { $('#please-wait').remove(); - var pbd = $('#pbd'); + var pbd = $('.file-progress'); pbd.attr('role', 'alert'); pbd.removeClass('progress'); pbd.html(['
', @@ -53,7 +53,11 @@ function spawnWebsocket(pa) { var l = $('#loading'); l.html(i18n.loading.replace(/XX1/, (pa + 1))); - window.ws.send('{"part":'+pa+'}'); + if ($('#file_pwd').length === 1) { + window.ws.send('{"part":'+pa+', "file_pwd": "'+$('#file_pwd').val()+'"}'); + } else { + window.ws.send('{"part":'+pa+'}'); + } }; ws.onclose = function() { console.log('Connection is closed'); @@ -70,6 +74,9 @@ function spawnWebsocket(pa) { if (data.msg !== undefined) { addAlert(data.msg); console.log(data.msg); + if ($('#file_pwd').length === 1) { + $('.file-abort').addClass('hide'); + } window.onbeforeunload = null; } else { console.log('Getting slice '+(data.part + 1)+' of '+data.total); @@ -90,7 +97,13 @@ function spawnWebsocket(pa) { var pbd = $('#pbd'); pbd.attr('class', 'center-align'); - var blobURL = URL.createObjectURL(blob); + // IE & Edge fix for downloading blob files, gives option to save or open the file when the link is opened. + if (window.navigator && window.navigator.msSaveOrOpenBlob) { + var fileName = escapeHtml(data.name); + window.navigator.msSaveOrOpenBlob(blob, fileName); + } else { + var blobURL = URL.createObjectURL(blob); + } var innerHTML = ['

', i18n.download, '

']; if (data.type.match(/^image\//) !== null) { @@ -99,10 +112,18 @@ function spawnWebsocket(pa) { innerHTML.push(''); + } else if (data.type.match(/^audio\//) !== null) { + innerHTML.push(''); } pbd.html(innerHTML.join('')); - window.ws.send('{"ended":true}'); + if ($('#file_pwd').length === 1) { + window.ws.send('{"ended":true, "file_pwd": "'+$('#file_pwd').val()+'"}'); + } else { + window.ws.send('{"ended":true}'); + } window.onbeforeunload = null; window.completed = true; $('#abort').remove(); @@ -123,7 +144,11 @@ function spawnWebsocket(pa) { console.log('Error. Retrying to get slice '+(data.part + 1)); window.ws = spawnWebsocket(data.part + 1); }; - window.ws.send('{"part":'+(data.part + 1)+'}'); + if ($('#file_pwd').length === 1) { + window.ws.send('{"part":'+(data.part + 1)+', "file_pwd": "'+$('#file_pwd').val()+'"}'); + } else { + window.ws.send('{"part":'+(data.part + 1)+'}'); + } } } } catch(err) { @@ -157,11 +182,26 @@ $(document).ready(function(){ window.completed = false; if (key !== '=') { - // Set websocket - window.ws = spawnWebsocket(0); + var go = true; + if ($('#file_pwd').length === 1) { + go = false; + $('#go').click(function() { + $('.file-progress, .file-abort').removeClass('hide'); + $('#file_pwd').parent().parent().addClass('hide'); + // Set websocket + window.ws = spawnWebsocket(0); + + // Prevent exiting page before full download + window.onbeforeunload = confirmExit; + }); + } + if (go) { + // Set websocket + window.ws = spawnWebsocket(0); - // Prevent exiting page before full download - window.onbeforeunload = confirmExit; + // Prevent exiting page before full download + window.onbeforeunload = confirmExit; + } } else { addAlert(i18n.nokey); } diff --git a/themes/default/public/js/lufi-files.js b/themes/default/public/js/lufi-files.js index c24ea82..58e64e5 100644 --- a/themes/default/public/js/lufi-files.js +++ b/themes/default/public/js/lufi-files.js @@ -106,6 +106,44 @@ function importStorage(f) { reader.readAsArrayBuffer(f[0]); } +function delFile() { + var dlink = $(this).attr('data-dlink'); + var short = $(this).attr('data-short'); + $.ajax({ + url: dlink, + method: 'GET', + data: { + format: 'json' + }, + success: function(data) { + if (data.success) { + $('#row-'+short).remove(); + delItem(short); + } else { + alert(data.msg); + } + }, + error: function() { + }, + complete: function() { + } + }); +} + +function evaluateMassDelete() { + if ($('input[data-checked="data-checked"]').length > 0) { + $('#mass-delete').removeAttr('disabled'); + $('#mass-delete').removeClass('disabled'); + } else { + $('#mass-delete').attr('disabled'); + $('#mass-delete').addClass('disabled'); + } +} + +function massDelete() { + $('input[data-checked="data-checked"]').each(delFile); +} + function populateFilesTable() { $('#myfiles').empty(); @@ -125,8 +163,12 @@ function populateFilesTable() { var limit = (element.delay === 0) ? i18n.noExpiration : moment.unix(element.delay * 86400 + element.created_at).locale(window.navigator.language).format('LLLL'); var created_at = moment.unix(element.created_at).locale(window.navigator.language).format('LLLL'); - var tr = $(''); - tr.html([ '', + var tr = $(''); + tr.html([ '', + '', + '', + '', + '', escapeHtml(element.name), '', '', @@ -144,9 +186,21 @@ function populateFilesTable() { limit, '', '', - '', + '', + '', + '', + '', ''].join('')); $('#myfiles').append(tr); + $('#del-'+element.short).on('click', delFile); + $('label[for="check-'+element.short+'"').on('click', function(){ + if ($('#check-'+element.short).attr('data-checked') && $('#check-'+element.short).attr('data-checked') === 'data-checked') { + $('#check-'+element.short).attr('data-checked', null); + } else { + $('#check-'+element.short).attr('data-checked', 'data-checked'); + } + evaluateMassDelete(); + }); $.ajax({ url: counterURL, diff --git a/themes/default/public/js/lufi-up.js b/themes/default/public/js/lufi-up.js index 2f64e17..e2b5376 100644 --- a/themes/default/public/js/lufi-up.js +++ b/themes/default/public/js/lufi-up.js @@ -174,8 +174,12 @@ function sliceAndUpload(randomkey, i, parts, j, delay, del_at_first_view, short) fr.onloadend = function() { var sl = $('#parts-'+window.fc); - // Get the binary result - var bin = fr.result; + // Get the binary result, different result in IE browsers (see default.html.ep line 27:48) + if (isIE == true){ + var bin = fr.content; + } else { + var bin = fr.result; + } // Transform it in base64 var b = window.btoa(bin); @@ -196,6 +200,12 @@ function sliceAndUpload(randomkey, i, parts, j, delay, del_at_first_view, short) id: short, i: i }; + if ($('#file_pwd').length === 1) { + var pwd = $('#file_pwd').val(); + if (pwd !== undefined && pwd !== null && pwd !== '') { + data['file_pwd'] = $('#file_pwd').val(); + } + } data = JSON.stringify(data); console.log('sending slice '+(j + 1)+'/'+parts+' of file '+file.name); diff --git a/themes/default/templates/about.html.ep b/themes/default/templates/about.html.ep index 7c76ee7..17ddf44 100644 --- a/themes/default/templates/about.html.ep +++ b/themes/default/templates/about.html.ep @@ -13,7 +13,7 @@

<%= l('Please contact the administrator: %1', config('contact')) %>

<%= l('Who wrote this software?') %>

<%== l('The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay.') %>
- <%== l('A thank you with a photo of kitten on Diaspora* or Twitter is cool too ;-)') %>

+ <%== l('A thank you with a photo of kitten on Diaspora* or Mastodon is cool too ;-)') %>

<%= l('How to install the software on my server?') %>

<%== l('As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure.') %>
<%== l('Get the source code on the official repository or on its Github mirror') %> diff --git a/themes/default/templates/files.html.ep b/themes/default/templates/files.html.ep index 213364e..a7441e3 100644 --- a/themes/default/templates/files.html.ep +++ b/themes/default/templates/files.html.ep @@ -8,19 +8,21 @@ <%= l('Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you\'ll lose this list.') %>
<%= l('Rows in red mean that the files have expired and are no longer available.') %>

-
+
+ @@ -28,6 +30,7 @@ + diff --git a/themes/default/templates/index.html.ep b/themes/default/templates/index.html.ep index f632d7f..7e98932 100644 --- a/themes/default/templates/index.html.ep +++ b/themes/default/templates/index.html.ep @@ -64,6 +64,14 @@

+ % if (config('allow_pwd_on_files')) { +
+
+ + +
+
+ % }

<%= l('Drop files here') %>

diff --git a/themes/default/templates/layouts/default.html.ep b/themes/default/templates/layouts/default.html.ep index faf03be..cd426d0 100644 --- a/themes/default/templates/layouts/default.html.ep +++ b/themes/default/templates/layouts/default.html.ep @@ -22,6 +22,31 @@ console.log(i18n.confirmExit); return i18n.confirmExit; } + + // Is the browser IE? + var isIE = /*@cc_on!@*/false || !!document.documentMode; + + // If the browser is IE, add readAsBinaryString function and store the data + if (isIE == true){ + if (FileReader.prototype.readAsBinaryString === undefined) { + FileReader.prototype.readAsBinaryString = function (fileData) { + var binary = ""; + var pt = this; + var reader = new FileReader(); + reader.onload = function (e) { + var bytes = new Uint8Array(reader.result); + var length = bytes.byteLength; + for (var i = 0; i < length; i++) { + binary += String.fromCharCode(bytes[i]); + } + //pt.result - readonly so assign content to another property + pt.content = binary; + $(pt).trigger('onloadend'); + } + reader.readAsArrayBuffer(fileData); + } + } + } % end diff --git a/themes/default/templates/mail.html.ep b/themes/default/templates/mail.html.ep index 78e063e..94bab1d 100644 --- a/themes/default/templates/mail.html.ep +++ b/themes/default/templates/mail.html.ep @@ -67,7 +67,7 @@ var subject = document.getElementById('subject'); var text = document.getElementById('body'); - btn.href = 'mailto:'+encodeURIComponent(emails.value)+'?subject='+encodeURIComponent(subject.value)+'&body='+encodeURIComponent(body.value); + btn.href = 'mailto:'+encodeURIComponent(emails.value)+'?subject='+encodeURIComponent(subject.value)+'&body='+encodeURIComponent(text.value); } function populateBody() { var links = [ @@ -75,7 +75,7 @@ '<%= $link %>', % } ]; - var text = "<%= l('Hello,\n\nHere\'s some files I want to share with you:\n') %>"; + var text = "<%== l('Hello,\n\nHere\'s some files I want to share with you:\n') %>"; links.forEach(function(name, index, array) { var item = findItem(name); if (item !== null && item !== undefined) { diff --git a/themes/default/templates/render.html.ep b/themes/default/templates/render.html.ep index b57bc8b..7c757ad 100644 --- a/themes/default/templates/render.html.ep +++ b/themes/default/templates/render.html.ep @@ -10,7 +10,7 @@
% } else { -

<%= stash('f')->filename %>

+

<%= stash('f')->filename %>

% if (defined(stash('msg'))) {
@@ -20,7 +20,15 @@
% } else { + % if (stash('file_pwd')) { + % } +

<%= l('Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it.') %>

@@ -30,7 +38,7 @@
-
+ %= javascript begin diff --git a/utilities/locales_files.txt b/utilities/locales_files.txt deleted file mode 100644 index dd95bb9..0000000 --- a/utilities/locales_files.txt +++ /dev/null @@ -1,12 +0,0 @@ -themes/default/templates/layouts/default.html.ep -themes/default/templates/index.html.ep -themes/default/templates/delays.html.ep -themes/default/templates/files.html.ep -themes/default/templates/mail.html.ep -themes/default/templates/msg.html.ep -themes/default/templates/render.html.ep -themes/default/templates/about.html.ep -themes/default/templates/login.html.ep -themes/default/templates/logout.html.ep -lib/Lufi/Controller/Files.pm -lib/Lufi/Controller/Mail.pm diff --git a/utilities/migrations_pg.sql b/utilities/migrations_pg.sql new file mode 100644 index 0000000..3ceeef9 --- /dev/null +++ b/utilities/migrations_pg.sql @@ -0,0 +1,28 @@ +-- 1 up +CREATE TABLE IF NOT EXISTS files ( + short text PRIMARY KEY, + deleted boolean default false, + mediatype text, + filename text, + filesize integer, + counter integer default 0, + delete_at_first_view boolean, + delete_at_day integer, + created_at integer, + created_by text, + last_access_at integer, + mod_token text, + nbslices integer, + complete boolean default false, + passwd text +); + +CREATE TABLE IF NOT EXISTS slices ( + short text NOT NULL REFERENCES files(short) ON DELETE CASCADE, + j integer NOT NULL, + path text unique NOT NULL, + constraint slice_short_j UNIQUE (short, j) +); +-- 1 down +DROP TABLE slices; +DROP TABLE files;
<%= l('File name') %> <%= l('Download link') %> <%= l('Counter') %><%= l('Uploaded at') %> <%= l('Expires at') %> <%= l('Deletion link') %><%= l('Mail') %>