=head1 NAME
-FS::Conf - Read access to Freeside configuration values
+FS::Conf - Freeside configuration values
=head1 SYNOPSIS
=head1 DESCRIPTION
-Read access to Freeside configuration values. Keys currently map to filenames,
+Read and write Freeside configuration values. Keys currently map to filenames,
but this may change in the future.
=head1 METHODS
bin/freeside-email
bin/freeside-print-batch
bin/freeside-queued
-fin/freeside-apply-credits
+bin/freeside-apply-credits
+bin/freeside-adduser
FS.pm
FS/CGI.pm
FS/Conf.pm
--- /dev/null
+#!/usr/bin/perl -w
+#
+# $Id: freeside-adduser,v 1.1 2001-10-30 10:20:32 ivan Exp $
+
+use strict;
+use vars qw($opt_h $opt_c);
+use Getopt::Std;
+
+my $FREESIDE_CONF = "/usr/local/etc/freeside";
+
+getopts("ch:");
+die &usage if $opt_c && ! $opt_h;
+my $secretfile = shift or die &usage;
+my $user = shift or die &usage;
+
+my @args = ( 'htpasswd' );
+push @args, '-c' if $opt_c;
+push @args, $opt_h, $user;
+system(@args) == 0 or die "htpasswd failed: $?";
+
+open(MAPSECRETS,">>$FREESIDE_CONF/mapsecrets")
+ or die "can't open $FREESIDE_CONF/mapsecrets: $!";
+print MAPSECRETS "$user $secretfile\n";
+close MAPSECRETS or die "can't close $FREESIDE_CONF/mapsecrets: $!";
+
+sub usage {
+ die "Usage:\n\n freeside-adduser [ -h htpasswd_file [ -c ] ] secretfile username"
+}
+
+=head1 NAME
+
+freeside-adduser - Command line interface to add (freeside) users.
+
+=head1 SYNOPSIS
+
+ freeside-adduser [ -h htpasswd_file [ -c ] ] username
+
+=head DESCRIPTION
+
+Adds a user to the Freeside billing system. This is for adding users (internal
+sales/tech folks) to the web interface, not for adding customer accounts.
+
+ -h: Also call htpasswd for this user with the given filename
+
+ -c: Passed to htpasswd
+
+=head1 SEE ALSO
+
+L<htpasswd>, base Freeside documentation
+
+=cut
+
#!/usr/bin/make
+#Pg
+DATASOURCE = DBI:Pg:host=localhost;dbname=freeside
+#pgsql on some systems; check /etc/passwd
+DB_ADMIN_USER = postgres
+DB_ADMIN_PASSWORD=
+
+#mysql
+#DATASOURCE=DBI:mysql:freeside
+#DB_ADMIN_USER=mysql
+#DB_ADMIN_PASSWORD=
+
+TEMPLATE = asp
+#mason's a bit dodgy stil
+#TEMPLATE = mason
+
+FREESIDE_DOCUMENT_ROOT = /var/www/freeside
+
+#---
+
+#not changable yet
+FREESIDE_CONF = /usr/local/etc/freeside
+
help:
- @echo "supported targets: aspdocs masondocs alldocs perl-modules"
- @echo " install-perl-modules install clean"
+ @echo "supported targets: aspdocs masondocs alldocs docs install-docs"
+ @echo " perl-modules install-perl-modules"
+ @echo " install deploy"
+ @echo " create-database"
+ @echo " clean"
aspdocs: httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
rm -rf aspdocs
alldocs: aspdocs masondocs
-FS/Makefile:
- cd FS
- perl Makefile.PL
+docs:
+ make ${TEMPLATE}docs
+
+install-docs: docs
+ cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT}
perl-modules:
cd FS; \
cd FS; \
make install
-install: install-perl-modules
+install: install-perl-modules install-docs
deploy: install
/etc/init.d/apache restart
+create-database:
+ perl -e 'use DBIx::DataSource qw( create_database ); create_database( \'${DATASOURCE}\', \'${DB_ADMIN_USER}\', \'${DB_ADMIN_PASSWORD}\' ) or die $DBIx::DataSource::errstr;'
+
+create-config: install-perl-modules
+ [ -d ${FREESIDE_CONF} ] || mkdir ${FREESIDE_CONF}
+ chown freeside ${FREESIDE_CONF}
+
+ [ -d "${FREESIDE_CONF}/conf.${DATASOURCE}" ] \
+ || mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}"
+ chown freeside "${FREESIDE_CONF/conf.${DATASOURCE}"
+
+ [ -d "${FREESIDE_CONF}/counters.${DATASOURCE}" ] \
+ || mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}"
+ chown freeside "${FREESIDE_CONF/counters.${DATASOURCE}"
+
+ [ -d "${FREESIDE_CONF}/cache.${DATASOURCE}" ] \
+ || mkdir "${FREESIDE_CONF}/cache.${DATASOURCE}"
+ chown freeside "${FREESIDE_CONF/cache.${DATASOURCE}"
+
+ [ -d "${FREESIDE_CONF}/export.${DATASOURCE}" ] \
+ || mkdir "${FREESIDE_CONF}/export.${DATASOURCE}"
+ chown freeside "${FREESIDE_CONF/export.${DATASOURCE}"
+
clean:
rm -rf aspdocs masondocs
cd FS; \
<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>
+ <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>
</tr>
</table>
<ul>
-<li>Restrict access to this web interface. (with <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache</a>)
+<li>Restrict access to this web interface. (with <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache</a>). For example, to configure user authentication with flat files:
+<font size="-1"><pre>
+<Directory /usr/local/apache/htdocs/freeside-asp>
+PerlSetVar Global /usr/local/etc/freeside/asp-global/
+AuthName Freeside
+AuthType Basic
+AuthUserFile /usr/local/etc/apache/htpasswd
+require valid-user
+</Directory>
+</pre>
<li>Create the necessary <a href="config.html">configuration files</a>.
<li>Create the `/usr/local/etc/freeside/counters.<i>datasrc</i>',
`/usr/local/etc/freeside/cache.<i>datasrc</i>', and