e533ed2ee4e2588ba6b7b5642339d301b16588bf
[freeside.git] / httemplate / docs / selfservice.html
1 <head>
2   <title>Signup, self-service and reseller interfaces</title>
3 </head>
4 <body>
5   <h1>Signup, self-service and reseller interfaces</h1>
6 For security reasons, the self-service interface should run on a public
7 machine, not the backend Freeside server.  On the public machine, install:
8 <ul>
9   <li>A web server, such as <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)
10
11   <li><a href="ftp://ftp.cs.hut.fi/pub/ssh/">SSH</a>
12   <li><a href="http://www.perl.com/CPAN/doc/relinfo/INSTALL.html">Perl</a>.
13   <li><a href="http://search.cpan.org/search?dist=Text-Template">Text::Template</a>
14   <li><a href="http://search.cpan.org/search?dist=Storable">Storable</a>
15   <li><a href="http://search.cpan.org/search?dist=Business-CreditCard">Business-CreditCard</a>
16   <li><a href="http://search.cpan.org/search?dist=HTTP-BrowserDetect">HTTP::BrowserDetect</a>
17
18   <li><a href="man/FS/SelfService.html">FS::SelfService</a> (copy the fs_selfservice/FS-SelfService directory to the external machine, then: perl Makefile.PL; make; make install)
19   <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)
20 </ul>
21 Then:
22 <ul>
23   <li>Set the <a href="../config/config.cgi#unclassified"><i>signup_server-default_agentnum</i></a> configuration value to a default <a href="../browse/agent.cgi">agent number</a>.
24   <li>Set the <a href="../config/config.cgi#unclassified"><i>signup_server-default_refnum</i></a> to a default <a href="../browse/part_referral.cgi">advertising source</a>.
25   <li>Add the user `freeside' to the the external machine.
26   <li>Copy or symlink the <pre>fs_selfservice/FS-SelfService/cgi/</pre> directory into the web server's document space, for customer self-service and reseller access.  Optionally, customize the .html templates.
27   <li>Copy or symlink the <pre>fs_signup/FS-SignupClient/cgi/</pre> directory into the web server's document space, for signups. Optionally, customize the .html templates.
28   <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>
29   <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>)
30   <li>Create the /usr/local/freeside directory on the external machine (owned by the freeside user).
31   <li>touch /usr/local/freeside/fs_signupd_socket; chown freeside /usr/local/freeside/fs_signupd_socket; chmod 600 /usr/local/freeside/fs_signupd_socket
32   <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, selfservice.cgi, agent.cgi and passwd.cgi as the freeside user.
33   <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).
34   <li>Run an instance of <pre>freeside-selfservice-server <i>user</i> <i>machine</i> <i>agentnum</i> <i>refnum</i></pre> on the Freeside machine for each external machine.
35   <ul>
36     <li><i>user</i> is a user from the mapsecrets file.
37     <li><i>machine</i> is the name of the external machine.
38
39
40   </ul>
41 </ul>
42 Optional:
43 <ul>
44   <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 variables listed below available.
45   (an example file is included as <b>fs_signup/ieak.template</b>)  See the section on <a href="http://www.microsoft.com/windows/ieak/techinfo/deploy/60/en/INS.HTM">internet settings files</a> in the <a href="http://www.microsoft.com/windows/ieak/techinfo/deploy/60/en/toc.asp">IEAK documentation</a> for more information.
46 <!--  <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>-->
47   <li>Variable substitutions available in <b>ieak.template</b> and <b>success.html</b>:
48     <ul>
49       <li>$ac - area code of selected POP
50       <li>$exch - exchange of selected POP
51       <li>$loc - local part of selected POP
52       <li>$username
53       <li>$password
54       <li>$email_name - first and last name
55       <li>$pkg - package name
56     </ul>
57 <!--  <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>. -->
58 <!--  <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. -->
59 </ul>
60 </body>