From 4d47ce04e62b09ddd737b1aac70bd18f28fabd40 Mon Sep 17 00:00:00 2001 From: Tomasz Borychowski Date: Sun, 28 Mar 2021 16:48:56 +0100 Subject: [PATCH] add Lychee --- README.md | 2 +- apps/photos/comparison.md | 2 +- apps/photos/lychee.md | 161 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 apps/photos/lychee.md diff --git a/README.md b/README.md index 51b830b..08c80d6 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,7 @@ So, without further ado, here's the current list: # Photos - [Comparison table](apps/photos/comparison.md) - [LibrePhotos](apps/photos/libre-photos.md) +- [Lychee](apps/photos/lychee.md) - [Pigallery2](apps/photos/pigallery.md) - [Piwigo](apps/photos/piwigo.md) - [Pixelfed](apps/photos/pixelfed.md) @@ -238,7 +239,6 @@ So, without further ado, here's the current list: ### Other tested - [Chevereto](https://chevereto.com/) 🔗 - quite nice. No video support. -- [Lychee](https://lycheeorg.github.io/) 🔗 - good looking, no video support. - [PhotoShow](https://github.com/thibaud-rohmer/PhotoShow/) 🔗 - seems dead and doesn't work. - [Photosync](https://www.photosync-app.com/home.html) 🔗 - paid, app, not really self-hosted, just sync. - [OwnPhotos](https://github.com/hooram/ownphotos) 🔗 - limited features, ugly & dead. diff --git a/apps/photos/comparison.md b/apps/photos/comparison.md index ec33651..c34fbb1 100644 --- a/apps/photos/comparison.md +++ b/apps/photos/comparison.md @@ -3,7 +3,7 @@ |--------------------------------------------------|-----------|------------|----------------------------|----------|-----------|----------------------------------------| | [Chevereto](https://chevereto.com/) 🔗 | ⭐️⭐️⭐️⭐️⭐️ | ✅ | permissions, passwords | probably | ✅ | ⛔️ | | [LibrePhotos](libre-photos.md) | ⭐️ | ✅ | links, passwords | ⛔️ | ⛔️ | ⛔️ | -| [Lychee](https://lycheeorg.github.io) 🔗 | ⭐️⭐️⭐️⭐️⭐️ | ⛔️ | links, passwords | ⛔️ | ✅ | ⛔️ | +| [Lychee](lychee.md) | ⭐️⭐️⭐️⭐️⭐️ | ✅ | links, passwords | ⛔️ | ✅ | ✅ | | NextCloud Photos | ⭐️⭐️⭐️⭐️ | ✅ | links, passwords | ✅ | ✅ | ✅ | | [PhotoPrism](photoprism.md) | ⭐️⭐️⭐️⭐️ | admin only | unique links | ⛔️ | ✅ | ✅ | | [Pigallery2](pigallery.md) | ⭐️⭐️⭐️⭐️ | ✅ | users, links with password | ⛔️ | ⛔️ | ✅ | diff --git a/apps/photos/lychee.md b/apps/photos/lychee.md new file mode 100644 index 0000000..f093b60 --- /dev/null +++ b/apps/photos/lychee.md @@ -0,0 +1,161 @@ +# Lychee + +- Very nice and polished UI +- Supports multiple users +- Supports U2F +- Can import from local server path, URL or Dropbox +- Supports creating and sharing nested albums! + +
+ +- [Github repo](https://github.com/LycheeOrg/Lychee) +- [Homepage](https://lycheeorg.github.io/) +- [Docs](https://lycheeorg.github.io/docs/docker.html) + + +## nginx.conf +This file is required to increase the upload size (from the default 20MB). +Original can be found here: [default.conf](https://github.com/LycheeOrg/Lychee-Docker/blob/master/default.conf). +This will increase the size to 1000MB (`upload_max_filesize` and `post_max_size`): + +```conf +user www-data; +worker_processes auto; +daemon off; +error_log /var/log/nginx/error.log; +events { + worker_connections 1024; +} +http { + include mime.types; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + access_log /var/log/nginx/access.log main; + sendfile on; + keepalive_timeout 65; + # By default, if the processing of images takes more than 60s, + # a 504 Gateway timeout occurs, so we increase the timeout here + # to allow procesing of large images or when multiple images are + # being processed at the same time. We set max_execution_time + # below to the same value. + fastcgi_read_timeout 3600; + # We also set the send timeout since this can otherwise also cause + # issues with slow connections + fastcgi_send_timeout 3600; + gzip on; + server { + root /var/www/html/Lychee/public; + listen 80; + server_name localhost; + client_max_body_size 100M; + # serve static files directly + location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ { + access_log off; + expires max; + log_not_found off; + } + # removes trailing slashes (prevents SEO duplicate content issues) + if (!-d $request_filename) + { + rewrite ^/(.+)/$ /$1 permanent; + } + # If the request is not for a valid file (image, js, css, etc.), send to bootstrap + if (!-e $request_filename) + { + rewrite ^/(.*)$ /index.php?/$1 last; + break; + } + location / { + index index.php + try_files $uri $uri/ /index.php?$query_string; + } + # Serve /index.php through PHP + location = /index.php { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + try_files $uri $document_root$fastcgi_script_name =404; + # Mitigate https://httpoxy.org/ vulnerabilities + fastcgi_param HTTP_PROXY ""; + fastcgi_pass unix:/run/php/php7.4-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PHP_VALUE "post_max_size=1000M + max_execution_time=3600 + upload_max_filesize=1000M + memory_limit=1024M"; + fastcgi_param PATH /usr/local/bin:/usr/bin:/bin; + include fastcgi_params; + } + # Deny access to other .php files, rather than exposing their contents + location ~ [^/]\.php(/|$) { + return 403; + } + } +} +``` + + +## docker-compose.yml +```yml +--- +version: '3' +services: + lychee_db: + container_name: lychee_db + image: mariadb:10 + restart: unless-stopped + environment: + - MYSQL_ROOT_PASSWORD=lychee123 + - MYSQL_DATABASE=lychee + - MYSQL_USER=lychee + - MYSQL_PASSWORD=lychee123 + expose: + - 3306 + volumes: + - ./db:/var/lib/mysql + + lychee: + image: lycheeorg/lychee + container_name: lychee + restart: unless-stopped + depends_on: + - lychee_db + ports: + - 3123:80 + volumes: + - ./lychee/conf:/conf + - ./lychee/uploads:/uploads + - ./lychee/sym:/sym + - ./nginx.conf:/etc/nginx/nginx.conf + environment: + - PUID=1000 + - PGID=1000 + - PHP_TZ=Europe/Dublin + - DB_CONNECTION=mysql + - DB_HOST=lychee_db + - DB_PORT=3306 + - DB_DATABASE=lychee + - DB_USERNAME=lychee + - DB_PASSWORD=lychee123 + - STARTUP_DELAY=0 + + #- APP_NAME=Laravel + #- APP_ENV=local + #- APP_URL=http://localhost + #- CACHE_DRIVER=file + #- SESSION_DRIVER=file + #- SESSION_LIFETIME=120 + #- QUEUE_DRIVER=sync + #- REDIS_HOST=127.0.0.1 + #- REDIS_PASSWORD=null + #- REDIS_PORT=6379 + #- MAIL_DRIVER=smtp + #- MAIL_HOST=smtp.mailtrap.io + #- MAIL_PORT=2525 + #- MAIL_USERNAME=null + #- MAIL_PASSWORD=null + #- MAIL_ENCRYPTION=null +``` + +**Note:** when you open the url first time (e.g. http://localhost:3123) you will see an installer. There should be no need to change anything there, and just clicking "Next" should work.