Fork of a fork that will probably never get finished. https://github.com/KushBlazingJudah/fedichan
Go to file
anomalous69 3ef5bc5190 Dump all changes 2023-10-03 19:45:31 +13:00
.githooks down to the main package it seems 2022-06-19 12:53:29 -07:00
activitypub Dump all changes 2023-10-03 19:45:31 +13:00
config (W.I.P) Basic Proof of work implementation 2023-07-03 04:34:41 +12:00
db Dump all changes 2023-10-03 19:45:31 +13:00
doc fix news template 2023-02-20 11:22:46 -04:00
internal/rx resecure some routes 2023-02-20 10:29:03 -04:00
routes Dump all changes 2023-10-03 19:45:31 +13:00
util Dump all changes 2023-10-03 19:45:31 +13:00
views Dump all changes 2023-10-03 19:45:31 +13:00
.gitignore move config file to ./fchan.cfg 2022-12-22 14:23:44 -04:00
LICENSE changed to base 36 for post ids 2021-02-01 23:39:32 -08:00
Makefile it begins 2022-12-22 13:04:30 -04:00
README.md nuke NestedObjectBase 2023-01-11 16:45:48 -04:00
fchan.example.cfg email new posts and reports 2023-02-20 13:54:56 -04:00
go.mod Dump all changes 2023-10-03 19:45:31 +13:00
go.sum Dump all changes 2023-10-03 19:45:31 +13:00
main.go (W.I.P) Basic Proof of work implementation 2023-07-03 04:34:41 +12:00
startdb.sh it begins 2022-12-22 13:04:30 -04:00

README.md

Fedichan

Fedichan is a libre, self-hostable, federated, imageboard platform that utilizes ActivityPub to federate between other instances. It is a continuation of FChannel, who's upstream has effectively stalled as the main developer has lost interest.

Why fork?

There is still a bit of a demand for this type of software and for a period of time, it was quite popular. At its peak, there were about 10 instances, however as of writing only one remains.

This fork aims to further improve the software and to give a reason for people to host instances again.

Development

To get started on hacking the code of Fedichan, it is recommended you setup your Git hooks by simply running git config core.hooksPath .githooks.

Before you make a pull request, ensure everything you changed works as expected, and to fix errors reported by go vet and make your code better with staticcheck.

Server Installation and Configuration

Minimum Server Requirements

  • Go v1.19+
  • PostgreSQL
  • ImageMagick
  • exiv2

Server Installation Instructions

  • Ensure you have Golang installed and set a correct GOPATH
  • git clone the software
  • Copy fchan.example.cfg to fchan.cfg and change the values appropriately to reflect the instance.
  • Create the database, username, and password for psql that is used in the config file.
  • Build the server with make
  • Start the server with ./fchan.

Server Configuration

config file

instance:fchan.xyz Domain name that the host can be located at without www and http:// or https://

instancetp:https:// Transfer protocol your domain is using, should be https if possible. Do not put https:// if you are using http://

instanceport:3000 Port the server is running on locally, on your server.

instancename:FChan Full name that you want your instances to be called.

instancesummary:FChan is a federated image board instance. Brief description of your instance.

dbhost:localhost Database host. Most likely leave as localhost.

dbport:5432 Port number for database. Most likely leave the default value.

dbname:fchan_server Database name for psql.

dbuser:admin Database user that can connect to dbname.

dbpass:password Database password for dbuser.

torproxy:127.0.0.1:9050 Tor proxy route and port, leave blank if you do not want to support

instancesalt:put your salt string here Used for secure tripcodes currently.

modkey:3358bed397c1f32cf7532fa37a8778 Set a static modkey instead of one randomly generated on restart.

emailserver:mail.fchan.xyz

emailport:465

emailaddress:contact@fchan.xyz

emailpass:password

emailnotify:email1@so.co, email2@bo.uo Comma seperated emails To.

Local testing

When testing on a local env when setting the instance value in the config file you have to append the port number to the local address eg. instance:localhost:3000 with instanceport also being set to the same port.

If you want to test federation between servers locally you have to use your local ip as the instance eg. instance:192.168.0.2:3000 and instance:192.168.0.2:4000 adding the port to localhost will not route correctly.

Managing the server

To access the managment page to create new boards or subscribe to other boards, when you start the server the console will output the Mod key and Admin Login Use the Mod key by appending it to your server's url, https://fchan.xyz/[Mod key] once there you will be prompted for the Admin Login credentials. You can manage each board by appending the Mod key to the desired board url: https://fchan.xyz/[Mod Key]/g The Mod key is not static and is reset on server restart.

Server Update

Check the git repo for the latest commits. If there are commits you want to update to, git pull and restart the instance.

Networking

NGINX Template

Use Certbot, (or your tool of choice) to setup SSL.

server {
        listen 80;
        listen [::]:80;

        root /var/www/html;

        server_name DOMAIN_NAME;

        client_max_body_size 100M;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                #try_files $uri $uri/ =404;
                proxy_pass http://localhost:3000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_cache_bypass $http_upgrade;
        }
}

Using Certbot With NGINX

  • After installing Certbot and the Nginx plugin, generate the certificate: sudo certbot --nginx --agree-tos --redirect --rsa-key-size 4096 --hsts --staple-ocsp --email YOUR_EMAIL -d DOMAIN_NAME
  • Add a job to cron so the certificate will be renewed automatically: echo "0 0 * * * root certbot renew --quiet --no-self-upgrade --post-hook 'systemctl reload nginx'" | sudo tee -a /etc/cron.d/renew_certbot