2021-01-19 17:55:21 +01:00
<main class="container-xl">
2019-02-05 22:17:02 +01:00
<div id="config-block" class="align-items-center p-3 mb-3 bg-secondary rounded shadow">
2019-02-02 16:47:27 +01:00
<div>
2019-02-05 22:17:02 +01:00
<h6 class="text-white mb-3">Configuration</h6>
2019-03-07 20:22:02 +01:00
<div class="small text-white mb-3">
2021-06-19 19:22:19 +02:00
<span class="font-weight-bolder">NOTE:</span> The settings here override the environment variables. Once saved, it's recommended to stop setting them to avoid confusion.<br>
This does not apply to the read-only section, which can only be set via environment variables.<br>
2022-06-08 19:46:33 +02:00
Settings which are overridden are shown with <span class="is-overridden-true alert-row px-1">a yellow colored background</span>.
2019-03-07 20:22:02 +01:00
</div>
2020-02-26 11:02:22 +01:00
2022-12-28 20:05:10 +01:00
<form class="form needs-validation" id="config-form" novalidate>
{{ # each page_data .config }}
2019-02-05 22:17:02 +01:00
{{ # if groupdoc }}
<div class="card bg-light mb-3">
2021-09-18 19:49:44 +02:00
<button id="b_ {{ group }} " type="button" class="card-header text-start btn btn-link text-decoration-none" aria-expanded="false" aria-controls="g_ {{ group }} " data-bs-toggle="collapse" data-bs-target="#g_ {{ group }} "> {{ groupdoc }} </button>
2021-06-19 19:22:19 +02:00
<div id="g_ {{ group }} " class="card-body collapse">
2019-02-05 22:17:02 +01:00
{{ # each elements }}
{{ # if editable }}
2022-06-08 19:46:33 +02:00
<div class="row my-2 align-items-center is-overridden- {{ overridden }} alert-row" title="[ {{ name }} ] {{ doc .description }} ">
2019-02-08 20:49:04 +01:00
{{ # case type "text" "number" "password" }}
2019-02-05 22:17:02 +01:00
<label for="input_ {{ name }} " class="col-sm-3 col-form-label"> {{ doc .name }} </label>
2021-06-19 19:22:19 +02:00
<div class="col-sm-8">
<div class="input-group">
2019-02-08 20:49:04 +01:00
<input class="form-control conf- {{ type }} " id="input_ {{ name }} " type=" {{ type }} "
2021-06-19 19:22:19 +02:00
name=" {{ name }} " value=" {{ value }} " {{ # if default }} placeholder="Default: {{ default }} " {{ / if }} >
2019-02-08 20:49:04 +01:00
{{ # case type "password" }}
2022-12-28 20:05:10 +01:00
<button class="btn btn-outline-secondary input-group-text" type="button" data-vw-pw-toggle="input_ {{ name }} ">Show/hide</button>
2019-02-08 20:49:04 +01:00
{{ / case }}
2021-06-19 19:22:19 +02:00
</div>
2019-02-05 22:17:02 +01:00
</div>
{{ / case }}
{{ # case type "checkbox" }}
2020-11-18 12:00:25 +01:00
<div class="col-sm-3 col-form-label"> {{ doc .name }} </div>
2019-02-05 22:17:02 +01:00
<div class="col-sm-8">
<div class="form-check">
2019-02-06 00:38:57 +01:00
<input class="form-check-input conf- {{ type }} " type="checkbox" id="input_ {{ name }} "
name=" {{ name }} " {{ # if value }} checked {{ / if }} >
2019-02-03 00:22:18 +01:00
2019-02-05 22:17:02 +01:00
<label class="form-check-label" for="input_ {{ name }} "> Default: {{ default }} </label>
</div>
</div>
{{ / case }}
2019-02-03 00:22:18 +01:00
</div>
2019-02-05 22:17:02 +01:00
{{ / if }}
{{ / each }}
2020-03-04 13:25:38 +01:00
{{ # case group "smtp" }}
2021-06-19 19:22:19 +02:00
<div class="row my-2 align-items-center pt-3 border-top" title="Send a test email to given email address">
2020-03-04 13:25:38 +01:00
<label for="smtp-test-email" class="col-sm-3 col-form-label">Test SMTP</label>
<div class="col-sm-8 input-group">
2021-06-19 19:22:19 +02:00
<input class="form-control" id="smtp-test-email" type="email" placeholder="Enter test email" required>
2022-12-28 20:05:10 +01:00
<button type="button" class="btn btn-outline-primary input-group-text" id="smtpTest">Send test email</button>
2021-06-19 19:22:19 +02:00
<div class="invalid-tooltip">Please provide a valid email address</div>
2020-03-04 13:25:38 +01:00
</div>
</div>
{{ / case }}
2019-02-03 00:22:18 +01:00
</div>
</div>
{{ / if }}
{{ / each }}
2019-02-18 19:25:33 +01:00
<div class="card bg-light mb-3">
2021-09-18 19:49:44 +02:00
<button id="b_readonly" type="button" class="card-header text-start btn btn-link text-decoration-none" aria-expanded="false" aria-controls="g_readonly"
data-bs-toggle="collapse" data-bs-target="#g_readonly">Read-Only Config</button>
2021-06-19 19:22:19 +02:00
<div id="g_readonly" class="card-body collapse">
2019-03-07 20:22:02 +01:00
<div class="small mb-3">
2019-02-18 19:25:33 +01:00
NOTE: These options can't be modified in the editor because they would require the server
to be restarted. To modify them, you need to set the correct environment variables when
launching the server. You can check the variable names in the tooltips of each option.
2019-03-07 20:22:02 +01:00
</div>
2019-02-18 19:25:33 +01:00
2022-12-28 20:05:10 +01:00
{{ # each page_data .config }}
2019-02-18 19:25:33 +01:00
{{ # each elements }}
{{ # unless editable }}
2022-06-08 19:46:33 +02:00
<div class="row my-2 align-items-center alert-row" title="[ {{ name }} ] {{ doc .description }} ">
2019-02-18 19:25:33 +01:00
{{ # case type "text" "number" "password" }}
<label for="input_ {{ name }} " class="col-sm-3 col-form-label"> {{ doc .name }} </label>
2021-06-19 19:22:19 +02:00
<div class="col-sm-8">
<div class="input-group">
2022-06-08 19:46:33 +02:00
{{ ! - -
Also set the database_url input as password here.
If we would set it to password in config.rs it will not be character masked for the support string.
And sometimes this is more useful for providing support than just 3 asterisk.
--}}
{{ # if ( eq name "database_url" ) }}
<input readonly class="form-control" id="input_ {{ name }} " type="password" value=" {{ value }} " {{ # if default }} placeholder="Default: {{ default }} " {{ / if }} >
2022-12-28 20:05:10 +01:00
<button class="btn btn-outline-secondary" type="button" data-vw-pw-toggle="input_ {{ name }} ">Show/hide</button>
2022-06-08 19:46:33 +02:00
{{ else }}
<input readonly class="form-control" id="input_ {{ name }} " type=" {{ type }} " value=" {{ value }} " {{ # if default }} placeholder="Default: {{ default }} " {{ / if }} >
{{ # case type "password" }}
2022-12-28 20:05:10 +01:00
<button class="btn btn-outline-secondary" type="button" data-vw-pw-toggle="input_ {{ name }} ">Show/hide</button>
2022-06-08 19:46:33 +02:00
{{ / case }}
{{ / if }}
2021-06-19 19:22:19 +02:00
</div>
2019-02-18 19:25:33 +01:00
</div>
{{ / case }}
{{ # case type "checkbox" }}
2020-11-18 12:00:25 +01:00
<div class="col-sm-3 col-form-label"> {{ doc .name }} </div>
2019-02-18 19:25:33 +01:00
<div class="col-sm-8">
2020-11-18 12:00:25 +01:00
<div class="form-check align-middle">
2019-02-18 19:25:33 +01:00
<input disabled class="form-check-input" type="checkbox" id="input_ {{ name }} "
{{ # if value }} checked {{ / if }} >
<label class="form-check-label" for="input_ {{ name }} "> Default: {{ default }} </label>
</div>
</div>
{{ / case }}
</div>
{{ / unless }}
{{ / each }}
{{ / each }}
2019-05-03 15:46:29 +02:00
</div>
</div>
2019-06-02 00:08:52 +02:00
2022-12-28 20:05:10 +01:00
{{ # if page_data .can_backup }}
2019-05-03 15:46:29 +02:00
<div class="card bg-light mb-3">
2021-09-18 19:49:44 +02:00
<button id="b_database" type="button" class="card-header text-start btn btn-link text-decoration-none" aria-expanded="false" aria-controls="g_database"
data-bs-toggle="collapse" data-bs-target="#g_database">Backup Database</button>
2021-06-19 19:22:19 +02:00
<div id="g_database" class="card-body collapse">
2019-05-03 15:46:29 +02:00
<div class="small mb-3">
2021-04-10 07:30:39 +02:00
WARNING: This function only creates a backup copy of the SQLite database.
This does not include any configuration or file attachment data that may
2021-04-27 23:18:32 +02:00
also be needed to fully restore a vaultwarden instance. For details on
2021-04-10 07:30:39 +02:00
how to perform complete backups, refer to the wiki page on
2022-08-17 08:00:46 +02:00
<a href="https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault" target="_blank" rel="noopener noreferrer">backups</a>.
2019-05-03 15:46:29 +02:00
</div>
2022-12-28 20:05:10 +01:00
<button type="button" class="btn btn-primary" id="backupDatabase">Backup Database</button>
2019-02-18 19:25:33 +01:00
</div>
</div>
2019-06-02 00:08:52 +02:00
{{ / if }}
2019-02-18 19:25:33 +01:00
2019-02-02 16:47:27 +01:00
<button type="submit" class="btn btn-primary">Save</button>
2022-12-28 20:05:10 +01:00
<button type="button" class="btn btn-danger float-end" id="deleteConf">Reset defaults</button>
2019-02-02 16:47:27 +01:00
</form>
</div>
</div>
2019-01-19 22:12:52 +01:00
</main>
2019-02-03 00:22:18 +01:00
<style>
#config-block ::placeholder {
/* Most modern browsers support this now. */
color: orangered;
}
2021-06-19 19:22:19 +02:00
.is-overridden-true {
2022-06-08 19:46:33 +02:00
--bs-alert-color: #664d03;
--bs-alert-bg: #fff3cd;
--bs-alert-border-color: #ffecb5;
2021-06-19 19:22:19 +02:00
}
2019-02-03 00:22:18 +01:00
</style>
2022-12-28 20:05:10 +01:00
<script src=" {{ urlpath }} /vw_static/admin_settings.js"></script>