git.m455.casa

linkbud

clone url: git://git.m455.casa/linkbud


linkbud

An IRC bot that generates a feed of links that are submitted by users.

Page contents

Requirements

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.

Quick start

  1. Run mkdir linkbud-demo.
  2. Run wget https://git.m455.casa/linkbud/plain/builds/linkbud-linux-x86_64 -O linkbud-demo/linkbud.
  3. Run cd demo.
  4. Run ./linkbud init.
  5. Run ./linkbud run.
  6. Join the #linkbud-demo channel on the libera.chat IRC network to start interacting with linkbud.

Getting started

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.

  1. Run mkdir ~/linkbud.
  2. Run wget https://git.m455.casa/linkbud/plain/builds/linkbud-linux-x86_64 -O linkbud/linkbud.
  3. Run cd ~/linkbud.
  4. Run ./linkbud init.

If you run ls, then you'll get a list of the files and directories that linkbud created.

Configuring linkbud

After running ./linkbud init, linkbud will create a config.scm file, which you can edit.

Refer to the list below for an explanation of each configuration value in the config.scm file.

Setting up nginx

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.

  1. As root, run mkdir -p /var/www/linkbudz.

  2. As root, run chown -R your_username:your_username /var/www/linkbudz.

  3. As root, run chmod -R 755 /var/www/linkbudz.

  4. As root, create a file at /etc/nginx/sites-available/linkbudz.example.com.

  5. 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;
        }
    }
    
  6. As root, run ln -s /etc/nginx/sites-available/linkbudz.example.com /etc/nginx/sites-enabled/.

  7. As root, run systemctl restart nginx.

  8. If you have certbot installed, then run certbot as root to add SSL certificate configurations to your linkbudz.example.com file.

Productionizing linkbud

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.

  1. Create a file at /etc/systemd/system/linkbud.service.

  2. 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
    
  3. Run systemctl daemon-reload.

  4. Run systemctl enable linkbud.

  5. Run systemctl start linkbud.

Using linkbud

This section provides syntax and examples for the commands that linkbud responds to.

Compiling linkbud from source

  1. Ensure you have Chicken Scheme installed.
  2. Ensure you have SSL development files installed. On Debian, you can get these files by installing the libssl-dev package.
  3. As root, run make dep to install the Chicken Scheme eggs.
  4. As as regular user, make to create a linkbud-linux-x86_64 binary in the builds directory.