From 9dfb72876418eb6d8d3a2962a76ae26d993c3f8d Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Sat, 4 Feb 2023 08:19:52 +0000 Subject: [PATCH] Update 5 files - /home/dot_config/rclone/merge_private_rclone.conf - /home/dot_tool-versions.tmpl - /home/dot_config/rclone/merge_private_rclone.conf.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl - /software.yml --- .../run_onchange_after_07-docker-plugins.tmpl | 32 +++++++++----- ...ne.conf => merge_private_rclone.conf.tmpl} | 2 +- home/dot_tool-versions.tmpl | 6 +-- software.yml | 43 +++++++++---------- 4 files changed, 46 insertions(+), 37 deletions(-) rename home/dot_config/rclone/{merge_private_rclone.conf => merge_private_rclone.conf.tmpl} (99%) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl index 865aa156..9ac6325b 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_07-docker-plugins.tmpl @@ -19,17 +19,27 @@ fi ### Docker Rclone plugin # Source: https://rclone.org/docker/ -if [ ! -d /var/lib/docker-plugins/rclone/config ]; then - logg info 'Creating directory /var/lib/docker-plugins/rclone/config' - sudo mkdir -p /var/lib/docker-plugins/rclone/config -fi -if [ ! -d /var/lib/docker-plugins/rclone/cache ]; then - logg info 'Creating directory /var/lib/docker-plugins/rclone/cache' - sudo mkdir -p /var/lib/docker-plugins/rclone/cache -fi -sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/rclone/docker-rclone.conf" /var/lib/docker-plugins/rclone/config/rclone.conf -if ! sudo su -c 'docker plugin ls' - "$USER" | grep 'rclone:latest' > /dev/null; then - sudo su -c 'docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions' - "$USER" +# First, ensure Docker Rclone configuration exists (which only happens when the Chezmoi Age decryption key is present as well as keys for Rclone) +if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/rclone/docker-rclone.conf" ]; then + ### Ensure Docker Rclone plugin system folders exist + logg info 'Ensure Docker Rclone plugin system folders exist' + if [ ! -d /var/lib/docker-plugins/rclone/config ]; then + logg info 'Creating directory /var/lib/docker-plugins/rclone/config' + sudo mkdir -p /var/lib/docker-plugins/rclone/config + fi + if [ ! -d /var/lib/docker-plugins/rclone/cache ]; then + logg info 'Creating directory /var/lib/docker-plugins/rclone/cache' + sudo mkdir -p /var/lib/docker-plugins/rclone/cache + fi + + ### Copy Rclone configuration + logg info "Copy the Rclone configuration from ${XDG_CONFIG_HOME:-$HOME/.config}/rclone/docker-rclone.conf to /var/lib/docker-plugins/rclone/config/rclone.conf" + sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/rclone/docker-rclone.conf" /var/lib/docker-plugins/rclone/config/rclone.conf + + ### Install the Rclone Docker plugin (if not already installed) + if ! sudo su -c 'docker plugin ls' - "$USER" | grep 'rclone:latest' > /dev/null; then + sudo su -c 'docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions' - "$USER" + fi fi {{ end -}} diff --git a/home/dot_config/rclone/merge_private_rclone.conf b/home/dot_config/rclone/merge_private_rclone.conf.tmpl similarity index 99% rename from home/dot_config/rclone/merge_private_rclone.conf rename to home/dot_config/rclone/merge_private_rclone.conf.tmpl index 68eeb860..26798ef7 100644 --- a/home/dot_config/rclone/merge_private_rclone.conf +++ b/home/dot_config/rclone/merge_private_rclone.conf.tmpl @@ -25,4 +25,4 @@ endpoint = {{ .user.cloudflare.r2 }}.r2.cloudflarestorage.com/user acl = private # MEGABYTE LABS MANAGED S3 EOT -{{- end }} +{{- end -}} diff --git a/home/dot_tool-versions.tmpl b/home/dot_tool-versions.tmpl index ebc18b2e..ba9ea02c 100644 --- a/home/dot_tool-versions.tmpl +++ b/home/dot_tool-versions.tmpl @@ -1,9 +1,9 @@ golang system -java openjdk-17 +# java openjdk-17 deno system nodejs system -php 8.1.12 +# php 8.1.12 poetry system python system -ruby 3.1.1 +ruby system rust system diff --git a/software.yml b/software.yml index b2a2eff7..6cead537 100644 --- a/software.yml +++ b/software.yml @@ -5761,7 +5761,7 @@ softwarePackages: pacman: php port: php scoop: php - _service: false_ + _service: false _type: cli php-extensions: _name: PHP Extensions @@ -5788,13 +5788,15 @@ softwarePackages: - php-xml brew: - postgresql - dnf:centos: + dnf: + - pcre-devel - postgresql-devel - php-apcu - php-cgi - php-cli - php-common - php-curl + - php-devel - php-fpm - php-gd - php-intl @@ -5805,26 +5807,6 @@ softwarePackages: - php-snmp - php-sqlite3 - php-xml - dnf:fedora: - - libpcre3-dev - - postgresql-devel - - php-apcu - - php-cgi - - php-cli - - php-common - - php-curl - - php-dev - - php-fpm - - php-gd - - php-intl - - php-imap - - php-json - - php-mbstring - - php-opcache - - php-redis - - php-snmp - - php-sqlite3 - - php-xml pacman: - libpcre3-dev - postgresql-libs @@ -5846,7 +5828,24 @@ softwarePackages: - php-sqlite3 - php-xml zypper: + - pcre-devel - postgresql-devel + - php-apcu + - php-cgi + - php-cli + - php-common + - php-curl + - php-devel + - php-fpm + - php-gd + - php-intl + - php-json + - php-mbstring + - php-opcache + - php-redis + - php-snmp + - php-sqlite3 + - php-xml pihole: _bin: null _desc: '[Pi-hole](https://pi-hole.net/) is a Linux network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole and optionally a DHCP server, intended for use on a private network. It is designed for low-power embedded devices with network capability, such as the Raspberry Pi, but supports any Linux machines.'