2022-07-15 05:38:33 +02:00
@using BTCPayServer.Abstractions.Models
2021-04-17 13:29:50 +09:00
@model BTCPayServer.Models.ServerViewModels.SSHServiceViewModel
2018-08-12 21:38:45 +09:00
@{
2021-12-16 11:17:02 +01:00
ViewData.SetActivePage(ServerNavPages.Services, "SSH settings");
2018-08-12 21:38:45 +09:00
}
2022-01-17 17:19:27 -08:00
<h3 class="mb-4">@ViewData["Title"]</h3>
2018-08-12 21:38:45 +09:00
<div class="row">
<div class="col-md-8">
<div class="form-group">
<p>
2019-01-09 17:35:32 +01:00
<span>SSH services are used by the maintenance operations<br /></span>
2018-08-12 21:38:45 +09:00
</p>
</div>
2021-04-08 15:32:42 +02:00
@if (!ViewContext.ModelState.IsValid)
{
2023-12-21 15:43:12 +01:00
<div asp-validation-summary="All"></div>
2021-04-08 15:32:42 +02:00
}
2018-08-12 21:38:45 +09:00
<div class="form-group">
<div class="form-group">
2021-06-06 13:44:54 +02:00
<label asp-for="CommandLine" class="form-label"></label>
<input asp-for="CommandLine" class="form-control" readonly />
2018-08-12 21:38:45 +09:00
</div>
2019-09-19 19:17:20 +09:00
@if (!string.IsNullOrEmpty(Model.Password))
2018-08-12 21:38:45 +09:00
{
<div class="form-group">
2021-06-06 13:44:54 +02:00
<label asp-for="Password" class="form-label"></label>
<input asp-for="Password" class="form-control" readonly />
2018-08-12 21:38:45 +09:00
</div>
}
2019-09-19 19:17:20 +09:00
@if (!string.IsNullOrEmpty(Model.KeyFilePassword))
2018-08-12 21:38:45 +09:00
{
<div class="form-group">
2021-06-06 13:44:54 +02:00
<label asp-for="KeyFilePassword" class="form-label"></label>
<input asp-for="KeyFilePassword" class="form-control" readonly />
2018-08-12 21:38:45 +09:00
</div>
}
</div>
</div>
</div>
2019-09-19 19:17:20 +09:00
2019-09-20 18:51:14 +09:00
@if (Model.SSHKeyFileContent != null)
2019-09-19 19:17:20 +09:00
{
<h4>Authorized keys</h4>
<div class="row">
<div class="col-md-8">
<div class="form-group">
<p>
<span>You can enter here SSH public keys authorized to connect to your server.<br /></span>
</p>
</div>
<form method="post">
<div class="form-group">
<textarea asp-for="SSHKeyFileContent" rows="20" cols="80" class="form-control"></textarea>
<span asp-validation-for="SSHKeyFileContent" class="text-danger"></span>
</div>
2021-04-17 13:29:50 +09:00
<button name="command" id="submit" type="submit" class="btn btn-primary" value="Save">Save</button>
2019-09-19 19:17:20 +09:00
</form>
</div>
</div>
}
2021-04-17 13:29:50 +09:00
<h4 class="mt-5 mb-3">Other actions</h4>
<div class="row">
<div class="col-md-8">
<div class="form-group">
<p>
2021-09-07 04:55:53 +02:00
<span>Increase the security of your instance by disabling the ability to change the SSH settings in this BTCPay Server instance's user interface.<br /></span>
2021-04-17 13:29:50 +09:00
</p>
</div>
<div>
<form method="post">
2021-09-07 04:55:53 +02:00
<button name="command" id="disable" type="submit" class="btn btn-outline-danger mb-5" value="disable" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-confirm-input="DISABLE">Disable</button>
2021-04-17 13:29:50 +09:00
</form>
</div>
</div>
</div>
2021-09-07 04:55:53 +02:00
<partial name="_Confirm" model="@(new ConfirmModel("Disable modification of SSH settings", "This action is permanent and will remove the ability to change the SSH settings via the BTCPay Server user interface.", "Disable"))"/>
@section PageFootContent {
<script>
const disableButton = document.getElementById('disable')
disableButton.dataset.action = window.location.href + '/disable'
disableButton.addEventListener('click', event => {
event.preventDefault()
})
</script>
}