Skip to content
This repository was archived by the owner on May 27, 2026. It is now read-only.
/ cm Public archive

Commit bc62564

Browse files
committed
bw/bundles/vsftpd: clean up a bit after fossgis
1 parent b5e2e4b commit bc62564

3 files changed

Lines changed: 52 additions & 18 deletions

File tree

bundlewrap/bundles/vsftpd/items.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
files['/etc/vsftpd.conf'] = {
32
'triggers': {
43
'svc_systemd:vsftpd:restart',
@@ -14,7 +13,7 @@
1413
files['/etc/vsftpd/ftpd.passwd'] = {
1514
'content_type': 'mako',
1615
'context': {
17-
'users':node.metadata.get('vsftpd/users'),
16+
'users': node.metadata.get('vsftpd/users'),
1817
},
1918
'triggers': {
2019
'svc_systemd:vsftpd:restart',
@@ -28,17 +27,17 @@
2827
}
2928

3029
for user in node.metadata.get('vsftpd/users'):
31-
localroot = node.metadata.get(f'vsftpd/users/{user}/localroot')
32-
password = node.metadata.get(f'vsftpd/users/{user}/password')
33-
needs = {}
34-
if not node.has_bundle('zfs'):
35-
needs = {'zfs_dataset:'}
30+
localroot = node.metadata.get(('vsftpd', 'users', user, 'localroot'))
31+
password = node.metadata.get(('vsftpd', 'users', user, 'password'))
3632

3733
directories[localroot] = {
3834
'owner': 'voc',
3935
'group': 'voc',
40-
'needs': needs,
36+
'needs': {
37+
f'zfs_dataset:video/vsftpd/{user}',
38+
},
4139
}
40+
4241
files[f'/etc/vsftpd_user_conf/{user}'] = {
4342
'content': f"local_root={localroot}/",
4443
'triggers': {

bundlewrap/bundles/vsftpd/metadata.py

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,28 @@
77
},
88
},
99
'vsftpd': {
10-
'users': {
10+
'users': {},
11+
},
12+
'zfs': {
13+
'datasets': {
14+
'video/vsftpd': {
15+
'mountpoint': '/srv/vsftpd',
16+
},
1117
},
12-
'restrict-to': {
13-
"voc-internal",
14-
"voc-vpn",
15-
}
1618
},
1719
}
1820

1921

2022
@metadata_reactor.provides(
2123
'vsftpd/users',
2224
)
23-
def autogenerate_sony_camera_config(metadata):
25+
def autogenerate_some_user_config(metadata):
2426
users = {}
25-
for cam in [1,2,3,4,5,6]:
26-
users[f'saal{cam}-sony'] = {
27-
'password': repo.vault.human_password_for(f'{node.name} sony {cam}', words=1),
28-
'localroot': f'/video/tmp/fossgis2026/sony/saal{cam}',
27+
datasets = {}
28+
for user in metadata.get('vsftpd/users', {}):
29+
users[user] = {
30+
'password': repo.vault.human_password_for(f'{node.name} vsftpd user {user}', words=1),
31+
'localroot': f'/srv/vsftpd/{user}',
2932
}
3033

3134
return {
@@ -35,6 +38,24 @@ def autogenerate_sony_camera_config(metadata):
3538
}
3639

3740

41+
@metadata_reactor.provides(
42+
'zfs/datasets',
43+
)
44+
def zfs(metadata):
45+
users = {}
46+
datasets = {}
47+
for user in metadata.get('vsftpd/users', {}):
48+
datasets[f'video/vsftpd/{user}'] = {
49+
'mountpoint': metdata.get(('vsftpd', 'users', user, 'localroot')),
50+
}
51+
52+
return {
53+
'zfs': {
54+
'datasets': datasets
55+
}
56+
}
57+
58+
3859
@metadata_reactor.provides(
3960
'firewall/port_rules',
4061
)

bundlewrap/nodes/storage.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ webroot = "/video/encoded"
7272
[metadata.systemd-networkd.bonds.bond0]
7373
match = ["ens3f0", "ens3f1"]
7474

75+
# TODO migrate from fossgis2026-set passwords to autogenerated ones
76+
[metadata.vsftpd.users.saal1-sony]
77+
password = "!decrypt:encrypt$gAAAAABpyqDZC5GyxrfjvosR8jCYX3pAn7ZsaQ2q7ba4IdAFI2snySb7ZkZ4HDSjtIlNHp1e5mdMTZmxz_MVFCFc9RXsnGO4eA=="
78+
[metadata.vsftpd.users.saal2-sony]
79+
password = "!decrypt:encrypt$gAAAAABpyqDeqM09gof4YUe83n74-bWqUWIZUi9KyL3goMXgpGvnt_fE-0mAWXoO0ufxrNl8sJEDmb_MK275Bga_SFV_RqtVpQ=="
80+
[metadata.vsftpd.users.saal3-sony]
81+
password = "!decrypt:encrypt$gAAAAABpyqDlh-GCAx8DuhPwMD8XRlQ09zxjgzv1TSzUI60Idq92_Ov5FEAFjojsLxq-9Yl25HF7T1A49nI3DvzsYimnUbyovg=="
82+
[metadata.vsftpd.users.saal4-sony]
83+
password = "!decrypt:encrypt$gAAAAABpyqDq9FL6srCazA5HIGWyMQ4ZFegjWeIY6FPGifIlbhvkCPnEk0O5hUWM21VC_XMGdVmNfUwAFY18zruBOYO5RIi7TA=="
84+
[metadata.vsftpd.users.saal5-sony]
85+
password = "!decrypt:encrypt$gAAAAABpyqDzS71g421zD6qXibvl6dmNikDq8WYnZPqnrQ5REh8sTaP8A0vPTHb1pgZdCZXBr5vKr6iQ2VErSebwZapYOmkx_Q=="
86+
[metadata.vsftpd.users.saal6-sony]
87+
password = "!decrypt:encrypt$gAAAAABpyqD4yJF8hWHpymElaxaupzkComOmjhOBs2AmP9BAWolGWhtN01JvWtL-VXX7_9OljEijmIWaGNzJcal2V6cb7VSFCQ=="
88+
7589
[metadata.zfs.module_options]
7690
zfs_arc_max_gb = 100
7791

0 commit comments

Comments
 (0)