Skip to content

Commit

Permalink
feat: add qrcode to GET page
Browse files Browse the repository at this point in the history
  • Loading branch information
rpj committed Jul 3, 2022
1 parent 452bd0e commit 81df1d8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions client/getkey.tmpl.html
Expand Up @@ -70,6 +70,21 @@
color: #843b84;
text-decoration: none;
}

#qr {
text-align: center;
align-items: center;
justify-content: center;
position: fixed;
left: 3vw;
bottom: 3vh;
z-index: -999;
}

#qr > div > img {
opacity: 0.8;
border-radius: 7px;
}
</style>
</head>
<body>
Expand All @@ -92,4 +107,11 @@
{{{ body }}}
</template>
</main>

<div id="qr">
<div style="margin-bottom: 2em;">
<img src="/{{ key }}.png?full" />
</div>
</div>

</body>
2 changes: 2 additions & 0 deletions server/routes.js
Expand Up @@ -266,6 +266,8 @@ async function attach (app, knownKeys, fqdn, contentDir, contactAddr, scheme) {
return body;
}

// REALLY need a better way to handle this...
reply.header('Content-Security-Policy', reply.getHeader('Content-Security-Policy').replace('data:', "'self'"));
return mustache.render(getkeyTmpl, { ...renderMap, body });
};

Expand Down

0 comments on commit 81df1d8

Please sign in to comment.