summaryrefslogtreecommitdiff
path: root/install.pl
blob: 3d0ac385addb43ab6a828eef173a819522218efb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/perl

### This script creates symlinks so things will appear as they do on
### the carbonpictures.com bucky.  You will still have to edit
### "lib/constants.pm" and "cgi-bin/localbucky.pm" due to the ridiculous
### way we set this up so long ago.  But mostly just paths and shit.
### Also, do touch up the stuff in "fortunes".

### If you are going to use FTP/SCP to import shit, do something like this:
# vi $BUCKY_ROOT/bin/buckypoll.pl
### ..and set $localpath to "$BUCKY_DATA_ROOT/incoming"
### then:
# /usr/sbin/useradd --home $BUCKY_DATA_ROOT/incoming \
#   --password $BUCKY_FTP_PASS $BUCKY_FTP_LOGIN
# chown $BUCKY_FTP_LOGIN $BUCKY_ROOT/bin/buckypoll.pl
# su $BUCKY_FTP_LOGIN
# nohup $BUCKY_ROOT/bin/buckypoll.pl > output.log 2>&1 &

###################################################################3

use lib "/bucky/lib";
use Bucky;
use Digest::MD5 qw (md5_hex);

# path to HTTPS docroot
$DOCROOT = "/web/engine/docs";
$CGI_BIN = "/web/engine/cgi-bin";

# path to bucky install
$BUCKY_ROOT = "/bucky";
$BUCKY_LIB  = "/bucky/lib";

# path to bucky data directory (if it lives somewhere else)
$BUCKY_DATA_ROOT = "/bucky/data";

# mysql shit
$MYSQL_HOST = "carbonpictures.com";
$MYSQL_USER = "bucky";
$MYSQL_PASS = "wh4t3v3r";

###################################################################3

system('/bin/mkdir', '-p', $BUCKY_DATA_ROOT.'/incoming');
system('/bin/mkdir', '-p', $BUCKY_DATA_ROOT.'/profile');
system('/bin/mkdir', '-p', $BUCKY_DATA_ROOT.'/profile/.thumb');

system('/bin/ln', '-s', $CGI_BIN.'bucky', $BUCKY_ROOT.'/cgi-bin');
system('/bin/ln', '-s', $DOCROOT, $BUCKY_ROOT.'/docs');
system('/bin/ln', '-s', $DOCROOT.'/css', $BUCKY_ROOT.'/css');
system('/bin/ln', '-s', $BUCKY_DATA_ROOT, $DOCROOT.'/bucky/data');
system('/bin/ln', '-s', $BUCKY_DATA_ROOT, $BUCKY_ROOT.'/data')
  unless ($BUCKY_DATA_ROOT eq $BUCKY_ROOT.'/data');
system('/bin/ln', '-s', $BUCKY_DATA_ROOT.'/incoming', $BUCKY_ROOT.'/incoming');

open MYCNF, "$BUCKY_ROOT/.bucky.cnf";
print MYCNF <<__OUT__;
[client]
host=$MYSQL_HOST
user=$MYSQL_USER
password=$MYSQL_PASS
__OUT__
close MYCNF;

our $USER = ( username => "bucky" );

$dbh = DBI->connect ($dsn);

$hash = generate_invite();
print STDERR "Please create an admin account: " invite_url($hash) . "\n";