Google App Engine: Assigning domain names to specific paths of your app - google-app-engine

I'm building a website for a client who wants to showcase his company's products.His company has like 5 sub companies. For example, his company is called Nazzy industries (named after Nazzy his endeared grandmama). Nazzy Industries has 5 sub-companies. One distributes snacks, one sells safety equipment, one sells cars.
I"m going to build a large website but I may want to serve sub companies in their own domains in the future. Is this possible?

This is possible with a little workaround.
You need to first verify ownership of all the domain names (through the google cloud console). Console > AppEngine > Settings > Custom Domains
In the application you will need to check from which domain the request is incoming. All languages should support that already, a simple thing.
This information is not verified from zero to production. But almost sure this can be done this way.

For both Standard and Flexible you set up your domain names in Products & Services > App Engine > Settings > Custom Domains using wildcards and subdomains in following ways:
Have services named cars, snacks, etc, which will be mapped to cars.nazzy.com, snacks.nazzy.com, etc.
Later you can separate them to different domains, like: ncars.com, nsnacks.com .
You can set it up in one way and then transition to the other without changing code or configuration of your applications at all.

Related

Is it possible to restrict google authentication to specific group of users?

I have recently used omniauth-google-oauth2 gem in one of my rails 5 application for authenticating users, and it is working fine. The application is intended for specific group of users, in my case students of a university. All users have a google account with email addresses ending with #ait.asia or #ait.ac.th.
Is it possible to restrict authentication to only above mentioned users. i.e. only users with email addresses ending with #ait.asia or #ait.ac.th?
You can pass a list of Google Apps hosted domains to the hd option when you are adding the OmniAuth middleware to your application.
So, in your case, you can make a initializer like this:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2,
ENV["GOOGLE_CLIENT_ID"],
ENV["GOOGLE_CLIENT_SECRET"],
hd: %w(ait.asia ait.ac.th)
You can see a complete list of the configuration options here

What countries and territories is Google App Engine currently blocked in?

I run a website that allows you to hire a journalist anywhere in the world, and we have correspondents in 150 countries. It's hosted on App Engine, and occasionally we get a journalists emailing us to say that our site is not available from where they are. The specific error is:
Your client does not have permission to get URL xxx from this server.
(Client IP address: x.x.x.x)
We're sorry, but this service is not available in your country. That’s
all we know.
The locations we have identified so far are: Cuba and Crimea.
I can't find a complete list anywhere, but I really need one. Any suggestions?
There is not an official list. I would recommend using this list until one specifically for App Engine is created.
Google restricts access to some of its business services in certain countries or regions, such as Crimea, Cuba, Iran, North Korea, Sudan, and Syria.

How to forward domain requests to gae url

I have different customers who own each their own hosted saas page on my gae app. for example:
myapp.appspot.com/customer/123
myapp.appspot.com/customer/456
each of the customers may want his domain name for example theBigDomain.com to "invisibilly" forward to myapp.appspot.com/customer/123
Please notice I want theBigDomain.com/myservlet?id=theId#aBookmarkUrl to be transmitted to the target url as myapp.appspot.com/customer/123/myservlet?id=theId#aBookmarkUrl
I searched for the google documentation and I can't find a way to do that.
Note: I don't want a redirect where the person who types theBigDomain.com finds he's not there anymore, and I don't want a frame to include my url in the theBigDomain.com since I want the user to be able to click on the back button.
In short, I want the domains to work as proxies, knowing that from what I know, proxies are not good for some content, for exampe, if my target link has a youtube video, this might not work. So I'm asking if there is a way to do a dns redirect for a url and not a domain???
Using subdomains is also limited: creating a subdomain for each customer will be a tedious work...
Using subdomains is also limited: creating a subdomain for each customer will be a tedious work...
How so? This could actually be a lot easier for you/your customers since your customers wouldn't have to deal with domain verification/DNS settings and all you would need to do is add one * (wildcard) host to your main domain pointing to ghs.googlehosted.com and adding *.yourdomain.com in your GAE apps's settings. In your app, in your framework of choice you would then see what subdomain the request came to and and handle it as the customer's unique id (instead of 123/456). See here how you would determine the subdomain on python/webapp2. If you're using a different combination of language/framework - there are alternatives functions as well.
If you still want the customers to use their own domains then it gets a little more complicated. First, they need to provide the full domain name to you, you then add it to your GAE app's settings. Next, you and your customers need to follow one of the verifications steps listed on this page: https://support.google.com/a/answer/60216?hl=en and once that is complete you would need to ask your customers to create a CNAME record on their domains/subdomains pointing to ghs.googlehosted.com. Once the CNAME record is created, you would handle this just like the if these were subdomains on your own domain, i.e. in your framework determine what domain the request came to and handle it as a customer's unique ID to serve that customer's app.

Validating Sender Addresses in Appengine

My app needs to send emails from several addresses: noreply#, accounts# and support#, for instance. Now I'm setting up country-specific domains.
To send emails from Appengine, the sender address has to be a registered admin. To become an admin, you need to have a Google Apps account. But it appears you can't use aliases ("nicknames") - when you click the invite link, you have to log in, which you can't do as an alias. I think this also means I can't set up the country-specific domains as alias domains in Google Apps.
I'm not a cheapskate, but paying $50 per account (three accounts times five domains - $2,250) per year purely to validate the sender addresses is a bit rich. Am I missing something blindingly obvious?
Unfortunately that's how it currently works.
From what I understand GAE team is working on alternate solutions and while they figure out something they offer an AppEngine credit.
But that only works once per App.
We handle this by using an external service (SendGrid, that introduced a pay-as-you-go offer with the same pricing as AppEngine). However if you want full DKIM or other features it becomes much more expensive.

CakePHP multisite (like WPMU + domain mapping)... possible?

So I'm just starting to play with CakePHP and was wondering if the following was possible:
A single install of Cake, with a super admin login. Then, admins that have access to specified "sub sites", and the ability to create/edit content and users on those sub sites. Finally, the ability to map domain names (not subdomains, but unique domains) to the routes; so instead of mysite.com/subsite/posts/1 it would just be newdomain.com/posts/1
Essentially, I'm looking to replicate the experience of using Wordpress Multi-user (with domain mapping).
Is this possible? If so, what should I be looking into?
Sure. You can even use the same set of code and just configure certain domains to point to the code. Then in the code base, tie a domain ID to each user and the content so it knows where it belongs. You can have admin users belong to all domains. Then when you add regular users, you can specify what domain they belong to.
You could establish the domain checking in the Config/bootstrap.php and then set the configuration for the domain like so:
Configure::write('domain_id', 'someDomainSpecificID');
Then you only have to maintain one set of code and one database from many domains.
If the domains have to be physically separate, you could set up one location for the ADMIN users (single database) and run everything against that.
There are many ways you could architect it, it just depends on what your specific needs are. It sounds like a cool project though.

Resources