Backing Up Django Data in Docker-Compose Environment

My solution for backing up this website's data

I chose to create a simple bash script that runs on a VM on my home network and backups up the database and media files used on this website.

#!/bin/bash

TODAYS_DATE=`date +"%m-%d-%Y"`

ssh -i /home/user/.ssh/data-manager_rsa user@averyuslaner.com 'docker exec user-db mysqldump -u db_user --password=supersecretpassword photo_blog' > /home/user/backups/averyuslaner.com/${TODAYS_DATE}_db_dump.sql

ssh -i /home/user/.ssh/data-manager_rsa user@averyuslaner.com 'docker run --rm -v personal_website_media_volume:/media -v $(pwd)/backups:/backups ubuntu tar cvf /backups/media.tar /media'

scp -i /home/user/.ssh/data-manager_rsa user@averyuslaner.com:/home/user/backups/media.tar /home/user/backups/averyuslaner.com/${TODAYS_DATE}_media.tar

I don't love having the database password in …

Prometheus VM

Documenting the setup of my Prometheus VM

Where?

It runs in a 2 vCPU 2 GB RAM proxmox VM with Ubuntu 20.04. The proxmox host is an old laptop.

What?

Data manager VM for collecting prometheus data that can be ingested by the Grafana instance running in my Home Assistant instance.

How?

Original creation:

docker run --name prometheus -d -p 9090:9090 -v /home/myuser/configs:/etc/prometheus prom/prometheus --config.file=/etc/prometheus/prometheus.yml --web.config.file=/etc/prometheus/web-config.yml

The context:

~/configs$ ls
prometheus.crt  prometheus.key  prometheus.yml  web-config.yml

prometheus.yml:

global:
  scrape_interval: 15s
  evaluation_interval: 30s
  # scrape_timeout …

I Broke My Media Volume

Does it work yet?

Image?

If you can see this, it means I figured out how to solve the problem with my nginx container being unable to read the media volume from my Django/Wagtail container.

disable_chat_files.png

From my nginx logs:

2022/05/10 00:01:28 [error] 34#34: *4 open() "/app/media/images/disable_chat_files.width-800.png" failed (13: Permission denied), client: 69.162.230.182, server: averyuslaner.com, request: "GET /media/images/disable_chat_files.width-800.png HTTP/2.0", host: "averyuslaner.com", referrer: "https://averyuslaner.com/i-broke-my-media-volume/"

The static and media volumes are mounted to /app inside the nginx container. Their permissions:

root@e7b004ccbbb5:/# ls …

(Failing to) Run a VM on Fedora 35 with the Framework Laptop

An attempt to run a Parrot OS VM on Fedora 35 by any means necessary.

Virt-Manager (QEMU/KVM)

The first blocker encountered during setup of my Parrot OS VM is that the VM creation wizard reports that it "Failed to find a suitable default network."

Virt-Manager netword device

If I ignore the problem and attempt to hit finish, it tells me it is "Unable to complete install: 'internal error: No <source> 'bridge' attribute specified with <interface type='bridge'/>'".

I'm not entirely sure what device name it's looking for but I'll try …