0. check that all files are present
- lighttpd.conf torrc
  - configuration files
- Nano block-cucknet.lua err*.html robots.txt Static/*.png Static/nanochan.css
  - essential server files for nanochan, in /var/www/nano3chan/
and optionally:
- nanochan.pem nanochanv2.pem
  - tls cert keys, hakase's and mine respectively
- nano3chan/ nano3chanv2/ nanochan/
  - hidden service keys, hakase's v2+v3 and my v3 addresses
- captcha/
  - contains the source for the harder version of the captcha
-> other required folders should be generated upon creation of the initial account

1. modify the configs and other files
- Nano/source.lua -> generate.mainpage: modify the html contents as needed
- torrc: - set NumCPUs according to the cores on your CPU
         - remove or modify HiddenService* entries as needed
- lighttpd.conf: - switch out server.event-handler and server.network-backend values if not using openbsd
                 - remove or modify server.* and $SERVER["socket"] entries as needed (remove the redirects, for one)
-> if the folder locations or user names/groups aren't setup exactly as how the following steps describe, change their values in the config files too
-> if you prefer to have lighttpd run on different ports, the port values can be found/changed at "HiddenServicePort" for torrc and "server.port" / "$SERVER["socket"]" for lighttpd.conf

1.5 make the ssl and hidden service keys yourself
- download and compile mkp224o, then run `./mkp224o -s -d $directory -B -t $threads nanochan`
  - add the resulting folder to the location specified in torrc's HiddenServiceDir
- use the included gencert.sh script to generate the .pem file required for lighttpd (needs openssl)

2. move files over to their respective folders
mkdir /var/tor /etc/lighttpd /var/www /var/log/lighttpd /var/cache/lighttpd
mv nanochan.pem nanochanv2.pem /etc/ssl/certs/
mv nano3chan/ nano3chanv2/ nanochan/ torrc /var/tor/
mkdir /var/tor/keys
mv lighttpd.conf /etc/lighttpd/
mv nano3chan/ /var/www/
mv captcha /usr/bin/captcha # if applicable
rm source.lua
ln -s /var/www/nano3chan/Nano /var/www/nano3chan/source.lua
-> change the original file locations above as needed
-> modify the first two lines according to any modifications made in step 1

3. set up the two usergroups
groupadd -g 1000 nanochan
useradd -u 1000 -g 1000 -M -N -s /usr/sbin/nologin -d /var/www/nano3chan nanochan
groupadd -g 1001 _tor
useradd -u 1001 -g 1001 -M -N -s /usr/sbin/nologin -d /var/tor _tor
-> (modify uids/gids and names as needed, check /etc/group and /etc/passwd to make sure they don't conflict with existing usergroups)

4. set perms and ownership
chown root:root /etc/ssl/certs/nanochan.pem /etc/ssl/certs/nanochanv2.pem /etc/lighttpd/lighttpd.conf
chown -R _tor:_tor /var/tor
chown -R nanochan:nanochan /var/www /var/log/lighttpd /var/cache/lighttpd
chmod 644 /etc/ssl/certs/nanochan.pem /etc/ssl/certs/nanochanv2.pem /etc/lighttpd/lighttpd.conf
chmod -R 644 /var/www /var/log/lighttpd /var/cache/lighttpd
chmod 644 /var/www/nano3chan/source.lua
chown nanochan:nanochan /var/www/nano3chan/source.lua
shopt -s globstar
chmod 755 /var/www /var/log/lighttpd /var/cache/lighttpd /var/www/**/ /var/log/lighttpd/**/ /var/cache/lighttpd/**/
shopt -u globstar
-> perform the chmods for these two directories by hand:
  - (/var/tor: 600 for files, 700 for folders, 644 for logs and torrc)
  - (/var/www/nano3chan: 644 for files, 755 for folders and /Nano)
-> modify chmod and chown filenames according to any modifications in step 2
-> if not using bash, modify the last chmod command to expand the folders properly

5. install the dependencies
- install tor, lighttpd, haserl, graphicsmagick, ffmpeg, lua
  - lua can be 5.1 or 5.2 (untested on 5.3), but must be compatible with haserl. might also need liblua for haserl
  - lighttpd *might* need the gamin package or to install/enable the required modules to work
- install nanochan's lua requires: luasqlite3, openssl and bcrypt
  - easiest way would be to use luarocks (lsqlite3, openssl, bcrypt), but it's not available as an openbsd port (install specialized packages in that case)

6. start the server
tor -f /var/tor/torrc
lighttpd -f /etc/lighttpd/lighttpd.conf
- remove all entries in Accounts in the database if applicable
- open localhost:37568 (or some other port)
- run Nano/mod/global/regenerate after logging in
