#LUTIm
##What LUTIm means? It means Let's Upload That Image.
##What does it do? It stores images and allows you to see them or download them. Images are indefinitly stored unless you request that they will be deleted at first view or after 24 hours.
##License LUTIm is licensed under the terms of the AGPL. See the LICENSE file.
##Logo LUTIm's logo is an adaptation of Lutin by Godo, licensed under the terms of the CC-BY-SA 3.0 license.
##Dependancies
- Carton : Perl dependancies manager, it will get what you need, so don't bother for dependancies (but you can read the file
cpanfileif you want).
sudo cpan Carton
##Installation After installing Carton :
git clone https://github.com/ldidry/lutim.git
cd lutim
carton install
cp lutim.conf.template lutim.conf
vi lutim.conf
##Configuration
- hypnotoad: listen to listen to, user and group which runs hypnotoad ;
- contact: write something which make people able to contact you (contact form URL, email address, whatever) ;
- secrets: an array of random string. Used by Mojolicious for encrypting session cookies.
- piwik_img: the image Piwik provides you to have records of visits without javascript (better privacy than js and cookies) ;
- length: length of the random string part of image's URL (default is 8) ;
- provis_step: LUTIm provisions random strings for image's URL per pack of
provis_step(default is 5) ; - provisioning: number of random strings to provision (default is 100) ;
- hosted_by: if someone hosts your LUTIm instance, you can add some HTML (a logo for example) to make it appear on index page ;
- tweet_card_via: a twitter account which will appear on twitter cards ;
- max_file_size: well, this is explicit (default is 10Mio = 10485760 octets) ;
- https: 1 if you want to provide secure images URLs (default is 0) ;
- stats_day_num: when you generate statistics with
script/lutim cron stats, you will have stats for the laststats_day_numdays (default is 365) ; - keep_ip_during: when you delete IP addresses of image's senders with
script/lutim cron cleanbdd, the IP addresses of images older thankeep_ip_duringdays will be deleted (default is 365) ;
##Usage
carton exec hypnotoad script/lutim
##Update
git pull
carton install
carton exec hypnotoad script/lutim
Yup, that's all (Mojolicious magic), it will listen at "http://127.0.0.1:8080".
For more options (interfaces, user, etc.), change the configuration in lutim.conf (have a look at http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad#SETTINGS for the available options).
##Reverse proxy You can use a reverse proxy like Nginx or Varnish (or Apache with the mod_proxy module). The web is full of tutos.
Here's a valid Varnish configuration:
backend lutim {
.host = "127.0.0.1";
.port = "8080";
}
sub vcl_recv {
if (req.restarts == 0) {
set req.http.X-Forwarded-For = client.ip;
}
if (req.http.host == "lut.im") {
set req.backend = lutim;
return(pass);
}
}
##Cron jobs LUTIm have commands which can be used in cron jobs.
To see what commands are available:
carton exec script/lutim cron
###Statistics
To generate statistics which can be viewed at the address /stats:
carton exec script/lutim cron stats
###Delete IP adresses from database To automatically delete the IP addresses of image's senders after a configurable delay:
carton exec script/lutim cron cleanbdd
##Shutter integration
See where Shutter (http://en.wikipedia.org/wiki/Shutter_%28software%29) keeps its plugins on your computer.
On my computer, it's in /usr/share/shutter/resources/system/upload_plugins/upload.
Then:
sudo cp utilities/Shutter.pm /usr/share/shutter/resources/system/upload_plugins/upload/Lutim.pm
And restart Shutter if it was running.
Of course, this plugin is configured for the official instance of LUTIm (http://lut.im), feel free to edit it for your own instance.
##Internationalization LUTIm comes with english and french languages. It will choose the language to display from the browser's settings.
If you want to add more languages, for example german:
cd lib/I18N
cp en.pm de.pm
vim de.pm
There's just a few sentences, so it will be quick to translate. Please consider to send me you language file in order to help the other users 😄.
##Others projects dependancies LUTIm is written in Perl with the Mojolicious framework, uses the Twitter bootstrap framework to look not too ugly, JQuery and JQuery File Uploader (slightly modified) to add some modernity, Raphaël and SimpleGraph for stats graphs.
##Official instance You can see it working at http://lut.im.
