lando / lando

A development tool for all your projects that is fast, easy, powerful and liberating
https://lando.dev
GNU General Public License v3.0
4.07k stars 543 forks source link

Trying to get Lando working on Synology NAS #3354

Closed Vandaahl closed 2 years ago

Vandaahl commented 2 years ago

I have a Synology Diskstation NAS and I managed to compile Lando for it (that was the easy part, surprisingly). I initialised a basic LAMP application and it was created without issue. However I can not connect to it. I think it has to do with networking, which I don't know much about. Some details:

I named my app 'syno' and the appserver URL's are:

https://localhost:49155
http://localhost:49156
http://syno.lndo.site/
https://syno.lndo.site/

My lando file:

name: syno
recipe: lamp
config:
  webroot: .
services:
  appserver:
    scanner: false
  database:
    scanner: false

When I curl -I syno.lndo.site, I get a 502 Bad Gateway response. When I curl -I localhost:49156 it returns curl: (56) Recv failure: Connection reset by peer. I run these curl commands on the docker host (i.e. the NAS via ssh).

I have made sure ports 80 and 443 are not in use by my NAS. I have some other (non-Lando) docker test apps and they work fine on port 80. I also have a simple Traefik container which also works as expected.

Here is the NAS gui showing the docker networks used by my 'syno' lando app. Any idea what I can try to resolve this?

Screenshot 2022-03-16 at 15 17 14

reynoldsalec commented 2 years ago

@Vandaahl ah I don't know too much about the networking side of things either. The Lando Traeffic proxy is what is providing the URLs you mentioned served on :80, I'm kind of surprised if you have other traefik proxies that are working that the Lando proxy isn't working.

Have you read all the docs on the Lando proxy? https://docs.lando.dev/config/proxy.html#proxy

Your best bet after that is asking on Slack where someone with more networking skillz might understand.

Would be curious what the answer is when you figure it out...this is pretty far outside of normal use cases but sounds cool!

Vandaahl commented 2 years ago

Alright it appears there were 2 problems.

Problem 1: I checked the appserver logs and noticed apache was generating an error. So I swapped the LAMP recipe with the LEMP recipe and than I was able to curl the app successfully on the NAS itself. Good times! I will have to investigate further into what's wrong with the apache container.

Problem 2: After problem 1 was solved, I was getting a ERR_CONNECTION_REFUSED error when trying to access the app in my browser on another computer in the same network. I added bindAddress: 0.0.0.0 to ~/.lando/config.yml, rebuild the Lando project and the problem was solved.

Very happy with this progress so far!

Vandaahl commented 2 years ago

I've done some further digging. It looks like my Synology nas has a really old linux kernel (3.10.108) that is not supported by recent Apache releases: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978045

Apache version 2.4.39 is working however. I'll have to specify this version when using the LAMP recipe:

name: lamptest
recipe: lamp
config:
  webroot: .
  php: 5.6
  apache: 2.4.39
Mewgood commented 1 year ago

Can you make a guide for getting Lando (and devilbox perhaps) up and running on a Synology?

Vandaahl commented 1 year ago

Can you make a guide for getting Lando (and devilbox perhaps) up and running on a Synology?

Make sure you have docker and node installed though the app store on version 7+ of the Synology operating system. Follow this guide to setup docker and docker-compose: https://www.smarthomebeginner.com/synology-nas-docker-media-server-2022/

Then you need to follow the official build instructions: https://docs.lando.dev/getting-started/installation.html#from-source. You don't need yarn on line 5 of the instruction script, instead you can use the command 'npm install'. Run the commands from an SSH session on your Synology.