new changes

This commit is contained in:
Niranjan
2026-04-07 11:42:19 +05:30
parent cc45fac342
commit 10236a4cd4
14 changed files with 360 additions and 52 deletions

View File

@@ -17,9 +17,21 @@ interface Certificate {
path: string
}
interface SslDiagnostics {
vhost_dir: string
include_snippet: string
vhosts: { file: string; has_listen_80: boolean; has_listen_443: boolean; has_ssl_directives: boolean }[]
any_vhost_listen_ssl: boolean
nginx_effective_listen_443: boolean
panel_vhost_path_in_nginx_t: boolean
nginx_t_probe_errors: string[]
hints: string[]
}
export function DomainsPage() {
const [domains, setDomains] = useState<Domain[]>([])
const [certificates, setCertificates] = useState<Certificate[]>([])
const [diag, setDiag] = useState<SslDiagnostics | null>(null)
const [loading, setLoading] = useState(true)
const [error, setError] = useState('')
const [requesting, setRequesting] = useState<string | null>(null)
@@ -86,6 +98,34 @@ export function DomainsPage() {
Request Let&apos;s Encrypt certificates for your site domains. Requires certbot and nginx configured for the domain.
</div>
{diag ? (
<div className="alert alert-info small mb-4">
<div className="fw-semibold mb-2">HTTPS / nginx check</div>
{diag.hints.length ? (
<ul className="mb-3 ps-3">
{diag.hints.map((h, i) => (
<li key={i} className="mb-1">
{h}
</li>
))}
</ul>
) : null}
<div className="text-secondary mb-1">Include YakPanel vhosts inside the <code>http</code> block of the nginx process that serves your sites:</div>
<code className="d-block user-select-all bg-body-secondary p-2 rounded small text-break">{diag.include_snippet}</code>
{diag.vhosts.length > 0 ? (
<div className="mt-2 text-secondary">
Panel configs scanned:{' '}
{diag.vhosts.map((v) => `${v.file}${v.has_listen_443 && v.has_ssl_directives ? ' (HTTPS block)' : ''}`).join(', ')}
</div>
) : null}
{diag.nginx_t_probe_errors.length > 0 ? (
<div className="mt-2 small text-danger">
nginx -T probe: {diag.nginx_t_probe_errors.join(' | ')}
</div>
) : null}
</div>
) : null}
<div className="row g-4">
<div className="col-lg-6">
<div className="card h-100">