Skip to content

Commit

Permalink
feat: Merge PROTONVPN_SERVER and PROTONVPN_COUNTRY into `PROTONVP…
Browse files Browse the repository at this point in the history
…N_SERVER`.

BREAKING CHANGES:

- Specifying `PROTONVPN_SERVER` is now required environment variable.
- `PROTONVPN_COUNTRY` is merged into `PROTONVPN_SERVER`.
- Users who are migrating from version 4.x or below rename `PROTONVPN_COUNTRY` to `PROTONVPN_SERVER`.
- You can migrate value of `PROTONVPN_COUNTRY` to `PROTONVPN_SERVER`. Container will detect that you wish to connct to country specified and connect as usual.
  • Loading branch information
tprasadtp committed Jun 25, 2021
1 parent efff4ce commit e3e55ca
Show file tree
Hide file tree
Showing 36 changed files with 1,191 additions and 581 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_size = 2
indent_style = space
max_line_length = 80
insert_final_newline = true
Expand Down
1 change: 0 additions & 1 deletion .github/CODEOWNERS

This file was deleted.

1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/connectivity-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ about: Use this template for connectivty issues.

## Docker configuration

- [ ] Overiding `PROTONVPN_CHECK_URL`.
- [ ] Using custom runtime like gvisor (specify your runtime):
- [ ] Using user namespaces
- [ ] Using rootless containers
Expand Down
36 changes: 11 additions & 25 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
version: 2
updates:
# Docker Updates
- package-ecosystem: docker
labels:
- "Actor:Dependabot"
- "Deps:Docker"
# Allow Automerge for base image updates.
- "Luna:Automerge"
# Common settings
commit-message:
prefix: "chore(deps):"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
interval: "weekly"
day: "saturday"
pull-request-branch-name:
separator: "-"

- package-ecosystem: pip
labels:
- "Actor:Dependabot"
- "Deps:Python"
# Common settings
commit-message:
prefix: "chore(deps):"
directory: "/root"
schedule:
interval: "daily"
open-pull-requests-limit: 10
interval: "weekly"
day: "saturday"
pull-request-branch-name:
separator: "-"
ignore:
# Upstream is horrible at following semver specs
# They change interface names and even replace entire repos
# to a new ones between patch releases.
- dependency-name: "protonvpn-cli"

# Actions
- package-ecosystem: github-actions
Expand All @@ -40,22 +41,7 @@ updates:
prefix: "ci(deps):"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
interval: "weekly"
day: "saturday"
pull-request-branch-name:
separator: "-"
ignore:
# We trust official actions by GitHub
# we trust them for not breaking stuff
# and security.
- dependency-name: "actions/*"
- dependency-name: "github/codeql-action/upload-sarif"

# Labels is Frozen
- dependency-name: "tprasadtp/labels"

# Trust docker provided actions to
# not break stuff.
- dependency-name: docker/login-action
- dependency-name: docker/setup-buildx-action
- dependency-name: docker/setup-qemu-action
24 changes: 2 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Shellcheck
run: |
make show-vars-base
Expand All @@ -20,8 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Lint
run: |
make show-vars-base
Expand All @@ -32,9 +30,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: Make Variables for Debugging
run: |
Expand All @@ -54,21 +49,6 @@ jobs:
version: latest
install-only: true

- name: Install git-chglog
run: |
brew tap git-chglog/git-chglog
brew install git-chglog
- name: Generate Changelog
run: |
make changelog
cat docs/changelog.md
- name: Generate Release notes
run: |
make release-notes
cat RELEASE_NOTES.md
- name: Build snapshot
run: make snapshot

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: Make Variables for Debugging
run: |
Expand Down
4 changes: 2 additions & 2 deletions .kodiak.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require_automerge_label = true
# This Label is shared with Luna.
#-----------------------------------
# Conflicts are avoided by explicitly blacklisting Actor:Luna label
# Luna handles this gracefully by first, adding the label before doing
# Luna handles this gracefullym by first adding this label before doing
# any other tasks. If adding Actor:Luna label fails, Luna will not act
# on that PR/Issue.
automerge_label = "Luna:AutoMerge"
Expand Down Expand Up @@ -47,7 +47,7 @@ cut_body_after = "<!-- COMMIT-NOTES-END-->"
[merge.automerge_dependencies]
# only auto merge "minor" and "patch" version upgrades.
# do not automerge "major" version upgrades.
versions = ["minor", "patch"]
versions = ["patch"]
usernames = ["dependabot"]


Expand Down
47 changes: 28 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM ubuntu:focal-20210609
#syntax=docker/dockerfile:1.2

FROM ubuntu:focal-20210416 as upstream
FROM upstream as base

# Overlay defaults
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
Expand All @@ -10,25 +13,30 @@ ENV PROTONVPN_DNS_LEAK_PROTECT=1 \
PROTONVPN_PROTOCOL=udp \
PROTONVPN_EXCLUDE_CIDRS="169.254.169.254/32,169.254.170.2/32" \
PROTONVPN_CHECK_INTERVAL=60 \
PROTONVPN_FAIL_THRESHOLD=3

PROTONVPN_FAIL_THRESHOLD=3 \
PROTONVPN_CHECK_URL="https://ipinfo.prasadt.workers.dev/" \
PROTONVPN_CHECK_QUERY=".client.country"

ARG S6_OVERLAY_VERSION="2.2.0.3"

RUN rm -f /etc/apt/apt.conf.d/docker-clean \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache

# Install Packages
# hadolint ignore=DL3008
RUN apt-get -qq -o=Dpkg::Use-Pty=0 update \
&& apt-get -qq -o=Dpkg::Use-Pty=0 install --no-install-recommends --yes \
curl \
jq \
procps \
iptables \
iputils-ping \
net-tools \
openvpn \
bind9-host \
dialog \
python3-pip \
RUN --mount=type=tmpfs,target=/root/.gnupg/ \
apt-get update \
&& apt-get install --no-install-recommends --yes \
curl \
jq \
procps \
iptables \
iputils-ping \
net-tools \
openvpn \
bind9-host \
dialog \
python3-pip \
&& ARCH="$(uname -m)" \
&& export ARCH \
&& if [ "$ARCH" = "x86_64" ]; then \
Expand All @@ -55,14 +63,15 @@ RUN apt-get -qq -o=Dpkg::Use-Pty=0 update \
&& rm -rf /downloads/ \
&& rm -rf /var/lib/apt/lists/*

COPY root/ /
COPY --chown=root:root --chmod=0755 root/ /

# Install Proton CLI
RUN pip3 install \
# hadolint ignore=DL3042
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=cache,target=/root/.cache/wheel \
pip3 install \
--progress-bar=off \
--upgrade \
--no-cache-dir \
--no-cache-dir \
--disable-pip-version-check \
-r requirements.txt

Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ include $(REPO_ROOT)/makefiles/docker.mk

.PHONY: shellcheck
shellcheck: ## Runs shellcheck
@bash $(REPO_ROOT)/scripts/shellcheck.sh $(shell find $(REPO_ROOT)/root/etc/ -type f -executable)
@bash $(REPO_ROOT)/scripts/shellcheck.sh \
$(shell find $(REPO_ROOT)/root/etc/ -type f -executable) \
$(REPO_ROOT)/root/usr/local/lib/loggers/logger.sh

# go releaser
.PHONY: snapshot
Expand Down Expand Up @@ -64,6 +66,10 @@ release-notes: ## Generate release-notes
--output $(REPO_ROOT)/RELEASE_NOTES.md \
--release-notes

.PHONY: docs-server
docs-server: ## Server documentation
cd docs && python3 -m http.server

# Enforce BUILDKIT
ifneq ($(DOCKER_BUILDKIT),1)
# DO NOT INDENT!
Expand Down
Loading

0 comments on commit e3e55ca

Please sign in to comment.