Is it possible to whitelist Heroku apps? - heroku

I have a Heroku application that binds with a telco sms gateway via SMPP
The telco guys need to whitelist IPs for my app to connect.
I am aware of the new addon proximo, but it's just insanely priced. So that option is out.
Is there a subnet or a list of IPs that I can get whitelisted and is there a guarantee that all requests from my app will originate from tose IPs?
I found this https://api.heroku.com/vendor/logplex/allowlist.
Is that only for syslog or all apps make a request from one of those IPs?
Thanks

There is now a Heroku add-on that does this called Proximo: https://addons.heroku.com/proximo

The Heroku docs specifically mention how dynos don't have static IP addresses. Even when using custom domains it looks like they want you to point to a CNAME record rather than an IP address. So if you need a static IP it looks like Proximo is your best bet.
Would it be possible to use an API token to authenticate your app with the sms gateway, similar to the way the blitz.ip plugin works with heroku? Then you might not need to use a static IP whitelist.
This question looks to be doing something similar to you, and this answer suggests using a hosted VPN service. Would that work?

Heroku now has Private Spaces which is what you are looking for:
https://www.heroku.com/private-spaces

Another Heroku addon option is Quotaguard , in beta, free for now.

Answering my own question. Even though an external VPN or the proximo addon are a solution in case you want to whitelist a Heroku app, I have decided to go for the simpler option and host the SMPP binding service of my app on ec2 using an Elastic IP

You can host a proxy yourself using Dockhero Heroku add-on - https://dockhero.io/ - which has a static IP (AWS elastic IP).
Install the add-on and the CLI plugin:
$ heroku addons:create dockhero
$ heroku plugins:install dockhero
Wait until the provisioning is done and get DOCKHERO_HOST environment variable
$ heroku dh:wait
$ heroku config:get DOCKHERO_HOST
--> e.g. dockhero-spherical-42047.dockhero.io
Create dockhero-compose.yml file with the following contents:
version: "2"
services:
proxy:
image: tecnativa/tcp-proxy
environment:
LISTEN: ":80"
TALK: "www.wikipedia.org:80"
ports:
- "80:80"
Here www.wikipedia.org:80 is the server which you build a proxy for.
Find more about the syntax in https://docs.docker.com/compose/compose-file/compose-file-v2/
Run this stack in the cloud using Dockhero CLI:
$ heroku dh:compose up -d
Any requests to the host from DOCKHERO_HOST Heroku config var will now be proxied according to your dockhero-compose.yml
$ curl http://dockhero-spherical-42047.dockhero.io/
--> <response from www.wikipedia.org>
IMPORTANT: as of writing this, dockhero.io is in Beta and available for free. When switching to production, the assigned IP may be changed after a prior notification.

Fixie is another alternative add-on not mentioned here. Free plan with 500 requests per month. Requires some adjustments in code and heroku app to be in us region (or you can migrate it: Migrating an Application to Another Region). Worked for me.

Related

How to Provision APIs on Heroku

Please forgive my question. I am a complete newbie at this.
I have built an API in spring boot and I have pushed it to heroku.
I have a custom domain for my website already as www.mywebsite.com
I want to provision my apis under this domain as well as api.mywebsite.com
How can I achieve this on heroku?
Any help on how to go about this would be sincerely appreciated.
Thanks
I will assume that you have full access to the Namecheap account.
You have 2 options:
A. Use Heroku CLI
B. Use Heroku interface (Web application)
A) Let's go through the process with Heroku CLI.
Make sure that you have the Heroku CLI installed (macOS: brew install heroku, Ubuntu: apt install heroku, etc.)
Add your domain using the command heroku domains:add api.website.com (if you have multiple apps, don't forget at the end of the command to add --app name-of-your-heroku-app.
Heroku will generate for you a DNS target for the custom domain you added at step 2. Run heroku domains and copy the DNS target (The DNS target looks like this: whispering-willow-5678.herokudns.com)
Open your Namecheap domain settings and add a CNAME (Name: "api" and Target: the DNS target provided by Heroku).
Wait few minutes up to few hours.
B) If you want to use Heroku Interface / Webapplications.
Open your app on www.herokuapp.com
Go to "Settings" tab
Scroll down to "Domains"
Click on "Add domains"
Add your subdomain (api.website.com)
Heroku will generate for you a DNS Target
Navigate to your domain settings in Namecheap and create a new CNAME using your subdomain (e.g. api) as name and the DNS target provided by Heroku as target.
You can find all the details in Custom Domain Names for Apps Heroku Documentation

Is it possible to deploy more then one Strapi.io app on the same Heroku dyno?

I read more tutorials about deploy Strapi to Heroku and all of them talks about deployng your Strapi app to Heroku. But in addition I would like to understand if it is possible to deploy for example 2 different Strapi applications, to the same Heroku dyno and if it has any disadvantage or not.
Yes, it's possible.
You need to use Nginx Virtual Host as defined in Strapi Nginx Proxying documentation.
It's mentioned in Amazon AWS part of the documentation.
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-with-http-2-support-on-ubuntu-18-04

Creating static IP for heroku to connect to external firewall

I'm trying to connect to ObjectRocket with my Heroku app, I'm running into a little problem where I can't seem to set a static IP (tried Proximo for that).
ObjectRocket requires me to define all IP's connecting to the database, so I need a non-dynamic IP for my heroku app.
How could I create this, or is this not possible with Heroku?
Hello you can use this answer to see how to use NGINX as a reverse proxy.
https://stackoverflow.com/a/27874505/1345865
http://blog.talenox.com/post/107675614745/how-to-setup-static-ip-on-heroku
If in your case where you require a outbound reverse proxy, setup an AWS instance and use NGINX to point it to ObjectRocket as your backend

DNS routing not working on Heroku app

I'm trying to setup a custom domain for my Heroku Cedar stack app, but it's not working.
I've tried entering 'host www.mydomain.com' command' in Terminal, but it yields no output.
I've already changed my DNS settings and added a 'CNAME' host: www, direct to: my domain.herokuapp.com but still it's not working.
What could I be doing wrong here???
Thanks,
Faisal
The fact that you're not getting any results in terminal for host then the problem lies with your DNS settings - it sometimes takes a while for updates to propogate across the internet, I usually allow for 24 hrs to be sure. If it still doesn't work then you should get in touch with your DNS host.
You also have to add domain entries to your Heroku app:
heroku domains:add yourdomain --app yourapp
The "-app yourapp" is not required if you are in the root directory of your Rails app.
You can repeatedly add more than one domain to your Heroku app.
Here is an article about adding custom domains and DNS setup, at the Heroku Dev Center:
https://devcenter.heroku.com/articles/custom-domains

Use Heroku with register.com

I have a free app hosted on Heroku, and a domain on register.com. How can I connect the two? I am OK with using any service or addon, as long as it is free. The only stipulation is that I can not spend ANY money. I also want to be able to have an m subdomain for a mobile site. Thanks
Follow the instructions to configure custom domains.
You just need to install the free custom_domains addon.
$ heroku addons:add custom_domains
Then add the domains
$ heroku domains:add www.example.com
Then, don't forget to update the DNS settings on your domain provider to point to Heroku IP.

Resources