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