source: locker/deploy/bin/trac @ 700

Last change on this file since 700 was 700, checked in by price, 16 years ago
trac autoinstaller: tracdata/.htaccess as fallback
  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/usr/bin/perl
2use strict;
3use lib '/mit/scripts/deploy/bin';
4use onserver;
5use Cwd;
6use File::Path;
7use URI::Escape;
8
9setup();
10
11print "\nEnter the name of your project (the title of this Trac instance).\n";
12print "Project name: ";
13my $name=<STDIN>;
14chomp($name);
15
16my $dbstring = "mysql://" . uri_escape($sqluser) . ":" . uri_escape($sqlpass) . "\@$sqlhost/$sqldb";
17
18print "\nEnter the type of version-control repository this project uses.\n";
19print "You'll have to set up the repo yourself; feel free to ask scripts@ for help.\n";
20print "If you don't want version-control integration, take the default.\n";
21print "Repository type (default svn; also bzr, git, hg): ";
22my $repotype=<STDIN>;
23chomp($repotype);
24$repotype = $repotype ? $repotype : 'svn';
25
26print "\nEnter the path to the version-control repository.\n";
27print "If you don't want version-control integration, leave blank.\n";
28print "Path to repository: ";
29my $repopath=<STDIN>;
30chomp($repopath);
31
32print STDERR "running trac-admin:\n";
33system(qw(/usr/bin/trac-admin tracdata initenv),
34       $name, $dbstring, $repotype, $repopath, '/usr/share/trac/templates');
35# XXX this exposes the SQL password on the command line
36
37#aka perl -pe 's/\@ADDREND\@/$addrend/g' <.htaccess.in >.htaccess
38open IN, '<.htaccess.in'; open OUT, '>.htaccess';
39while (<IN>) {
40    s/\@ADDREND\@/$addrend/g;
41    print OUT $_;
42}
43close IN; close OUT;
44
45chmod 0777, '.htaccess';
46unlink '.htaccess.in';
47
48open OUT, '>tracdata/.htaccess';
49print OUT 'Deny from all\n';
50close OUT;
51chmod 0777, 'tracdata/.htaccess';
52
53exit 0;
Note: See TracBrowser for help on using the repository browser.