update all before V2 dev start

This commit is contained in:
vx3r 2021-04-06 14:23:23 +02:00
parent 22fb5575e0
commit e5a94ae59f
30 changed files with 1416 additions and 907 deletions

View File

@ -7,7 +7,7 @@ build-back:
stage: build artifacts stage: build artifacts
image: golang:latest image: golang:latest
script: script:
- GOOS=linux GOARCH=amd64 go build -o ${CI_PROJECT_NAME}-linux-amd64 -ldflags="-X 'gitlab.127-0-0-1.fr/vx3r/wg-gen-web/version.Version=${CI_COMMIT_SHA}'" gitlab.127-0-0-1.fr/vx3r/wg-gen-web/cmd/wg-gen-web - GOOS=linux GOARCH=amd64 go build -o ${CI_PROJECT_NAME}-linux-amd64 -ldflags="-X 'github.com/vx3r/wg-gen-web/version.Version=${CI_COMMIT_SHA}'" github.com/vx3r/wg-gen-web/cmd/wg-gen-web
artifacts: artifacts:
paths: paths:
- ${CI_PROJECT_NAME}-linux-amd64 - ${CI_PROJECT_NAME}-linux-amd64

View File

@ -4,7 +4,7 @@ FROM golang:alpine AS build-back
WORKDIR /app WORKDIR /app
ARG COMMIT ARG COMMIT
COPY . . COPY . .
RUN go build -o wg-gen-web-linux -ldflags="-X 'gitlab.127-0-0-1.fr/vx3r/wg-gen-web/version.Version=${COMMIT}'" gitlab.127-0-0-1.fr/vx3r/wg-gen-web/cmd/wg-gen-web RUN go build -o wg-gen-web-linux -ldflags="-X 'github.com/vx3r/wg-gen-web/version.Version=${COMMIT}'" github.com/vx3r/wg-gen-web/cmd/wg-gen-web


FROM node:10-alpine AS build-front FROM node:10-alpine AS build-front
WORKDIR /app WORKDIR /app

View File

@ -4,9 +4,7 @@


Simple Web based configuration generator for [WireGuard](https://wireguard.com). Simple Web based configuration generator for [WireGuard](https://wireguard.com).


[![pipeline status](https://gitlab.127-0-0-1.fr/vx3r/wg-gen-web/badges/master/pipeline.svg)](https://gitlab.127-0-0-1.fr/vx3r/wg-gen-web/commits/master)
[![Go Report Card](https://goreportcard.com/badge/github.com/vx3r/wg-gen-web)](https://goreportcard.com/report/github.com/vx3r/wg-gen-web) [![Go Report Card](https://goreportcard.com/badge/github.com/vx3r/wg-gen-web)](https://goreportcard.com/report/github.com/vx3r/wg-gen-web)
![Gitlab pipeline status (self-hosted)](https://img.shields.io/gitlab/pipeline/vx3r/wg-gen-web?gitlab_url=https%3A%2F%2Fgitlab.127-0-0-1.fr%2F)
[![License: WTFPL](https://img.shields.io/badge/License-WTFPL-brightgreen.svg)](http://www.wtfpl.net/about/) [![License: WTFPL](https://img.shields.io/badge/License-WTFPL-brightgreen.svg)](http://www.wtfpl.net/about/)
![Discord](https://img.shields.io/discord/681699554189377567) ![Discord](https://img.shields.io/discord/681699554189377567)
![Build multi-arch Docker Images via buildx](https://github.com/vx3r/wg-gen-web/workflows/Build%20multi-arch%20Docker%20Images%20via%20buildx/badge.svg) ![Build multi-arch Docker Images via buildx](https://github.com/vx3r/wg-gen-web/workflows/Build%20multi-arch%20Docker%20Images%20via%20buildx/badge.svg)
@ -91,8 +89,8 @@ use 127.0.0.1 as <API_LISTEN_IP>.
### Directly without docker ### Directly without docker


Fill free to download latest artifacts from my GitLab server: Fill free to download latest artifacts from my GitLab server:
* [Backend](https://gitlab.127-0-0-1.fr/vx3r/wg-gen-web/-/jobs/artifacts/master/download?job=build-back) * [Backend](https://github.com/vx3r/wg-gen-web/-/jobs/artifacts/master/download?job=build-back)
* [Frontend](https://gitlab.127-0-0-1.fr/vx3r/wg-gen-web/-/jobs/artifacts/master/download?job=build-front) * [Frontend](https://github.com/vx3r/wg-gen-web/-/jobs/artifacts/master/download?job=build-front)


Put everything in one directory, create `.env` file with all configurations and run the backend. Put everything in one directory, create `.env` file with all configurations and run the backend.



View File

@ -2,7 +2,7 @@ package api


import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/api/v1" "github.com/vx3r/wg-gen-web/api/v1"
) )


// ApplyRoutes apply routes to gin engine // ApplyRoutes apply routes to gin engine

View File

@ -4,9 +4,9 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/patrickmn/go-cache" "github.com/patrickmn/go-cache"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/auth" "github.com/vx3r/wg-gen-web/auth"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util" "github.com/vx3r/wg-gen-web/util"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"net/http" "net/http"
"time" "time"

View File

@ -4,9 +4,9 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/skip2/go-qrcode" "github.com/skip2/go-qrcode"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/auth" "github.com/vx3r/wg-gen-web/auth"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/core" "github.com/vx3r/wg-gen-web/core"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"net/http" "net/http"
) )

View File

@ -3,10 +3,10 @@ package server
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/auth" "github.com/vx3r/wg-gen-web/auth"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/core" "github.com/vx3r/wg-gen-web/core"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/version" "github.com/vx3r/wg-gen-web/version"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"net/http" "net/http"
) )

View File

@ -6,7 +6,7 @@ import (


"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/core" "github.com/vx3r/wg-gen-web/core"
) )


// ApplyRoutes applies router to gin Router // ApplyRoutes applies router to gin Router

View File

@ -2,10 +2,10 @@ package apiv1


import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/api/v1/auth" "github.com/vx3r/wg-gen-web/api/v1/auth"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/api/v1/client" "github.com/vx3r/wg-gen-web/api/v1/client"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/api/v1/server" "github.com/vx3r/wg-gen-web/api/v1/server"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/api/v1/status" "github.com/vx3r/wg-gen-web/api/v1/status"
) )


// ApplyRoutes apply routes to gin router // ApplyRoutes apply routes to gin router

View File

@ -3,10 +3,10 @@ package auth
import ( import (
"fmt" "fmt"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/auth/fake" "github.com/vx3r/wg-gen-web/auth/fake"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/auth/github" "github.com/vx3r/wg-gen-web/auth/github"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/auth/oauth2oidc" "github.com/vx3r/wg-gen-web/auth/oauth2oidc"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"os" "os"
) )

View File

@ -1,8 +1,8 @@
package fake package fake


import ( import (
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util" "github.com/vx3r/wg-gen-web/util"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"time" "time"
) )

View File

@ -4,7 +4,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"golang.org/x/oauth2" "golang.org/x/oauth2"
oauth2Github "golang.org/x/oauth2/github" oauth2Github "golang.org/x/oauth2/github"
"io/ioutil" "io/ioutil"

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"github.com/coreos/go-oidc" "github.com/coreos/go-oidc"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"os" "os"
) )

View File

@ -9,11 +9,11 @@ import (
"github.com/joho/godotenv" "github.com/joho/godotenv"
"github.com/patrickmn/go-cache" "github.com/patrickmn/go-cache"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/api" "github.com/vx3r/wg-gen-web/api"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/auth" "github.com/vx3r/wg-gen-web/auth"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/core" "github.com/vx3r/wg-gen-web/core"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util" "github.com/vx3r/wg-gen-web/util"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/version" "github.com/vx3r/wg-gen-web/version"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"net/http" "net/http"
"os" "os"

View File

@ -5,10 +5,10 @@ import (
uuid "github.com/satori/go.uuid" uuid "github.com/satori/go.uuid"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/skip2/go-qrcode" "github.com/skip2/go-qrcode"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/storage" "github.com/vx3r/wg-gen-web/storage"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/template" "github.com/vx3r/wg-gen-web/template"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util" "github.com/vx3r/wg-gen-web/util"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes" "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"gopkg.in/gomail.v2" "gopkg.in/gomail.v2"
"io/ioutil" "io/ioutil"

View File

@ -3,10 +3,10 @@ package core
import ( import (
"errors" "errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/storage" "github.com/vx3r/wg-gen-web/storage"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/template" "github.com/vx3r/wg-gen-web/template"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util" "github.com/vx3r/wg-gen-web/util"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes" "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"os" "os"
"path/filepath" "path/filepath"

View File

@ -10,7 +10,7 @@ import (
"sort" "sort"
"time" "time"


"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
) )


// apiError implements a top-level JSON-RPC error. // apiError implements a top-level JSON-RPC error.

18
go.mod
View File

@ -1,21 +1,23 @@
module gitlab.127-0-0-1.fr/vx3r/wg-gen-web module github.com/vx3r/wg-gen-web


go 1.14 go 1.16


require ( require (
github.com/coreos/go-oidc v2.2.1+incompatible github.com/coreos/go-oidc v2.2.1+incompatible
github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e
github.com/elazarl/go-bindata-assetfs v1.0.0 // indirect
github.com/gin-contrib/cors v1.3.1 github.com/gin-contrib/cors v1.3.1
github.com/gin-contrib/static v0.0.0-20191128031702-f81c604d8ac2 github.com/gin-contrib/static v0.0.1
github.com/gin-gonic/gin v1.6.2 github.com/gin-gonic/gin v1.6.3
github.com/joho/godotenv v1.3.0 github.com/joho/godotenv v1.3.0
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
github.com/satori/go.uuid v1.2.0 github.com/satori/go.uuid v1.2.0
github.com/sirupsen/logrus v1.5.0 github.com/sirupsen/logrus v1.8.1
github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200324154536-ceff61240acf golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200609130330-bd2cb7843e1b
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/square/go-jose.v2 v2.5.0 // indirect gopkg.in/square/go-jose.v2 v2.5.0 // indirect

View File

@ -2,7 +2,7 @@ package model


import ( import (
"fmt" "fmt"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util" "github.com/vx3r/wg-gen-web/util"
"time" "time"
) )



View File

@ -2,7 +2,7 @@ package model


import ( import (
"fmt" "fmt"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util" "github.com/vx3r/wg-gen-web/util"
"time" "time"
) )



View File

@ -2,8 +2,8 @@ package storage


import ( import (
"encoding/json" "encoding/json"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util" "github.com/vx3r/wg-gen-web/util"
"os" "os"
"path/filepath" "path/filepath"
) )

View File

@ -2,8 +2,8 @@ package template


import ( import (
"bytes" "bytes"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model" "github.com/vx3r/wg-gen-web/model"
"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util" "github.com/vx3r/wg-gen-web/util"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"

2158
ui/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,23 +7,23 @@
"build": "vue-cli-service build" "build": "vue-cli-service build"
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.2", "axios": "^0.21.1",
"is-cidr": "^3.1.1", "is-cidr": "^4.0.2",
"moment": "^2.29.1", "moment": "^2.29.1",
"vue": "^2.6.12", "vue": "^2.6.12",
"vue-axios": "^2.1.5", "vue-axios": "^3.2.4",
"vue-moment": "^4.1.0", "vue-moment": "^4.1.0",
"vue-router": "^3.4.9", "vue-router": "^3.5.1",
"vuetify": "^2.3.17", "vuetify": "^2.4.9",
"vuex": "^3.5.1" "vuex": "^3.6.2"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-router": "^4.5.8", "@vue/cli-plugin-router": "^4.5.12",
"@vue/cli-service": "^4.5.8", "@vue/cli-service": "^4.5.12",
"sass": "^1.29.0", "sass": "^1.32.8",
"sass-loader": "^8.0.0", "sass-loader": "^10.1.1",
"vue-cli-plugin-vuetify": "^2.0.7", "vue-cli-plugin-vuetify": "^2.3.1",
"vue-template-compiler": "^2.6.12", "vue-template-compiler": "^2.6.12",
"vuetify-loader": "^1.6.0" "vuetify-loader": "^1.7.2"
} }
} }

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.png"> <link rel="icon" href="<%= BASE_URL %>favicon.png">
<title>ui</title> <title>Wg Gen Web</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
</head> </head>

View File

@ -4,11 +4,11 @@
<div v-if="this.isAuthenticated"> <div v-if="this.isAuthenticated">
<Header/> <Header/>


<v-content> <v-main>
<v-container> <v-container>
<router-view /> <router-view />
</v-container> </v-container>
</v-content> </v-main>


<Footer/> <Footer/>
</div> </div>

View File

@ -1,7 +1,7 @@
<template> <template>
<v-content> <v-main>
<Clients/> <Clients/>
</v-content> </v-main>
</template> </template>


<script> <script>

View File

@ -1,7 +1,7 @@
<template> <template>
<v-content> <v-main>
<Server/> <Server/>
</v-content> </v-main>
</template> </template>


<script> <script>

View File

@ -1,7 +1,7 @@
<template> <template>
<v-content> <v-main>
<Status/> <Status/>
</v-content> </v-main>
</template> </template>


<script> <script>

View File

@ -3,7 +3,10 @@ module.exports = {
port: 8081, port: 8081,
disableHostCheck: true, disableHostCheck: true,
}, },
"transpileDependencies": [ transpileDependencies: [
"vuetify" "vuetify"
] ],
pwa: {
name: 'Wg Gen Web',
}
}; };