Hayden Guide

From Bibliotheca Anonoma
Revision as of 05:33, 15 August 2020 by Ctrl-s (talk | contribs) (Formatting and more sections)

Guide on how to setup and run hayden on a linux machine.


Warnings

  • Blame Ctrl-S for this document. (WIP)
  • Hayden is not really reliably stable on linux right now and may decide to enter a state where it will reliably crash on startup.
  • Hayden cares about the JSON config file syntax. If you missplace a comma it will probably reject the config file and crash.


Prerequisites

How to set up a system so hayden will download, build, and run.

  1. Prep system for updates
    • Debian-based systems (ubuntu, debian, etc)
    $ sudo apt update && sudo apt upgrade -y
    $ sudo apt install -y git curl wget
    
    • RHEL-based systems (redhat, fedora, centos)
    $ sudo yum update -y
    
  1. Install Microsoft dotnet runtime

https://docs.microsoft.com/en-us/dotnet/core/install/linux-centos
https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

    • RHEL-based systems (redhat, fedora, centos)
    $ sudo dnf install dotnet-sdk-3.1
    
    • Debian-based systems (ubuntu, debian, etc)
    $ sudo apt-get install -y dotnet-sdk-3.1
    

Database install

Hayden works with MariaDB and I dont know if it works with others.
You could use any MariaDB installation if you wanted to, however that is left to advanced users who know how and is outside the scope of this guide.

Docker+Mariadb - Install Docker

https://docs.docker.com/engine/install/#server
https://docs.docker.com/engine/install/centos/

  1. Setup repository:
    $ sudo yum install -y yum-utils
    $ sudo yum-config-manager  --add-repo  https://download.docker.com/linux/centos/docker-ce.repo
    
  2. Install docker engine:
    $ sudo yum install docker-ce docker-ce-cli containerd.io
    
  3. Start docker service:
    $ sudo systemctl start docker
    
  4. Verify docker works
    $ sudo docker run hello-world
    


Docker+Mariadb - Install docker-compose

https://docs.docker.com/compose/

  1. Install docker-compose:
    $ sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    $ sudo chmod +x /usr/local/bin/docker-compose
    
  2. Symlink into $PATH:
    $ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
    
  3. Test installation:
    $ docker-compose --version
    

Docker+Mariadb - Setup Container

  • TODO

Docker+Mariadb - Setup DB

  • TODO

Docker+Mariadb - Usage

  • TODO

Download and Build

  1. Prepare location:
    $ mkdir -vp /home/USER/hayden_2020/
    $ cd /home/USER/hayden_2020/
    
  2. Clone (download) Hayden source code from Github:
    $ git clone https://github.com/bbepis/Hayden.git
    
  3. Build the Hayden solution file:
    $ dotnet build "/home/USER/hayden_2020/Hayden/Hayden.sln"
    
  4. Run with config file:
    $ "/home/USER/hayden_2020/Hayden/Hayden/bin/Debug/netcoreapp3.1/Hayden" "/home/USER/hayden_2020/hayden-config.json"
    

Configuration

  • Configuration for Hayden is done through a JSON file that is specified as a command-line argument when starting Hayden.
$ "/home/USER/hayden_2020/Hayden/Hayden/bin/Debug/netcoreapp3.1/Hayden" "/home/USER/hayden_2020/hayden-config.json"
  • Hayden is picy about the syntax of this JSON file.
    • Commas only go between key:value pars. Trailing commas are not tolerated by Hayden.
  • Some options are implimented but not shown in the example JSON file.
    • The option to scan archive.json to save threads that have recently fallen off the board: <code"ReadArchive": true
  • Some databses will not let you connect as the DB root account from a system user other than root.
    • As a result of this, you should create a DB user specifically for Hayden to use.
  • The database connection is defined by this string value:
"connectionString" : "Server=DB_NETWORK_ADDRESS;Port=DB_PORT;Database=DATABASE;Uid=DB_USERNAME;Pwd=DB_PASSWORD;CharSet=utf8mb4;IgnorePrepare=false",


e.g.

"connectionString" : "Server=localhost;Port=3306;Database=asagi;Uid=hayden;Pwd=some_secret_value;CharSet=utf8mb4;IgnorePrepare=false",
  • Image downloading is controlled by two options:


"fullImagesEnabled" : true,
"thumbnailsEnabled" : false,

    • These values must either be false ortrue.