1
0
Fork 0
mirror of synced 2024-11-23 01:05:35 -05:00

Renaming to ovpn-admin

This commit is contained in:
Dmitry Shurupov 2021-03-17 16:05:37 +07:00
parent 5c5c874788
commit 9629f51e76
14 changed files with 29 additions and 27 deletions

View file

@ -16,6 +16,7 @@ frontend/node_modules
openvpn-web-ui openvpn-web-ui
openvpn-ui openvpn-ui
openvpn-admin openvpn-admin
ovpn-admin
docker-compose.yaml docker-compose.yaml
docker-compose-slave.yaml docker-compose-slave.yaml

View file

@ -17,14 +17,14 @@ jobs:
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }} password: ${{ secrets.DOCKER_PASS }}
repository: flant/openvpn-admin repository: flant/ovpn-admin
tags: openvpn-latest tags: openvpn-latest
dockerfile: Dockerfile.openvpn dockerfile: Dockerfile.openvpn
- name: Push openvpn-admin image to Docker Hub - name: Push ovpn-admin image to Docker Hub
uses: docker/build-push-action@v1 uses: docker/build-push-action@v1
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }} password: ${{ secrets.DOCKER_PASS }}
repository: flant/openvpn-admin repository: flant/ovpn-admin
tags: latest tags: latest
dockerfile: Dockerfile dockerfile: Dockerfile

View file

@ -21,14 +21,14 @@ jobs:
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }} password: ${{ secrets.DOCKER_PASS }}
repository: flant/openvpn-admin repository: flant/ovpn-admin
tags: openvpn-${{ steps.get_version.outputs.VERSION }} tags: openvpn-${{ steps.get_version.outputs.VERSION }}
dockerfile: Dockerfile.openvpn dockerfile: Dockerfile.openvpn
- name: Push openvpn-admin image to Docker Hub - name: Push ovpn-admin image to Docker Hub
uses: docker/build-push-action@v1 uses: docker/build-push-action@v1
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }} password: ${{ secrets.DOCKER_PASS }}
repository: flant/openvpn-admin repository: flant/ovpn-admin
tags: ${{ steps.get_version.outputs.VERSION }} tags: ${{ steps.get_version.outputs.VERSION }}
dockerfile: Dockerfile dockerfile: Dockerfile

3
.gitignore vendored
View file

@ -7,6 +7,7 @@ ccd_slave
openvpn-web-ui openvpn-web-ui
openvpn-ui openvpn-ui
openvpn-admin openvpn-admin
ovpn-admin
frontend/node_modules frontend/node_modules
main-packr.go main-packr.go
@ -17,4 +18,4 @@ packrd/
*.suo *.suo
*.ntvs* *.ntvs*
*.njsproj *.njsproj
*.sln *.sln

View file

@ -5,11 +5,11 @@ RUN cd /app && npm install && npm run build
FROM golang:1.14.2-buster AS backend-builder FROM golang:1.14.2-buster AS backend-builder
COPY --from=frontend-builder /app/static /app/frontend/static COPY --from=frontend-builder /app/static /app/frontend/static
COPY . /app COPY . /app
RUN go get -u github.com/gobuffalo/packr/v2/packr2 && cd /app && packr2 && env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags='-linkmode external -extldflags "-static" -s -w' -o openvpn-admin && packr2 clean RUN go get -u github.com/gobuffalo/packr/v2/packr2 && cd /app && packr2 && env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags='-linkmode external -extldflags "-static" -s -w' -o ovpn-admin && packr2 clean
FROM alpine:3.13 FROM alpine:3.13
WORKDIR /app WORKDIR /app
COPY --from=backend-builder /app/openvpn-admin /app COPY --from=backend-builder /app/ovpn-admin /app
RUN apk add --update bash easy-rsa && \ RUN apk add --update bash easy-rsa && \
ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \ ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
wget https://github.com/pashcovich/openvpn-user/releases/download/v1.0.3-rc.1/openvpn-user-linux-amd64.tar.gz -O - | tar xz -C /usr/local/bin && \ wget https://github.com/pashcovich/openvpn-user/releases/download/v1.0.3-rc.1/openvpn-user-linux-amd64.tar.gz -O - | tar xz -C /usr/local/bin && \

View file

@ -7,6 +7,6 @@ cd frontend && npm install && npm run build && cd ..
packr2 packr2
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags "-linkmode external -extldflags -static -s -w" -o openvpn-admin CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags "-linkmode external -extldflags -static -s -w" -o ovpn-admin
packr2 clean packr2 clean

View file

@ -13,15 +13,15 @@ services:
- NET_ADMIN - NET_ADMIN
ports: ports:
- 7778:1194 # for openvpn - 7778:1194 # for openvpn
- 8081:8080 # for openvpn-admin because of network_mode - 8081:8080 # for ovpn-admin because of network_mode
volumes: volumes:
- ./easyrsa_slave:/etc/openvpn/easyrsa - ./easyrsa_slave:/etc/openvpn/easyrsa
- ./ccd_slave:/etc/openvpn/ccd - ./ccd_slave:/etc/openvpn/ccd
openvpn-admin: ovpn-admin:
build: build:
context: . context: .
image: openvpn-admin:local image: ovpn-admin:local
command: /app/openvpn-admin --debug --ovpn.network="172.16.100.0/22" --master.sync-token="TOKEN" --master.host="http://172.20.0.1:8080" --role="slave" --ovpn.server="127.0.0.1:7777:tcp" --ovpn.server="127.0.0.1:7778:tcp" --easyrsa.path="/mnt/easyrsa" --easyrsa.index-path="/mnt/easyrsa/pki/index.txt" command: /app/ovpn-admin --debug --ovpn.network="172.16.100.0/22" --master.sync-token="TOKEN" --master.host="http://172.20.0.1:8080" --role="slave" --ovpn.server="127.0.0.1:7777:tcp" --ovpn.server="127.0.0.1:7778:tcp" --easyrsa.path="/mnt/easyrsa" --easyrsa.index-path="/mnt/easyrsa/pki/index.txt"
environment: environment:
- OPVN_SLAVE=1 - OPVN_SLAVE=1
network_mode: service:openvpn network_mode: service:openvpn

View file

@ -11,15 +11,15 @@ services:
- NET_ADMIN - NET_ADMIN
ports: ports:
- 7777:1194 # for openvpn - 7777:1194 # for openvpn
- 8080:8080 # for openvpn-admin because of network_mode - 8080:8080 # for ovpn-admin because of network_mode
volumes: volumes:
- ./easyrsa_master:/etc/openvpn/easyrsa - ./easyrsa_master:/etc/openvpn/easyrsa
- ./ccd_master:/etc/openvpn/ccd - ./ccd_master:/etc/openvpn/ccd
openvpn-admin: ovpn-admin:
build: build:
context: . context: .
image: openvpn-admin:local image: ovpn-admin:local
command: /app/openvpn-admin --debug --ovpn.network="172.16.100.0/22" --master.sync-token="TOKEN" --easyrsa.path="/mnt/easyrsa" --easyrsa.index-path="/mnt/easyrsa/pki/index.txt" --ovpn.server="127.0.0.1:7777:tcp" command: /app/ovpn-admin --debug --ovpn.network="172.16.100.0/22" --master.sync-token="TOKEN" --easyrsa.path="/mnt/easyrsa" --easyrsa.index-path="/mnt/easyrsa/pki/index.txt" --ovpn.server="127.0.0.1:7777:tcp"
network_mode: service:openvpn network_mode: service:openvpn
volumes: volumes:
- ./easyrsa_master:/mnt/easyrsa - ./easyrsa_master:/mnt/easyrsa

View file

@ -1,5 +1,5 @@
{ {
"name": "openvpn-admin", "name": "ovpn-admin",
"version": "1.0.1a", "version": "1.0.1a",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,

View file

@ -1,5 +1,5 @@
{ {
"name": "openvpn-admin", "name": "ovpn-admin",
"description": "Vue.js admin ui for openvpn and easyrsa", "description": "Vue.js admin ui for openvpn and easyrsa",
"version": "1.0.1a", "version": "1.0.1a",
"author": "vitaliy.snurnitsin@gmail.com", "author": "vitaliy.snurnitsin@gmail.com",

View file

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>openvpn-admin</title> <title>ovpn-admin</title>
</head> </head>
<body> <body>
<script src="dist/style.min.js"></script> <script src="dist/style.min.js"></script>

2
go.mod
View file

@ -1,4 +1,4 @@
module openvpn-admin module ovpn-admin
go 1.14 go 1.14

View file

@ -36,8 +36,8 @@ const (
) )
var ( var (
listenHost = kingpin.Flag("listen.host","host for openvpn-admin").Default("0.0.0.0").String() listenHost = kingpin.Flag("listen.host","host for ovpn-admin").Default("0.0.0.0").String()
listenPort = kingpin.Flag("listen.port","port for openvpn-admin").Default("8080").String() listenPort = kingpin.Flag("listen.port","port for ovpn-admin").Default("8080").String()
serverRole = kingpin.Flag("role","server role master or slave").Default("master").HintOptions("master", "slave").String() serverRole = kingpin.Flag("role","server role master or slave").Default("master").HintOptions("master", "slave").String()
masterHost = kingpin.Flag("master.host","url for master server").Default("http://127.0.0.1").String() masterHost = kingpin.Flag("master.host","url for master server").Default("http://127.0.0.1").String()
masterBasicAuthUser = kingpin.Flag("master.basic-auth.user","user for basic auth on master server url").Default("").String() masterBasicAuthUser = kingpin.Flag("master.basic-auth.user","user for basic auth on master server url").Default("").String()

View file

@ -1,8 +1,8 @@
project: openvpn-admin project: ovpn-admin
configVersion: 1 configVersion: 1
--- ---
image: openvpn-admin image: ovpn-admin
dockerfile: Dockerfile dockerfile: Dockerfile
--- ---