From 1ccd2d22cfc06907117f490337ce14edd593352f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20H=C3=B8rup?= Date: Wed, 19 Jul 2023 09:21:03 +0200 Subject: [PATCH 1/4] Updated README.MD for zsh shell, removed version requirement for Terraform Provider for Scaleway, updated acl definition to avoid deprecated syntax. --- .gitignore | 1 + scw/README.md | 6 ++++-- scw/scw-generic.tf | 1 - scw/scw-storage.tf | 6 +++++- scw/scw.tfvars | 10 +++++----- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 2631b96..006c786 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ *-setup-*.sh *-init-*.yml *.swp +.DS_Store diff --git a/scw/README.md b/scw/README.md index bea91e4..a59f98f 100644 --- a/scw/README.md +++ b/scw/README.md @@ -30,11 +30,13 @@ brew install terraform git curl -o ~/scw -L "https://github.com/scaleway/scaleway-cli/releases/download/v2.3.0/scw-2.3.0-darwin-x86_64" chmod +x ~/scw -# Add alias +# Add alias (bash) echo "alias scw ~/scw" >> ~/.bash_profile && source ~/.bash_profile +# ...or zsh +echo "alias scw=\"~/scw\"" >> ~/.zshrc && source ~/.zshrc # Verify the three are installed -which terraform git gcloud scw +which terraform git scw # Skip down to 'git clone' below ``` diff --git a/scw/scw-generic.tf b/scw/scw-generic.tf index 32b3ed6..a222609 100644 --- a/scw/scw-generic.tf +++ b/scw/scw-generic.tf @@ -2,7 +2,6 @@ terraform { required_providers { scaleway = { source = "scaleway/scaleway" - version = "2.0.0-rc1" } } required_version = ">= 0.13" diff --git a/scw/scw-storage.tf b/scw/scw-storage.tf index a64d6fe..19971a9 100644 --- a/scw/scw-storage.tf +++ b/scw/scw-storage.tf @@ -1,5 +1,9 @@ resource "scaleway_object_bucket" "scw-backup-bucket" { name = "${var.scw_prefix}-backup-bucket-${random_string.scw-random.result}" - acl = "private" region = var.scw_region } + +resource "scaleway_object_bucket_acl" "scw-backup-bucket" { + bucket = "${var.scw_prefix}-backup-bucket-${random_string.scw-random.result}" + acl = "private" +} \ No newline at end of file diff --git a/scw/scw.tfvars b/scw/scw.tfvars index ce12282..bf1896d 100644 --- a/scw/scw.tfvars +++ b/scw/scw.tfvars @@ -1,10 +1,10 @@ ## COMMON ## -ph_password = "changeme1" -ssh_key = "ssh-rsa AAAAB3replace_me_replace_me_replace_me" -mgmt_cidr = "1.2.3.4/32" +ph_password = "mnementh" +ssh_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIXr0/LJf26LpFtTiIvNI2epaTvxWvMDZWvLYBkT90ES login" +mgmt_cidr = "85.204.120.4/32" -scw_accesskey = "changeme2" -scw_secretkey = "changeme3" +scw_accesskey = "SCWCEDE550DSHX9PY88Z" +scw_secretkey = "7c7e7f55-9bd7-4ae8-a93f-153e6c1535e4" # The number of wireguard peer configurations to generate / store - 1 per device wireguard_peers = 20 From 9a41d9ccc130e42f8748e1b146f71948dba7ba17 Mon Sep 17 00:00:00 2001 From: thoerup <59938705+thoerup@users.noreply.github.com> Date: Wed, 19 Jul 2023 09:31:16 +0200 Subject: [PATCH 2/4] Delete scw.tfvars --- scw/scw.tfvars | 52 -------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 scw/scw.tfvars diff --git a/scw/scw.tfvars b/scw/scw.tfvars deleted file mode 100644 index bf1896d..0000000 --- a/scw/scw.tfvars +++ /dev/null @@ -1,52 +0,0 @@ -## COMMON ## -ph_password = "mnementh" -ssh_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIXr0/LJf26LpFtTiIvNI2epaTvxWvMDZWvLYBkT90ES login" -mgmt_cidr = "85.204.120.4/32" - -scw_accesskey = "SCWCEDE550DSHX9PY88Z" -scw_secretkey = "7c7e7f55-9bd7-4ae8-a93f-153e6c1535e4" - -# The number of wireguard peer configurations to generate / store - 1 per device -wireguard_peers = 20 - -# dns over https provider, one of adguard applied-privacy cloudflare google hurricane-electric libre-dns opendns pi-dns quad9-recommended - see https://github.com/curl/curl/wiki/DNS-over-HTTPS -doh_provider = "opendns" - -# Generate wireguard client configurations to route only "dns" traffic through VPN, or: -# "peers" - dns + other connected peers -# "all" - all traffic -# The wireguard server container does NOT restrict clients, clients can change their AllowedIPs as desired. -# either "dns" "peers" or "all" -vpn_traffic = "dns" - -# a value of 1 permits mgmt_cidr access to DNS without the VPN -dns_novpn = 1 - -# additional client networks granted access pihole DNS without the VPN, example format: -# client_cidrs = ["127.0.0.1/32","8.8.8.8/32"] -client_cidrs = [] - -# Ensure the region/zone has the instance type available! -# See: https://console.scaleway.com/instance/servers/create -# and see: https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/guides/regions_and_zones -scw_region = "nl-ams" -scw_zone = "nl-ams-1" -scw_image = "ubuntu_jammy" -scw_size = "STARDUST1-S" - -## UNCOMMON ## -scw_prefix = "cloudblock" -project_url = "https://github.com/chadgeary/cloudblock" - -# Change if ip/port settings would interfere with existing scw networks, local networks, or container networks -scw_cidr = "10.10.13.0/24" - -# Change if ip/port settings would interfere with existing networks, should all be within a /24 -vpn_cidr = "0.0.0.0/0" -docker_network = "172.18.0.0" -docker_gw = "172.18.0.1" -docker_doh = "172.18.0.2" -docker_pihole = "172.18.0.3" -docker_wireguard = "172.18.0.4" -docker_webproxy = "172.18.0.5" -wireguard_network = "172.19.0.0" From bce0e9c0c12e030174a3d3de8d25a151d218876b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20H=C3=B8rup?= Date: Wed, 19 Jul 2023 09:32:27 +0200 Subject: [PATCH 3/4] Template .tfvars file added --- scw/scw.tfvars | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scw/scw.tfvars b/scw/scw.tfvars index bf1896d..ce12282 100644 --- a/scw/scw.tfvars +++ b/scw/scw.tfvars @@ -1,10 +1,10 @@ ## COMMON ## -ph_password = "mnementh" -ssh_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIXr0/LJf26LpFtTiIvNI2epaTvxWvMDZWvLYBkT90ES login" -mgmt_cidr = "85.204.120.4/32" +ph_password = "changeme1" +ssh_key = "ssh-rsa AAAAB3replace_me_replace_me_replace_me" +mgmt_cidr = "1.2.3.4/32" -scw_accesskey = "SCWCEDE550DSHX9PY88Z" -scw_secretkey = "7c7e7f55-9bd7-4ae8-a93f-153e6c1535e4" +scw_accesskey = "changeme2" +scw_secretkey = "changeme3" # The number of wireguard peer configurations to generate / store - 1 per device wireguard_peers = 20 From 3d76801226cd9e1c0c8e5add15dd70bd6cd29068 Mon Sep 17 00:00:00 2001 From: thoerup <59938705+thoerup@users.noreply.github.com> Date: Wed, 19 Jul 2023 09:35:03 +0200 Subject: [PATCH 4/4] Add files via upload --- scw/scw.tfvars | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 scw/scw.tfvars diff --git a/scw/scw.tfvars b/scw/scw.tfvars new file mode 100644 index 0000000..ce12282 --- /dev/null +++ b/scw/scw.tfvars @@ -0,0 +1,52 @@ +## COMMON ## +ph_password = "changeme1" +ssh_key = "ssh-rsa AAAAB3replace_me_replace_me_replace_me" +mgmt_cidr = "1.2.3.4/32" + +scw_accesskey = "changeme2" +scw_secretkey = "changeme3" + +# The number of wireguard peer configurations to generate / store - 1 per device +wireguard_peers = 20 + +# dns over https provider, one of adguard applied-privacy cloudflare google hurricane-electric libre-dns opendns pi-dns quad9-recommended - see https://github.com/curl/curl/wiki/DNS-over-HTTPS +doh_provider = "opendns" + +# Generate wireguard client configurations to route only "dns" traffic through VPN, or: +# "peers" - dns + other connected peers +# "all" - all traffic +# The wireguard server container does NOT restrict clients, clients can change their AllowedIPs as desired. +# either "dns" "peers" or "all" +vpn_traffic = "dns" + +# a value of 1 permits mgmt_cidr access to DNS without the VPN +dns_novpn = 1 + +# additional client networks granted access pihole DNS without the VPN, example format: +# client_cidrs = ["127.0.0.1/32","8.8.8.8/32"] +client_cidrs = [] + +# Ensure the region/zone has the instance type available! +# See: https://console.scaleway.com/instance/servers/create +# and see: https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/guides/regions_and_zones +scw_region = "nl-ams" +scw_zone = "nl-ams-1" +scw_image = "ubuntu_jammy" +scw_size = "STARDUST1-S" + +## UNCOMMON ## +scw_prefix = "cloudblock" +project_url = "https://github.com/chadgeary/cloudblock" + +# Change if ip/port settings would interfere with existing scw networks, local networks, or container networks +scw_cidr = "10.10.13.0/24" + +# Change if ip/port settings would interfere with existing networks, should all be within a /24 +vpn_cidr = "0.0.0.0/0" +docker_network = "172.18.0.0" +docker_gw = "172.18.0.1" +docker_doh = "172.18.0.2" +docker_pihole = "172.18.0.3" +docker_wireguard = "172.18.0.4" +docker_webproxy = "172.18.0.5" +wireguard_network = "172.19.0.0"