Digital ID
Latest

lladdr.info OpenBSD

📆
🏷
, , ,

purpose and application

This runbook sets up the environment and installs the application.

definitions

None.

prerequisites

  1. checked out [lladdr.info repository|https://git.sr.ht/~nighthawk/lladdr.info]
  2. pre-compiled binary of lladdr.info

steps

on the server

  1. Setting up the user account, downloading rc file and enabling the service
umask 077
useradd -g =uid -k /var/empty -m -d /var/lladdr.info -L daemon -c 'lladdr.info daemon' -s /sbin/nologin _lladdrinfo
ftp -vMo /etc/lladdrinfo https://git.sr.ht/~nighthawk/lladdr.info/blob/master/contrib/openbsd/lladdrinfo.rc
rcctl enable lladdrinfo

on the client

  1. Copying the binary and the template files for the application
cd <path to lladdr.info git repo>
scp <lladdrinfo binary> server:/var/lladdr.info/lladdr.info
scp -r templates/ server:/var/lladdr.info/

on the server

  1. adjust ownership and start the service
chgrp _lladdrinfo /var/lladdr.info/lladdr.info
chmod 0750 /var/lladdr.info/lladdr.info
rcctl start lladdrinfo

firewall rules

match out on egress inet proto { udp, tcp} to standards-oui.ieee.org port https user _lladdrinfo tag eallow

Resources

Gotosocial Restore

📆
🏷
, ,

purpose and application

Restore gotosocial on OpenBSD from a backup done via the following [procedure|https://brank.me/runbooks/gotosocial-backup/]

definitions

None.

prerequisites

  1. gotosocial and postgresql need to be installed pkg_add gotosocial-- postgresql-server--
  2. gotosocial must not be running rcctl stop gotosocial

steps

  1. create the database
su -s /bin/ksh -l _postgresql
psql -U postgres
create database gotosocial with locale 'C.UTF-8' template template0;
create user gotosocial;
\password gotosocial
grant all privileges on database gotosocial to gotosocial;  
\connect gotosocial
grant create on schema public to gotosocial;
\q
  1. restore the database backup and create statistics for the optimizer
gzip -dc <gotosocialdump.psql.gz> | psql --set ON_ERROR_STOP=on -U gotosocial gotosocial
psql -c 'ANALYZE VERBOSE' -U gotosocial gotosocial
exit
  1. restore the mediafiles
su -s /bin/ksh -l _gotosocial
tar -xzvf <gotosocial_media>.tar.gz -C /

Resources

Netbox Backup

📆
🏷
, , ,

purpose and application

Use this for backing up your netbox instance. This is specific to my setup YMMV.

definitions

  • YMMV - Your Mileage May Vary

steps

  1. Become netbox user su -s /bin/ksh -l _netbox
  2. Backup the database pg_dump -W postgres://netbox@127.0.0.1:5432/netbox | gzip > backup/netbox_$(date +%Y-%m-%d).psql.gz
  3. Backup media tar -czf backup/netbox-media_$(date +%Y-%m-%d).tar.gz netbox/netbox/media/
  4. Backup netbox configuration cp netbox/netbox/netbox/configuration.py backup/
  5. Backup gunicorn configuration cp netbox/gunicorn.py backup/

Resources

https://netboxlabs.com/docs/netbox/en/stable/administration/replicating-netbox/

Docspell Backup

📆
🏷
, , ,

purpose and application

When you want to backup docspell.

definitions

None.

steps

  1. Become docspell user
  2. Backup database pg_dump -W postgres://docspell@127.0.0.1:5432/docspell | gzip > backup/docsell_$(date +%Y%m%dT%H%M%S).psql.gz
  3. Backup joex config cp docspell-joex-0.41.0/conf/docspell-joex.conf backup/
  4. Backup rest server config cp docspell-restserver-0.41.0/conf/docspell-server.conf backup/

Resources

None.

Gotosocial Backup

📆
🏷
, , ,

purpose and application

Backing up gotosocial.

definitions

None.

steps

  1. Backup db pg_dump -W postgres://gotosocial@127.0.0.1:5432/gotosocial | gzip > /var/tmp/gotosocial_$(date +%Y%m%dT%H%M%S).psql.gz
  2. Backup media files gotosocial admin media list-attachments --config-path /etc/gotosocial.yaml --log-level fatal | xargs tar -cvzf /var/tmp/gotosocial-media_$(date +%Y%m%dT%H%M%S).tar.gz

Resources