Move email SMTP config to settings page with encrypted password storage; add cryptography dependency

This commit is contained in:
Troll (Hermes Agent) 2026-08-01 23:20:23 +00:00
parent 5277c20d24
commit 8e5c2f5867
5 changed files with 160 additions and 57 deletions

View file

@ -83,7 +83,7 @@
font-size:.9rem;
color:var(--muted);
}
input[type="text"],input[type="number"],textarea,select{
input[type="text"],input[type="number"],input[type="password"],textarea,select{
width:100%;
padding:.6rem;
border-radius:.4rem;
@ -106,7 +106,7 @@
}
button:hover{background:var(--accent);}
/* Metadata table */
/* Metadata and email config tables */
.meta-table{
width:100%;
border-collapse:collapse;
@ -125,7 +125,7 @@
}
.meta-table td:last-child{padding-right:0;}
.meta-table tr:last-child td{border-bottom:none;}
.meta-table input,.meta-table textarea{
.meta-table input,.meta-table textarea,.meta-table select{
margin-top:0;
}
@ -234,6 +234,40 @@
</form>
</div>
<!-- Email / SMTP configuration -->
<div class="section">
<h2>Email (SMTP) Settings</h2>
<p class="copy-hint">These settings are used to send confirmation, preview, and delivery emails to customers. The password is stored encrypted using the Flask secret key.</p>
<form method="POST">
<input type="hidden" name="action" value="save_email_config">
<table class="meta-table">
<tr>
<td>SMTP Host</td>
<td><input type="text" id="smtp_host" name="smtp_host" value="{{ email_form.smtp_host }}" placeholder="e.g. mailroot8.namespro.ca"></td>
</tr>
<tr>
<td>SMTP Port</td>
<td><input type="text" id="smtp_port" name="smtp_port" value="{{ email_form.smtp_port }}" placeholder="e.g. 465"></td>
</tr>
<tr>
<td>SMTP Username</td>
<td><input type="text" id="smtp_user" name="smtp_user" value="{{ email_form.smtp_user }}" placeholder="e.g. ai@hallsworth.ca"></td>
</tr>
<tr>
<td>From Address</td>
<td><input type="text" id="smtp_from" name="smtp_from" value="{{ email_form.smtp_from }}" placeholder="e.g. ai@hallsworth.ca"></td>
</tr>
<tr>
<td>SMTP Password</td>
<td>
<input type="password" id="smtp_pass" name="smtp_pass" placeholder="{% if email_form.smtp_pass_set %}Stored encrypted — type to replace{% else %}Enter password{% endif %}">
</td>
</tr>
</table>
<button type="submit">Save Email Settings</button>
</form>
</div>
<!-- MP3 metadata defaults -->
<div class="section">
<h2>MP3 Metadata Tags</h2>