From 21cd42cefa2ba724e69b98f2347056df74ca4e21 Mon Sep 17 00:00:00 2001 From: bsourisse Date: Tue, 28 Feb 2023 12:35:14 +0100 Subject: [PATCH 1/3] fix: improve ubuntu server compatibility #25 --- helpers/shells/getStorageUsed.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/shells/getStorageUsed.sh b/helpers/shells/getStorageUsed.sh index 94634b4..4d58746 100755 --- a/helpers/shells/getStorageUsed.sh +++ b/helpers/shells/getStorageUsed.sh @@ -16,4 +16,4 @@ set -e # Use jc to output a JSON format with du command cd /var/borgwarehouse -sudo jc du -s * +sudo /usr/bin/du -s * | jc --du \ No newline at end of file From 2013c2af3cf2c2a3529966b9ba1f70aa6bf554dd Mon Sep 17 00:00:00 2001 From: bsourisse Date: Thu, 2 Mar 2023 17:24:25 +0100 Subject: [PATCH 2/3] docs: follow the modifications of the sudoers file --- docs/sudoers/10-borgwarehouse | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/sudoers/10-borgwarehouse diff --git a/docs/sudoers/10-borgwarehouse b/docs/sudoers/10-borgwarehouse new file mode 100644 index 0000000..6392618 --- /dev/null +++ b/docs/sudoers/10-borgwarehouse @@ -0,0 +1,9 @@ +borgwarehouse ALL=(ALL) NOPASSWD: /usr/sbin/userdel -rf [[\:xdigit\:]]* +borgwarehouse ALL=(ALL) NOPASSWD: /usr/sbin/useradd -d /var/borgwarehouse/[[\:xdigit\:]]* -s /bin/bash -m --badname [[\:xdigit\:]]* +borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/mkdir -p /var/borgwarehouse/[[\:xdigit\:]]*/repos/repo[[\:digit\:]]*, /usr/bin/mkdir -p /var/borgwarehouse/[[\:xdigit\:]]*/.ssh +borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/touch /var/borgwarehouse/[[\:xdigit\:]]*/.ssh/authorized_keys +borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/chmod -R 750 /var/borgwarehouse/[[\:xdigit\:]]*, /usr/bin/chmod 600 /var/borgwarehouse/[[\:xdigit\:]]*/.ssh/authorized_keys +borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/chown -R [[\:xdigit\:]]*\:borgwarehouse /var/borgwarehouse/[[\:xdigit\:]]* +borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/tee /var/borgwarehouse/[[\:xdigit\:]]*/.ssh/authorized_keys +borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/sed -ri s|*|g /var/borgwarehouse/[[\:xdigit\:]]*/.ssh/authorized_keys +borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/jc du -s [[\:xdigit\:]]* From aa4e8bc933a85766670b1edb28078a46ad02895a Mon Sep 17 00:00:00 2001 From: bsourisse Date: Thu, 2 Mar 2023 17:29:06 +0100 Subject: [PATCH 3/3] fix: improve compatibility with UbuntuServer 22.04 --- docs/sudoers/10-borgwarehouse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sudoers/10-borgwarehouse b/docs/sudoers/10-borgwarehouse index 6392618..d50799b 100644 --- a/docs/sudoers/10-borgwarehouse +++ b/docs/sudoers/10-borgwarehouse @@ -6,4 +6,4 @@ borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/chmod -R 750 /var/borgwarehouse/[[\:x borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/chown -R [[\:xdigit\:]]*\:borgwarehouse /var/borgwarehouse/[[\:xdigit\:]]* borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/tee /var/borgwarehouse/[[\:xdigit\:]]*/.ssh/authorized_keys borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/sed -ri s|*|g /var/borgwarehouse/[[\:xdigit\:]]*/.ssh/authorized_keys -borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/jc du -s [[\:xdigit\:]]* +borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/du -s [[\:xdigit\:]]*