update
10
.github/workflows/ci.yml
vendored
@ -12,6 +12,7 @@ concurrency:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_PLATFORMS: linux/amd64,linux/arm64
|
BUILD_PLATFORMS: linux/amd64,linux/arm64
|
||||||
|
DOCKERHUB_SLUG: shahradel/wireadmin
|
||||||
GHCR_SLUG: ghcr.io/wireadmin/wireadmin
|
GHCR_SLUG: ghcr.io/wireadmin/wireadmin
|
||||||
TAG: dev
|
TAG: dev
|
||||||
|
|
||||||
@ -38,6 +39,13 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@ -55,4 +63,4 @@ jobs:
|
|||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
platforms: '${{ env.BUILD_PLATFORMS }}'
|
platforms: '${{ env.BUILD_PLATFORMS }}'
|
||||||
tags: '${{ env.GHCR_SLUG }}:${{ env.TAG }}'
|
tags: "${{ env.GHCR_SLUG }}:${{ env.TAG }},${{ env.DOCKERHUB_SLUG }}:${{ env.TAG }}"
|
||||||
|
13
.github/workflows/release.yaml
vendored
@ -8,6 +8,7 @@ on:
|
|||||||
concurrency: '${{ github.workflow }}-${{ github.ref }}'
|
concurrency: '${{ github.workflow }}-${{ github.ref }}'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
DOCKERHUB_SLUG: shahradel/wireadmin
|
||||||
GHCR_SLUG: ghcr.io/wireadmin/wireadmin
|
GHCR_SLUG: ghcr.io/wireadmin/wireadmin
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -54,6 +55,12 @@ jobs:
|
|||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
- uses: docker/setup-qemu-action@v3
|
- uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@ -81,9 +88,13 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
|
|
||||||
- name: Check manifest
|
- name: Check manifest
|
||||||
run: docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
run: |
|
||||||
|
docker buildx imagetools inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
|
||||||
|
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||||
|
|
||||||
- name: Inspect image
|
- name: Inspect image
|
||||||
run: |
|
run: |
|
||||||
|
docker pull ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
|
||||||
|
docker image inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }}
|
||||||
docker pull ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
docker pull ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||||
docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"importOrder": ["<THIRD_PARTY_MODULES>", "", "^types$", "^@lib/(.*)$", "^@/(.*)$", "", "^[./]"],
|
"importOrder": ["<THIRD_PARTY_MODULES>", "", "^types$", "^\\$lib/(.*)$", "^@/(.*)$", "", "^[./]"],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@ianvs/prettier-plugin-sort-imports",
|
"@ianvs/prettier-plugin-sort-imports",
|
||||||
"prettier-plugin-tailwindcss",
|
"prettier-plugin-tailwindcss",
|
||||||
|
@ -24,7 +24,7 @@ RUN apk update \
|
|||||||
make \
|
make \
|
||||||
&& rm -rf /var/cache/apk/*
|
&& rm -rf /var/cache/apk/*
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
RUN <<EOT
|
RUN << EOT
|
||||||
set -ex
|
set -ex
|
||||||
cd /tmp
|
cd /tmp
|
||||||
|
|
||||||
|
37
README.md
@ -39,10 +39,12 @@
|
|||||||
|
|
||||||
| Registry | Image |
|
| Registry | Image |
|
||||||
| ------------------------------------------------------------------------------------------------------- | ----------------------------- |
|
| ------------------------------------------------------------------------------------------------------- | ----------------------------- |
|
||||||
|
| [Docker Hub](https://hub.docker.com/r/shahradel/wireadmin/) | `shahradel/wireadmin` |
|
||||||
| [GitHub Container Registry](https://github.com/users/shahradelahi/packages/container/package/cfw-proxy) | `ghcr.io/wireadmin/wireadmin` |
|
| [GitHub Container Registry](https://github.com/users/shahradelahi/packages/container/package/cfw-proxy) | `ghcr.io/wireadmin/wireadmin` |
|
||||||
|
|
||||||
## Ports
|
## Ports
|
||||||
|
|
||||||
|
- `53`: Dnsmasq
|
||||||
- `3000`: WebUI
|
- `3000`: WebUI
|
||||||
|
|
||||||
And for any additional ports of WireGuard instance, should be exposed through Docker.
|
And for any additional ports of WireGuard instance, should be exposed through Docker.
|
||||||
@ -64,15 +66,15 @@ docker compose logs -f
|
|||||||
```shell
|
```shell
|
||||||
$ docker run -d \
|
$ docker run -d \
|
||||||
--name wireadmin \
|
--name wireadmin \
|
||||||
-e WG_HOST= \
|
-e WG_HOST="<YOUR_SERVER_IP>" \
|
||||||
ADMIN_PASSWORD= \
|
-e ADMIN_PASSWORD="<ADMIN_PASSWORD>" \
|
||||||
"3000:3000/tcp" \
|
-p "3000:3000/tcp" \
|
||||||
-p "51820:51820/udp" \
|
-p "51820:51820/udp" \
|
||||||
--cap-add=NET_ADMIN \
|
--cap-add=NET_ADMIN \
|
||||||
--cap-add=SYS_MODULE \
|
--cap-add=SYS_MODULE \
|
||||||
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
|
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
|
||||||
--sysctl="net.ipv4.ip_forward=1" \
|
--sysctl="net.ipv4.ip_forward=1" \
|
||||||
ghcr.io/wireadmin/wireadmin < YOUR_SERVER_IP > -e < ADMIN_PASSWORD > -p
|
ghcr.io/wireadmin/wireadmin
|
||||||
```
|
```
|
||||||
|
|
||||||
> 💡 Replace `<YOUR_SERVER_IP>` with the IP address of your server.
|
> 💡 Replace `<YOUR_SERVER_IP>` with the IP address of your server.
|
||||||
@ -83,13 +85,26 @@ The Web UI will now be available on `http://0.0.0.0:3000`.
|
|||||||
|
|
||||||
### Persistent Data
|
### Persistent Data
|
||||||
|
|
||||||
WireAdmin store configurations at `/data`. It's important to mount a volume at this location to ensure that
|
It's important to mount a volume to ensure that your data is not lost during container restarts or updates. Here is the list of required volumes:
|
||||||
your data is not lost during container restarts or updates.
|
|
||||||
|
- `wireadmin-data`: `/data`
|
||||||
|
- `tor-data`: `/var/lib/tor`
|
||||||
|
|
||||||
To create a docker volume, use the following command:
|
To create a docker volume, use the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker volume create wireadmin-data --driver local
|
$ docker volume create "<volume>" --driver local
|
||||||
|
```
|
||||||
|
|
||||||
|
> 💡 Replace `<volume>` with the name of the volume.
|
||||||
|
|
||||||
|
Finally, to mount the volumes with `-v` flag in the `docker run` command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ docker run -d \
|
||||||
|
-v wireadmin-data:/data \
|
||||||
|
-v tor-data:/var/lib/tor \
|
||||||
|
ghcr.io/wireadmin/wireadmin
|
||||||
```
|
```
|
||||||
|
|
||||||
### Environment variables
|
### Environment variables
|
||||||
@ -99,7 +114,7 @@ These options can be configured by setting environment variables using `-e KEY="
|
|||||||
| Option | Description | Default | Optional |
|
| Option | Description | Default | Optional |
|
||||||
| ----------------- | ----------------------------------------------------------------------------------- | ------------------- | -------- |
|
| ----------------- | ----------------------------------------------------------------------------------- | ------------------- | -------- |
|
||||||
| `WG_HOST` | The public IP address of the WireGuard server. | - | |
|
| `WG_HOST` | The public IP address of the WireGuard server. | - | |
|
||||||
| `ADMIN_PASSWORD` | The password for the admin UI. | `insecure-password` | |
|
| `ADMIN_PASSWORD` | The password for the web UI. | `insecure-password` | |
|
||||||
| `HOST` | The hostname for the WebUI. | `127.0.0.1` | ✔️ |
|
| `HOST` | The hostname for the WebUI. | `127.0.0.1` | ✔️ |
|
||||||
| `PORT` | The port for the WebUI. | `3000` | ✔️ |
|
| `PORT` | The port for the WebUI. | `3000` | ✔️ |
|
||||||
| `TOR_USE_BRIDGES` | Set this to `1` and then mount the bridges file at `/etc/tor/torrc.d/bridges.conf`. | - | ✔️ |
|
| `TOR_USE_BRIDGES` | Set this to `1` and then mount the bridges file at `/etc/tor/torrc.d/bridges.conf`. | - | ✔️ |
|
||||||
@ -110,14 +125,14 @@ These options can be configured by setting environment variables using `-e KEY="
|
|||||||
Recreate the container whenever I push an update:
|
Recreate the container whenever I push an update:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose pull
|
$ docker compose pull
|
||||||
docker compose up -d
|
$ docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Want to contribute? Awesome! To show your support is to star the project, or to raise issues
|
Want to contribute? Awesome! To show your support is to star the project, or to raise issues
|
||||||
on [GitHub](https://github.com/shahradelahi/docker-cfw-proxy).
|
on [GitHub](https://github.com/wireadmin/wireadmin)
|
||||||
|
|
||||||
Thanks again for your support, it is much appreciated! 🙏
|
Thanks again for your support, it is much appreciated! 🙏
|
||||||
|
|
||||||
|
BIN
assets/screenshot-1.png
Normal file → Executable file
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 65 KiB |
BIN
assets/screenshot-2.png
Normal file → Executable file
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 77 KiB |
BIN
assets/screenshot-3.png
Normal file → Executable file
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 62 KiB |
BIN
assets/screenshot-4.png
Normal file → Executable file
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 56 KiB |
@ -7,7 +7,7 @@
|
|||||||
"baseColor": "gray"
|
"baseColor": "gray"
|
||||||
},
|
},
|
||||||
"aliases": {
|
"aliases": {
|
||||||
"components": "@lib/components",
|
"components": "$lib/components",
|
||||||
"utils": "@lib/utils"
|
"utils": "$lib/utils"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,9 @@ import 'dotenv/config';
|
|||||||
|
|
||||||
import { redirect, type Handle } from '@sveltejs/kit';
|
import { redirect, type Handle } from '@sveltejs/kit';
|
||||||
|
|
||||||
import { verifyToken } from '@lib/auth';
|
import { verifyToken } from '$lib/auth';
|
||||||
import { AUTH_COOKIE } from '@lib/constants';
|
import { AUTH_COOKIE } from '$lib/constants';
|
||||||
import logger from '@lib/logger';
|
import logger from '$lib/logger';
|
||||||
|
|
||||||
export const handle: Handle = async ({ event, resolve }) => {
|
export const handle: Handle = async ({ event, resolve }) => {
|
||||||
logger.debug(`-> ${event.request.method} ${event.url.pathname}`);
|
logger.debug(`-> ${event.request.method} ${event.url.pathname}`);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import jwt from 'jsonwebtoken';
|
import jwt from 'jsonwebtoken';
|
||||||
|
|
||||||
import { WG_AUTH_PATH } from '@lib/constants';
|
import { WG_AUTH_PATH } from '$lib/constants';
|
||||||
import { env } from '@lib/env';
|
import { env } from '$lib/env';
|
||||||
import { storage } from '@lib/storage';
|
import { storage } from '$lib/storage';
|
||||||
import { sha256 } from '@lib/utils/hash';
|
import { sha256 } from '$lib/utils/hash';
|
||||||
|
|
||||||
interface GenerateTokenParams {
|
interface GenerateTokenParams {
|
||||||
expiresIn: number;
|
expiresIn: number;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import { ClipboardCopyIcon } from 'lucide-svelte';
|
import { ClipboardCopyIcon } from 'lucide-svelte';
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
|
|
||||||
export let showInHover: boolean = false;
|
export let showInHover: boolean = false;
|
||||||
export let rootClass: string | undefined = undefined;
|
export let rootClass: string | undefined = undefined;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
import type { ZodEffects, ZodString } from 'zod';
|
import type { ZodEffects, ZodString } from 'zod';
|
||||||
import { SquarePenIcon } from 'lucide-svelte';
|
import { SquarePenIcon } from 'lucide-svelte';
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
|
|
||||||
export let editMode: boolean = false;
|
export let editMode: boolean = false;
|
||||||
export let schema: ZodString | ZodEffects<any>;
|
export let schema: ZodString | ZodEffects<any>;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLDivElement>;
|
type $$Props = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { mode } from 'mode-watcher';
|
import { mode } from 'mode-watcher';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<SVGImageElement> & {
|
type $$Props = HTMLAttributes<SVGImageElement> & {
|
||||||
borderColor?: string;
|
borderColor?: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import { EmptyDescription, EmptySimpleImage, type Props } from '.';
|
import { EmptyDescription, EmptySimpleImage, type Props } from '.';
|
||||||
|
|
||||||
type $$Props = Props;
|
type $$Props = Props;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Icon from '@lib/components/iconset/icon.svelte';
|
import Icon from '$lib/components/iconset/icon.svelte';
|
||||||
import type { Props } from '@lib/components/iconset';
|
import type { Props } from '$lib/components/iconset';
|
||||||
|
|
||||||
type $$Props = Props;
|
type $$Props = Props;
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
export let name: string | undefined = undefined;
|
export let name: string | undefined = undefined;
|
||||||
export let color = 'currentColor';
|
export let color = 'currentColor';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Icon from '@lib/components/iconset/icon.svelte';
|
import Icon from '$lib/components/iconset/icon.svelte';
|
||||||
import type { Props } from '@lib/components/iconset';
|
import type { Props } from '$lib/components/iconset';
|
||||||
|
|
||||||
type $$Props = Props;
|
type $$Props = Props;
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
export let content: string;
|
export let content: string;
|
||||||
export let maxLength: number = Math.floor(content.length / 2);
|
export let maxLength: number = Math.floor(content.length / 2);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import PageFooter from '@lib/components/page/PageFooter.svelte';
|
import PageFooter from '$lib/components/page/PageFooter.svelte';
|
||||||
import PageHeader from '@lib/components/page/PageHeader.svelte';
|
import PageHeader from '$lib/components/page/PageHeader.svelte';
|
||||||
|
|
||||||
export let rootClass: string | undefined = undefined;
|
export let rootClass: string | undefined = undefined;
|
||||||
let className: string | undefined = undefined;
|
let className: string | undefined = undefined;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import DotDivider from '@lib/components/DotDivider.svelte';
|
import DotDivider from '$lib/components/DotDivider.svelte';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<footer class={'flex items-center justify-center'}>
|
<footer class={'flex items-center justify-center'}>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import Moon from 'lucide-svelte/icons/moon';
|
import Moon from 'lucide-svelte/icons/moon';
|
||||||
|
|
||||||
import { toggleMode } from 'mode-watcher';
|
import { toggleMode } from 'mode-watcher';
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import { LogOutIcon } from 'lucide-svelte';
|
import { LogOutIcon } from 'lucide-svelte';
|
||||||
|
|
||||||
export let showLogout: boolean = false;
|
export let showLogout: boolean = false;
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from '@lib/components/ui/dialog';
|
} from '$lib/components/ui/dialog';
|
||||||
import { Skeleton } from '@lib/components/ui/skeleton';
|
import { Skeleton } from '$lib/components/ui/skeleton';
|
||||||
import { Dialog as DialogPrimitive } from 'bits-ui';
|
import { Dialog as DialogPrimitive } from 'bits-ui';
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import type { SafeReturn } from '@lib/typings';
|
import type { SafeReturn } from '$lib/typings';
|
||||||
|
|
||||||
const DialogClose = DialogPrimitive.Close;
|
const DialogClose = DialogPrimitive.Close;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import { badgeVariants, type Variant } from '.';
|
import { badgeVariants, type Variant } from '.';
|
||||||
|
|
||||||
let className: string | undefined | null = undefined;
|
let className: string | undefined | null = undefined;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Ellipsis from 'lucide-svelte/icons/ellipsis';
|
import Ellipsis from 'lucide-svelte/icons/ellipsis';
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLSpanElement> & {
|
type $$Props = HTMLAttributes<HTMLSpanElement> & {
|
||||||
el?: HTMLSpanElement;
|
el?: HTMLSpanElement;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLLiAttributes } from 'svelte/elements';
|
import type { HTMLLiAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = HTMLLiAttributes & {
|
type $$Props = HTMLLiAttributes & {
|
||||||
el?: HTMLLIElement;
|
el?: HTMLLIElement;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = HTMLAnchorAttributes & {
|
type $$Props = HTMLAnchorAttributes & {
|
||||||
el?: HTMLAnchorElement;
|
el?: HTMLAnchorElement;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLOlAttributes } from 'svelte/elements';
|
import type { HTMLOlAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = HTMLOlAttributes & {
|
type $$Props = HTMLOlAttributes & {
|
||||||
el?: HTMLOListElement;
|
el?: HTMLOListElement;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLSpanElement> & {
|
type $$Props = HTMLAttributes<HTMLSpanElement> & {
|
||||||
el?: HTMLSpanElement;
|
el?: HTMLSpanElement;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLLiAttributes } from 'svelte/elements';
|
import type { HTMLLiAttributes } from 'svelte/elements';
|
||||||
import ChevronRight from 'lucide-svelte/icons/chevron-right';
|
import ChevronRight from 'lucide-svelte/icons/chevron-right';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = HTMLLiAttributes & {
|
type $$Props = HTMLLiAttributes & {
|
||||||
el?: HTMLLIElement;
|
el?: HTMLLIElement;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Button as ButtonPrimitive } from 'bits-ui';
|
import { Button as ButtonPrimitive } from 'bits-ui';
|
||||||
import { type Events, type Props, buttonVariants } from './index';
|
import { type Events, type Props, buttonVariants } from './index';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = Props;
|
type $$Props = Props;
|
||||||
type $$Events = Events;
|
type $$Events = Events;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLDivElement>;
|
type $$Props = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLParagraphElement>;
|
type $$Props = HTMLAttributes<HTMLParagraphElement>;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLDivElement>;
|
type $$Props = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLDivElement>;
|
type $$Props = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import type { HeadingLevel } from './index.js';
|
import type { HeadingLevel } from './index.js';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLHeadingElement> & {
|
type $$Props = HTMLAttributes<HTMLHeadingElement> & {
|
||||||
tag?: HeadingLevel;
|
tag?: HeadingLevel;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLDivElement>;
|
type $$Props = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { Checkbox as CheckboxPrimitive } from 'bits-ui';
|
import { Checkbox as CheckboxPrimitive } from 'bits-ui';
|
||||||
import Check from 'lucide-svelte/icons/check';
|
import Check from 'lucide-svelte/icons/check';
|
||||||
import Minus from 'lucide-svelte/icons/minus';
|
import Minus from 'lucide-svelte/icons/minus';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = CheckboxPrimitive.Props;
|
type $$Props = CheckboxPrimitive.Props;
|
||||||
type $$Events = CheckboxPrimitive.Events;
|
type $$Events = CheckboxPrimitive.Events;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Dialog as DialogPrimitive } from 'bits-ui';
|
import { Dialog as DialogPrimitive } from 'bits-ui';
|
||||||
import * as Dialog from '.';
|
import * as Dialog from '.';
|
||||||
import { cn, flyAndScale } from '@lib/utils';
|
import { cn, flyAndScale } from '$lib/utils';
|
||||||
import { X } from 'lucide-svelte';
|
import { X } from 'lucide-svelte';
|
||||||
|
|
||||||
type $$Props = DialogPrimitive.ContentProps;
|
type $$Props = DialogPrimitive.ContentProps;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Dialog as DialogPrimitive } from 'bits-ui';
|
import { Dialog as DialogPrimitive } from 'bits-ui';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = DialogPrimitive.DescriptionProps;
|
type $$Props = DialogPrimitive.DescriptionProps;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLDivElement>;
|
type $$Props = HTMLAttributes<HTMLDivElement>;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLDivElement>;
|
type $$Props = HTMLAttributes<HTMLDivElement>;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Dialog as DialogPrimitive } from 'bits-ui';
|
import { Dialog as DialogPrimitive } from 'bits-ui';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
|
|
||||||
type $$Props = DialogPrimitive.OverlayProps;
|
type $$Props = DialogPrimitive.OverlayProps;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Dialog as DialogPrimitive } from 'bits-ui';
|
import { Dialog as DialogPrimitive } from 'bits-ui';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = DialogPrimitive.TitleProps;
|
type $$Props = DialogPrimitive.TitleProps;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import * as Button from '@lib/components/ui/button/index.js';
|
import * as Button from '$lib/components/ui/button/index.js';
|
||||||
|
|
||||||
type $$Props = Button.Props;
|
type $$Props = Button.Props;
|
||||||
type $$Events = Button.Events;
|
type $$Events = Button.Events;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import * as FormPrimitive from 'formsnap';
|
import * as FormPrimitive from 'formsnap';
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLSpanElement>;
|
type $$Props = HTMLAttributes<HTMLSpanElement>;
|
||||||
let className: string | undefined | null = undefined;
|
let className: string | undefined | null = undefined;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPathLeaves<T>">
|
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPathLeaves<T>">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import * as FormPrimitive from 'formsnap';
|
import * as FormPrimitive from 'formsnap';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = FormPrimitive.ElementFieldProps<T, U> & HTMLAttributes<HTMLElement>;
|
type $$Props = FormPrimitive.ElementFieldProps<T, U> & HTMLAttributes<HTMLElement>;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import * as FormPrimitive from 'formsnap';
|
import * as FormPrimitive from 'formsnap';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = FormPrimitive.FieldErrorsProps & {
|
type $$Props = FormPrimitive.FieldErrorsProps & {
|
||||||
errorClasses?: string | undefined | null;
|
errorClasses?: string | undefined | null;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
|
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import * as FormPrimitive from 'formsnap';
|
import * as FormPrimitive from 'formsnap';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = FormPrimitive.FieldProps<T, U> & HTMLAttributes<HTMLElement>;
|
type $$Props = FormPrimitive.FieldProps<T, U> & HTMLAttributes<HTMLElement>;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
|
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
|
||||||
import * as FormPrimitive from 'formsnap';
|
import * as FormPrimitive from 'formsnap';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = FormPrimitive.FieldsetProps<T, U>;
|
type $$Props = FormPrimitive.FieldsetProps<T, U>;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Label as LabelPrimitive } from 'bits-ui';
|
import type { Label as LabelPrimitive } from 'bits-ui';
|
||||||
import { getFormControl } from 'formsnap';
|
import { getFormControl } from 'formsnap';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
import { Label } from '@lib/components/ui/label/index.js';
|
import { Label } from '$lib/components/ui/label/index.js';
|
||||||
|
|
||||||
type $$Props = LabelPrimitive.Props;
|
type $$Props = LabelPrimitive.Props;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import * as FormPrimitive from 'formsnap';
|
import * as FormPrimitive from 'formsnap';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = FormPrimitive.LegendProps;
|
type $$Props = FormPrimitive.LegendProps;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLInputAttributes } from 'svelte/elements';
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import type { InputEvents } from '.';
|
import type { InputEvents } from '.';
|
||||||
|
|
||||||
type $$Props = HTMLInputAttributes;
|
type $$Props = HTMLInputAttributes;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Label as LabelPrimitive } from 'bits-ui';
|
import { Label as LabelPrimitive } from 'bits-ui';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = LabelPrimitive.Props;
|
type $$Props = LabelPrimitive.Props;
|
||||||
type $$Events = LabelPrimitive.Events;
|
type $$Events = LabelPrimitive.Events;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { RadioGroup as RadioGroupPrimitive } from 'bits-ui';
|
import { RadioGroup as RadioGroupPrimitive } from 'bits-ui';
|
||||||
import { Circle } from 'lucide-svelte';
|
import { Circle } from 'lucide-svelte';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = RadioGroupPrimitive.ItemProps;
|
type $$Props = RadioGroupPrimitive.ItemProps;
|
||||||
type $$Events = RadioGroupPrimitive.ItemEvents;
|
type $$Events = RadioGroupPrimitive.ItemEvents;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { RadioGroup as RadioGroupPrimitive } from 'bits-ui';
|
import { RadioGroup as RadioGroupPrimitive } from 'bits-ui';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = RadioGroupPrimitive.Props;
|
type $$Props = RadioGroupPrimitive.Props;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Select as SelectPrimitive } from 'bits-ui';
|
import { Select as SelectPrimitive } from 'bits-ui';
|
||||||
import { scale } from 'svelte/transition';
|
import { scale } from 'svelte/transition';
|
||||||
import { cn, flyAndScale } from '@lib/utils';
|
import { cn, flyAndScale } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = SelectPrimitive.ContentProps;
|
type $$Props = SelectPrimitive.ContentProps;
|
||||||
type $$Events = SelectPrimitive.ContentEvents;
|
type $$Events = SelectPrimitive.ContentEvents;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Check from 'lucide-svelte/icons/check';
|
import Check from 'lucide-svelte/icons/check';
|
||||||
import { Select as SelectPrimitive } from 'bits-ui';
|
import { Select as SelectPrimitive } from 'bits-ui';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = SelectPrimitive.ItemProps;
|
type $$Props = SelectPrimitive.ItemProps;
|
||||||
type $$Events = SelectPrimitive.ItemEvents;
|
type $$Events = SelectPrimitive.ItemEvents;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Select as SelectPrimitive } from 'bits-ui';
|
import { Select as SelectPrimitive } from 'bits-ui';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = SelectPrimitive.LabelProps;
|
type $$Props = SelectPrimitive.LabelProps;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Select as SelectPrimitive } from 'bits-ui';
|
import { Select as SelectPrimitive } from 'bits-ui';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = SelectPrimitive.SeparatorProps;
|
type $$Props = SelectPrimitive.SeparatorProps;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Select as SelectPrimitive } from 'bits-ui';
|
import { Select as SelectPrimitive } from 'bits-ui';
|
||||||
import ChevronDown from 'lucide-svelte/icons/chevron-down';
|
import ChevronDown from 'lucide-svelte/icons/chevron-down';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = SelectPrimitive.TriggerProps;
|
type $$Props = SelectPrimitive.TriggerProps;
|
||||||
type $$Events = SelectPrimitive.TriggerEvents;
|
type $$Events = SelectPrimitive.TriggerEvents;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import type { HTMLAttributes } from 'svelte/elements';
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLDivElement>;
|
type $$Props = HTMLAttributes<HTMLDivElement>;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Switch as SwitchPrimitive } from 'bits-ui';
|
import { Switch as SwitchPrimitive } from 'bits-ui';
|
||||||
import { cn } from '@lib/utils.js';
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = SwitchPrimitive.Props;
|
type $$Props = SwitchPrimitive.Props;
|
||||||
type $$Events = SwitchPrimitive.Events;
|
type $$Events = SwitchPrimitive.Events;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
type $$Props = HTMLTextareaAttributes;
|
type $$Props = HTMLTextareaAttributes;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { randomUUID } from 'node:crypto';
|
|||||||
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/utils/hash';
|
import { sha256 } from '$lib/utils/hash';
|
||||||
|
|
||||||
export const env = createEnv({
|
export const env = createEnv({
|
||||||
runtimeEnv: process.env,
|
runtimeEnv: process.env,
|
||||||
|
@ -4,8 +4,8 @@ import { trySafe } from 'p-safe';
|
|||||||
import pino, { type Logger, type LoggerOptions } from 'pino';
|
import pino, { type Logger, type LoggerOptions } from 'pino';
|
||||||
import pretty from 'pino-pretty';
|
import pretty from 'pino-pretty';
|
||||||
|
|
||||||
import { env } from '@lib/env';
|
import { env } from '$lib/env';
|
||||||
import { fsAccess } from '@lib/utils/fs-extra';
|
import { fsAccess } from '$lib/utils/fs-extra';
|
||||||
|
|
||||||
const options: LoggerOptions = {
|
const options: LoggerOptions = {
|
||||||
level: env.LOG_LEVEL,
|
level: env.LOG_LEVEL,
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { promises } from 'node:fs';
|
import { promises } from 'node:fs';
|
||||||
import { execa } from 'execa';
|
import { execa } from 'execa';
|
||||||
|
|
||||||
import logger from '@lib/logger';
|
import logger from '$lib/logger';
|
||||||
import { fsTouch } from '@lib/utils/fs-extra';
|
import { fsTouch } from '$lib/utils/fs-extra';
|
||||||
|
|
||||||
export const SERVICES = <const>{
|
export const SERVICES = <const>{
|
||||||
tor: {
|
tor: {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { Client, HashMap, MSGPack } from 'storage-box';
|
import { Client, HashMap, MSGPack } from 'storage-box';
|
||||||
import { FsDriver } from 'storage-box/node';
|
import { FsDriver } from 'storage-box/node';
|
||||||
|
|
||||||
import { WG_SEVER_PATH } from '@lib/constants';
|
import { WG_SEVER_PATH } from '$lib/constants';
|
||||||
import { env } from '@lib/env';
|
import { env } from '$lib/env';
|
||||||
import logger from '@lib/logger';
|
import logger from '$lib/logger';
|
||||||
import type { WgServer } from '@lib/typings';
|
import type { WgServer } from '$lib/typings';
|
||||||
import { isJson } from '@lib/utils';
|
import { isJson } from '$lib/utils';
|
||||||
|
|
||||||
const driver = new FsDriver(env.STORAGE_PATH, { parser: MSGPack });
|
const driver = new FsDriver(env.STORAGE_PATH, { parser: MSGPack });
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { IPV4_REGEX } from 'node-netkit/ip';
|
import { IPV4_REGEX } from 'node-netkit/ip';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
import { NameSchema, TorSchema } from '@lib/wireguard/schema';
|
import { NameSchema, TorSchema } from '$lib/wireguard/schema';
|
||||||
|
|
||||||
export const WgKeySchema = z.object({
|
export const WgKeySchema = z.object({
|
||||||
privateKey: z.string(),
|
privateKey: z.string(),
|
||||||
|
@ -4,15 +4,15 @@ import deepmerge from 'deepmerge';
|
|||||||
import { execa } from 'execa';
|
import { execa } from 'execa';
|
||||||
import { ip } from 'node-netkit';
|
import { ip } from 'node-netkit';
|
||||||
|
|
||||||
import { WG_PATH } from '@lib/constants';
|
import { WG_PATH } from '$lib/constants';
|
||||||
import logger from '@lib/logger';
|
import logger from '$lib/logger';
|
||||||
import Network from '@lib/network';
|
import Network from '$lib/network';
|
||||||
import { WG_STORE } from '@lib/storage';
|
import { WG_STORE } from '$lib/storage';
|
||||||
import type { Peer, WgKey, WgServer } from '@lib/typings';
|
import type { Peer, WgKey, WgServer } from '$lib/typings';
|
||||||
import { dynaJoin, sleep } from '@lib/utils';
|
import { dynaJoin, sleep } from '$lib/utils';
|
||||||
import { fsAccess } from '@lib/utils/fs-extra';
|
import { fsAccess } from '$lib/utils/fs-extra';
|
||||||
import { sha256 } from '@lib/utils/hash';
|
import { sha256 } from '$lib/utils/hash';
|
||||||
import { getPeerConf } from '@lib/wireguard/utils';
|
import { getPeerConf } from '$lib/wireguard/utils';
|
||||||
|
|
||||||
export class WGServer {
|
export class WGServer {
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
import { IPV4_REGEX, isPrivateIP } from '@lib/utils/ip';
|
import { IPV4_REGEX, isPrivateIP } from '$lib/utils/ip';
|
||||||
import { isBetween } from '@lib/utils/number';
|
import { isBetween } from '$lib/utils/number';
|
||||||
|
|
||||||
export const NameSchema = z
|
export const NameSchema = z
|
||||||
.string()
|
.string()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { WgServer } from '@lib/typings';
|
import type { WgServer } from '$lib/typings';
|
||||||
|
|
||||||
type Peer = WgServer['peers'][0];
|
type Peer = WgServer['peers'][0];
|
||||||
|
|
||||||
|
@ -2,10 +2,10 @@ import { error, fail, type Actions } from '@sveltejs/kit';
|
|||||||
import { setError, superValidate } from 'sveltekit-superforms';
|
import { setError, superValidate } from 'sveltekit-superforms';
|
||||||
import { zod } from 'sveltekit-superforms/adapters';
|
import { zod } from 'sveltekit-superforms/adapters';
|
||||||
|
|
||||||
import logger, { errorBox } from '@lib/logger';
|
import logger, { errorBox } from '$lib/logger';
|
||||||
import { WG_STORE } from '@lib/storage';
|
import { WG_STORE } from '$lib/storage';
|
||||||
import { generateWgServer, isIPReserved, isPortReserved, WGServer } from '@lib/wireguard';
|
import { generateWgServer, isIPReserved, isPortReserved, WGServer } from '$lib/wireguard';
|
||||||
import { NameSchema } from '@lib/wireguard/schema';
|
import { NameSchema } from '$lib/wireguard/schema';
|
||||||
|
|
||||||
import type { PageServerLoad } from './$types';
|
import type { PageServerLoad } from './$types';
|
||||||
import { createServerSchema } from './schema';
|
import { createServerSchema } from './schema';
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import BasePage from '@lib/components/page/BasePage.svelte';
|
import BasePage from '$lib/components/page/BasePage.svelte';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@lib/components/ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from '$lib/components/ui/card';
|
||||||
import Service from './Service.svelte';
|
import Service from './Service.svelte';
|
||||||
import { Empty } from '@lib/components/empty';
|
import { Empty } from '$lib/components/empty';
|
||||||
import Server from './Server.svelte';
|
import Server from './Server.svelte';
|
||||||
import fetchAction from '@lib/utils/fetch-action';
|
import fetchAction from '$lib/utils/fetch-action';
|
||||||
import CreateServerDialog from './CreateServerDialog.svelte';
|
import CreateServerDialog from './CreateServerDialog.svelte';
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import { PlusIcon } from 'lucide-svelte';
|
import { PlusIcon } from 'lucide-svelte';
|
||||||
import { DnsmasqIcon, OnionIcon } from '@lib/components/iconset';
|
import { DnsmasqIcon, OnionIcon } from '$lib/components/iconset';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from '@lib/components/ui/dialog';
|
} from '$lib/components/ui/dialog';
|
||||||
import {
|
import {
|
||||||
FormButton,
|
FormButton,
|
||||||
FormControl,
|
FormControl,
|
||||||
@ -16,18 +16,18 @@
|
|||||||
FormField,
|
FormField,
|
||||||
FormFieldErrors,
|
FormFieldErrors,
|
||||||
FormLabel,
|
FormLabel,
|
||||||
} from '@lib/components/ui/form';
|
} from '$lib/components/ui/form';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import {
|
import {
|
||||||
Collapsible,
|
Collapsible,
|
||||||
CollapsibleContent,
|
CollapsibleContent,
|
||||||
CollapsibleTrigger,
|
CollapsibleTrigger,
|
||||||
} from '@lib/components/ui/collapsible';
|
} from '$lib/components/ui/collapsible';
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import toast from 'svelte-french-toast';
|
import toast from 'svelte-french-toast';
|
||||||
import { Input } from '@lib/components/ui/input';
|
import { Input } from '$lib/components/ui/input';
|
||||||
import { zodClient } from 'sveltekit-superforms/adapters';
|
import { zodClient } from 'sveltekit-superforms/adapters';
|
||||||
import { Switch } from '@lib/components/ui/switch';
|
import { Switch } from '$lib/components/ui/switch';
|
||||||
import { ChevronRightIcon, LoaderCircle } from 'lucide-svelte';
|
import { ChevronRightIcon, LoaderCircle } from 'lucide-svelte';
|
||||||
|
|
||||||
let dialogOpen = false;
|
let dialogOpen = false;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import type { WgServer } from '@lib/typings';
|
import type { WgServer } from '$lib/typings';
|
||||||
import { EditableText } from '@lib/components/editable-text';
|
import { EditableText } from '$lib/components/editable-text';
|
||||||
import { CopiableText } from '@lib/components/copiable-text';
|
import { CopiableText } from '$lib/components/copiable-text';
|
||||||
import { NameSchema } from '@lib/wireguard/schema';
|
import { NameSchema } from '$lib/wireguard/schema';
|
||||||
import { Badge } from '@lib/components/ui/badge';
|
import { Badge } from '$lib/components/ui/badge';
|
||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import { LayersIcon } from 'lucide-svelte';
|
import { LayersIcon } from 'lucide-svelte';
|
||||||
import { OnionIcon } from '@lib/components/iconset';
|
import { OnionIcon } from '$lib/components/iconset';
|
||||||
|
|
||||||
export let server: WgServer;
|
export let server: WgServer;
|
||||||
export let addressPort: string = `${server.address}:${server.listen}`;
|
export let addressPort: string = `${server.address}:${server.listen}`;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import { Badge } from '@lib/components/ui/badge';
|
import { Badge } from '$lib/components/ui/badge';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { LoaderCircle } from 'lucide-svelte';
|
import { LoaderCircle } from 'lucide-svelte';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@lib/components/ui/card';
|
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '$lib/components/ui/card';
|
||||||
import { Empty } from '@lib/components/empty';
|
import { Empty } from '$lib/components/empty';
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import BasePage from '@lib/components/page/BasePage.svelte';
|
import BasePage from '$lib/components/page/BasePage.svelte';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<BasePage showLogout={true}>
|
<BasePage showLogout={true}>
|
||||||
|
@ -2,10 +2,10 @@ import { error, redirect, type Actions } from '@sveltejs/kit';
|
|||||||
import { setError, superValidate } from 'sveltekit-superforms';
|
import { setError, superValidate } from 'sveltekit-superforms';
|
||||||
import { zod } from 'sveltekit-superforms/adapters';
|
import { zod } from 'sveltekit-superforms/adapters';
|
||||||
|
|
||||||
import logger, { errorBox } from '@lib/logger';
|
import logger, { errorBox } from '$lib/logger';
|
||||||
import { WG_STORE } from '@lib/storage';
|
import { WG_STORE } from '$lib/storage';
|
||||||
import { generateWgKey, WGServer } from '@lib/wireguard';
|
import { generateWgKey, WGServer } from '$lib/wireguard';
|
||||||
import { NameSchema } from '@lib/wireguard/schema';
|
import { NameSchema } from '$lib/wireguard/schema';
|
||||||
|
|
||||||
import type { PageServerLoad } from './$types';
|
import type { PageServerLoad } from './$types';
|
||||||
import { createPeerSchema } from './schema';
|
import { createPeerSchema } from './schema';
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import CreatePeerDialog from './CreatePeerDialog.svelte';
|
import CreatePeerDialog from './CreatePeerDialog.svelte';
|
||||||
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@lib/components/ui/card';
|
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '$lib/components/ui/card';
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import Peer from './Peer.svelte';
|
import Peer from './Peer.svelte';
|
||||||
import fetchAction from '@lib/utils/fetch-action';
|
import fetchAction from '$lib/utils/fetch-action';
|
||||||
import DetailRow from './DetailRow.svelte';
|
import DetailRow from './DetailRow.svelte';
|
||||||
import { Badge } from '@lib/components/ui/badge';
|
import { Badge } from '$lib/components/ui/badge';
|
||||||
import { CopiableText } from '@lib/components/copiable-text';
|
import { CopiableText } from '$lib/components/copiable-text';
|
||||||
import { MiddleEllipsis } from '@lib/components/middle-ellipsis';
|
import { MiddleEllipsis } from '$lib/components/middle-ellipsis';
|
||||||
import { goto, invalidateAll } from '$app/navigation';
|
import { goto, invalidateAll } from '$app/navigation';
|
||||||
import { Empty } from '@lib/components/empty';
|
import { Empty } from '$lib/components/empty';
|
||||||
import prettyBytes from 'pretty-bytes';
|
import prettyBytes from 'pretty-bytes';
|
||||||
import { onDestroy } from 'svelte';
|
import { onDestroy } from 'svelte';
|
||||||
import {
|
import {
|
||||||
@ -20,7 +20,7 @@
|
|||||||
BreadcrumbList,
|
BreadcrumbList,
|
||||||
BreadcrumbPage,
|
BreadcrumbPage,
|
||||||
BreadcrumbSeparator,
|
BreadcrumbSeparator,
|
||||||
} from '@lib/components/ui/breadcrumb';
|
} from '$lib/components/ui/breadcrumb';
|
||||||
import { ArrowUpIcon } from 'lucide-svelte';
|
import { ArrowUpIcon } from 'lucide-svelte';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
@ -8,19 +8,19 @@
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from '@lib/components/ui/dialog';
|
} from '$lib/components/ui/dialog';
|
||||||
import {
|
import {
|
||||||
FormButton,
|
FormButton,
|
||||||
FormControl,
|
FormControl,
|
||||||
FormField,
|
FormField,
|
||||||
FormFieldErrors,
|
FormFieldErrors,
|
||||||
FormLabel,
|
FormLabel,
|
||||||
} from '@lib/components/ui/form';
|
} from '$lib/components/ui/form';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import { invalidateAll } from '$app/navigation';
|
import { invalidateAll } from '$app/navigation';
|
||||||
import toast from 'svelte-french-toast';
|
import toast from 'svelte-french-toast';
|
||||||
import { zodClient } from 'sveltekit-superforms/adapters';
|
import { zodClient } from 'sveltekit-superforms/adapters';
|
||||||
import { Input } from '@lib/components/ui/input';
|
import { Input } from '$lib/components/ui/input';
|
||||||
import { LoaderCircle } from 'lucide-svelte';
|
import { LoaderCircle } from 'lucide-svelte';
|
||||||
|
|
||||||
let loading: boolean = false;
|
let loading: boolean = false;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
export let label: string;
|
export let label: string;
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Peer, WgServer } from '@lib/typings';
|
import type { Peer, WgServer } from '$lib/typings';
|
||||||
import { CopiableText } from '@lib/components/copiable-text';
|
import { CopiableText } from '$lib/components/copiable-text';
|
||||||
import { EditableText } from '@lib/components/editable-text';
|
import { EditableText } from '$lib/components/editable-text';
|
||||||
import { NameSchema } from '@lib/wireguard/schema';
|
import { NameSchema } from '$lib/wireguard/schema';
|
||||||
import PeerActionButton from './PeerActionButton.svelte';
|
import PeerActionButton from './PeerActionButton.svelte';
|
||||||
import { createEventDispatcher, onMount } from 'svelte';
|
import { createEventDispatcher, onMount } from 'svelte';
|
||||||
import { getPeerConf } from '@lib/wireguard/utils';
|
import { getPeerConf } from '$lib/wireguard/utils';
|
||||||
import { QRCodeDialog } from '@lib/components/qrcode-dialog';
|
import { QRCodeDialog } from '$lib/components/qrcode-dialog';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import { DownloadIcon, QrCodeIcon, Trash2Icon, UserIcon } from 'lucide-svelte';
|
import { DownloadIcon, QrCodeIcon, Trash2Icon, UserIcon } from 'lucide-svelte';
|
||||||
|
|
||||||
export let peer: Peer;
|
export let peer: Peer;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
import { Button } from 'bits-ui';
|
import { Button } from 'bits-ui';
|
||||||
import { LoaderCircle } from 'lucide-svelte';
|
import { LoaderCircle } from 'lucide-svelte';
|
||||||
import { FormButton } from '@lib/components/ui/form';
|
import { FormButton } from '$lib/components/ui/form';
|
||||||
|
|
||||||
type $$Props = Button.Props & {
|
type $$Props = Button.Props & {
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
import { NameSchema } from '@lib/wireguard/schema';
|
import { NameSchema } from '$lib/wireguard/schema';
|
||||||
|
|
||||||
export const createPeerSchema = z.object({
|
export const createPeerSchema = z.object({
|
||||||
name: NameSchema,
|
name: NameSchema,
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
|
|
||||||
import { errorBox } from '@lib/logger';
|
import { errorBox } from '$lib/logger';
|
||||||
import { WG_STORE } from '@lib/storage';
|
import { WG_STORE } from '$lib/storage';
|
||||||
import { WGServer } from '@lib/wireguard';
|
import { WGServer } from '$lib/wireguard';
|
||||||
|
|
||||||
export const GET: RequestHandler = async () => {
|
export const GET: RequestHandler = async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { json, type RequestHandler } from '@sveltejs/kit';
|
import { json, type RequestHandler } from '@sveltejs/kit';
|
||||||
|
|
||||||
import { errorBox } from '@lib/logger';
|
import { errorBox } from '$lib/logger';
|
||||||
import { getService } from '@lib/services';
|
import { getService } from '$lib/services';
|
||||||
|
|
||||||
export const GET: RequestHandler = async ({ params }) => {
|
export const GET: RequestHandler = async ({ params }) => {
|
||||||
try {
|
try {
|
||||||
|
@ -3,7 +3,7 @@ import 'dotenv/config';
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { execa } from 'execa';
|
import { execa } from 'execa';
|
||||||
|
|
||||||
import logger from '@lib/logger';
|
import logger from '$lib/logger';
|
||||||
|
|
||||||
export const GET: RequestHandler = async () => {
|
export const GET: RequestHandler = async () => {
|
||||||
let { WG_HOST } = process.env;
|
let { WG_HOST } = process.env;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import PageFooter from '@lib/components/page/PageFooter.svelte';
|
import PageFooter from '$lib/components/page/PageFooter.svelte';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class={'w-full min-h-screen flex justify-center px-2 md:px-6 py-2'}>
|
<div class={'w-full min-h-screen flex justify-center px-2 md:px-6 py-2'}>
|
||||||
|
@ -2,11 +2,11 @@ import { error, fail, type Actions } from '@sveltejs/kit';
|
|||||||
import { setError, superValidate } from 'sveltekit-superforms';
|
import { setError, superValidate } from 'sveltekit-superforms';
|
||||||
import { zod } from 'sveltekit-superforms/adapters';
|
import { zod } from 'sveltekit-superforms/adapters';
|
||||||
|
|
||||||
import { generateToken } from '@lib/auth';
|
import { generateToken } from '$lib/auth';
|
||||||
import { AUTH_COOKIE } from '@lib/constants';
|
import { AUTH_COOKIE } from '$lib/constants';
|
||||||
import { env } from '@lib/env';
|
import { env } from '$lib/env';
|
||||||
import logger, { errorBox } from '@lib/logger';
|
import logger, { errorBox } from '$lib/logger';
|
||||||
import { sha256 } from '@lib/utils/hash';
|
import { sha256 } from '$lib/utils/hash';
|
||||||
|
|
||||||
import type { PageServerLoad } from './$types';
|
import type { PageServerLoad } from './$types';
|
||||||
import { formSchema } from './schema';
|
import { formSchema } from './schema';
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { formSchema, type FormSchema } from './schema';
|
import { formSchema, type FormSchema } from './schema';
|
||||||
import { type Infer, superForm, type SuperValidated } from 'sveltekit-superforms';
|
import { type Infer, superForm, type SuperValidated } from 'sveltekit-superforms';
|
||||||
import { Card, CardContent } from '@lib/components/ui/card';
|
import { Card, CardContent } from '$lib/components/ui/card';
|
||||||
import {
|
import {
|
||||||
FormButton,
|
FormButton,
|
||||||
FormControl,
|
FormControl,
|
||||||
FormField,
|
FormField,
|
||||||
FormFieldErrors,
|
FormFieldErrors,
|
||||||
FormLabel,
|
FormLabel,
|
||||||
} from '@lib/components/ui/form';
|
} from '$lib/components/ui/form';
|
||||||
import { zodClient } from 'sveltekit-superforms/adapters';
|
import { zodClient } from 'sveltekit-superforms/adapters';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { Input } from '@lib/components/ui/input';
|
import { Input } from '$lib/components/ui/input';
|
||||||
import { LoaderCircle, UserIcon } from 'lucide-svelte';
|
import { LoaderCircle, UserIcon } from 'lucide-svelte';
|
||||||
import { cn } from '@lib/utils';
|
import { cn } from '$lib/utils';
|
||||||
|
|
||||||
export let data: SuperValidated<Infer<FormSchema>>;
|
export let data: SuperValidated<Infer<FormSchema>>;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
import { revokeToken } from '@lib/auth';
|
import { revokeToken } from '$lib/auth';
|
||||||
import { AUTH_COOKIE } from '@lib/constants';
|
import { AUTH_COOKIE } from '$lib/constants';
|
||||||
|
|
||||||
import type { PageServerLoad } from './$types';
|
import type { PageServerLoad } from './$types';
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
NameSchema,
|
NameSchema,
|
||||||
PortSchema,
|
PortSchema,
|
||||||
TorSchema,
|
TorSchema,
|
||||||
} from '@lib/wireguard/schema';
|
} from '$lib/wireguard/schema';
|
||||||
|
|
||||||
export const createServerSchema = z.object({
|
export const createServerSchema = z.object({
|
||||||
name: NameSchema,
|
name: NameSchema,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { error, type Actions } from '@sveltejs/kit';
|
import { error, type Actions } from '@sveltejs/kit';
|
||||||
|
|
||||||
import logger, { errorBox } from '@lib/logger';
|
import logger, { errorBox } from '$lib/logger';
|
||||||
import { clearLogs, getService, logs, restart, type ServiceName } from '@lib/services';
|
import { clearLogs, getService, logs, restart, type ServiceName } from '$lib/services';
|
||||||
|
|
||||||
import type { PageServerLoad } from './$types';
|
import type { PageServerLoad } from './$types';
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@lib/components/ui/card';
|
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '$lib/components/ui/card';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import fetchAction from '@lib/utils/fetch-action';
|
import fetchAction from '$lib/utils/fetch-action';
|
||||||
import { Button } from '@lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import toast from 'svelte-french-toast';
|
import toast from 'svelte-french-toast';
|
||||||
import { LoaderCircle } from 'lucide-svelte';
|
import { LoaderCircle } from 'lucide-svelte';
|
||||||
import {
|
import {
|
||||||
@ -13,9 +13,9 @@
|
|||||||
BreadcrumbList,
|
BreadcrumbList,
|
||||||
BreadcrumbPage,
|
BreadcrumbPage,
|
||||||
BreadcrumbSeparator,
|
BreadcrumbSeparator,
|
||||||
} from '@lib/components/ui/breadcrumb';
|
} from '$lib/components/ui/breadcrumb';
|
||||||
import BasePage from '@lib/components/page/BasePage.svelte';
|
import BasePage from '$lib/components/page/BasePage.svelte';
|
||||||
import { Checkbox } from '@lib/components/ui/checkbox';
|
import { Checkbox } from '$lib/components/ui/checkbox';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
|