Skip to content

Commit c77d4ed

Browse files
committed
Switch to passing in quota in GB, because passing in MB is just a very large number
1 parent e683691 commit c77d4ed

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

samba-timemachine/README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,17 @@ A custom username can be passed to the container with the environment variable `
5050

5151
A custom password can be passed to the container with the environment variable `PASS`.
5252

53-
# Quotas
53+
# Quota
5454

55-
The container supports setting of quota to limit the max size of backups, it defaults to 512GB.
55+
*BREAKING CHANGE in v2.7* Changing quota to be configured in Gigabytes
56+
57+
The container supports setting of quota to limit the max size of backups, it defaults to 1024GB (1TB).
5658
I'm unclear if this works correctly in modern versions of macOS.
5759

5860
The SAMBA setting of `disk max size` is also configured to limit the reported size of the disk to the same as the configured quota.
5961
This is a soft limit not a hard limit.
6062

63+
6164
# Building the Docker image
6265

6366
To build the image you need to have docker and docker buildx available, this is included by default in docker desktop

samba-timemachine/entrypoint

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ export PASS="${PASS:-password}"
66
export PUID="${PUID:-999}"
77
export PGID="${PGID:-999}"
88
export LOG_LEVEL="${LOG_LEVEL:-2}"
9-
export QUOTA="${QUOTA:-512000}"
9+
export QUOTA="${QUOTA:-1024}"
1010

1111
calculateQuota()
1212
{
13-
echo "Quota is ${QUOTA}MB"
14-
export QUOTA_IN_MEGABYTES="${QUOTA}"
13+
echo "Quota is ${QUOTA} GB"
14+
export QUOTA_IN_GIGABYTES="${QUOTA}"
15+
export QUOTA_IN_MEGABYTES="$((QUOTA_IN_GIGABYTES * 1024))"
1516
export QUOTA_IN_BYTES=$((QUOTA_IN_MEGABYTES * 1024 * 1024))
1617
}
1718

samba-timemachine/spec/samba-timemachine/samba-timemachine_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def compose
1212
ENV['PGID'] = '1234'
1313
ENV['USER'] = 'testuser'
1414
ENV['PASS'] = 'Password123'
15-
ENV['QUOTA'] = '123456'
15+
ENV['QUOTA'] = '1234'
1616
ENV['LOG_LEVEL'] = '4'
1717
compose.up('samba-timemachine', detached: true)
1818
end
@@ -35,8 +35,8 @@ def compose
3535
it { should be_file }
3636
it { should be_mode 644 }
3737
it { should be_owned_by 'root' }
38-
its(:content) { is_expected.to match('max disk size = 123456') }
39-
its(:content) { is_expected.to match('fruit:time machine max size = 123456 MB') }
38+
its(:content) { is_expected.to match('max disk size = 1263616') }
39+
its(:content) { is_expected.to match('fruit:time machine max size = 1263616 MB') }
4040
its(:content) { is_expected.to match('log level = 4') }
4141
end
4242

@@ -60,7 +60,7 @@ def compose
6060
it { should be_mode 444 }
6161
it { should be_owned_by 'root' }
6262
it { should be_grouped_into 'root' }
63-
its(:content) { is_expected.to match('129452998656') }
63+
its(:content) { is_expected.to match('1324997410816') }
6464
end
6565

6666
describe group('timemachine') do

0 commit comments

Comments
 (0)