Restricting Access to tracks by IP

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Restricting Access to tracks by IP

Samy Jeevan Karloss Antony
Hi,

I want to have two versions of genome annotation in one installation. But, one's access should be restricted only to certain IP address.
Another one is open to everyone.

Any suggestions?

Google search didn’t bring any answers so far.

Jeevan
------------------------------------------------------------------------------
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Restricting Access to tracks by IP

wesbarris
There is a way to restrict tracks based on IP address.  There may be other ways but this is how I have done it:

1) Include this in your main .conf file:

init_code = use lib '/htdocs/gbrowse/gbrowse.conf';
                      use init_code;

2) Create "init_code.pm" and include code similar to the following modifying to suit your needs:

package init_code;
use strict;
sub myRrestrict {
   my ($ip) = @_;
   $ip =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;
   return 1 if ($1 == 123 && $2 == 456);
   return 1 if ($1 == 123 && $2 == 789);
   return 0;
   }
1;

3) Include the following in your track definition:

restrict      = sub { return &init_code::myRestrict(@_); }


I no longer have a working version of this.  The information above is from notes and former code.  It is possible that I may not have the syntax precisely correct but it should be really close to what once worked for me.
--
Wes Barris

-----Original Message-----
From: Jeevan Karloss Antony Samy [mailto:[hidden email]]
Sent: Monday, November 28, 2016 6:19 AM
To: [hidden email]
Subject: [Gmod-gbrowse] Restricting Access to tracks by IP

Hi,

I want to have two versions of genome annotation in one installation. But, one's access should be restricted only to certain IP address.
Another one is open to everyone.

Any suggestions?

Google search didn’t bring any answers so far.

Jeevan
------------------------------------------------------------------------------
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse

This email and any files transmitted with it are confidential and intended solely for the use of the addressee. If you are not the intended addressee, then you have received this email in error and any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. Please notify us immediately of your unintended receipt by reply and then delete this email and your reply. Cobb-Vantress, Inc. and its subsidiaries and affiliates will not be held liable to any person resulting from the unintended or unauthorized use of any information contained in this email or as a result of any additions or deletions of information originally contained in this email.
------------------------------------------------------------------------------
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Loading...