Giter Site home page Giter Site logo

sicxnull / homelab-scripts Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 73 KB

Various Scripts w/Discord Embeds for my Homelab

Python 100.00%
certbot discord-api discord-bot discordpy homelab homelab-automation homelab-setup pfsense pfsense-backup plex

homelab-scripts's Introduction

Homelab Scripts w/Discord Embeds

Various scripts I use to maintain my homelab. Sends notifications to Discord

Scripts

apt-upgrade.py - Pretty straight forward. Runs apt-get update & upgrade. Sends notification when complete

  • change webhook_url & pytz.timezone as needed

image

rsync.py - Runs rsync command. ignores the various filetypes that cause errors. Sends notification when complete

  • change webhook_url source_dirs target_dir & pytz.timezone

rsync-ssh.py - Runs rsync command - Syncs to remote machine via SSH ignores the various filetypes that cause errors. Sends notification when complete

  • change private_key webhook_url source_dirs target_dir & pytz.timezone

image

certbot-renewal.py - Checks expiration date of certificate. Notifies when renewed

  • change webhook_url subdomain & base_domain (TO DO: Notify if cert expires, renew)

image

plex-update.py - checks current Plex version and updates if needed. Notifies when updated

  • change webhook_url

image

plex-backup.py - backs up plex db & data

  • change webhook_url

  • change backup_dir

image

pfbak.py - creates pfSense backup and notified when complete

  • change .env file

image

vaultwarden.py - Modified version of an existing VaultWarden backup script. Added ability to save to samba share and send notifications. The existing VaultWarden DB is encrypted but still stores sensitive data in cleartext such as email address, password hint and websites. This encrypts the archive to add another layer of protection.

vaultwarden-ssh.py - Same as above, sends to remote machine via SSH instead. Change remote_host , remote_username, remote_path as well as everything below

  • change webhook_url
  • create .secrets folder if it does not already exist sudo mkdir /root/.secrets
  • add the following to warden.ini sudo nano /root/.secrets/warden.ini
[Vaultwarden]
password = YOUR_PASSWORD_HERE
  • Set permissions so only root has access
sudo chmod 700 /root/.secrets
sudo chmod 600 /root/.secrets/warden.ini
sudo chown -R root:root /root/.secrets

image

snapraid.py - fork of snapraid-runner

  • change webhook_url in snapraid-runner.conf. otherwise follow same configuration.

image

Deployment

Add to crontab. Example:

  • rsync Daily @ 10pm
0 22 * * * python3 /opt/homelab-scripts/rsync.py
  • SnapRaid Daily @ 1am
0 1 * * * python3 /opt/homelab-scripts/snapraid/snapraid.py -c /opt/homelab-scripts/snapraid/snapraid-runner.conf
  • pfSense Sundays @ 8am
0 8 * * 0 python3 /opt/homelab-scripts/pfsense/pfbak.py
  • Vaultwarden Sundays @ 8:05am
5 8 * * 0 python3 /opt/homelab-scripts/pfsense/vaultwarden.py
  • apt-upgrade Sundays @ 9am
0 9 * * 0 python3 /opt/homelab-scripts/apt-upgrade.py
  • Plex update Daily @ 4am
0 4 * * * python3 /opt/homelab-scripts/plex-update.py
  • certbot renewal every 6 hours
0 */6 * * * python3 /opt/homelab-scripts/certbot-renewal.py

homelab-scripts's People

Contributors

sicxnull avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.