Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
klo2k committed Sep 5, 2020
0 parents commit a385895
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# top-most EditorConfig file
root = true

# Default style
[*]
# Default UTF-8 charset
charset = utf-8
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
# Indent with 4 spaces
indent_style = space
indent_size = 4
# Trim space at end of line
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Don't change line ending; Check-out as-is, commit as-is.
# i.e.: git config --global core.autocrlf false
* -text
32 changes: 32 additions & 0 deletions .github/workflows/deploy_development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy Development Build

# Trigger on push to "development" branch
on:
push:
branches:
- development
paths:
- .github/**
- files/**
- Dockerfile

jobs:
build_deploy_to_registry:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3.1.0

- name: Docker login
run: docker login --username '${{secrets.REGISTRY_USERNAME}}' --password '${{secrets.REGISTRY_ACCESS_TOKEN}}'

- name: Build + Push image ("development")
run: |
docker buildx build \
--platform "linux/amd64,linux/arm/v7,linux/arm64" \
--tag "${{secrets.REGISTRY_USERNAME}}/openconnect:development" \
--output "type=image,push=true" \
--file ./Dockerfile .
36 changes: 36 additions & 0 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy Release Build

# Trigger on release
on:
release:
types:
- released

jobs:
build_deploy_to_registry:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3.1.0

- name: Docker login
run: docker login --username '${{secrets.REGISTRY_USERNAME}}' --password '${{secrets.REGISTRY_ACCESS_TOKEN}}'

- name: Build + Push image (tag = git release tag)
run: |
docker buildx build \
--platform "linux/amd64,linux/arm/v7,linux/arm64" \
--tag "${{secrets.REGISTRY_USERNAME}}/openconnect:${GITHUB_REF#refs/tags/}" \
--output "type=image,push=true" \
--file ./Dockerfile .
- name: Build + Push image ("latest")
run: |
docker buildx build \
--platform "linux/amd64,linux/arm/v7,linux/arm64" \
--tag "${{secrets.REGISTRY_USERNAME}}/openconnect:latest" \
--output "type=image,push=true" \
--file ./Dockerfile .
29 changes: 29 additions & 0 deletions .github/workflows/validate_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Validate Pull Request

# Trigger on pull request, for things that warrants re-build
on:
pull_request:
branches:
- master
paths:
- .github/**
- files/**
- Dockerfile

jobs:
# Verify image build success
build_image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@master

- name: Build image (no push)
run: |
docker buildx build \
--platform "linux/amd64,linux/arm/v7,linux/arm64" \
--output "type=image,push=false" \
--file ./Dockerfile .
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM debian:10-slim

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update && \
apt install -y --no-install-recommends openconnect ca-certificates && \
apt clean

CMD openconnect --help
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# OpenConnect

OpenConnect is a multi-VPN-client for:
- [Cisco's AnyConnect SSL VPN](http://www.cisco.com/go/asm)
- [Pulse Connect Secure](https://www.pulsesecure.net/products/connect-secure/)
- [Palo Alto Networks GlobalProtect SSL VPN](https://www.paloaltonetworks.com/features/vpn)

This repository builds and publish Docker images for my own use, but you're more than welcome to use it.

For official source code, go to [openconnect/openconnect](https://github.com/openconnect/openconnect).

# Licence

All work in this repository is published as [GNU General Public License, version 3](https://www.gnu.org/licenses/gpl-3.0.en.html).




# Run with Docker

e.g. Connect to Palo Alto Networks GlobalProtect SSL VPN:
```
docker run --rm -it --privileged --net=host klo2k/openconnect openconnect --protocol=gp vpn.example.com
```




# Build with "docker buildx"

Initialise [buildx](https://docs.docker.com/buildx/working-with-buildx/), if you're on a x64 machine:
```
# Enable experimental mode
export DOCKER_CLI_EXPERIMENTAL=enabled
# Enable ARM support
docker run --rm --privileged linuxkit/binfmt:v0.8
# Create 'mybuilder' if not exist, set as default builder
docker buildx inspect mybuilder||docker buildx create --name mybuilder
docker buildx use mybuilder
# Start builder
docker buildx inspect --bootstrap
```

Build for x64 (x86_64):
```
docker buildx build --pull \
--platform "linux/amd64" \
--tag "klo2k/openconnect" \
--output=type=docker \
.
```

For ARM 32-bit (armv7l), use `--platform "linux/arm/v7"`

For ARM 64-bit (aarch64), use `--platform "linux/arm64"`

0 comments on commit a385895

Please sign in to comment.