Update file run_onchange_after_50-rclone.tmpl

This commit is contained in:
Brian Zalewski 2023-04-11 20:30:35 +00:00
parent ef8b48c13b
commit 0be2ecc07b

View file

@ -1,5 +1,50 @@
{{- if ne .host.distro.family "windows" -}}
#!/usr/bin/env bash
# @file Rclone S3 Mounts
# @brief This script configures Rclone to provide several S3-compliant mounts by leveraging CloudFlare R2
# @description
# Install Doctor leverages Rclone and CloudFlare R2 to provide S3-compliant bucket mounts that allow you to retain stateful files and configurations.
# In general, these buckets are used for backing up files like your browser profiles, Docker backup files, and other files that cannot be stored as
# as code in your Install Doctor fork.
#
# This script sets up Rclone to provide several folders that are synchronized with S3-compliant buckets (using CloudFlare R2 by default).
# The script ensures required directories are created and that proper permissions are applied. This script will only run if `rclone` is
# available in the `PATH`. It also requires the user to provide `CLOUDFLARE_R2_ID` and `CLOUDFLARE_R2_SECRET` as either environment variables
# or through the encrypted repository-fork-housed method detailed in the [Secrets documentation](https://install.doctor/docs/customization/secrets).
#
# ## Mounts
#
# The script will setup five mounts by default and enable / start `systemd` services on Linux systems so that the mounts are available
# whenever the device is turned on. The mounts are:
#
# | Mount Location | Description |
# |-----------------------|-----------------------------------------------------------------------------------------------------------------------|
# | `/mnt/s3-private` | Private system-wide bucket used for any private files that should not be able to be accessed publicly over HTTPS |
# | `/mnt/s3-public` | Public system-wide bucket that can be accessed by anyone over HTTPS with the bucket's URL (provided by CloudFlare R2) |
# | `/mnt/s3-docker` | Private system-wide bucket used for storing Docker-related backups / files |
# | `/mnt/s3-system` | Private system-wide bucket similar to `/mnt/s3-private` but intended for system file backups |
# | `$HOME/.local/mnt/s3` | Private user-specific bucket (used for backing up application settings) |
#
# ## Permissions
#
# The system files are all assigned proper permissions and are owned by the user `rclone` with the group `rclone`. The exception to this is the
# user-specific mount which uses the user's user name and user group.
#
# ## Samba
#
# If Samba is installed, then by default Samba will create two shares that are symlinked to the `/mnt/s3-private` and `/mnt/s3-public`
# buckets. This feature allows you to easily access the two buckets from other devices in your local network. If Rclone buckets are not
# available then the Samba setup script will just create regular empty folders as shares.
#
# ## Notes
#
# * The mount services all leverage the executable found at `$HOME/.local/bin/rclone-mount` to mount the shares.
#
# ## Links
#
# * [Rclone mount script](https://github.com/megabyte-labs/install.doctor/tree/master/home/dot_local/bin/executable_rclone-mount)
# * [Rclone default configurations](https://github.com/megabyte-labs/install.doctor/tree/master/home/dot_config/rclone)
# * [Rclone documentation](https://rclone.org/docs/)
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}