My suspicion is that the secondary user that you are creating has an offline role, This requires the user to be able to register the service worker, so that the app is actually available online. Service workers won’t install of your connection is not secure - which yours isn’t.
To verify, can you please check if you have an error in your browser for failure to register service worker and nothing else afterwards?
Error bootstrapping DOMException: Failed to register a ServiceWorker for scope ('https://localhost:8444/')
with script ('https://localhost:8444/service-worker.js'):
An SSL certificate error occurred when fetching the script.
In case you’re running the developer environment, then you’ll need to use the Nginx Local-IP project, as you won’t have an cht-nginx container running.
Inside my cht-4-app-developer folder I ran CHT_COMPOSE_PROJECT_NAME=app-devl COUCHDB_SECRET=foo DOCKER_CONFIG_PATH=${PWD} COUCHDB_DATA=${PWD}/couchd CHT_COMPOSE_PATH=${PWD} COUCHDB_USER=medic COUCHDB_PASSWORD=password docker-compose up
But I got an error that port 443 was already in use. Therefore, I started the app with
@Ben_Kiarie - cool! Good job getting nginx-local-ip working.
I believe what happened is that when you started nginx-local-ip it bound to port 443. If you want to run it on a different port, check the troubleshooting section about “Port Conflicts”
I also noticed you ran APP_URL=http://192.168.0.3:5988 docker compose up, but I suspect that 192.168.0.3 is not the IP of your computer, but directly copied out of the “Run” section. This should be your local IP (which may be 192.168.0.3! but not likely ; )
Generally speaking, a happy path looks like this:
Install and get CHT Running. Get your IP and verify you can see the login on http. For me this is http://192.168.68.26:5988
Install nginx Local-IP. Using the IP and port from step #1, start it. For me this is APP_URL=http://192.168.68.26:5988 docker compose up
In the output of nginx Local-IP, check for this section with local-ip.medicmobile.org - it is the URL with a valid TLS cert for your CHT instance:
nginx-local-ip | /entrypoint.sh:
nginx-local-ip | --------------------------------------
nginx-local-ip | nginx-local-ip URL:
nginx-local-ip | https://192-168-68-26.local-ip.medicmobile.org
nginx-local-ip | --------------------------------------
nginx-local-ip | /entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
The slightly less happy path is when you have a port conflict in step #2. For example, if I already another service running on 443, I would use this call (remember, your IP will be different than my 192 one!): HTTP=9080 HTTPS=9443 APP_URL=http://192.168.68.26:5988 docker-compose up. Note that nginx Local IP will give you the full URL back to you to use, including port: