Changeset 780 for trunk/cgi-bin


Ignore:
Timestamp:
10/07/15 18:12:25 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

  • Revert most examples in MyIPDB.pm to defaults.
  • Add new flag to retrieve/show unique/custom per-IP rDNS on IP pools rather than having to either visit each IP individually or use the primary DNS management UI
  • Add final safety valve in the UI to limit per-IP rDNS lists to 1K (10 bits). Even a /26 is a bit slow; a /24 takes over a second even on lightly-loaded hardware over local loopback.
Location:
trunk/cgi-bin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r775 r780  
    117117# (eg, NetAddr::IP->bits - NetAddr::IP->masklen)
    118118our $maxrevlist = 5;  # /27
     119
     120# Display the per-IP rDNS list on all block types even when it might not
     121# make sense (typically for IP pools, where the per-IP entries are available
     122# from each IP's edit page)
     123our $revlistalltypes = 0;
    119124
    120125# UI layout for subblocks/containers
  • trunk/cgi-bin/MyIPDB.pm

    r776 r780  
    3838# Set some globals declared in IPDB.pm.  Most of these only affect mailNotify().
    3939# Note that while you *can* leave these at defaults, it's probably a Really Bad Idea.
    40 #$IPDB::org_name = "Bob's Big Bonaza";
    41 #$IPDB::smtphost = '127.0.0.1';
    42 #$IPDB::domain = 'bob.com';
     40#$IPDB::org_name = 'Example Corp';
     41#$IPDB::smtphost = 'smtp.example.com';
     42#$IPDB::domain = 'example.com';
    4343#$IPDB::defcustid = '5554242';
    44 #$IPDB::smtpsender = "ipdb\@$domain";
     44#$IPDB::smtpsender = 'ipdb@example.com';
    4545# Globals for db2rwhois.pl
    4646#$IPDB::rwhoisDataPath = '/usr/local/rwhoisd/etc/rwhoisd';
     
    5959# Note that the value here should have the LOG_ prefix removed, and convert to lower-case.
    6060# local0 through local7 and user make the most sense.
    61 #$IPDB::syslog_facility = 'daemon';
     61#$IPDB::syslog_facility = 'local2';
    6262
    6363# RPC URL for pushing DNS changes out.  Blank by default;  disables RPC calls for DNS changes when blank.
     
    6767# (eg, NetAddr::IP->bits - NetAddr::IP->masklen)
    6868# allowing longer than a /27 is probably going to slow things down;  longer than /29 will scroll.
    69 #$IPDB::maxrevlist = 8;  # v4 /24
     69#$IPDB::maxrevlist = 5;
     70
     71# Show per-IP rDNS list even on pools?
     72#$IPDB::revlistalltypes = 0;
    7073
    7174## UI layout for showing subblocks
  • trunk/cgi-bin/main.cgi

    r771 r780  
    592592    if ($IPDBacl{$authuser} =~ /c/
    593593        && $cidr->masklen != $cidr->bits
    594         && ($cidr->bits - $cidr->masklen) <= $IPDB::maxrevlist
    595         && $webvar{alloctype} !~ /^.[dpi]/
     594        && ($cidr->bits - $cidr->masklen) <= $IPDB::maxrevlist
     595        # config flag for "all block types" OR "not-a-pool-or-IP type"
     596        && ($IPDB::revlistalltypes || $webvar{alloctype} !~ /^.[dpi]/)
     597        # safety against trying to retrieve and display more than 1k (10 bits, /22 v4) worth of individual IPs
     598        # ever.  If you really need to manage a long list of IPs like that all in one place, you can use the DNS
     599        # management tool.  Even a /26 is a bit much, really.
     600        && ($cidr->bits - $cidr->masklen) <= 10
    596601        # do we want to allow v6 at all?
    597602        #&& ! $cidr->{isv6}
     
    917922        && $cidr->masklen != $cidr->bits
    918923        && ($cidr->bits - $cidr->masklen) <= $IPDB::maxrevlist
    919         && $blockinfo->{type} !~ /^.[dpi]/
     924        # config flag for "all block types" OR "not-a-pool-or-IP type"
     925        && ($IPDB::revlistalltypes || $blockinfo->{type} !~ /^.[dpi]/)
     926        # safety against trying to retrieve and display more than 1k (10 bits, /22 v4) worth of individual IPs
     927        # ever.  If you really need to manage a long list of IPs like that all in one place, you can use the DNS
     928        # management tool.  Even a /26 is a bit much, really.
     929        && ($cidr->bits - $cidr->masklen) <= 10
    920930        # do we want to allow v6 at all?
    921931        #&& ! $cidr->{isv6}
Note: See TracChangeset for help on using the changeset viewer.