-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a385895
Showing
7 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"` |