2021-08-15 03:28:48 +02:00
# Welcome to ThreadR
2023-01-07 00:46:41 +01:00
2021-09-02 11:28:11 +02:00
This is the source code for the ThreadR Forum Engine.
2023-01-07 00:46:41 +01:00
The project originated as a school project with the goal of developing
a mix between a forum engine and a social media platform.
When school was over, we left the project up for some time with the
general intention to continue working on it until I took it down after
an extended period of inactivity to host my own website on my server.
2021-08-15 03:28:48 +02:00
2023-01-07 00:46:41 +01:00
Now, that it is being revived, the original scope of the project
doesn’ t really make sense anymore (at least to me) so it needs to shift
slightly.
Below is a list of goals that I would like to see achieved, feel free
to discuss this in the issues or commit comments.
2021-08-15 03:28:48 +02:00
2021-08-31 03:28:57 +02:00
- [x] come back online (see issue #2 )
2021-08-18 21:21:08 +02:00
- [x] go FOSS (make the source code publicly available under a FOSS license (see issue #5 ))
2021-09-07 10:23:15 +02:00
- [x] make the code portable so everyone can set up their own instance
2021-08-31 03:28:57 +02:00
- [ ] get generic forum functionality going (sign-up, creation of boards, creation of threads within boards, messages, profiles)
2021-08-15 03:28:48 +02:00
2023-01-07 00:46:41 +01:00
Once these two are given, here are some additional goals both from
the original scope of the project as well as my own ideas.
Input is welcome.
2021-08-15 03:28:48 +02:00
2021-08-15 03:30:47 +02:00
- [ ] anonymous posts (users can choose to post anonymously, registered users will have a unique name per thread that stays the same so users can tell each other apart)
2021-08-15 03:28:48 +02:00
- [ ] subscribing to threads
- [ ] "split thread here" feature (kinda like on Reddit when multiple ppl answer to one person)
- [ ] automatic loading of new messages in threads (opt-out in settings)
- [ ] notifications for new messages in subscribed threads (opt-out in settings)
- [ ] question threads with an "accept answer" feature, threads can be marked as question threads on creation
- [ ] like/dislike feature but in better (as in more limited in functionality and more nuanced, kinda like on StackExchange but with two types of likes/dislikes and without showing an actual number)
\- BodgeMaster
2023-01-07 00:46:41 +01:00
UPDATE: The ThreadR Forum Engine is now technically host-independent.
By default, it still contains the configuration for our test instance
but all host-dependent setup information is configurable now.
It is still heavily WIP.
2021-09-07 10:23:15 +02:00
# Installation
2023-01-07 00:46:41 +01:00
First of all, keep in mind that the ThreadR Forum Engine is still
in early development and things are subject to change.
For now, the only way to set up an instance is doing it the manual way;
automatic setup might be added in the future.
This setup guide is assuming that you are on a UNIX-like system
and have the following already installed and set up properly:
2021-09-07 10:23:15 +02:00
2021-09-07 10:26:34 +02:00
- Apache with PHP (will most likely also work on other web servers)
2021-09-07 10:23:15 +02:00
- MySQL or MariaDB
2021-09-08 10:04:44 +02:00
- Python 3
2021-09-07 10:23:15 +02:00
- Bash
Installation:
2021-09-07 10:26:34 +02:00
- To install the ThreadR Forum Engine, clone this repository into a directory that the web server has access to but that it outside of any web root.
2021-09-07 10:23:15 +02:00
- Add a database to your MySQL/MariaDB server that contains the tables shown below.
- Create a MySQL/MariaDB user for ThreadR and grant usage privileges for the tables to it.
2021-09-08 10:39:00 +02:00
- Symlink the directory `build/` to your desired location on the web root. ThreadR does not support being linked directly to the webroot.
2021-09-07 10:23:15 +02:00
- adjust the files in `config/` to your setup
- run ./deployment-script.sh to apply configuration
2021-09-08 10:39:00 +02:00
- Optionally symlink `build/redirect_home.html` to all places that you want to redirect to ThreadR.
2021-09-07 10:23:15 +02:00
Database tables:
- 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, may be null, default null, on update current_timestamp())
- `content` (text, may be null, default null)
- `attachment_hash` (bigint(20), may be null, default null)
- `attachment_name` (varchar, may be null, default null)
- `title` (varchar)
- `reply_to` (int, default -1)
- profiles (do we even use this?)
- `id` (smallint (why? this makes no sense whatsoever), primary key, index (why? probably wanted to do unique))
- `email` (varchar, index (I think that’ s supposed to be unique?))
2021-09-08 04:40:27 +02:00
- `display_name` (varchar)
2021-09-07 10:23:15 +02:00
- `status` (varchar)
- `about` (very long varchar)
- `website` (varchar)
- users
- `id` (smallint (again, this makes no sense), primary key)
- `name` (varchar, index (again, that’ s probably supposed to be 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)
2020-01-02 12:33:49 +01:00
# Git based automatic web deployment system
2023-01-07 00:46:41 +01:00
This repository will be automagically pulled by the test server
each time something is pushed by a user.
2020-02-19 04:18:32 +01:00
2023-01-07 00:46:41 +01:00
Dear Developers,
Please use pushes sparingly because it takes a while for the server
to replace all code variables.
2020-03-07 18:38:35 +01:00
2021-09-07 10:23:15 +02:00
What this thing does basically equates to:
2021-09-03 05:30:34 +02:00
```
ssh < user > @< threadr.ip | no public access set up currently >
cd /var/www/git
sudo -u www-data -s
rm -rf ./web-deployment
git clone < ssh git repository link >
cd web-deployment
./deployment-script
exit
logout
```
2023-01-07 00:46:41 +01:00
TBD: Remove this section when the ThreadR project moves to its final home
and this repository is only used for our local setup.
2021-09-03 05:30:34 +02:00
2020-02-19 04:18:32 +01:00
## Symlinks
2023-01-07 00:46:41 +01:00
The following files and directories are linked to areas where they can be
accessed by the web server:
2021-09-08 10:04:44 +02:00
* `build/` → `threadr.lostcave.ddnss.de/` (all files acessible by the web server, READMEs get deleted on deployment)
2020-02-17 02:06:40 +01:00
2020-03-10 21:28:12 +01:00
# Individual documentation for each file
2023-01-07 00:46:41 +01:00
2021-09-08 10:04:44 +02:00
### [[DIR] src](./src)
2023-01-07 00:46:41 +01:00
2020-03-10 21:28:12 +01:00
This folder contains all the files that are parts of ThreadR directly
2023-01-07 00:46:41 +01:00
2021-09-08 10:04:44 +02:00
### [[DIR] build](./build)
2023-01-07 00:46:41 +01:00
Placeholder folder to link against, will be deleted and recreated by
the deployment script, contains the a working instance of ThreadR after
successful execution of the deployment script
2021-09-02 02:40:53 +02:00
### [[DIR] config](./config)
2023-01-07 00:46:41 +01:00
A place to store the configuation for a specific ThreadR instance
(contains official instance config for now, will be removed and replaced
with a generic config eventually)
2021-09-02 06:38:21 +02:00
### [[DIR] macros](./macros)
2023-01-07 00:46:41 +01:00
2021-09-02 11:28:11 +02:00
files for use with variable_grabbler.py
2023-01-07 00:46:41 +01:00
2021-08-31 03:21:30 +02:00
### [deployment_script.sh](./deployment_script.sh)
2023-01-07 00:46:41 +01:00
This script is executed each time (or most of the time) the repository
gets pushed. It contains the commands to execute the code variable
replcement system and some other useful tasks. Its working directory is
the root of the git repository.
2021-09-02 11:28:11 +02:00
### [LICENSE.md](./LICENSE.md)
2023-01-07 00:46:41 +01:00
2021-09-02 11:28:11 +02:00
A copy of the Apache 2.0 license, the license this project is under
2023-01-07 00:46:41 +01:00
2021-09-02 11:28:11 +02:00
### [NOTICE](./NOTICE)
2023-01-07 00:46:41 +01:00
2021-09-02 11:28:11 +02:00
Copyright notice in plain text format
2023-01-07 00:46:41 +01:00
2021-08-31 03:21:30 +02:00
### [README.md](./README.md)
2023-01-07 00:46:41 +01:00
2020-03-10 21:28:12 +01:00
this file
2023-01-07 00:46:41 +01:00
2021-08-31 03:21:30 +02:00
### [variable_grabbler.py](./variable_grabbler.py)
2021-09-02 11:28:11 +02:00
2023-01-07 00:46:41 +01:00
Custom macro processor, takes two arguments:
- macro declaration file
- the file to be processed
2021-09-02 11:28:11 +02:00
2023-01-07 00:46:41 +01:00
Macros in code are strings of capitalized characters prefixed and
suffixed with %.
2021-08-31 03:21:30 +02:00
2023-01-07 00:46:41 +01:00
Macro definition format: JSON
- "< MACRO > ":"< text > " → direct replacement
- "< MACRO > ":["file","< file path > "] → insert file
- "< MACRO > ":["exec","< command > "] → run command and insert its output from stdout