Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nginx cert config panel #536

Merged
merged 1 commit into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/components/certificate/certificate-available.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Description from './description';
import GeneralPanel from './panels/general';
import NodePanel from './panels/node';
import AwsPanel from './panels/aws';
import NginxPanel from './panels/nginx';

interface CertificateAvailableProps {
validFromFormatted: string;
Expand Down Expand Up @@ -72,12 +73,15 @@ export default function CertificateAvailable({
<Tab>General</Tab>
<Tab>Node.js</Tab>
<Tab>AWS</Tab>
<Tab>NGINX</Tab>
</TabList>

<TabPanels>
<GeneralPanel publicKey={publicKey} privateKey={privateKey} />
<NodePanel publicKey={publicKey} privateKey={privateKey} />
<AwsPanel publicKey={publicKey} privateKey={privateKey} />
{/* TODO: needs to be updated with full chain... */}
<NginxPanel fullChain={publicKey} privateKey={privateKey} />
</TabPanels>
</Tabs>
</>
Expand Down
38 changes: 38 additions & 0 deletions app/components/certificate/panels/nginx.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Divider, TabPanel, Text, Link } from '@chakra-ui/react';
import CertificateDisplay from '../certificate-display';

interface NginxPanelProps {
fullChain: string;
privateKey: string;
}

export default function NginxPanel({ fullChain, privateKey }: NginxPanelProps) {
return (
<TabPanel>
<Text marginBottom={4}>
You can use your certificate with{' '}
<Link
href="https://www.nginx.com/blog/using-free-ssltls-certificates-from-lets-encrypt-with-nginx/"
isExternal
>
NGINX to create a secure HTTPS server
</Link>
.
</Text>

<CertificateDisplay
title="Full Chain"
value={fullChain}
description="Your Public Certificate combined with the Let's Encrypt intermediate certificate chain into a single certificate."
pathname="cert"
/>
<Divider />
<CertificateDisplay
title="Private Key"
value={privateKey}
description="Private certificate key, do not share it."
pathname="privkey"
/>
</TabPanel>
);
}