Start meguca on boot

Meguca is an open source annonymouse imageboard written in Go Lang and Node.js

https://github.com/bakape/meguca

To start Meguca on boot, you can use monit

Create a monitoring script with

check process meguca with pidfile /meguca/.pid
  start program = "/bin/su -c 'cd /meguca; ./meguca start' meguca"
  stop program  = "/bin/su -c 'cd /meguca; ./meguca stop' meguca"

if failed port 8000 protocol HTTP
  request /api/health-check
  with timeout 10 seconds
  then restart

/meduca is where Meguca is installed.

Create a config.json file with

vi /meguca/config.json 

Add following content

{
	"ssl": false,
	"reverseProxied": true,
	"gzip": false,
	"imagerMode": 0,
	"cacheSize": 128,
	"address": "127.0.0.1:8000",
	"database": "user=meguca password=meguca dbname=meguca sslmode=disable",
	"certPath": "",
	"reverseProxyIP": ""
}

reverseProxied is set to true because my installation is behind reverse proxy (CloudFlare).

Make changes to config settings as requires.

Create a user

useradd -m -s /bin/bash meguca

Change ownership of meguca files

chown -R meguca:meguca /meguca

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *