Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading from v4 to v5 to v6 #214

Open
ironicbadger opened this issue Jan 2, 2025 · 14 comments
Open

Upgrading from v4 to v5 to v6 #214

ironicbadger opened this issue Jan 2, 2025 · 14 comments

Comments

@ironicbadger
Copy link

ironicbadger commented Jan 2, 2025

I attempted to upgrade yesterday from v4 to v5 but all the thumbnails dissapeared and no files would load in the new v5 interface - I didn't even try v6.

Could you provide some migration instructions from 4.13 -> +onwards please? Running via docker if it helps - compose.yaml.

Running instance is at https://gallery.ktz.cloud.

Thanks!

@ildyria
Copy link
Member

ildyria commented Jan 2, 2025

Skip version 5 all together.
Go directly to version 6.

I see that you are using traefik, you need to forward the proto. As follow is part of my docker compose:

    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.photography.rule=Host(`photography.viguier.nl`)"
      - "traefik.http.routers.photography.entrypoints=websecure"
      - "traefik.http.routers.photography.tls.certresolver=myresolver"
      - "traefik.http.middlewares.https-photography.headers.sslproxyheaders.X-Forwarded-Proto=https"
      - "traefik.http.routers.photography.middlewares=https-photography"

@ildyria
Copy link
Member

ildyria commented Jan 2, 2025

BTW looking at your traefik setup:

This is bad practice:

      - /var/run/docker.sock:/var/run/docker.sock:ro

If traefik is compromised your all server is F***.

Here is some reading material : https://github.com/wollomatic/socket-proxy :)

@ildyria
Copy link
Member

ildyria commented Jan 2, 2025

Also there is a change in the volumes. Here is some details (I think you can infer what needs changing):

    volumes:
      - ${PATH_TO_FILES:-.}/lychee/conf:/conf
      - ${PATH_TO_FILES:-.}/lychee/uploads:/uploads
      - ${PATH_TO_FILES:-.}/lychee/sym:/sym
      - ${PATH_TO_FILES:-.}/lychee/logs:/logs
      - ${PATH_TO_FILES:-.}/lychee/tmp:/lychee-tmp

@ildyria
Copy link
Member

ildyria commented Jan 2, 2025

I would also suggest to use doozle https://dozzle.dev/ It is very very nice to get the logs of your container in real time.

@ironicbadger
Copy link
Author

- "traefik.http.middlewares.https-photography.headers.sslproxyheaders.X-Forwarded-Proto=https"

traefik is my edge TLS termination so this is unnecessary?

so what you're saying about lychee is that it's a straight upgrade from 4.13 to 6 once the volumes have been finagled?

@ildyria
Copy link
Member

ildyria commented Jan 2, 2025

traefik is my edge TLS termination so this is unnecessary?

This still necessary for Lychee to know which kind of prefix to use: http or https in the links.

so what you're saying about lychee is that it's a straight upgrade from 4.13 to 6 once the volumes have been finagled?

In theory yes.

@ironicbadger
Copy link
Author

Unfortunately I see the same type of issue with a straight jump to v6. Logs appear to be happy the migrations were all conducted successfully, alas the gallery has no images anymore.

You can see what I mean here.

services:
...
  ktz-lychee:
    image: lycheeorg/lychee:v6.2.0
    container_name: ktz-lychee
    volumes:
      - "/opt/appdata/ktz-lychee/app/config:/conf"
      - "/opt/appdata/ktz-lychee/app/uploads:/uploads"
      - "/opt/appdata/ktz-lychee/app/sym:/sym"
      - "/opt/appdata/ktz-lychee/app/logs:/logs"
      - "/opt/appdata/ktz-lychee/app/tmp:/lychee-tmp"
    labels:
      - traefik.enable=true
      - traefik.http.routers.ktzlychee.rule=Host(`gallery.ktz.cloud`)
      - traefik.http.routers.ktzlychee.tls.certresolver=cloudflare
      - traefik.http.middlewares.ktzlychee.headers.sslproxyheaders.X-Forwarded-Proto=https
      - traefik.http.routers.ktzlychee.middlewares=ktzlychee
    environment:
      - "PHP_TZ=America/New_York"
      - DB_CONNECTION=mysql
      - DB_HOST=ktz-lychee-db
      - DB_PORT=3306
      - "DB_USERNAME=1234"
      - "DB_DATABASE=1234"
      - "DB_PASSWORD=1234"
    depends_on:
      - ktz-lychee-db
    restart: unless-stopped
  ktz-lychee-db:
    image: mariadb:10.5.5-focal
    container_name: ktz-lychee-db
    volumes:
      - "/opt/appdata/ktz-lychee/db:/var/lib/mysql"
    environment:
      - "MYSQL_ROOT_PASSWORD=1234"
      - "MYSQL_PASSWORD=1234"
      - "MYSQL_DATABASE=lychee"
      - "MYSQL_USER=lychee"
    restart: unless-stopped

@ildyria
Copy link
Member

ildyria commented Jan 2, 2025

I see, go to your lychee .env file (in the config folder), look for the APP_URL and set to empty string: APP_URL= that will fix it. Or in your docker-compose:

    environment:
      APP_URL=gallery.ktz.cloud

And you should be back on track.

@ironicbadger
Copy link
Author

Oh. Well there we are. Any need to supply https or not?

@ildyria
Copy link
Member

ildyria commented Jan 2, 2025

I would supply it :)

PS: if you edit directly the .env file in config/ you do not need to redeploy, the changes are pretty much immediate.

@ironicbadger
Copy link
Author

ironicbadger commented Jan 2, 2025

There is some kind of bug / weirdness with how that is parsed.

Errors
error
APP_URL (https://gall*********loud) does not match the current url (http://gall*********loud).
error
APP_URL (https://gall*********loud) does not match the current url (http://gall*********loud).

If I supply - "APP_URL=https://gallery.ktz.cloud" I get the error message above (but the images work). If I remove the https:// prefix, images break but the warning goes away.

The traefik middleware lines are unnecessary too.

@ildyria
Copy link
Member

ildyria commented Jan 2, 2025

Yes, that is why the proto forwarding is needed. See here: #214 (comment)
So that Lychee knows that you are using https.

They may be unnecessary for basic setup, but are necessary to enable WebAuthn.

@ironicbadger
Copy link
Author

The built-in diagnostics state the same error regardless of whether I include those lines for traefik or not.

@ildyria
Copy link
Member

ildyria commented Jan 2, 2025

Interesting. That should not be the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants