diff --git a/notify.pl b/notify.pl index 872543a..12ed107 100755 --- a/notify.pl +++ b/notify.pl @@ -35,6 +35,19 @@ my $function_variable = $ARGV[1] || "empty"; my $base_price = '64'; my %memory_prices = ('2G' => '10', '4G' => '30', '8G' => '70'); my %hdd_prices = ('50G' => '50', '100G' => '100', '150G' => '150', '200G' => '200'); +my %payment_links = ( + '44' => 'https://buy.stripe.com/28odR0aWK0jq0aAeV0', + '64' => 'https://buy.stripe.com/8wMaEO0i67LS1eE288', + '74' => 'https://buy.stripe.com/aEU5kuc0Ofek4qQ001', + '84' => 'https://buy.stripe.com/9AQ8wG8OCfek9LaaEI', + '94' => 'https://buy.stripe.com/3cs28i6GuaY4f5ueUZ', + '114' => 'https://buy.stripe.com/14k00ae8W2ryg9y28a', + '124' => 'https://buy.stripe.com/cN2fZ81mac28g9ydQT', + '134' => 'https://buy.stripe.com/28o4gq0i67LSe1q8wD', + '144' => 'https://buy.stripe.com/cN214ec0O1nuf5u6ow', + '184' => 'https://buy.stripe.com/9AQ8wGe8W0jq1eEdQZ', + '334' => 'https://buy.stripe.com/9AQfZ80i6gio8H64gq', +); # fuction to parse _deploy.conf and vm*.txt files # all variables are stripped and added to either %vms or %conf @@ -96,7 +109,7 @@ sub mailout { for my $vm_name (sort keys %vms) { my $_date = $vms{$vm_name}{'date'}; - my $_payment = $vms{$vm_name}{'payment'}; + my $_payment = $vms{$vm_name}{'payment'} || '0'; my $_subscription = $vms{$vm_name}{'subscription'} || "no"; my $_donated = $vms{$vm_name}{'donated'}; my $_name = $vms{$vm_name}{'name'}; @@ -106,9 +119,12 @@ sub mailout { my $_memory = $vms{$vm_name}{'memory'} || ''; my $_disk2 = $vms{$vm_name}{'disk2'} || ''; - my $memory_price = $memory_prices{$_memory} || '0'; - my $hdd_price = $hdd_prices{$_disk2} || '0'; - my $price = $base_price + $memory_price + $hdd_price; + if ($_payment == 0) { + my $memory_price = $memory_prices{$_memory} || '0'; + my $hdd_price = $hdd_prices{$_disk2} || '0'; + $_payment = $base_price + $memory_price + $hdd_price; + } + my $stripe = $payment_links{$_payment} || ''; (my $_firstname, my $_lastname) = split(/ /, $_name, 2); (my $_year, my $_month, my $_day) = split(/\//, $_date, 3); @@ -137,7 +153,7 @@ sub mailout { $row =~ s/TOTAL_VMS/$total_vms/g; $row =~ s/TOTAL_HOSTS/$total_hosts/g; $row =~ s/PAYMENT/$_payment/g; - $row =~ s/PRICE/$price/g; + $row =~ s/STRIPE/$stripe/g; if ($row =~ /TIME\((.*)\)/) { my @TIMES = split(/,/, $1); @@ -146,7 +162,7 @@ sub mailout { print $fh_email "$row\n"; } close $fh_email; - print "$function: $_date, $_payment ($price), $_name, $_email, $_hostname, $_server ($vm_name), $ip4address\n"; + print "$function: $_date, $_payment ($_payment), $_name, $_email, $_hostname, $_server ($vm_name), $ip4address\n"; } } diff --git a/templates/email-deployed.txt b/templates/email-deployed.txt index 874b8cc..10934db 100644 --- a/templates/email-deployed.txt +++ b/templates/email-deployed.txt @@ -1,5 +1,6 @@ -From: admin +From: Mischa Subject: OpenBSD Amsterdam +Bcc: mischa@high5.nl Content-Type: text/plain; charset=utf-8 Hi FIRSTNAME, @@ -17,8 +18,39 @@ Your IPv6 address: IPV6 Your IPv6 subnet: 64 Your IPv6 gateway: IPV6GW +You should be able to ssh into your VM. + The username you provided was: USERNAME -The price for the VM is €PRICE +You can also ssh into the host on port 31415 with the same username +and SSH key and use vmctl to manage your VM. + +More information to be found at: +https://openbsd.amsterdam/onboard.html +https://openbsd.amsterdam/backup.html + +It also includes a couple of known issues and work-arounds. +Especially have a look at the connectivity workaround with tmux. + +Your payment for the year is €PAYMENT. + +Stripe: STRIPE +iDEAL: https://bunq.me/openbsdams/PAYMENT/VMID%20SERVER +Paypal: https://paypal.me/runbsd/PAYMENTeur + +For all payment options, have a look at: +https://openbsd.amsterdam/pay.html + +Have fun! Mischa + +PS: When you are going to FDE your VM, keep in mind that we can not +start your VM. + +PPS: There is no need to run a Tor/I2P node. There are multiple +Tor/I2P nodes (relay and exit) in our infrastructure already. + +PPPS: You can follow us on https://bsd.network/@OpenBSDAms and +https://twitter.com/OpenBSDAms and would be great if you can share +your story there. diff --git a/templates/email-redeployed.txt b/templates/email-redeployed.txt index 710b28a..bdc26a4 100644 --- a/templates/email-redeployed.txt +++ b/templates/email-redeployed.txt @@ -1,5 +1,6 @@ -From: admin +From: Mischa Subject: OpenBSD Amsterdam +Bcc: mischa@high5.nl Content-Type: text/plain; charset=utf-8 Hi FIRSTNAME, @@ -17,4 +18,23 @@ Your IPv6 address: IPV6 Your IPv6 subnet: 64 Your IPv6 gateway: IPV6GW +You should be able to ssh into your VM again. +Keep in mind the host listens on port 31415. + +More information to be found at: +https://openbsd.amsterdam/onboard.html +https://openbsd.amsterdam/backup.html + +Have fun! + Mischa + +PS: When you are going to FDE your VM, keep in mind that we can not +start your VM. + +PPS: There is no need to run a Tor/I2P node. There are multiple +Tor/I2P nodes (relay and exit) in our infrastructure already. + +PPPS: You can follow us on https://bsd.network/@OpenBSDAms and +https://twitter.com/OpenBSDAms and would be great if you can share +your story there. diff --git a/templates/email-renewal.txt b/templates/email-renewal.txt index cb34795..2533f22 100644 --- a/templates/email-renewal.txt +++ b/templates/email-renewal.txt @@ -1,14 +1,42 @@ -From: admin -Subject: OpenBSD Amsterdam Renewal YEAR for VMID / SERVER +From: Mischa +Subject: OpenBSD Amsterdam Renewal YEAR for VMID / SERVER - Price Change Content-Type: text/plain; charset=utf-8 Hi FIRSTNAME, -Your renewal fee for VMID on SERVER this year is €PAYMENT. +First and foremost, we thank you for your continued support! +Can you believe another year has passed since you started with your +VM? -Total donated: TOTAL_DONATED -Total VMs deployed: TOTAL_VMS -Total hosts deployed: TOTAL_HOSTS +Since that time, your support has enabled us to reach the following +milestones: + +1) Donate €TOTAL_DONATED to the OpenBSD Foundation +2) Deploy TOTAL_VMS VMs +3) Deploy TOTAL_HOSTS hosts + +We really hope you have been happy with the service provided, if so, +please consider renewing now. You can find all the options to renew at: +https://openbsd.amsterdam/pay.html + +The unfortunate thing is that we are forced to increase our prices +with €4 per year due to the current state of the energy market. + +This means that your renewal fee for VMID on SERVER this year is €PAYMENT. + +Stripe: STRIPE +iDEAL: https://bunq.me/openbsdams/PAYMENT/VMID%20on%20SERVER +Paypal: https://paypal.me/runbsd/PAYMENTeur + +For all payment options, have a look at: +https://openbsd.amsterdam/pay.html + +For every renewal we will donate €15 to the OpenBSD Foundation. + +When you want to cancel your VM please let us know. + +In the last week of the month we will shutdown and remove VMs which +have not been renewed. Mischa diff --git a/templates/email-subscription.txt b/templates/email-subscription.txt index 4755194..9b81dba 100644 --- a/templates/email-subscription.txt +++ b/templates/email-subscription.txt @@ -1,16 +1,32 @@ -From: admin -Subject: OpenBSD Amsterdam Renewal YEAR +From: Mischa +Subject: OpenBSD Amsterdam Renewal YEAR for VMID / SERVER - Price Change Content-Type: text/plain; charset=utf-8 Hi FIRSTNAME, -Your renewal fee for VMID on SERVER this year is €PAYMENT. +First and foremost, we thank you for your continued support! +Can you believe another year has passed since you started with your +VM? -Total donated: TOTAL_DONATED -Total VMs deployed: TOTAL_VMS -Total hosts deployed: TOTAL_HOSTS +Since that time, your support has enabled us to reach the following +milestones: -Payment will be done automatically. +1) Donate €TOTAL_DONATED to the OpenBSD Foundation +2) Deploy TOTAL_VMS VMs +3) Deploy TOTAL_HOSTS hosts + +We really hope you have been happy with the service provided. + +The unfortunate thing is that we are forced to increase our prices +with €4 per year due to the current state of the energy market. + +This means that your renewal fee for VMID on SERVER this year is €PAYMENT. + +Since you have a subscription this will be done automatic. + +For every renewal we will donate €15 to the OpenBSD Foundation. + +If you want to cancel your VM please let us know. Mischa diff --git a/vms/vm01.txt b/vms/vm01.txt index 58109a8..9149657 100644 --- a/vms/vm01.txt +++ b/vms/vm01.txt @@ -1,8 +1,8 @@ mac="fe:e1:ab:dd:73:a4" ip="192.168.1.1" owner="testuser1" -date="2018/01/02" -payment="70" +date="2018/04/02" +payment="74" donated="" name="Test1 User" email="vm01@high5.nl" diff --git a/vms/vm02.txt b/vms/vm02.txt index 788e889..f75d2ee 100644 --- a/vms/vm02.txt +++ b/vms/vm02.txt @@ -1,5 +1,5 @@ -date="2018/02/02" -payment="70" +date="2018/04/02" +payment="" subscription="" donated="" name="Test2 User" diff --git a/vms/vm03.txt b/vms/vm03.txt index a669a76..b72d783 100644 --- a/vms/vm03.txt +++ b/vms/vm03.txt @@ -1,5 +1,5 @@ -date="2020/01/21" -payment="60" +date="2020/04/21" +payment="94" subscription="yes" donated="" name="Test3" diff --git a/vms/vm04.txt b/vms/vm04.txt index b6b721f..8953100 100644 --- a/vms/vm04.txt +++ b/vms/vm04.txt @@ -1,4 +1,4 @@ -date="2024/01/21" +date="2022/04/21" payment="sponsor" subscription="" donated="sponsor"