Compare commits

...

5 Commits
v0.3.2 ... main

Author SHA1 Message Date
89fce64179 feat: add http-assets
All checks were successful
ZeroDownTime/zdt-openvpn/pipeline/head This commit looks good
ZeroDownTime/zdt-openvpn/pipeline/tag This commit looks good
2025-01-23 15:28:11 +00:00
a50042ad0f feat: Use Alpine 3.21, add branding
Some checks are pending
ZeroDownTime/zdt-openvpn/pipeline/head This commit looks good
ZeroDownTime/zdt-openvpn/pipeline/tag Build started...
2025-01-23 14:55:30 +00:00
3e0ec5fcb0 fix: reuse existing OTP config during re-issue of certs
All checks were successful
ZeroDownTime/zdt-openvpn/pipeline/head This commit looks good
2025-01-23 13:11:02 +00:00
10ad744336 Merge latest ci-tools-lib 2025-01-23 13:08:18 +00:00
ddfcada921 Squashed '.ci/' changes from 3feaf6f..15e4d1f
15e4d1f ci: make work with main branch

git-subtree-dir: .ci
git-subtree-split: 15e4d1f589c8e055944b2a4b58a9a50728e245b4
2025-01-23 13:08:18 +00:00
9 changed files with 60 additions and 7 deletions

View File

@ -14,7 +14,7 @@ include .ci/podman.mk
Add subtree to your project:
```
git subtree add --prefix .ci https://git.zero-downtime.net/ZeroDownTime/ci-tools-lib.git master --squash
git subtree add --prefix .ci https://git.zero-downtime.net/ZeroDownTime/ci-tools-lib.git main --squash
```

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.png filter=lfs diff=lfs merge=lfs -text

View File

@ -1,4 +1,4 @@
ARG ALPINE_VERSION=3.20
ARG ALPINE_VERSION=3.21
FROM alpine:${ALPINE_VERSION}
ARG ALPINE_VERSION
@ -36,10 +36,14 @@ EXPOSE 1194/udp
ADD ./bin /usr/local/bin
RUN chmod a+x /usr/local/bin/* && \
mkdir -p /etc/openvpn-oauth
mkdir -p /etc/openvpn-oauth \
/opt/http-assets
# Add support for OTP authentication using a PAM module
ADD ./otp/openvpn /etc/pam.d/
ADD ./pam.d/openvpn /etc/pam.d/
# Add http branding assets
ADD ./http-assets /opt/http-assets
# Breaks all easyrsa commands locally due to UID mappings
# would require podman as plain docker doesnt support keep-id

6
bin/openvpn-auth-oauth2.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# copy http-assets
cp /opt/http-assets/* /etc/openvpn-oauth/http-assets
openvpn-auth-oauth2 --config /etc/openvpn-oauth/config.yaml

View File

@ -32,6 +32,9 @@ cat << EOF | easyrsa build-client-full "$cn" nopass
yes
EOF
# Skip confirmation if not running in interctive mode. Essential for integration tests.
google-authenticator --time-based --disallow-reuse --force --rate-limit=3 --rate-time=30 --window-size=3 \
# Do not overwrite potential existing config during the re-issue flow
if [ ! -f /etc/openvpn/otp/${cn}.google_authenticator ] ; then
# Skip confirmation if not running in interctive mode. Essential for integration tests.
google-authenticator --time-based --disallow-reuse --force --rate-limit=3 --rate-time=30 --window-size=3 \
-l "${cn}" -i "${server}" -s /etc/openvpn/otp/${cn}.google_authenticator --no-confirm -q
fi

View File

@ -32,4 +32,6 @@ echo "Revoked $cn"
echo "Updating crl.pem"
easyrsa gen-crl
rm -f $OPENVPN/pki/issued/$cn.crt $OPENVPN/pki/private/$cn.key $OPENVPN/pki/reqs/$cn.req $OPENVPN/otp/$cn.google_authenticator
rm -f $OPENVPN/pki/issued/$cn.crt $OPENVPN/pki/private/$cn.key $OPENVPN/pki/reqs/$cn.req
# do not delete OTP to allow reuse after re-issued cert, left overs OTP data wont hurt anyone
# rm -f $OPENVPN/otp/$cn.google_authenticator

BIN
http-assets/logo.png (Stored with Git LFS) Normal file

Binary file not shown.

34
http-assets/style.css Normal file
View File

@ -0,0 +1,34 @@
/* overlay for MVP.css v1.15 - https://github.com/andybrewer/mvp */
:root {
--active-brightness: 0.85;
--border-radius: 5px;
--box-shadow: 2px 2px 10px;
--color-accent: #118bee15;
--color-bg: #0d0711;
--color-bg-secondary: #e9e9e9;
--color-link: #118bee;
--color-secondary: #920de9;
--color-secondary-accent: #920de90b;
--color-shadow: #f4f4f4;
--color-table: #118bee;
--color-text: #737f8a;
--color-text-secondary: #999;
--color-scrollbar: #cacae8;
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
--hover-brightness: 1.2;
--justify-important: center;
--justify-normal: left;
--line-height: 1.5;
--width-card: 285px;
--width-card-medium: 460px;
--width-card-wide: 800px;
--width-content: 1080px;
}
header {
background-image: url(logo.png);
background-repeat: no-repeat;
background-position-x: center;
text-align: var(--justify-important);
}