Changeset 433


Ignore:
Timestamp:
Jul 16, 2010, 5:48:19 PM (11 years ago)
Author:
Kris Deugau
Message:

/trunk

Distribution-preparation rollup:

  • Clean up links in footer.inc
  • Extend/complete INSTALL
  • .spec file tweaks
  • Add GPL3 as COPYING
  • Remove obsoleted files from Makefile MANIFEST
  • Shuffle install process to allow side-by-side multiversion installation (sort of related to #14)
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/INSTALL

    r419 r433  
    11$Id$
     2
     3Requirements
     4============
     5
     6- Any CGI-capable web server that can execute arbitrary files or
     7  files with administrator-defineable extensions
     8- PostgreSQL >= 7.4.  It should be possible to (fairly) trivially patch
     9  the code for any other DBMS that supports:
     10  - an IP address/CIDR netblock data type
     11  - higher/greater, lower/less than, contains, and is-contained-by
     12    operators
     13- Perl >= 5.6
     14  - Standard modules:
     15    These should be included in any base Perl install
     16    - File::Path
     17    - CGI::Carp
     18    - POSIX
     19    - Sys::Syslog
     20  - Extra modules:
     21    - NetAddr::IP >= 4.x.  3.x may work, however 4.x has been out for
     22      more than 4 years.
     23    - DBI
     24    - DBD::Pg
     25    - Sys::SigAction.  This isn't strictly required;  it's used in an
     26      example hook for validating customer IDs against an external
     27      database.  It could arguably be replaced with sigaction() from the
     28      POSIX module when using Perl >= 5.8.2.  See eg Sys::SigAction on
     29      CPAN (http://search.cpan.org/~lbaxter/Sys-SigAction-0.11/lib/Sys/SigAction.pm)
     30      for some thoughts on the gritty details.
    231
    332Installing the IPDB
    433===================
    534
    6 1) Untar in a convenient location.  Note that all URLs referenced internally currently assume they will be
    7 presented at http://host/ip/.
     351) Untar in a convenient location.  You should be able to simply use the
     36unpacked tarball as-is, or you can run "make install" to install files
     37in /usr/local/lib/ipdb-#VERSION#, with configuration modules in
     38/usr/local/etc/ipdb-#VERSION#.
    839
    9 2) Edit cgi-bin/MyIPDB.pm:  you need to set the database DSN and company info.  You
    10 should probably also set the syslog facility and default custid.
     40The Makefile supports substitution on most standard
     41GNU/FHS-ish paths, so you could also run:
    1142
    12 3) Edit cgi-bin/CustIDCK.pm as needed to validate customer IDs.
     43  make install prefix=/opt
     44
     45to install it under /opt.
     46
     47The Makefile also supports DESTDIR for packaging, so you can use:
     48
     49  make install libdir=/usr/lib sysconfdir=/etc DESTDIR=/tmp/ipdbpkgroot
     50
     51to install for packaging under /tmp/ipdbpkgroot with the core scripts
     52and HTML packaged under /usr/lib/ipdb-#VERSION#, and the configuration
     53modules packaged under /etc/ipdb-#VERSION#.
     54
     552) Configuration:  These module files will either be in the cgi-bin/
     56directory from the unpacked tarball, or /usr/local/etc/ipdb-#VERSION#
     57if installed with 'make install'.
     58  a) Edit MyIPDB.pm:  you need to set the database DSN and
     59    company info.  You should probably also set the syslog facility and
     60    default custid.
     61  b) Edit CustIDCK.pm as needed to validate customer IDs.
    1362
    14634) Create the database, and the inital tables using cgi-bin/ipdb.psql.
    1564
    16 5) User lists can be maintained two basic ways:
     655) Configure your webserver to call the IPDB scripts at an appropriate
     66web path.  A webroot pointing to the HTML files (first level under
     67the ipdb-#VERSION#/ tarball directory, or /usr/local/lib/ipdb-#VERSION#)
     68with a symlink or alias for ip/ -> . should work fine;  a server alias
     69under an existing virtual host should work as well.
    1770
    18   a) Use the built-in user manager to add and remove users.  This requires mod_auth_pgsql, configured
    19 with read/write access to the IPDB users table.  A default user admin, password admin, is created in step 4 above
    20 - make sure to create a new user as an admin, and remove the default user.
     71Note that all URLs referenced internally currently assume they will be
     72presented at http://host/ip/;  you cannot put the IPDB at
     73http://host/noc/misc/ipdb/.
    2174
    22   b) Maintain an external .htpasswd file of your own, configured however you like.  In this case the
    23 access-pwd-update.pl script should edited to match the .htpasswd filename/path and should be called from cron to
    24 make sure new users get added to the database, and old ones get deleted.  This extra maintenance of user lists is
    25 necessary to support the access controls, which are stored in the database.
     75The directory containing the HTML and scripts must have at least the
     76following Apache directives (or other server equivalent) set:
    2677
    27 You will have to either temporarily create a user "admin", so that user can grant other users priviledges, or run
    28 the following on the database:
     78  Options ExecCGI IncludesNoEXEC FollowSymlinks
    2979
    30 UPDATE users SET acl='bacdsA' WHERE username='newadminuser';
     806) User lists can be maintained two basic ways:
     81
     82  a) Use the built-in user manager to add and remove users.  This
     83    requires mod_auth_pgsql, configured with read/write access to the
     84    IPDB users table.  A default user admin, password admin, is created
     85    in step 4 above - make sure to create a new user as an admin, and
     86    remove the default user (or at least change its password).
     87
     88  b) Maintain an external .htpasswd file of your own, configured and
     89    maintained however you like.  In this case the access-pwd-update.pl
     90    script should edited to match the .htpasswd filename/path and should
     91    be called from cron to make sure new users get added to the
     92    database, and old ones get deleted.  This extra maintenance of user
     93    lists is necessary to support the access controls, which are stored
     94    in the database.
     95
     96You will have to either temporarily create a user "admin", so that user
     97can grant other users priviledges, or run the following on the database:
     98
     99  UPDATE users SET acl='bacdsA' WHERE username='newadminuser';
    31100
    32101Replace 'newadminuser' as appropriate.
    33102
    34 If you don't do this, nobody will be able to make any changes;  access-pwd-update.pl only grants read access.
     103If you don't do this, nobody will be able to make any changes; 
     104access-pwd-update.pl only grants minimal read access to new users.
    35105
     1067) (optional) Pick a log facility by setting $IPDB::syslog_facility in
     107MyIPDB.pm, and tweak your syslog configuration to direct IPDB logging
     108to a custom log.  Most logging is at the level of "info" or "warn". 
     109Full changes are not logged.  Logging verbosity isn't very high, so it
     110may be acceptable to leave the log stream at the defaults.
    36111
    37 Basic installation should now be complete!  Add your ARIN, RIPE, LACNIC, AfriNIC, or APNIC allocations and start
     112---
     113
     114Basic installation should now be complete!  Log in as an admin user,
     115add your ARIN, RIPE, LACNIC, AfriNIC, or APNIC allocations and start
    38116documenting your netblock usage.
    39117
    40 If you want to export rWHOIS data, see http://www.unixadmin.cc/rwhois/ for a place to start on setting up an
    41 rWHOIS server.  Note that db2rwhois.pl creates and maintains the net-<cidr> trees, all you have to do is
    42 configure the daemon itself.  Schedule runs of cgi-bin/extras/db2rwhois.pl followed by rwhois_indexer.  You'll
    43 need to fill in correct organization contact info in MyIPDB.pm.
     118If you want to export rWHOIS data, see http://www.unixadmin.cc/rwhois/
     119for a place to start on setting up an rWHOIS server.  Note that
     120db2rwhois.pl creates and maintains the net-<cidr> trees, all you have
     121to do is configure the daemon itself.  Schedule runs of
     122cgi-bin/extras/db2rwhois.pl followed by rwhois_indexer (every hour
     123should be plenty often).  You'll need to fill in correct organization
     124contact info in MyIPDB.pm.
  • trunk/Makefile

    r417 r433  
    2929
    3030MANIFEST = \
    31         Makefile ipdb.spec \
     31        INSTALL COPYING Makefile ipdb.spec \
    3232        \
    33         addmaster.html alloctypes.html assign.html changes.html compsearch.html \
     33        addmaster.html alloctypes.html assign.html compsearch.html \
    3434        confirm.html confirmRemove.html editDisplay.html fb-assign.html footer.inc \
    3535        header.inc help.html index.shtml ipdb.css local.css \
     
    3737        images/logo.png \
    3838        \
    39         cgi-bin/updatecust.php cgi-bin/combineblocks.pl cgi-bin/access-pwd-update.pl \
     39        cgi-bin/combineblocks.pl cgi-bin/access-pwd-update.pl \
    4040        cgi-bin/newnode.cgi cgi-bin/CustIDCK.pm cgi-bin/freespace.pl \
    4141        cgi-bin/admin.cgi cgi-bin/MyIPDB.pm cgi-bin/IPDB.pm \
    4242        cgi-bin/main.cgi cgi-bin/checkcusts.pl cgi-bin/newcity.cgi \
    43         cgi-bin/allocate.pl cgi-bin/search.cgi cgi-bin/editcust.php \
     43        cgi-bin/allocate.pl cgi-bin/search.cgi \
    4444        cgi-bin/snCalc.cgi cgi-bin/CommonWeb.pm cgi-bin/ipdb.psql \
    45         cgi-bin/list-cust.php cgi-bin/consistency-check.pl \
     45        cgi-bin/consistency-check.pl \
    4646        \
    4747        cgi-bin/extras/db2rwhois.pl cgi-bin/extras/rwhois-net-skel.tar.gz cgi-bin/extras/rwhois-config \
     
    8080install:
    8181        @for i in $(HTML) $(IMAGES); do \
    82                 $(INSTALL_DATA) -D $$i $(DESTDIR)${libdir}/ipdb/$$i ; \
     82                $(INSTALL_DATA) -D $$i $(DESTDIR)${libdir}/ipdb-$(VERSION)/$$i ; \
    8383        done
    8484        # munge in necessary 'use lib ...' bits so scripts can find MyIPDB.pm...
    8585        @for i in $(SCRIPTS) $(MODULES) $(RWHOIS); do \
    86                 $(INSTALL_SCRIPT) -D $$i $(DESTDIR)${libdir}/ipdb/$$i ; \
    87                 perl -pi -e 's|##uselib##|use lib "${sysconfdir}/ipdb/";|;' $(DESTDIR)${libdir}/ipdb/$$i ; \
     86                $(INSTALL_SCRIPT) -D $$i $(DESTDIR)${libdir}/ipdb-$(VERSION)/$$i ; \
     87                perl -pi -e 's|##uselib##|use lib "${sysconfdir}/ipdb-$(VERSION)/";|;' $(DESTDIR)${libdir}/ipdb-$(VERSION)/$$i ; \
    8888        done
    89         $(INSTALL) -d $(DESTDIR)${sysconfdir}/ipdb/
     89        $(INSTALL) -d $(DESTDIR)${sysconfdir}/ipdb-$(VERSION)/
    9090        @for i in $(CONFIGMODULES) ; do \
    91                 $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/ipdb/ ; \
     91                $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/ipdb-$(VERSION)/ ; \
    9292        done
    9393        # and now munge MyIPDB.pm so it can find the core library
    94         perl -pi -e 's|##uselib##|use lib "${libdir}/ipdb";|;' $(DESTDIR)${sysconfdir}/ipdb/MyIPDB.pm
     94        perl -pi -e 's|##uselib##|use lib "${libdir}/ipdb-$(VERSION)";|;' $(DESTDIR)${sysconfdir}/ipdb-$(VERSION)/MyIPDB.pm
    9595
    9696#clean:
     
    103103        tar cf - $(MANIFEST) | (cd $(PKGNAME)-$(VERSION); tar xf -)
    104104        /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < $(PKGNAME).spec > $(PKGNAME)-$(VERSION)/$(PKGNAME).spec
     105        /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < INSTALL > $(PKGNAME)-$(VERSION)/INSTALL
    105106        perl -pi -e 's/[\d.]+;\s*##VERSION##/$(VERSION);/;' $(PKGNAME)-$(VERSION)/cgi-bin/IPDB.pm
    106107        tar cf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION)
  • trunk/footer.inc

    r55 r433  
    99  <tr>
    1010    <td nowrap="" width="0" height="0" valign="top">
    11       <div align="right"><font face="Arial, Helvetica, sans-serif" size="1">contact:
    12         <a href="mailto:kdeugau@deepnet.cx">kdeugau@deepnet.cx</a> - (c) 2004 <a href="http://www.deepnet.cx/" target="_blank">deepnet</a><br>
    13 Written for standards-based browsers (eg <a href="http://www.netscape.com">Netscape</a>/<a href="http://www.mozilla.org">Mozilla</a>)</font></div>
     11      <div align="right"><font face="Arial, Helvetica, sans-serif" size="1"> DeepNet
     12 <a href="http://projects.deepnet.cx/trac/ipdb" target="_blank">IP Database</a> |
     13 Copyright 2004-2010 <a href="mailto:kdeugau@deepnet.cx">Kris Deugau</a><br>
     14Written for standards-based browsers (eg <a href="http://www.mozilla.org">Mozilla</a>)</font></div>
    1415    </td>
    1516  </tr>
  • trunk/ipdb.spec

    r417 r433  
    3737Packager: Kris Deugau <kdeugau@deepnet.cx>
    3838BuildRoot: /var/tmp/%{name}-%{version}
    39 License: GPL 2+
     39License: GPL 3+
    4040BuildArch: noarch
     41Requires: perl(NetAddr::IP) >= 4, perl(DBD:Pg)
     42%if %{_vendor} == "debbuild"
     43Recommends: perl(Sys::SigAction)
     44%endif
    4145
    4246%description
Note: See TracChangeset for help on using the changeset viewer.