Neale Pickett
·
2015-02-09
INSTALL.md
1Spongy Server Installation
2==========================
3
4You gotta make a base directory with an `authtok` file,
5and a subdirectory for every server you want to connect to.
6
7 BASE_DIRECTORY
8 +-- slashnet
9 | +-- handler
10 | +-- config/
11 | | +-- server
12 | | +-- gecos
13 | | +-- nick
14 | +-- log/
15 | | +-- 2015-01-29T19:56:27Z.log
16 | | +-- 2015-01-29T20:01:15Z.log
17 | | +-- 2015-01-29T20:41:40Z.log
18 | | +-- 2015-01-29T20:41:48Z.log
19 | | +-- 2015-01-29T20:41:56Z.log
20 | | +-- 2015-01-29T20:42:44Z.log
21 | +-- outq/
22 +-- oftc
23 +-- server3
24 +-- server4
25
26
27`config` directory
28------------------
29
30The `config` directory in a server directory must have certain files:
31
32* `server` is a list of servers to try and connect to, in the form `hostname:port`
33* `gecos` is your "Real Name"
34* `nick` is a list of nicknames you'd like to use
35
36The lists are gone through starting with the first entry until one sticks.
37
38
39`outq` directory
40----------------
41
42The `outq` directory is monitored by spongy.
43When a new file shows up, its contents are spit out verbatim
44over the server connection.
45
46So if you want to send a message to a channel,
47do something like this:
48
49 $ echo 'PRIVMSG #channel :hello world' > outq/$$.$(date +%s)
50
51
52Starting up
53-----------
54
55Pretty easy:
56
57 $ cd BASE_DIRECTORY; /path/to/spongy
58
59Spongy will go off and connect to every configured server in BASE_DIRECTORY.
60
61
62Spongy CGI Configuration
63========================
64
65If you'd like to run `spongy.cgi`,
66that's fine,
67but you have to create a file
68called `spongy.basedir`
69in the same directory as the CGI.
70You can do it like this:
71
72 $ echo '/home/neale/BASE_DIRECTORY' > spongy.basedir
73
74And then,
75in `BASE_DIRECTORY`,
76you need a file called `auth`
77with a sha256 checksum of the authorization token
78you want to use in the client.
79
80You can make it like this:
81
82 $ printf 'my fabulous token' | sha256sum | cut -d\ -f1 > BASE_DIRECTORY
83
84
85Permissions
86-----------
87
88There are a lot of different ways to set up permissions.
89Here's what I suggest:
90make `spongy.cgi` setuid to you.
91
92 $ chmod +s spongy.cgi
93
94If it's setuid,
95you don't need to make your config file
96(or any other files)
97readable by the user that
98runs the web server.
99
100Sadly,
101Apache has a whole bunch of weirdness in place
102which prevents setuid CGI from working
103without a lot of configuration twiddling.
104But it also has its own mechanism for running CGI
105as the user who owns it.
106So if you're using Apache,
107please send me a recipe for your solution,
108and I'll add it to the distribution :)
109