import type { Metadata } from "next" import { getTranslations, getMessages, setRequestLocale } from "next-intl/server" import { Link } from "@/i18n/navigation" import Image from "next/image" import { ExternalLink } from "lucide-react" import { DocHeader } from "@/components/ui/doc-header" import { Callout } from "@/components/ui/callout" import { DataFlowDiagram } from "@/components/ui/data-flow-diagram" export async function generateMetadata({ params, }: { params: Promise<{ locale: string }> }): Promise { const { locale } = await params const t = await getTranslations({ locale, namespace: "docs.security.lynis.meta" }) return { title: t("title"), description: t("description"), openGraph: { title: t("ogTitle"), description: t("ogDescription"), type: "article", url: "https://macrimi.github.io/ProxMenux/docs/security/lynis", }, } } type WhyRow = { sourceRich: string; path: string; update: string; fresh: string } type ReportRow = { markerRich: string; meaning: string; action: string } type ReinstallRow = { actionRich: string; whatRich: string } type RelatedItem = { href: string; label: string; tail?: string; tailRich?: string } export default async function LynisPage({ params, }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations({ locale, namespace: "docs.security.lynis" }) const messages = (await getMessages({ locale })) as unknown as { docs: { security: { lynis: { detection: { items: string[] } whyUpstream: { rows: WhyRow[] } report: { rows: ReportRow[] } reinstall: { rows: ReinstallRow[] } related: { items: RelatedItem[] } } } } } const block = messages.docs.security.lynis const detectionItems = block.detection.items const whyRows = block.whyUpstream.rows const reportRows = block.report.rows const reinstallRows = block.reinstall.rows const relatedItems = block.related.items const code = (chunks: React.ReactNode) => {chunks} const strong = (chunks: React.ReactNode) => {chunks} const em = (chunks: React.ReactNode) => {chunks} const ok = (chunks: React.ReactNode) => {chunks} const warn = (chunks: React.ReactNode) => {chunks} const sugg = (chunks: React.ReactNode) => {chunks} const linkFail2ban = (chunks: React.ReactNode) => ( {chunks} ) const linkSecurityTab = (chunks: React.ReactNode) => ( {chunks} ) return (
{t.rich("intro.body", { code })}

{t("manageMenu.heading")}

{t("manageMenu.intro")}

{t("manageMenu.imageAlt")}

{t("whyUpstream.heading")}

{t.rich("whyUpstream.intro", { code })}

{whyRows.map((row, idx) => ( ))}
{t("whyUpstream.headerSource")} {t("whyUpstream.headerPath")} {t("whyUpstream.headerUpdate")} {t("whyUpstream.headerFresh")}
{t.rich(`whyUpstream.rows.${idx}.sourceRich`, { strong })} {row.path} {row.update} {row.fresh}

{t("install.heading")}

{t.rich("install.outro", { code })}

{t("detection.heading")}

{t("detection.intro")}

    {detectionItems.map((_, idx) => (
  1. {t.rich(`detection.items.${idx}`, { code })}
  2. ))}

{t.rich("detection.outro", { code, strong })}

{t("audit.heading")}

{t.rich("audit.intro", { strong })}

{t.raw("audit.code") as string}

{t.rich("audit.outro", { code, ok, warn, sugg })}

{t.raw("audit.summary") as string}

{t("report.heading")}

{t.rich("report.intro", { code, strong })}

{reportRows.map((row, idx) => ( ))}
{t("report.headerMarker")} {t("report.headerMeaning")} {t("report.headerAction")}
{t.rich(`report.rows.${idx}.markerRich`, { strong })} {row.meaning} {row.action}

{t.rich("report.outro", { code })}

{t.rich("pairFail2ban.body", { code, link: linkFail2ban })}

{t("update.heading")}

{t.rich("update.body", { code, strong })}

{t("reinstall.heading")}

{reinstallRows.map((_, idx) => ( ))}
{t("reinstall.headerAction")} {t("reinstall.headerWhat")}
{t.rich(`reinstall.rows.${idx}.actionRich`, { strong })} {t.rich(`reinstall.rows.${idx}.whatRich`, { code })}

{t("cli.heading")}

{t("cli.intro")}

{t.raw("cli.code") as string}

{t("troubleshoot.heading")}

{t.rich("troubleshoot.cloneBody", { code })} {t.rich("troubleshoot.notFoundIntro", { code })}
{t.raw("troubleshoot.notFoundCode") as string}
{t.rich("troubleshoot.sshIntro", { code, link: linkFail2ban })}
{t.raw("troubleshoot.sshCode") as string}
{t.rich("troubleshoot.scoreBody", { code })}

{t("files.heading")}

{t.raw("files.code") as string}

{t("sample.heading")}

{t.rich("sample.intro", { link: linkSecurityTab })}

{t("sample.imageAlt")}
{t("sample.captionPrefix")} {t("sample.captionLink")} {t("sample.captionSuffix")}

{t.rich("sample.cli", { code })}

{t("related.heading")}

    {relatedItems.map((item, idx) => (
  • {item.label} {item.tailRich ? t.rich(`related.items.${idx}.tailRich`, { code }) : item.tail}
  • ))}
) }