mirror of
https://github.com/fosrl/pangolin.git
synced 2025-05-13 05:40:38 +01:00
save
This commit is contained in:
parent
d78312fad8
commit
50d374d9f6
8 changed files with 1735 additions and 21 deletions
|
@ -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"]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
1711
server/names.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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)
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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("/");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue