GithubHelp home page GithubHelp logo

hugmouse / vpub-plus Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 3.0 395 KB

Fork of vpub, the forum software

Home Page: https://git.sr.ht/~m15o/vpub

License: BSD 2-Clause "Simplified" License

Makefile 0.05% CSS 3.18% Go 86.92% PLpgSQL 9.85%
forum

vpub-plus's Introduction

vpub-plus

Simple message board software and also a fork.

Examples

Status Cafe Forum

An example of a forum

Installation

To host it and install it you have to have:

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

Compiling vpub-plus from the source

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://[email protected]/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/.

vpub-plus's People

Contributors

hugmouse avatar yesitsme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vpub-plus's Issues

[Feature] Markdown tables

Markdown table

As a user of this forum, I want to have an ability to paste a markdown table.

An example of a markdown table:

| Tables   |      Are      |  Cool |
|----------|:-------------:|------:|
| col 1 is |  left-aligned | $1600 |
| col 2 is |    centered   |   $12 |
| col 3 is | right-aligned |    $1 |

It should render a table like this:

A markdown table shown on a vtub-plus forum

More

See it on a vpub forum: forum.status.cafe/topics/39#185

CSRF token invalid on HTTP site

Got follow error on login in HTTP site:

  • Response:
Forbidden - CSRF token invalid
  • Browser console:
Cookie "_gorilla_csrf" has been rejected because a non-HTTPS cookie can’t be set as "secure".

Looks like the CSRF token should be passed along with the forms.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.