more samba fixing

This commit is contained in:
Daniel 2019-10-24 22:04:01 +02:00
parent f655a1113c
commit 05c7414b4a
4 changed files with 13 additions and 4 deletions

View file

@ -29,6 +29,10 @@ def create_share(name, path, user, dir_mask, create_mask, writeable, btrfs, recy
"""
share = SambaShare(name, path, btrfs=btrfs, recycle=recycling)
user = SambaOption("valid users", user)
if dir_mask is None:
dir_mask = "0700"
if create_mask is None:
create_mask = "0600"
dir_mask = SambaOption("directory mask", dir_mask)
create_mask = SambaOption("create mask", create_mask)
if writeable:

View file

@ -33,3 +33,8 @@ class SambaOption(db.Model):
option = db.Column(db.String, nullable=False)
value = db.Column(db.String, nullable=False)
def __init__(self, option, value):
self.option = option
self.value = value

View file

@ -25,7 +25,7 @@
<thead>
<tr>
<th>Name</th>
<th>Schreibzugriff</th>
<th>Pfad</th>
<th>Papierkorb</th>
<th>BtrFS Optimierungen</th>
</tr>
@ -35,8 +35,8 @@
{% for share in shares %}
<tr>
<td>{{ share.name }}</td>
<td>{{ share.writeable }}</td>
<td>{{ share.recycling }}</td>
<td>{{ share.path }}</td>
<td>{{ share.recycle}}</td>
<td>{{ share.btrfs }}</td>
</tr>

View file

@ -37,7 +37,7 @@ def drives():
abort(500, description="Expected int, but got {}.".format(delete))
except LookupError:
abort(500, description="Invalid drive id {}".format(delete))
return redirect(url_for('drives'))
return render_template('drives.html', drives=Drive.query.all())