The last atempt of a 83channel engine.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Birunda 1c067f78be Merge branch 'release/0.2.1' 2 months ago
app feature: add cli command to add/remove individual tags from posts 2 months ago
config feature: create a simple plugin manager to load and run external processes 5 months ago
logger feature: add msgpack support and move websocket logic to new module 12 months ago
mock Improve feed view 1 year ago
scripts/dev feature: create file bans, check for file bans on post and thread creation 1 year ago
static feature: collapse half hidden posts or threads 2 months ago
template fix: hide radio iframe 2 months ago
translation feature: add usecase for creating event listeners 11 months ago
us83kunc feature: unixrpc client commands 4 months ago
.dockerignore chore: add a functional docker-compose.yml file 2 months ago
.drone.yml feature: add drone ci pipeline 1 year ago
.gitignore chore: add a functional docker-compose.yml file 2 months ago
Dockerfile chore: add a functional docker-compose.yml file 2 months ago
Dockerfile.dev change: build without lilliput on dev dockerfile 1 year ago
LICENSE Initial commit 1 year ago
Makefile feature: add websocket route for creating posts with raw file bytes 10 months ago
README.md chore(README): add a docker compose section 2 months ago
docker-compose.yml chore: add a functional docker-compose.yml file 2 months ago
go.mod feature: add a unix socket adapter 5 months ago
go.sum feature: add a unix socket adapter 5 months ago
logo.png chore(README): add meaningful information 2 months ago
main.go fix: main.go 9 months ago
nginx.vhost.conf chore: add a functional docker-compose.yml file 2 months ago

README.md

83kun

83kun

The last atempt of a 83channel engine.

Overview

That project aims to build a modular imageboard engine using Go and Clean Arquitecture.

Installation

Env variables

  • MONGO_URI mongodb connection string
  • FILE_DIR path to file storage directory
  • LOG_FILE path to a log file, leave empty to output logs to stdout
  • THUMB_DIR path to thumb storage directory
  • DEFAULT_AUDIO_COVER path to a image file used as the default audio file cover image
  • MONGO_DATABASE_NAME name of the mongodb database
  • WEB_NOTIFICATION_EMAIL email used in webpush notifications
  • WEB_NOTIFICATION_VAPID_PUBLIC_KEY public key used in webpush notifications
  • WEB_NOTIFICATION_VAPID_PRIVATE_KEY private key used in webpush notifications
  • PLUGINS_DIR path to a directory of plugins loaded by the engine

Manual

Requirements

  • ImageMagick 7
  • FFmpeg 6
  • Go 1.18
  • Make
  • MongoDB 5

Build

Build the 83kun executable with:

make build

Now you can run the 83kun command. Make sure you have a mongodb database running locally and start the application server with:

export MONGO_URI='mongodb://localhost:27017/'
export FILE_DIR=/data/files
export THUMB_DIR=/data/thumb

./83kun server --host 0.0.0.0 --port 7777

Now you need to configure a reverse proxy, nginx, to serve the engine correctly. You may use the nginx.vhost.conf file provided as a base template.

Create a local 83kun-files and 83kun-thumb folder:

mkdir 83kun-files
mkdir 83kun-thumb

Open the Dockerfile, go at line 25, 26, 27 and 31 and change the 1001 guid or 1000 uid to your local guid and uid (use the id command to get those values).

Now you can run the engine with:

docker-compose up

When the engine is up and running, you can create a initial tag with docker exec:

docker exec -it 83kun-83kun-1 ./83kun tag create h
docker exec -it 83kun-83kun-1 ./83kun tag update --global h

And other yo your liking:

docker exec -it 83kun-83kun-1 ./83kun tag create nsfw
docker exec -it 83kun-83kun-1 ./83kun tag create pol
docker exec -it 83kun-83kun-1 ./83kun tag create 2d

# To know more about the ./83kun command run
docker exec -it 83kun-83kun-1 ./83kun --help

Docker

Build the image.

docker build -t 83kun:last .

Now you can run the engine with docker run command. Make sure you have a mongodb database running locally.

docker run -it --rm --name 83kun \
    --add-host=localhost:host-gateway \
    -e DEFAULT_AUDIO_COVER=/data/files/audio.png \
    -e LOG_FILE= \
    -e FILE_DIR=/data/files \
    -e THUMB_DIR=/data/thumb \
    -e MONGO_URI='mongodb://localhost:27017/' \
    -p 7777:7777 \
    -p 7778:7778 \
    -p 7780:7780 \
    -v ./83kun-files:/data/files \
    -v ./83kun-thumb:/data/thumb \
    --entrypoint /app/83kun \
    83kun:last \
    serve --host 0.0.0.0 --port 7777

Development

Folder structure

.
├── translation/ # i18n translation files
├── us83kunc/ # go library used by plugins to stabilish a communication channel
├── config/ # global configuration
├── logger/ # global logging library
└── app/ # engine code, clean arquitecture style
    ├── adapter/ # communication with outside world goes here
    ├── contract/ # interfaces used by the engine to talk to external libraries
    ├── controller/ # controllers used to bridge the i/o between the adapter layer and the usecase layer
    ├── entity/ # core entities of the engine, essential operations and business logic
    ├── factory/ # object instantiation goes here
    ├── infrastructure/ # external libraries and databases
    ├── presenter/ # interfaces used by the controllers to format the output of a usecase
    ├── repository/ # interfaces for all database operations
    ├── usecase/ # all business logic operations
    └── view/ # views used by the controllers to output a specific response for a specific adapter, must implement a presenter interface

Watch command

You can automatically reload the engine when editing the code with the command:

make watch

But you need to have entr installed.