Don't let new peers be deleted

master
Keith Irwin 2022-10-21 12:42:34 -06:00
parent c0aef84f0a
commit 036b6cdeca
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
3 changed files with 7 additions and 7 deletions

View File

@ -87,7 +87,7 @@ if ! sudo /usr/bin/openssl x509 -req -sha256 -extensions SAN -CAcreateserial \
fi; if ! sudo [ -f "${SSL_CONFIG_DIR:?}/${username:?}/${hostname:?}/server.crt" ]; then
printf 'ERROR! SSL key %s/%s/server.crt was not generated!\n' "${username}" "${hostname}" >>"${LOGFILE}"
exit 7
fi; if ! sudo chmod 640 "${SSL_CONFIG_DIR}/${username}/${hostname}/server.*"; then
fi; if ! sudo chmod 640 "${SSL_CONFIG_DIR}/${username}/${hostname}/server.crt" "${SSL_CONFIG_DIR}/${username}/${hostname}/server.key"; then
printf 'ERROR! Failed to chmod SSL cert %s/%s/server.*\n' "${username}" "${hostname}" >>"${LOGFILE}"
exit 8
fi & if ! sudo chgrp -R www-data "${SSL_CONFIG_DIR}/${username}/"; then

View File

@ -13,7 +13,7 @@
<tbody data-bind="foreach:peers"><tr>
<td data-bind="text:domain"></td>
<td data-bind="text:ipv4"></td>
<td><button style="float:right" data-bind="click:$parent.delPeer,disable:$data.isDeleting,text:deleteText">Delete</button></td>
<td><button style="float:right" data-bind="click:$parent.delPeer,disable:$data.isDeleting,disable:$data.cantDelete,text:deleteText">Delete</button></td>
</tr></tbody>
</table>

View File

@ -6,7 +6,7 @@ function Peer(data) {
this.pubkey = data.pubkey
this.ipv4 = data.ipv4
this.ipv6 = data.ipv6
this.canDelete = data.canDelete || true
this.cantDelete = data.cantDelete
this.isDeleting = ko.observable(false)
this.deleteText = ko.computed(() => this.isDeleting()?'Deleting...':'Delete')
}
@ -94,7 +94,7 @@ function PeerList() {
self.newPeerHostname('')
self.peers.push(new Peer({
domain:`${validHostname}.${self.newPeerUser().name}.${TLD}`,
canDelete: false,
cantDelete: true,
}))
self.newConfigText(parsedRes)
}