Skip to content

Commit

Permalink
fixup! Store secret with NethServer::Password
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidePrincipi committed Nov 28, 2023
1 parent fd65ba5 commit 4f5355c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion root/etc/e-smith/db/configuration/migrate/wg_quick_secretkey
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
use NethServer::Password;
my $secretKey = $DB->get_prop_and_delete('wg-quick@ns8', 'SecretKey');
if ($secretKey) {
NethServer::Password->new('ns8wg', secret=>$secretKey)->save();
my $tmpmask = umask 0077;
open(FH, ">", '/var/lib/nethserver/secrets/ns8wg');
print FH $secretKey . "\n";
close(FH);
umask $tmpmask;
}
'';
}

0 comments on commit 4f5355c

Please sign in to comment.