Skip to content

hugmouse/vpub-plus

Folders and files

NameName
Last commit message
Last commit date
Sep 20, 2024
Mar 2, 2025
Mar 13, 2023
Mar 2, 2025
Mar 2, 2025
Jan 27, 2023
Dec 24, 2024
Mar 2, 2025
Jan 1, 2025
Dec 29, 2021
Jan 6, 2025
Jun 30, 2022
Sep 20, 2024
Dec 26, 2024
Jan 6, 2025
Jan 14, 2023
Jan 27, 2023
Jan 27, 2023
Jan 24, 2025

Repository files navigation

vpub-plus

Simple message board software and also a fork.

Examples

Status Cafe Forum - vpub instance

Status Cafe Forum - vpub instance

Vpub Plus Forum - vpub-plus instance

Vpub Plus Forum - vpub-plus instance

Installation

Using Docker and Docker Compose

You can try it out using Docker, for testing purposes you can skip configuring .env file and just run:

docker-compose up -d

And then you can navigate to localhost:1337 to see your very own forum!

Compiling vpub-plus from the source

To host it and install it you have to have:

  • Golang
  • Postgresql
  • Git
  • Make
  • Systemd (optional)

Here is how to build vpub:

  1. git clone https://github.com/hugmouse/vpub-plus.git
  2. cd vpub-plus
  3. make

You should now have vpub in ./bin/!

Creating a vpub user

For isolation purposes, we can create a user that is going to run a vpub instance

  • useradd vpub

Make sure that vpub group exists too! And if it does not, then:

  • groupadd vpub

Database setup

Make sure that you have postgresql installed!

  • Create a new database: createdb vpub (or create it from psql)

Set up environment variables

Now you have to set those environment variables:

  • DATABASE_URL - Postgresql connection URL
  • SESSION_KEY - 32 bytes long session key
  • CSRF_KEY - 32 bytes longs CSRF key
  • CSRF_SECURE - Makes CSRF cookies secure (true/false)
  • PORT - What port is going to be used by a vpub HTTP server

You can check the example configuration in systemd config!


At this point you can run vpub just fine, other steps are optional ones

Systemd config (optional)

Create a /etc/systemd/system/vpub.service file and add this example config to there:

[Install]
WantedBy=multi-user.target

[Unit]
Description="Message board"
Documentation="https://github.com/hugmouse/vpub-plus"

[Service]
ExecStart=/usr/local/bin/vpub
User=vpub
Group=vpub

Environment=DATABASE_URL=postgres://vpub@127.0.0.1/vpub?sslmode=disable

# Default port 8080
Environment=PORT=1337

# Those keys should be 32 bytes long
Environment=SESSION_KEY=CHANGE ME
Environment=CSRF_KEY=CHANGE ME

# If you are going to use HTTPS, then use secure cookies
Environment=CSRF_SECURE=true

After that you just can run it like any other systemd service: systemctl enable --now vpub

If something goes wrong, you can use journalctl -eu vpub to troubleshoot this service

Where to go next

At this point a vpub service should be running on a 1337 port without HTTPS.

  • You can add a reverse proxy, like NGINX, to handle a secure connection
  • You can install a certbot that is going to create a let's encrypt cert for your domain

Credentials

On the first run vpub will create an admin user with the password "admin". Log in and change it by navigating to /admin/users route.

Registering new users

To register you have to have a unique key! Create one on /admin/keys page and use it to create a new user account.

Atom feed

You need to change the URL in settings to pass the atom feed check.

Specify your domain name in /admin/settings/edit like this: https://example.com/.