SSL, Let's Encrypt, kobo-install, "Waiting for environment to be ready"

Hello!

I’ve been reviewing forum posts and have run into a very common problem (it seems) with kobo-install and getting Let’s Encrypt and SSL certificates to work.

I’m deploying on a fresh Ubuntu 22.04 LTS instance, with the latest Docker installed.

I’m trying to install with configs for a server, with Let’s Encrypt for SSL / HTTPS. I’m using the defaults for all the configs, except with these domains.

# Choose between http or https
PUBLIC_REQUEST_SCHEME=https
# The publicly-accessible domain where your KoBo Toolbox instance will be reached (e.g. example.com).
PUBLIC_DOMAIN_NAME=opencontext.org
# The private domain used in docker network. Useful for communication between containers without passing through
# a load balancer. No need to be resolved by a public DNS.
INTERNAL_DOMAIN_NAME=opencontext.internal
# The publicly-accessible subdomain for the KoBoForm form building and management interface (e.g. koboform).
KOBOFORM_PUBLIC_SUBDOMAIN=kform
# The publicly-accessible subdomain for the KoBoCAT data collection and project management interface (e.g.kobocat).
KOBOCAT_PUBLIC_SUBDOMAIN=kcat
# The publicly-accessible subdomain for the Enketo Express web forms (e.g. enketo).
ENKETO_EXPRESS_PUBLIC_SUBDOMAIN=kenketo

I two get stuck with the endless, cryptic, and “Waiting for environment to be ready”.

To check if there was some sort of firewall or networking problem, I installed checked that my server could indeed support Nginx port 80 + 443, and Let’s encrypt using this GitHub - evgeniy-khist/letsencrypt-docker-compose: Set up Nginx and Let’s Encrypt with Docker Compose in less than 3 minutes with a Docker Compose project, which automatically obtains and renews free Let's Encrypt SSL/TLS certificates and sets up HTTPS in Nginx for multiple domain names and a simple CLI configuration management tool.

That worked. So no firewall problem.

But when I do the python3 run.py --setup command, I eventually bomb out here:

init-letsencrypt.sh: line 34: run: command not found
init-letsencrypt.sh: line 43: up: command not found
init-letsencrypt.sh: line 47: run: command not found
init-letsencrypt.sh: line 70: run: command not found
init-letsencrypt.sh: line 81: exec: nginx_ssl_proxy: not found
### Downloading recommended TLS parameters ...

### Creating dummy certificate for kform.opencontext.org,kcat.opencontext.org,kenketo.opencontext.org ...

### Starting nginx ...

### Deleting dummy certificate for kform.opencontext.org,kcat.opencontext.org,kenketo.opencontext.org ...

### Requesting Let's Encrypt certificate for kform.opencontext.org,kcat.opencontext.org,kenketo.opencontext.org ...

### Reloading nginx ...
An error has occurred

I then try to re-run the python3 run.py --setup command, then I get that same error after being prompted to replace the (dummy) SSL certificates.

I even tried moving the SSL certificates generated from letsencrypt-docker-compose into the ../nginx-certbot/data/certbot/conf/live. That worked to some extent, except enketo_express connections failed, and I could never see a working form.

So I really want to use the preferred Kobo way of setting up HTTPs on my server. I got all of this to work in 2019, but the setup is very different now, and for the life of me I can’t figure this out, especially since there are so many confusing posts on this forum with no clear solution even though many other people have encountered similar issues.

Please help!!

I think I figured out the problem. The init-letsencrypt.sh script expects docker-compose, which is the obsolete / deprecated way of invoking docker compose. My version of docker compose (v2.18.1) expects docker compose.

As a workaround, I added a script to my server that mimics the old docker-compose command (see: How to alias docker-compose to docker compose? - Stack Overflow), and that seems to have resolved the problems with HTTPS / Let’s Encrypt in the setup!

Anyway, I filed a ticket here to fix kobo-install to support docker compose not just the old form of docker-compose with the deprecated dash.