mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Compare commits
No commits in common. "79ba408d9f9d76e4ca803255111d40be02524f09" and "e90914b3204f1d86177362661a89d0132a046e26" have entirely different histories.
79ba408d9f
...
e90914b320
5
auth.ts
5
auth.ts
@ -1,12 +1,9 @@
|
|||||||
import getEnv from "@/lib/env-entry"
|
import getEnv from "@/lib/env-entry"
|
||||||
import CryptoJS from "crypto-js"
|
|
||||||
import NextAuth from "next-auth"
|
import NextAuth from "next-auth"
|
||||||
import CredentialsProvider from "next-auth/providers/credentials"
|
import CredentialsProvider from "next-auth/providers/credentials"
|
||||||
|
|
||||||
export const { handlers, signIn, signOut, auth } = NextAuth({
|
export const { handlers, signIn, signOut, auth } = NextAuth({
|
||||||
secret:
|
secret: process.env.AUTH_SECRET ?? "this_is_nezha_dash_web_secret",
|
||||||
process.env.AUTH_SECRET ??
|
|
||||||
CryptoJS.MD5(`this_is_nezha_dash_web_secret_${getEnv("SitePassword")}`).toString(),
|
|
||||||
trustHost: (process.env.AUTH_TRUST_HOST as boolean | undefined) ?? true,
|
trustHost: (process.env.AUTH_TRUST_HOST as boolean | undefined) ?? true,
|
||||||
providers: [
|
providers: [
|
||||||
CredentialsProvider({
|
CredentialsProvider({
|
||||||
|
@ -73,6 +73,7 @@ export type ClientEnvKey = `NEXT_PUBLIC_${keyof ClientEnvConfig}`
|
|||||||
export function getServerEnv<K extends keyof ServerEnvConfig>(key: K): string | undefined {
|
export function getServerEnv<K extends keyof ServerEnvConfig>(key: K): string | undefined {
|
||||||
const value = process.env[key]
|
const value = process.env[key]
|
||||||
if (!value) {
|
if (!value) {
|
||||||
|
console.warn(`Environment variable ${key} is not set`)
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
@ -87,6 +88,7 @@ export function getClientEnv<K extends keyof ClientEnvConfig>(key: K): string |
|
|||||||
const envKey = `NEXT_PUBLIC_${key}`
|
const envKey = `NEXT_PUBLIC_${key}`
|
||||||
const value = env(envKey)
|
const value = env(envKey)
|
||||||
if (!value) {
|
if (!value) {
|
||||||
|
console.warn(`Environment variable ${envKey} is not set`)
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
|
34
package.json
34
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nezha-dash",
|
"name": "nezha-dash",
|
||||||
"version": "2.7.0",
|
"version": "2.6.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3040",
|
"dev": "next dev -p 3040",
|
||||||
@ -16,27 +16,25 @@
|
|||||||
"@ducanh2912/next-pwa": "^10.2.9",
|
"@ducanh2912/next-pwa": "^10.2.9",
|
||||||
"@heroicons/react": "^2.2.0",
|
"@heroicons/react": "^2.2.0",
|
||||||
"@number-flow/react": "^0.5.5",
|
"@number-flow/react": "^0.5.5",
|
||||||
"@radix-ui/react-dialog": "^1.1.6",
|
"@radix-ui/react-dialog": "^1.1.5",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.1.6",
|
"@radix-ui/react-dropdown-menu": "^2.1.5",
|
||||||
"@radix-ui/react-label": "^2.1.2",
|
"@radix-ui/react-label": "^2.1.1",
|
||||||
"@radix-ui/react-navigation-menu": "^1.2.5",
|
"@radix-ui/react-navigation-menu": "^1.2.4",
|
||||||
"@radix-ui/react-popover": "^1.1.6",
|
"@radix-ui/react-popover": "^1.1.5",
|
||||||
"@radix-ui/react-progress": "^1.1.2",
|
"@radix-ui/react-progress": "^1.1.1",
|
||||||
"@radix-ui/react-separator": "^1.1.2",
|
"@radix-ui/react-separator": "^1.1.1",
|
||||||
"@radix-ui/react-slot": "^1.1.2",
|
"@radix-ui/react-slot": "^1.1.1",
|
||||||
"@radix-ui/react-switch": "^1.1.3",
|
"@radix-ui/react-switch": "^1.1.2",
|
||||||
"@radix-ui/react-tooltip": "^1.1.8",
|
"@radix-ui/react-tooltip": "^1.1.7",
|
||||||
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
||||||
"@types/crypto-js": "^4.2.2",
|
|
||||||
"@types/d3-geo": "^3.1.0",
|
"@types/d3-geo": "^3.1.0",
|
||||||
"@types/luxon": "^3.4.2",
|
"@types/luxon": "^3.4.2",
|
||||||
"babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
|
"babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
|
||||||
"caniuse-lite": "^1.0.30001698",
|
"caniuse-lite": "^1.0.30001697",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cmdk": "^1.0.4",
|
"cmdk": "^1.0.4",
|
||||||
"country-flag-icons": "^1.5.16",
|
"country-flag-icons": "^1.5.14",
|
||||||
"crypto-js": "^4.2.0",
|
|
||||||
"d3-geo": "^3.1.1",
|
"d3-geo": "^3.1.1",
|
||||||
"d3-selection": "^3.0.0",
|
"d3-selection": "^3.0.0",
|
||||||
"flag-icons": "^7.3.2",
|
"flag-icons": "^7.3.2",
|
||||||
@ -56,19 +54,19 @@
|
|||||||
"react-wrap-balancer": "^1.1.1",
|
"react-wrap-balancer": "^1.1.1",
|
||||||
"recharts": "^2.15.1",
|
"recharts": "^2.15.1",
|
||||||
"sharp": "^0.33.5",
|
"sharp": "^0.33.5",
|
||||||
"swr": "^2.3.2",
|
"swr": "^2.3.1",
|
||||||
"tailwind-merge": "^2.6.0",
|
"tailwind-merge": "^2.6.0",
|
||||||
"tailwindcss-animate": "^1.0.7"
|
"tailwindcss-animate": "^1.0.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.9.4",
|
"@biomejs/biome": "1.9.4",
|
||||||
"@next/bundle-analyzer": "^15.1.6",
|
"@next/bundle-analyzer": "^15.1.6",
|
||||||
"@tailwindcss/postcss": "^4.0.4",
|
"@tailwindcss/postcss": "^4.0.3",
|
||||||
"@types/node": "^22.13.1",
|
"@types/node": "^22.13.1",
|
||||||
"@types/react": "^19.0.8",
|
"@types/react": "^19.0.8",
|
||||||
"@types/react-dom": "^19.0.3",
|
"@types/react-dom": "^19.0.3",
|
||||||
"postcss": "^8.5.1",
|
"postcss": "^8.5.1",
|
||||||
"tailwindcss": "^4.0.4",
|
"tailwindcss": "^4.0.3",
|
||||||
"typescript": "^5.7.3",
|
"typescript": "^5.7.3",
|
||||||
"vercel": "^39.4.2"
|
"vercel": "^39.4.2"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user