Discussion:
[Gmod-gbrowse] Restricting Access to tracks by IP
Jeevan Karloss Antony Samy
2016-11-28 12:18:50 UTC
Permalink
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
------------------------------------------------------------------------------
Barris, Wes
2016-11-29 16:00:46 UTC
Permalink
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:***@nmbu.no]
Sent: Monday, November 28, 2016 6:19 AM
To: gmod-***@lists.sourceforge.net
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
Gmod-***@lists.sourceforge.net
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.
------------------------------------------------------------------------------
Loading...