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 React, { useState } from 'react';
|
||||||
import { Outlet, useLocation, useNavigate } from 'react-router-dom';
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
import { Action } from './types/Action';
|
|
||||||
import { AlertContent, AlertContext } from './contexts/AlertContext';
|
import { AlertContent, AlertContext } from './contexts/AlertContext';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
@ -18,12 +17,7 @@ function App() {
|
|||||||
setContent,
|
setContent,
|
||||||
}
|
}
|
||||||
}>
|
}>
|
||||||
<h1>homepage</h1>
|
<Header>Doorman</Header>
|
||||||
{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 />
|
|
||||||
</AlertContext.Provider>
|
</AlertContext.Provider>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { getRedisClient } from "../clients/db/RedisDbProvider";
|
|||||||
const client = await getRedisClient();
|
const client = await getRedisClient();
|
||||||
|
|
||||||
export const ValidQueryParamAuth: RequestHandler = async (req, res, next) => {
|
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" });
|
res.status(401).json({ msg: "Unauthorized" });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
import { getRedisClient } from "../clients/db/RedisDbProvider";
|
import { getRedisClient } from "../clients/db/RedisDbProvider";
|
||||||
import { RedisKeys, concatKeys, doorStatusKey } from "../types/RedisKeys";
|
import { doorStatusKey } from "../types/RedisKeys";
|
||||||
import { ValidQueryParamAuth } from "../middlewares/DoorAuthModes";
|
import { ValidQueryParamAuth } from "../middlewares/DoorAuthModes";
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|||||||
@ -20,8 +20,8 @@ app.use(fileUpload({
|
|||||||
app.use(express.static("dist"));
|
app.use(express.static("dist"));
|
||||||
|
|
||||||
// use routers
|
// use routers
|
||||||
app.use('/api/lnurl', LnurlRouter);
|
// app.use('/api/lnurl', LnurlRouter);
|
||||||
app.use('/api/actions', ActionRouter);
|
// app.use('/api/actions', ActionRouter);
|
||||||
app.use('/api/door', DoorRouter);
|
app.use('/api/door', DoorRouter);
|
||||||
|
|
||||||
app.listen(5000, async () => {
|
app.listen(5000, async () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user