diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 0a96884..0000000 --- a/Dockerfile +++ /dev/null @@ -1,77 +0,0 @@ -# Build stage -FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.21-alpine3.19 AS builder -LABEL maintainer="Khanh Ngo " - -ARG BUILDPLATFORM -ARG TARGETOS -ARG TARGETARCH -ARG APP_VERSION=dev -ARG BUILD_TIME -ARG GIT_COMMIT - -ARG BUILD_DEPENDENCIES="npm \ - yarn" - -# Get dependencies -RUN apk add --update --no-cache ${BUILD_DEPENDENCIES} - -WORKDIR /build - -# Add dependencies -COPY go.mod /build -COPY go.sum /build -COPY package.json /build -COPY yarn.lock /build - -# Prepare assets -RUN yarn install --pure-lockfile --production && \ - yarn cache clean - -# Move admin-lte dist -RUN mkdir -p assets/dist/js assets/dist/css && \ - cp /build/node_modules/admin-lte/dist/js/adminlte.min.js \ - assets/dist/js/adminlte.min.js && \ - cp /build/node_modules/admin-lte/dist/css/adminlte.min.css \ - assets/dist/css/adminlte.min.css - -# Move plugin assets -RUN mkdir -p assets/plugins && \ - cp -r /build/node_modules/admin-lte/plugins/jquery/ \ - /build/node_modules/admin-lte/plugins/fontawesome-free/ \ - /build/node_modules/admin-lte/plugins/bootstrap/ \ - /build/node_modules/admin-lte/plugins/icheck-bootstrap/ \ - /build/node_modules/admin-lte/plugins/toastr/ \ - /build/node_modules/admin-lte/plugins/jquery-validation/ \ - /build/node_modules/admin-lte/plugins/select2/ \ - /build/node_modules/jquery-tags-input/ \ - assets/plugins/ - -# Add sources -COPY . /build - -# Move custom assets -RUN cp -r /build/custom/ assets/ - -# Build -RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-X 'main.appVersion=${APP_VERSION}' -X 'main.buildTime=${BUILD_TIME}' -X 'main.gitCommit=${GIT_COMMIT}'" -a -o wg-ui . - -# Release stage -FROM alpine:3.19 - -RUN addgroup -S wgui && \ - adduser -S -D -G wgui wgui - -RUN apk --no-cache add ca-certificates wireguard-tools jq iptables - -WORKDIR /app - -RUN mkdir -p db - -# Copy binary files -COPY --from=builder --chown=wgui:wgui /build/wg-ui . -RUN chmod +x wg-ui -COPY init.sh . -RUN chmod +x init.sh - -EXPOSE 5000/tcp -ENTRYPOINT ["./init.sh"] diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index a7d49c0..0000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,27 +0,0 @@ -version: "3" - -services: - wg: - build: . - #image: ngoduykhanh/wireguard-ui:latest - container_name: wgui - cap_add: - - NET_ADMIN - network_mode: host - environment: - - SENDGRID_API_KEY - - EMAIL_FROM_ADDRESS - - EMAIL_FROM_NAME - - SESSION_SECRET - - WGUI_USERNAME=alpha - - WGUI_PASSWORD=this-unusual-password - - WG_CONF_TEMPLATE - - WGUI_MANAGE_START=false - - WGUI_MANAGE_RESTART=false - logging: - driver: json-file - options: - max-size: 50m - volumes: - - ./db:/app/db - - /etc/wireguard:/etc/wireguard diff --git a/examples/docker-compose/README.md b/examples/docker-compose/README.md deleted file mode 100644 index 951df08..0000000 --- a/examples/docker-compose/README.md +++ /dev/null @@ -1,30 +0,0 @@ -## Prerequisites - -### Kernel Module - -Depending on if the Wireguard kernel module is available on your system you have more or less choices which example to use. - -You can check if the kernel modules are available via the following command: -```shell -modprobe wireguard -``` - -If the command exits successfully and doesn't print an error the kernel modules are available. -If it does error, you either have to install them manually (or activate if deactivated) or use an userspace implementation. -For an example of an userspace implementation, see _borigtun_. - -### Credentials - -Username and password for all examples is `admin` by default. -For security reasons it's highly recommended to change them before the first startup. - -## Examples -- **[system](system.yml)** - - If you have Wireguard already installed on your system and only want to run the UI in docker this might fit the most. -- **[linuxserver](linuxserver.yml)** - - If you have the Wireguard kernel modules installed (included in the mainline kernel since version 5.6) but want it running inside of docker, this might fit the most. -- **[boringtun](boringtun.yml)** - - If Wireguard kernel modules are not available, you can switch to an userspace implementation like [boringtun](https://github.com/cloudflare/boringtun). diff --git a/examples/docker-compose/boringtun.yml b/examples/docker-compose/boringtun.yml deleted file mode 100644 index a1bdd2f..0000000 --- a/examples/docker-compose/boringtun.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: "3" - -services: - boringtun: - image: ghcr.io/ntkme/boringtun:edge - command: - - wg0 - container_name: boringtun - # use the network of the 'wireguard-ui' service. this enables to show active clients in the status page - network_mode: service:wireguard-ui - cap_add: - - NET_ADMIN - volumes: - - /dev/net/tun:/dev/net/tun - - ./config:/etc/wireguard - - wireguard-ui: - image: ngoduykhanh/wireguard-ui:latest - container_name: wireguard-ui - cap_add: - - NET_ADMIN - environment: - - SENDGRID_API_KEY - - EMAIL_FROM_ADDRESS - - EMAIL_FROM_NAME - - SESSION_SECRET - - WGUI_USERNAME=admin - - WGUI_PASSWORD=admin - - WG_CONF_TEMPLATE - - WGUI_MANAGE_START=true - - WGUI_MANAGE_RESTART=true - logging: - driver: json-file - options: - max-size: 50m - volumes: - - ./db:/app/db - - ./config:/etc/wireguard - ports: - # port for wireguard-ui - - "5000:5000" - # port of the wireguard server. this must be set here as the `boringtun` container joins the network of this container and hasn't its own network over which it could publish the ports - - "51820:51820/udp" diff --git a/examples/docker-compose/linuxserver.yml b/examples/docker-compose/linuxserver.yml deleted file mode 100644 index 1b7a66f..0000000 --- a/examples/docker-compose/linuxserver.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: "3" - -services: - wireguard: - image: linuxserver/wireguard:latest - container_name: wireguard - cap_add: - - NET_ADMIN - volumes: - - ./config:/config - ports: - # port for wireguard-ui. this must be set here as the `wireguard-ui` container joins the network of this container and hasn't its own network over which it could publish the ports - - "5000:5000" - # port of the wireguard server - - "51820:51820/udp" - - wireguard-ui: - image: ngoduykhanh/wireguard-ui:latest - container_name: wireguard-ui - depends_on: - - wireguard - cap_add: - - NET_ADMIN - # use the network of the 'wireguard' service. this enables to show active clients in the status page - network_mode: service:wireguard - environment: - - SENDGRID_API_KEY - - EMAIL_FROM_ADDRESS - - EMAIL_FROM_NAME - - SESSION_SECRET - - WGUI_USERNAME=admin - - WGUI_PASSWORD=admin - - WG_CONF_TEMPLATE - - WGUI_MANAGE_START=true - - WGUI_MANAGE_RESTART=true - logging: - driver: json-file - options: - max-size: 50m - volumes: - - ./db:/app/db - - ./config:/etc/wireguard diff --git a/examples/docker-compose/system.yml b/examples/docker-compose/system.yml deleted file mode 100644 index c27f31e..0000000 --- a/examples/docker-compose/system.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: "3" - -services: - wireguard-ui: - image: ngoduykhanh/wireguard-ui:latest - container_name: wireguard-ui - cap_add: - - NET_ADMIN - # required to show active clients. with this set, you don't need to expose the ui port (5000) anymore - network_mode: host - environment: - - SENDGRID_API_KEY - - EMAIL_FROM_ADDRESS - - EMAIL_FROM_NAME - - SESSION_SECRET - - WGUI_USERNAME=admin - - WGUI_PASSWORD=admin - - WG_CONF_TEMPLATE - - WGUI_MANAGE_START=false - - WGUI_MANAGE_RESTART=false - logging: - driver: json-file - options: - max-size: 50m - volumes: - - ./db:/app/db - - /etc/wireguard:/etc/wireguard