*** All scripts in this directory should be executed from the root of the linux folder *** ########################################################## INTRO ####################################################### Most scripts in this site have a corresponding vars file that MUST be populated for correct functionality. I have started writing checks to ensure corresponding variables are populated, but have not completed this site-wide. Again: --- CHECK YOUR VARIABLES --- For simplicity and consistency, all scripts should be run via bash. If there are .sh and .py files named similarly, use the .sh via bash. The following headings correspond to directory names, which themselves describe categorically what the scripts they contain do. Script names lead each bullet and a description of that script follows. ---------------------------------------------------------- BACKUP ------------------------------------------------------ NOTE: before running anything in this folder, if backups are going to a remote server, passwordless ssh should be set up BEFORE running anything here. - deploy_restic.sh: configures git and ssh connection parameters before installing dependencies including Ansible, cloning the restic playbook, and running it. This sources vars from restic-vars.yaml **NOTE: restic_dest_port is a REQUIRED variable. This should be 22 in most cases.** After installation, this script runs an initial backup before creating a backup script, setting that to run via cron. ---------------------------------------------------------- CLOUDFLARE -------------------------------------------------- Nothing in this folder should be called directly at this time ---------------------------------------------------------- EMAILS ------------------------------------------------------ - create_email_domain.sh: Adds a domain specified in email_server_vars.json to Mailcow via API. - create_mailbox.sh: creates any number of specified email accounts defined in email_account_vars.json - create_email_dns_records.sh: *THIS WILL NOT DELETE ANY DNS RECORDS* creates correct DNS records on Cloudflare for domain specified in email_server_vars.json. You will need to manually remove records if they exist and overlap for an old server config. - transfer_mailbox.sh: Installs imapsync (if not present) and syncs src and dst mailboxes as definied in email_transfer_vars.json. The dst_hostname in the json file already contains mail-01 mailcow IP address. **DO NOT GET THESE BACKWARDS** *NOTE: All functions/json vars files are configured to use lists where appropriate, and you should define as many instances of a given object as needed ---------------------------------------------------------- FILES ------------------------------------------------------- There is nothing executable in this directory- it contains keys and other files that are dependencies for scripts. ---------------------------------------------------------- LOGS -------------------------------------------------------- Scripts will log to this directory. This is only implemented for a few so far. ---------------------------------------------------------- PVE --------------------------------------------------------- Ignore this. ---------------------------------------------------------- SSL --------------------------------------------------------- - get-cert.sh: Configures prereqs before cloning and running Ansible playbook that uses letsencrypt cloudflare dns to obtain a cert for the given domains before setting up a cron job for renewal. Sources vars from cert-vars.yml ---------------------------------------------------------- STORAGE ----------------------------------------------------- - expand_root_lvm.sh: WARNING: THIS SCRIPT DELETES A PARTITION TABLE <<<<<<< READ THAT AGAIN this was put together after finding extreme annoyance at needing to do extensive googling every time a root drive needs to be expanded. LOOK AT THE VARS, THEY ARE AT THE TOP OF THE SCRIPT- if you get these wrong, you are going to have a very bad day. Currently, this script only works with LVM. The vars declared at the top are self-explanatory in that you define the target drive and parition number. ROOT_PART_TO_EXPAND="3" for example would target /dev/3. If you are unsure of the use of this script, simply read it and use the steps as a guide for commands you might run rather than decimating an innocent boot drive or worse. ---------------------------------------------------------- UTILS ------------------------------------------------------- Nothing in this folder should be called directly at this time