mirror of
https://github.com/fosrl/pangolin.git
synced 2025-05-14 22:30:45 +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 ./
|
COPY package.json ./
|
||||||
|
|
||||||
RUN npm install
|
RUN npm install --legacy-peer-deps
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
@ -18,12 +18,12 @@ WORKDIR /app
|
||||||
|
|
||||||
COPY package.json ./
|
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/.next ./.next
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
|
|
||||||
COPY ./config/config.example.yml ./dist/config.example.yml
|
COPY config.example.yml ./dist/config.example.yml
|
||||||
COPY ./server/db/names.json ./dist/names.json
|
COPY server/db/names.json ./dist/names.json
|
||||||
|
|
||||||
CMD ["npm", "start"]
|
CMD ["npm", "start"]
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import {
|
// import {
|
||||||
orgs,
|
// orgs,
|
||||||
sites,
|
// sites,
|
||||||
resources,
|
// resources,
|
||||||
exitNodes,
|
// exitNodes,
|
||||||
routes,
|
// routes,
|
||||||
targets,
|
// targets,
|
||||||
} from "@server/db/schema";
|
// } from "@server/db/schema";
|
||||||
import db from "@server/db";
|
// import db from "@server/db";
|
||||||
import { createSuperuserRole } from "@server/db/ensureActions";
|
// import { createSuperuserRole } from "@server/db/ensureActions";
|
||||||
|
|
||||||
async function insertDummyData() {
|
async function insertDummyData() {
|
||||||
// // Insert dummy orgs
|
// // Insert dummy orgs
|
||||||
|
|
|
@ -14,7 +14,6 @@ const portSchema = z.number().positive().gt(0).lte(65535);
|
||||||
|
|
||||||
const environmentSchema = z.object({
|
const environmentSchema = z.object({
|
||||||
app: z.object({
|
app: z.object({
|
||||||
name: z.string(),
|
|
||||||
base_url: z.string().url(),
|
base_url: z.string().url(),
|
||||||
log_level: z.enum(["debug", "info", "warn", "error"]),
|
log_level: z.enum(["debug", "info", "warn", "error"]),
|
||||||
save_logs: z.boolean(),
|
save_logs: z.boolean(),
|
||||||
|
@ -129,8 +128,7 @@ process.env.NEXT_PUBLIC_INTERNAL_API_BASE_URL = new URL(
|
||||||
"/api/v1",
|
"/api/v1",
|
||||||
`http://${parsedConfig.data.server.internal_hostname}:${parsedConfig.data.server.external_port}`
|
`http://${parsedConfig.data.server.internal_hostname}:${parsedConfig.data.server.external_port}`
|
||||||
).href;
|
).href;
|
||||||
process.env.NEXT_PUBLIC_APP_NAME = parsedConfig.data.app.name;
|
process.env.PUBLIC_FLAGS_EMAIL_VERIFICATION_REQUIRED = parsedConfig.data
|
||||||
process.env.NEXT_PUBLIC_FLAGS_EMAIL_VERIFICATION_REQUIRED = parsedConfig.data
|
|
||||||
.flags?.require_email_verification
|
.flags?.require_email_verification
|
||||||
? "true"
|
? "true"
|
||||||
: "false";
|
: "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 hex = crypto.getRandomValues(new Uint8Array(20));
|
||||||
const secret = encodeHex(hex);
|
const secret = encodeHex(hex);
|
||||||
const uri = createTOTPKeyURI(config.app.name, user.email, hex);
|
const uri = createTOTPKeyURI("Pangolin", user.email, hex);
|
||||||
|
|
||||||
await db
|
await db
|
||||||
.update(users)
|
.update(users)
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
|
// let origin;
|
||||||
|
// if (typeof window !== "undefined") {
|
||||||
|
// origin = window.location.origin;
|
||||||
|
// }
|
||||||
|
|
||||||
export const api = axios.create({
|
export const api = axios.create({
|
||||||
baseURL: process.env.NEXT_PUBLIC_EXTERNAL_API_BASE_URL,
|
baseURL: `http://localhost:3000/api/v1`,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
@ -9,7 +14,7 @@ export const api = axios.create({
|
||||||
});
|
});
|
||||||
|
|
||||||
export const internal = axios.create({
|
export const internal = axios.create({
|
||||||
baseURL: process.env.NEXT_PUBLIC_INTERNAL_API_BASE_URL,
|
baseURL: `http://localhost:3000/api/v1`,
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { redirect } from "next/navigation";
|
||||||
export default async function Page(props: {
|
export default async function Page(props: {
|
||||||
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
|
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("/");
|
redirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue