
Show HN: Lychee — Self-hosted photo-management done right - electerious
http://lychee.electerious.com
======
electerious
I developed this project in my spare time. It's a self-hosted photo-
management-system and a great place to share, store and manage your photos and
inspiration. I hope you guys here on HN like it. If you have any questions or
feedback, just write it here :) Thanks!

~~~
marban
Private albums with a random access token in the url would be awesome (instead
of passwords).

On a side note, I'd donate 100 bucks for a Lightroom Sync Plugin any minute.

~~~
blahbap
I second that - I have been looking for something like this, but it would be
extremenly conventient to be able to upload directly from LR.

Another request - I love the free flow, tiled display of images a la Flickr
photostream - any chance that could be an option?

Otherwise, great job! - I was pleasently surprised at the quality of this
applications.

------
ytjohn
For years and years, I used Gallery/Gallery2 to self-host photos, but more and
more, I found myself taking photos with my phone instead of a regular camera.
From the smartphone, it was much easier to upload to Facebook (and now, G+)
than it was to get photos into Gallery. Once every so often, I would bother
connecting my phone to my computer, sync the photos over, and then upload them
into Gallery. But by then, they were already shared among my friends and
family.

My gallery is still up, but the last time I updated it was apparently in 2011.
There was a android client that came out that I had tried, but it didn't
really work that well. I still backup photos from my phone to my computer and
NAS, but couldn't be motivated to go beyond that.

I've looked at times to improve this situation. I much prefer to have my
photos self-hosted. I haven't really found a gallery type program that worked
as well as Menalto Gallery, but Lychee looks like it's a good contender. I
also like that it can share out to other services.

At first I was thinking that since this doesn't have an android client, it
would fall into the same disuse as my Gallery installation. But I noticed that
it could read from an uploads folder and you could essentially ftp upload to
the server. This made me wonder if one could just have an auto-upload
(scp/sftp or otherwise) to a server.

I found a couple apps that do this, but [Auto-
Share]([https://play.google.com/store/apps/details?id=com.dngames.au...](https://play.google.com/store/apps/details?id=com.dngames.autoshare))
looks the most polished. So I can see this working out.

tl;dr Looks like a great photo manager, love the option to share out to other
service. There may be some Android Apps to automatically upload, even if it's
not natively supported in Lychee.

~~~
ytjohn
Ok, so I installed it and added some pictures into uploads/import. Lychee
imported these and dropped them into a smart album called Unsorted. I then
wanted to organize these into albums. The first thing I noticed was there was
no way to select photos. You have to open them one by one and move them. This
would be my feature request numero uno.

Second thing I noticed is there doesn't seem to be support for sub-albums. I
guess this isn't necessarily a deal killer, but I had a system of organizing
albums in YEAR/MM type albums. If there was a lot of photos or an event, that
would be a sub-album within the month it took place. If a single event took
place between months (New Year's Eve party) I just handled that on a case by
case basis.

~~~
electerious
Tip: You can right-click on single images/albums to rename, move or star them.
By now, it may be easier to upload photos directly into the album of your
choice.

Multi-select is planned.

------
electerious
Our server gets hammered by you guys. Here is the direct link to GitHub:
[https://github.com/electerious/Lychee](https://github.com/electerious/Lychee)

~~~
mrtree
Hi, great tool guys! Lovely. During configuration I keep getting an error
during the creation of the database connection to mysql: "Connection failed.
Unable to connect to host database because access was denied. Double check
host username password to ensure that access is permitted"

Can't I write whatever username and password I want? Should I create the
database before hand?

~~~
electerious
This could help. Here is how the php/config.php should look like:
[http://cl.ly/TVft](http://cl.ly/TVft)

------
__herson__
> "Change the permissions of uploads/ and php/ to 777, including all
> subfolders"

>
> [https://github.com/electerious/Lychee/blob/master/docs/md/In...](https://github.com/electerious/Lychee/blob/master/docs/md/In..).
> I don't think this is ok

~~~
krapp
That bothers me. That should never be necessary.

It looks like they intend everything to be in the webroot, which is a problem
in and of itself. Setting everything in the uploads folder to be executable
without any .htaccess directives to prevent that seems like a potential issue.
If they're not validating images (properly) or sandboxing uploads, or thinking
about mitigating directory traversal attacks, then there could be issues with
remote code execution.

------
sz4kerto
It would be so great if it could simple serve files from a directory (without
in-app upload). Then I could simply sync the photos using btsync (or anything
else).

~~~
chime
That's what I do for my own photos.
[http://chir.ag/gallery/](http://chir.ag/gallery/) just shows everything from
a folder on the server. The thumbnails shown in the gallery view are random
and auto-generated. I use subfolders to caption/group the photo in large
albums: [http://chir.ag/gallery/alaska-
cruise-2013](http://chir.ag/gallery/alaska-cruise-2013)

The folder names are underscore delimited column data. E.g. "alaska-
cruise-2013_2013-07-27_5th Anniversary Alaska
Cruise_critters,cruise,hiking,juliet,travel" => "alaska-cruise-2013" is the
permalink, 2013-07-27 is the start date, "5th Anniversary Alaska Cruise" is
the gallery title, and the rest of the comma-separated words are tags for
filtering, e.g.
[http://chir.ag/gallery/tag/cruise](http://chir.ag/gallery/tag/cruise). I have
a few local scripts to resize the raw photos and rsync everything with the
server.

It's really not complicated code. Pretty simple stuff that anyone with half a
year of coding experience can build. I have been taking and sharing photos on
my 'blog since late 2001. I have tried many, many things over time and finally
settled on the current method. While my gallery looks/works very simply, it
has taken years to refine this exact strategy. I LOVE the Boston Big Picture
view and always wanted that. But I also like the thumbnails to jump. I love
clicking on the left/right of a pic to advance but I also like to scroll
up/down if needed. Sorting gallery by name vs. date, filtering similar albums
by tags, and of course captioning without using a text file or DB were things
I always wanted but didn't want to deal with a complicated system. I re-did my
gallery after our Alaska trip and have been very happy ever since.

------
PavlovsCat
This is _so_ smooth. Wow. It's been a while since I saw something labelled as
"stunning" actually stun me.

The ability to tag photos and a commenting system would make it just perfect.
Maybe an RSS feed for photos and comments, too?

~~~
electerious
Tags and RSS feeds for albums are already planned.

------
roeme
I like it very much; both the code and interface seem clean and lightweight.

You should use mysqli prepared statements though, after a quick glance over
the code I can't quite shake the feeling that there might be some sql
injections lurking.

~~~
electerious
All calls to the API are going through the api.php where every $_POST gets
escaped. I'm not an expert when it comes to SQL injection, but I think this
should prevent it. See line 61 in php/api.php. It would be great to know if
this actually helps or not.

~~~
roeme
Having read your code and quickly brushing up the little bits of PHP knowledge
from years ago, I'd say it helps only a little. mysqli_real_escape_string
alone doesn't protect you completely from sql injection attacks, it just makes
it harder - see the second answer at
[http://stackoverflow.com/questions/5741187/sql-injection-
tha...](http://stackoverflow.com/questions/5741187/sql-injection-that-gets-
around-mysql-real-escape-string) for an example. Also, the homegrown $albumID
validation allows bad payload to reach mysqli_real_escape_string().

~~~
electerious
Thanks! Good to know.

------
priyakanth024
Dude, you could've easily made money out it. I for one would've definitely
bought it. Your product is superb, simple and gives us capability to add stuff
on top of it like authentication

~~~
electerious
Thanks! Donations are welcome :)

~~~
dangravell
No - you didn't read what (s)he wrote. You should charge. Charging people real
money gets you real users who give you real feedback. It allows you to
allocate more money to the development of the project.

Providing this tool for free is a cost to you.

Sure, allow a certain number of photos free of charge and charge for more.

~~~
egeozcan
I also agree. I want to pay for this, not donate. This can be very important
for my personal needs and I want to rely on it. If I donate, I don't get the
feeling that the project is moving forward.

~~~
belorn
Simple solution, they provide a package that is the program and a friendly
service contract which provide help setting it up or adding customization.

~~~
unicornporn
OK, seems everybody wants to pay per copy, am I rite? I think that is a pretty
bad idea that will slow down adoption and development. Yes, this is an open-
source project and more developers could help out. I think developers are less
likely to jump on the wagon to help out a duo that gets all the money.
Instead, don't try to monetize this now. Make adoption and interest grow. Then
sell a hosted variant at lychee.io, Wordpress stylee. Or be more imaginative
than that and come up with a better idea.

Great software anyways! Thanks!

~~~
dangravell
Make something of value -> now sell it.

Why be more imaginative? It sounds a pretty simple offering to me, and is
highly transparent.

A hosted variant isn't a bad idea (I was going to ask if there were recipes
for EC2, Docker etc... some people might want to "self" host on a machine they
control) but it's more "value added" than the original codebase.

------
henryaj
This is beautiful. AFAIK, the alternatives are either a self-hosted blog (not
ideal, strips out EXIF data etc.) or something hideous like Piwigo.

Awesome!

~~~
north
Koken might be an other alternative. [http://koken.me](http://koken.me)

~~~
unicornporn
I'm running Koken right now and I don't think it's a Lychee alternative. Koken
seems geared towards users that are building a photographic or design
portfolio with a limited selection of images (and that's what I'm doing). I
think Lychee is something else. A way to store and display photos en masse.
Perhaps a way to share all your photos from your family vacations 2005-2013.

------
nodata
Nice. A few questions (I might add more, just using the demo)

1\. How does it deal with mixed landscape and portrait images?

2\. Is preloading the next image possible?

3\. Scrollbars are appearing, I can't work out why, e.g. on
[http://electerious.com/lychee_demo/#3/13901681813613](http://electerious.com/lychee_demo/#3/13901681813613)

~~~
electerious
1\. If the image is to tall/wide it will be scaled to fit into your browser.
This happens via CSS. Photos won't be compressed or scaled, Lychee keeps their
original quality and dimensions. You can click the 'Full Photo' button on the
top right to see the file.

2\. Nope. Not at the moment.

3\. Does this happen only sometimes or always? Which browser and OS are you
using?

~~~
egeozcan
I also have the same problem (3). It happens when using chrome 32 on windows
8.0 with full screen mode enabled. The scroll bars appear when I open an image
and click the right arrow on my keyboard to switch to the next. For me it
doesn't happen if I don't navigate to another image or if I'm not browsing in
full-screen mode (f11).

~~~
electerious
Thanks for the report! I will look into it.

------
Adirael
I love it. I've been playing with ownCloud because I no longer want to store
my pictures on Dropbox (I'm running out of space, and the first tier is 100GB
which I don't need).

I'm going to toy around a bit with it and if I like the API I may hack
together something to automatically upload new pictures from iOS devices :)

~~~
electerious
This plugin lets you sync OwnCloud with Lychee:
[https://github.com/GustavePate/lycheesync](https://github.com/GustavePate/lycheesync)
It might not work with version 2.0, but the code may help you to start
developing some great stuff.

------
terhechte
I really like this! I've been wanting to work on a project where I can just
insert a SD card into my home server, and it imports all the images into a
locally hosted photo-management automatically. This looks like the perfect
solution for that. Thanks for sharing!

------
flowless
Animated transitions are really distracting, I hope there's a way to turn this
off (and it should be turned off by default..)

------
blowski
Thanks - I've been looking for something like this since Flickr went a bit
mad. I'll install and play around.

Thanks for doing this!

------
sp8
This may be exactly the photo sharing software I've always wanted. Will
definitely be setting this up soon.

------
thor545
Awesome. Certainly one of the most elegants solutions. Any plans to add video
support?

~~~
electerious
Not at the moment, sorry.

------
mrlinx
I can really see this as a frontend to my crashplan data. They do have a nice
API :)

------
myang
good job! I like the simplistic and elegant interface. Like what other
commenters said, it would be great if it can serve files directly instead of
having to upload through the web app.

BTW, why did you name it Lychee?

~~~
electerious
I think it's a great name for a product. Almost every name which has something
to do with photos is already taken. And I like Lychees ;)

------
Walkman
You don't need to blur the image when showing information about it.

------
lazyant
I'm looking at something like this but with storage in S3

------
jagermo
This looks fantastic, very well done.

------
Heliosmaster
Wow, it is incredibly good looking!

