From: swa Date: Mon, 4 Jun 2001 18:31:58 +0000 (+0000) Subject: files are now prefixed with either `confdir' or `logdir'. X-Git-Tag: v_2_9_9~390 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=52688cf7f811e1452ebd86f374628953f7ad7420 files are now prefixed with either `confdir' or `logdir'. `make redhat-dist' replaces both entries confdir and logdir with redhat values --- diff --git a/.gitignore b/.gitignore index ef833b08..a9ad28ad 100644 --- a/.gitignore +++ b/.gitignore @@ -34,5 +34,6 @@ config.log config.status junkbuster junkbuster.log +logfile permissionsfile re_filterfile diff --git a/Makefile.in b/Makefile.in index d9839ec0..bd61a7e3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ # Note: Makefile is built automatically from Makefile.in # -# $Id: Makefile.in,v 1.7 2001/06/03 17:09:09 swa Exp $ +# $Id: Makefile.in,v 1.8 2001/06/04 10:44:57 swa Exp $ # # Written by and Copyright (C) 2001 the SourceForge # IJBSWA team. http://ijbswa.sourceforge.net @@ -28,6 +28,10 @@ # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Log: Makefile.in,v $ +# Revision 1.8 2001/06/04 10:44:57 swa +# `make redhatr-dist' now works. Except for the paths +# in the config file. +# # Revision 1.7 2001/06/03 17:09:09 swa # swa for oes: reversed my earlier change # @@ -203,7 +207,7 @@ sregexp.txt: re_filterfile redhat-dist: @make clobber # verify that i'm root needs to be done - tar --exclude "ijb/CVS" -cvzf ../ijbswa.tar.gz . + tar -cvzf ../ijbswa.tar.gz . # verify all version strings, FLAGS, etc. in the spec file cat junkbuster-rh.spec | sed 's/^Version:.*/Version: $(RPM_VERSION)/g' | sed 's/^Release:.*/Release: $(VERSION_POINT)/g' > /tmp/abc && cp -f /tmp/abc junkbuster-rh.spec # verify all files in their correct location needs to be done diff --git a/config b/config index 078a95d1..4fa0a371 100644 --- a/config +++ b/config @@ -1,7 +1,7 @@ # Sample Configuration file for the Internet Junkbuster 2.0 # -# $Id: config,v 1.11 2001/06/03 18:38:11 oes Exp $ +# $Id: config,v 1.12 2001/06/04 10:44:57 swa Exp $ # # Table of Contents @@ -66,7 +66,19 @@ # Now, only confdir/templates is used for storing HTML templates # for CGI results. # -confdir /home/swa/sourceforge/current +# No trailing /, please. +confdir . + +# +# The directory where all logging (i.e. logfile and jarfile) takes place +# No trailing /, please. +# +logdir . + +# +# Note that all file specifications below are relative to +# the above two directories!!! +# # The permissions file contains patterns to specify the # filtering rules to apply to each site. @@ -76,7 +88,7 @@ confdir /home/swa/sourceforge/current # All sites are filtered if re_filterfile specified. # No sites are blocked. Nothing is an image. # -permissionsfile ./permissionsfile +permissionsfile permissionsfile # # The re_filterfile contains content modification rules. These rules @@ -87,7 +99,7 @@ permissionsfile ./permissionsfile # # Default: No content modification. # -re_filterfile ./re_filterfile +re_filterfile re_filterfile # # The logfile is where all logging and error messages are written. @@ -106,7 +118,7 @@ re_filterfile ./re_filterfile # # Default: Log to the standard error channel, not to a file # -logfile ./junkbuster.log +logfile logfile # # The jarfile defines where Junkbuster stores the cookies it @@ -115,7 +127,7 @@ logfile ./junkbuster.log # # Default: Don't store intercepted cookies # -#jarfile ./jarfile +#jarfile jarfile # # The forwardfile defines domain-specific forwarding of HTTP @@ -126,7 +138,7 @@ logfile ./junkbuster.log # # Default: Make all connections directly. # -forwardfile ./forward +forwardfile forward # # Generally, Junkbuster is used as a personal proxy. The default @@ -144,7 +156,7 @@ forwardfile ./forward # Default: No access control. Everybody that can reach junkbuster # will be served. # -#aclfile ./aclfile +#aclfile aclfile # # 4. OPTIONS diff --git a/junkbuster-rh.spec b/junkbuster-rh.spec index e36423aa..e17a594c 100644 --- a/junkbuster-rh.spec +++ b/junkbuster-rh.spec @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.7 2001/06/03 17:09:09 swa Exp $ +# $Id: junkbuster-rh.spec,v 1.1 2001/06/04 10:44:57 swa Exp $ # # Written by and Copyright (C) 2001 the SourceForge # IJBSWA team. http://ijbswa.sourceforge.net @@ -25,7 +25,11 @@ # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# $Log: Makefile.in,v $ +# $Log: junkbuster-rh.spec,v $ +# Revision 1.1 2001/06/04 10:44:57 swa +# `make redhatr-dist' now works. Except for the paths +# in the config file. +# # # %define PACKAGE_NAME junkbuster @@ -255,7 +259,20 @@ cp -f re_filterfile $RPM_BUILD_ROOT/etc/junkbuster/re_filterfile # cp -f imagelist $RPM_BUILD_ROOT/etc/junkbuster/imagelist # cp -f cookiefile $RPM_BUILD_ROOT/etc/junkbuster/cookiefile cp -f aclfile $RPM_BUILD_ROOT/etc/junkbuster/aclfile -cp -f config $RPM_BUILD_ROOT/etc/junkbuster/config + +# verify all file locations, etc. in the config file +# don't start with ^ or commented lines are not replaced +cat config | \ + sed 's/^confdir.*/confdir \/etc\/junkbuster/g' | \ +# sed 's/^permissionsfile.*/permissionsfile \/etc\/junkbuster\/permissionsfile/g' | \ +# sed 's/^re_filterfile.*/re_filterfile \/etc\/junkbuster\/re_filterfile/g' | \ +# sed 's/^logfile.*/logfile \/var\/log\/junkbuster\/logfile/g' | \ +# sed 's/^jarfile.*/jarfile \/var\/log\/junkbuster\/jarfile/g' | \ +# sed 's/^forward.*/forward \/etc\/junkbuster\/forward/g' | \ +# sed 's/^aclfile.*/aclfile \/etc\/junkbuster\/aclfile/g' > \ + sed 's/^logdir.*/logdir \/var\/log\/junkbuster/g' > \ + $RPM_BUILD_ROOT/etc/junkbuster/config + cp -f forward $RPM_BUILD_ROOT/etc/junkbuster/forward cp -f trust $RPM_BUILD_ROOT/etc/junkbuster/trust # cp -f popup $RPM_BUILD_ROOT/etc/junkbuster/popup diff --git a/junkbuster.logrotate b/junkbuster.logrotate index f79d2f99..50623783 100644 --- a/junkbuster.logrotate +++ b/junkbuster.logrotate @@ -3,7 +3,7 @@ # # ******************************************************************** # -# File : $Source: /cvsroot/ijbswa/current/junkbuster.monthly,v $ +# File : $Source: /cvsroot/ijbswa/current/junkbuster.logrotate,v $ # # Purpose : Rotates all potential Junkbuster logfiles # @@ -34,7 +34,10 @@ # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Revisions : -# $Log: junkbuster.monthly,v $ +# $Log: junkbuster.logrotate,v $ +# Revision 1.2 2001/05/24 07:52:24 swa +# added header. removed ^M. +# # Revision 1.3 2001/05/24 07:41:33 swa # added header # @@ -42,13 +45,12 @@ # # ********************************************************************/ -/var/log/junkbuster/junkbuster { +/var/log/junkbuster/logfile { compress weekly } - -#/var/log/junkbuster/jarfile { -# compress -# weekly -#} +/var/log/junkbuster/jarfile { + compress + weekly +} diff --git a/loadcfg.c b/loadcfg.c index e7dccc8b..4bb99d13 100644 --- a/loadcfg.c +++ b/loadcfg.c @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.10 2001/06/03 11:03:48 oes Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.10 2001/06/03 19:11:54 oes Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $ @@ -35,6 +35,9 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.10 2001/06/03 11:03:48 oes Exp $" * * Revisions : * $Log: loadcfg.c,v $ + * Revision 1.10 2001/06/03 19:11:54 oes + * introduced confdir option + * * Revision 1.10 2001/06/03 11:03:48 oes * Makefile/in * @@ -293,6 +296,7 @@ static struct file_list *current_configfile = NULL; #define hash_actions_file 3825730796ul /* FIXME "permissionsfile" */ #define hash_debug 78263ul #define hash_confdir 1978389lu +#define hash_logdir 422889lu #define hash_forwardfile 1268669141ul #define hash_jarfile 2046641ul #define hash_listen_address 1255650842ul @@ -450,6 +454,8 @@ struct configuration_spec * load_config(void) char arg[BUFSIZ]; char tmp[BUFSIZ]; + char arg2[BUFSIZ]; + strcpy(tmp, buf); /* Copy command (i.e. up to space or tab) into cmd */ @@ -494,7 +500,8 @@ struct configuration_spec * load_config(void) #ifdef TRUST_FILES case hash_trustfile : freez((char *)config->trustfile); - config->trustfile = strdup(arg); + snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg); + config->trustfile = strdup(arg2); continue; case hash_trust_info_url : @@ -510,24 +517,31 @@ struct configuration_spec * load_config(void) config->confdir = strdup(arg); continue; + case hash_logdir : + config->logdir = strdup(arg); + continue; + case hash_single_threaded : config->multi_threaded = 0; continue; case hash_actions_file : freez((char *)config->actions_file); - config->actions_file = strdup(arg); + snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg); + config->actions_file = strdup(arg2); continue; case hash_logfile : freez((char *)config->logfile); - config->logfile = strdup(arg); + snprintf(arg2, BUFSIZ, "%s/%s", config->logdir, arg); + config->logfile = strdup(arg2); continue; #ifdef JAR_FILES case hash_jarfile : freez((char *)config->jarfile); - config->jarfile = strdup(arg); + snprintf(arg2, BUFSIZ, "%s/%s", config->logdir, arg); + config->jarfile = strdup(arg2); continue; #endif /* def JAR_FILES */ @@ -538,13 +552,15 @@ struct configuration_spec * load_config(void) case hash_forwardfile : freez((char *)config->forwardfile); - config->forwardfile = strdup(arg); + snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg); + config->forwardfile = strdup(arg2); continue; #ifdef ACL_FILES case hash_aclfile : freez((char *)config->aclfile); - config->aclfile = strdup(arg); + snprintf(arg2, BUFSIZ, "%s/%s", config->confdir, arg); + config->aclfile = strdup(arg2); continue; #endif /* def ACL_FILES */ diff --git a/project.h b/project.h index 9020d923..fc058adc 100644 --- a/project.h +++ b/project.h @@ -1,6 +1,6 @@ #ifndef _PROJECT_H #define _PROJECT_H -#define PROJECT_H_VERSION "$Id: project.h,v 1.14 2001/06/03 11:03:48 oes Exp $" +#define PROJECT_H_VERSION "$Id: project.h,v 1.15 2001/06/04 11:28:53 swa Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/project.h,v $ @@ -36,6 +36,9 @@ * * Revisions : * $Log: project.h,v $ + * Revision 1.15 2001/06/04 11:28:53 swa + * redirect did not work due to missing / + * * Revision 1.14 2001/06/03 11:03:48 oes * Makefile/in * @@ -701,6 +704,7 @@ struct configuration_spec const char *logfile; const char *confdir; + const char *logdir; const char *actions_file; const char *forwardfile;