diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab8c080..c609541 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ concurrency: env: BUILD_PLATFORMS: linux/amd64,linux/arm64 + DOCKERHUB_SLUG: shahradel/wireadmin GHCR_SLUG: ghcr.io/wireadmin/wireadmin TAG: dev @@ -38,6 +39,13 @@ jobs: - uses: actions/checkout@v4 - 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 if: github.event_name != 'pull_request' uses: docker/login-action@v3 @@ -55,4 +63,4 @@ jobs: file: ./Dockerfile push: ${{ github.event_name != 'pull_request' }} platforms: '${{ env.BUILD_PLATFORMS }}' - tags: '${{ env.GHCR_SLUG }}:${{ env.TAG }}' + tags: "${{ env.GHCR_SLUG }}:${{ env.TAG }},${{ env.DOCKERHUB_SLUG }}:${{ env.TAG }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 10027d7..a424262 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,6 +8,7 @@ on: concurrency: '${{ github.workflow }}-${{ github.ref }}' env: + DOCKERHUB_SLUG: shahradel/wireadmin GHCR_SLUG: ghcr.io/wireadmin/wireadmin jobs: @@ -54,6 +55,12 @@ jobs: - uses: docker/setup-buildx-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 uses: docker/login-action@v3 with: @@ -81,9 +88,13 @@ jobs: push: true - 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 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 image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }} diff --git a/.prettierrc b/.prettierrc index 3b72a48..bf01dfd 100644 --- a/.prettierrc +++ b/.prettierrc @@ -23,7 +23,7 @@ } } ], - "importOrder": ["", "", "^types$", "^@lib/(.*)$", "^@/(.*)$", "", "^[./]"], + "importOrder": ["", "", "^types$", "^\\$lib/(.*)$", "^@/(.*)$", "", "^[./]"], "plugins": [ "@ianvs/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss", diff --git a/Dockerfile b/Dockerfile index 9dca165..a4d0bb6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ RUN apk update \ make \ && rm -rf /var/cache/apk/* SHELL ["/bin/bash", "-c"] -RUN < -e < ADMIN_PASSWORD > -p + ghcr.io/wireadmin/wireadmin ``` > 💡 Replace `` 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 -WireAdmin store configurations at `/data`. It's important to mount a volume at this location to ensure that -your data is not lost during container restarts or updates. +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: + +- `wireadmin-data`: `/data` +- `tor-data`: `/var/lib/tor` To create a docker volume, use the following command: ```bash -docker volume create wireadmin-data --driver local +$ docker volume create "" --driver local +``` + +> 💡 Replace `` 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 @@ -99,7 +114,7 @@ These options can be configured by setting environment variables using `-e KEY=" | Option | Description | Default | Optional | | ----------------- | ----------------------------------------------------------------------------------- | ------------------- | -------- | | `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` | ✔️ | | `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`. | - | ✔️ | @@ -110,14 +125,14 @@ These options can be configured by setting environment variables using `-e KEY=" Recreate the container whenever I push an update: ```bash -docker compose pull -docker compose up -d +$ docker compose pull +$ docker compose up -d ``` ## Contributing 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! 🙏 diff --git a/assets/screenshot-1.png b/assets/screenshot-1.png old mode 100644 new mode 100755 index c22e6af..52dcea8 Binary files a/assets/screenshot-1.png and b/assets/screenshot-1.png differ diff --git a/assets/screenshot-2.png b/assets/screenshot-2.png old mode 100644 new mode 100755 index 4e85299..95eb903 Binary files a/assets/screenshot-2.png and b/assets/screenshot-2.png differ diff --git a/assets/screenshot-3.png b/assets/screenshot-3.png old mode 100644 new mode 100755 index 26efabe..c0cf08a Binary files a/assets/screenshot-3.png and b/assets/screenshot-3.png differ diff --git a/assets/screenshot-4.png b/assets/screenshot-4.png old mode 100644 new mode 100755 index a866bdb..2e6164c Binary files a/assets/screenshot-4.png and b/assets/screenshot-4.png differ diff --git a/web/components.json b/web/components.json index 515e06b..11239e6 100644 --- a/web/components.json +++ b/web/components.json @@ -7,7 +7,7 @@ "baseColor": "gray" }, "aliases": { - "components": "@lib/components", - "utils": "@lib/utils" + "components": "$lib/components", + "utils": "$lib/utils" } } diff --git a/web/src/hooks.server.ts b/web/src/hooks.server.ts index f437b42..6a2e2ac 100644 --- a/web/src/hooks.server.ts +++ b/web/src/hooks.server.ts @@ -2,9 +2,9 @@ import 'dotenv/config'; import { redirect, type Handle } from '@sveltejs/kit'; -import { verifyToken } from '@lib/auth'; -import { AUTH_COOKIE } from '@lib/constants'; -import logger from '@lib/logger'; +import { verifyToken } from '$lib/auth'; +import { AUTH_COOKIE } from '$lib/constants'; +import logger from '$lib/logger'; export const handle: Handle = async ({ event, resolve }) => { logger.debug(`-> ${event.request.method} ${event.url.pathname}`); diff --git a/web/src/lib/auth.ts b/web/src/lib/auth.ts index 669f2d1..d12f6ff 100644 --- a/web/src/lib/auth.ts +++ b/web/src/lib/auth.ts @@ -1,9 +1,9 @@ import jwt from 'jsonwebtoken'; -import { WG_AUTH_PATH } from '@lib/constants'; -import { env } from '@lib/env'; -import { storage } from '@lib/storage'; -import { sha256 } from '@lib/utils/hash'; +import { WG_AUTH_PATH } from '$lib/constants'; +import { env } from '$lib/env'; +import { storage } from '$lib/storage'; +import { sha256 } from '$lib/utils/hash'; interface GenerateTokenParams { expiresIn: number; diff --git a/web/src/lib/components/copiable-text/CopiableText.svelte b/web/src/lib/components/copiable-text/CopiableText.svelte index 19fe248..5aae502 100644 --- a/web/src/lib/components/copiable-text/CopiableText.svelte +++ b/web/src/lib/components/copiable-text/CopiableText.svelte @@ -1,7 +1,7 @@ diff --git a/web/src/lib/components/iconset/icon.svelte b/web/src/lib/components/iconset/icon.svelte index 20a43f5..41b640a 100644 --- a/web/src/lib/components/iconset/icon.svelte +++ b/web/src/lib/components/iconset/icon.svelte @@ -1,5 +1,5 @@ diff --git a/web/src/lib/components/middle-ellipsis/MiddleEllipsis.svelte b/web/src/lib/components/middle-ellipsis/MiddleEllipsis.svelte index 81320ce..16d2f42 100644 --- a/web/src/lib/components/middle-ellipsis/MiddleEllipsis.svelte +++ b/web/src/lib/components/middle-ellipsis/MiddleEllipsis.svelte @@ -1,5 +1,5 @@