From b76639308a0a2846a4b3f740e8ed204faafa07e7 Mon Sep 17 00:00:00 2001 From: Sam Sipe Date: Wed, 17 Feb 2021 18:29:03 -0500 Subject: [PATCH 1/2] fix comma in wg config, Dockerfile, Makefile --- Dockerfile | 2 +- Makefile | 24 ++++++++++++++++++------ roles/wireguard/defaults/main.yml | 6 ++---- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 90f23819e..75b2ffa3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:3-alpine ARG VERSION="git" -ARG PACKAGES="bash libffi openssh-client openssl rsync tini gcc libffi-dev linux-headers make musl-dev openssl-dev" +ARG PACKAGES="bash libffi openssh-client openssl rsync tini gcc libffi-dev linux-headers make musl-dev openssl-dev cargo" LABEL name="algo" \ version="${VERSION}" \ diff --git a/Makefile b/Makefile index 0ef19ce7e..f739055ff 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ ## docker-build: Build and tag a docker image .PHONY: docker-build -IMAGE := trailofbits/algo -TAG := latest -DOCKERFILE := Dockerfile -CONFIGURATIONS := $(shell pwd) +IMAGE := trailofbits/algo +TAG := latest +DOCKERFILE := Dockerfile +PWD := $$(pwd) docker-build: docker build \ @@ -21,10 +21,22 @@ docker-deploy: --cap-drop=all \ --rm \ -it \ - -v $(CONFIGURATIONS):/data \ + -v $(PWD):/data \ $(IMAGE):$(TAG) -## docker-clean: Remove images and containers. +# update the users on existing VPN +.PHONY: docker-update + +docker-update: + docker run \ + --cap-drop=all \ + --rm \ + -it \ + -e "ALGO_ARGS=update-users" \ + -v $(PWD):/data \ + $(IMAGE):$(TAG) + +## docker-prune: Remove images and containers. .PHONY: docker-prune docker-prune: diff --git a/roles/wireguard/defaults/main.yml b/roles/wireguard/defaults/main.yml index 171530a83..9f43fa482 100644 --- a/roles/wireguard/defaults/main.yml +++ b/roles/wireguard/defaults/main.yml @@ -13,8 +13,6 @@ wireguard_dns_servers: >- {% for host in dns_servers.ipv4 %}{{ host }}{% if not loop.last %},{% endif %}{% endfor %}{% if ipv6_support %},{% for host in dns_servers.ipv6 %}{{ host }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %} {% endif %} wireguard_client_ip: >- - {{ wireguard_network_ipv4 | ipmath(index|int+2) }} - {{ ',' + wireguard_network_ipv6 | ipmath(index|int+2) if ipv6_support else '' }} + {{ wireguard_network_ipv4 | ipmath(index|int+2) }}{{ ', ' + wireguard_network_ipv6 | ipmath(index|int+2) if ipv6_support else '' }} wireguard_server_ip: >- - {{ wireguard_network_ipv4 | ipaddr('1') }} - {{ ',' + wireguard_network_ipv6 | ipaddr('1') if ipv6_support else '' }} + {{ wireguard_network_ipv4 | ipaddr('1') }}{{ ', ' + wireguard_network_ipv6 | ipaddr('1') if ipv6_support else '' }} From e15f0d7f8da6b4f25e551c04162cef27f9e8dad6 Mon Sep 17 00:00:00 2001 From: Sam Sipe Date: Sun, 22 Aug 2021 15:24:49 -0400 Subject: [PATCH 2/2] jinja2==2.8 fix --- playbooks/cloud-pre.yml | 1 - requirements.txt | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/cloud-pre.yml b/playbooks/cloud-pre.yml index 2e07d2474..2cc6fcbb4 100644 --- a/playbooks/cloud-pre.yml +++ b/playbooks/cloud-pre.yml @@ -21,7 +21,6 @@ state: present name: - pyOpenSSL>=0.15 - - jinja2==2.8 - segno tags: - always diff --git a/requirements.txt b/requirements.txt index f90652f7c..52f678c9b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ ansible==2.9.7 +jinja2==2.8 netaddr