fix standalone mode bugs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "app",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"dev": "bun run --watch src/index.js",
|
||||
|
||||
@@ -116,10 +116,10 @@ createKeyBtn.addEventListener("click", async () => {
|
||||
<p>Make sure to copy your secret key — it's required to validate tokens and you won't be able to see it again.</p>
|
||||
<div class="key-creation-form">
|
||||
<label for="public-key">Key ID</label>
|
||||
<input type="text" id="public-key" value="${publicKey}" disabled style="opacity: 1"/>
|
||||
<input type="text" id="public-key" value="${publicKey}" readonly style="opacity: 1"/>
|
||||
</div><div class="key-creation-form">
|
||||
<label for="private-key">Secret key</label>
|
||||
<input type="text" id="private-key" value="${privateKey}" disabled style="opacity: 1"/>
|
||||
<input type="text" id="private-key" value="${privateKey}" readonly style="opacity: 1"/>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -196,7 +196,6 @@ const reloadKeysList = async () => {
|
||||
<input type="number" id="expiresMs" placeholder="600000" value="600000" min="1" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="actions actions-col">
|
||||
<button class="rotate-key action-secundary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rotate-cw-icon lucide-rotate-cw"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/></svg> Rotate secret key</button>
|
||||
<button class="delete-key action-secundary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-trash2-icon lucide-trash-2"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/></svg> Delete key</button>
|
||||
@@ -315,10 +314,10 @@ const reloadKeysList = async () => {
|
||||
<p>Make sure to copy your new secret key — it's required to validate tokens and you won't be able to see it again.</p>
|
||||
<div class="key-creation-form">
|
||||
<label for="public-key">Key ID</label>
|
||||
<input type="text" id="public-key" value="${key.publicKey}" disabled style="opacity: 1"/>
|
||||
<input type="text" id="public-key" value="${key.publicKey}" readonly style="opacity: 1"/>
|
||||
</div><div class="key-creation-form">
|
||||
<label for="private-key">Secret key</label>
|
||||
<input type="text" id="private-key" value="${privateKey}" disabled style="opacity: 1"/>
|
||||
<input type="text" id="private-key" value="${privateKey}" readonly style="opacity: 1"/>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Elysia, file, NotFoundError } from "elysia";
|
||||
import { staticPlugin } from "@elysiajs/static";
|
||||
import { cors } from '@elysiajs/cors'
|
||||
import { rateLimit } from "elysia-rate-limit";
|
||||
import Cap from "@cap.js/server";
|
||||
import crypto from "crypto";
|
||||
@@ -270,6 +271,7 @@ const internal = new Elysia({ prefix: "/internal" })
|
||||
});
|
||||
|
||||
const api = new Elysia({ prefix: "/:key" })
|
||||
.use(cors())
|
||||
.use(
|
||||
rateLimit({
|
||||
scoping: "scoped",
|
||||
|
||||
Reference in New Issue
Block a user