GithubHelp home page GithubHelp logo

lychee-docker's Introduction

Build Status Last Commit Lychee Version Docker Pulls (new) Docker Pulls (old)
Supports amd64 Architecture Supports arm64/aarch64 Architecture Supports armv7 Architecture

Notice: Dockerhub repository has been migrated to lycheeorg/lychee

Make sure you update your docker-compose files accordingly

Table of Contents

Image Content

This image features Lychee, nginx and PHP-FPM. The provided configuration (PHP, nginx...) follows Lychee's official recommendations.

The following tags are available :

  • latest: Latest Lychee release
  • v[NUMBER]: Stable version tag for a Lychee release
  • nightly (also dev): Current master branch tag (Lychee operates on a stable master, so this should usually be safe)
  • devtools: As above, but includes development dependencies
  • testing: Tag for testing new branches and pull requests. Designed for internal use by LycheeOrg
  • alpha: Current alpha branch tag (The alpha branch contains bleeding edge changes that are not peer-reviewed)
  • alpha-devtools: As above, but includes development dependencies

Setup

Quick Start

To use the built-in SQLite support, no external dependencies are required. At its simplest, docker run -p 80 lycheeorg/lychee:dev will start Lychee listening on a random port on the local host.

For more runtime options, look below in Run with Docker and Available environment variables and defaults.

Prerequisites

To use this image with MySQL, MariaDB or PostgreSQL you will need a suitable database running externally. This may be through a Docker image, possibly in your docker-compose.yml.

  1. Create the db, username, password.
  2. Edit the environment variables (db credentials, language...) by :
    • Supplying the environment variables via docker run / docker-compose or
    • Creating a .env file with the appropriate info and mount it to /conf/.env or
    • Use the Lychee installer by passing -e DB_CONNECTION= on the command line and connecting to the container with your browser

Run with Docker

Make sure that you link to the container running your database !!

The example below shows --net and --link for these purposes. --net connects to the name of the network your database is on and --link connects to the database container.

docker run -d \
--name=lychee \
-v /host_path/lychee/conf:/conf \
-v /host_path/lychee/uploads:/uploads \
-v /host_path/lychee/sym:/sym \
-e PUID=1000 \
-e PGID=1000 \
-e PHP_TZ=America/New_York \
-e TIMEZONE=America/New_York \
-e DB_CONNECTION=mysql \
-e DB_HOST=mariadb \
-e DB_PORT=3306 \
-e DB_DATABASE=lychee \
-e DB_USERNAME=user \
-e DB_PASSWORD=password \
-p 90:80 \
--net network_name \
--link db_name \
lycheeorg/lychee

Warning : if you use a MySQL database, make sure to use the mysql_native_password authentication plugin, either by using the --default-authentication-plugin option when starting mysql, or by running a query to enable the authentication plugin for the lychee user, e.g. :

alter user 'lychee' identified with mysql_native_password by '<your password>';

Run with Docker Compose

Change the environment variables in the provided example to reflect your database credentials.

Note that in order to avoid writing credentials directly into the file, you can create a db_secrets.env and use the env_file directive (see the docs).

Create admin account during first run

When ADMIN_USER and ADMIN_PASSWORD (or ADMIN_PASSWORD_FILE) are set an admin user will be created with those credentials during the first run. Otherwise Lychee will prompt in the browser when first loaded.

Docker secrets

As an alternative to passing sensitive information via environment variables, _FILE may be appended to some of the environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files.

If both the original variable and the _FILE (e.g. both DB_PASSWORD and DB_PASSWORD_FILE) are set, the original variable will be used.

The following _FILE variables are supported:

  • DB_PASSWORD_FILE
  • REDIS_PASSWORD_FILE
  • MAIL_PASSWORD_FILE
  • ADMIN_PASSWORD_FILE

Available environment variables and defaults

If you do not provide environment variables or .env file, the example .env file will be used with some values already set by default.

Some variables are specific to Docker, and the default values are :

  • PUID=1000
  • PGID=1000
  • USER=lychee
  • PHP_TZ=UTC
  • STARTUP_DELAY=0

Additionally, if SKIP_PERMISSIONS_CHECKS is set to "yes", the entrypoint script will not check or set the permissions of files and directories on startup. Users are strongly advised against using this option, and efforts have been made to keep the checks as fast as possible. Nonetheless, it may be suitable for some advanced use cases.

Advanced configuration

Note that nginx will accept by default images up to 100MB (client_max_body_size 100M) and that PHP parameters are overridden according to the recommendations of the Lychee FAQ.

You may still want to further customize PHP configuration. The first method is to mount a custom php.ini to /etc/php/8.2/fpm/php.ini when starting the container. However, this method is kind of brutal as it will override all parameters. It will also need to be remapped whenever an image is released with a new version of PHP.

Instead, we recommend to use the PHP_VALUE directive of PHP-FPM to override specific parameters. To do so, you will need to mount a custom nginx.conf in your container :

  1. Take the default.conf file as a base
  2. Find the line starting by fastcgi_param PHP_VALUE [...]
  3. Add a new line and set your new parameter
  4. Add or change any other parameters (e.g. client_max_body_size)
  5. Mount your new file to /etc/nginx/nginx.conf

If you need to add (not change) nginx directives, files mounted in /etc/nginx/conf.d/ will be included in the http context.

lychee-docker's People

Contributors

astrofrog avatar chostakovitch avatar d7415 avatar horlogeskynet avatar ildyria avatar junebugfix avatar mannil avatar meyca avatar mingan666 avatar nicokaiser avatar p4block avatar radek-sprta avatar roblandry avatar swrap avatar tmp-hallenser avatar ttys0 avatar yoshinorin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lychee-docker's Issues

Request: Easier access to the php.ini / Are the docs correct?

The docs refer to the php.ini used in the docker and the location appears incorrect compared to the actual docker.

/etc/php/7.3/php/ does not exist, it appears to be /7.3/cli or fpm?

Cheers

drwxr-xr-x 1 root root 26 Aug 16 11:41 cli/php.ini
drwxr-xr-x 1 root root 62 Aug 15 21:50 fpm/php.ini
drwxr-xr-x 1 root root 698 Aug 15 21:50 mods-available

Change of permissions in entrypoint.sh

Hi,

I migrated from Lychee 3 and I got it work, read-only though. As I tried to upload a photo (just to see if I can) all I got was this:

2019-05-12 19:56:56 -- error -- App\ModelFunctions\PhotoFunctions::add -- 262 -- Could not move photo to uploads

About my setup: a machine running docker, upload and config directories in a separate, storage server via SMB/CIFS share.

I suspected that this must be permissions related, so I tried a simple write to the uploads directory.

www-data@docker-container:~/html/Lychee-Laravel$ cd /uploads
www-data@docker-container:/uploads$ touch file.txt
touch: cannot touch 'file.txt': Permission denied
www-data@docker-container:/uploads$ ls -l file.txt
-rw-r--r--+ 1 lychee lychee 0 May 13 09:52 file.txt
www-data@docker-container:/uploads$ logout
<redacted>:~/.docker/main-services$ docker exec -ti -u lychee mainservices_lychee-laravel_1 /bin/bash -l
lychee@docker-container:/var/www/html/Lychee-Laravel$ cd /uploads
lychee@docker-container:/uploads$ touch file.txt
lychee@docker-container:/uploads$ ls -l file.txt
-rw-r--r--+ 1 lychee lychee 0 May 13 09:53 file.txt
lychee@docker-container:/uploads$ rm file.txt 
lychee@docker-container:/uploads$ touch file.txt
lychee@docker-container:/uploads$ ls -l file.txt
-rw-r--r--+ 1 lychee lychee 0 May 13 09:54 file.txt
lychee@docker-container:/uploads$ echo "hello" > file.txt 
lychee@docker-container:/uploads$ ls -l file.txt
-rw-r--r--+ 1 lychee lychee 6 May 13 09:54 file.txt
lychee@docker-container:/uploads$ cat file.txt 
hello
lychee@docker-container:/uploads$ rm file.txt 
lychee@docker-container:/uploads$ ls -l 
total 0
drwxrwxrwx+ 2 lychee lychee 0 May 12 20:35 big
drwxrwxrwx+ 2 lychee lychee 0 May 11 13:20 import
drwxrwxrwx+ 2 lychee lychee 0 Oct  1  2017 medium
drwxrwxrwx+ 2 lychee lychee 0 May 10 13:52 small
drwxrwxrwx+ 2 lychee lychee 0 Oct  1  2017 thumb
lychee@docker-container:/uploads$ cd ..
lychee@docker-container:/$ ls -l
total 72
...
drwxr-xr-x+   2 lychee lychee    0 May 12 20:39 conf
drwxrwxrwx+   3 lychee lychee    0 May 11 13:20 importer
drwxrwxrwx+   7 lychee lychee    0 May 13 09:54 uploads
...
lychee@docker-container:/$ logout
<redacted>:~/.docker/main-services$ 

So, in brief, user www-data can't write, only user lychee can, but it's user www-data who handles files during import.

Now, if I change ownership of uploads folder, that's what I get:

lychee-laravel_1  | chown: changing ownership of '/uploads/small/index.html': Permission denied
lychee-laravel_1  | chown: changing ownership of '/uploads/small': Permission denied
lychee-laravel_1  | chown: changing ownership of '/uploads/medium/c9d7814faafd6c8198f9eb4830f87d59.JPG': Permission denied
lychee-laravel_1  | chown: changing ownership of '/uploads/medium/598e6e7556ba81c47a503c620daebb4f.JPG': Permission denied
lychee-laravel_1  | chown: changing ownership of '/uploads/medium/c985a5643757b6c9726927dd18a5f1d0.JPG': Permission denied
lychee-laravel_1  | chown: changing ownership of '/uploads/medium/fb72b153dd0da9ccabc80c8510f2fa06.JPG': Permission denied
lychee-laravel_1  | chown: changing ownership of '/uploads/medium/74383014a074162c2a5d9df494632418.JPG': Permission denied
lychee-laravel_1  | chown: changing ownership of '/uploads/medium/64b0831bc378b6db5feae75fe6cd2369.JPG': Permission denied

and docker container fails to start.

So, I just wanted to ask: are lines 43-47 of entrypoint.sh completely necessary? Can't we just check them before running and then omit them?

Thank you.

Photos are DELETED from host and are MISSING in lychee

Hello,

I setup lychee as docker container, I bind uploads/import path to my pictures and started the container. I did not start the import process as I was just about to tarball my pictures. However starting the container deleted photos from host but the mysql photos tables has or rows and there are no photos in the docker volume.

I was not expecting files to be deleted until I actioned it on the website and I was ready to start the proccess

Please help where these photos could be. Where are they stored in the lychee volume. Uploads big, medium and small are all empty directories.

At the moment I cannot give more detailed description because I am in the middle of a lengthy data recovery!

Links broken after docker rm

After running sudo docker-compose down or sudo docker rm lychee all the pictures links are broken: the http requests return 404. "Open original" option also returns 404, however the download option works fine for all the different sizes including original and entire albums.

It only happens after sudo docker-compose down or sudo docker rm lychee. Rebooting the server or sudo docker {restart, stop + star} lychee behave well.

My docker-compose.yml:

version: "2"
services:
  lychee:
    container_name: lychee
    restart: always
    image: lycheeorg/lychee-laravel
    expose:
        - 80
    volumes:
        - /home/bros/fast-data/lychee/conf:/conf
        - /home/bros/big-data/lychee/uploads:/uploads
    environment:
        - PHP_TZ=***
        - DB_CONNECTION=mysql
        - DB_HOST=***
        - DB_PORT=***
        - DB_DATABASE=***
        - DB_USERNAME=***
        - DB_PASSWORD=***
        - VIRTUAL_HOST=***
        - VIRTUAL_PORT=80
        - LETSENCRYPT_HOST=***
        - LETSENCRYPT_EMAIL=***
networks:
    default:
        external:
            name: nginx-net

Note:

  • I'm using an already running MariaDB container, and the connection to it seems just fine.
  • I'm using a nginx + letsencrypt setup based on this

Diagnostic:

    Diagnostics
    -----------
    Info: Latest version of PHP is 7.4
    Warning: Dropbox import not working. dropbox_key is empty.

    System Information
    ------------------
    Lychee-front Version:      3.2.16
    Lychee Version (git):      bae5f2b (master) - Data not in Cache
    DB Version:                040000
    System:                    Linux
    PHP Version:               7.3
    MySQL Version:             10.4.12-MariaDB-1:10.4.12+maria~bionic-log
    
    Lychee total space:        65.14 MB
    Upload folder space:       8.00 B
    System total space:        31.61 GB
    System free space:         16.26 GB (51%)
    
    Imagick:                   1
    Imagick Active:            1
    Imagick Version:           1690
    GD Version:                2.2.5

    Config Information
    ------------------
    version:                   040000
    check_for_updates:         0
    sorting_Photos_col:        takestamp
    sorting_Photos_order:      ASC
    sorting_Albums_col:        max_takestamp
    sorting_Albums_order:      ASC
    imagick:                   1
    skip_duplicates:           0
    small_max_width:           0
    small_max_height:          360
    medium_max_width:          1920
    medium_max_height:         1080
    lang:                      en
    layout:                    1
    image_overlay:             1
    image_overlay_type:        desc
    default_license:           none
    compression_quality:       90
    full_photo:                1
    delete_imported:           0
    Mod_Frame:                 1
    Mod_Frame_refresh:         30
    thumb_2x:                  1
    small_2x:                  1
    medium_2x:                 1
    landing_page_enable:       0
    landing_owner:             Arnau Bennassar
    landing_title:             Arnau Bennassar
    landing_subtitle:          Cats, Dogs & Humans Photography
    landing_facebook:          https://www.facebook.com/JohnSmith
    landing_flickr:            https://www.flickr.com/JohnSmith
    landing_twitter:           https://www.twitter.com/JohnSmith
    landing_instagram:         https://instagram.com/JohnSmith
    landing_youtube:           https://www.youtube.com/JohnSmith
    landing_background:        dist/cat.jpg
    site_title:                Lychee v4
    site_copyright_enable:     0
    site_copyright_begin:      2019
    site_copyright_end:        2019
    additional_footer_text:    
    display_social_in_gallery: 0
    public_search:             0
    public_recent:             0
    recent_age:                1
    public_starred:            0
    downloadable:              1
    photos_wraparound:         1
    map_display:               1
    zip64:                     1
    map_display_public:        0
    map_provider:              Wikimedia
    force_32bit_ids:           0
    map_include_subalbums:     0
    update_check_every_days:   3
    has_exiftool:              1
    share_button_visible:      1
    import_via_symlink:        0
    has_ffmpeg:                1

ERROR: FPM initialization failed

When I first start this container, it creates tables in the database, but then reports some errors and exits:

...

lychee    | Migrated:  2019_10_11_093442_config_check_update_every (0 seconds)
lychee    | **** Create user and use PUID/PGID ****
lychee    | -e  	User UID :	1000
lychee    | -e  	User GID :	1000
lychee    | **** Set Permissions ****
lychee    | **** Setup complete, starting the server. ****
lychee    | [12-Feb-2020 01:00:54] ERROR: failed to open configuration file '/etc/php/7.3/fpm/php-fpm.conf': No such file or directory (2)
lychee    | [12-Feb-2020 01:00:54] ERROR: failed to load configuration file '/etc/php/7.3/fpm/php-fpm.conf'
lychee    | [12-Feb-2020 01:00:54] ERROR: FPM initialization failed

Is there a default php-fpm.conf file that you recommend?

Renaming this repo/image

Lychee v4 has been released as Lychee, so it may make sense to rename this repo to Lychee-Docker and/or the image to Lychee.

  • Renaming the repo should have minimal effect as GitHub will redirect from the old URLs.
  • The image name might be better pushed to both names, unless Docker Hub has a similar mechanism.

Leaving this open for any other considerations. I don't see any rush.

Lychee/Laravel is unaware of https when sitting behind an nginx reverse proxy.

I've got a fresh copy of Lychee-Docker running under docker-compose. Here's my configuration:

  lychee:
    container_name: lychee
    image: lycheeorg/lychee
    env_file:
      - lychee.env
      - lychee.secret.env
    ports: ["4004:80"]
    restart: unless-stopped
    volumes:
      - /opt/lychee/conf:/conf
      - /opt/lychee/uploads:/uploads
      - /opt/lychee/sym:/sym

It's sitting behind an nginx reverse proxy with the following location block:

location / {
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto https;
    client_max_body_size 1G;
    proxy_pass http://127.0.0.1:4004/;
}

Because nginx is handling public-facing https:// and communicating with Lychee over http://, and because Laravel's url directive uses the same scheme that its requests use, the /install page is totally hosed when I hit nginx.

Specifically, the generated URLs for static assets (css, js) are http:// which nginx is rejecting.

Permission issue with Lychee, Docker, and NFS

Detailed description of the problem [REQUIRED]

Mounting the /uploads directory using an NFS volume in Docker creates permission denied errors.

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. Either create an NFS volume in Docker or mount an NFS share
  2. Link that share to the /uploads directory in the docker-compose.yaml file
  3. Start the container

Note: I had previously set this up with local files before moving to the NFS share. Yes, I have absolutely made sure the permissions are the same and I can create and modify files on the NFS share.

Mount options for the NFS share on the client side: rw,noatime,rsize=65536,wsize=65536,tcp,timeo=14
NFS share options on the server side: sec=sys,rw,crossmnt,no_subtree_check,no_root_squash

Screenshots
N/A

Output of the diagnostics [REQUIRED]

(Settings => Diagnostics or https://example.com/Diagnostics or php artisan lychee:diagnostics)
Those logs are not available due to the container not staying up long enough to get them.
However, here are some of the logs from Docker:

**** Make sure the /conf and /uploads folders exist ****,
Lychee Commit:  3274d9a,
-------------------------------------,
Lychee Version: 4.2.2 (release),
https://github.com/LycheeOrg/Lychee/commit/3274d9aef5ef00126d8006b9161c10538c5b130f,
**** Delaying startup (0 seconds)... ****,
**** Create the symbolic link for the /uploads folder ****,
cp: cannot create regular file '/uploads/big/index.html': Permission denied,
cp: cannot create regular file '/uploads/import/index.html': Permission denied,
cp: cannot create regular file '/uploads/medium/index.html': Permission denied,
cp: cannot create regular file '/uploads/raw/index.html': Permission denied,
cp: cannot create regular file '/uploads/small/index.html': Permission denied,
cp: cannot create regular file '/uploads/thumb/index.html': Permission denied,
**** Create the symbolic link for the /sym folder ****,
**** Create the symbolic link to the old Lychee-Laravel folder ****,
**** Copy the .env to /conf ****,
**** Inject .env values ****,
**** Check user.css exists and symlink it ****,
**** Create user and use PUID/PGID ****,
 	User UID :	1000,
 	User GID :	1000,
**** Set Permissions ****,
chown: changing ownership of '/uploads/thumb/aa56ae1af1f5ce9ae9573a6d0469206b.jpeg': Operation not permitted,
chown: changing ownership of '/uploads/thumb/f8b275e0e0b78fe00d9e028f25d014ed.jpeg': Operation not permitted,
chown: changing ownership of '/uploads/thumb/fbd05f58c47d6851319e4911ced01335.jpeg': Operation not permitted,
chown: changing ownership of '/uploads/thumb/[email protected]': Operation not permitted

Browser and system

Desktop: Windows 10, Chrome
Servers: client - Ubuntu 20.04, NFS server: Ubuntu 20.04 (Armbian)

lychee not working after upgrade to lycheeorg/lychee-laravel:dev (Image ID:0c3ea3c21b7f)

Detailed description of the problem [REQUIRED]

I setup a Lychee Service using lycheeorg/lychee-larave:latest (Imag ID: 70e1024b8861)
with proper volumn and database setup. After sync some photos, the Lychee service works very well. Then I upgrade to lycheeorg/lychee-larave:dev, and can not make it work anymore.

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. docker run -d
    --name=lychee --restart=unless-stopped
    -v /srv/lychee/conf:/conf
    -v /srv/lychee/uploads:/uploads
    -e PUID=1000
    -e PGID=1000
    -e PHP_TZ=$(cat /etc/timezone )
    -e DB_CONNECTION=mysql
    -e DB_HOST=172.17.0.1
    -e DB_PORT=3306
    -e DB_DATABASE=photos
    -e DB_USERNAME=lychee
    -e DB_PASSWORD=DBPassword
    -p 90:80
    lycheeorg/lychee-laravel:latest

  2. docker exec -it lychee php artisan lychee:sync /conf/path/to/photos

  3. docker stop lychee && docker rename lychee lychee.bk

  4. docker run -d
    --name=lychee --restart=unless-stopped
    -v /srv/lychee/conf:/conf
    -v /srv/lychee/uploads:/uploads
    -e PUID=1000
    -e PGID=1000
    -e PHP_TZ=$(cat /etc/timezone )
    -e DB_CONNECTION=mysql
    -e DB_HOST=172.17.0.1
    -e DB_PORT=3306
    -e DB_DATABASE=photos
    -e DB_USERNAME=lychee
    -e DB_PASSWORD=DBPassword
    -p 90:80
    lycheeorg/lychee-laravel:dev

after login, get some fatal error.

Screenshots
Screen Shot 2020-05-13 at 1 01 02 AM

Output of the diagnostics [REQUIRED]

(Settings => Diagnostics or https://example.com/Diagnostics )

Diagnostics
-----------
Info: Latest version of PHP is 7.4
Warning: Using 32 bit PHP, recommended upgrade to 64 bit
Warning: Dropbox import not working. dropbox_key is empty.

System Information
------------------
Lychee Version (git):       master (cda45c2) - Data not in Cache
DB Version:                 4.0.3

composer install:           --no-dev
APP_ENV:                    local
APP_DEBUG:                  false

System:                     Linux
PHP Version:                7.3
MySQL Version:              10.1.44-MariaDB-0ubuntu0.18.04.1

Imagick:                    1
Imagick Active:             1
Imagick Version:            1690
GD Version:                 2.2.5

Config Information
------------------
version:                    040003
check_for_updates:          0
sorting_Photos_col:         takestamp
sorting_Photos_order:       ASC
sorting_Albums_col:         max_takestamp
sorting_Albums_order:       ASC
imagick:                    1
skip_duplicates:            0
small_max_width:            0
small_max_height:           360
medium_max_width:           1920
medium_max_height:          1080
lang:                       en
layout:                     0
image_overlay:              1
image_overlay_type:         desc
default_license:            none
compression_quality:        90
full_photo:                 1
delete_imported:            0
Mod_Frame:                  1
Mod_Frame_refresh:          30
thumb_2x:                   1
small_2x:                   1
medium_2x:                  1
landing_page_enable:        1
landing_owner:              -
landing_title:              -
landing_subtitle:          -
landing_facebook:           
landing_flickr:             
landing_twitter:            
landing_instagram:          
landing_youtube:            
landing_background:         dist/cat.jpg
site_title:                 Lychee v4
site_copyright_enable:      1
site_copyright_begin:       2019
site_copyright_end:         2019
additional_footer_text:     
display_social_in_gallery:  0
public_search:              0
SL_enable:                  1
SL_for_admin:               1
public_recent:              0
recent_age:                 1
public_starred:             0
downloadable:               0
photos_wraparound:          1
map_display:                0
zip64:                      1
map_display_public:         0
map_provider:               Wikimedia
force_32bit_ids:            0
map_include_subalbums:      0
update_check_every_days:    3
has_exiftool:               1
share_button_visible:       0
import_via_symlink:         0
has_ffmpeg:                 1
location_decoding:          0
location_decoding_timeout:  30
location_show:              1
location_show_public:       0

Browser and system

Docker container wont start

/entrypoint.sh: 7: /entrypoint.sh: cannot open /var/www/html/Lychee-Laravel/.git/refs/heads/master: No such file
/entrypoint.sh: 7: /entrypoint.sh: cannot open /var/www/html/Lychee-Laravel/.git/refs/heads/master: No such file
/entrypoint.sh: 7: /entrypoint.sh: cannot open /var/www/html/Lychee-Laravel/.git/refs/heads/master: No such file
/entrypoint.sh: 7: /entrypoint.sh: cannot open /var/www/html/Lychee-Laravel/.git/refs/heads/master: No such file
/entrypoint.sh: 7: /entrypoint.sh: cannot open /var/www/html/Lychee-Laravel/.git/refs/heads/master: No such file
/entrypoint.sh: 7: /entrypoint.sh: cannot open /var/www/html/Lychee-Laravel/.git/refs/heads/master: No such file
/entrypoint.sh: 7: /entrypoint.sh: cannot open /var/www/html/Lychee-Laravel/.git/refs/heads/master: No such file
/entrypoint.sh: 7: /entrypoint.sh: cannot open /var/www/html/Lychee-Laravel/.git/refs/heads/master: No such file
/entrypoint.sh: 7: /entrypoint.sh: cannot open /var/www/html/Lychee-Laravel/.git/refs/heads/master: No such file

Unable to deploy

compose-yaml:

---
version: '3'

services:
  lychee_db:
    container_name: lychee_db
    image: mariadb:10
    environment:
      - MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
      - MYSQL_DATABASE=lychee
      - MYSQL_USER=lychee
      - MYSQL_PASSWORD=${DB_PASSWORD}
    expose:
      - 3306
    volumes:
      - mysql:/var/lib/mysql
    networks:
      - lychee
    restart: unless-stopped

  lychee:
    image: lycheeorg/lychee:latest
    container_name: lychee
    ports:
      - 8142:80
    volumes:
      - ./lychee/conf:/conf
      - ./lychee/uploads:/uploads
      - ./lychee/sym:/sym
    networks:
      - lychee
    environment:
      - PHP_TZ=America/New_York
      - DB_CONNECTION=mysql
      - DB_HOST=lychee_db
      - DB_PORT=3306
      - DB_DATABASE=lychee
      - DB_USERNAME=lychee
      - DB_PASSWORD=${DB_PASSWORD}
      - STARTUP_DELAY=5
    restart: unless-stopped
    depends_on:
      - lychee_db

networks:
  lychee:

volumes:
  mysql:

.env:

PUID=1000
PGID=1000
PHP_TZ=America/New_York
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=lychee
DB_USERNAME=lychee
DB_PASSWORD=password_here
APP_URL='https://domain.tld'

Docker-log:

lychee       | **** Make sure the /conf and /uploads folders exist ****
lychee       | **** Create the symbolic link for the /uploads folder ****
lychee       | **** Create the symbolic link for the /sym folder ****
lychee       | **** Create the symbolic link to the old Lychee-Laravel folder ****
lychee       | **** Copy the .env to /conf ****
lychee       | **** Inject .env values ****
lychee       | **** Generate the key (to make sure that cookies cannot be decrypted etc) ****
lychee       | 
lychee       | **************************************
lychee       | *     Application In Production!     *
lychee       | **************************************
lychee       | 
lychee       | Command Canceled!
lychee       | **** Migrate the database ****
lychee       | 
lychee       | 
lychee       | In Connection.php line 678:
lychee       |                                                                                
lychee       |   SQLSTATE[HY000] [2002] Connection timed out (SQL: select * from information  
lychee       |   _schema.tables where table_schema = lychee and table_name = migrations and   
lychee       |   table_type = 'BASE TABLE')                                                   
lychee       |                                                                                
lychee       | 
lychee       | In Exception.php line 18:
lychee       |                                                
lychee       |   SQLSTATE[HY000] [2002] Connection timed out  
lychee       |                                                
lychee       | 
lychee       | In PDOConnection.php line 38:
lychee       |                                                
lychee       |   SQLSTATE[HY000] [2002] Connection timed out  
lychee       |                                                
lychee       | 
lychee       | **** Check user.css exists and symlink it ****
lychee       | **** Create user and use PUID/PGID ****
lychee       |  	User UID :	1000
lychee       |  	User GID :	1000
lychee       | **** Set Permissions ****
lychee       | **** Setup complete, starting the server. ****

Database [mariadb] not configured

I am getting an error trying to get this container to work with mariadb. Below is the Docker command I ran to create the container. I am able to connect to my mariadb container with other applications using the user ID and password so I feel confident it is working fine. There is a DB call lychee in mariadb already.

docker create --name=lychee /
-e TZ=America/Chicago /
-p 8597:80 /
-e PUID=1000 -e PGID=1000 /
-e DB_CONNECTION=mariadb /
-e DB_HOST=192.168.1.103 /
-e DB_PORT=3306 /
-e DB_DATABASE=lychee /
-e DB_USERNAME=<user_name>/
-e DB_PASSWORD= /
-v /docker/lychee:/conf -v /pictures:/uploads /
bigrob8181/lychee-laravel

Messages related to git in logs

I am currently running the lychee:dev image, and in the logs I see at regular intervals the following message:

    2020-06-29 13:20:29 -- notice  -- App\Metadata\GitHubFunctions::__construct -- 49 -- file_get_contents(/var/www/html/Lychee/.git/refs/heads/master): failed to open stream: No such file or directory

PHP upload_max_filesize limit is too small

Detailed description of the problem [REQUIRED]

While uploading a bunch of files, the error "Upload failed. The PHP upload_max_filesize limit is too small" occurred. The affected file is 22.1 MB in size.

Steps to reproduce the issue

  1. Upload picture file which is 22.1 MB in size or larger

Screenshots
Screenshot_2021-05-06 Lychee v4 - Ducks

Output of the diagnostics [REQUIRED]

Diagnostics
-------
Warning: Dropbox import not working. dropbox_key is empty.
Warning: You may experience problems when uploading a photo of large size. Take a look in the FAQ for details.

System Information
--------------
Lychee Version (git):            No git data found.
DB Version:                      4.3.0

composer install:                --no-dev
APP_ENV:                         production
APP_DEBUG:                       false

System:                          Linux
PHP Version:                     7.4
Max uploaded file size:          20M
Max post size:                   100M
SQLite Version:                  3.34.1

Imagick:                         1
Imagick Active:                  1
Imagick Version:                 1691
GD Version:                      2.3.0

Lychee total space:              34.85 MB
Upload folder space:             8.00 B
System total space:              186.26 GB
System free space:               122.90 GB (65%)

Config Information
--------------
version:                         040300
check_for_updates:               0
sorting_Photos_col:              takestamp
sorting_Photos_order:            ASC
sorting_Albums_col:              max_takestamp
sorting_Albums_order:            ASC
imagick:                         1
skip_duplicates:                 0
small_max_width:                 0
small_max_height:                360
medium_max_width:                1920
medium_max_height:               1080
lang:                            en
layout:                          1
image_overlay_type:              desc
default_license:                 none
compression_quality:             90
full_photo:                      1
delete_imported:                 0
Mod_Frame:                       1
Mod_Frame_refresh:               30
thumb_2x:                        1
small_2x:                        1
medium_2x:                       1
landing_page_enable:             0
landing_owner:                   John Smith
landing_title:                   John Smith
landing_subtitle:                Cats, Dogs & Humans Photography
landing_facebook:                https://www.facebook.com/JohnSmith
landing_flickr:                  https://www.flickr.com/JohnSmith
landing_twitter:                 https://www.twitter.com/JohnSmith
landing_instagram:               https://instagram.com/JohnSmith
landing_youtube:                 https://www.youtube.com/JohnSmith
landing_background:              dist/cat.jpg
site_title:                      Lychee v4
site_copyright_enable:           1
site_copyright_begin:            2019
site_copyright_end:              2019
additional_footer_text:          
display_social_in_gallery:       0
public_search:                   0
SL_enable:                       0
SL_for_admin:                    0
public_recent:                   0
recent_age:                      1
public_starred:                  0
downloadable:                    0
photos_wraparound:               1
map_display:                     0
zip64:                           1
map_display_public:              0
map_provider:                    Wikimedia
force_32bit_ids:                 0
map_include_subalbums:           0
update_check_every_days:         3
has_exiftool:                    1
share_button_visible:            0
import_via_symlink:              0
has_ffmpeg:                      1
location_decoding:               0
location_decoding_timeout:       30
location_show:                   1
location_show_public:            0
rss_enable:                      0
rss_recent_days:                 7
rss_max_items:                   100
prefer_available_xmp_metadata:   0
editor_enabled:                  1
lossless_optimization:           0
swipe_tolerance_x:               150
swipe_tolerance_y:               250
local_takestamp_video_formats:   .avi|.mov
log_max_num_line:                1000
unlock_password_photos_with_url_param: 0
nsfw_visible:                    1
nsfw_blur:                       0
nsfw_warning:                    0
nsfw_warning_admin:              0
map_display_direction:           1
album_subtitle_type:             oldstyle
upload_processing_limit:         4
public_photos_hidden:            1

Browser and system

openSUSE Leap 15.2, 5.3.18-lp152.72-default (Both Server + Client)
Firefox 78.10.0esr (64 bit)

Add support for docker secrets

It would be great to have support for docker secrets.

Looking at the available environment variables I think these should be added:

  • DB_PASSWORD_FILE
  • REDIS_PASSWORD_FILE
  • MAIL_PASSWORD_FILE
  • PUSHER_APP_KEY_FILE
  • PUSHER_APP_SECRET_FILE

I had a look at inject.sh and my initial thought was like this:

if [ "$DB_PASSWORD_FILE" != '' ]; then
  value=$(<$DB_PASSWORD_FILE)
  sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=${value}|i" /conf/.env
fi

I think this should be it?

Images for armv7

I noticed that the :dev image supports amrv7, but this seems to be missing from the stable tags - is this a work in progress, or are there no plans to support stable tags for armv7 going forward?

Error:Class 'Predis\Client' not found

OS:raspberry 4B arm64
docker:lycheeorg/lychee-laravel:latest

In the file '.env' 'CACHE_DRIVER=redis' then appears an error

ErrorClass 'Predis\Client' not found

inย PredisConnector.phpย line 29
atย PredisConnector->connect(array('host' => '127.0.0.1', 'password' =>ย null, 'port' => 6379, 'database' => 0),ย array())inย RedisManager.phpย line 110

Nextcloud upload

Hi,

This is more a feature request.
will it be possible to upload pics or folders from nextcloud instance or webDav server?

Thanks

"Personalize your CSS" is not persistent on Docker installs

Steps to reproduce:

  1. Spin up Lychee container.
  2. As an admin user add some content to "Personalize your CSS".
  3. Restart Lychee container.
  4. Any CSS modifications are gone.

What I think is going on: custom CSS is stored in public/dist/user.css and this file isn't mounted outside of the container (or in any docker volume), so after the restart it's gone. A possible solution would be to move it to /conf directory on docker installs.

Mysql 8.0.16 (latest) authentication error

Context

Running the following commands to install and run mysql and lychee

LYCHEE_BASE=/path/to

docker run -d --name mysql --network lychee -e MYSQL_ROOT_PASSWORD=password -e MYSQL_USER=lychee -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=lychee mysql:8.0.16

docker run -d --name=lychee-laravel -v ${LECHEE_BASE}/conf:/conf -v ${LECHEE_BASE}/uploads:/uploads -e PUID=1000 -e PGID=1000 -e PHP_TZ=Europe/Berlin -e DB_CONNECTION=mysql -e DB_HOST=mysql -e DB_PORT=3306 -e DB_DATABASE=lychee -e DB_USERNAME=lychee -e DB_PASSWORD=password -p 80:80 --network lychee bigrob8181/lychee-laravel

Issue

Raises an authentication error while running install script:

**** Migrate the database ****

In Connection.php line 664:
                                                                               
  SQLSTATE[HY000] [2054] The server requested authentication method unknown t  
  o the client (SQL: select * from information_schema.tables where table_sche  
  ma = lychee and table_name = migrations)                                     
                                                                               

In PDOConnection.php line 31:
                                                                               
  SQLSTATE[HY000] [2054] The server requested authentication method unknown t  
  o the client                                                                 
                                                                               

In PDOConnection.php line 27:
                                                                               
  SQLSTATE[HY000] [2054] The server requested authentication method unknown t  
  o the client                                                                 
                                                                               

In PDOConnection.php line 27:
                                                                               
  PDO::__construct(): The server requested authentication method unknown to t  
  he client [caching_sha2_password]

Possible fix

(working on my installation), found inspiration here:

$ docker exec -it mysql mysql -u lychee -p -e "alter user 'lychee' identified with mysql_native_password by 'password';"

Connection issue

Hello,

I'm trying to deploy a Lychee image on docker. Im' a relative beginner. In logs I have an error:
image
I think it's related with the databse. However, I set same password for mysql_password and db_password. Am I missed something ?
This is my docker-compose file:

`version: '3'

services:
lychee_db:
container_name: lychee_db
image: mariadb:10
environment:
- MYSQL_ROOT_PASSWORD=loremtest
- MYSQL_DATABASE=lychee
- MYSQL_USER=lychee
- MYSQL_PASSWORD=lorem
expose:
- 3306
volumes:
- mysql:/var/lib/mysql
networks:
- lychee
restart: unless-stopped

lychee:
image: lycheeorg/lychee
container_name: lychee
ports:
- 90:80
volumes:
- /srv/dev-disk-by-label-AppData/AppData/Config/Lychee:/conf
- /srv/dev-disk-by-label-Files/Files/Medias/Uploads:/uploads
- /srv/dev-disk-by-label-Files/Files/Medias/Sym:/sym
networks:
- lychee
environment:
- PUID=1000
- PGID=100
# PHP timezone e.g. PHP_TZ=America/New_York
- PHP_TZ=Europe/Paris
#- APP_NAME=Laravel
#- APP_ENV=local
#- APP_DEBUG=true
#- APP_URL=http://localhost
#- LOG_CHANNEL=stack
- DB_CONNECTION=mysql
- DB_HOST=lychee_db
- DB_PORT=3306
- DB_DATABASE=lychee
- DB_USERNAME=lychee
- DB_PASSWORD=lorem
#- DB_DROP_CLEAR_TABLES_ON_ROLLBACK=false
#- DB_OLD_LYCHEE_PREFIX=''
#- BROADCAST_DRIVER=log
#- CACHE_DRIVER=file
#- SESSION_DRIVER=file
#- SESSION_LIFETIME=120
#- QUEUE_DRIVER=sync
#- SECURITY_HEADER_HSTS_ENABLE=false
#- 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
#- PUSHER_APP_ID=''
#- PUSHER_APP_KEY=''
#- PUSHER_APP_SECRET=''
#- PUSHER_APP_CLUSTER=mt1
- STARTUP_DELAY=30
restart: unless-stopped
depends_on:
- lychee_db

networks:
lychee:

volumes:
mysql:`

Thank you!!

Lychee waits for confirmation in Docker

Detailed description of the problem [REQUIRED]

Fresh install without any prior data.
Lychee v4.0.5 and v4.0.6 do not start in Docker. It just waits for confirmation(see screenshot).
Message:
Do you really wish to run this command? (yes/no) [no]:

Steps to reproduce the issue

  1. Start Lychee in Docker (lycheeorg/lychee:v4.0.6 or v4.0.5)
  2. Check logs

Screenshots
image

Output of the diagnostics [REQUIRED]

Diagnostics
-----------
Info: Latest version of PHP is 7.4
Error: username empty or not set in database
Error: password empty or not set in database
Warning: Dropbox import not working. dropbox_key is empty.
Warning: You may experience problems when uploading a large amount of photos. Take a look in the FAQ for details.

System Information
------------------
Lychee Version (git):       No git data found.
DB Version:                 4.0.6

composer install:           --no-dev
APP_ENV:                    production
APP_DEBUG:                  false

System:                     Linux
PHP Version:                7.3
MySQL Version:              8.0.20

Imagick:                    1
Imagick Active:             1
Imagick Version:            1690
GD Version:                 2.2.5

Config Information
------------------
version:                    040006
check_for_updates:          0
sorting_Photos_col:         takestamp
sorting_Photos_order:       ASC
sorting_Albums_col:         max_takestamp
sorting_Albums_order:       ASC
imagick:                    1
skip_duplicates:            0
small_max_width:            0
small_max_height:           360
medium_max_width:           1920
medium_max_height:          1080
lang:                       en
layout:                     1
image_overlay:              1
image_overlay_type:         desc
default_license:            none
compression_quality:        90
full_photo:                 1
delete_imported:            0
Mod_Frame:                  1
Mod_Frame_refresh:          30
thumb_2x:                   1
small_2x:                   1
medium_2x:                  1
landing_page_enable:        0
landing_owner:              John Smith
landing_title:              John Smith
landing_subtitle:           Cats, Dogs & Humans Photography
landing_facebook:           https://www.facebook.com/JohnSmith
landing_flickr:             https://www.flickr.com/JohnSmith
landing_twitter:            https://www.twitter.com/JohnSmith
landing_instagram:          https://instagram.com/JohnSmith
landing_youtube:            https://www.youtube.com/JohnSmith
landing_background:         dist/cat.jpg
site_title:                 Lychee v4
site_copyright_enable:      1
site_copyright_begin:       2019
site_copyright_end:         2019
additional_footer_text:     
display_social_in_gallery:  0
public_search:              0
SL_enable:                  0
SL_for_admin:               0
public_recent:              0
recent_age:                 1
public_starred:             0
downloadable:               0
photos_wraparound:          1
map_display:                0
zip64:                      1
map_display_public:         0
map_provider:               Wikimedia
force_32bit_ids:            0
map_include_subalbums:      0
update_check_every_days:    3
has_exiftool:               1
share_button_visible:       0
import_via_symlink:         0
has_ffmpeg:                 1
location_decoding:          0
location_decoding_timeout:  30
location_show:              1
location_show_public:       0
rss_enable:                 0
rss_recent_days:            7
rss_max_items:              100
prefer_available_xmp_metadata: 0

Browser and system

  • Chrome Version 81.0.4044.138 (Official Build) (32-bit)
  • Rancher v2.3.5
  • Docker version 19.03.2, build 6a30dfc

A workaround I found

supply -e APP_ENV=local to Docker

404 after update

I've pulled the latest lycheeorg/lychee-laravel:dev image, and my lychee website suddenly stopped working. 404 Not Found nginx/1.14.2.

Tried lycheeorg/lychee-laravel:testing got the same result.

docker logs showed no error, the last line is:
lychee_laravel | **** Setup complete, starting the server. ****
and inside the container /var/log/nginx/error.log` showed no errors.

Failling back to an older tag worked: lycheeorg/lychee-laravel:dev@sha256:2e54f47ee8cf5458505ea456b17375ca0de36d3d3aa87e1bc77f90e15cb70f8c (Commit: LycheeOrg/Lychee@499eef6)

I don't know if this issue is related to the docker repo or the php repo, sorry if I posed the issue in the wrong place.

Server error with docker+nginx on subdirectory

Detailed description of the problem [REQUIRED]

When deploying Lychee with docker and nginx Proxy on a subdirectory (e.g. localhost/lychee), the instance reports "Server error or API not found"

Steps to reproduce the issue

Deploy instance with with docker:

mkdir -p /srv/lychee/{conf,uploads,sym}
docker run -d \
--name=lychee \
-v /srv/lychee/conf:/conf \
-v /srv/lychee/uploads:/uploads \
-v /srv/lychee/sym:/sym \
-e PHP_TZ=Europe/Amsterdam \
-p 127.0.0.1:8181:80 \
lycheeorg/lychee

nginx config:

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    location /albums {
            proxy_pass http://127.0.0.1:8181/;
    }
}

Now, when accessing http://localhost/albums, it results in "Server error or API not found". In the Firefox Inspector it looks like index.php and at least some of the Javascript resources are loaded correctly:

Screenshot from 2021-03-14 12-11-55

Direct access via http://localhost:8181 is possible and works just fine

Output of the diagnostics [REQUIRED]

diagnostics.txt

Browser and system

openSUSE Leap 15.2, Kernel 5.3.18-lp152.66-default
Docker version 19.03.15, build 99e3ed89195c
nginx version: nginx/1.16.1

Not able to run lychee with docker-compose example

Using this example file https://github.com/LycheeOrg/Lychee-Laravel-Docker/blob/master/docker-compose.yml and running docker compose up I got the following logs initially:

...
**** Migrate the database ****
In Connection.php line 669:
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
chema.tables where table_schema = lychee and table_name = migrations and ta
ble_type = 'BASE TABLE')
In PDOConnection.php line 31: 
SQLSTATE[HY000] [2002] Connection refused
In PDOConnection.php line 27:
SQLSTATE[HY000] [2002] Connection refused
**** Create user and use PUID/PGID ****
-e      User UID :      1000
-e      User GID :      1000
**** Set Permissions ****
**** Setup complete, starting the server. ****

If I do docker compose down + docker compose up again, it seems to run the migrations successfully.

If I do docker compose down + docker compose up one more time after that, it seems to boot saying there is nothing to migrate.

Each time I still get nothing on http://localhost:80

Docker container starts but lychee not deploying

I'm having an issue where lychee will not run on the docker container that is created.
I have tried deploying with the cli as well as with portainer and through a stack all with similar results.

Sometimes the error that i get in the logs seems to be related to certificate errors:
_lychee_logs.txt

But also i seem to be having issues with php when deploying with some slight changes:
_lychee_logs-2.txt

The full logs for both these deployments is attached but i think it is important to mention that i am using the below docker cli command for the second error log. It is the same as the command recommended by the link https://hub.docker.com/r/linuxserver/lychee:
lychee_docker_script.txt

I have also tried using the docker-compose method recommended here: https://hub.docker.com/r/linuxserver/lychee But that does not seem to work for either the db or the lychee containers.

The mariadb container is running fine, and i have created a user named lychee with access to the lychee db.

Error on image upload.

I just set up Lychee in docker and whenever i try to upload an image it fails with the message:

Server returned an unknown response. Please take a look at the console of your browser for further details.

Looking at the dev tools the upload request returns a page that just says "500 Server Error." No messages are printed to the docker console, how would I start troubleshooting this? thanks.

Changing source URLs

Related: #38

Lychee v4 has been released as Lychee and the repository moved accordingly, so it may make sense to change the source URLs in this project.

Leaving this open for any other considerations. I don't see any rush as GitHub will redirect all requests to the old URLs.

Docker nginx upload limited to 100MB

Increasing the upload limits in .user.ini as described i-cant-upload-photos is not sufficient when using docker-compose, because the upload limit must be increased in the nginx.conf file as well. I found the following workaround:

docker exec -it lychee bash
apt update; apt install nano

nano /etc/nginx/nginx.conf
    client_max_body_size 1000M;
    
nano /var/www/html/Lychee/public/.user.ini
    max_execution_time = 200
    post_max_size = 200M
    upload_max_size = 1000M
    upload_max_filesize = 1000M
    max_file_uploads = 2000

Restart docker or docker-compose

Lychee configuration broken after running from modified docker image

Steps to reproduce:

  1. Download lycheeorg/lychee:latest (tested with 4.0.7)
  2. Run lychee with sudo docker run --name=lychee -p 80:80 lycheeorg/lychee
  3. In the web interface set up the admin account and password and change some settings
  4. Stop the docker image and commit changes with sudo docker commit [lychee_container_ID] shrx/lychee
  5. Start the modified image with sudo docker run --name=lychee-shrx -p 80:80 shrx/lychee
  6. The web interface now redirects to http://[lychee.domain.tld]/install/env lychee-installer interface, which complains that all public/uploads/* subdirectories are missing.

Can't upload video files

I'm running Lychee in Docker, so I'm filing the issue here.

Whenever I try to upload a video file, the upload itself seems to work, but then it's always stuck in processing and nothing else ever happens.

I have seen nothing useful in the docker log itself and have no idea where else to go for debugging, so I'm kind of stuck with this. Any hints on how to debug this are highly appreciated.

Cannot upload larger files: upload_max_filesize is not taken from PHP-FPM

Detailed description of the problem [REQUIRED]

When I run the docker image with sqlite via docker run -p 92:80 --name lychee lycheeorg/lychee:dev lychee comes up and I can access through the browser. However, when I try to upload larger files (anything more than 3MB) I get an error saying that the "PHP upload_max_size" file limit is to small. I can check that file limit by running docker exec lychee php --info | grep max and indeed, it is set to '2M'. When I try to see which php.ini is being used I see that the php.ini in the cli folder is being used: docker exec lychee php --info | grep php.ini results in:

Configuration File (php.ini) Path => /etc/php/7.4/cli
Loaded Configuration File => /etc/php/7.4/cli/php.ini

In the docs it says that by default the upload_max_size is set to 200 MB and PHP-FPM is being used. I have changed the config in /etc/php/7.4/fpm/php.ini but that did not have any effect.

Steps to reproduce the issue

Steps to reproduce the behavior:

  1. Run docker container via docker run -p 92:80 --name lychee lycheeorg/lychee:dev
  2. Access lychee on localhost:92 , set a password and username and try to upload any file larger than 2MB.

Screenshots
Uploading Screenshot_20210314_153330.pngโ€ฆ

Output of the diagnostics [REQUIRED]

docker exec lychee php --info | grep php.ini:
Configuration File (php.ini) Path => /etc/php/7.4/cli
Loaded Configuration File => /etc/php/7.4/cli/php.ini

docker exec lychee php --info | grep max
post_max_size => 8M => 8M
upload_max_filesize => 2M => 2M

Browser and system

Ubuntu 19.10, Firefox 78.

Decoding of coordinates into location name fails

The decoding of location coordinates into location name is failing (e.g. run php artisan lychee:decode_GPS_locations)

Log says:

2020-10-24 05:34:54 -- warning -- App\Metadata\Geodecoder::decodeLocation_core -- 84 -- Error creating resource: [message] fopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
[file] /var/www/html/Lychee/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
[line] 324
[message] fopen(): Failed to enable crypto
[file] /var/www/html/Lychee/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
[line] 324
[message] fopen(https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=48.25700488&lon=10.08186616&addressdetails=1&zoom=18&accept-language=en): failed to open stream: operation failed
[file] /var/www/html/Lychee/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
[line] 324
    2020-10-24 05:34:54 -- warning -- App\Metadata\Geodecoder::decodeLocation_core -- 83 -- Decoding of location failed!

This seems to be an issue with the docker container (certificates?)

SQL-ERROR SQLSTATE[HY000] [2002] Connection refused

I try to setup Lychee-Laravel but keep getting the following error in the docker log when starting:

**** Migrate the database ****

In Connection.php line 664:

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
chema.tables where table_schema = lychee and table_name = migrations)

In PDOConnection.php line 31:

SQLSTATE[HY000] [2002] Connection refused

In PDOConnection.php line 27:

SQLSTATE[HY000] [2002] Connection refused

**** Create user and use PUID/PGID ****
-e User UID : 1000
-e User GID : 1000
**** Set Permissions ****
**** Setup complete, starting the server. ****

Docker-compose is as follows:
lychee_db:
container_name: lychee_db
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=randomPassword
- MYSQL_DATABASE=lychee
- MYSQL_USER=lychee
- MYSQL_PASSWORD=randomPassword
ports:
- 3309:3306
volumes:
- /mnt/storage/photos_db:/var/lib/mysql
restart: unless-stopped

lychee:
image: bigrob8181/lychee-laravel
container_name: lychee_laravel
ports:
- 90:80
volumes:
- /myFileLocation:/conf
- /mnt/storage/photos:/uploads
environment:
#- PUID=1000
#- PGID=1000
- PHP_TZ=Europe/Amsterdam
#- APP_NAME=Laravel
#- APP_ENV=local
#- APP_DEBUG=true
#- APP_URL=http://localhost
#- LOG_CHANNEL=stack
- DB_CONNECTION=mysql
- DB_HOST=lychee_db
- DB_PORT=3309
- DB_DATABASE=lychee
- DB_USERNAME=lychee
- DB_PASSWORD=YvtHW5FZg5U9Qnz7
#- DB_DROP_CLEAR_TABLES_ON_ROLLBACK=false
#- DB_OLD_LYCHEE_PREFIX=''
#- BROADCAST_DRIVER=log
#- CACHE_DRIVER=file
#- SESSION_DRIVER=file
#- SESSION_LIFETIME=120
#- QUEUE_DRIVER=sync
#- SECURITY_HEADER_HSTS_ENABLE=false
#- 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
#- PUSHER_APP_ID=''
#- PUSHER_APP_KEY=''
#- PUSHER_APP_SECRET=''
#- PUSHER_APP_CLUSTER=mt1
restart: unless-stopped
depends_on:
- lychee_db

touch: setting times of '/var/www/html/Lychee/public/sym/empty_file': Operation not permitted

I am trying to set up the lychee server on my Raspberry Pi 3 B plus via docker. The initial setup seems to complete without any error; however, the production run throws two errors.

Error 1: touch: setting times of '/var/www/html/Lychee/public/sym/empty_file': Operation not permitted
Error 2: touch: setting times of '/tmp/first_run': Operation not permitted

I thought it's a user permission error, so I changed the ownership of these files and folders recursively. But it's still throwing the same error. Below is the detail log.

Lychee Version: 4.3.4 (release)
Lychee Commit:  8d41c0f
https://github.com/LycheeOrg/Lychee/commit/8d41c0f928b3ffac8f07523a6b369f3daeee28df
-------------------------------------
**** Make sure the /conf and /uploads folders exist ****
**** Create the symbolic link for the /uploads folder ****
**** Create the symbolic link for the /sym folder ****
touch: setting times of '/var/www/html/Lychee/public/sym/empty_file': Operation not permitted
**** Create the symbolic link to the old Lychee-Laravel folder ****
**** Create the symbolic link for the database ****
**** Copy the .env to /conf ****
**** Inject .env values ****
**** Generate the key (to make sure that cookies cannot be decrypted etc) ****

**************************************
*     Application In Production!     *
**************************************

Command Canceled!
**** Migrate the database ****

Nothing to migrate.
touch: setting times of '/tmp/first_run': Operation not permitted

Here is my docker run command.

docker container run -v /mnt/dell_1000/lychee/conf:/conf \
        -v /mnt/dell_1000/lychee/uploads:/uploads \
        -v /mnt/dell_1000/lychee/sym:/sym \
        -e PUID=1001 \
        -e PGID=1001 \
        -e USER=rohit \
        -e PHP_TZ=America/New_York \
        -e DB_CONNECTION=sqlite \
        -p 890:80 \
        lycheeorg/lychee

Any suggestion would be helpful; thanks.

Upload with UI issue

Detailed description of the problem [REQUIRED]

A clear and concise description of what the bug is.
Issue when I upload file on UI

  1. Upload on photo
  2. Import from server

Upload work well with CLI

Steps to reproduce the issue

  1. Go to Add button and click on Upload photo
  2. Select 6 or more photo to 1Mb to 20MB

Output of the diagnostics [REQUIRED]

(Settings => Diagnostics or https://example.com/Diagnostics )

 Diagnostics
    -----------
    Info: Latest version of PHP is 7.4
    Warning: Using 32 bit PHP, recommended upgrade to 64 bit
    Warning: Dropbox import not working. dropbox_key is empty.

    System Information
    ------------------
    Lychee-front Version:      3.2.16
    Lychee Version (git):      bae5f2b (master) - Data not in Cache
    DB Version:                040000
    System:                    Linux
    PHP Version:               7.3
    PostgreSQL Version:        PostgreSQL 12.2 (Debian 12.2-2.pgdg100+1) on arm-unknown-linux-gnueabihf, compiled by gcc (Debian 8.3.0-6) 8.3.0, 32-bit
    
    Lychee total space:        66.60 MB
    Upload folder space:       8.00 B
    System total space:        6.86 GB
    System free space:         1.35 GB (19%)
    
    Imagick:                   1
    Imagick Active:            1
    Imagick Version:           1690
    GD Version:                2.2.5

    Config Information
    ------------------
    Mod_Frame_refresh:         30
    sorting_Albums_col:        max_takestamp
    sorting_Albums_order:      ASC
    version:                   040000
    check_for_updates:         0
    sorting_Photos_col:        takestamp
    sorting_Photos_order:      ASC
    imagick:                   1
    skip_duplicates:           0
    lang:                      en
    layout:                    1
    image_overlay:             1
    default_license:           none
    small_max_width:           0
    small_max_height:          360
    medium_max_width:          1920
    medium_max_height:         1080
    full_photo:                1
    delete_imported:           0
    Mod_Frame:                 1
    image_overlay_type:        desc
    compression_quality:       90
    landing_page_enable:       1
    landing_owner:             John Smith
    landing_title:             John Smith
    landing_subtitle:          Cats, Dogs & Humans Photography
    landing_facebook:          https://www.facebook.com/JohnSmith
    landing_flickr:            https://www.flickr.com/JohnSmith
    landing_twitter:           https://www.twitter.com/JohnSmith
    landing_instagram:         https://instagram.com/JohnSmith
    landing_youtube:           https://www.youtube.com/JohnSmith
    landing_background:        dist/cat.jpg
    thumb_2x:                  1
    small_2x:                  1
    medium_2x:                 1
    site_title:                Lychee v4
    site_copyright_enable:     1
    site_copyright_begin:      2019
    site_copyright_end:        2019
    additional_footer_text:    
    display_social_in_gallery: 0
    public_search:             0
    public_recent:             0
    recent_age:                1
    public_starred:            0
    downloadable:              0
    photos_wraparound:         1
    zip64:                     1
    map_display_public:        0
    map_provider:              Wikimedia
    force_32bit_ids:           0
    map_include_subalbums:     0
    map_display:               0
    share_button_visible:      0
    update_check_every_days:   3
    has_exiftool:              1
    import_via_symlink:        0
    has_ffmpeg:                1

Browser and system

Deploy with docker on Raspberry PI 3
All browser

Capture du 2020-05-11 09-15-06
Property photo example

Capture du 2020-05-11 09-15-33

Capture du 2020-05-11 09-15-56

ERROR unable to set 'upload_max_size'

I followed the https://github.com/LycheeOrg/Lychee-Laravel-Docker#advanced-configuration, and set a higher upload_max_size.
I'm still not able to upload >100M file, here is the error from /var/log/nginx/error.log

2020/02/24 20:09:59 [error] 75#75: *4 FastCGI sent in stderr: "Passing INI directive through FastCGI: unable to set 'upload_max_size'" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "localhost"

Problems with install and directory/files owners

I have installed Lychee-Docker in a NAS using docker (QNAP NAS with docker station).

I have created directories for /conf, /sym and /uploads, and mouented the corresponding volumes

The docker install script created the appropiate files and directories (/conf/.env,/uploads/thumb...).

But when I tried to run Lychee for the first time, the install script found problems /sym and /uplodas being not readable/writeable.

I have checked the ownership and /uploads and /sym are owned by lychee:lychee after being created by the docker script, shile /conf is owned by www-data:www-data.

I have changed the ownership of that directories and their subdirs to www-data:www-data, and the lychee install could progress.

Then there was a HTTP:500 page error then it directed me to the url http://lychee.somedomain/install/env.

I have checked file /conf/.env and ownership was lychee:lychee.
Everything seems to work OK when I changed that to www-data:www-data.

I am not sure if this is a bug in the docker install scripts.

I had previously installed Lychee-Docker without configuring the /conf,/uploads,/sym volume entry points (which creates docker volumes authomatically) and it worked OK.
But now I want to control where that files reside, and seems that the install script has some kind of bug.

BTW: How to install ufraw in Lychee docker container

How to add ufraw to a docker containter with Lychee. I tried a dockerfile method for alpinelinux:
RUN apk update && apk add ufraw ufraw-batch

however I got following error:

ERROR: unable to select packages:
ufraw (no such package):
required by: world[ufraw]
ufraw-batch (no such package):
required by: world[ufraw-batch]
The command '/bin/sh -c apk update && apk add ufraw ufraw-batch mc' returned a non-zero code: 2

Any help ???

p.s. Why it can't be included in the docker image by default ???

Please DO NOT forget to install ufraw, ufraw-batch in the released Lychee Docker Image.

Originally posted by @zhanglix in LycheeOrg/Lychee#564 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.