From 1efc1ffd44c899c72b1fb20b05e6a792bceb08da Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 23 Aug 2024 12:55:22 -0500 Subject: [PATCH] provisioning updates --- Makefile | 2 +- README.md | 2 +- provisioning/packer-amd64.pkr.hcl | 16 +++++++++++++--- provisioning/scripts/install_vpn.sh | 5 ++++- webapp/README.md | 5 ----- 5 files changed, 19 insertions(+), 11 deletions(-) delete mode 100644 webapp/README.md diff --git a/Makefile b/Makefile index bb6fb2e..93e7ee8 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ test: go test ./... install-aws: - cd provisioning && AWS_PROFILE=in4it-vpn-server packer build -var-file=whitelist.pkr.hcl packer-amd64.pkr.hcl + cd provisioning && AWS_PROFILE=in4it-vpn-server AWS_REGION=us-east-1 packer build -var-file=whitelist.pkr.hcl packer-amd64.pkr.hcl install-gcp: cd provisioning && packer build packer-gcp-amd64.pkr.hcl diff --git a/README.md b/README.md index ab0d80f..e13a77f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # VPN Server ## Usage -You can launch the WireGuard® based VPN server for production use from the [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-dymnyb6a2pq72), the [Azure Marketplace]( +You can launch the WireGuard® based VPN server for production use from the [AWS Marketplace (License Included)](https://aws.amazon.com/marketplace/pp/prodview-dymnyb6a2pq72), the [AWS Marketplace (BYOL)](https://aws.amazon.com/marketplace/pp/prodview-5somq325qrwss), the [Azure Marketplace]( https://azuremarketplace.microsoft.com/en-us/marketplace/apps/in4it.vpn-server), the [DigitalOcean Marketplace](https://marketplace.digitalocean.com/apps/vpn-server), the [GCP Marketplace](https://console.cloud.google.com/marketplace/product/in4it-public/vpn-server) or install the VPN manually. Personal use is allowed under BSL (Business Source License). ## Features diff --git a/provisioning/packer-amd64.pkr.hcl b/provisioning/packer-amd64.pkr.hcl index 0de15f2..5189d73 100644 --- a/provisioning/packer-amd64.pkr.hcl +++ b/provisioning/packer-amd64.pkr.hcl @@ -18,7 +18,17 @@ variable "ami_users" { locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") } -source "amazon-ebs" "autogenerated_1" { +data "amazon-ami" "ubuntu" { + filters = { + virtualization-type = "hvm" + name = "ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*" + root-device-type = "ebs" + } + owners = ["099720109477"] + most_recent = true +} + +source "amazon-ebs" "vpn-server" { ami_name = "in4it-vpn-server-${local.timestamp}" ami_users = var.ami_users instance_type = "m7a.medium" @@ -31,12 +41,12 @@ source "amazon-ebs" "autogenerated_1" { profile = "${var.aws_profile}" region = "us-east-1" ami_regions = ["eu-west-1"] - source_ami = "ami-0f2a1bb3c242fe285" + source_ami = data.amazon-ami.ubuntu.id ssh_username = "ubuntu" } build { - sources = ["source.amazon-ebs.autogenerated_1"] + sources = ["source.amazon-ebs.vpn-server"] provisioner "file" { destination = "/tmp/configmanager-linux-amd64" diff --git a/provisioning/scripts/install_vpn.sh b/provisioning/scripts/install_vpn.sh index 71a985f..e34fb85 100755 --- a/provisioning/scripts/install_vpn.sh +++ b/provisioning/scripts/install_vpn.sh @@ -1,8 +1,11 @@ #!/bin/bash -ARCHITECTURE=$(uname -m) +ARCHITECTURE=$(uname -m | sed s/x86_64/amd64/) if [ -e "/usr/bin/cloud-init" ] ; then cloud-init status --wait fi + +set -ex + apt-get -y update apt-get -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' full-upgrade apt-get install -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' wireguard diff --git a/webapp/README.md b/webapp/README.md deleted file mode 100644 index 0d43a1d..0000000 --- a/webapp/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Mantine Vite template - -Get started with the template by clicking `Use this template` button on the top of the page. - -[Documentation](https://mantine.dev/guides/vite/)