2015-01-30 18:41:24 -07:00
|
|
|
Spongy Server Installation
|
|
|
|
==========================
|
|
|
|
|
|
|
|
You gotta make a base directory with an `authtok` file,
|
|
|
|
and a subdirectory for every server you want to connect to.
|
|
|
|
|
|
|
|
BASE DIRECTORY
|
|
|
|
+-- slashnet
|
|
|
|
| +-- handler
|
|
|
|
| +-- config/
|
|
|
|
| | +-- server
|
|
|
|
| | +-- gecos
|
|
|
|
| | +-- nick
|
|
|
|
| +-- log/
|
|
|
|
| | +-- 2015-01-29T19:56:27Z.log
|
|
|
|
| | +-- 2015-01-29T20:01:15Z.log
|
|
|
|
| | +-- 2015-01-29T20:41:40Z.log
|
|
|
|
| | +-- 2015-01-29T20:41:48Z.log
|
|
|
|
| | +-- 2015-01-29T20:41:56Z.log
|
|
|
|
| | +-- 2015-01-29T20:42:44Z.log
|
|
|
|
| +-- outq/
|
|
|
|
+-- oftc
|
|
|
|
+-- server3
|
|
|
|
+-- server4
|
|
|
|
|
|
|
|
|
|
|
|
`config` directory
|
|
|
|
------------------
|
|
|
|
|
|
|
|
The `config` directory in a server directory must have certain files:
|
|
|
|
|
|
|
|
* `server` is a list of servers to try and connect to, in the form `hostname:port`
|
|
|
|
* `gecos` is your "Real Name"
|
|
|
|
* `nick` is a list of nicknames you'd like to use
|
|
|
|
|
|
|
|
The lists are gone through starting with the first entry until one sticks.
|
|
|
|
|
|
|
|
|
|
|
|
`outq` directory
|
|
|
|
----------------
|
|
|
|
|
|
|
|
The `outq` directory is monitored by spongy.
|
|
|
|
When a new file shows up, its contents are spit out verbatim
|
|
|
|
over the server connection.
|
|
|
|
|
|
|
|
So if you want to send a message to a channel,
|
|
|
|
do something like this:
|
|
|
|
|
|
|
|
$ echo 'PRIVMSG #channel :hello world' > outq/$$.$(date +%s)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Spongy CGI Configuration
|
|
|
|
========================
|
|
|
|
|
|
|
|
If you'd like to run `spongy.cgi`,
|
|
|
|
that's fine,
|
|
|
|
but you have to create a configuration file
|
2015-01-30 19:17:16 -07:00
|
|
|
called `spongy.cfg`
|
2015-01-30 18:41:24 -07:00
|
|
|
in the same directory as the CGI.
|
|
|
|
It looks like this:
|
|
|
|
|
|
|
|
{
|
|
|
|
"auth": "bdf0ff3f50f492bd0fb261caf097829138f472dd0ab3b504fe0f01e8c8225664",
|
|
|
|
"basedir": "/home/neale/lib/irc"
|
|
|
|
}
|
|
|
|
|
2015-01-30 19:17:16 -07:00
|
|
|
`basedir` is the path to the BASE DIRECTORY from above.
|
|
|
|
|
2015-01-30 18:41:24 -07:00
|
|
|
`auth` is a sha256 checksum of your password.
|
|
|
|
You can generate it for the password "bloop" like this:
|
|
|
|
|
|
|
|
$ echo -n "bloop" | sha256sum
|
|
|
|
|
|
|
|
|
|
|
|
Permissions
|
|
|
|
-----------
|
|
|
|
|
|
|
|
There are a lot of different ways to set up permissions.
|
|
|
|
Here's what I suggest:
|
|
|
|
make `spongy.cgi` setuid to you.
|
|
|
|
|
|
|
|
$ chmod +s spongy.cgi
|
|
|
|
|
|
|
|
If it's setuid,
|
|
|
|
you don't need to make your config file readable by whatever user
|
|
|
|
runs the web server.
|
|
|
|
|
|
|
|
Sadly,
|
|
|
|
Apache has a whole bunch of weirdness that prevents this from working.
|
|
|
|
So if you're using Apache,
|
|
|
|
please send me a recipe for your solution,
|
|
|
|
and I'll add it to the distribution :)
|
|
|
|
|