Restrict website access to specific location - geolocation

I am working on a personal website that I would like only accessible to people in my town. I was thinking of somehow using the IP address of the person accessing the site or having them verify their address but that seems too complex. It would be great if someone could point me in the right direction.
Thanks!

Related

How to check to see if you are hosting correctly on GCP?

I recently made the jump to hosting on GCP and haven't been able to get my homepage to work. My website is made using Ruby on Rails, I've added the cname to the dns field in Google domains, and made the pages I need publicly visible in GCP, but I don't get anything. This is my first time using GCP I got it to work with AWS, but my mailing service didn't work as well with it. Any chance someone could offer some advice or insight?
From your description, I gather you have your domain parked in Google Domain. Where are your A, NS, SOA records? You need to have these configured correctly for your site to work.
For your email to work, you need to ensure your MX records are pointed to your mail server correctly.
Have you configured your DNS Zone in Google Cloud console? Check A, NS records for website to work.
Where is your MX record configured? (For emails to work)
Have you configured these?
Google Cloud Console > Networking > Network Services > Cloud DNS
Where is your mail hosted?
This elaborate Google Docs might help.
Ideally all ISPs provide elaborate and detail docs on configuring MX records.
More info from your end would definitely help us point you in the right direction.

Cross country development, change IP address

I am developing sites that will be used in various different countries. The code looks at the originating ip address to determine where they are coming from. I change currency etc based on this.
My problem is testing the functionality in the browser. I have had a look at the geolocator tools in firefox and chrome but these don't change the ip address to the country.
Are there any tools that I can use, preferably without installing something, whereby I can set the ip address to be coming from a different country? I have tried setting the proxy values in the internet options but this doesn't seem to work either.
Thanks
There are several proxy services that will allow you to accomplish your goal.
You can use the Tor Browser / Onion Router proxy for free. Here is a video that shows you how to choose your country. https://www.youtube.com/watch?v=5iLCgRHp_2k

Identifying unique browsers in Rails

I am building a multiplayer site in Rails, and I need a reliable way of blocking computers from using the site. For example, someone has been banned from the site multiple times, and there should be a way to block their computer from using the site.
I would find a way to do this with IP addresses but they're not always static are they? Also I'm asking about identifying browsers so that if there was unauthorised access from a different browser or machine, then I could implement a security feature to make sure the account belonged to them. I would also need to store these locations as trusted locations in a database, hashed.

Is there a way I can block access to my website by country?

I would like to block access to my web site from some countries. The reason is that I suspect they are stealing the information from the site and copying for their own sites.
Is there a way I can block access from certain countries or even better redirect users accessing my site from these countries to a very plain web page that makes it look like the site is under construction.
Note that my site uses MVC3. I am looking for a .net solution or some IIS solution if that's not possible.
You could setup the free GeoLite Country database at yours and check each IP address (HTTP remote address of the visitor) against it and then decide what to do.
Another way would be to reverse-lookup the IP addresses, but then again, which country is a visitor with a hostname ending in .net from?
Finally, be aware that there are free proxy servers out there, so if someone really wants to fake his "country", he easily can do.

how to restrict a web portal to a particular computer?

I am in the process of creating a Ruby on rails portal
This portal requires a lot of data feeding by the site owner's back-office personnel.
My client has this problem :
the office staff should not be able to access the back office interface from any other than his office computers
I have no idea how to achieve this. Is there a method for this?
Thanks in advance.
Edit:
Is tracking the Mac address a good solution.? is it possible if a ok?
I don't think that you should do anything in rails - this should be configured elsewhere. If rails is running on Apache then see mod_access.
The best way to set this up is to have the app hosted INSIDE the organisation's firewall. Best option - server lives inside the company on a subnet isolated entirely from direct internet access.
If you currently host outside the company, you can set up a firewall that prevents access from unknown IP addresses. You would only accept requests that come from the company's IP ranges. Ideally, you do this at the host/operating system level.
If that can't work, you can do add to your Rails authentication - detect the IP address of the request and if it is not in the company range, prevent access.
found a solution. Using a java applet one can access the machine's hardware details including MAC address. am using this idea.

Resources