use env value for pin
All checks were successful
Build and push image for doorman / docker (push) Successful in 47s
All checks were successful
Build and push image for doorman / docker (push) Successful in 47s
This commit is contained in:
parent
d218d95104
commit
f8b39c77c0
@ -1,7 +1,6 @@
|
||||
import { Alert, Button } from '@cloudscape-design/components';
|
||||
import { Header } from '@cloudscape-design/components';
|
||||
import React, { useState } from 'react';
|
||||
import { Outlet, useLocation, useNavigate } from 'react-router-dom';
|
||||
import { Action } from './types/Action';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { AlertContent, AlertContext } from './contexts/AlertContext';
|
||||
|
||||
function App() {
|
||||
@ -18,12 +17,7 @@ function App() {
|
||||
setContent,
|
||||
}
|
||||
}>
|
||||
<h1>homepage</h1>
|
||||
{Object.values(Action).map(value => {
|
||||
return <Button disabled={location.pathname.includes(value)} key={value} onClick={() => navigate(`/action/${value}`)}>{value}</Button>
|
||||
})}
|
||||
{content.message && <Alert dismissible onDismiss={() => setContent({})} type={content.type || "info"}>{content.message}</Alert>}
|
||||
<Outlet />
|
||||
<Header>Doorman</Header>
|
||||
</AlertContext.Provider>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -4,7 +4,7 @@ import { getRedisClient } from "../clients/db/RedisDbProvider";
|
||||
const client = await getRedisClient();
|
||||
|
||||
export const ValidQueryParamAuth: RequestHandler = async (req, res, next) => {
|
||||
if (req.query['key'] !== '123') {
|
||||
if (req.query['key'] !== Bun.env.DOOR_FIXED_PIN) {
|
||||
res.status(401).json({ msg: "Unauthorized" });
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import express from "express";
|
||||
import { getRedisClient } from "../clients/db/RedisDbProvider";
|
||||
import { RedisKeys, concatKeys, doorStatusKey } from "../types/RedisKeys";
|
||||
import { doorStatusKey } from "../types/RedisKeys";
|
||||
import { ValidQueryParamAuth } from "../middlewares/DoorAuthModes";
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
@ -20,8 +20,8 @@ app.use(fileUpload({
|
||||
app.use(express.static("dist"));
|
||||
|
||||
// use routers
|
||||
app.use('/api/lnurl', LnurlRouter);
|
||||
app.use('/api/actions', ActionRouter);
|
||||
// app.use('/api/lnurl', LnurlRouter);
|
||||
// app.use('/api/actions', ActionRouter);
|
||||
app.use('/api/door', DoorRouter);
|
||||
|
||||
app.listen(5000, async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user