From e1548ff61ee5fff174e1a4b1dfc6f037b019fcac Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 4 Apr 2025 17:17:11 +0200 Subject: [PATCH] bundles/samba: cannot have time machine and 'guest ok' shares on the same machine --- bundles/samba/items.py | 3 +++ nodes/home/nas.py | 18 ------------------ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/bundles/samba/items.py b/bundles/samba/items.py index 5c60c69..2f5090e 100644 --- a/bundles/samba/items.py +++ b/bundles/samba/items.py @@ -66,6 +66,9 @@ for user, uconfig in node.metadata.get('users', {}).items(): if timemachine_shares: assert node.has_bundle('avahi-daemon'), f'{node.name}: samba needs avahi-daemon to publish time machine shares' + for share, share_config in node.metadata.get('samba/shares', {}).items(): + assert not share_config.get('guest_ok', True), f'{node.name} samba {share}: cannot have time machine shares and "guest ok" shares on the same machine' + files['/etc/avahi/services/timemachine.service'] = { 'content_type': 'mako', 'context': { diff --git a/nodes/home/nas.py b/nodes/home/nas.py index fbc7bbd..93fb47f 100644 --- a/nodes/home/nas.py +++ b/nodes/home/nas.py @@ -180,24 +180,6 @@ nodes['home.nas'] = { }, }, 'samba': { - 'shares': { - 'C3VOC': { - 'path': '/storage/nas/C3VOC', - 'force_group': 'nas', - }, - 'TV': { - 'path': '/storage/nas/TV', - 'force_group': 'nas', - }, - 'music': { - 'path': '/storage/nas/Musik', - 'force_group': 'nas', - }, - 'music_videos': { - 'path': '/storage/nas/Musikvideos', - 'force_group': 'nas', - }, - }, 'restrict-to': { '172.19.138.0/24', },