[tutorial] Raspberry Pi – Docker, Proxy, Let’s Encrypt, SUPLA, SUPLA-Scripts...

Esteta
Posts: 15
Joined: Wed Oct 24, 2018 9:32 pm

Mon May 13, 2019 8:41 pm

Problem się rozwiązał.
Okazuje się, że jeżeli do Cloud'a nie ma dodanych żadnych urządzeń, to nie da się połączyć ze Skryptów.
Sporo straconego czasu, ale przynajmniej nauczyłem się paru rzeczy :)
Dzięki za pomoc.
User avatar
lesny8
Posts: 821
Joined: Mon Dec 11, 2017 9:43 pm

Mon May 13, 2019 8:56 pm

A to nie tylko Ty jeden, bo ja też tego nie wiedziałem :)
superprzemo
Posts: 64
Joined: Thu May 09, 2019 6:52 am

Wed May 22, 2019 8:00 am

Witam,

Usiłuję uruchomić SUPLA na dosyć leciwego RP B (pierwsze modele z 2 USB), na karcie mam wgrane "Raspbian Stretch with desktop", postępuję według instrukcji z pierwszej strony i przy komendzie

Code: Select all

sudo apt-get install -y docker-ce=18.03.0~ce-0~raspbian –allow-downgrades
otrzymuję:

Code: Select all

Czytanie list pakietów... Gotowe
Budowanie drzewa zależności
Odczyt informacji o stanie... Gotowe
E: Nie udało się odnaleźć pakietu –allow-downgrades
Mam wgrane:

Code: Select all

Docker version 18.09.0, build 4d60db4
docker-compose version 1.24.0, build 0aa5906
Jeżeli pomijam krok downgrade, to przy próbie odpalenia SUPLA, mam takie coś:

Code: Select all

Starting SUPLA containers
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Co mam teraz zrobić, żeby ukończyć proces instalacji SUPLA na RP?
User avatar
lesny8
Posts: 821
Joined: Mon Dec 11, 2017 9:43 pm

Wed May 22, 2019 10:02 am

Daj dwa myślniki przed allow-downgrades, był błąd

Code: Select all

sudo apt-get install -y docker-ce=18.03.0~ce-0~raspbian --allow-downgrades
superprzemo
Posts: 64
Joined: Thu May 09, 2019 6:52 am

Wed May 22, 2019 10:56 am

Ok, poszło dalej, ale dostałem takie błędy przy .start/sh:

Code: Select all

pi@raspberrypi:~/docker-compose-letsencrypt-nginx-proxy-companion $ ./start.sh
d1e9a41c3485afc0a7a7478521c32006c70f08bcd59ad0979e1e2004d44af11e
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16292  100 16292    0     0  14215      0  0:00:01  0:00:01 --:--:-- 14228
Pulling nginx-web         ... done
Pulling nginx-gen         ... done
Pulling nginx-letsencrypt ... done
Creating nginx-letsencrypt ...
Creating nginx-web         ...
Creating nginx-gen         ...

ERROR: for nginx-letsencrypt  UnixHTTPConnectionPool(host='localhost', port=None                                                                                                 ): Read timed out. (read timeout=60)

ERROR: for nginx-web  UnixHTTPConnectionPool(host='localhost', port=None): Read                                                                                                  timed out. (read timeout=60)

ERROR: for nginx-gen  UnixHTTPConnectionPool(host='localhost', port=None): Read                                                                                                  timed out. (read timeout=60)

ERROR: for nginx-web  UnixHTTPConnectionPool(host='localhost', port=None): Read                                                                                                  timed out. (read timeout=60)

ERROR: for nginx-gen  UnixHTTPConnectionPool(host='localhost', port=None): Read                                                                                                  timed out. (read timeout=60)

ERROR: for nginx-letsencrypt  UnixHTTPConnectionPool(host='localhost', port=None                                                                                                 ): Read timed out. (read timeout=60)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain                                                                                                  debug information.
If you encounter this issue regularly because of slow network conditions, consid                                                                                                 er setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
docker.ps:

Code: Select all

pi@raspberrypi:~/docker-compose-letsencrypt-nginx-proxy-companion $ docker ps
CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS                              PORTS                                      NAMES
9ed25548a43a        arm32v6/nginx:alpine                     "nginx -g 'daemon of…"   4 minutes ago       Up About a minute                   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   nginx-web
2d40069cc694        jwilder/docker-gen                       "/usr/local/bin/dock…"   4 minutes ago       Restarting (1) About a minute ago                                              nginx-gen
1c8aa9b31d76        jrcs/letsencrypt-nginx-proxy-companion   "/bin/bash /app/entr…"   4 minutes ago       Restarting (1) About a minute ago                                              nginx-letsencrypt
Próba odpalenia SUPLA:

Code: Select all

pi@raspberrypi:~ $ ./supla-docker/supla.sh start
Starting SUPLA containers
WARNING: The PORT_HTTP variable is not set. Defaulting to a blank string.
ERROR: The Compose file './docker-compose.standalone.yml' is invalid because:
services.supla-cloud.ports is invalid: Port ranges don't match in length
Co teraz mam zrobić?
User avatar
lesny8
Posts: 821
Joined: Mon Dec 11, 2017 9:43 pm

Wed May 22, 2019 12:44 pm

superprzemo wrote:
Wed May 22, 2019 10:56 am
docker.ps:

Code: Select all

pi@raspberrypi:~/docker-compose-letsencrypt-nginx-proxy-companion $ docker ps
CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS                              PORTS                                      NAMES
9ed25548a43a        arm32v6/nginx:alpine                     "nginx -g 'daemon of…"   4 minutes ago       Up About a minute                   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   nginx-web
2d40069cc694        jwilder/docker-gen                       "/usr/local/bin/dock…"   4 minutes ago       Restarting (1) About a minute ago                                              nginx-gen
1c8aa9b31d76        jrcs/letsencrypt-nginx-proxy-companion   "/bin/bash /app/entr…"   4 minutes ago       Restarting (1) About a minute ago                                              nginx-letsencrypt
Na pewno nie zrobiłeś tego
lesny8 wrote:
Mon Dec 03, 2018 1:19 am

Jako, że uruchamiamy to na RPI musimy zmienić obraz dla dwóch kontenerów, aby działał na naszej architekturze sprzętowej, bo bez tej zmiany nie zadziała. Robimy to jak w tym commicie.
superprzemo
Posts: 64
Joined: Thu May 09, 2019 6:52 am

Wed May 22, 2019 1:23 pm

To mam w docker-compose.yml:

Code: Select all

version: '3'
services:
  nginx-web:
    image: arm32v6/nginx:alpine
    labels:
        com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    container_name: ${NGINX_WEB:-nginx-web}
    restart: always
    ports:
      - "${IP:-0.0.0.0}:${DOCKER_HTTP:-80}:80"
      - "${IP:-0.0.0.0}:${DOCKER_HTTPS:-443}:443"
    volumes:
      - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
      - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d
      - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html
      - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro
      - ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro
    logging:
      driver: ${NGINX_WEB_LOG_DRIVER:-json-file}
      options:
        max-size: ${NGINX_WEB_LOG_MAX_SIZE:-4m}
        max-file: ${NGINX_WEB_LOG_MAX_FILE:-10}

  nginx-gen:
    image: jwilder/docker-gen
    command: -notify-sighup ${NGINX_WEB:-nginx-web} -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
    container_name: ${DOCKER_GEN:-nginx-gen}
    restart: always
    volumes:
      - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
      - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d
      - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html
      - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro
      - ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
    logging:
      driver: ${NGINX_GEN_LOG_DRIVER:-json-file}
      options:
        max-size: ${NGINX_GEN_LOG_MAX_SIZE:-2m}
        max-file: ${NGINX_GEN_LOG_MAX_FILE:-10}

  nginx-letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: ${LETS_ENCRYPT:-nginx-letsencrypt}
    restart: always
    volumes:
	  - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
      - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d
      - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html
      - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:ro
      - ${NGINX_FILES_PATH:-./data}/htpasswd:/etc/nginx/htpasswd:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
    logging:
      driver: ${NGINX_GEN_LOG_DRIVER:-json-file}
      options:
        max-size: ${NGINX_GEN_LOG_MAX_SIZE:-2m}
        max-file: ${NGINX_GEN_LOG_MAX_FILE:-10}

  nginx-letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: ${LETS_ENCRYPT:-nginx-letsencrypt}
    restart: always
    volumes:
      - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
      - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d
      - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html
      - ${NGINX_FILES_PATH:-./data}/certs:/etc/nginx/certs:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      NGINX_DOCKER_GEN_CONTAINER: ${DOCKER_GEN:-nginx-gen}
      NGINX_PROXY_CONTAINER: ${NGINX_WEB:-nginx-web}
    logging:
      driver: ${NGINX_LETSENCRYPT_LOG_DRIVER:-json-file}
      options:
        max-size: ${NGINX_LETSENCRYPT_LOG_MAX_SIZE:-2m}
        max-file: ${NGINX_LETSENCRYPT_LOG_MAX_FILE:-10}

networks:
  default:
    external:
      name: ${NETWORK:-webproxy}
Coś jeszcze mam zmienić oprócz arm32v6/nginx:alpine?
User avatar
lesny8
Posts: 821
Joined: Mon Dec 11, 2017 9:43 pm

Wed May 22, 2019 1:57 pm

Tak, jak w commicie podlinkowanym wyżej.
Zmiań obraz dla nginx-gen i nginx-letsencrypt.
superprzemo
Posts: 64
Joined: Thu May 09, 2019 6:52 am

Wed May 22, 2019 2:14 pm

Ok, poszło dalej, w docker ps mam:

Code: Select all

pi@raspberrypi:~/docker-compose-letsencrypt-nginx-proxy-companion $ docker ps
CONTAINER ID        IMAGE                                                   COMMAND                  CREATED              STATUS              PORTS                                      NAMES
336f3e2714bc        wouterds/rpi-docker-letsencrypt-nginx-proxy-companion   "/bin/bash /app/entr…"   About a minute ago   Up 48 seconds                                                  nginx-letsencrypt
10f64b3244ea        wouterds/rpi-docker-gen                                 "/usr/local/bin/dock…"   2 minutes ago        Up About a minute                                              nginx-gen
9ed25548a43a        arm32v6/nginx:alpine                                    "nginx -g 'daemon of…"   4 hours ago          Up 4 hours          0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   nginx-web
Przy próbie odpalenia kontenerów mam:

Code: Select all

pi@raspberrypi:~ $ ./supla-docker/supla.sh start
Starting SUPLA containers
WARNING: The PORT_HTTP variable is not set. Defaulting to a blank string.
ERROR: The Compose file './docker-compose.standalone.yml' is invalid because:
services.supla-cloud.ports is invalid: Port ranges don't match in length
User avatar
lesny8
Posts: 821
Joined: Mon Dec 11, 2017 9:43 pm

Wed May 22, 2019 2:46 pm

Coś nie tak masz w plikach .yml
Przeczytaj jeszcze raz #4 i dostosuj pliki
Post Reply