diff --git a/src/auth.ts b/src/auth.ts index febe1e5f..e98e1652 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -1,11 +1,15 @@ +import express from 'express'; +import path from 'path'; import { ServerOptions } from "../proto/autogenerated/ts/express_server"; import { AdminContext, MetricsContext } from "../proto/autogenerated/ts/types"; import Main from './services/main' import { getLogger } from './services/helpers/logger.js' + const serverOptions = (mainHandler: Main): ServerOptions => { const log = getLogger({}) return { logger: { log, error: err => log("ERROR", err) }, + staticFiles: path.resolve('static'), AdminAuthGuard: adminAuth, MetricsAuthGuard: metricsAuth, AppAuthGuard: async (authHeader) => { return { app_id: mainHandler.applicationManager.DecodeAppToken(stripBearer(authHeader)) } }, diff --git a/static/LightningPub.png b/static/LightningPub.png new file mode 100644 index 00000000..1cbc35de Binary files /dev/null and b/static/LightningPub.png differ diff --git a/static/connect.html b/static/connect.html new file mode 100644 index 00000000..9e6a60e5 --- /dev/null +++ b/static/connect.html @@ -0,0 +1,47 @@ + + + + + + + + + + + Lightning.Pub + + + +
+ Lightning Pub logo + Lightning Pub logo +
+ +
+
+

Connect

+

To access the dashboard, use ShockWallet and tap the logo 3 times.

+

Scan the QR with ShockWallet to insert the connection details.

+
+ +
+ +
+
+

strfry.shock.network
npub123abcdefghhhhhhhhhhhhhhh


+

Note: Code contains a one-time pairing secret.

+
+ +
+ + +
+ + + + + + + \ No newline at end of file diff --git a/static/index.html b/static/index.html new file mode 100644 index 00000000..54674617 --- /dev/null +++ b/static/index.html @@ -0,0 +1,49 @@ + + + + + + + + + + + Lightning.Pub + + + +
+ Lightning Pub logo + Lightning Pub logo +
+ +
+
+

Setup

+

To manage your Pub, you will connect a via remote dashboard.

+

Confirm a few things to generate a connection string:

+
+ +
+ +
+

Use default managed relay,
1000 sats per month paid automatically after grace period.

+
+ + +
+

Or, enter a custom relay:

+


+ +

Need Help?

+
+ +
+ + +
+ + \ No newline at end of file diff --git a/static/pub_logo.png b/static/pub_logo.png new file mode 100644 index 00000000..36cc43b4 Binary files /dev/null and b/static/pub_logo.png differ diff --git a/static/script.js b/static/script.js new file mode 100644 index 00000000..f21f547c --- /dev/null +++ b/static/script.js @@ -0,0 +1,10 @@ +$(document).ready(function() { + var qrcode = new QRCode(document.getElementById("qrcode"), { + text: "strfry.shock.network npub123abcdefghhhhhhhhhhhhhhh", + width: 157, + height: 157, + colorDark : "#ffffff", + colorLight : "#000000", + correctLevel : QRCode.CorrectLevel.H + }); +}); \ No newline at end of file diff --git a/static/styles.css b/static/styles.css new file mode 100644 index 00000000..80fef982 --- /dev/null +++ b/static/styles.css @@ -0,0 +1,168 @@ +:root { + --background-color: #16191c; + --color: #ffffff; + --color-marked: #ff7700; + --color-linked: #2aabe9; + --gradient: linear-gradient(60deg, #ff7700 0%, #c740c7 100%); + --font-size-h2: 36px; + --font-size-p: 16px; +} + +body { + margin-block-start: 15px; + font-family: Montserrat; + background-color: var(--background-color); + color: var(--color); + text-align: center; + overflow: scroll; +} + +header { + background-color: var(--background-color); + padding-inline: 2%; + display: flex; + flex-direction: row; + align-items: center; + gap: 1rem; +} + +main { + max-width: 700px; + width: 100%; + margin-inline: auto; +} + +@media (min-width: 768px) { + body { + zoom: 1.4; + } + +} + +@media (min-width: 2000px) { + body { + zoom: 1.6; + } + +} + +@media screen and (max-width: 425px) { + header>img:nth-child(1){ + width: 30px; + height: auto; + } + + header>img:nth-child(2){ + width: auto; + height: 26px; + } +} + +input[type="text"] { + background-color: transparent; + padding: 7px 10px; + border: 1px solid #c740c7; + border-radius: 5px; + font-size: 14px; + color: #999999; + text-align: center; + box-shadow: 0px 0px 2px rgba(0,0,0,1); +} + +button { + background-color: transparent; + padding: 10px 55px; + font-size: 20px; + color: var(--color); + text-align: center; + box-shadow: 0px 0px 2px rgba(0,0,0,1); + background: linear-gradient(var(--background-color), var(--background-color)) padding-box, var(--gradient) border-box; + border-radius: 5px; + border: 1px solid transparent; +} + + +h2 { + font-size: var(--font-size-h2); + font-weight: 400; +} + +p { + font-size: var(--font-size-p); +} + +a { + color: var(--color); + text-decoration: none; +} + +.text-gray { + color: #a3a3a3; + margin-block-end: 5px; +} + +/* Hide the default checkbox */ +.checkbox input[type="checkbox"] { + display: none; +} + +/* Create a new box */ +.checkbox label { + position: relative; +} + +.checkbox label::before { + content: ""; + display: inline-block; + width: 20px; + height: 20px; + margin-right: 10px; + background-color: transparent; + border: 1px solid #a3a3a3; + border-radius: 5px; +} + +/* Display a checkmark when the checkbox is checked */ +.checkbox input[type="checkbox"]:checked + label::after { + content: "✔"; + color: #a012c7; + font-size: 20px; + position: absolute; + left: 1px; + top: -11px; + width: 20px; + height: 20px; + text-align: center; +} + +.line { + margin-block: 30px; + background: var(--gradient); + width: 347px; + height: 2px; + margin-inline: auto; +} + +.marked { + color: var(--color-marked); +} + +.linked { + color: var(--color-linked); +} + +.setup-footer>p { + line-height: 4px; +} + +.setup-header>h2 { + margin-block-start: 20px; +} + +#qrcode { + display: flex; + margin: auto; + justify-content: center; + margin-block-start: 40px; + margin-block-end: 15px; +}