Skip to content

Commit 9448969

Browse files
committed
Merge branch 'main' of https://github.com/kittendevv/Invio
2 parents 462171e + b0f6a87 commit 9448969

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

backend/src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const app = new Hono();
1717

1818
// Check for required credentials in environment
1919
try {
20-
ensureEnv(["JWT_SECRET"]);
20+
ensureEnv(["JWT_SECRET", "ADMIN_USER", "ADMIN_PASS"]);
2121

2222
const { username: adminUsername, password: adminPassword } = getAdminCredentials();
2323
if (!adminUsername || adminUsername.trim().length === 0) {

backend/src/middleware/auth.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import type { Context, Next } from "hono";
22
import { verifyJWT } from "../utils/jwt.ts";
3-
4-
function getAdminCredentials(): { username: string; password: string } {
5-
return {
6-
username: Deno.env.get("ADMIN_USER") || "admin",
7-
password: Deno.env.get("ADMIN_PASS") || "supersecret",
8-
};
9-
}
3+
import { getAdminCredentials } from "../utils/env.ts";
104

115
function unauthorized(): Response {
126
return new Response("Unauthorized", {

docker-compose-dev.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ services:
66
env_file:
77
- .env
88
environment:
9-
ADMIN_USER: ${ADMIN_USER:-admin}
10-
ADMIN_PASS: ${ADMIN_PASS:-supersecret}
11-
JWT_SECRET: ${JWT_SECRET:-change-me-in-prod}
9+
ADMIN_USER: ${ADMIN_USER}
10+
ADMIN_PASS: ${ADMIN_PASS}
11+
JWT_SECRET: ${JWT_SECRET}
1212
DATABASE_PATH: ${DATABASE_PATH:-/app/data/invio.db}
1313
volumes:
1414
- invio_data:/app/data

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ services:
66
env_file:
77
- .env
88
environment:
9-
ADMIN_USER: ${ADMIN_USER:-admin}
10-
ADMIN_PASS: ${ADMIN_PASS:-supersecret}
11-
JWT_SECRET: ${JWT_SECRET:-change-me-in-prod}
9+
ADMIN_USER: ${ADMIN_USER}
10+
ADMIN_PASS: ${ADMIN_PASS}
11+
JWT_SECRET: ${JWT_SECRET}
1212
DATABASE_PATH: ${DATABASE_PATH:-/app/data/invio.db}
1313
volumes:
1414
- invio_data:/app/data

0 commit comments

Comments
 (0)