Q: How can I use .qgtunnel for Separate Environments?
Update for July 2021:
If you are using the recent versions of QGTunnel (after July 2021), then you can use the QGTUNNEL_CONFIG environment variable in lieu of the .qgtunnel file.
As a best practice, we recommend the above solution, as well as, downloading the most recent QGTunnel software.
The below solutions also continue to work as well.
Option A) If you are using transparent mode, you can put all your endpoints in the same .qgtunnel file and it will work.
Transparent mode will create DNS records for all records in the .qgtunnel file and then when you go to connect to your endpoint it will match and do the right thing. Those that belong to the other environments will just never be called/matched.
Option B) Add a launch script and then use environment variables to dynamically build the .qgtunnel file.
Example:
#!/bin/bash echo "$QGTUNNEL_CONTENT" > .qgtunnel bin/qgtunnel $@
Then if you set your Procfile to run this script (say bin/qglaunch) instead of bin/qgtunnel, it should be successful.
For example:
web: bin/qglaunch your-application your arguments