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



If you have questions, or if this solution doesn’t work or fit your use case, please reach out to us at Support so we can help figure it out with you.


Working with sensitive data, like HIPAA, Financial, or Personally Identifiable Information (PII)? 
    Then you will want to check out our QuotaGuard Shield solution, it's the same as QuotaGuard Static, but with stronger end to end security for your requests. We can also help migrate current Static customers to Shield for free, just reach out to us at Support to request assistance.