Hayden Guide: Difference between revisions

From Bibliotheca Anonoma
(Starting a guide on Hayden 4chan scraper)
 
(more notes formatted)
Line 10: Line 10:
== Prerequisites ==
== Prerequisites ==
How to set up a system so hayden will download, build, and run.
How to set up a system so hayden will download, build, and run.
TODO package install
* Prep system for updates
** Debian-based systems (ubuntu, debian, etc)
<syntaxhighlight lang="bash">
$ sudo apt update && sudo apt upgrade -y
$ sudo apt install -y git curl wget
</syntaxhighlight>
** RHEL-based systems (redhat, fedora, centos)
<syntaxhighlight lang="bash">
$ sudo yum update -y
</syntaxhighlight>
 
* 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)
<syntaxhighlight lang="bash">$ sudo dnf install dotnet-sdk-3.1</syntaxhighlight>
** Debian-based systems (ubuntu, debian, etc)
<syntaxhighlight lang="bash">$ sudo apt-get install -y dotnet-sdk-3.1</syntaxhighlight>


=== Database install ===
=== Database install ===
TODO DB install
TODO DB install
==== docker mariadb ====


== Download and Build ==
== Download and Build ==
* Prepare location:
<syntaxhighlight lang="bash">
$ mkdir -vp /home/USER/hayden_2020/
$ cd /home/USER/hayden_2020/
</syntaxhighlight>
* Clone (download) Hayden source code from Github:
<syntaxhighlight lang="bash">$ git clone https://github.com/bbepis/Hayden.git</syntaxhighlight>
Build the Hayden solution file:
<syntaxhighlight lang="bash">$ dotnet build "/home/USER/hayden_2020/Hayden/Hayden.sln"</syntaxhighlight>
* Run with config file:
<syntaxhighlight lang="bash">$ "/home/USER/hayden_2020/Hayden/Hayden/bin/Debug/netcoreapp3.1/Hayden" "/home/USER/hayden_2020/hayden-config.json"</syntaxhighlight>


Prepare location:
== Configuration ==
<code>$ mkdir -vp /home/USER/hayden_2020/</code>
* Configuration for Hayden is done through a JSON file that is specified as a command-line argument when starting Hayden.
$ cd /home/USER/hayden_2020/</code>
<syntaxhighlight lang="bash">$ "/home/USER/hayden_2020/Hayden/Hayden/bin/Debug/netcoreapp3.1/Hayden" "/home/USER/hayden_2020/hayden-config.json"</syntaxhighlight>
Clone (download) Hayden source code from Github:
* Hayden is picy about the syntax of this JSON file.
<code>$ git clone https://github.com/bbepis/Hayden.git</code>
** Commas only go between key:value pars. Trailing commas are not tolerated by Hayden.
Build the Hayden solution file:
* Some options are implimented but not shown in the example JSON file.
<code>$ dotnet build "/home/USER/hayden_2020/Hayden/Hayden.sln"</code>
** The option to scan archive.json to save threads that have recently fallen off the board: <code"ReadArchive": true</code>
Run with config file:
* Some databses will not let you connect as the DB root account from a system user other than root.
<code>$ "/home/USER/hayden_2020/Hayden/Hayden/bin/Debug/netcoreapp3.1/Hayden" "/home/USER/hayden_2020/hayden-config.json"</code>
** 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:
<syntaxhighlight lang="json">"connectionString" : "Server=DB_NETWORK_ADDRESS;Port=DB_PORT;Database=DATABASE;Uid=DB_USERNAME;Pwd=DB_PASSWORD;CharSet=utf8mb4;IgnorePrepare=false",</syntaxhighlight>
<br>e.g. <syntaxhighlight lang="json">"connectionString" : "Server=localhost;Port=3306;Database=asagi;Uid=hayden;Pwd=some_secret_value;CharSet=utf8mb4;IgnorePrepare=false",</syntaxhighlight>
* Image downloading is controlled by two options:
<br><code>"fullImagesEnabled" : true,</code>
<br><code>"thumbnailsEnabled" : false,</code>
** These values must either be <code>false</code> or<code>true</code>.

Revision as of 03:19, 15 August 2020

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.

  • 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
  • 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

TODO DB install

docker mariadb

Download and Build

  • Prepare location:
$ mkdir -vp /home/USER/hayden_2020/
$ cd /home/USER/hayden_2020/
  • Clone (download) Hayden source code from Github:
$ git clone https://github.com/bbepis/Hayden.git

Build the Hayden solution file:

$ dotnet build "/home/USER/hayden_2020/Hayden/Hayden.sln"
  • 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.