diff options
Diffstat (limited to 'httemplate/docs')
-rwxr-xr-x | httemplate/docs/admin.html | 75 | ||||
-rw-r--r-- | httemplate/docs/billing.html | 52 | ||||
-rw-r--r-- | httemplate/docs/config.html | 36 | ||||
-rwxr-xr-x | httemplate/docs/export.html | 54 | ||||
-rw-r--r-- | httemplate/docs/index.html | 30 | ||||
-rw-r--r-- | httemplate/docs/install.html | 180 | ||||
-rwxr-xr-x | httemplate/docs/legacy.html | 34 | ||||
-rw-r--r-- | httemplate/docs/overview.dia | bin | 0 -> 2800 bytes | |||
-rw-r--r-- | httemplate/docs/overview.png | bin | 0 -> 13064 bytes | |||
-rwxr-xr-x | httemplate/docs/passwd.html | 23 | ||||
-rw-r--r-- | httemplate/docs/schema.html | 385 | ||||
-rw-r--r-- | httemplate/docs/session.html | 54 | ||||
-rw-r--r-- | httemplate/docs/signup.html | 60 | ||||
-rwxr-xr-x | httemplate/docs/trouble.html | 26 | ||||
-rw-r--r-- | httemplate/docs/upgrade4.html | 27 | ||||
-rw-r--r-- | httemplate/docs/upgrade5.html | 34 | ||||
-rw-r--r-- | httemplate/docs/upgrade6.html | 66 | ||||
-rw-r--r-- | httemplate/docs/upgrade7.html | 24 | ||||
-rw-r--r-- | httemplate/docs/upgrade8.html | 313 |
19 files changed, 1473 insertions, 0 deletions
diff --git a/httemplate/docs/admin.html b/httemplate/docs/admin.html new file mode 100755 index 000000000..16d492095 --- /dev/null +++ b/httemplate/docs/admin.html @@ -0,0 +1,75 @@ +<head> + <title>Administration</title> +</head> +<body> + <h1>Administration</h1> +</body> +<ul> + <li>Open up the root of the Freeside document tree in your web + browser. For example, if you created the Freeside document tree in + /home/httpd/html/freeside, and your web browser's DocumentRoot is + /home/httpd/html, open https://your_host/freeside/. Replace + "your_host" with the name or network address of your web server. + <li>Select <u>Configuration</u> from the main menu and update your configuration values. + <li>Next you must create a service definition. An example of a service + definition would be a dial-up account or a domain. For starters, it is + necessary to create a domain definition. Click on <u>View/Edit service + definitions</u> and <u>Add a new service definition</u> with <i>Table</i> + <b>svc_domain</b> (and no modifiers). + + <li>Now that you have created your first service, you must create a package + including this service which you can sell to customers. Zero, one, or many + services are bundled into a package. Click on <u>View/Edit package + definitions</u> and <u>Add a new package definition</u> which includes + quantity <b>1</b> of the svc_domain service you created above. + + <li>After you create your first package, then you must define who is + able to sell that package by creating an agent type. An example of + an agent type would be an internal sales representitive which sells + regular and promotional packages, as opposed to an external sales + representitive which would only sell regular packages of services. Click on + <u>View/Edit agent types</u> and <u>Add a new agent type</u>. Allow this + agent type to sell the package you created above. + + <li>After creating a new agent type, you must create an agent. Click on + <u>View/Edit agents</u> and <u>Add a new agent</u>. + + <li>Set up at least one referral. Referrals will help you keep track of how + effective your advertising is, by helping you keep track of where customers + heard of your service offerings. You must create at least one referral. If + you do not wish to use the referral functionality, simply create a single + referral only. Click on <u>View/Edit referrals</u> and <u>Add a new + referral</u>. + + <li>Click on <u>New Customer</u> and create a new customer for your system + accounts with billing type <b>Complimentary</b>. + + <li>From the Customer View screen of the newly created customer, order the + package you defined above. + + <li>From the Package View screen of the newly created package, choose + <u>(Add)</u> to add the customer's service for this new package. + + <li>Add your own domain. + + <li>Go back to <u>View/Edit service definitions</u> on the main menu, and + <u>Add a new service definition</u> with <i>Table</i> <b>svc_acct</b>. + Select your domain in the <b>domsvc</b> Modifier. Set <b>Fixed</b> to define + a service locked-in to this domain, or <b>Default</b> to define a service + which may select from among this domain and the customer's domains. + + <li><table><tr> + <td> Create at least POP (Point of Presence) by selecting + <u>View/Edit POPs</u> from the main menu.</td> + <th align="left"> OR </th> + <td>If you are not doing dialup, set slipip to fixed and blank for all your + Service Definitions which have Table <b>svc_acct</b>.</td> + </tr></table> + + <li>If you are using Freeside to keep track of sales taxes, define tax + information for your locales by clicking on the <u>View/Edit locales and tax + rates</b> on the main menu. + +</ul> +</body> +</html> diff --git a/httemplate/docs/billing.html b/httemplate/docs/billing.html new file mode 100644 index 000000000..de59fc60a --- /dev/null +++ b/httemplate/docs/billing.html @@ -0,0 +1,52 @@ +<head> + <title>Billing</title> +</head> +<body> + <h1>Billing</h1> + <ul> + <li>You can bill individual customers by clicking on the <i>Bill now</i> link on the main customer view. + <li>The <a href="man/bin/freeside-daily.html"><b>freeside-daily</b></a> script should be run daily to bill customers and run invoice collection events. + <li>Real-time credit card processing: Install the <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> module for your processor. Configure the <a href="../config/config-view.cgi#business-onlinepayment">business-onlinepayment</a> configuration option. Disable the default <b>Batch card</b> <a href="../browse/part_bill_event.cgi">invoice event</a> and add one for Business::OnlinePayment. + <li>Optional: Invoice template customization + <ul> + <li>See the <a href="http://search.cpan.org/doc/MJD/Text-Template-1.42/Template.pm">Text::Template</a> documentation for details on the substitution language. + <li>You <b>must</b> call the invoice_lines() function at least once - pass it a number of lines, and it returns a list of array references, each of two elements: a service description column, and a price column. + <li>In addition, the following variables are available: + <ul> + <li>$invnum - invoice number + <li>$date - as a UNIX timestamp (see <a href="http://search.cpan.org/doc/GBARR/TimeDate-1.09/lib/Date/Format.pm">Date::Format</a> for conversion functions). + <li>$page - current page + <li>$total_pages - total pages + <li>@address - A six-element array containing the customer name, company, and address. + <li>$overdue - true if this invoice is overdue + </ul> + </ul> + <li>Batch credit card processing + <ul> + <li>After <a href="man/bin/freeside-daily.html"><b>freeside-daily</b></a> is run, a credit card batch will be in the <a href="schema.html#cust_pay_batch">cust_pay_batch</a> table. Export this table to your credit card batching. + <li>When your batch completes, erase the cust_pay_batch records in that batch and add any necessary paymants to the <a href="schema.html#cust_pay">cust_pay</a> table. Example code to add payments is: + <pre>use FS::cust_pay; + +# loop over all records in batch + +my $payment=create FS::cust_pay ( + 'invnum' => $invnum, + 'paid' => $paid, + '_date' => $_date, + 'payby' => $payby, + 'payinfo' => $payinfo, + 'paybatch' => $paybatch, +); + +my $error=$payment->insert; +if ( $error ) { + #process error +} + +# end loop +</pre> +All fields except paybatch are contained in the cust_pay_batch table. You can use paybatch field to track particular batches and/or particular transactions within a batch. + </ul> + <li>The <a href="man/bin/freeside-print-batch.html"><b>freeside-print-batch</b></a> script can print or email pending credit card batches for manual entry. + </ul> +</body> diff --git a/httemplate/docs/config.html b/httemplate/docs/config.html new file mode 100644 index 000000000..9caf3bb3a --- /dev/null +++ b/httemplate/docs/config.html @@ -0,0 +1,36 @@ +<head> + <title>Configuration files</title> +</head> +<body> + <h1>Configuration files</h1> +<font size="+1" color="#ff0000">Configuration is now done by the top-level Makefile and web interface. The instructions below are no longer necessary.</font> +<ul> + <li>Create the <b>/usr/local/etc/freeside</b> directory to hold your configuration. + <li>Setting up <a href="http://www.apache.org/docs/misc/FAQ.html#user-authentication">Apache user authetication</a> is mandatory. + <li>Create the <b>/usr/local/etc/freeside/mapsecrets</b> file, which maps Apache users to a secrets file which contains a DBI data source, username and password. Every +line in <b>/usr/local/etc/freeside/mapsecrets</b> should contain a username and +filename, separated by whitespace. Note that these are not local usernames - +they are passed from Apache. <a href="http://www.apache.org/docs/misc/FAQ.html#user-authentication"> +Apache user authetication</a> is mandatory. For example, if you had the Apache users admin, +john, and sam, +you mapsecrets file might look like: +<pre> +admin secretfile +john secretfile +sam secretfile +</pre> + <li>Next, the filename(s) referenced in <b>/usr/local/etc/freeside/mapsecrets</b> file should be created in the <b>/usr/local/etc/freeside/</b> directory. Each file contains three lines: <a href="http://search.cpan.org/doc/TIMB/DBI-1.20/DBI.pm">DBI data source</a> (for example, + <tt>DBI:mysql:freeside</tt> or <tt>DBI:Pg:host=localhost;dbname=freeside</tt>), database username, and database password. + These files should not be world readable. See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.20/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD">manpage for your DBD</a> for the exact syntax of a DBI data source. In a normal installation such as the example above, a single file <b>/usr/local/etc/freeside/secretfile</b> would be created - for example: +<pre> +DBI:Pg:host=localhost;dbname=freeside +dbusername +dbpassword +</pre> +<li>Create the <b>/usr/local/etc/freeside/conf.<i>datasource</i></b> directory, for example, <b>/usr/local/etc/freeside/conf.DBI:Pg:host=localhost;dbname=freeside</b> (remember to backslash-escape the ; character when creating directories in the shell: +<pre>mkdir /usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=freeside +</pre> +<li>The rest of the configuration can be done with the web interface. Select <u>Configuration</u> from the main menu and update your configuration values. +</ul> +</body> +</html> diff --git a/httemplate/docs/export.html b/httemplate/docs/export.html new file mode 100755 index 000000000..c7f1b4c9e --- /dev/null +++ b/httemplate/docs/export.html @@ -0,0 +1,54 @@ +<head> + <title>File exporting</title> +</head> +<body> + <h1>File exporting</h1> + <ul> + <li>bin/svc_acct.export will create UNIX <b>passwd</b>, <b>shadow</b> and <b>master.passwd</b> files, ERPCD <b>acp_passwd</b> and <b>acp_dialup</b> files and a RADIUS <b>users</b> file in the <b>/usr/local/etc/freeside/export.<i>datasrc</i></b> directory. Some RADIUS servers (such as <a href="http://www.open.com.au/radiator/">Radiator</a>, <a href="ftp://ftp.cheapnet.net/pub/icradius/">ICRADIUS</a> and <a href="http://www.freeradius.org/">FreeRADIUS</a>) will authenticate directly out of an SQL database. In these cases, +it is reccommended that you replicate (<a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Replication">Replication in MySQL</a>) the data to an external RADIUS machine or point icradius_secrets to the external machine rather than running the RADIUS server on your Freeside machine. Using the appropriate <a href="../config/config-view.cgi">configuration settings</a>, you can export these files to your remote machines unattended: + <ul> + <li>shellmachines - <b>passwd</b> and <b>shadow</b> are copied to the remote machine as <b>/etc/passwd.new</b> and <b>/etc/shadow.new</b> and then moved to <b>/etc/passwd</b> and <b>/etc/shadow</b> if no errors occur. + <li>bsdshellmachines - <b>passwd</b> and <b>master.passwd</b> are copied to the remote machine as <b>/etc/passwd.new</b> and <b>/etc/master.passwd.new</b> and moved to <b>/etc/passwd</b> and <b>/etc/master.passwd</b> if no errors occur. + <li>nismachines - <b>passwd</b> and <b>shadow</b> are copied to the <b>/etc/global</b> directory on the remote machine. If no errors occur, the command <b>( cd /var/yp; make; )</b> is executed on the remote machine. + <li>erpcdmachines - <b>acp_passwd</b> and <b>acp_dialup</b> are copied to the <b>/usr/annex</b> directory on the remote machine. If no errors occur, the command <b>( kill -USR1 `cat /usr/annex/erpcd.pid` )</b> is executed on the remote machine. + <li>radiusmachines - <b>users</b> is copied to the <b>/etc/raddb</b> directory on the remote machine. If no errors occur, the command <b>( builddbm )</b> is executed on the remote machine. + <li>icradiusmachines - Turn this option on to enable radcheck table population - by default in the Freeside database, or in the database specified by the <a href="http://rootwood.haze.st/aspside/config/config-view.cgi#icradius_secrets">icradius_secrets</a> config option (the radcheck table needs to be created manually). You do not need to use MySQL for your Freeside database to export to an ICRADIUS/FreeRADIUS MySQL database with this option. <blockquote><b>ADDITIONAL DEPRECATED FUNCTIONALITY</b> (instead use <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Replication">MySQL replication</a> or point icradius_secrets to the external database) - your <a href="ftp://ftp.cheapnet.net/pub/icradius">ICRADIUS</a> machines or <a href="http://www.freeradius.org/">FreeRADIUS</a> (with MySQL authentication) machines, one per line. Machines listed in this file will have the radcheck table exported to them. Each line should contain four items, separted by whitespace: machine name, MySQL database name, MySQL username, and MySQL password. For example: <CODE>"radius.isp.tld radius_db radius_user passw0rd"</CODE></blockquote> + </ul> + <li>svc_acct.pm - If a shellmachine is defined, users can be created, modified and deleted remotely; see below. + <ul> + <li>Account creation - If the <b>username</b>, <b>uid</b> and <b>dir</b> fields are defined for a new user, the command(s) specified in the <a href="../config/config-view.cgi#shellmachine-useradd">shellmachine-useradd</a> configuration file are executed on shellmachine via ssh. If this file does not exist, <code>useradd -d $dir -m -s $shell -u $uid $username</code> is the default. If the file exists but is empty, <code>cp -pr /etc/skel $dir; chown -R $uid.$gid $dir</code> is the default instead. Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$username</code>, <code>$uid</code>, <code>$gid</code>, <code>$dir</code>, and <code>$shell</code>. + <li>Account deletion - The command(s) specified in the <a href="../config/config-view.cgi#shellmachine-userdel">shellmachine-userdel</a> configuration file are executed on shellmachine via ssh. If this file does not exist, <code>userdel $username</code> is the default. If the file exists but is empty, <code>rm -rf $dir</code> is the default instead. Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$username</code> and <code>$dir</code>. + <li>Account modification - If a user's home directory changes, the command(s) specified in the <a href="../config/config-view.cgi#shellmachine-usermod">shellmachine-usermod</a> configuration file are execute on shellmachine via ssh. If this file does not exist or is empty, <code>[ -d $old_dir ] && mv $old_dir $new_dir || ( chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; find . -depth -print | cpio -pdm $new_dir; chmod u-t $new_dir; chown -R $uid.$gid $new_dir; rm -rf $old_dir )</code> is the default. Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$old_dir</code>, <code>$new_dir</code>, <code>$uid</code> and <code>$gid</code>. + </ul> + <li>svc_acct.pm - <a href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus IMAP Server</a> integration, enabled by the <a href="../config/config-view.cgi#cyrus">cyrus configuration file</a> + <ul> + <li>Account creation - (Cyrus::IMAP::Admin should be installed locally) + <li>Account deletion - (Cyrus::IMAP::Admin should be installed locally) + <li>Account modification - (not yet implemented) + </ul> + <li>bin/svc_acct_sm.export will create <a href="http://www.qmail.org">Qmail</a> <b>rcpthosts</b>, <b>recipientmap</b> and <b>virtualdomains</b> files and <a href="http://www.sendmail.org">Sendmail</a> <b>virtusertable</b> and <b>sendmail.cw</b> files in the <b>/usr/local/etc/freeside/export.<i>datasrc</i></b> directory. Using the appropriate <a href="../config/config-view.cgi">configuration files</a>, you can export these files to your remote machines unattemded: + <ul> + <li>qmailmachines - <b>recipientmap</b>, <b>virtualdomains</b> and <b>rcpthosts</b> are copied to the <b>/var/qmail/control</b> directory on the remote machine. Note: If you <a href="legacy.html#svc_acct_sm">imported</a> qmail configuration files, run the generated <b>/usr/local/etc/freeside/export.<i>datasrc</i>/virtualdomains.FIX</b> on a machine with your user home directories before exporting qmail configuration files. + <li>shellmachine - The command <b>[ -e <i>homedir</i>/.qmail-default ] || { touch <i>homedir</i>/.qmail-default; chown <i>uid</i>.<i>gid</i> <i>homedir</i>/.qmail-default; }</b> will be run on this machine for users in the virtualdomains file. + <li>sendmailmachines - <b>sendmail.cw</b> and <b>virtusertable</b> are copied to the remote machine as <b>/etc/sendmail.cw.new</b> and <b>/etc/virtusertable.new</b>. If no errors occur, they are moved to <b>/etc/sendmail.cw</b> and <b>/etc/virtusertable</b> and the command specified in the <a href="../config/config-view.cgi#sendmailrestart">sendmailrestart</a> configuration file is executed. (The path can be changed from the default <b>/etc</b> with the <a href="../config/config-view.cgi#sendmailconfigpath">sendmailconfigpath</a> configuration file.) + </ul> + <li>svc_domain.pm - If the qmailmachines configuration file exists and a shellmachine is defined, user <b>.qmail-</b> files can be updated for catchall mailboxes. + <ul> + <li>The command <pre>[ -e <i>homedir</i>/.qmail-<i>domain</i>-default ] || { + touch <i>homedir</i>/.qmail-<i>domain</i>-default; + chown <i>uid</i>.<i>gid</i> <i>homedir</i>/.qmail-<i>domain</i>-default; +}</pre> is run. + </ul> + <li>svc_forward.pm - Not yet documented; see manpage. + <li>svc_www.pm - Not yet documented; see manpage. + </ul> + <br><a name=ssh>Unattended remote login</a> - Freeside can login to remote machines unattended using SSH. This can pose a security risk if not configured correctly, and will allow an intruder who breaks into your freeside machine full access to your remote machines. <b>Do not use this feature unless you understand what you are doing!</b> + <ul> + <li>As the freeside user (on your freeside machine), generate an authentication key using <a href="http://www.tac.eu.org/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>. Since this is for unattended operation, use a blank passphrase. + <li>Append the newly-created <code>identity.pub</code> file to <code>~root/.ssh/authorized_keys</code> on the remote machine(s). + <li>Some new SSH v2 implementation accept v2 style keys only. Use the <code>-t</code> option to <a href="http://www.tac.eu.org/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>, and append the created <code>id_dsa.pub</code> or <code>id_rsa.pub</code> to <code>~root/.ssh/authorized_keys2</code> on the remote machine(s). + <li>You may need to set <code>PermitRootLogin without-password</code> (meaning with keys only) in your <code>sshd_config</code> file on the remote machine(s). + </ul> + +</body> + diff --git a/httemplate/docs/index.html b/httemplate/docs/index.html new file mode 100644 index 000000000..00c863b0c --- /dev/null +++ b/httemplate/docs/index.html @@ -0,0 +1,30 @@ +<head> + <title>Documentation</title> +</head> +<body bgcolor="#ffffff"> + <h1>Documentation</h1> +<img src="overview.png"> +<ul> + <li><a href="install.html">New Installation</a> + <li><a href="upgrade4.html">Upgrading from 1.2.x to 1.2.2</a> + <li><a href="upgrade5.html">Upgrading from 1.2.2 to 1.2.3</a> + <li><a href="upgrade6.html">Upgrading from 1.2.3 to 1.3.0</a> + <li><a href="upgrade7.html">Upgrading from 1.3.0 to 1.3.1</a> + <li><a href="upgrade8.html">Upgrading from 1.3.1 to 1.4.0</a> +<!-- + <li><a href="config.html">Configuration files</a> +!--> + <li><a href="admin.html">Administration</a> +<!-- + <li><a href="../index.html#admin">Administration</a> +!--> + <li><a href="legacy.html">Importing legacy data</a> + <li><a href="export.html">File exporting and remote setup</a> + <li><a href="passwd.html">fs_passwd</a> + <li><a href="signup.html">Signup server</a> + <li><a href="session.html">Session monitor</a> + <li><a href="billing.html">Billing</a> + <li><a href="schema.html">Schema reference</a> + <li><a href="man/FS.html">Perl API</a> +</ul> +</body> diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html new file mode 100644 index 000000000..b2d735d12 --- /dev/null +++ b/httemplate/docs/install.html @@ -0,0 +1,180 @@ +<head> + <title>Installation</title> +</head> +<body> +<h1>Installation</h1> +Before installing, you need: +<ul> + <li><a href="http://www.perl.com/">Perl</a> Don't enable experimental features like threads or the PerlIO abstraction layer. + <li><a href="http://www.apache.org">Apache</a> (<a href="http://www.modssl.org/">mod_ssl</a> or <a href="http://www.apache-ssl.org">Apache-SSL</a> highly recommended) + <li><a href="http://perl.apache.org/">mod_perl</a> (if compiling your own mod_perl, make sure you set the <a href="http://perl.apache.org/guide/install.html#EVERYTHING">EVERYTHING</a>=1 compile-time option) + <li><a href="http://www.openssh.com/">SSH</a> (<a href="http://www.openssh.com//">OpenSSH</a> is recommended. SSH Communications Security <a href="http://www.ssh.com/products/ssh/download.cfm">commercial SSH version 3</a> has been reported incompatible with Freeside.) + <li><a href="http://rsync.samba.org/">rsync</a> + <li>A <b>transactional</b> database engine supported by Perl's <a href="http://www.hermetica.com/technologia/DBI/">DBI</a>. + <ul> + <li><a href="http://www.postgresql.org/">PostgreSQL</a> (v7 or higher) is recommended. + <li><b>MySQL does not work at this time.</b> + <i>The following information is provided for developers who wish to contribute MySQL support:</i> See ticket <a href="http://pouncequick.420.am/rt/Ticket/Display.html?id=300">#300</a> in the bug-tracking system. + <!-- <li>MySQL has been reported to work. --> + <b>MySQL's default <a href="http://www.mysql.com/doc/M/y/MyISAM.html">MyISAM</a> and <a href="http://www.mysql.com/doc/I/S/ISAM.html">ISAM</a> table types are not supported</b>. If you really want to use MySQL, you need to use one of the new <a href="http://www.mysql.com/doc/T/a/Table_types.html">transaction-safe table types</a> such as <a href="http://www.mysql.com/doc/B/D/BDB.html">BDB</a>, and set it as the default table type using the <code>--default-table-type=BDB</code> <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Command-line_options">mysqld command-line option</a> or by setting <code>default-table-type=BDB</code> in the <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Option_files">my.cnf option file</a>. + </ul> + <li>Perl modules (<a href="http://theoryx5.uwinnipeg.ca/CPAN/perl/CPAN.html">CPAN</a> will query, download and build perl modules automatically) + <ul> + <li><a href="http://search.cpan.org/search?dist=Array-PrintCols">Array-PrintCols</a> + <li><a href="http://search.cpan.org/search?dist=Term-Query">Term-Query</a> (make test broken; install manually) + <li><a href="http://search.cpan.org/search?dist=MIME-Base64">MIME-Base64</a> + <li><a href="http://search.cpan.org/search?dist=Digest-MD5">Digest-MD5</a> + <li><a href="http://search.cpan.org/search?dist=URI">URI</a> + <li><a href="http://search.cpan.org/search?dist=HTML-Tagset">HTML-Tagset</a> + <li><a href="http://search.cpan.org/search?dist=HTML-Parser">HTML-Parser</a> + <li><a href="http://search.cpan.org/search?dist=libnet">libnet</a> + <li><a href="http://search.cpan.org/search?dist=Locale-Codes">Locale-Codes</a> + <li><a href="http://search.cpan.org/search?dist=Net-Whois">Net-Whois</a> + <li><a href="http://search.cpan.org/search?dist=libwww-perl">libwww-perl</a> + <li><a href="http://search.cpan.org/search?dist=Business-CreditCard">Business-CreditCard</a> + <li><a href="http://search.cpan.org/search?dist=Data-ShowTable">Data-ShowTable</a> + <li><a href="http://search.cpan.org/search?dist=MailTools">MailTools</a> + <li><a href="http://search.cpan.org/search?dist=TimeDate">TimeDate</a> + <li><a href="http://search.cpan.org/search?dist=DateManip">DateManip</a> + <li><a href="http://search.cpan.org/search?dist=File-CounterFile">File-CounterFile</a> + <li><a href="http://search.cpan.org/search?dist=FreezeThaw">FreezeThaw</a> + <li><a href="http://search.cpan.org/search?dist=String-Approx">String-Approx</a> + <li><a href="http://search.cpan.org/search?dist=Text-Template">Text-Template</a> + <li><a href="http://search.cpan.org/search?dist=DBI">DBI</a> + <li><a href="http://search.cpan.org/search?mode=module&query=DBD">DBD for your database engine</a> (<a href="http://search.cpan.org/search?dist=DBD-Pg">DBD::Pg</a> for PostgreSQL, <a href="http://search.cpan.org/search?dist=DBD-mysql">DBD::mysql</a> for MySQL) + <li><a href="http://search.cpan.org/search?dist=DBIx-DataSource">DBIx-DataSource</a> + <li><a href="http://search.cpan.org/search?dist=DBIx-DBSchema">DBIx-DBSchema</a> + <li><a href="http://search.cpan.org/search?dist=Net-SSH">Net-SSH</a> + <li><a href="http://search.cpan.org/search?dist=String-ShellQuote">String-ShellQuote</a> + <li><a href="http://search.cpan.org/search?dist=Net-SCP">Net-SCP</a> + <li><a href="http://www.apache-asp.org/">Apache::ASP</a> or <a href="http://www.masonhq.com/">HTML::Mason</a> + <li><a href="http://search.cpan.org/search?dist=Tie-IxHash">Tie-IxHash</a> + <li><a href="http://search.cpan.org/search?dist=Time-Duration">Time-Duration</a> + </ul> +</ul> +Install the Freeside distribution: +<ul> + <li>Add the user `freeside' to your system. + <li>Allow the freeside user full access to the freeside database. + <ul> + <li> with <a href="http://www.postgresql.org/users-lounge/docs/7.1/postgres/user-manag.html#DATABASE-USERS">PostgreSQL</a>: + <pre> +$ su postgres +$ createuser -P freeside +Enter password for user "freeside": +Enter it again: +Shall the new user be allowed to create databases? (y/n) y +Shall the new user be allowed to create more new users? (y/n) n +CREATE USER</pre> + <li> with <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#User_Account_Management">MySQL</a>: + <pre> +$ mysqladmin -u root password '<i>set_a_root_database_password</i>' +$ mysql -u root -p +mysql> GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE,DROP on freeside.* TO freeside@localhost IDENTIFIED BY '<i>set_a_freeside_database_password</i>';</pre> + </ul> +<!-- <li>Unpack the tarball: <pre>gunzip -c fs-x.y.z.tar.gz | tar xvf -</pre>--> + <li>Edit the top-level Makefile: + <ul> + <li>Set <tt>DATASOURCE</tt> to your <a href="http://search.cpan.org/doc/TIMB/DBI-1.20/DBI.pm">DBI data source</a>, for example, <tt>DBI:Pg:host=localhost;dbname=freeside</tt> for PostgresSQL or <tt>DBI:mysql:freeside</tt> for MySQL. See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.20/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD">manpage for your DBD</a> for the exact syntax of a DBI data source. + <li>Set <tt>DB_PASSWORD</tt> to the freeside database user's password. + </ul> + <li>Add the freeside database to your database engine: + <pre> +$ su +# make create-database</pre> + (or manually, with Postgres:) + <pre> +$ su freeside +$ createdb freeside</pre> + (with MySQL:) + <pre> +$ mysqladmin -u freeside -p create freeside </pre> + <li>Build and install the Perl modules: + <pre> +$ make perl-modules +$ su +# make install-perl-modules</pre> + <li>Create the necessary configuration files:<pre> +$ su +# make create-config +</pre> + <li>You should run a separate iteration of Apache[-SSL] with mod_perl enabled as the freeside user. +</ul> +<table> + <tr> + <th>Apache::ASP</th><th>Mason</th> + </tr> + <tr> + <td><ul> + <li>Run <tt>make aspdocs</tt> + <li>Copy <tt>aspdocs/</tt> to your web server's document space. + <li>Create a <a href="http://www.apache-asp.org/config.html#Global">Global</a> directory, such as <tt>/usr/local/etc/freeside/asp-global/</tt> + <li>Copy <tt>htetc/global.asa</tt> to the Global directory: +<font size="-1"><pre> +cp htetc/global.asa /usr/local/etc/freeside/asp-global/global.asa +</pre></font> + <li>Configure Apache for the Global directory and to execute .cgi files using Apache::ASP. For example: +<font size="-1"><pre> +<Directory /usr/local/apache/htdocs/freeside-asp> +<Files ~ (\.cgi)> +AddHandler perl-script .cgi +PerlHandler Apache::ASP +</Files> +<Perl> +$MLDBM::RemoveTaint = 1; +</Perl> +PerlSetVar Global /usr/local/etc/freeside/asp-global/ +PerlSetVar Debug 2 +</Directory> +</pre></font> + </ul></td> + <td><ul> + <li>Run <tt>make masondocs</tt> + <li>Copy <tt>masondocs/</tt> to your web server's document space. + <li>Copy <tt>htetc/handler.pl</tt> to your web server's configuration directory. + <li>Edit <tt>handler.pl</tt> and set an appropriate <tt>data_dir</tt>, such as <tt>/usr/local/etc/freeside/mason-data</tt> + <li>Configure Apache to use the <tt>handler.pl</tt> file and to execute .cgi files using HTML::Mason. For example: +<font size="-1"><pre> +<Directory /usr/local/apache/htdocs/freeside-mason> +<Files ~ (\.cgi)> +AddHandler perl-script .cgi +PerlHandler HTML::Mason +</Files> +<Perl> +require "/usr/local/apache/conf/handler.pl"; +</Perl> +</Directory> +</pre></font> + </ul></td> + </tr> +</table> +<ul> +<li>Restrict access to this web interface - see the <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache documentation on user authentication</a>. For example, to configure user authentication with <a href="http://httpd.apache.org/docs/mod/mod_auth.html">mod_auth</a> (flat files): +<pre> +<Directory /usr/local/apache/htdocs/freeside-asp> +PerlSetVar Global /usr/local/etc/freeside/asp-global/ +AuthName Freeside +AuthType Basic +AuthUserFile /usr/local/etc/freeside/htpasswd +require valid-user +</Directory> +</pre> + <li>Create one or more Freeside users (your internal sales/tech folks, not customer accounts). These users are setup using using Apache authentication, not UNIX user accounts. For example, using <a href="http://httpd.apache.org/docs/mod/mod_auth.html">mod_auth</a> (flat files): + <ul> + <li>First user:<font size="-1"> +<pre>$ su +$ <a href="man/bin/freeside-adduser.html">freeside-adduser</a> -c -h /usr/local/etc/freeside/htpasswd <i>username</i></pre></font> + <li>Additional users:<font size="-1"> +<pre>$ su +$ <a href="man/bin/freeside-adduser.html">freeside-adduser</a> -h /usr/local/etc/freeside/htpasswd <i>username</i></pre></font> + </ul> + <i>(using other auth types, add each user to your <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache authentication</a> and then run: <tt>freeside-adduser <b>username</b></tt></i> + <li>As the freeside UNIX user, run <tt>bin/fs-setup <b>username</b></tt> to create the database tables, passing the username of a Freeside user you created above: +<pre> +$ su freeside +$ bin/fs-setup <b>username</b> +</pre> + <li><tt>freeside-queued</tt> was installed with the Perl modules. Start it now and ensure that is run upon system startup. + <li>Now proceed to the initial <a href="admin.html">administration</a> of your installation. +</ul> +</body> diff --git a/httemplate/docs/legacy.html b/httemplate/docs/legacy.html new file mode 100755 index 000000000..3ab21dab2 --- /dev/null +++ b/httemplate/docs/legacy.html @@ -0,0 +1,34 @@ +<head> + <title>Importing legacy data</title> +</head> +<body> + <h1>Importing legacy data</h1> +<ul> + <li><a name="svc_acct">bin/svc_acct.import</a> - Import `passwd', ( `shadow' or `master.passwd' ) and RADIUS `users'. Before running bin/svc_acct.import, you need <a href="../browse/part_svc.cgi">services</a> (with table svc_acct) as follows: + <ul> + <li>Most accounts probably have entries in passwd and users (with Port-Limit nonexistant or 1) + <li>Some accounts have entries in passwd and users, but with Port-Limit 2 (or more) + <li>Some accounts might have entries in users only (Port-Limit 1) + <li>Some accounts might have entries in users only (Port-Limit >= 2) + <li>POP mail accounts have entries in passwd only, and have a particular shell. + <li>Everything else in passwd is a shell account. + </ul> + <li><a name="svc_acct_sm">bin/svc_acct_sm.import</a> - Import qmail ( `virtualdomains' and `rcpthosts' ), or sendmail ( `virtusertable' and `sendmail.cw' ) files. Before running bin/svc_acct_sm.import, you need <a href="../browse/part_svc.cgi">services</a> as follows: + <ul> + <li>Domain (table svc_acct) + <li>Mail alias (table svc_acct_sm) + </ul> + <li><a name="cust_main">Importing customer data</a> + <ul> + <li>Manually + <ul> + <li>Add a <a href="../edit/cust_main.cgi">new customer</a> + <li>Add one or more packages for this customer + <li>Enter a package by clicking on the package number + <li>Pick the `Link to existing' option + </ul> + <li>Batch - You will need to write a script to import your particular legacy data. You can use eg/TEMPLATE_cust_main.import as a starting point. + </ul> +</ul> +</body> + diff --git a/httemplate/docs/overview.dia b/httemplate/docs/overview.dia Binary files differnew file mode 100644 index 000000000..a0e34c30e --- /dev/null +++ b/httemplate/docs/overview.dia diff --git a/httemplate/docs/overview.png b/httemplate/docs/overview.png Binary files differnew file mode 100644 index 000000000..bf2dbc26c --- /dev/null +++ b/httemplate/docs/overview.png diff --git a/httemplate/docs/passwd.html b/httemplate/docs/passwd.html new file mode 100755 index 000000000..c4d91480c --- /dev/null +++ b/httemplate/docs/passwd.html @@ -0,0 +1,23 @@ +<head> + <title>fs_passwd</title> +</head> +<body> + <h1>fs_passwd</h1> +You may use fs_passwd/fs_passwd as a "passwd", "chfn" and "chsh" replacement on your shell machine(s) to cause password, gecos and shell changes to update your freeside machine. You can also use the fs_passwd/fs_passwd.html and fs_passwd/fs_passwd.cgi to run a public password change CGI on a public web server. This can pose a security risk if not configured correctly. <b>Do not use this feature unless you understand what you are doing!</b> +<br><br>Currently it is assumed that the the crypt(3) function in the C library is the same on the Freeside machine as on the target machine. +<ul> + <li>Create a freeside account on the shell or web machine(s). + <li>Setup SSH keys: + <ul> + <li>As the freeside user (on your freeside machine), generate an authentication key using <a href="http://www.tac.eu.org/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>. Since this is for unattended operation, use a blank passphrase. + <li>Append the newly-created <code>identity.pub</code> file to <code>~root +/.ssh/authorized_keys</code> on the shell or web machine(s). + <li>Some new SSH v2 implementation accept v2 style keys only. Use the <code>-t</code> option to <a href="http://www.tac.eu.org/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>, and append the created <code>id_dsa.pub</code> or <code>id_rsa.pub</code> to <code>~root/.ssh/authorized_keys2</code> on the remote machine(s). + </ul> + <li>Copy fs_passwd/fs_passwdd to /usr/local/sbin on the shell or web machine(s). (chown freeside, chmod 500) + <li>Create /usr/local/freeside on the shell or web machine(s). (chown freeside, chmod 700) + <li>Run an iteration of "fs_passwd/fs_passwd_server <i>user</i> shell.machine" as the freeside user for each shell or web machine (this is a daemon process). <i>user</i> refers to the freeside user from the <a href="config.html">mapsecrets configuration file</a>. + <li>Copy fs_passwd/fs_passwd to /usr/local/bin on the shell machine(s). (chown freeside, chmod 4755). You may link it to passwd, chfn and chsh as well. + <li>Copy fs_passwd/fs_passwd.cgi to the cgi-bin directory on your web machine(s). Use <a href="http://www.apache.org/docs/suexec.html">suEXEC</a> or <a href="http://www.perldoc.com/perl5.6.1/pod/perlsec.html">suidperl</a> to run fs_passwd.cgi as the freeside user. +</ul> +</body> diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html new file mode 100644 index 000000000..8420161bf --- /dev/null +++ b/httemplate/docs/schema.html @@ -0,0 +1,385 @@ +<head> + <title>Schema reference</title> +</head> +<body> + <h1>Schema reference</h1> + <ul> + <li><a name="agent" href="man/FS/agent.html">agent</a> - Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their agent type). + <ul> + <li>agentnum - primary key + <li>agent - name of this agent + <li>typenum - <a href="#agent_type">agent type</a> + <li>prog - (unimplemented) + <li>freq - (unimplemented) + </ul> + <li><a name="agent_type" href="man/FS/agent_type.html">agent_type</a> - Agent types define groups of packages that you can then assign to particular agents. + <ul> + <li>typenum - primary key + <li>atype - name of this agent type + </ul> + <li><a name="cust_bill" href="man/FS/cust_bill.html">cust_bill</a> - Invoices. Declarations that a customer owes you money. The specific charges are itemized in <a href="#cust_bill_pkg">cust_bill_pkg</a>. + <ul> + <li>invnum - primary key + <li>custnum - <a href="#cust_main">customer</a> + <li>_date + <li>charged - amount of this invoice + <li>printed - how many times this invoice has been printed automatically + <li>closed - books closed flag, empty or `Y' + </ul> + <li><a name="cust_bill_event" href="man/FS/cust_bill_event.html">cust_bill_event</a> - Invoice event history + <ul> + <li>eventnum - primary key + <li>invnum - <a href="#cust_bill">invoice</a> + <li>eventpart - <a href="#part_bill_event">event definition</a> + <li>_date + </ul> + <li><a name="part_bill_event" href="man/FS/part_bill_event.html">part_bill_event</a> - Invoice event definitions + <ul> + <li>eventpart - primary key + <li>payby - CARD, BILL, or COMP + <li>event - event name + <li>eventcode - event action + <li>seconds - how long after the invoice date (<a href="#cust_bill">cust_bill</a>._date) events of this type are triggered + <li>weight - ordering for events with identical seconds + <li>plan - eventcode plan + <li>plandata - additional plan data + <li>disabled - Disabled flag, empty or `Y' + </ul> + <li><a name="cust_bill_pkg" href="man/FS/cust_bill_pkg.html">cust_bill_pkg</a> - Invoice line items + <ul> + <li>invnum - (multiple) key + <li>pkgnum - <a href="#cust_pkg">package</a> or 0 for the special virtual sales tax package + <li>setup - setup fee + <li>recur - recurring fee + <li>sdate - starting date + <li>edate - ending date + </ul> + <li><a name="cust_credit" href="man/FS/cust_credit.html">cust_credit</a> - Credits. The equivalent of a negative <a href="#cust_bill">cust_bill</a> record. + <ul> + <li>crednum - primary key + <li>custnum - <a href="#cust_main">customer</a> + <li>amount - amount credited + <li>_date + <li>otaker - order taker + <li>reason + <li>closed - books closed flag, empty or `Y' + </ul> + <li><a name="cust_credit_bill" href="man/FS/cust_credit_bill.html">cust_credit_bill</a> - Credit invoice application. Links a credit to an invoice. + <ul> + <li>creditbillnum - primary key + <li>crednum - <a href="#cust_credit">credit</a> being applied + <li>invnum - <a href="#cust_bill">invoice</a> to which credit is applied + <li>amount - amount applied + <li>_date + </ul> + <li><a name="cust_main" href="man/FS/cust_main.html">cust_main</a> - Customers + <ul> + <li>custnum - primary key + <li>agentnum - <a href="#agent">agent</a> + <li>refnum - <a href="#part_referral">referral</a> + <li>first - name + <li>last - name + <li>ss - social security number + <li>company + <li>address1 + <li>address2 + <li>city + <li>county + <li>state + <li>zip + <li>country + <li>daytime - phone + <li>night - phone + <li>fax - phone + <li><i>ship_first</i> + <li><i>ship_last</i> + <li><i>ship_company</i> + <li><i>ship_address1</i> + <li><i>ship_address2</i> + <li><i>ship_city</i> + <li><i>ship_county</i> + <li><i>ship_state</i> + <li><i>ship_zip</i> + <li><i>ship_country</i> + <li><i>ship_daytime</i> + <li><i>ship_night</i> + <li><i>ship_fax</i> + <li>payby - CARD, BILL, or COMP + <li>payinfo - card number, P.O.#, or comp issuer + <li>paydate - expiration date + <li>payname - billing name (name on card) + <li>tax - tax exempt, Y or null + <li>otaker - order taker + <li>referral_custnum + <li>comments + </ul> + (columns in <i>italics</i> are optional) + <li><a name="cust_main_invoice" href="man/FS/cust_main_invoice.html">cust_main_invoice</a> - Invoice destinations for email invoices. Note that a customer can have many email destinations for their invoice (either literal or via svcnum), but only one postal destination. + <ul> + <li>destnum - primary key + <li>custnum - <a href="#cust_main">customer</a> + <li>dest - Invoice destination. Freeside supports three types of invoice delivery: send directly to a service defined in Freeside, send to an arbitrary email address, or print the invoice to a printer and have someone send it out via snail mail. Freeside determines which method to use based on the contents of the dest field. If the contents are numeric, a <a href="#svc_acct">svcnum</a> pointing to a valid service is expected in the field. If the contents are a string, a literal email address is expected to be in the field. If the special keyword `POST' is present, the snail mail method is used (which is the default if no cust_main_invoice records exist). Snail mail invoices get their address information from <A name="#cust_main">cust_main</A> and are printed with the printer defined in the configuration files. + </ul> + <li><a name="cust_main_county" href="man/FS/cust_main_county.html">cust_main_county</a> - Tax rates + <ul> + <li>taxnum - primary key + <li>state + <li>county + <li>country + <li>tax - % rate + </ul> + <li><a name="cust_pay" href="man/FS/cust_pay.html">cust_pay</a> - Payments. Money being transferred from a customer. + <ul> + <li>paynum - primary key + <li>custnum - <a href="#cust_main">customer</a> + <li>paid - amount + <li>_date + <li>payby - CARD, BILL, or COMP + <li>payinfo - card number, P.O.#, or comp issuer + <li>paybatch - text field for tracking card processor batches + <li>closed - books closed flag, empty or `Y' + </ul> + <li><a name="cust_bill_pay" href="man/FS/cust_bill_pay.html">cust_bill_pay</a> - Applicaton of a payment to a specific invoice. + <ul> + <li>billpaynum + <li>invnum - <a href="#cust_bill">invoice</a> + <li>paynum - <a href="#cust_pay">payment</a> + <li>amount + <li>_date + </ul> + <li><a name="cust_pay_batch" href="man/FS/cust_pay_batch.html">cust_pay_batch</a> - Pending batch + <ul> + <li>paybatchnum + <li>cardnum + <li>exp - card expiration + <li>amount + <li>invnum - <a href="#cust_bill">invoice</a> + <li>custnum - <a href="#cust_main">customer</a> + <li>payname - name on card + <li>first - name + <li>last - name + <li>address1 + <li>address2 + <li>city + <li>state + <li>zip + <li>country + </ul> + <li><a name="cust_pkg" href="man/FS/cust_pkg.html">cust_pkg</a> - Customer billing items + <ul> + <li>pkgnum - primary key + <li>custnum - <a href="#cust_main">customer</a> + <li>pkgpart - <a href="#part_pkg">Package definition</a> + <li>setup - date + <li>bill - next bill date + <li>susp - (past) suspension date + <li>expire - (future) cancellation date + <li>cancel - (past) cancellation date + <li>otaker - order taker + <li>manual_flag - If this field is set to 1, disables the automatic unsuspensiond of this package when using the <a href="config.html#unsuspendauto">unsuspendauto</a> config file. + </ul> + <li><a name="cust_refund" href="man/FS/cust_refund.html">cust_refund</a> - Refunds. The transfer of money to a customer; equivalent to a negative <a href="#cust_pay">cust_pay</a> record. + <ul> + <li>refundnum - primary key + <li>custnum - <a href="#cust_main">customer</a> + <li>refund - amount + <li>_date + <li>payby - CARD, BILL or COMP + <li>payinfo - card number, P.O.#, or comp issuer + <li>otaker - order taker + <li>closed - books closed flag, empty or `Y' + </ul> + <li><a name="cust_credit_refund" href="man/FS/cust_credit_refund.html">cust_credit_refund</a> - Applicaton of a refund to a specific credit. + <ul> + <li>creditrefundnum - primary key + <li>crednum - <a href="#cust_credit">credit</a> + <li>refundnum - <a href="#cust_refund">refund</a> + <li>amount + <li>_date + </ul> + <li><a name="cust_svc" href="man/FS/cust_svc.html">cust_svc</a> - Customer services + <ul> + <li>svcnum - primary key + <li>pkgnum - <a href="#cust_pkg">package</a> + <li>svcpart - <a href="#part_svc">Service definition</a> + </ul> + <li><a name="nas" href="man/FS/nas.html">nas</a> - Network Access Server (terminal server) + <ul> + <li>nasnum - primary key + <li>nas - NAS name + <li>nasip - NAS ip address + <li>nasfqdn - NAS fully-qualified domain name + <li>last - timestamp indicating the last instant the NAS was in a known state (used by the session monitoring). + </ul> + <li><a name="part_pkg" href="man/FS/part_pkg.html">part_pkg</a> - Package definitions + <ul> + <li>pkgpart - primary key + <li>pkg - package name + <li>comment - non-customer visable package comment + <li>setup - setup fee expression + <li>freq - recurring frequency (months) + <li>recur - recurring fee expression + <li>setuptax - Setup fee tax exempt flag, empty or `Y' + <li>recurtax - Recurring fee tax exempt flag, empty or `Y' + <li>plan - price plan + <li>plandata - additional price plan data + <li>disabled - Disabled flag, empty or `Y' + </ul> + <li><a name="part_referral" href="man/FS/part_referral.html">part_referral</a> - Referral listing + <ul> + <li>refnum - primary key + <li>referral - referral + </ul> + <li><a name="part_svc" href="man/FS/part_svc.html">part_svc</a> - Service definitions + <ul> + <li>svcpart - primary key + <li>svc - name of this service + <li>svcdb - table used for this service: svc_acct, svc_acct_sm, svc_forward, svc_domain, svc_charge or svc_wo + <li>disabled - Disabled flag, empty or `Y' +<!-- <li><i>table</i>__<i>field</i> - Default or fixed value for <i>field</i> in <i>table</i> + <li><i>table</i>__<i>field</i>_flag - null, D or F +--> + </ul> + <li><a name="part_svc_column" href="man/FS/part_svc_column.html">part_svc_column</a> + <ul> + <li>columnnum - primary key + <li>svcpart - <a href="#part_svc">Service definition</a> + <li>columnname - column name in part_svc.svcdb table + <li>columnvalue - default or fixed value for the column + <li>columnflag - null, D or F + </ul> + <li><a name="pkg_svc" href="man/FS/pkg_svc.html">pkg_svc</a> + <ul> + <li>pkgpart - <a href="#part_pkg">Package definition</a> + <li>svcpart - <a href="#part_svc">Service definition</a> + <li>quantity - quantity of this service that this package includes + </ul> + <li><a name="part_export" href="man/FS/part_export.html">part_export</a> - Export to external provisioning + <ul> + <li>exportnum - primary key + <li>svcpart - <a href="#part_svc">Service definition</a> + <li>machine - Machine name + <li>exporttype - Export type + <li>nodomain - blank or Y: usernames are exported to this service with no domain + </ul> + <li><a name="part_export_option" href="man/FS/part_export_option.html">part_export_option</a> - provisioning options + <ul> + <li>optionnum - primary key + <li>exportnum - <a href="#part_export">Export</a> + <li>optionname - option name + <li>optionvalue - option value + </ul> + <li><a name="port" href="man/FS/port.html">port</a> - individual port on a <a href="#nas">nas</a> + <ul> + <li>portnum - primary key + <li>ip - IP address of this port + <li>nasport - port number on the NAS + <li>nasnum - <a href="#nas">NAS</a> + </ul> + <li><a name="prepay_credit" href="man/FS/prepay_credit.html">prepay_credit</a> + <ul> + <li>prepaynum - primary key + <li>identifier - text or numeric string used to receive this credit + <li>amount - amount of credit + </ul> + <li><a name="session" href="man/FS/session.html">session</a> + <ul> + <li>sessionnum - primary key + <li>portnum - <a href="#port">Port</a> + <li>svcnum - <a href="#svc_acct">Account</a> + <li>login - timestamp indicating the beginning of this user session. + <li>logout - timestamp indicating the end of this user session. May be null, which indicates a currently open session. + </ul> + + <li><a name="svc_acct" href="man/FS/svc_acct.html">svc_acct</a> - Accounts + <ul> + <li>svcnum - <a href="#cust_svc">primary key</a> + <li>username + <li>_password + <li>popnum - <a href="#svc_acct_pop">Point of Presence</a> + <li>uid + <li>gid + <li>finger - GECOS + <li>dir + <li>shell + <li>quota - (unimplementd) + <li>slipip - IP address + <li>seconds + <li>domsvc + <li>radius_<i>Radius_Reply_Attribute</i> - Radius-Reply-Attribute + <li>rc_<i>Radius_Check_Attribute</i> - Radius-Check-Attribute + </ul> + <li><a name="svc_acct_pop" href="man/FS/svc_acct_pop.html">svc_acct_pop</a> - Points of Presence + <ul> + <li>popnum - primary key + <li>city + <li>state + <li>ac - area code + <li>exch - exchange + <li>loc - rest of number + </ul> + <li><a name="part_pop_local" href="man/FS/part_pop_local.html">part_pop_local</a> - Local calling areas + <ul> + <li>localnum - primary key + <li>popnum - primary key + <li>city + <li>state + <li>npa - area code + <li>nxx - exchange + </ul> + <li><a name="svc_acct_sm" href="man/FS/svc_acct_sm.html">svc_acct_sm</a> - <b>DEPRECIATED</b> Domain mail aliases + <ul> + <li>svcnum - <a href="#cust_svc">primary key</a> + <li>domsvc - <a href="#svc_domain">Domain</a> (by svcnum) + <li>domuid - <a href="#svc_acct">Account</a> (by uid) + <li>domuser - domuser @ <a href="#svc_domain">Domain</a> forwards to <a href="#svc_acct">Account</a> + </ul> + <li><a name="svc_domain" href="man/FS/svc_domain.html">svc_domain</a> - Domains + <ul> + <li>svcnum - <a href="#cust_svc">primary key</a> + <li>domain + </ul> + <li><a name="svc_forward" href="man/FS/svc_forward.html">svc_forward</a> - Mail forwarding aliases + <ul> + <li>svcnum - <a href="#cust_svc">primary key</a> + <li>srcsvc - <a href="#svc_acct">svcnum of the source of this forward</a> + <li>dstsvc - <a href="#svc_acct">svcnum of the destination of this forward</a> + <li>dst - foreign destination (email address) - forward not local to freeside + </ul> + <li><a name="domain_record" href="man/FS/domain_record.html">domain_record</a> - Domain zone detail + <ul> + <li>recnum - primary key + <li>svcnum - <a href="#svc_domain">Domain</a> (by svcnum) + <li>reczone - zone for this line + <li>recaf - address family, usually <b>IN</b> + <li>rectype - type for this record (<b>A</b>, <b>MX</b>, etc.) + <li>recdata - data for this record + </ul> + <li><a name="svc_www" href="man/FS/svc_www.html">svc_www</a> + <ul> + <li>svcnum - <a href="#cust-svc">primary key</a> + <li>recnum - <a href="#domain_record">host</a> + <li>usersvc - <a href="#svc_acct">account</a> + </ul> + <li><a name="type_pkgs" href="man/FS/type_pkgs.html">type_pkgs</a> + <ul> + <li>typenum - <a href="#agent_type">agent type</a> + <li>pkgpart - <a href="#part_pkg">Package definition</a> + </ul> + <li><a name="queue" href="man/FS/queue.html">queue</a> - job queue + <ul> + <li>jobnum - primary key + <li>job + <li>_date + <li>status + <li>statustext + <li>svcnum + </ul> + <li><a name="queue_arg" href="man/FS/queue_arg.html">queue_arg</a> - job arguments + <ul> + <li>argnum - primary key + <li>jobnum - <a href="#queue">job</a> + <li>arg - argument + </ul> + </ul> +</body> diff --git a/httemplate/docs/session.html b/httemplate/docs/session.html new file mode 100644 index 000000000..7dac5fdf7 --- /dev/null +++ b/httemplate/docs/session.html @@ -0,0 +1,54 @@ +<head> + <title>Session monitor</title> +</head> +<body> +<h1>Session monitor</h1> +<h2>Installation</h2> +For security reasons, the client portion of the session montior may run on one +or more external public machine(s). On these machines, install: +<ul> + <li><a href="http://www.perl.com/CPAN/doc/relinfo/INSTALL.html">Perl</a> (at l +east 5.004_05 for the 5.004 series or 5.005_03 for the 5.005 series. Don't enable experimental features like threads or the PerlIO abstraction layer.) + <li><a href="man/FS/SessionClient.html">FS::SessionClient</a> (copy the fs_session/FS-SessionClient directory to the external machine, then: perl Makefile.PL; make; make install) +</ul> +Then: +<ul> + <li>Add the user `freeside' to the the external machine. + <li>Create the /usr/local/freeside directory on the external machine (owned by the freeside user). + <li>touch /usr/local/freeside/fs_sessiond_socket; chown freeside /usr/local/freeside/fs_sessiond_socket; chmod 600 /usr/local/freeside/fs_sessiond_socket + <li>Append the identity.pub from the freeside user on your freeside machine to the authorized_keys file of the newly created freeside user on the external machine(s). + <li>Run <pre>fs_session_server <i>user</i> <i>machine</i></pre> on the Freeside machine. + <ul> + <li><i>user</i> is a user from the mapsecrets file. + <li><i>machine</i> is the name of the external machine. + </ul> +</ul> +<h2>Usage</h2> +<ul> + <li>Web + <ul> + <li>Copy FS-SessionClient/cgi/login.cgi and logout.cgi to your web + server's document space. + <li>Use <a href="http://www.apache.org/docs/suexec.html">suEXEC</a> or <a href="http://www.perl.com/CPAN-local/doc/manual/html/pod/perlsec.html#Security_Bugs">setuid</a> (see <a href="install.html">install.html</a> for details) to run login.cgi and logout.cgi as the freeside user. + </ul> + <li>Command-line + <br><pre>freeside-login username ( portnum | ip | nasnum nasport ) +freeside-logout username ( portnum | ip | nasnum nasport )</pre> + <ul> + <li><i>username</i> is a customer username from the svc_acct table + <li><i>portnum</i>, <i>ip</i> or <i>nasport</i> and <i>nasnum</i> uniquely identify a port in the <a href="schema.html#port">port</a> database table. + </ul> + <li>RADIUS + <ul> + <li>Configure your RADIUS server's login and logout callbacks to use the command-line <tt>freeside-login</tt> and <tt>freeside-logout</tt> utilites. + </ul> +</ul> +<h2>Callbacks</h2> +<ul> + <li>Sesstion start - The command(s) specified in the <a href="config.html#session-start">session-start</a> configuration file are executed on the Freeside machine. The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on. + <li>Session end - The command(s) specified in the <a href="config.html#session-stop">session-stop</a> configuration file are executed on the Freeside machine. The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on. +</ul> +<h2>Dropping expired users</h2> +Run <pre>bin/freeside-session-kill username</pre> periodically from cron. +</body> +</html> diff --git a/httemplate/docs/signup.html b/httemplate/docs/signup.html new file mode 100644 index 000000000..262b697bb --- /dev/null +++ b/httemplate/docs/signup.html @@ -0,0 +1,60 @@ +<head> + <title>Signup server</title> +</head> +<body> + <h1>Signup server</h1> +For security reasons, the signup server should run on an external public +webserver. On this machine, install: +<ul> + <li>A web server, such as <a href="http://www.apache-ssl.org">Apache-SSL</a> or <a href="http://www.apache.org">Apache</a> + <li><a href="ftp://ftp.cs.hut.fi/pub/ssh/">SSH</a> + <li><a href="http://www.perl.com/CPAN/doc/relinfo/INSTALL.html">Perl</a> (at least 5.004_05 for the 5.004 series or 5.005_03 for the 5.005 series. Don't enable experimental features like threads or the PerlIO abstraction layer.) + <li><a href="http://www.perl.com/CPAN/modules/by-module/Text/">Text::Template</a> + <li><a href="http://www.sisd.com/useragent">HTTP::Headers::UserAgent</a> (version 2.0 or higher; not yet indexed correctly on CPAN) + + <li><a href="man/FS/SignupClient.html">FS::SignupClient</a> (copy the fs_signup/FS-SignupClient directory to the external machine, then: perl Makefile.PL; make; make install) +</ul> +Then: +<ul> + <li>Add the user `freeside' to the the external machine. + <li>Copy or symlink fs_signup/FS-SignupClient/cgi/signup.cgi into the web server's document space. + <li>When linking to signup.cgi, you can include a referring custnum in the URL as follows: <code>http://public.web.server/path/signup.cgi?ref=1542</code> + <li>Enable CGI execution for files with the `.cgi' extension. (with <a href="http://www.apache.org/docs/mod/mod_mime.html#addhandler">Apache</a>) + <li>Create the /usr/local/freeside directory on the external machine (owned by the freeside user). + <li>touch /usr/local/freeside/fs_signupd_socket; chown freeside /usr/local/freeside/fs_signupd_socket; chmod 600 /usr/local/freeside/fs_signupd_socket + <li>Use <a href="http://www.apache.org/docs/suexec.html">suEXEC</a> or <a href="http://www.perl.com/CPAN-local/doc/manual/html/pod/perlsec.html#Security_Bugs">setuid</a> (see <a href="install.html">install.html</a> for details) to run signup.cgi as the freeside user. + <li>Append the identity.pub from the freeside user on your freeside machine to the authorized_keys file of the newly created freeside user on the external machine(s). + <li>Run <pre>fs_signup_server <i>user</i> <i>machine</i> <i>agentnum</i> <i>refnum</i></pre> on the Freeside machine. + <ul> + <li><i>user</i> is a user from the mapsecrets file. + <li><i>machine</i> is the name of the external machine. + <li><i>agentnum</i> and <i>refnum</i> are the <a href="schema.html#agent">agent</a> and <a href="schema.html#part_referral">referral</a>, respectively, to use for customers who sign up via this signup server. + </ul> +</ul> +Optional: +<ul> + <li>If you create a <b>/usr/local/freeside/ieak.template</b> file on the external machine, it will be sent to IE users with MIME type <i>application/x-Internet-signup</i>. This file will be processed with <a href="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</a> with the following variables available: + <ul> + <li>$ac - area code of selected POP + <li>$exch - exchange of selected POP + <li>$loc - local part of selected POP + <li>$username + <li>$password + <li>$email_name - first and last name + </ul> + (an example file is included as <b>fs_signup/ieak.template</b>) See the <a href="http://www.microsoft.com/windows/ieak/techinfo/deploy/60/en/toc.asp">IEAK documentation</a> for more information. + <li>If you create a <b>/usr/local/freeside/cck.template</b> file on the external machine, the variables defined will be sent to Netscape users with MIME type <i>application/x-netscape-autoconfigure-dialer-v2</i>. This file will be processed with <a href="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</a> with the following variables available: + <ul> + <li>$ac - area code of selected POP + <li>$exch - exchange of selected POP + <li>$loc - local part of selected POP + <li>$username + <li>$password + <li>$email_name - first and last name + </ul> + (an example file is included as <b>fs_signup/cck.template</b>). See the <a href="http://help.netscape.com/products/client/mc/acctproc4.html">Netscape documentation</a> for more information. + <li>If you create a <b>/usr/local/freeside/signup.html</b> file on the external machine, it will be used as a template for the form HTML. This requires the template to be constructed appropriately; probably best to start with the example file included as <b>fs_signup/FS-SignupClient/cgi/signup.html</b>. + <li>If you create a <b>/usr/local/freeside/success.html</b> file on the external machine, it will be used as the success HTML page. Although template substiutions are available, a regular HTML file will work fine here, unlike signup.html. An example file is included as <b>fs_signup/FS-SignupClient/cgi/success.html</b> + <li>If there are any entries in the <i>prepay_credit</i> table, a user can enter a string matching the <b>identifier</i> column to receive the credit specified in the <b>amount</b> column, and/or the time specified in the <b>seconds</b> column (for use with the <a href="session.html">session monitor</a>), after which that <b>identifier</b> is no longer valid. This can be used to implement pre-paid "calling card" type signups. The <i>bin/generate-prepay</i> script can be used to populate the <i>prepay_credit</i> table. +</ul> +</body> diff --git a/httemplate/docs/trouble.html b/httemplate/docs/trouble.html new file mode 100755 index 000000000..fce743928 --- /dev/null +++ b/httemplate/docs/trouble.html @@ -0,0 +1,26 @@ +<head> + <title>Troubleshooting</title> +</head> +<body> + <h1>Troubleshooting</h1> + <ul> + <li>When troubleshooting the web interface, helpful information is often in your web server's error log. + <li>If bin/svc_acct.import fails with an "Out of memory!" error using MySQL, upgrede MySQL and recompile the Perl DBD. There was a memory leak in some older versions of MySQL. + <li>If you get tons of errors in your web server's error log like this: +<pre> +Ambiguous use of value => resolved to "value" => +at /usr/lib/perl5/site_perl/File/CounterFile.pm line 132. +</pre> + This clutters up your log files but is otherwise harmless. Upgrade to the latest File::CounterFile. + <li>If you get errors like this: +<pre> +UID.pm: Can't open /var/spool/freeside/conf/secrets: Permission denied +at <i>/your/path</i>/site_perl/FS/UID.pm line 26. +BEGIN failed--compilation aborted at +<i>/your/path</i>/edit/process/part_svc.cgi line 15. +</pre> + Then the scripts are not running as the freeside freeside user. See +the <a href="install.html">New Installation</a> section of the documentation. + <li>If you receive `can not connect to server' errors using MySQL on a system that doesn't support native threading, you may need to specify the full hostname in your DBI datasource. See the <a href="http://www.mysql.com/Manual_chapter/manual_Problems.html#Can_not_connect_to_server">MySQL documentation</a>, DBI manpage and the DBD::mysql manpage for details. + </ul> +</body> diff --git a/httemplate/docs/upgrade4.html b/httemplate/docs/upgrade4.html new file mode 100644 index 000000000..1d70f8b73 --- /dev/null +++ b/httemplate/docs/upgrade4.html @@ -0,0 +1,27 @@ +<head> + <title>Upgrading to 1.2.2</title> +</head> +<body> +<h1>Upgrading to 1.2.2 from 1.2.x</h1> +<ul> + <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first. + <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first. + <li>If migrating from less than 1.2.0, see these <a href="upgrade3.html">instructions</a> first. + <li>Back up your data and current Freeside installation. + <li>Install the Perl modules <a href="http://www.perl.com/CPAN/modules/by-module/Locale/">Locale-Codes</a> and <a href="http://www.perl.com/CPAN/modules/by-module/Net/">Net-Whois</a>. + <li>Apply the following changes to your database: +<pre> +ALTER TABLE cust_pay_batch CHANGE exp exp VARCHAR(11); +</pre> + <li>Copy or symlink htdocs to the new copy. + <li>Remove the symlink or directory <i>(your_site_perl_directory)</i>/FS. + <li>Change to the FS directory in the new tarball, and build and install the + Perl modules: + <pre> +$ cd FS/ +$ perl Makefile.PL +$ make +$ su +# make install</pre> + <li>Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly. +</body> diff --git a/httemplate/docs/upgrade5.html b/httemplate/docs/upgrade5.html new file mode 100644 index 000000000..3f3431653 --- /dev/null +++ b/httemplate/docs/upgrade5.html @@ -0,0 +1,34 @@ +<head> + <title>Upgrading to 1.3.0</title> +</head> +<body> +<h1>Upgrading to 1.2.3 from 1.2.2</h1> +<ul> + <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first. + <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first. + <li>If migrating from less than 1.2.0, see these <a href="upgrade3.html">instructions</a> first. + <li>If migrating from less than 1.2.2, see these <a href="upgrade4.html">instructions</a> first. + <li>Back up your data and current Freeside installation. + <li>Apply the following changes to your database: +<pre> +ALTER TABLE svc_acct_pop ADD loc CHAR(4); +CREATE TABLE prepay_credit ( + prepaynum int NOT NULL, + identifier varchar(80) NOT NULL, + amount decimal(10,2) NOT NULL, + PRIMARY KEY (prepaynum), + INDEX (identifier) +); +</pre> + <li>Copy or symlink htdocs to the new copy. + <li>Remove the symlink or directory <i>(your_site_perl_directory)</i>/FS. + <li>Change to the FS directory in the new tarball, and build and install the + Perl modules: + <pre> +$ cd FS/ +$ perl Makefile.PL +$ make +$ su +# make install</pre> + <li>Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly. +</body> diff --git a/httemplate/docs/upgrade6.html b/httemplate/docs/upgrade6.html new file mode 100644 index 000000000..dc82975f3 --- /dev/null +++ b/httemplate/docs/upgrade6.html @@ -0,0 +1,66 @@ +<head> + <title>Upgrading to 1.3.0</title> +</head> +<body> +<h1>Upgrading to 1.3.0 from 1.2.3</h1> +<ul> + <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first. + <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first. + <li>If migrating from less than 1.2.0, see these <a href="upgrade3.html">instructions</a> first. + <li>If migrating from less than 1.2.2, see these <a href="upgrade4.html">instructions</a> first. + <li>If migrating from less than 1.2.3, see these <a href="upgrade5.html">instructions</a> first. + <li>Back up your data and current Freeside installation. + <li>As 1.3.0 requires transactions, <b>MySQL's default <a href="http://www.mysql.com/doc/M/y/MyISAM.html">MyISAM</a> and <a href="http://www.mysql.com/doc/I/S/ISAM.html">ISAM</a> table types are no longer supported</b>. Converting to <a href="http://www.postgresql.org/">PostgreSQL</a> is recommended. If you really want to use MySQL, convert your tables to one of the <a href="http://www.mysql.com/doc/T/a/Table_types.html">transaction-safe table types</a> such as <a href="http://www.mysql.com/doc/B/D/BDB.html">BDB</a>. + <li>Copy the <i>invoice_template</i> file from the <i>conf/</i> directory in the distribution to your <a href="config.html">configuration directory</a>. + <li>Install the <a href="http://search.cpan.org/search?dist=Text-Template">Text-Template</a>, <a href="http://search.cpan.org/search?dist=DBIx-DBSchema">DBIx-DBSchema</a>, <a href="http://search.cpan.org/search?dist=Net-SSH">Net-SSH</a>, <a href="http://search.cpan.org/search?dist=String-ShellQuote">String-ShellQuote</a> and <a href="http://search.cpan.org/search?dist=Net-SCP">Net-SCP</a> Perl modules. + <li>Apply the following changes to your database: +<pre> +CREATE TABLE domain_record ( + recnum int NOT NULL, + svcnum int NOT NULL, + reczone varchar(80) NOT NULL, + recaf char(2) NOT NULL, + rectype char(5) NOT NULL, + recdata varchar(80) NOT NULL, + PRIMARY KEY (recnum) +); +CREATE TABLE svc_www ( + svcnum int NOT NULL, + recnum int NOT NULL, + usersvc int NOT NULL, + PRIMARY KEY (svcnum) +); +ALTER TABLE part_svc ADD svc_www__recnum varchar(80) NULL; +ALTER TABLE part_svc ADD svc_www__recnum_flag char(1) NULL; +ALTER TABLE part_svc ADD svc_www__usersvc varchar(80) NULL; +ALTER TABLE part_svc ADD svc_www__uesrsvc_flag char(1) NULL; +ALTER TABLE svc_acct CHANGE _password _password varchar(50) NULL; +ALTER TABLE svc_acct ADD seconds integer NULL; +ALTER TABLE part_svc ADD svc_acct__seconds integer NULL; +ALTER TABLE part_svc ADD svc_acct__seconds_flag char(1) NULL; +ALTER TABLE prepay_credit ADD seconds integer NULL; + +</pre> + <li>If your database supports dropping columns: +<pre> +ALTER TABLE cust_bill DROP owed; +ALTER TABLE cust_credit DROP credited; +</pre> + Or, if your database does not support dropping columns, you can do this: +<pre> +ALTER TABLE cust_bill CHANGE owed depriciated decimal(10,2); +ALTER TABLE cust_credit CHANGE credited depriciated2 decimal(10,2); +</pre> + + <li>Copy or symlink htdocs to the new copy. + <li>Remove the symlink or directory <i>(your_site_perl_directory)</i>/FS. + <li>Change to the FS directory in the new tarball, and build and install the + Perl modules: + <pre> +$ cd FS/ +$ perl Makefile.PL +$ make +$ su +# make install</pre> + <li>Run bin/dbdef-create. +</body> diff --git a/httemplate/docs/upgrade7.html b/httemplate/docs/upgrade7.html new file mode 100644 index 000000000..d9dcfe2ae --- /dev/null +++ b/httemplate/docs/upgrade7.html @@ -0,0 +1,24 @@ +<head> + <title>Upgrading to 1.3.1</title> +</head> +<body> +<h1>Upgrading to 1.3.1 from 1.3.0</h1> +<ul> + <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first. + <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first. + <li>If migrating from less than 1.2.0, see these <a href="upgrade3.html">instructions</a> first. + <li>If migrating from less than 1.2.2, see these <a href="upgrade4.html">instructions</a> first. + <li>If migrating from less than 1.2.3, see these <a href="upgrade5.html">instructions</a> first. + <li>If migrating from less than 1.3.0, see these <a href="upgrade6.html">instructions</a> first. + <li>Back up your data and current Freeside installation. + <li>Copy or symlink htdocs to the new copy. + <li>Change to the FS directory in the new tarball, and build and install the + Perl modules: + <pre> +$ cd FS/ +$ perl Makefile.PL +$ make +$ su +# make install UNINST=1</pre> + <li>Run bin/dbdef-create. +</body> diff --git a/httemplate/docs/upgrade8.html b/httemplate/docs/upgrade8.html new file mode 100644 index 000000000..e11041682 --- /dev/null +++ b/httemplate/docs/upgrade8.html @@ -0,0 +1,313 @@ +<head> + <title>Upgrading to 1.4.0</title> +</head> +<body> +<h1>Upgrading to 1.4.0 from 1.3.1</h1> +<ul> + <li>If migrating from less than 1.3.1, see these <a href="upgrade7.html">instructions</a> first. + <li><font size="+2" color="#ff0000">Backup your database and current Freeside installation.</font> (with <a href="http://www.ca.postgresql.org/devel-corner/docs/postgres/backup.html">PostgreSQL</a>) (with <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Backup">MySQL</a>) + <li><a href="http://perl.apache.org/">mod_perl</a> is now required. + <li>Install <a href="http://search.cpan.org/search?dist=Time-Duration">Time-Duration</a>, and <a href="http://search.cpan.org/search?dist=Tie-IxHash">Tie-IxHash</a> + <li>Install <a href="http://www.apache-asp.org/">Apache::ASP</a> or <a href="http://www.masonhq.com/">HTML::Mason</a>. + <li>Install <a href="http://rsync.samba.org/">rsync</a> +</ul> +<table> + <tr> + <th>Apache::ASP</th><th>Mason</th> + </tr> + <tr> + <td><ul> + <li>Run <tt>make aspdocs</tt> + <li>Copy <tt>aspdocs/</tt> to your web server's document space. + <li>Create a <a href="http://www.apache-asp.org/config.html#Global">Global</a> directory, such as <tt>/usr/local/etc/freeside/asp-global/</tt> + <li>Copy <tt>htetc/global.asa</tt> to the Global directory. + <li>Configure Apache for the Global directory and to execute .cgi files using Apache::ASP. For example: +<font size="-1"><pre> +<Directory /usr/local/apache/htdocs/freeside-asp> +<Files ~ (\.cgi)> +AddHandler perl-script .cgi +PerlHandler Apache::ASP +</Files> +<Perl> +$MLDBM::RemoveTaint = 1; +</Perl> +PerlSetVar Global /usr/local/etc/freeside/asp-global/ +</Directory> +</pre></font> + </ul></td> + <td><ul> + <li>Run <tt>make masondocs</tt> + <li>Copy <tt>masondocs/</tt> to your web server's document space. + <li>Copy <tt>htetc/handler.pl</tt> to your web server's configuration directory. + <li>Edit <tt>handler.pl</tt> and set an appropriate <tt>data_dir</tt>, such as <tt>/usr/local/etc/freeside/mason-data</tt> + <li>Configure Apache to use the <tt>handler.pl</tt> file and to execute .cgi files using HTML::Mason. For example: +<font size="-1"><pre> +<Directory /usr/local/apache/htdocs/freeside-mason> +<Files ~ (\.cgi)> +AddHandler perl-script .cgi +PerlHandler HTML::Mason +</Files> +<Perl> +require "/usr/local/apache/conf/handler.pl"; +</Perl> +</Directory> +</pre></font> + </ul></td> + </tr> +</table> +<ul> + <li>Build and install the Perl modules: + <pre> +$ su +# make install-perl-modules</pre> + <li>Apply the following changes to your database: +<pre> +CREATE TABLE svc_forward ( + svcnum int NOT NULL, + srcsvc int NOT NULL, + dstsvc int NOT NULL, + dst varchar(80), + PRIMARY KEY (svcnum) +); + +CREATE TABLE cust_credit_bill ( + creditbillnum int primary key, + crednum int not null, + invnum int not null, + _date int not null, + amount decimal(10,2) not null +); + +CREATE TABLE cust_bill_pay ( + billpaynum int primary key, + invnum int not null, + paynum int not null, + _date int not null, + amount decimal(10,2) not null +); + +CREATE TABLE cust_credit_refund ( + creditrefundnum int primary key, + crednum int not null, + refundnum int not null, + _date int not null, + amount decimal(10,2) not null +); + +CREATE TABLE part_svc_column ( + columnnum int primary key, + svcpart int not null, + columnname varchar(64) not null, + columnvalue varchar(80) null, + columnflag char(1) null +); + +CREATE TABLE queue ( + jobnum int primary key, + job text not null, + _date int not null, + status varchar(80) not null, + statustext text null, + svcnum int null +); +CREATE INDEX queue1 ON queue ( svcnum ); +CREATE INDEX queue2 ON queue ( status ); + +CREATE TABLE queue_arg ( + argnum int primary key, + jobnum int not null, + arg text null +); +CREATE INDEX queue_arg1 ON queue_arg ( jobnum ); + +CREATE TABLE part_pop_local ( + localnum int primary key, + popnum int not null, + city varchar(80) null, + state char(2) null, + npa char(3) not null, + nxx char(3) not null +); +CREATE UNIQUE INDEX part_pop_local1 ON part_pop_local ( npa, nxx ); + +CREATE TABLE cust_bill_event ( + eventnum int primary key, + invnum int not null, + eventpart int not null, + _date int not null +); +CREATE UNIQUE INDEX cust_bill_event1 ON cust_bill_event ( eventpart, invnum ); +CREATE INDEX cust_bill_event2 ON cust_bill_event ( invnum ); + +CREATE TABLE part_bill_event ( + eventpart int primary key, + payby char(4) not null, + event varchar(80) not null, + eventcode text null, + seconds int null, + weight int not null, + plan varchar(80) null, + plandata text null, + disabled char(1) null +); +CREATE INDEX part_bill_event1 ON part_bill_event ( payby ); + +CREATE TABLE part_export ( + exportnum int primary key, + svcpart int not null, + machine varchar(80) not null, + exporttype varchar(80) not null, + nodomain char(1) NULL +); +CREATE INDEX part_export1 ON part_export ( machine ); +CREATE INDEX part_export2 ON part_export ( exporttype ); + +CREATE INDEX part_export_option ( + optionnum int primary key, + exportnum int not null, + optionname varchar(80) not null, + optionvalue text NULL +); +CREATE INDEX part_export_option1 ON part_export_option ( exportnum ); +CREATE INDEX part_export_option2 ON part_export_option ( optionname ); + +ALTER TABLE svc_acct ADD domsvc integer NOT NULL; +ALTER TABLE svc_domain ADD catchall integer NULL; +ALTER TABLE cust_main ADD referral_custnum integer NULL; +ALTER TABLE cust_pay ADD custnum integer; +ALTER TABLE cust_pay_batch ADD paybatchnum integer; +ALTER TABLE cust_refund ADD custnum integer; +ALTER TABLE cust_pkg ADD manual_flag char(1) NULL; +ALTER TABLE part_pkg ADD plan varchar(80) NULL; +ALTER TABLE part_pkg ADD plandata text NULL; +ALTER TABLE part_pkg ADD setuptax char(1) NULL; +ALTER TABLE part_pkg ADD recurtax char(1) NULL; +ALTER TABLE part_pkg ADD disabled char(1) NULL; +ALTER TABLE part_svc ADD disabled char(1) NULL; +ALTER TABLE cust_bill ADD closed char(1) NULL; +ALTER TABLE cust_pay ADD closed char(1) NULL; +ALTER TABLE cust_credit ADD closed char(1) NULL; +ALTER TABLE cust_refund ADD closed char(1) NULL; +CREATE INDEX cust_main3 ON cust_main ( referral_custnum ); +CREATE INDEX cust_credit_bill1 ON cust_credit_bill ( crednum ); +CREATE INDEX cust_credit_bill2 ON cust_credit_bill ( invnum ); +CREATE INDEX cust_bill_pay1 ON cust_bill_pay ( invnum ); +CREATE INDEX cust_bill_pay2 ON cust_bill_pay ( paynum ); +CREATE INDEX cust_credit_refund1 ON cust_credit_refund ( crednum ); +CREATE INDEX cust_credit_refund2 ON cust_credit_refund ( refundnum ); +CREATE UNIQUE INDEX cust_pay_batch_pkey ON cust_pay_batch ( paybatchnum ); +CREATE UNIQUE INDEX part_svc_column1 ON part_svc_column ( svcpart, columnname ); +CREATE INDEX cust_pay2 ON cust_pay ( paynum ); +CREATE INDEX cust_pay3 ON cust_pay ( custnum ); +CREATE INDEX cust_pay4 ON cust_pay ( paybatch ); +</pre> + + <li>If you are using PostgreSQL, apply the following changes to your database: +<pre> +CREATE UNIQUE INDEX agent_pkey ON agent ( agentnum ); +CREATE UNIQUE INDEX agent_type_pkey ON agent_type ( typenum ); +CREATE UNIQUE INDEX cust_bill_pkey ON cust_bill ( invnum ); +CREATE UNIQUE INDEX cust_credit_pkey ON cust_credit ( crednum ); +CREATE UNIQUE INDEX cust_main_pkey ON cust_main ( custnum ); +CREATE UNIQUE INDEX cust_main_county_pkey ON cust_main_county ( taxnum ); +CREATE UNIQUE INDEX cust_main_invoice_pkey ON cust_main_invoice ( destnum ); +CREATE UNIQUE INDEX cust_pay_pkey ON cust_pay ( paynum ); +CREATE UNIQUE INDEX cust_pkg_pkey ON cust_pkg ( pkgnum ); +CREATE UNIQUE INDEX cust_refund_pkey ON cust_refund ( refundnum ); +CREATE UNIQUE INDEX cust_svc_pkey ON cust_svc ( svcnum ); +CREATE UNIQUE INDEX domain_record_pkey ON domain_record ( recnum ); +CREATE UNIQUE INDEX nas_pkey ON nas ( nasnum ); +CREATE UNIQUE INDEX part_pkg_pkey ON part_pkg ( pkgpart ); +CREATE UNIQUE INDEX part_referral_pkey ON part_referral ( refnum ); +CREATE UNIQUE INDEX part_svc_pkey ON part_svc ( svcpart ); +CREATE UNIQUE INDEX port_pkey ON port ( portnum ); +CREATE UNIQUE INDEX prepay_credit_pkey ON prepay_credit ( prepaynum ); +CREATE UNIQUE INDEX session_pkey ON session ( sessionnum ); +CREATE UNIQUE INDEX svc_acct_pkey ON svc_acct ( svcnum ); +CREATE UNIQUE INDEX svc_acct_pop_pkey ON svc_acct_pop ( popnum ); +CREATE UNIQUE INDEX svc_acct_sm_pkey ON svc_acct_sm ( svcnum ); +CREATE UNIQUE INDEX svc_domain_pkey ON svc_domain ( svcnum ); +CREATE UNIQUE INDEX svc_www_pkey ON svc_www ( svcnum ); +CREATE UNIQUE INDEX type_pkgs_pkey ON type_pkgs ( typenum ); +</pre> + <li>If you wish to enable service/shipping addresses, apply the following + changes to your database: +<pre> +ALTER TABLE cust_main ADD COLUMN ship_last varchar(80) NULL; +ALTER TABLE cust_main ADD COLUMN ship_first varchar(80) NULL; +ALTER TABLE cust_main ADD COLUMN ship_company varchar(80) NULL; +ALTER TABLE cust_main ADD COLUMN ship_address1 varchar(80) NULL; +ALTER TABLE cust_main ADD COLUMN ship_address2 varchar(80) NULL; +ALTER TABLE cust_main ADD COLUMN ship_city varchar(80) NULL; +ALTER TABLE cust_main ADD COLUMN ship_county varchar(80) NULL; +ALTER TABLE cust_main ADD COLUMN ship_state varchar(80) NULL; +ALTER TABLE cust_main ADD COLUMN ship_zip varchar(10) NULL; +ALTER TABLE cust_main ADD COLUMN ship_country char(2) NULL; +ALTER TABLE cust_main ADD COLUMN ship_daytime varchar(20) NULL; +ALTER TABLE cust_main ADD COLUMN ship_night varchar(20) NULL; +ALTER TABLE cust_main ADD COLUMN ship_fax varchar(12) NULL; +CREATE INDEX cust_main1 ON cust_main ( ship_last ); +CREATE INDEX cust_main2 ON cust_main ( ship_company ); +</pre> + <li>If you wish to enable customer comments, apply the following change to + your database: +<pre> +ALTER TABLE cust_main ADD COLUMN comments text NULL; +</pre> + <li>If you are using the signup server, reinstall it according to the <a href="signup.html">instructions</a>. The 1.3.x signup server is not compatible with 1.4.x. + <li>Run bin/dbdef-create. + <li>If you have svc_acct_sm records or service definitions: + <ul> + <li>Create a service definition with table svc_forward + <li>Run bin/fs-migrate-svc_acct_sm + </ul> + <li>Run bin/fs-migrate-payref + <li>Run bin/fs-migrate-part_svc + <li><b>After running bin/fs-migrate-payref</b>, apply the following changes to your database: + <table border><tr><th>PostgreSQL</th><th>MySQL, others</th></tr> +<tr><td> +<font size=-1><pre> +CREATE TABLE cust_pay_temp ( + paynum int primary key, + custnum int not null, + paid decimal(10,2) not null, + _date int null, + payby char(4) not null, + payinfo varchar(16) null, + paybatch varchar(80) null +); +INSERT INTO cust_pay_temp SELECT * from cust_pay; +DROP TABLE cust_pay; +ALTER TABLE cust_pay_temp RENAME TO cust_pay; +CREATE UNIQUE INDEX cust_pay1 ON cust_pay (paynum); +CREATE TABLE cust_refund_temp ( + refundnum int primary key, + custnum int not null, + _date int null, + refund decimal(10,2) not null, + otaker varchar(8) not null, + reason varchar(80) not null, + payby char(4) not null, + payinfo varchar(16) null, + paybatch varchar(80) null +); +INSERT INTO cust_refund_temp SELECT * from cust_refund; +DROP TABLE cust_refund; +ALTER TABLE cust_refund_temp RENAME TO cust_refund; +CREATE UNIQUE INDEX cust_refund1 ON cust_refund (refundnum); +</pre></font> +</td><td> +<font size=-1><pre> +ALTER TABLE cust_pay DROP COLUMN invnum; +ALTER TABLE cust_refund DROP COLUMN crednum; +</pre></font> +</td></tr></table> + <li><b>IMPORTANT: After applying the second set of database changes</b>, run bin/dbdef-create again. + <li>set the <a href="../config/config.cgi#username_policy">user_policy configuration value</a> as appropriate for your site. + <li>Create the `/usr/local/etc/freeside/cache.<i>datasrc</i>' directory + (ownded by the freeside user). + <li>freeside-queued was installed with the Perl modules. Start it now and ensure that is run upon system startup. + <li>Set appropriate <a href="../browse/part_bill_event.cgi">invoice events</a> for your site. At the very least, you'll want to set some invoice events "<i>After 0 days</i>": a <i>BILL</i> invoice event to print invoices, a <i>CARD</i> invoice event to batch or run cards real-time, and a <i>COMP</i> invoice event to "pay" complimentary customers. If you were using the <i>-i</i> option to <a href="man/bin/freeside-bill.html">freeside-bill</a> it should be removed. + <li>Use <a href="man/bin/freeside-daily.html">freeside-daily</a> instead of <a href="man/bin/freeside-bill.html">freeside-bill</a>. +</ul> +</body> |