diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7928ca4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +# Override for Makefile +[{Makefile, makefile, GNUmakefile}] +indent_style = tab +indent_size = 4 + +[Makefile.*] +indent_style = tab +indent_size = 4 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a6659d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build-harness/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3e655bf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +sudo: required +addons: + apt: + packages: + - git + - make + - curl +env: + - DOCKER_IMAGE_NAME=cloudposse/pritunl +services: +- docker +install: +- make init +- make docker/login + +script: +- make docker/build + +after_success: +- make travis/docker-tag-and-push diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..41c2863 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu:16.04 + +ENV DEBIAN_FRONTEND noninteractive + +ENV PRITUNL_CONFIG= +ENV PRITUNL_MAIN_CONFIG=/etc/pritunl.conf + +EXPOSE 9700 +EXPOSE 443 +EXPOSE 80 +EXPOSE 1194 + +ENTRYPOINT ["/init"] + +ENV VERSION="1.29.1979.98" + +RUN echo 'deb http://repo.pritunl.com/stable/apt xenial main' > /etc/apt/sources.list.d/pritunl.list \ + && echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 42F3E95A2C4F08279C4960ADD68FA50FEA312927 \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 8E6DA8B4E158C569 \ + && apt-get update -q \ + && apt-get install locales \ + && locale-gen en_US en_US.UTF-8 \ + && dpkg-reconfigure locales \ + && ln -sf /usr/share/zoneinfo/UTC /etc/localtime \ + && apt-get upgrade -y -q \ + && apt-get dist-upgrade -y -q \ + && apt-get -y install pritunl iptables \ + && apt-get clean \ + && apt-get -y -q autoclean \ + && apt-get -y -q autoremove \ + && rm -rf /tmp/* + +ADD rootfs / diff --git a/LICENSE b/LICENSE index 8dada3e..a6e3b3e 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright 2017-2019 Cloud Posse, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13c9c14 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +SHELL = /bin/bash +export BUILD_HARNESS_PATH ?= $(shell until [ -d "build-harness" ] || [ "`pwd`" == '/' ]; do cd ..; done; pwd)/build-harness +-include $(BUILD_HARNESS_PATH)/Makefile + +.PHONY : init +## Init build-harness +init: + @curl --retry 5 --retry-delay 1 https://raw.githubusercontent.com/cloudposse/build-harness/master/bin/install.sh | bash + +.PHONY : clean +## Clean build-harness +clean: + @rm -rf $(BUILD_HARNESS_PATH) diff --git a/rootfs/init b/rootfs/init new file mode 100755 index 0000000..e686394 --- /dev/null +++ b/rootfs/init @@ -0,0 +1,9 @@ +#!/bin/sh +[ "${MONGODB_URI}" ] && pritunl set-mongodb ${MONGODB_URI} + +if [ -f "${PRITUNL_CONFIG}" ]; then + cat ${PRITUNL_CONFIG} | xargs -n 2 pritunl set +fi + + +exec env GODEBUG=netdns=cgo /usr/bin/pritunl start