Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e38ab4e
add first draft of dockerfile
bodane Feb 23, 2023
8b18dba
fix path related issues
bodane Feb 23, 2023
75fe7d2
added vpn client profile generator
bodane Feb 23, 2023
b3eb6a2
more guidance covering certs + docker info added
bodane Feb 23, 2023
9ed54bd
added missed portion of cert instructions
bodane Feb 23, 2023
71f19ff
updates for gaps, improvements and docker
bodane Feb 24, 2023
844873f
fixes to allow successful docker build. Run operator remains to be fixed
bodane Feb 24, 2023
d96abf6
updated paths for openvpn location changes
bodane Feb 24, 2023
b5176ca
updates iptables and ip forwarding/promiscious then runs openvpn serv…
bodane Feb 24, 2023
8a4159d
add missing profile folder for vpn profiles
bodane Feb 24, 2023
bec92df
Docker build + CI + Dockerhub image
Snider Feb 25, 2023
b3d5414
bugfix from last minute change
Snider Feb 25, 2023
135856c
creates profile folder if no exists
Snider Feb 25, 2023
9a521a5
moves over our conf and profile folders
Snider Feb 25, 2023
aaa57ed
moves over our conf and profile folders
Snider Feb 25, 2023
708fbce
copy across local .conf openvpn server profile files as well
bodane Feb 25, 2023
8b8c547
iptables policy added for connecting clients to prevent access to loc…
bodane Feb 25, 2023
037dad7
cleanup ip fwd/promisc mode for now. iptables stripped due to now bei…
bodane Feb 25, 2023
fdf44fd
Working Docker compile + vpn container
Snider Feb 25, 2023
d7bad05
path fixes for cert generation
Snider Feb 25, 2023
4922812
updates docker instructions
Snider Feb 25, 2023
e32192e
remove netscape reference which is deprecated
bodane Feb 26, 2023
67f9c08
make path updates with recent path changes, corrected syntax errors, …
bodane Feb 26, 2023
a3b747d
openvpn server-side conf file needs a static filename, ours isn't str…
bodane Feb 26, 2023
89cb605
docker usage updates based on test results
bodane Feb 26, 2023
b107edc
added strong hash and ciphers as a default
bodane Mar 4, 2023
64ed9d7
update shebang to not require absolute path to bash + attempt to reso…
bodane Mar 4, 2023
cace88d
fix shebang on last file + commit LF to conf file
bodane Mar 4, 2023
c708cef
point to correct openvpn conf file
bodane Mar 4, 2023
914fc09
update docker section in readme
bodane Mar 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: ubuntu
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
branches:
- main
- lthn
- further-improvements
pull_request:
branches:
- main
- lthn
- further-improvements
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Login to GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build
if: ${{ github.event_name != 'pull_request' }}
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
cache-to: ghcr.io/dappserver/openvpn
cache-from: ghcr.io/dappserver/openvpn
push: true
tags: lthn/openvpn,ghcr.io/dappserver/openvpn
- name: Docker Build
if: ${{ github.event_name == 'pull_request' }}
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
cache-to: ghcr.io/dappserver/openvpn
cache-from: ghcr.io/dappserver/openvpn
push: false
tags: lthn/openvpn,ghcr.io/dappserver/openvpn

55 changes: 55 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Use Ubuntu as the build image.
FROM lthn/ubuntu-build:20.04 as build

RUN apt-get update && apt-get install -y python-docutils python3-docutils

WORKDIR /build/lthn

# Copy source files
COPY . .

# Configure code checkout
RUN autoreconf -i -v -f

# Configure build for Linux amd64
RUN ./configure --prefix=/home/lthn

# Compile OpenVPN
RUN make -j2

RUN make install

# Use Ubuntu as the final image.
FROM ubuntu:20.04 as final

# Add Image Authors
LABEL org.opencontainers.image.authors="darbs@lethean.io,snider@lethean.io"

# Install necessary packages to run OpenVPN.
RUN apt-get update && apt-get install -y sudo openssl iptables libssl-dev libpam0g-dev liblzo2-dev

# Path where all openvpn scripts and configs will live.
WORKDIR /home/lthn/openvpn

# Copy openvpn binary
COPY --from=build --chmod=0777 /home/lthn /home/lthn
# Copy config & profile folders
COPY ./conf/ /home/lthn/openvpn/conf/
COPY ./profile/ /home/lthn/openvpn/profile/

# Copy all helper shell script files locally.
COPY --chmod=0777 ./*.sh /home/lthn/bin/
COPY ./*.conf ./

# Set Lethean environment PATH
ENV PATH=/home/lthn/bin:/home/lthn/sbin:${PATH}

# Expose the OpenVPN port
EXPOSE 1194/udp

# Set environment variables
ENV SCRIPT=""

# Run a specified script (if provided), or run OpenVPN server if none is provided.
CMD ["/bin/bash", "-c", "if [ -f \"$SCRIPT\" ]; then \"$SCRIPT\"; else /bin/bash startup.sh; fi"]

Loading