Skip to content

Commit c7db47e

Browse files
authored
Merge pull request #44 from d3vilh/dev
Dev2main 0.9.4.1
2 parents cebd606 + fafb7b7 commit c7db47e

File tree

437 files changed

+11339
-4959
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

437 files changed

+11339
-4959
lines changed

build/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
FROM DEFINE-YOUR-ARCH
55
LABEL maintainer="Mr.Philipp <[email protected]>"
6-
LABEL version="0.9.4"
6+
LABEL version="0.9.4.1"
77
WORKDIR /opt
88
EXPOSE 8080/tcp
99

build/Dockerfile-beego

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ FROM DEFINE-YOUR-ARCH
44

55
LABEL maintainer="Mr.Philipp <[email protected]>"
66

7-
# Set the working directory to /tmp1
8-
WORKDIR /tmp1
7+
# Set the working directory to /beego and installing dependencies
8+
WORKDIR /beego
99
RUN apt-get update && apt-get install git musl-tools -y
1010

1111
# Enable go modules
@@ -21,10 +21,9 @@ RUN go mod download
2121
# Install the beego and bee packages
2222
RUN go install github.com/beego/bee/v2@develop
2323

24-
# qrencode build
24+
# Setting working directory to /app and getting qrencode from github
2525
WORKDIR /app
2626
RUN git clone https://github.com/d3vilh/qrencode
27-
#RUN cd qrencode && go build -o qrencode main.go && chmod +x qrencode
2827

2928
# Set the working directory to /
3029
WORKDIR /

build/assets/genclient.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ cd $EASY_RSA
3838
# Generate certificates
3939
if [[ -z $CERT_PASS ]]; then
4040
echo 'Without password...'
41-
./easyrsa --batch --req-cn="$CERT_NAME" --days="$EASYRSA_CERT_EXPIRE" --req-email="$EASYRSA_REQ_EMAIL" gen-req "$CERT_NAME" nopass subject="/C=$EASYRSA_REQ_COUNTRY/ST=$EASYRSA_REQ_PROVINCE/L=$EASYRSA_REQ_CITY/O=$EASYRSA_REQ_ORG/OU=$EASYRSA_REQ_OU"
41+
./easyrsa --batch --req-cn="$CERT_NAME" --days="$EASYRSA_CERT_EXPIRE" --req-email="$EASYRSA_REQ_EMAIL" gen-req "$CERT_NAME" nopass subject="/C=$EASYRSA_REQ_COUNTRY/ST=$EASYRSA_REQ_PROVINCE/L=\"$EASYRSA_REQ_CITY\"/O=\"$EASYRSA_REQ_ORG\"/OU=\"$EASYRSA_REQ_OU\""
4242
else
4343
echo 'With password...'
4444
# See https://stackoverflow.com/questions/4294689/how-to-generate-an-openssl-key-using-a-passphrase-from-the-command-line
4545
# ... and https://stackoverflow.com/questions/22415601/using-easy-rsa-how-to-automate-client-server-creation-process
4646
# ... and https://github.com/OpenVPN/easy-rsa/blob/master/doc/EasyRSA-Advanced.md
47-
(echo -e '\n') | ./easyrsa --batch --req-cn="$CERT_NAME" --days="$EASYRSA_CERT_EXPIRE" --req-email="$EASYRSA_REQ_EMAIL" --passin=pass:${CERT_PASS} --passout=pass:${CERT_PASS} gen-req "$CERT_NAME" subject="/C=$EASYRSA_REQ_COUNTRY/ST=$EASYRSA_REQ_PROVINCE/L=$EASYRSA_REQ_CITY/O=$EASYRSA_REQ_ORG/OU=$EASYRSA_REQ_OU"
47+
(echo -e '\n') | ./easyrsa --batch --req-cn="$CERT_NAME" --days="$EASYRSA_CERT_EXPIRE" --req-email="$EASYRSA_REQ_EMAIL" --passin=pass:${CERT_PASS} --passout=pass:${CERT_PASS} gen-req "$CERT_NAME" subject="/C=$EASYRSA_REQ_COUNTRY/ST=$EASYRSA_REQ_PROVINCE/L=\"$EASYRSA_REQ_CITY\"/O=\"$EASYRSA_REQ_ORG\"/OU=\"$EASYRSA_REQ_OU\""
4848
fi
4949

5050
# Sign request

build/build_openvpn-ui.sh renamed to build/build.sh

+18-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#!/bin/bash
2-
# Exit immediately if a command exits with a non-zero status
3-
# VERSION 1.2 by [email protected] aka Mr. Philipp
4-
# based on [email protected] script - https://github.com/bugsyb/openvpn-web-ui-docker-build/blob/a791ea279deaf9459fd4a2049a0fdb2fe222e37a/build_openvpn-ui.sh
5-
set -e
2+
# VERSION 1.3 by [email protected] aka Mr. Philipp. Thanks [email protected] for all the efforts ;)
3+
set -e # Exit immediately if a command exits with a non-zero status. Set -x option for debugging
64

7-
# Determine the machine architecture
5+
# Define the machine architecture
86
# PLATFORM="linux/amd64" # arm64v8 = "linux/arm64/v8", arm32v5 - "linux/arm/v5", arm32v7 - "linux/arm/v7", amd64 - "linux/amd64"
97
ARCH=$(uname -m)
108
case $ARCH in
@@ -47,24 +45,33 @@ printf "Dockerfiles updated \n\033[1;34mBuilding Golang and Bee enviroment.\033[
4745
# Build golang & bee environment
4846
docker build --platform=$PLATFORM -f Dockerfile-beego -t local/beego-v8 -t local/beego-v8:latest .
4947
printf "\033[1;34mBuilding OpenVPN-UI and qrencode binaries.\033[0m\n"
50-
./openvpn-ui-pack2.sh
5148

49+
# Run a beego-v8 container to build qrencode and execute bee pack
50+
time docker run \
51+
-v "$PWD/../":/go/src/github.com/d3vilh/openvpn-ui \
52+
-e GO111MODULE='auto' \
53+
-e CGO_ENABLED=1 \
54+
--rm \
55+
-w /usr/src/myapp \
56+
local/beego-v8 \
57+
sh -c "cd /go/src/github.com/d3vilh/openvpn-ui/ && go env -w GOFLAGS="-buildvcs=false" && bee version && CGO_ENABLED=1 CC=musl-gcc bee pack -exr='^vendor|^ace.tar.bz2|^data.db|^build|^README.md|^docs' && cd /app/qrencode && go build -o qrencode main.go && chmod +x /app/qrencode/qrencode && cp -p /app/qrencode/qrencode /go/src/github.com/d3vilh/openvpn-ui/"
5258
printf "OpenVPN-UI and qrencode were built \n\033[1;34mBuilding OpenVPN-UI image.\033[0m\n"
59+
5360
# Build OpenVPN-UI image
54-
PKGFILE="openvpn-ui.tar.gz"
5561
QRFILE="qrencode"
56-
cp -f ../$PKGFILE ./
62+
UIFILE="openvpn-ui.tar.gz"
5763
cp -f ../$QRFILE ./
64+
cp -f ../$UIFILE ./
5865

66+
# Build openvpn-ui image
5967
docker build -t local/openvpn-ui .
60-
rm -f $PKGFILE; rm -f $(basename $PKGFILE); #rm -f $QRFILE;
68+
rm -f $UIFILE; rm -f $(basename $UIFILE); #rm -f $QRFILE;
6169
printf "\033[1;34mAll done.\033[0m\n"
70+
6271
# Benchmarking the end time record
6372
end_time=$(date +%s)
64-
6573
# Calculate the execution time in seconds
6674
execution_time=$((end_time - start_time))
67-
6875
# Calculate the execution time in minutes and seconds
6976
minutes=$((execution_time / 60))
7077
seconds=$((execution_time % 60))

build/go.mod

+16-18
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module github.com/d3vilh/openvpn-ui
22

3-
go 1.21
3+
go 1.21.1
44

55
require (
6-
github.com/beego/beego/v2 v2.1.1
7-
github.com/cloudfoundry/gosigar v1.3.27
8-
github.com/d3vilh/openvpn-server-config v0.3.4
6+
github.com/beego/beego/v2 v2.1.4
7+
github.com/cloudfoundry/gosigar v1.3.39
8+
github.com/d3vilh/openvpn-server-config v0.3.5
99
github.com/go-ldap/ldap/v3 v3.4.6
10-
github.com/mattn/go-sqlite3 v1.14.17
10+
github.com/mattn/go-sqlite3 v1.14.19
1111
gopkg.in/hlandau/passlib.v1 v1.0.11
1212
)
1313

@@ -16,26 +16,24 @@ require (
1616
github.com/beorn7/perks v1.0.1 // indirect
1717
github.com/cespare/xxhash/v2 v2.2.0 // indirect
1818
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
19-
github.com/golang/protobuf v1.5.3 // indirect
20-
github.com/google/uuid v1.3.1 // indirect
19+
github.com/google/uuid v1.5.0 // indirect
2120
github.com/hashicorp/golang-lru v1.0.2 // indirect
2221
github.com/kr/text v0.2.0 // indirect
23-
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
22+
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
2423
github.com/mitchellh/mapstructure v1.5.0 // indirect
2524
github.com/pkg/errors v0.9.1 // indirect
26-
github.com/prometheus/client_golang v1.16.0 // indirect
27-
github.com/prometheus/client_model v0.4.0 // indirect
28-
github.com/prometheus/common v0.44.0 // indirect
29-
github.com/prometheus/procfs v0.11.1 // indirect
25+
github.com/prometheus/client_golang v1.17.0 // indirect
26+
github.com/prometheus/client_model v0.5.0 // indirect
27+
github.com/prometheus/common v0.45.0 // indirect
28+
github.com/prometheus/procfs v0.12.0 // indirect
3029
github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02 // indirect
3130
github.com/sirupsen/logrus v1.9.3 // indirect
32-
github.com/stretchr/testify v1.8.4 // indirect
3331
github.com/valyala/bytebufferpool v1.0.0 // indirect
34-
golang.org/x/crypto v0.13.0 // indirect
35-
golang.org/x/net v0.15.0 // indirect
36-
golang.org/x/sys v0.12.0 // indirect
37-
golang.org/x/text v0.13.0 // indirect
38-
google.golang.org/protobuf v1.31.0 // indirect
32+
golang.org/x/crypto v0.17.0 // indirect
33+
golang.org/x/net v0.19.0 // indirect
34+
golang.org/x/sys v0.15.0 // indirect
35+
golang.org/x/text v0.14.0 // indirect
36+
google.golang.org/protobuf v1.32.0 // indirect
3937
gopkg.in/hlandau/easymetric.v1 v1.0.0 // indirect
4038
gopkg.in/hlandau/measurable.v1 v1.0.1 // indirect
4139
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)