mirror of
https://github.com/wireadmin/wireadmin
synced 2025-02-26 05:48:44 +00:00
fix
This commit is contained in:
parent
d87ba2fc6a
commit
100eeb84ad
12
Dockerfile
12
Dockerfile
@ -1,7 +1,9 @@
|
|||||||
ARG ALPINE_VERSION=3.19
|
ARG ALPINE_VERSION=3.19
|
||||||
|
ARG NODE_VERSION=20
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM chriswayg/tor-alpine:latest as tor
|
FROM --platform=$BUILDPLATFORM chriswayg/tor-alpine:latest as tor
|
||||||
FROM --platform=$BUILDPLATFORM node:alpine${ALPINE_VERSION} as base
|
|
||||||
|
FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-alpine${ALPINE_VERSION} as base
|
||||||
LABEL Maintainer="Shahrad Elahi <https://github.com/shahradelahi>"
|
LABEL Maintainer="Shahrad Elahi <https://github.com/shahradelahi>"
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -11,10 +13,8 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|||||||
COPY --from=tor /usr/local/bin/obfs4proxy /usr/local/bin/obfs4proxy
|
COPY --from=tor /usr/local/bin/obfs4proxy /usr/local/bin/obfs4proxy
|
||||||
COPY --from=tor /usr/local/bin/meek-server /usr/local/bin/meek-server
|
COPY --from=tor /usr/local/bin/meek-server /usr/local/bin/meek-server
|
||||||
|
|
||||||
# Update and upgrade packages
|
# Install required packages
|
||||||
RUN apk update && apk upgrade &&\
|
RUN apk add -U --no-cache \
|
||||||
# Install required packages
|
|
||||||
apk add -U --no-cache \
|
|
||||||
iproute2 iptables net-tools \
|
iproute2 iptables net-tools \
|
||||||
screen curl bash \
|
screen curl bash \
|
||||||
wireguard-tools \
|
wireguard-tools \
|
||||||
@ -48,6 +48,8 @@ COPY web .
|
|||||||
|
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile \
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile \
|
||||||
# build
|
# build
|
||||||
|
&& mkdir -p /data \
|
||||||
|
&& echo gA== > /data/storage.b64 \
|
||||||
&& NODE_ENV=production pnpm run build \
|
&& NODE_ENV=production pnpm run build \
|
||||||
# Omit devDependencies
|
# Omit devDependencies
|
||||||
&& pnpm prune --prod \
|
&& pnpm prune --prod \
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
ARG ALPINE_VERSION=3.19
|
ARG ALPINE_VERSION=3.19
|
||||||
|
ARG NODE_VERSION=20
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM chriswayg/tor-alpine:latest as tor
|
FROM --platform=$BUILDPLATFORM chriswayg/tor-alpine:latest as tor
|
||||||
FROM --platform=$BUILDPLATFORM node:alpine${ALPINE_VERSION} as base
|
|
||||||
|
FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-alpine${ALPINE_VERSION} as base
|
||||||
LABEL Maintainer="Shahrad Elahi <https://github.com/shahradelahi>"
|
LABEL Maintainer="Shahrad Elahi <https://github.com/shahradelahi>"
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -11,10 +13,8 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|||||||
COPY --from=tor /usr/local/bin/obfs4proxy /usr/local/bin/obfs4proxy
|
COPY --from=tor /usr/local/bin/obfs4proxy /usr/local/bin/obfs4proxy
|
||||||
COPY --from=tor /usr/local/bin/meek-server /usr/local/bin/meek-server
|
COPY --from=tor /usr/local/bin/meek-server /usr/local/bin/meek-server
|
||||||
|
|
||||||
# Update and upgrade packages
|
# Install required packages
|
||||||
RUN apk update && apk upgrade &&\
|
RUN apk add -U --no-cache \
|
||||||
# Install required packages
|
|
||||||
apk add -U --no-cache \
|
|
||||||
iproute2 iptables net-tools \
|
iproute2 iptables net-tools \
|
||||||
screen vim curl bash \
|
screen vim curl bash \
|
||||||
wireguard-tools \
|
wireguard-tools \
|
||||||
@ -63,4 +63,4 @@ VOLUME ["/etc/torrc.d", "/data", "/var/vlogs"]
|
|||||||
|
|
||||||
# Run the app
|
# Run the app
|
||||||
EXPOSE 5173/tcp
|
EXPOSE 5173/tcp
|
||||||
CMD [ "npm", "run", "dev", "--", "--host" ]
|
CMD [ "npm", "run", "dev", "--", "--host" ]
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import { createEnv } from '@t3-oss/env-core';
|
import { createEnv } from '@t3-oss/env-core';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { sha256 } from '$lib/hash';
|
import { hex, sha256 } from '$lib/hash';
|
||||||
import { randomUUID } from 'node:crypto';
|
import { randomUUID } from 'node:crypto';
|
||||||
import 'dotenv/config';
|
import 'dotenv/config';
|
||||||
|
|
||||||
export const env = createEnv({
|
export const env = createEnv({
|
||||||
runtimeEnv: process.env,
|
runtimeEnv: process.env,
|
||||||
server: {
|
server: {
|
||||||
|
NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
|
||||||
STORAGE_PATH: z.string().default('/data/storage.pack'),
|
STORAGE_PATH: z.string().default('/data/storage.pack'),
|
||||||
AUTH_SECRET: z.string().default(sha256(randomUUID())),
|
AUTH_SECRET: z.string().default(sha256(randomUUID())),
|
||||||
HASHED_PASSWORD: z.string(),
|
HASHED_PASSWORD: z.string().default(hex('insecure-password')),
|
||||||
ORIGIN: z.string().optional(),
|
ORIGIN: z.string().optional(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -5,3 +5,7 @@ export function sha256(data: Buffer | string): string {
|
|||||||
hash.update(data);
|
hash.update(data);
|
||||||
return hash.digest('hex');
|
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'} />
|
<Input placeholder={'e.g. 1.1.1.1'} type={'text'} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription
|
<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 />
|
<FormFieldErrors />
|
||||||
</FormField>
|
</FormField>
|
||||||
|
Loading…
Reference in New Issue
Block a user