Changeset 264

Show
Ignore:
Timestamp:
11/01/03 22:20:19 (5 years ago)
Author:
kake
Message:

Junked OpenGuides::Config completely to avoid database password

leakage, and easier install (CPAN RT 3916).

Location:
trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r263 r264  
    1010 
    1111# See if we already have some config variables set. 
    12 use lib "lib"; 
    13 my %existing_config; 
    14 eval "use OpenGuides::Config"; 
    15 %existing_config = %OpenGuides::Config::config unless $@; 
     12my $read_config = Config::Tiny->read('wiki.conf'); 
     13my %existing_config = $read_config ? %{ $read_config->{_} } : (); 
    1614 
    1715my @questions = ( 
     
    8381); 
    8482 
     83print <<EOF; 
     84 
     85Beginning install process... if you already have an OpenGuides 
     86configuration file and you don't want to have to type in all your config 
     87parameters over again, abort this process now, copy that file to this 
     88directory, and start again. 
     89 
     90EOF 
     91 
     92my $continue = Module::Build->y_n("Continue with install?", "y"); 
     93exit 0 unless $continue; 
     94 
    8595my $skip_config = Module::Build->y_n("Skip OpenGuides configuration?", "n"); 
    8696if ( $skip_config ) { 
     
    8999Skipping OpenGuides configuration - any configuration options previously 
    90100saved will be used instead.  You may tweak your configuration now by 
    91 editing the 'wiki.conf' file produced by this script, but changes made to 
    92 that file will *not* stick around for the next time you install OpenGuides. 
     101editing the 'wiki.conf' file produced by this script. 
    93102=========================================================================== 
    94103EOF 
     
    182191} 
    183192close FILE or die "Can't close wiki.conf: $!"; 
    184  
    185 # Now use Config::Tiny to read it all back in - bit convoluted I know. 
    186 my $read_config = Config::Tiny->read('wiki.conf'); 
    187 %existing_config = %{ $read_config->{_} }; 
    188  
    189 # And pop it in OpenGuides::Config 
    190 %OpenGuides::Config::config = %existing_config; 
    191 open OUT, ">lib/OpenGuides/Config.pm" 
    192     or die "Can't open lib/OpenGuides/Config.pm for writing: $!"; 
    193  
    194 # Sigh, I am still cargo culting this line; one day I will figure out 
    195 # how it works (Kake). 
    196 print OUT Data::Dumper->new([ \%OpenGuides::Config::config ], 
    197                             [ '*OpenGuides::Config::config' ] 
    198                            )->Dump, 
    199     "\n1;\n"; 
    200193 
    201194##### 
     
    240233 
    241234$build->add_to_cleanup( "wiki.conf" ); 
     235$build->add_to_cleanup( "configlib" ); 
    242236 
    243237# Tell OpenGuides::Build which additional scripts and templates to install. 
  • trunk/Changes

    r263 r264  
    1 0.28     
     10.28    1 November 2003 
    22        Allow running sites on SQLite databases. 
    33        Fixed bug with navbar prompt in Build.PL (CPAN RT #3894). 
     4        Junked OpenGuides::Config completely to avoid database password 
     5          leakage, and easier install (CPAN RT 3916). 
    46 
    570.27    1 November 2003 
  • trunk/INSTALL

    r191 r264  
    1010 
    1111Unpack the distribution (using for example 'tar' or 'WinZip'), and set 
    12 your working directory to be the top level of the distribution, then 
    13 execute the following commands: 
     12your working directory to be the top level of the distribution. 
     13 
     14If you have an existing "wiki.conf" configuration file and you wish 
     15to keep using the values in that, copy it to this directory. 
     16 
     17Now execute the following commands: 
    1418 
    1519perl Build.PL 
     
    2832 
    2933 
    30   "what type of database do you want the site to run on?  postgres/mysql" 
     34  "what type of database do you want the site to run on?" 
    3135 
    32 Answer either "postgres" or "mysql". 
     36Answer "postgres", "mysql", or "sqlite". 
    3337 
    3438 
     
    3741  "And the password that they use to access the database?" 
    3842 
    39 You should create (or ask your ISP/sysadmin to create) a Postgres or 
    40 MySQL database specifically for the use of OpenGuides.  If you have 
    41 more than one OpenGuides installation, for example if you run guides 
    42 for more than one city, each installation will need its own database. 
    43 (TODO - support SQLite as well (requires faffing with install scripts, 
    44 bit messy but CGI::Wiki already supports this so won't be hard)) 
     43You should create (or ask your ISP/sysadmin to create) a database 
     44specifically for the use of OpenGuides.  If you have more than one 
     45OpenGuides installation, for example if you run guides for more than 
     46one city, each installation will need its own database. 
    4547 
    4648 
  • trunk/PREREQUISITES

    r252 r264  
    1 Modules required by OpenGuides 0.27 
     1Modules required by OpenGuides 0.28 
    22=================================== 
    33 
     
    1818    -- or -- 
    1919  DBD::mysql 
     20    -- or -- 
     21  DBD::SQLite 
    2022) 
    2123File::Spec::Functions 
  • trunk/TROUBLESHOOTING

    r246 r264  
    4545 
    4646---------------------------------------------------------------------- 
     47 
     48Again relating to permissions - if you are using SQLite then note that 
     49the user your CGI is running as must have write access to not only the 
     50database file itself, but the directory that the file is in (in order 
     51that it can write a lockfile). 
     52 
     53----------------------------------------------------------------------