clone url: git://git.m455.casa/linkbud
An IRC bot that generates a feed of links that are submitted by users.
Note: Most Linux systems already have OpenSSL libraries installed. If you
use Debian Linux, then you can check to see if the openssl
package is
installed by running apt search openssl | grep installed
.
mkdir linkbud-demo
.wget https://git.m455.casa/linkbud/plain/builds/linkbud-linux-x86_64 -O linkbud-demo/linkbud
.cd demo
../linkbud init
../linkbud run
.#linkbud-demo
channel on the libera.chat
IRC network to start interacting with linkbud.You'll want to create a directory to put the linkbud
binary in, because
linkbud creates files and directories when it's initialized, and when it's
running.
mkdir ~/linkbud
.wget https://git.m455.casa/linkbud/plain/builds/linkbud-linux-x86_64 -O linkbud/linkbud
.cd ~/linkbud
../linkbud init
.If you run ls
, then you'll get a list of the files and directories that
linkbud created.
After running ./linkbud init
, linkbud will create a config.scm
file, which
you can edit.
You can refer to the example configuration values in the generated config.scm
file, and the explanations of each configuration value below when configuring
this file:
irc-host
(string): This is the IRC server that linkbud will connect to. This
value should be a hostname or an IP address.irc-port
(number): This is the port of the IRC server that linkbud will
connect to.irc-ssl
(#t
or #f
):
#t
, then linkbud will connect to the irc-host
on
irc-port
using an SSL or TLS connection.#f
, then linkbud will connect to the irc-host
on
irc-port
over an insecure connection, sending data as plain text.irc-password
(string or #f
):
irc-realname
. Some servers, such as ergo.chat,
support a SASL work-around, where you can supply the password in the form
of username:password
for authentication.#f
, then no authentication will be used.irc-disable-history?
(#t
or #f
):
#t
, then linkbud won't read playback history.#f
, then linkbud will read playback history.irc-nickname
(string): This value appears as the name of of linkbud when
linkbud sends messages.irc-username
(string): This value appears in join and leave messages.irc-realname
(string): I don't know where this name appears, sorry.irc-channels
(space-separated strings): These values represent IRC channels
that linkbud will join, and then listen to.base-url
(string): This value is an HTTP link. This value is used in the
following files:templates/rss/header.xml
templates/rss/item.xml
templates/html/header.html
build-path
(string): This value represents the path where the index.html
and feed.rss
files will be generated.rss-feed-title
(string): This value is the title of the RSS feed, and is
only seen when viewing the RSS feed in an RSS feed reader.rss-description-value
(string): This value is the description of the RSS
feed, and is only seen when viewing the RSS feed in an RSS feed reader.html-title
(string): This value populates the <title>
and <h1>
elements
in the index.html
file that's generated in the build-path
.post-response
(string): This value changes the message that's shown after
using the post command.You'll need to create a web directory that nginx exposes to the internet, so people can access the feed.
In this section, you'll create a web directory, and configure nginx to serve the contents of the web directory.
Note: Change your_username
to your username, and example.com
to your
domain name in the steps below.
As root, run mkdir -p /var/www/linkbudz
.
As root, run chown -R your_username:your_username /var/www/linkbudz
.
As root, run chmod -R 755 /var/www/linkbudz
.
As root, create a file at /etc/nginx/sites-available/linkbudz.example.com
.
As root, add the following contents to the linkbudz.example.com
file:
server {
root /var/www/linkbudz;
index index.html;
server_name linkbudz.example.com;
location / {
try_files $uri $uri/ =404;
}
}
As root, run ln -s /etc/nginx/sites-available/linkbudz.example.com /etc/nginx/sites-enabled/
.
As root, run systemctl restart nginx
.
If you have certbot
installed, then run certbot
as root to add SSL
certificate configurations to your linkbudz.example.com
file.
System restarts or updates can cause processes to stop.
In this section, you'll create a systemd
service, which restarts linkbud if it
stops running.
Note: Change your_username
to your username in the steps below.
Create a file at /etc/systemd/system/linkbud.service
.
Add the following contents to the linkbud.service
file:
[Unit]
Description=linkbud service
After=ergo.service
[Service]
Type=simple
User=your_username
WorkingDirectory=/home/your_username/linkbud
ExecStart=/home/your_username/linkbud/linkbud run
Restart=on-failure
[Install]
WantedBy=multi-user.target
Run systemctl daemon-reload
.
Run systemctl enable linkbud
.
Run systemctl start linkbud
.
This section provides syntax and examples for the commands that linkbud responds to.
!post <link> <title>
: Submit a link to the feed.!delete <id of post>
: Delete a link from the feed.!regenerate
: Regenerate the HTML and RSS feeds.!reload
: Reload the config.scm
and template files.!linkbud
: Display a help message.libssl-dev
package.make dep
to install the Chicken Scheme eggs.make
to create a linkbud-linux-x86_64
binary in the
builds
directory.