This commit is contained in:
Milo Schwartz 2024-10-26 17:01:34 -04:00
parent d78312fad8
commit 50d374d9f6
No known key found for this signature in database
8 changed files with 1735 additions and 21 deletions

View file

@ -4,7 +4,7 @@ WORKDIR /app
COPY package.json ./
RUN npm install
RUN npm install --legacy-peer-deps
COPY . .
@ -18,12 +18,12 @@ WORKDIR /app
COPY package.json ./
RUN npm install --omit=dev
RUN npm install --omit=dev --legacy-peer-deps
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/dist ./dist
COPY ./config/config.example.yml ./dist/config.example.yml
COPY ./server/db/names.json ./dist/names.json
COPY config.example.yml ./dist/config.example.yml
COPY server/db/names.json ./dist/names.json
CMD ["npm", "start"]

View file

@ -1,13 +1,13 @@
import {
orgs,
sites,
resources,
exitNodes,
routes,
targets,
} from "@server/db/schema";
import db from "@server/db";
import { createSuperuserRole } from "@server/db/ensureActions";
// import {
// orgs,
// sites,
// resources,
// exitNodes,
// routes,
// targets,
// } from "@server/db/schema";
// import db from "@server/db";
// import { createSuperuserRole } from "@server/db/ensureActions";
async function insertDummyData() {
// // Insert dummy orgs

View file

@ -14,7 +14,6 @@ const portSchema = z.number().positive().gt(0).lte(65535);
const environmentSchema = z.object({
app: z.object({
name: z.string(),
base_url: z.string().url(),
log_level: z.enum(["debug", "info", "warn", "error"]),
save_logs: z.boolean(),
@ -129,8 +128,7 @@ process.env.NEXT_PUBLIC_INTERNAL_API_BASE_URL = new URL(
"/api/v1",
`http://${parsedConfig.data.server.internal_hostname}:${parsedConfig.data.server.external_port}`
).href;
process.env.NEXT_PUBLIC_APP_NAME = parsedConfig.data.app.name;
process.env.NEXT_PUBLIC_FLAGS_EMAIL_VERIFICATION_REQUIRED = parsedConfig.data
process.env.PUBLIC_FLAGS_EMAIL_VERIFICATION_REQUIRED = parsedConfig.data
.flags?.require_email_verification
? "true"
: "false";

1711
server/names.json Normal file

File diff suppressed because it is too large Load diff

View file

@ -65,7 +65,7 @@ export async function requestTotpSecret(
const hex = crypto.getRandomValues(new Uint8Array(20));
const secret = encodeHex(hex);
const uri = createTOTPKeyURI(config.app.name, user.email, hex);
const uri = createTOTPKeyURI("Pangolin", user.email, hex);
await db
.update(users)

View file

@ -1,7 +1,12 @@
import axios from "axios";
// let origin;
// if (typeof window !== "undefined") {
// origin = window.location.origin;
// }
export const api = axios.create({
baseURL: process.env.NEXT_PUBLIC_EXTERNAL_API_BASE_URL,
baseURL: `http://localhost:3000/api/v1`,
timeout: 10000,
headers: {
"Content-Type": "application/json",
@ -9,7 +14,7 @@ export const api = axios.create({
});
export const internal = axios.create({
baseURL: process.env.NEXT_PUBLIC_INTERNAL_API_BASE_URL,
baseURL: `http://localhost:3000/api/v1`,
timeout: 10000,
headers: {
"Content-Type": "application/json",

View file

@ -5,7 +5,7 @@ import { redirect } from "next/navigation";
export default async function Page(props: {
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
}) {
if (process.env.NEXT_PUBLIC_FLAGS_EMAIL_VERIFICATION_REQUIRED !== "true") {
if (process.env.PUBLIC_FLAGS_EMAIL_VERIFICATION_REQUIRED !== "true") {
redirect("/");
}