Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fiat Tux
Hat softwares
Lutim
Commits
9aed9a0f
Commit
9aed9a0f
authored
Jun 03, 2017
by
Luc Didry
Browse files
Fix typos and oblivions
parent
c2110dc1
Changes
5
Hide whitespace changes
Inline
Side-by-side
cpanfile
View file @
9aed9a0f
...
...
@@ -3,6 +3,7 @@ requires 'EV';
requires 'IO::Socket::SSL';
requires 'Data::Validate::URI';
requires 'Net::Domain::TLD', '>= 1.73'; # Must have the last version to handle (at least) .xyz and .link
requires 'Mojo::Pg';
requires 'Mojolicious::Plugin::I18N';
requires 'Mojolicious::Plugin::AssetPack';
requires 'CSS::Minifier::XS';
...
...
cpanfile.snapshot
View file @
9aed9a0f
...
...
@@ -72,12 +72,32 @@ DISTRIBUTIONS
ExtUtils::MakeMaker 0
File::Spec 0.80
perl 5.006
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
warnings 0
Class-Singleton-1.4
pathname: A/AB/ABW/Class-Singleton-1.4.tar.gz
provides:
Class::Singleton 1.4
requirements:
ExtUtils::MakeMaker 0
Clone-0.39
pathname: G/GA/GARU/Clone-0.39.tar.gz
provides:
Clone 0.39
requirements:
ExtUtils::MakeMaker 0
Test::More 0
Crypt-Blowfish-2.14
pathname: D/DP/DPARIS/Crypt-Blowfish-2.14.tar.gz
provides:
...
...
@@ -98,6 +118,17 @@ DISTRIBUTIONS
requirements:
ExtUtils::MakeMaker 0
perl 5.006
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.40
pathname: I/IS/ISHIGAKI/DBD-SQLite-1.40.tar.gz
provides:
...
...
@@ -734,6 +765,14 @@ DISTRIBUTIONS
perl 5.008004
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
Devel-StackTrace-2.02
pathname: D/DR/DROLSKY/Devel-StackTrace-2.02.tar.gz
provides:
...
...
@@ -950,6 +989,14 @@ DISTRIBUTIONS
perl 5.005
strict 0
warnings 0
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-Socket-IP-0.37
pathname: P/PE/PEVANS/IO-Socket-IP-0.37.tar.gz
provides:
...
...
@@ -1341,8 +1388,22 @@ DISTRIBUTIONS
perl 5.006
strict 0
warnings 0
Mojolicious-7.31
pathname: S/SR/SRI/Mojolicious-7.31.tar.gz
Mojo-Pg-3.06
pathname: S/SR/SRI/Mojo-Pg-3.06.tar.gz
provides:
Mojo::Pg 3.06
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
Mojolicious-7.32
pathname: S/SR/SRI/Mojolicious-7.32.tar.gz
provides:
Mojo undef
Mojo::Asset undef
...
...
@@ -1410,7 +1471,7 @@ DISTRIBUTIONS
Mojo::UserAgent::Transactor undef
Mojo::Util undef
Mojo::WebSocket undef
Mojolicious 7.3
1
Mojolicious 7.3
2
Mojolicious::Command undef
Mojolicious::Command::cgi undef
Mojolicious::Command::cpanify undef
...
...
@@ -1508,6 +1569,36 @@ DISTRIBUTIONS
Mojolicious 5
Test::More 0
perl 5.010001
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
Net-Domain-TLD-1.75
pathname: A/AL/ALEXP/Net-Domain-TLD-1.75.tar.gz
provides:
...
...
@@ -1667,6 +1758,22 @@ DISTRIBUTIONS
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
SUPER-1.20141117
pathname: C/CH/CHROMATIC/SUPER-1.20141117.tar.gz
provides:
...
...
@@ -1767,6 +1874,15 @@ DISTRIBUTIONS
requirements:
ExtUtils::MakeMaker 0
Test::More 0
Sub-Quote-2.003001
pathname: H/HA/HAARG/Sub-Quote-2.003001.tar.gz
provides:
Sub::Defer 2.003001
Sub::Quote 2.003001
requirements:
ExtUtils::MakeMaker 0
Scalar::Util 0
perl 5.006
Sub-Uplevel-0.24
pathname: D/DA/DAGOLDEN/Sub-Uplevel-0.24.tar.gz
provides:
...
...
lib/Lutim/Controller.pm
View file @
9aed9a0f
...
...
@@ -580,7 +580,7 @@ sub short {
$dt
->
set_time_zone
('
GMT
');
$expires
=
$dt
->
strftime
("
%a, %d %b %Y %H:%M:%S GMT
");
$test
=
$c
->
render_file
(
$image
->
filename
,
$image
->
path
,
$image
->
mediatype
,
$dl
,
$expires
,
$image
->
delete_at_first_view
,
$key
,
$thumb
);
$test
=
$c
->
render_file
(
$im_loaded
,
$image
->
filename
,
$image
->
path
,
$image
->
mediatype
,
$dl
,
$expires
,
$image
->
delete_at_first_view
,
$key
,
$thumb
);
}
}
...
...
lib/Lutim/DB/Image/Pg.pm
View file @
9aed9a0f
# vim:set sw=4 ts=4 sts=4 ft=perl expandtab:
package
Lutim::DB::Image::
Pg
;
use
Mojo::
Base
'
Lutim::DB::Image
';
use
Mojo
licious
::
Collection
'
c
';
use
Mojo::
Collection
'
c
';
has
'
record
'
=>
0
;
...
...
@@ -71,9 +71,9 @@ sub write {
my
$c
=
shift
;
if
(
$c
->
record
)
{
$c
->
app
->
pg
->
db
->
query
('
UPDATE lutim SET counter = ?, created_at = ?, created_by = ?, delete_at_day = ?, delete_at_first_view = ?, enabled = ?, filename = ?, footprint = ?, height = ?, last_access_at = ?, mediatype = ?, mod_token = ?, path = ?, short = ?, width = ? WHERE short = ?
'
$c
->
counter
,
$c
->
created_at
,
$c
->
created_by
,
$c
->
delete_at_day
,
$c
->
delete_at_first_view
,
$c
->
enabled
,
$c
->
filename
,
$c
->
footprint
,
$c
->
height
,
$c
->
last_access_at
,
$c
->
mediatype
,
$c
->
mod_token
,
$c
->
path
,
$c
->
short
,
$c
->
width
,
$c
->
short
);
$c
->
app
->
pg
->
db
->
query
('
UPDATE lutim SET counter = ?, created_at = ?, created_by = ?, delete_at_day = ?, delete_at_first_view = ?, enabled = ?, filename = ?, footprint = ?, height = ?, last_access_at = ?, mediatype = ?, mod_token = ?, path = ?, short = ?, width = ? WHERE short = ?
'
,
$c
->
counter
,
$c
->
created_at
,
$c
->
created_by
,
$c
->
delete_at_day
,
$c
->
delete_at_first_view
,
$c
->
enabled
,
$c
->
filename
,
$c
->
footprint
,
$c
->
height
,
$c
->
last_access_at
,
$c
->
mediatype
,
$c
->
mod_token
,
$c
->
path
,
$c
->
short
,
$c
->
width
,
$c
->
short
);
}
else
{
$c
->
app
->
pg
->
db
->
query
('
INSERT INTO lutim (counter, created_at, created_by, delete_at_day, delete_at_first_view, enabled, filename, footprint, height, last_access_at, mediatype, mod_token, path, short, width) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
;
'
$c
->
counter
,
$c
->
created_at
,
$c
->
created_by
,
$c
->
delete_at_day
,
$c
->
delete_at_first_view
,
$c
->
enabled
,
$c
->
filename
,
$c
->
footprint
,
$c
->
height
,
$c
->
last_access_at
,
$c
->
mediatype
,
$c
->
mod_token
,
$c
->
path
,
$c
->
short
,
$c
->
width
);
$c
->
app
->
pg
->
db
->
query
('
INSERT INTO lutim (counter, created_at, created_by, delete_at_day, delete_at_first_view, enabled, filename, footprint, height, last_access_at, mediatype, mod_token, path, short, width) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
'
,
$c
->
counter
,
$c
->
created_at
,
$c
->
created_by
,
$c
->
delete_at_day
,
$c
->
delete_at_first_view
,
$c
->
enabled
,
$c
->
filename
,
$c
->
footprint
,
$c
->
height
,
$c
->
last_access_at
,
$c
->
mediatype
,
$c
->
mod_token
,
$c
->
path
,
$c
->
short
,
$c
->
width
);
$c
->
record
(
1
);
}
...
...
lib/Lutim/Plugin/Helpers.pm
View file @
9aed9a0f
...
...
@@ -38,18 +38,18 @@ sub _pg {
my
$c
=
shift
;
my
$addr
=
'
postgresql://
';
$addr
.=
$c
->
config
->
{
pgdb
}
->
{
host
};
$addr
.=
'
:
'
.
$c
->
config
->
{
pgdb
}
->
{
port
}
if
defined
$c
->
config
->
{
pgdb
}
->
{
port
};
$addr
.=
'
/
'
.
$c
->
config
->
{
pgdb
}
->
{
database
};
$addr
.=
$c
->
app
->
config
('
pgdb
')
->
{
host
};
$addr
.=
'
:
'
.
$c
->
app
->
config
('
pgdb
')
->
{
port
}
if
defined
$c
->
app
->
config
('
pgdb
')
->
{
port
};
$addr
.=
'
/
'
.
$c
->
app
->
config
('
pgdb
')
->
{
database
};
state
$pg
=
Mojo::
Pg
->
new
(
$addr
);
$pg
->
password
(
$c
->
config
->
{
pgdb
}
->
{
pwd
});
$pg
->
username
(
$c
->
config
->
{
pgdb
}
->
{
user
});
$pg
->
password
(
$c
->
app
->
config
('
pgdb
')
->
{
pwd
});
$pg
->
username
(
$c
->
app
->
config
('
pgdb
')
->
{
user
});
return
$pg
;
}
sub
_render_file
{
my
$c
=
shift
;
my
(
$filename
,
$path
,
$mediatype
,
$dl
,
$expires
,
$nocache
,
$key
,
$thumb
)
=
@_
;
my
(
$im_loaded
,
$filename
,
$path
,
$mediatype
,
$dl
,
$expires
,
$nocache
,
$key
,
$thumb
)
=
@_
;
$dl
=
'
attachment
'
if
(
$mediatype
=~
m/svg/
);
$filename
=
quote
(
$filename
);
...
...
@@ -116,11 +116,11 @@ sub _provisioning {
# Create some short patterns for provisioning
my
$img
=
Lutim::DB::
Image
->
new
(
app
=>
$c
->
app
);
if
(
$img
->
count_empty
<
$c
->
config
->
{
provisioning
}
)
{
for
(
my
$i
=
0
;
$i
<
$c
->
config
->
{
provis_step
}
;
$i
++
)
{
if
(
$img
->
count_empty
<
$c
->
app
->
config
('
provisioning
')
)
{
for
(
my
$i
=
0
;
$i
<
$c
->
app
->
config
('
provis_step
')
;
$i
++
)
{
my
$short
;
do
{
$short
=
$c
->
shortener
(
$c
->
config
->
{
length
}
);
$short
=
$c
->
shortener
(
$c
->
app
->
config
('
length
')
);
}
while
(
$img
->
count_short
(
$short
)
||
$short
eq
'
about
'
||
$short
eq
'
stats
'
||
$short
eq
'
d
'
||
$short
eq
'
m
'
||
$short
eq
'
gallery
'
||
$short
eq
'
zip
'
||
$short
eq
'
infos
');
$img
->
short
(
$short
)
...
...
@@ -128,7 +128,7 @@ sub _provisioning {
->
enabled
(
1
)
->
delete_at_first_view
(
0
)
->
delete_at_day
(
0
)
->
mod_token
(
$c
->
shortener
(
$c
->
config
->
{
token_length
}
))
->
mod_token
(
$c
->
shortener
(
$c
->
app
->
config
('
token_length
')
))
->
write
;
$img
=
Lutim::DB::
Image
->
new
(
app
=>
$c
->
app
);
...
...
@@ -153,7 +153,7 @@ sub _stop_upload {
if
(
-
f
'
stop-upload
'
||
-
f
'
stop-upload.manual
')
{
$c
->
stash
(
stop_upload
=>
$c
->
l
('
Uploading is currently disabled, please try later or contact the administrator (%1).
',
$config
->
{
contact
}
)
stop_upload
=>
$c
->
l
('
Uploading is currently disabled, please try later or contact the administrator (%1).
',
$
c
->
app
->
config
('
contact
')
)
);
return
1
;
}
...
...
@@ -163,7 +163,7 @@ sub _stop_upload {
sub
_max_delay
{
my
$c
=
shift
;
return
$c
->
config
->
{
max_delay
}
if
(
$c
->
config
->
{
max_delay
}
>=
0
);
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
;
...
...
@@ -172,7 +172,7 @@ sub _max_delay {
sub
_default_delay
{
my
$c
=
shift
;
return
$c
->
config
->
{
default_delay
}
if
(
$c
->
config
->
{
default_delay
}
>=
0
);
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
;
...
...
@@ -245,3 +245,5 @@ sub _delete_image {
unlink
$img
->
path
or
warn
"
Could not unlink
"
.
$img
->
path
.
"
: $!
";
$img
->
disable
();
}
1
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment