Fuze Mediaboard 0.1.4 documentation/tutorial
Running a chat server may seem daunting, but hosting a basic instance is actually simple. As the tutorial progresses, you will start with running a local server, which will evolve into a platform viewable on the web.
Supported OS: FreeBSD, Linux, MacOS
A more condensed version for advanced users is available in the README on the GitHub page.
Getting started
Compiling from source
Prerequisites: Git, CMake, Boost 1.88, SQLite OR PostgreSQL.
First ensure that submodules are downloaded. Use this command:
git submodule update --init --recursive
Now, to compile the server:
cmake -B build
cmake --build build -D WITH_MAGICK=OFF
cmake --install build --prefix install
Running the server
- If compiled from source, execute
./install/bin/MediaboardServer - If using the AppImage, mark the file as executable and then run it
--create_owner to the command. Enter this link in your browser (you may be able to CTRL+click it) and enter your desired credentials.
If you ever forget the password, you can simply run the create_owner command again. Note that it will not be the same account.
Making it public
Fuze mediaboard requires HTTPS for secure remote authentication. It is recommended to use a reverse proxy like NGINX. SSL certificates (required for HTTPS) can be obtained for free using Certbot.
Example NGINX config.
Ensure your IP is accessible to the outside world, using port forwarding if necessary.
Permissions
By default, only the owner can read and write messages.
- After logging in, click on the "Manage server" tab in the toolbar as an administrator.
- In the Manage permissions tab, click "Add group" and select "Public".
- Change setting to Allow for the permissions you want to grant.
Leaving a setting on Inherit means the permission will be searched by traversing up the inheritance tree (if applicable), and cascading down the group heirarchy until a non-inherited setting is found. If no permission setting is found by the time inheritance passes the server-level setting for Public, permission is denied.
If both a user and group permission are set on an object, the user setting takes priority.
Optional: ImageMagick support
In order for thumbnails to work, the software needs to be compiled with ImageMagick.
Usually a custom build of ImageMagick is preferred, to ensure all required delegates are installed. FreeBSD's package is sufficient so you can install that via pkg, but Debian's apt package is not.
Refer to the ImageMagick section of README.md.
Configuration
Changes made to config.ini are read when the server starts. These options can also be passed directly in the command line, which will override what is set in the config file.
| config.ini | |
|---|---|
| server_port | Serves http://localhost:8300 by default. Change this if running multiple Mediaboard instances. |
| threads | Number of async threads. Values greater than 1 should be used for testing only. |
| file_size_limit_mb | For limiting the maximum size of user-uploaded files and to prevent abuse. |
| favicon_url site_name show_watermarks | Cosmetic settings. |
| strip_metadata | Removes metadata from uploaded images (except SVG files). |
| thumbnail_file_exension thumbnail_size | Format must be supported by ImageMagick. Please note that any change in this setting will not apply to existing thumbnails - those will have to be converted manually. |
| avif_thumbnails heic_thumbnails svg_thumbnails webp_thumbnails mp4_thumbnails webm_thumbnails | Requires the respective formats to be installed in the instance of ImageMagick used - Use magick -list format to see if they are supported.Video formats require ffmpeg. |
| sqlite_database_file | Path to SQLite database file. Ignored when compiled with the PostgreSQL interface. |
|
postgresql_host postgresql_port postgresql_user postgresql_database_name | PostgreSQL database connection parameters. Only used when compiled with the PostgreSQL interface. |
Embedding into a webpage
Fuze Mediaboard can be embedded inside of a page by using an iframe:
<iframe src="http://localhost:8300/"></iframe>
display=embed as a URL parameter:
<iframe src="http://localhost:8300/?display=embed"></iframe>
display=embeddisplay=embed also works with individual threads - just add &thread=0 (with a valid thread ID) to the path. Embedding threads has a number of potential uses, for example adding comment sections on blog posts, or an artist uploading his/her latest work.
Optional: Using PostgreSQL as the database
Alternatively, you can build with the PostgreSQL interface instead:
cmake -B build -D FUZEDBI_USE_POSTGRES=ON
Set the following options in config.ini to correspond to the database:
postgresql_host,
postgresql_port,
postgresql_user, and
postgresql_database_name.
Start cluster
This may be skipped on certain Linux distros such as Debian. Check if the server is already running with systemctl status postgresql or service postgresql status
initdb -D /var/db/postgres/18/main/
pg_ctl -D /var/db/postgres/18/main start
Create database
su -
su postgres
createdb fuze_mediaboard
psql -d fuze_mediaboard
fuze_mediaboard=# CREATE USER mediaboard_server WITH PASSWORD '
fuze_mediaboard=# GRANT ALL ON SCHEMA public TO mediaboard_server;
fuze_mediaboard=# \q
To import the database template, go back to your user account and run:
psql -U postgres fuze_mediaboard < database_template.sql
Add the following line to pg_hba.conf[documentation]. Insert it at the top of the table so that it won't be overridden by other settings:
local fuze_mediaboard mediaboard_server passwordmediaboard_server is the PostgreSQL user which interacts with the database named fuze_mediaboard.\
Set the environment variable FUZE_MEDIABOARD_PASSWORD with the same password used in the CREATE_USER statement earlier. Open a new terminal window or reboot your system to apply the change.