Darkbot, Talking Robot

Darkbot fork, version 8rc5.

## Overview

This repository is an independent fork of Darkbot.
Its historical origin is the original SourceForge Darkbot project,
whose last official release was 8rc1.
The codebase here is also based on the later community-maintained
Nasqueron fork around 8rc4, with additional fixes and local changes in
this repository.

This fork keeps the original Darkbot structure and adds local changes
for DuckDuckGo search, weather, URL shortening, quotes, backups,
`deop.ini`, container builds, a daily word-of-the-day post, and merged
official pre-made database records.

The repository is set up to be usable both from source and through a
container image. Runtime data is kept under `dat/` and is shipped with
example values so private server details are not committed by default.

## Included Changes

- DuckDuckGo search through `!ddgo`, `!ddg`, `!dtg`, and `!ducktogo`
- `!ddgo [1-4] <text>` for one to four result URLs
- Weather through `!weather`, `!wh`, `!wthr`, and `!wt`
- URL shortening through `!short`, `!shorten`, and `!shorturl`
- Public command summary through `!cmds` and `!commands`
- Private help replies through `!help` and `!more`
- Quote storage and retrieval through `!addq`, `!quote`, `!qt`, and
  `!quotetell`
- Word of the day through `!wotd`, `!wordofday`, and `!wordtoday`
- Runtime backup through `!backup`
- Safer flood-ignore behavior and working `!unignore`
- Manual kick/ban command aliases including `!k`, `!kick`, `!b`, and `!ban`
- Official pre-made Darkbot database records merged into `dat/info2.db`
- `deop.ini` handling on IRC 482
- Example runtime files in `dat/`
- Docker, Podman, and Compose support
- Container entrypoint for first-run setup

## Install

### Debian or Ubuntu

Install the required build dependencies:

```sh
apt-get install build-essential autoconf automake libtool pkg-config libssl-dev ca-certificates
```

Build the bot from source:

```sh
./bootstrap.sh
./configure
make
```

If the repository includes a prepared build script, use it before the
manual build:

```sh
./build.sh
```

### Runtime Setup

Before starting the bot, review these files:

- `dat/setup.ini` for nick, channel, and behavior flags
- `dat/servers.ini` for IRC server definitions
- `dat/userlist.db` for access entries
- `dat/perform.ini` for startup actions
- `dat/deop.ini` for deop handling
- `dat/rdb/quote.rdb` for stored quotes
- `dat/wordofday.ini` for daily word entries
- `SHORTURL_SITE`, `SHORTURL_USER`, and `SHORTURL_PASS` in `dat/setup.ini`
  for the configured URL shortener
- `backups/` for timestamped `!backup` output

Keep private server names, passwords, and user data out of commits.

Start the bot from the repository root with:

```sh
./darkbot
```

The wrapper starts `bin/darkbot`, writes `darkbot.pid`, and logs output
to `darkbot.out`.

### Container

Build and run the image with Docker:

```sh
docker build -t darkbot:8rc5 .
docker run --rm -it -v darkbot-data:/data darkbot:8rc5
```

Podman uses the same build and run commands.

The container stores runtime data in `/data`. On first start, the
entrypoint seeds that directory from the example files in the image.

## Configuration

`dat/setup.ini` controls the bot nick, channel, and core behavior.
`dat/servers.ini` lists IRC servers.
`dat/userlist.db` stores access entries.
`dat/deop.ini` runs when the bot is deoped.
`dat/perform.ini` holds startup actions.
`dat/rdb/quote.rdb` stores the quote list.
`dat/wordofday.ini` stores the word-of-the-day list.
`SHORTURL_SITE`, `SHORTURL_USER`, and `SHORTURL_PASS` configure the
YOURLS-backed URL shortener used by `!short`.

`!ddgo` and aliases use DuckDuckGo and accept an optional leading result
count from 1 to 4. Quote commands (`!addq`, `!quote`, `!qt`,
`!quotetell`) use `dat/rdb/quote.rdb`.

`!short`, `!shorten`, and `!shorturl` create a short URL through the
configured YOURLS site. The current setup points at `c9.nu`.

`!wotd` shows the current word of the day. The bot also posts one word
automatically once per day in its home channel.

`!backup` saves `info2.db`, `setup.ini`, `randomstuff.ini`, `random.ini`,
`wordofday.ini`, `userlist.db`, `seen.db`, `stats.db`, `permbans.db`,
`perform.ini`, and `servers.ini` into `backups/YYYYMMDD-HHMMSS/`.

`RANDOM_TIME` controls the delay between `randomstuff.ini` messages. The
example runtime setup uses `2820` seconds, or 47 minutes.

The current fork version is kept separate from upstream and should be
updated through `VERSION`, `source/configure.ac`, and
`share/doc/darkbot/VERSION` together.

## Runtime Packages

Container runtime packages:

- `ca-certificates`
- `libssl3`
- `libcrypt1`

## Notes

Runtime files under `dat/` use example values. See `WHATSNEW` for the
current fork changes and `docs/WHATSNEW` for the historical changelog.

GNU GPL v2. See `COPYING` for the full text.
