mirror of
https://github.com/wireadmin/wireadmin
synced 2025-06-26 18:28:06 +00:00
fix
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import { createEnv } from '@t3-oss/env-core';
|
||||
import { z } from 'zod';
|
||||
import { sha256 } from '$lib/hash';
|
||||
import { hex, sha256 } from '$lib/hash';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import 'dotenv/config';
|
||||
|
||||
export const env = createEnv({
|
||||
runtimeEnv: process.env,
|
||||
server: {
|
||||
NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
|
||||
STORAGE_PATH: z.string().default('/data/storage.pack'),
|
||||
AUTH_SECRET: z.string().default(sha256(randomUUID())),
|
||||
HASHED_PASSWORD: z.string(),
|
||||
HASHED_PASSWORD: z.string().default(hex('insecure-password')),
|
||||
ORIGIN: z.string().optional(),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -5,3 +5,7 @@ export function sha256(data: Buffer | string): string {
|
||||
hash.update(data);
|
||||
return hash.digest('hex');
|
||||
}
|
||||
|
||||
export function hex(data: Buffer | string): string {
|
||||
return Buffer.from(data).toString('hex');
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<Input placeholder={'e.g. 1.1.1.1'} type={'text'} />
|
||||
</FormControl>
|
||||
<FormDescription
|
||||
>Optional. This is the DNS server that will be pushed to clients.</FormDescription
|
||||
>Optional. This is the DNS server that will be pushed to clients.</FormDescription
|
||||
>
|
||||
<FormFieldErrors />
|
||||
</FormField>
|
||||
|
||||
Reference in New Issue
Block a user