[142] | 1 | # ipdb/cgi-bin/MyIPDB.pm
|
---|
| 2 | # Contains site-specific functions for IPDB
|
---|
| 3 | # May override some functions from IPDB.pm, wraps others
|
---|
| 4 | ###
|
---|
| 5 | # SVN revision info
|
---|
| 6 | # $Date: 2017-02-15 19:15:32 +0000 (Wed, 15 Feb 2017) $
|
---|
| 7 | # SVN revision $Rev: 902 $
|
---|
| 8 | # Last update by $Author: kdeugau $
|
---|
| 9 | ###
|
---|
[893] | 10 | # Copyright (C) 2004-2016 - Kris Deugau
|
---|
[142] | 11 |
|
---|
[417] | 12 | # don't remove! required for GNU/FHS-ish install from tarball
|
---|
| 13 | ##uselib##
|
---|
| 14 |
|
---|
[142] | 15 | use IPDB 2.0 qw(:ALL);
|
---|
| 16 |
|
---|
| 17 |
|
---|
[432] | 18 | # DSN, user, and password for database. These **MUST** be set.
|
---|
| 19 | my $dbname = 'ipdb';
|
---|
| 20 | my $dbuser = 'ipdb';
|
---|
| 21 | my $dbpass = 'ipdbpwd';
|
---|
| 22 | # DB host is optional.
|
---|
[659] | 23 | my $dbhost = 'localhost';
|
---|
[844] | 24 | ##fixme: need better way to export the variables above for db-update
|
---|
| 25 | sub dbname { $dbname }
|
---|
| 26 | sub dbuser { $dbuser }
|
---|
| 27 | sub dbpass { $dbpass }
|
---|
| 28 | sub dbhost { $dbhost }
|
---|
[432] | 29 |
|
---|
[660] | 30 | # ACL for RPC shim. A hash of arrays; the hash keys are the remote system
|
---|
| 31 | # names, the array contents are the IPs allowed to claim that system name.
|
---|
| 32 | #%IPDB::rpcacl = (
|
---|
| 33 | # cli_test => ['192.168.99.115','209.91.179.62'],
|
---|
| 34 | # devel => ['10.0.10.5'],
|
---|
| 35 | # );
|
---|
[661] | 36 | # Only you can prevent memory leaks!
|
---|
| 37 | #$IPDB::maxfcgi = 100;
|
---|
[517] | 38 |
|
---|
[660] | 39 | # Quick workaround for fixed web path. Set this to the absolute web path to
|
---|
| 40 | # your IPDB install, or leave blank for installation at the webroot.
|
---|
| 41 | $IPDB::webpath = '';
|
---|
| 42 |
|
---|
[416] | 43 | # Set some globals declared in IPDB.pm. Most of these only affect mailNotify().
|
---|
| 44 | # Note that while you *can* leave these at defaults, it's probably a Really Bad Idea.
|
---|
[780] | 45 | #$IPDB::org_name = 'Example Corp';
|
---|
| 46 | #$IPDB::smtphost = 'smtp.example.com';
|
---|
| 47 | #$IPDB::domain = 'example.com';
|
---|
[417] | 48 | #$IPDB::defcustid = '5554242';
|
---|
[780] | 49 | #$IPDB::smtpsender = 'ipdb@example.com';
|
---|
[417] | 50 | # Globals for db2rwhois.pl
|
---|
[420] | 51 | #$IPDB::rwhoisDataPath = '/usr/local/rwhoisd/etc/rwhoisd';
|
---|
[417] | 52 | #$IPDB::org_street = '123 4th Street';
|
---|
| 53 | #$IPDB::org_city = 'Anytown';
|
---|
| 54 | #$IPDB::org_prov_state = 'ON';
|
---|
| 55 | #$IPDB::org_pocode = 'H0H 0H0';
|
---|
| 56 | #$IPDB::org_country = 'CA';
|
---|
| 57 | #$IPDB::org_phone = '000-555-1234';
|
---|
| 58 | # note: following may also just be a bare email address
|
---|
| 59 | #$IPDB::org_techhandle = 'ISP-ARIN-HANDLE';
|
---|
[434] | 60 | #$IPDB::org_email = 'noc@example.com';
|
---|
[437] | 61 | #$IPDB::hostmaster = 'dns@example.com';
|
---|
[416] | 62 |
|
---|
[417] | 63 | # Logging destination. Defaults to local2. See your local syslog docs for valid facilities.
|
---|
| 64 | # Note that the value here should have the LOG_ prefix removed, and convert to lower-case.
|
---|
| 65 | # local0 through local7 and user make the most sense.
|
---|
[780] | 66 | #$IPDB::syslog_facility = 'local2';
|
---|
[417] | 67 |
|
---|
[582] | 68 | # RPC URL for pushing DNS changes out. Blank by default; disables RPC calls for DNS changes when blank.
|
---|
| 69 | #$IPDB::rpc_url = 'http://dnsadmin.example.com/dns-rpc.cgi';
|
---|
[432] | 70 |
|
---|
[674] | 71 | # Largest inverse CIDR mask length to show per-IP rDNS list
|
---|
| 72 | # (eg, NetAddr::IP->bits - NetAddr::IP->masklen)
|
---|
| 73 | # allowing longer than a /27 is probably going to slow things down; longer than /29 will scroll.
|
---|
[780] | 74 | #$IPDB::maxrevlist = 5;
|
---|
[674] | 75 |
|
---|
[780] | 76 | # Show per-IP rDNS list even on pools?
|
---|
| 77 | #$IPDB::revlistalltypes = 0;
|
---|
| 78 |
|
---|
[682] | 79 | ## UI layout for showing subblocks
|
---|
| 80 | # 1 lists all containers in a group, then all end-use allocations (including pools) in a group
|
---|
[836] | 81 | # 2 lists all entries in a container in CIDR order
|
---|
[682] | 82 | # Both show free blocks in a group at the bottom as previously
|
---|
| 83 | # $IPDB::sublistlayout = 1;
|
---|
| 84 |
|
---|
[818] | 85 | ## UI layout for showing VRFs and master blocks
|
---|
| 86 | # 1 lists VRFs on the index page, and master blocks on a subpage to formally separate them
|
---|
| 87 | # 2 is a somehat "lazy" layout that brings sublists of master blocks in each VRF (as well
|
---|
| 88 | # as the "Add master" link and "Delete this VRF" button) onto the index page grouped by VRF
|
---|
| 89 | #$IPDB::masterswithvrfs = 2;
|
---|
| 90 |
|
---|
[691] | 91 | ## VLAN validation mode
|
---|
| 92 | # Set to 0 to allow alphanumerics and _ . - (VLAN name instead of number)
|
---|
| 93 | #$IPDB::numeric_vlan = 1;
|
---|
| 94 |
|
---|
[839] | 95 | ## Billing return link
|
---|
| 96 | # Passalong link for allocations initiated by a link in from a billing system
|
---|
| 97 | #$IPDB::billinglink = 'https://billing.example.com/radius.pl';
|
---|
| 98 |
|
---|
[902] | 99 | ## Append default domain to unqualified DNS names? (ie, names without dots)
|
---|
| 100 | # Disabling this can result in DNS names that get "lost", due to downconversion from A+PTR to PTR.
|
---|
| 101 | #$IPDB::append_domain = 1;
|
---|
| 102 |
|
---|
[432] | 103 | ## connectDB_My()
|
---|
| 104 | # Wrapper for IPDB::connectDB
|
---|
| 105 | # Takes no arguments, returns whatever IPDB::connectDB returns.
|
---|
| 106 | sub connectDB_My {
|
---|
| 107 | return connectDB($dbname, $dbuser, $dbpass, $dbhost);
|
---|
| 108 | } # end connectDB_My()
|
---|
| 109 |
|
---|
[142] | 110 | # Keep Perl from complaining.
|
---|
| 111 | 1;
|
---|