feat: migrate to wg-portal2

This commit is contained in:
fedorHub 2025-08-28 15:14:23 +02:00
parent b44c19bb8c
commit b9bcf0e4ce
No known key found for this signature in database
GPG Key ID: 7FDE5B4177850E7D
109 changed files with 368 additions and 280 deletions

34
.github/workflows/release.yaml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Weekly release
on:
schedule:
- cron: 0 8 * * 1
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- run: |
npm install -g semantic-release@23.0.4 \
@semantic-release/commit-analyzer@12.0.0 \
@semantic-release/release-notes-generator@12.1.0 \
@semantic-release/changelog@6.0.3 \
@semantic-release/github@10.0.2 \
@semantic-release/git@10.0.1 \
@saithodev/semantic-release-backmerge@4.0.1 \
conventional-changelog-conventionalcommits
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -3,7 +3,7 @@
<module name="wg-portal" /> <module name="wg-portal" />
<working_directory value="$PROJECT_DIR$" /> <working_directory value="$PROJECT_DIR$" />
<kind value="PACKAGE" /> <kind value="PACKAGE" />
<package value="github.com/h44z/wg-portal/cmd/api_build_tool" /> <package value="github.com/fedor-git/wg-portal-2/cmd/api_build_tool" />
<directory value="$PROJECT_DIR$" /> <directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$/internal/ports/api/build_tool/main.go" /> <filePath value="$PROJECT_DIR$/internal/ports/api/build_tool/main.go" />
<method v="2" /> <method v="2" />

View File

@ -9,7 +9,7 @@
</envs> </envs>
<sudo value="true" /> <sudo value="true" />
<kind value="PACKAGE" /> <kind value="PACKAGE" />
<package value="github.com/h44z/wg-portal/cmd/wg-portal" /> <package value="github.com/fedor-git/wg-portal-2/cmd/wg-portal" />
<directory value="$PROJECT_DIR$" /> <directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$/cmd/wg-portal/main.go" /> <filePath value="$PROJECT_DIR$/cmd/wg-portal/main.go" />
<method v="2" /> <method v="2" />

View File

@ -8,7 +8,7 @@
</envs> </envs>
<sudo value="true" /> <sudo value="true" />
<kind value="PACKAGE" /> <kind value="PACKAGE" />
<package value="github.com/h44z/wg-portal/cmd/wg-portal" /> <package value="github.com/fedor-git/wg-portal-2/cmd/wg-portal" />
<directory value="$PROJECT_DIR$" /> <directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$/cmd/wg-portal/main.go" /> <filePath value="$PROJECT_DIR$/cmd/wg-portal/main.go" />
<method v="2" /> <method v="2" />

View File

@ -37,7 +37,7 @@ ARG BUILD_VERSION
ARG TARGETARCH ARG TARGETARCH
# Build the application # Build the application
RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} go build -o /build/dist/wg-portal \ RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} go build -o /build/dist/wg-portal \
-ldflags "-w -s -extldflags '-static' -X 'github.com/h44z/wg-portal/internal.Version=${BUILD_VERSION}'" \ -ldflags "-w -s -extldflags '-static' -X 'github.com/fedor-git/wg-portal-2/internal.Version=${BUILD_VERSION}'" \
-tags netgo \ -tags netgo \
cmd/wg-portal/main.go cmd/wg-portal/main.go

View File

@ -1,10 +1,10 @@
# Go parameters # Go parameters
GOCMD=go GOCMD=go
MODULENAME=github.com/h44z/wg-portal MODULENAME=github.com/fedor-git/wg-portal-2
GOFILES:=$(shell go list ./... | grep -v /vendor/) GOFILES:=$(shell go list ./... | grep -v /vendor/)
BUILDDIR=dist BUILDDIR=dist
BINARIES=$(subst cmd/,,$(wildcard cmd/*)) BINARIES=$(subst cmd/,,$(wildcard cmd/*))
IMAGE=h44z/wg-portal IMAGE=fedor-git/wg-portal-2
NPMCMD=npm NPMCMD=npm
all: help all: help
@ -76,7 +76,7 @@ clean:
.PHONY: build .PHONY: build
build: build-dependencies build: build-dependencies
CGO_ENABLED=0 $(GOCMD) build -o $(BUILDDIR)/wg-portal \ CGO_ENABLED=0 $(GOCMD) build -o $(BUILDDIR)/wg-portal \
-ldflags "-w -s -extldflags \"-static\" -X 'github.com/h44z/wg-portal/internal/server.Version=${ENV_BUILD_IDENTIFIER}-${ENV_BUILD_VERSION}'" \ -ldflags "-w -s -extldflags \"-static\" -X 'github.com/fedor-git/wg-portal-2/internal/server.Version=${ENV_BUILD_IDENTIFIER}-${ENV_BUILD_VERSION}'" \
-tags netgo \ -tags netgo \
cmd/wg-portal/main.go cmd/wg-portal/main.go
@ -84,7 +84,7 @@ build: build-dependencies
.PHONY: build-amd64 .PHONY: build-amd64
build-amd64: build-dependencies build-amd64: build-dependencies
CGO_ENABLED=0 $(GOCMD) build -o $(BUILDDIR)/wg-portal-amd64 \ CGO_ENABLED=0 $(GOCMD) build -o $(BUILDDIR)/wg-portal-amd64 \
-ldflags "-w -s -extldflags \"-static\" -X 'github.com/h44z/wg-portal/internal/server.Version=${ENV_BUILD_IDENTIFIER}-${ENV_BUILD_VERSION}'" \ -ldflags "-w -s -extldflags \"-static\" -X 'github.com/fedor-git/wg-portal-2/internal/server.Version=${ENV_BUILD_IDENTIFIER}-${ENV_BUILD_VERSION}'" \
-tags netgo \ -tags netgo \
cmd/wg-portal/main.go cmd/wg-portal/main.go
@ -92,7 +92,7 @@ build-amd64: build-dependencies
.PHONY: build-arm64 .PHONY: build-arm64
build-arm64: build-dependencies build-arm64: build-dependencies
CGO_ENABLED=0 CC=aarch64-linux-gnu-gcc GOOS=linux GOARCH=arm64 $(GOCMD) build -o $(BUILDDIR)/wg-portal-arm64 \ CGO_ENABLED=0 CC=aarch64-linux-gnu-gcc GOOS=linux GOARCH=arm64 $(GOCMD) build -o $(BUILDDIR)/wg-portal-arm64 \
-ldflags "-w -s -extldflags \"-static\" -X 'github.com/h44z/wg-portal/internal/server.Version=${ENV_BUILD_IDENTIFIER}-${ENV_BUILD_VERSION}'" \ -ldflags "-w -s -extldflags \"-static\" -X 'github.com/fedor-git/wg-portal-2/internal/server.Version=${ENV_BUILD_IDENTIFIER}-${ENV_BUILD_VERSION}'" \
-tags netgo \ -tags netgo \
cmd/wg-portal/main.go cmd/wg-portal/main.go
@ -100,7 +100,7 @@ build-arm64: build-dependencies
.PHONY: build-arm .PHONY: build-arm
build-arm: build-dependencies build-arm: build-dependencies
CGO_ENABLED=0 CC=arm-linux-gnueabi-gcc GOOS=linux GOARCH=arm GOARM=7 $(GOCMD) build -o $(BUILDDIR)/wg-portal-arm \ CGO_ENABLED=0 CC=arm-linux-gnueabi-gcc GOOS=linux GOARCH=arm GOARM=7 $(GOCMD) build -o $(BUILDDIR)/wg-portal-arm \
-ldflags "-w -s -extldflags \"-static\" -X 'github.com/h44z/wg-portal/internal/server.Version=${ENV_BUILD_IDENTIFIER}-${ENV_BUILD_VERSION}'" \ -ldflags "-w -s -extldflags \"-static\" -X 'github.com/fedor-git/wg-portal-2/internal/server.Version=${ENV_BUILD_IDENTIFIER}-${ENV_BUILD_VERSION}'" \
-tags netgo \ -tags netgo \
cmd/wg-portal/main.go cmd/wg-portal/main.go
@ -127,7 +127,7 @@ build-docker:
docker build --progress=plain \ docker build --progress=plain \
--build-arg BUILD_IDENTIFIER=${ENV_BUILD_IDENTIFIER} --build-arg BUILD_VERSION=${ENV_BUILD_VERSION} \ --build-arg BUILD_IDENTIFIER=${ENV_BUILD_IDENTIFIER} --build-arg BUILD_VERSION=${ENV_BUILD_VERSION} \
--build-arg TARGETPLATFORM=unknown . \ --build-arg TARGETPLATFORM=unknown . \
-t h44z/wg-portal:local -t fedor-git/wg-portal-2:local
#< helm-docs: Generate the helm chart documentation #< helm-docs: Generate the helm chart documentation
.PHONY: helm-docs .PHONY: helm-docs

View File

@ -1,12 +1,12 @@
# WireGuard Portal v2 # WireGuard Portal v2
[![Build Status](https://github.com/h44z/wg-portal/actions/workflows/docker-publish.yml/badge.svg?event=push)](https://github.com/h44z/wg-portal/actions/workflows/docker-publish.yml) [![Build Status](https://github.com/fedor-git/wg-portal-2/actions/workflows/docker-publish.yml/badge.svg?event=push)](https://github.com/fedor-git/wg-portal-2/actions/workflows/docker-publish.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)
![GitHub last commit](https://img.shields.io/github/last-commit/h44z/wg-portal/master) ![GitHub last commit](https://img.shields.io/github/last-commit/fedor-git/wg-portal-2/master)
[![Go Report Card](https://goreportcard.com/badge/github.com/h44z/wg-portal)](https://goreportcard.com/report/github.com/h44z/wg-portal) [![Go Report Card](https://goreportcard.com/badge/github.com/fedor-git/wg-portal-2)](https://goreportcard.com/report/github.com/fedor-git/wg-portal-2)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/h44z/wg-portal) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/fedor-git/wg-portal-2)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/h44z/wg-portal) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/fedor-git/wg-portal-2)
[![Docker Pulls](https://img.shields.io/docker/pulls/h44z/wg-portal.svg)](https://hub.docker.com/r/wgportal/wg-portal/) [![Docker Pulls](https://img.shields.io/docker/pulls/fedor-git/wg-portal-2.svg)](https://hub.docker.com/r/wgportal/wg-portal/)
## Introduction ## Introduction
<!-- Text from this line # is included in docs/documentation/overview.md --> <!-- Text from this line # is included in docs/documentation/overview.md -->
@ -65,4 +65,4 @@ For the complete documentation visit [wgportal.org](https://wgportal.org).
> [!IMPORTANT] > [!IMPORTANT]
> Since the project was accepted by the Docker-Sponsored Open Source Program, the Docker image location has moved to [wgportal/wg-portal](https://hub.docker.com/r/wgportal/wg-portal). > Since the project was accepted by the Docker-Sponsored Open Source Program, the Docker image location has moved to [wgportal/wg-portal](https://hub.docker.com/r/wgportal/wg-portal).
> Please update the Docker image from **h44z/wg-portal** to **wgportal/wg-portal**. > Please update the Docker image from **fedor-git/wg-portal-2** to **wgportal/wg-portal**.

View File

@ -13,7 +13,7 @@ If you believe you've found a security issue in one of the supported versions of
Please do not report security vulnerabilities through public GitHub issues. Please do not report security vulnerabilities through public GitHub issues.
Instead, we encourage you to submit a report through GitHub [private vulnerability reporting](https://github.com/h44z/wg-portal/security). Instead, we encourage you to submit a report through GitHub [private vulnerability reporting](https://github.com/fedor-git/wg-portal-2/security).
If you prefer to submit a report without logging in to GitHub, please email *info (at) wgportal.org*. If you prefer to submit a report without logging in to GitHub, please email *info (at) wgportal.org*.
We will respond as soon as possible, but as only two people currently maintain this project, we cannot guarantee specific response times. We will respond as soon as possible, but as only two people currently maintain this project, we cannot guarantee specific response times.

View File

@ -11,23 +11,23 @@ import (
evbus "github.com/vardius/message-bus" evbus "github.com/vardius/message-bus"
"gorm.io/gorm/schema" "gorm.io/gorm/schema"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/adapters" "github.com/fedor-git/wg-portal-2/internal/adapters"
"github.com/h44z/wg-portal/internal/app" "github.com/fedor-git/wg-portal-2/internal/app"
"github.com/h44z/wg-portal/internal/app/api/core" "github.com/fedor-git/wg-portal-2/internal/app/api/core"
backendV0 "github.com/h44z/wg-portal/internal/app/api/v0/backend" backendV0 "github.com/fedor-git/wg-portal-2/internal/app/api/v0/backend"
handlersV0 "github.com/h44z/wg-portal/internal/app/api/v0/handlers" handlersV0 "github.com/fedor-git/wg-portal-2/internal/app/api/v0/handlers"
backendV1 "github.com/h44z/wg-portal/internal/app/api/v1/backend" backendV1 "github.com/fedor-git/wg-portal-2/internal/app/api/v1/backend"
handlersV1 "github.com/h44z/wg-portal/internal/app/api/v1/handlers" handlersV1 "github.com/fedor-git/wg-portal-2/internal/app/api/v1/handlers"
"github.com/h44z/wg-portal/internal/app/audit" "github.com/fedor-git/wg-portal-2/internal/app/audit"
"github.com/h44z/wg-portal/internal/app/auth" "github.com/fedor-git/wg-portal-2/internal/app/auth"
"github.com/h44z/wg-portal/internal/app/configfile" "github.com/fedor-git/wg-portal-2/internal/app/configfile"
"github.com/h44z/wg-portal/internal/app/mail" "github.com/fedor-git/wg-portal-2/internal/app/mail"
"github.com/h44z/wg-portal/internal/app/route" "github.com/fedor-git/wg-portal-2/internal/app/route"
"github.com/h44z/wg-portal/internal/app/users" "github.com/fedor-git/wg-portal-2/internal/app/users"
"github.com/h44z/wg-portal/internal/app/webhooks" "github.com/fedor-git/wg-portal-2/internal/app/webhooks"
"github.com/h44z/wg-portal/internal/app/wireguard" "github.com/fedor-git/wg-portal-2/internal/app/wireguard"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
) )
// main entry point for WireGuard Portal // main entry point for WireGuard Portal

View File

@ -7,7 +7,7 @@ type: application
home: https://wgportal.org home: https://wgportal.org
icon: https://wgportal.org/latest/assets/images/logo.svg icon: https://wgportal.org/latest/assets/images/logo.svg
sources: sources:
- https://github.com/h44z/wg-portal - https://github.com/fedor-git/wg-portal-2
annotations: annotations:
artifacthub.io/category: networking artifacthub.io/category: networking

View File

@ -8,7 +8,7 @@ WireGuard Configuration Portal with LDAP, OAuth, OIDC authentication
## Source Code ## Source Code
* <https://github.com/h44z/wg-portal> * <https://github.com/fedor-git/wg-portal-2>
## Requirements ## Requirements
@ -42,7 +42,7 @@ The [Values](#values) section lists the parameters that can be configured during
| revisionHistoryLimit | string | `10` | The number of old ReplicaSets to retain to allow rollback. | | revisionHistoryLimit | string | `10` | The number of old ReplicaSets to retain to allow rollback. |
| workloadType | string | `"Deployment"` | Workload type - `Deployment` or `StatefulSet` | | workloadType | string | `"Deployment"` | Workload type - `Deployment` or `StatefulSet` |
| strategy | object | `{"type":"RollingUpdate"}` | Update strategy for the workload Valid values are: `RollingUpdate` or `Recreate` for Deployment, `RollingUpdate` or `OnDelete` for StatefulSet | | strategy | object | `{"type":"RollingUpdate"}` | Update strategy for the workload Valid values are: `RollingUpdate` or `Recreate` for Deployment, `RollingUpdate` or `OnDelete` for StatefulSet |
| image.repository | string | `"ghcr.io/h44z/wg-portal"` | Image repository | | image.repository | string | `"ghcr.io/fedor-git/wg-portal-2"` | Image repository |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | | image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion | | image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion |
| imagePullSecrets | list | `[]` | Image pull secrets | | imagePullSecrets | list | `[]` | Image pull secrets |

View File

@ -44,7 +44,7 @@ strategy:
image: image:
# -- Image repository # -- Image repository
repository: ghcr.io/h44z/wg-portal repository: ghcr.io/fedor-git/wg-portal-2
# -- Image pull policy # -- Image pull policy
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
# -- Overrides the image tag whose default is the chart appVersion # -- Overrides the image tag whose default is the chart appVersion

View File

@ -1,4 +1,4 @@
Starting from v2, each [release](https://github.com/h44z/wg-portal/releases) includes compiled binaries for supported platforms. Starting from v2, each [release](https://github.com/fedor-git/wg-portal-2/releases) includes compiled binaries for supported platforms.
These binary versions can be manually downloaded and installed. These binary versions can be manually downloaded and installed.
## Download ## Download
@ -12,19 +12,19 @@ Make sure that you download the correct binary for your architecture. The availa
With `curl`: With `curl`:
```shell ```shell
curl -L -o wg-portal https://github.com/h44z/wg-portal/releases/download/${WG_PORTAL_VERSION}/wg-portal_linux_amd64 curl -L -o wg-portal https://github.com/fedor-git/wg-portal-2/releases/download/${WG_PORTAL_VERSION}/wg-portal_linux_amd64
``` ```
With `wget`: With `wget`:
```shell ```shell
wget -O wg-portal https://github.com/h44z/wg-portal/releases/download/${WG_PORTAL_VERSION}/wg-portal_linux_amd64 wget -O wg-portal https://github.com/fedor-git/wg-portal-2/releases/download/${WG_PORTAL_VERSION}/wg-portal_linux_amd64
``` ```
with `gh cli`: with `gh cli`:
```shell ```shell
gh release download ${WG_PORTAL_VERSION} --repo h44z/wg-portal --output wg-portal --pattern '*amd64' gh release download ${WG_PORTAL_VERSION} --repo fedor-git/wg-portal-2 --output wg-portal --pattern '*amd64'
``` ```
@ -38,5 +38,5 @@ sudo install wg-portal /opt/wg-portal/
## Unreleased versions (master branch builds) ## Unreleased versions (master branch builds)
Unreleased versions can be fetched directly from the artifacts section of the [GitHub Workflow](https://github.com/h44z/wg-portal/actions/workflows/docker-publish.yml?query=branch%3Amaster). Unreleased versions can be fetched directly from the artifacts section of the [GitHub Workflow](https://github.com/fedor-git/wg-portal-2/actions/workflows/docker-publish.yml?query=branch%3Amaster).

View File

@ -1,6 +1,6 @@
## Image Usage ## Image Usage
The WireGuard Portal Docker image is available on both [Docker Hub](https://hub.docker.com/r/wgportal/wg-portal) and [GitHub Container Registry](https://github.com/h44z/wg-portal/pkgs/container/wg-portal). The WireGuard Portal Docker image is available on both [Docker Hub](https://hub.docker.com/r/wgportal/wg-portal) and [GitHub Container Registry](https://github.com/fedor-git/wg-portal-2/pkgs/container/wg-portal).
It is built on the official Alpine Linux base image and comes pre-packaged with all necessary WireGuard dependencies. It is built on the official Alpine Linux base image and comes pre-packaged with all necessary WireGuard dependencies.
This container allows you to establish WireGuard VPN connections without relying on a host system that supports WireGuard or using the `linuxserver/wireguard` Docker image. This container allows you to establish WireGuard VPN connections without relying on a host system that supports WireGuard or using the `linuxserver/wireguard` Docker image.
@ -109,7 +109,7 @@ WireGuard Portal supports managing WireGuard interfaces through three distinct d
## Image Versioning ## Image Versioning
All images are hosted on Docker Hub at [https://hub.docker.com/r/wgportal/wg-portal](https://hub.docker.com/r/wgportal/wg-portal) or in the [GitHub Container Registry](https://github.com/h44z/wg-portal/pkgs/container/wg-portal). All images are hosted on Docker Hub at [https://hub.docker.com/r/wgportal/wg-portal](https://hub.docker.com/r/wgportal/wg-portal) or in the [GitHub Container Registry](https://github.com/fedor-git/wg-portal-2/pkgs/container/wg-portal).
Version **2** is the current stable release. Version **1** has moved to legacy status and is no longer recommended. Version **2** is the current stable release. Version **1** has moved to legacy status and is no longer recommended.
@ -125,7 +125,7 @@ There are different types of these tags:
- Major version tags: `v2` or `2`. These tags always refer to the latest image for WireGuard Portal version **2**. - Major version tags: `v2` or `2`. These tags always refer to the latest image for WireGuard Portal version **2**.
- Minor version tags: `v2.x` or `2.0`. These tags always refer to the latest image for WireGuard Portal version **2.x**. - Minor version tags: `v2.x` or `2.0`. These tags always refer to the latest image for WireGuard Portal version **2.x**.
- Specific version tags (patch version): `v2.0.0` or `2.0.0`. These tags denote a very specific release. They correspond to the GitHub tags that we make, and you can see the release notes for them here: [https://github.com/h44z/wg-portal/releases](https://github.com/h44z/wg-portal/releases). Once these tags for a specific version show up in the Docker repository, they will never change. - Specific version tags (patch version): `v2.0.0` or `2.0.0`. These tags denote a very specific release. They correspond to the GitHub tags that we make, and you can see the release notes for them here: [https://github.com/fedor-git/wg-portal-2/releases](https://github.com/fedor-git/wg-portal-2/releases). Once these tags for a specific version show up in the Docker repository, they will never change.
#### The `latest` tag #### The `latest` tag

View File

@ -11,7 +11,7 @@ To build the application from source files, use the Makefile provided in the rep
```shell ```shell
# Get source code # Get source code
git clone https://github.com/h44z/wg-portal -b ${WG_PORTAL_VERSION:-master} --depth 1 git clone https://github.com/fedor-git/wg-portal-2 -b ${WG_PORTAL_VERSION:-master} --depth 1
cd wg-portal cd wg-portal
# Build the frontend # Build the frontend
make frontend make frontend

View File

@ -27,6 +27,6 @@ scrape_configs:
# Grafana Dashboard # Grafana Dashboard
You may import [`dashboard.json`](https://github.com/h44z/wg-portal/blob/master/deploy/helm/files/dashboard.json) into your Grafana instance. You may import [`dashboard.json`](https://github.com/fedor-git/wg-portal-2/blob/master/deploy/helm/files/dashboard.json) into your Grafana instance.
![Dashboard](../../assets/images/dashboard.png) ![Dashboard](../../assets/images/dashboard.png)

View File

@ -580,14 +580,14 @@ definitions:
info: info:
contact: contact:
name: WireGuard Portal Project name: WireGuard Portal Project
url: https://github.com/h44z/wg-portal url: https://github.com/fedor-git/wg-portal-2
description: |- description: |-
The WireGuard Portal REST API enables efficient management of WireGuard VPN configurations through a set of JSON-based endpoints. The WireGuard Portal REST API enables efficient management of WireGuard VPN configurations through a set of JSON-based endpoints.
It supports creating and editing peers, interfaces, and user profiles, while also providing role-based access control and auditing. It supports creating and editing peers, interfaces, and user profiles, while also providing role-based access control and auditing.
This API allows seamless integration with external tools or scripts for automated network configuration and administration. This API allows seamless integration with external tools or scripts for automated network configuration and administration.
license: license:
name: MIT name: MIT
url: https://github.com/h44z/wg-portal/blob/master/LICENSE.txt url: https://github.com/fedor-git/wg-portal-2/blob/master/LICENSE.txt
title: WireGuard Portal Public API title: WireGuard Portal Public API
version: "1.0" version: "1.0"
paths: paths:

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/h44z/wg-portal module github.com/fedor-git/wg-portal-2
go 1.24.0 go 1.24.0

View File

@ -19,8 +19,8 @@ import (
"gorm.io/gorm/logger" "gorm.io/gorm/logger"
"gorm.io/gorm/utils" "gorm.io/gorm/utils"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// SchemaVersion describes the current database schema version. It must be incremented if a manual migration is needed. // SchemaVersion describes the current database schema version. It must be incremented if a manual migration is needed.

View File

@ -10,9 +10,9 @@ import (
mail "github.com/xhit/go-simple-mail/v2" mail "github.com/xhit/go-simple-mail/v2"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type MailRepo struct { type MailRepo struct {

View File

@ -11,9 +11,9 @@ import (
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type MetricsServer struct { type MetricsServer struct {

View File

@ -18,10 +18,10 @@ import (
"golang.zx2c4.com/wireguard/wgctrl" "golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes" "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
"github.com/h44z/wg-portal/internal/lowlevel" "github.com/fedor-git/wg-portal-2/internal/lowlevel"
) )
// region dependencies // region dependencies

View File

@ -11,9 +11,9 @@ import (
"log/slog" "log/slog"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
"github.com/h44z/wg-portal/internal/lowlevel" "github.com/fedor-git/wg-portal-2/internal/lowlevel"
) )
type MikrotikController struct { type MikrotikController struct {

View File

@ -7,8 +7,8 @@ import (
"os/exec" "os/exec"
"strings" "strings"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// WgQuickRepo implements higher level wg-quick like interactions like setting DNS, routing tables or interface hooks. // WgQuickRepo implements higher level wg-quick like interactions like setting DNS, routing tables or interface hooks.

View File

@ -11,8 +11,8 @@ import (
"golang.zx2c4.com/wireguard/wgctrl" "golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes" "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
"github.com/h44z/wg-portal/internal/lowlevel" "github.com/fedor-git/wg-portal-2/internal/lowlevel"
) )
// WgRepo implements all low-level WireGuard interactions. // WgRepo implements all low-level WireGuard interactions.

View File

@ -15,8 +15,8 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// setup WireGuard manager with no linked store // setup WireGuard manager with no linked store

View File

@ -5,7 +5,7 @@
"title": "WireGuard Portal SPA-UI API", "title": "WireGuard Portal SPA-UI API",
"contact": { "contact": {
"name": "WireGuard Portal Developers", "name": "WireGuard Portal Developers",
"url": "https://github.com/h44z/wg-portal" "url": "https://github.com/fedor-git/wg-portal-2"
}, },
"version": "0.0" "version": "0.0"
}, },

View File

@ -456,7 +456,7 @@ definitions:
info: info:
contact: contact:
name: WireGuard Portal Developers name: WireGuard Portal Developers
url: https://github.com/h44z/wg-portal url: https://github.com/fedor-git/wg-portal-2
description: WireGuard Portal API - UI Endpoints description: WireGuard Portal API - UI Endpoints
title: WireGuard Portal SPA-UI API title: WireGuard Portal SPA-UI API
version: "0.0" version: "0.0"

View File

@ -5,11 +5,11 @@
"title": "WireGuard Portal Public API", "title": "WireGuard Portal Public API",
"contact": { "contact": {
"name": "WireGuard Portal Project", "name": "WireGuard Portal Project",
"url": "https://github.com/h44z/wg-portal" "url": "https://github.com/fedor-git/wg-portal-2"
}, },
"license": { "license": {
"name": "MIT", "name": "MIT",
"url": "https://github.com/h44z/wg-portal/blob/master/LICENSE.txt" "url": "https://github.com/fedor-git/wg-portal-2/blob/master/LICENSE.txt"
}, },
"version": "1.0" "version": "1.0"
}, },

View File

@ -636,14 +636,14 @@ definitions:
info: info:
contact: contact:
name: WireGuard Portal Project name: WireGuard Portal Project
url: https://github.com/h44z/wg-portal url: https://github.com/fedor-git/wg-portal-2
description: |- description: |-
The WireGuard Portal REST API enables efficient management of WireGuard VPN configurations through a set of JSON-based endpoints. The WireGuard Portal REST API enables efficient management of WireGuard VPN configurations through a set of JSON-based endpoints.
It supports creating and editing peers, interfaces, and user profiles, while also providing role-based access control and auditing. It supports creating and editing peers, interfaces, and user profiles, while also providing role-based access control and auditing.
This API allows seamless integration with external tools or scripts for automated network configuration and administration. This API allows seamless integration with external tools or scripts for automated network configuration and administration.
license: license:
name: MIT name: MIT
url: https://github.com/h44z/wg-portal/blob/master/LICENSE.txt url: https://github.com/fedor-git/wg-portal-2/blob/master/LICENSE.txt
title: WireGuard Portal Public API title: WireGuard Portal Public API
version: "1.0" version: "1.0"
paths: paths:

View File

@ -7,7 +7,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
) )
func TestMiddleware_Handler(t *testing.T) { func TestMiddleware_Handler(t *testing.T) {

View File

@ -12,13 +12,13 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/app/api/core/middleware/cors" "github.com/fedor-git/wg-portal-2/internal/app/api/core/middleware/cors"
"github.com/h44z/wg-portal/internal/app/api/core/middleware/logging" "github.com/fedor-git/wg-portal-2/internal/app/api/core/middleware/logging"
"github.com/h44z/wg-portal/internal/app/api/core/middleware/recovery" "github.com/fedor-git/wg-portal-2/internal/app/api/core/middleware/recovery"
"github.com/h44z/wg-portal/internal/app/api/core/middleware/tracing" "github.com/fedor-git/wg-portal-2/internal/app/api/core/middleware/tracing"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
) )
const ( const (

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"io" "io"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"io" "io"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

View File

@ -3,8 +3,8 @@ package backend
import ( import (
"context" "context"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

View File

@ -6,10 +6,10 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core" "github.com/fedor-git/wg-portal-2/internal/app/api/core"
"github.com/h44z/wg-portal/internal/app/api/core/middleware/cors" "github.com/fedor-git/wg-portal-2/internal/app/api/core/middleware/cors"
"github.com/h44z/wg-portal/internal/app/api/core/middleware/csrf" "github.com/fedor-git/wg-portal-2/internal/app/api/core/middleware/csrf"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
) )
type SessionMiddleware interface { type SessionMiddleware interface {
@ -45,7 +45,7 @@ type Handler interface {
// @description WireGuard Portal API - UI Endpoints // @description WireGuard Portal API - UI Endpoints
// @contact.name WireGuard Portal Developers // @contact.name WireGuard Portal Developers
// @contact.url https://github.com/h44z/wg-portal // @contact.url https://github.com/fedor-git/wg-portal-2
// @BasePath /api/v0 // @BasePath /api/v0
// @query.collection.format multi // @query.collection.format multi

View File

@ -6,10 +6,10 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v0/model" "github.com/fedor-git/wg-portal-2/internal/app/api/v0/model"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type AuditService interface { type AuditService interface {

View File

@ -11,11 +11,11 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v0/model" "github.com/fedor-git/wg-portal-2/internal/app/api/v0/model"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type AuthenticationService interface { type AuthenticationService interface {

View File

@ -10,12 +10,12 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v0/model" "github.com/fedor-git/wg-portal-2/internal/app/api/v0/model"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
//go:embed frontend_config.js.gotpl //go:embed frontend_config.js.gotpl

View File

@ -7,11 +7,11 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v0/model" "github.com/fedor-git/wg-portal-2/internal/app/api/v0/model"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type InterfaceService interface { type InterfaceService interface {

View File

@ -7,11 +7,11 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v0/model" "github.com/fedor-git/wg-portal-2/internal/app/api/v0/model"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type PeerService interface { type PeerService interface {

View File

@ -7,8 +7,8 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v0/model" "github.com/fedor-git/wg-portal-2/internal/app/api/v0/model"
) )
type TestEndpoint struct { type TestEndpoint struct {

View File

@ -6,11 +6,11 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v0/model" "github.com/fedor-git/wg-portal-2/internal/app/api/v0/model"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type UserService interface { type UserService interface {

View File

@ -0,0 +1,39 @@
package models
import (
"github.com/fedor-git/wg-portal-2/internal"
"github.com/fedor-git/wg-portal-2/internal/domain"
)
type ConfigOption[T any] struct {
Value T `json:"Value"`
Overridable bool `json:"Overridable,omitempty"`
}
func ConfigOptionFromDomain[T any](opt domain.ConfigOption[T]) ConfigOption[T] {
return ConfigOption[T]{
Value: opt.Value,
Overridable: opt.Overridable,
}
}
func ConfigOptionToDomain[T any](opt ConfigOption[T]) domain.ConfigOption[T] {
return domain.ConfigOption[T]{
Value: opt.Value,
Overridable: opt.Overridable,
}
}
func StringSliceConfigOptionFromDomain(opt domain.ConfigOption[string]) ConfigOption[[]string] {
return ConfigOption[[]string]{
Value: internal.SliceString(opt.Value),
Overridable: opt.Overridable,
}
}
func StringSliceConfigOptionToDomain(opt ConfigOption[[]string]) domain.ConfigOption[string] {
return domain.ConfigOption[string]{
Value: internal.SliceToString(opt.Value),
Overridable: opt.Overridable,
}
}

View File

@ -4,10 +4,10 @@ import (
"context" "context"
"net/http" "net/http"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v0/model" "github.com/fedor-git/wg-portal-2/internal/app/api/v0/model"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type Scope string type Scope string

View File

@ -9,7 +9,7 @@ import (
"github.com/alexedwards/scs/v2" "github.com/alexedwards/scs/v2"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
) )
func init() { func init() {

View File

@ -1,8 +1,8 @@
package model package model
import ( import (
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type ConfigOption[T any] struct { type ConfigOption[T any] struct {

View File

@ -1,7 +1,7 @@
package model package model
import ( import (
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type AuditEntry struct { type AuditEntry struct {

View File

@ -4,7 +4,7 @@ import (
"slices" "slices"
"strings" "strings"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type LoginProviderInfo struct { type LoginProviderInfo struct {

View File

@ -3,9 +3,9 @@ package model
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type Interface struct { type Interface struct {

View File

@ -3,8 +3,8 @@ package model
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
const ExpiryDateTimeLayout = "\"2006-01-02\"" const ExpiryDateTimeLayout = "\"2006-01-02\""

View File

@ -3,7 +3,7 @@ package model
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type User struct { type User struct {

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type InterfaceServiceInterfaceManagerRepo interface { type InterfaceServiceInterfaceManagerRepo interface {

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type MetricsServiceDatabaseRepo interface { type MetricsServiceDatabaseRepo interface {

View File

@ -5,8 +5,8 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type PeerServicePeerManagerRepo interface { type PeerServicePeerManagerRepo interface {

View File

@ -5,9 +5,9 @@ import (
"fmt" "fmt"
"io" "io"
"github.com/h44z/wg-portal/internal/app/api/v1/models" "github.com/fedor-git/wg-portal-2/internal/app/api/v1/models"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type ProvisioningServiceUserManagerRepo interface { type ProvisioningServiceUserManagerRepo interface {

View File

@ -5,8 +5,8 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type UserManagerRepo interface { type UserManagerRepo interface {

View File

@ -6,10 +6,10 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core" "github.com/fedor-git/wg-portal-2/internal/app/api/core"
"github.com/h44z/wg-portal/internal/app/api/core/middleware/cors" "github.com/fedor-git/wg-portal-2/internal/app/api/core/middleware/cors"
"github.com/h44z/wg-portal/internal/app/api/v1/models" "github.com/fedor-git/wg-portal-2/internal/app/api/v1/models"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type Handler interface { type Handler interface {
@ -30,10 +30,10 @@ type Handler interface {
// @description This API allows seamless integration with external tools or scripts for automated network configuration and administration. // @description This API allows seamless integration with external tools or scripts for automated network configuration and administration.
// @license.name MIT // @license.name MIT
// @license.url https://github.com/h44z/wg-portal/blob/master/LICENSE.txt // @license.url https://github.com/fedor-git/wg-portal-2/blob/master/LICENSE.txt
// @contact.name WireGuard Portal Project // @contact.name WireGuard Portal Project
// @contact.url https://github.com/h44z/wg-portal // @contact.url https://github.com/fedor-git/wg-portal-2
// @securityDefinitions.basic BasicAuth // @securityDefinitions.basic BasicAuth

View File

@ -6,10 +6,10 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v1/models" "github.com/fedor-git/wg-portal-2/internal/app/api/v1/models"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type InterfaceEndpointInterfaceService interface { type InterfaceEndpointInterfaceService interface {

View File

@ -6,10 +6,10 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v1/models" "github.com/fedor-git/wg-portal-2/internal/app/api/v1/models"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type MetricsEndpointStatisticsService interface { type MetricsEndpointStatisticsService interface {

View File

@ -6,10 +6,10 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v1/models" "github.com/fedor-git/wg-portal-2/internal/app/api/v1/models"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type PeerService interface { type PeerService interface {

View File

@ -7,10 +7,10 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v1/models" "github.com/fedor-git/wg-portal-2/internal/app/api/v1/models"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type ProvisioningEndpointProvisioningService interface { type ProvisioningEndpointProvisioningService interface {

View File

@ -6,10 +6,10 @@ import (
"github.com/go-pkgz/routegroup" "github.com/go-pkgz/routegroup"
"github.com/h44z/wg-portal/internal/app/api/core/request" "github.com/fedor-git/wg-portal-2/internal/app/api/core/request"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v1/models" "github.com/fedor-git/wg-portal-2/internal/app/api/v1/models"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type UserService interface { type UserService interface {

View File

@ -4,9 +4,9 @@ import (
"context" "context"
"net/http" "net/http"
"github.com/h44z/wg-portal/internal/app/api/core/respond" "github.com/fedor-git/wg-portal-2/internal/app/api/core/respond"
"github.com/h44z/wg-portal/internal/app/api/v0/model" "github.com/fedor-git/wg-portal-2/internal/app/api/v0/model"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type Scope string type Scope string

View File

@ -1,8 +1,8 @@
package models package models
import ( import (
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type ConfigOption[T any] struct { type ConfigOption[T any] struct {

View File

@ -3,8 +3,8 @@ package models
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// Interface represents a WireGuard interface. // Interface represents a WireGuard interface.

View File

@ -3,7 +3,7 @@ package models
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// PeerMetrics represents the metrics of a WireGuard peer. // PeerMetrics represents the metrics of a WireGuard peer.

View File

@ -3,8 +3,8 @@ package models
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
const ExpiryDateTimeLayout = "2006-01-02" const ExpiryDateTimeLayout = "2006-01-02"

View File

@ -1,6 +1,6 @@
package models package models
import "github.com/h44z/wg-portal/internal/domain" import "github.com/fedor-git/wg-portal-2/internal/domain"
// UserInformation represents the information about a user and its linked peers. // UserInformation represents the information about a user and its linked peers.
type UserInformation struct { type UserInformation struct {

View File

@ -3,7 +3,7 @@ package models
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// User represents a user in the system. // User represents a user in the system.

View File

@ -7,8 +7,8 @@ import (
"log/slog" "log/slog"
"time" "time"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

View File

@ -4,7 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type ManagerDatabaseRepo interface { type ManagerDatabaseRepo interface {

View File

@ -1,6 +1,6 @@
package audit package audit
import "github.com/h44z/wg-portal/internal/domain" import "github.com/fedor-git/wg-portal-2/internal/domain"
type AuthEvent struct { type AuthEvent struct {
Username string Username string

View File

@ -6,9 +6,9 @@ import (
"log/slog" "log/slog"
"time" "time"
"github.com/h44z/wg-portal/internal/app" "github.com/fedor-git/wg-portal-2/internal/app"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

View File

@ -16,10 +16,10 @@ import (
"github.com/coreos/go-oidc/v3/oidc" "github.com/coreos/go-oidc/v3/oidc"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"github.com/h44z/wg-portal/internal/app" "github.com/fedor-git/wg-portal-2/internal/app"
"github.com/h44z/wg-portal/internal/app/audit" "github.com/fedor-git/wg-portal-2/internal/app/audit"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

View File

@ -9,9 +9,9 @@ import (
"github.com/go-ldap/ldap/v3" "github.com/go-ldap/ldap/v3"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// LdapAuthenticator is an authenticator that uses LDAP for authentication. // LdapAuthenticator is an authenticator that uses LDAP for authentication.

View File

@ -11,9 +11,9 @@ import (
"golang.org/x/oauth2" "golang.org/x/oauth2"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// PlainOauthAuthenticator is an authenticator that uses OAuth for authentication. // PlainOauthAuthenticator is an authenticator that uses OAuth for authentication.

View File

@ -10,8 +10,8 @@ import (
"github.com/coreos/go-oidc/v3/oidc" "github.com/coreos/go-oidc/v3/oidc"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// OidcAuthenticator is an authenticator for OpenID Connect providers. // OidcAuthenticator is an authenticator for OpenID Connect providers.

View File

@ -3,9 +3,9 @@ package auth
import ( import (
"strings" "strings"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// parseOauthUserInfo parses the raw user info from the oauth provider and maps it to the internal user info struct // parseOauthUserInfo parses the raw user info from the oauth provider and maps it to the internal user info struct

View File

@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
) )
func Test_parseOauthUserInfo_no_admin(t *testing.T) { func Test_parseOauthUserInfo_no_admin(t *testing.T) {

View File

@ -12,10 +12,10 @@ import (
"github.com/go-webauthn/webauthn/protocol" "github.com/go-webauthn/webauthn/protocol"
"github.com/go-webauthn/webauthn/webauthn" "github.com/go-webauthn/webauthn/webauthn"
"github.com/h44z/wg-portal/internal/app" "github.com/fedor-git/wg-portal-2/internal/app"
"github.com/h44z/wg-portal/internal/app/audit" "github.com/fedor-git/wg-portal-2/internal/app/audit"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type WebAuthnUserManager interface { type WebAuthnUserManager interface {

View File

@ -5,7 +5,7 @@ import (
"gorm.io/gorm" "gorm.io/gorm"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
) )
// HandleProgramArgs handles program arguments and returns true if the program should exit. // HandleProgramArgs handles program arguments and returns true if the program should exit.

View File

@ -13,9 +13,9 @@ import (
"github.com/yeqown/go-qrcode/v2" "github.com/yeqown/go-qrcode/v2"
"github.com/yeqown/go-qrcode/writer/compressed" "github.com/yeqown/go-qrcode/writer/compressed"
"github.com/h44z/wg-portal/internal/app" "github.com/fedor-git/wg-portal-2/internal/app"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

View File

@ -7,7 +7,7 @@ import (
"io" "io"
"text/template" "text/template"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
//go:embed tpl_files/* //go:embed tpl_files/*

View File

@ -12,7 +12,7 @@ import (
"gorm.io/gorm/schema" "gorm.io/gorm/schema"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// GormEncryptedStringSerializer is a GORM serializer that encrypts and decrypts string values using AES256. // GormEncryptedStringSerializer is a GORM serializer that encrypts and decrypts string values using AES256.

View File

@ -6,8 +6,8 @@ import (
"io" "io"
"log/slog" "log/slog"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

View File

@ -8,7 +8,7 @@ import (
"io" "io"
"text/template" "text/template"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
//go:embed tpl_files/* //go:embed tpl_files/*

View File

@ -9,9 +9,9 @@ import (
"gorm.io/gorm" "gorm.io/gorm"
"github.com/h44z/wg-portal/internal/adapters" "github.com/fedor-git/wg-portal-2/internal/adapters"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
func migrateFromV1(db *gorm.DB, source, typ string) error { func migrateFromV1(db *gorm.DB, source, typ string) error {

View File

@ -10,10 +10,10 @@ import (
"golang.zx2c4.com/wireguard/wgctrl" "golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes" "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/h44z/wg-portal/internal/app" "github.com/fedor-git/wg-portal-2/internal/app"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
"github.com/h44z/wg-portal/internal/lowlevel" "github.com/fedor-git/wg-portal-2/internal/lowlevel"
) )
// region dependencies // region dependencies

View File

@ -7,9 +7,9 @@ import (
"github.com/go-ldap/ldap/v3" "github.com/go-ldap/ldap/v3"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
func convertRawLdapUser( func convertRawLdapUser(

View File

@ -12,10 +12,10 @@ import (
"github.com/go-ldap/ldap/v3" "github.com/go-ldap/ldap/v3"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/h44z/wg-portal/internal" "github.com/fedor-git/wg-portal-2/internal"
"github.com/h44z/wg-portal/internal/app" "github.com/fedor-git/wg-portal-2/internal/app"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

View File

@ -7,10 +7,10 @@ import (
"log/slog" "log/slog"
"net/http" "net/http"
"github.com/h44z/wg-portal/internal/app" "github.com/fedor-git/wg-portal-2/internal/app"
"github.com/h44z/wg-portal/internal/app/webhooks/models" "github.com/fedor-git/wg-portal-2/internal/app/webhooks/models"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

View File

@ -3,7 +3,7 @@ package models
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// Interface represents an interface model for webhooks. For details about the fields, see the domain.Interface struct. // Interface represents an interface model for webhooks. For details about the fields, see the domain.Interface struct.

View File

@ -3,7 +3,7 @@ package models
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// Peer represents a peer model for webhooks. For details about the fields, see the domain.Peer struct. // Peer represents a peer model for webhooks. For details about the fields, see the domain.Peer struct.

View File

@ -3,7 +3,7 @@ package models
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// PeerMetrics represents a peer metrics model for webhooks. // PeerMetrics represents a peer metrics model for webhooks.

View File

@ -3,7 +3,7 @@ package models
import ( import (
"time" "time"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// User represents a user model for webhooks. For details about the fields, see the domain.User struct. // User represents a user model for webhooks. For details about the fields, see the domain.User struct.

View File

@ -7,9 +7,9 @@ import (
"maps" "maps"
"slices" "slices"
"github.com/h44z/wg-portal/internal/adapters/wgcontroller" "github.com/fedor-git/wg-portal-2/internal/adapters/wgcontroller"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type InterfaceController interface { type InterfaceController interface {

View File

@ -6,9 +6,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/h44z/wg-portal/internal/app" "github.com/fedor-git/wg-portal-2/internal/app"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
type StatisticsDatabaseRepo interface { type StatisticsDatabaseRepo interface {

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
func Test_getSessionStartTime(t *testing.T) { func Test_getSessionStartTime(t *testing.T) {

View File

@ -6,9 +6,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/h44z/wg-portal/internal/app" "github.com/fedor-git/wg-portal-2/internal/app"
"github.com/h44z/wg-portal/internal/config" "github.com/fedor-git/wg-portal-2/internal/config"
"github.com/h44z/wg-portal/internal/domain" "github.com/fedor-git/wg-portal-2/internal/domain"
) )
// region dependencies // region dependencies

Some files were not shown because too many files have changed in this diff Show More