From 1eb4107fe8f7aee5d3518a2430ee73af78ee9600 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Sat, 14 Jun 2025 17:53:30 +0200 Subject: [PATCH] README: rip out all the leftovers that are no longer relevant to the new implementation --- README.md | 111 ++++++++++++++---------------------------------------- 1 file changed, 28 insertions(+), 83 deletions(-) diff --git a/README.md b/README.md index c34c0c8..4b7754f 100644 --- a/README.md +++ b/README.md @@ -4,104 +4,49 @@ This is the source code for the ThreadR Forum Engine, rewritten in Go. ThreadR i ## Project Overview -Originally started as a school project in 2019 with the aim of creating a hybrid between a forum and a social media platform, ThreadR was temporarily abandoned after school ended. Revived in 2020, the project shifted focus to become a fully functional, portable, and open-source forum engine under the Apache 2.0 license. +ThreadR was originally started as a school project in 2019 with the aim of creating a hybrid between a forum and a social media platform. It was built with PHP and (back then still) MySQL. +After we finished school, it was temporarily abandoned. An attempt was made to revive it in 2020, open-sourcing the code and making some things configurable, but not much else happened. +Here we are now, with a full rewrite in Go started in 2025. -### Current Goals -- [ ] Bring ThreadR back online (see issue #2) -- [ ] Go FOSS by making the source code publicly available (see issue #5) -- [ ] Ensure portability for easy setup of personal instances -- [ ] Implement core forum features (sign-up, board creation, threads, messages, profiles) +## Project Setup -### Future Features -- Anonymous posting with unique per-thread identifiers for registered users -- Thread subscription and notifications for new messages (opt-out available) -- "Split thread here" functionality for focused discussions -- Automatic loading of new messages in threads (opt-out in settings) -- Question threads with an "accept answer" feature -- Nuanced like/dislike system (limited functionality, inspired by StackExchange) - -**Note:** ThreadR is now technically host-independent with configurable settings, though it remains a work in progress (WIP). - -## Installation - -ThreadR is in early development, and setup is currently manual. Automated setup scripts will be added in the future. +This is for development only. Currently, ThreadR is not ready for production use. ### Prerequisites -This guide assumes you are on a UNIX-like system with the following installed: -- Apache with PHP (may work with other web servers) -- MySQL or MariaDB -- Python 3 -- Bash + +- UNIX-like OS +- Go (golang) +- Mariadb ### Setup Steps -1. Clone this repository into a directory accessible by your web server but outside any web root. -2. Create a MySQL/MariaDB database with the tables listed below. -3. Add a dedicated MySQL/MariaDB user for ThreadR and grant usage privileges for the tables. -4. Symlink the `build/` directory to your desired web root location (ThreadR does not support direct web root linking). -5. Adjust configuration files in the `config/` directory to match your setup. -6. Run `./deployment-script.sh` to apply the configuration. -7. Optionally, symlink `build/redirect_home.html` to redirect specific locations to ThreadR. -### Database Schema -- **boards** - - `id` (int, primary key, auto increment) - - `name` (varchar) - - `user_friendly_name` (varchar) - - `private` (boolean or tinyint(1)) - - `public_visible` (boolean or tinyint(1)) -- **posts** - - `id` (int, primary key, auto increment) - - `board_id` (int) - - `user_id` (int) - - `post_time` (timestamp, default current_timestamp()) - - `edit_time` (timestamp, nullable, default null, on update current_timestamp()) - - `content` (text, nullable, default null) - - `attachment_hash` (bigint(20), nullable, default null) - - `attachment_name` (varchar, nullable, default null) - - `title` (varchar) - - `reply_to` (int, default -1) -- **profiles** (usage TBD) - - `id` (smallint, primary key, index) - - `email` (varchar, index, likely unique) - - `display_name` (varchar) - - `status` (varchar) - - `about` (long varchar) - - `website` (varchar) -- **users** - - `id` (smallint, primary key) - - `name` (varchar, index, likely unique) - - `authentication_string` (varchar(128)) - - `authentication_salt` (varchar) - - `authentication_algorithm` (varchar) - - `time_created` (timestamp, default current_timestamp()) - - `time_altered` (timestamp, default current_timestamp(), on update current_timestamp()) - - `verified` (boolean or tinyint(1), default 0) +1. Create a mariadb user and database for ThreadR (the names can be changed): +```sql +CREATE USER threadr IDENTIFIED BY 'super secure password'; +CREATE DATABASE `threadr`; +GRANT ALL PRIVILEGES ON `threadr`.* TO 'threadr'; +``` +2. Create a config file: In the `config` subdirectory, `cp config.json.sample config.json` and edit it to suit your needs. +3. Create an about page: Also in the `config` subdirectory, `cp about_page.htmlbody.sample about_page.htmlbody` and edit it to suit your needs. ## Running the Application -To start the ThreadR server, run the following command after configuration: + +After configuration, run the following command once to initialize the DB: ``` -go run ./main.go +go run main.go --initialize +``` +To start the ThreadR server, run this: +``` +go run main.go ``` The server will start on port 8080 by default. -## Project Structure -- **src/**: Core ThreadR source files -- **build/**: Placeholder for deployment, contains a working instance after running the deployment script -- **config/**: Configuration files for specific ThreadR instances -- **macros/**: Files for use with the variable grabbler script -- **static/**: Static assets (CSS, images) for the web interface -- **templates/**: HTML templates for rendering pages -- **handlers/**: HTTP request handlers for various routes -- **models/**: Database models and interaction logic -- **deployment_script.sh**: Script for code variable replacement and deployment tasks -- **variable_grabbler.py**: Custom macro processor for configuration -- **LICENSE.md**: Apache 2.0 license details -- **NOTICE**: Copyright notice in plain text - ## Contributing -We welcome contributions! Please discuss ideas or issues in the GitHub issues section or join our Discord server for real-time communication: [discord.gg/r3w3zSkEUE](https://discord.gg/r3w3zSkEUE). + +We welcome contributions! Please join our Discord server to get in touch: [discord.gg/r3w3zSkEUE](https://discord.gg/r3w3zSkEUE). ## License + ThreadR is licensed under the Apache 2.0 License. See [LICENSE.md](./LICENSE.md) for details. -**Authors:** BodgeMaster, Jocadbz \ No newline at end of file +**Authors:** BodgeMaster, Jocadbz