Skip to content

Commit e15cdfd

Browse files
authored
Merge branch 'master' into master
2 parents 5b1801e + 346437f commit e15cdfd

File tree

9 files changed

+55
-33
lines changed

9 files changed

+55
-33
lines changed

Diff for: config.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ cloud_providers:
206206
image: Ubuntu 22.04 Jammy Jellyfish
207207
arch: x86_64
208208
hetzner:
209-
server_type: cx11
209+
server_type: cx22
210210
image: ubuntu-22.04
211211
openstack:
212212
flavor_ram: ">=512"
@@ -217,7 +217,7 @@ cloud_providers:
217217
disk: 10
218218
vultr:
219219
os: Ubuntu 22.04 LTS x64
220-
size: 1024 MB RAM,25 GB SSD,1.00 TB BW
220+
size: vc2-1c-1gb
221221
linode:
222222
type: g6-nanode-1
223223
image: linode/ubuntu22.04

Diff for: docs/cloud-amazon-ec2.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@ Creating an Amazon AWS account requires giving Amazon a phone number that can re
66

77
### Select an EC2 plan
88

9-
The cheapest EC2 plan you can choose is the "Free Plan" a.k.a. the "AWS Free Tier." It is only available to new AWS customers, it has limits on usage, and it converts to standard pricing after 12 months (the "introductory period"). After you exceed the usage limits, after the 12 month period, or if you are an existing AWS customer, then you will pay standard pay-as-you-go service prices.
9+
The cheapest EC2 plan you can choose is the "Free Plan" a.k.a. the ["AWS Free Tier"](https://aws.amazon.com/free/). It is only available to new AWS customers, it has limits on usage, and it converts to standard pricing after 12 months (the "introductory period"). After you exceed the usage limits, after the 12 month period, or if you are an existing AWS customer, then you will pay standard pay-as-you-go service prices.
1010

1111
*Note*: Your Algo instance will not stop working when you hit the bandwidth limit, you will just start accumulating service charges on your AWS account.
1212

1313
As of the time of this writing (July 2018), the Free Tier limits include "750 hours of Amazon EC2 Linux t2.micro instance usage" per month, 15 GB of bandwidth (outbound) per month, and 30 GB of cloud storage. Algo will not even use 1% of the storage limit, but you may have to monitor your bandwidth usage or keep an eye out for the email from Amazon when you are about to exceed the Free Tier limits.
1414

15+
If you are not eligible for the free tier plan or have passed the 12 months of the introductory period, you can switch to [AWS Graviton](https://aws.amazon.com/ec2/graviton/) instances that are generally cheaper. To use the graviton instances, make the following changes in the ec2 section of your `config.cfg` file:
16+
* Set the `size` to `t4g.nano`
17+
* Set the `arch` to `arm64`
18+
19+
> Currently, among all the instance sizes available on AWS, the t4g.nano instance is the least expensive option that does not require any promotional offers. However, AWS is currently running a promotion that provides a free trial of the `t4g.small` instance until December 31, 2023, which is available to all customers. For more information about this promotion, please refer to the [documentation](https://aws.amazon.com/ec2/faqs/#t4g-instances).
20+
1521
Additional configurations are documented in the [EC2 section of the deploy from ansible guide](https://github.com/trailofbits/algo/blob/master/docs/deploy-from-ansible.md#amazon-ec2)
1622

1723
### Create an AWS permissions policy
@@ -81,11 +87,11 @@ Next, you will be asked for the AWS Access Key (Access Key ID) and AWS Secret Ke
8187
Enter your aws_access_key (http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html)
8288
Note: Make sure to use an IAM user with an acceptable policy attached (see https://github.com/trailofbits/algo/blob/master/docs/deploy-from-ansible.md).
8389
[pasted values will not be displayed]
84-
[AKIA...]:
90+
[AKIA...]:
8591
8692
Enter your aws_secret_key (http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html)
8793
[pasted values will not be displayed]
88-
[ABCD...]:
94+
[ABCD...]:
8995
```
9096

9197
You will be prompted for the server name to enter. Feel free to leave this as the default ("algo") if you are not certain how this will affect your setup. Here we chose to call it "algovpn".
@@ -116,7 +122,7 @@ What region should the server be located in?
116122
14. us-east-2
117123
15. us-west-1
118124
16. us-west-2
119-
125+
120126
Enter the number of your desired region
121127
[13]
122128
:

Diff for: docs/deploy-from-cloudshell.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Deploy from Google Cloud Shell
2-
**IMPORTANT NOTE: As of 2021-12-14 Algo requires Python 3.8, but Google Cloud Shell only provides Python 3.7.3. The instructions below will not work until Google updates Cloud Shell to have at least Python 3.8.**
32

43
If you want to try Algo but don't wish to install the software on your own system, you can use the **free** [Google Cloud Shell](https://cloud.google.com/shell/) to deploy a VPN to any supported cloud provider. Note that you cannot choose `Install to existing Ubuntu server` to turn Google Cloud Shell into your VPN server.
54

Diff for: roles/cloud-hetzner/tasks/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
import_tasks: prompts.yml
77

88
- name: Create an ssh key
9-
hcloud_ssh_key:
9+
hetzner.hcloud.ssh_key:
1010
name: algo-{{ 999999 | random(seed=lookup('file', SSH_keys.public)) }}
1111
public_key: "{{ lookup('file', SSH_keys.public) }}"
1212
state: present
1313
api_token: "{{ algo_hcloud_token }}"
1414
register: hcloud_ssh_key
1515

1616
- name: Create a server...
17-
hcloud_server:
17+
hetzner.hcloud.server:
1818
name: "{{ algo_server_name }}"
1919
location: "{{ algo_hcloud_region }}"
2020
server_type: "{{ cloud_providers.hetzner.server_type }}"

Diff for: roles/cloud-hetzner/tasks/prompts.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
algo_hcloud_token: "{{ hcloud_token | default(_hcloud_token.user_input|default(None)) | default(lookup('env','HCLOUD_TOKEN'), true) }}"
1414

1515
- name: Get regions
16-
hcloud_datacenter_facts:
16+
hetzner.hcloud.datacenter_info:
1717
api_token: "{{ algo_hcloud_token }}"
1818
register: _hcloud_regions
1919

2020
- name: Set facts about the regions
2121
set_fact:
22-
hcloud_regions: "{{ hcloud_datacenter_facts | sort(attribute='location') }}"
22+
hcloud_regions: "{{ _hcloud_regions.hcloud_datacenter_info | sort(attribute='location') }}"
2323

2424
- name: Set default region
2525
set_fact:

Diff for: roles/cloud-vultr/tasks/main.yml

+14-12
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44

55
- block:
66
- name: Creating a firewall group
7-
vultr_firewall_group:
7+
vultr.cloud.firewall_group:
88
name: "{{ algo_server_name }}"
99

1010
- name: Creating firewall rules
11-
vultr_firewall_rule:
11+
vultr.cloud.firewall_rule:
1212
group: "{{ algo_server_name }}"
1313
protocol: "{{ item.protocol }}"
1414
port: "{{ item.port }}"
15-
ip_version: "{{ item.ip }}"
16-
cidr: "{{ item.cidr }}"
15+
ip_type: "{{ item.ip }}"
16+
subnet: "{{ item.cidr.split('/')[0] }}"
17+
subnet_size: "{{ item.cidr.split('/')[1] }}"
1718
with_items:
1819
- { protocol: tcp, port: "{{ ssh_port }}", ip: v4, cidr: 0.0.0.0/0 }
1920
- { protocol: tcp, port: "{{ ssh_port }}", ip: v6, cidr: "::/0" }
@@ -25,13 +26,13 @@
2526
- { protocol: udp, port: "{{ wireguard_port }}", ip: v6, cidr: "::/0" }
2627

2728
- name: Upload the startup script
28-
vultr_startup_script:
29+
vultr.cloud.startup_script:
2930
name: algo-startup
3031
script: |
3132
{{ lookup('template', 'files/cloud-init/base.yml') }}
3233
3334
- name: Creating a server
34-
vultr_server:
35+
vultr.cloud.instance:
3536
name: "{{ algo_server_name }}"
3637
startup_script: algo-startup
3738
hostname: "{{ algo_server_name }}"
@@ -40,17 +41,18 @@
4041
region: "{{ algo_vultr_region }}"
4142
firewall_group: "{{ algo_server_name }}"
4243
state: started
43-
tag: Environment:Algo
44-
ipv6_enabled: true
45-
auto_backup_enabled: false
46-
notify_activate: false
44+
tags:
45+
- Environment:Algo
46+
enable_ipv6: true
47+
backups: false
48+
activation_email: false
4749
register: vultr_server
4850

4951
- set_fact:
50-
cloud_instance_ip: "{{ vultr_server.vultr_server.v4_main_ip }}"
52+
cloud_instance_ip: "{{ vultr_server.vultr_instance.main_ip }}"
5153
ansible_ssh_user: algo
5254
ansible_ssh_port: "{{ ssh_port }}"
5355
cloudinit: true
5456

5557
environment:
56-
VULTR_API_CONFIG: "{{ algo_vultr_config }}"
58+
VULTR_API_KEY: "{{ lookup('ini', 'key', section='default', file=algo_vultr_config) }}"

Diff for: roles/cloud-vultr/tasks/prompts.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
What region should the server be located in?
4343
(https://www.vultr.com/locations/):
4444
{% for r in vultr_regions %}
45-
{{ loop.index }}. {{ r['name'] }}
45+
{{ loop.index }}. {{ r['name'] }} ({{ r['regioncode'] | lower }})
4646
{% endfor %}
4747
4848
Enter the number of your desired region
@@ -54,5 +54,5 @@
5454
set_fact:
5555
algo_vultr_region: >-
5656
{% if region is defined %}{{ region }}
57-
{%- elif _algo_region.user_input %}{{ vultr_regions[_algo_region.user_input | int -1 ]['name'] }}
58-
{%- else %}{{ vultr_regions[default_region | int - 1]['name'] }}{% endif %}
57+
{%- elif _algo_region.user_input %}{{ vultr_regions[_algo_region.user_input | int -1 ]['regioncode'] | lower }}
58+
{%- else %}{{ vultr_regions[default_region | int - 1]['regioncode'] | lower }}{% endif %}

Diff for: roles/strongswan/tasks/openssl.yml

+16
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,25 @@
155155
format: OpenSSH
156156
with_items: "{{ users }}"
157157

158+
- name: Get OpenSSL version
159+
shell: |
160+
set -o pipefail
161+
{{ openssl_bin }} version |
162+
cut -f 2 -d ' '
163+
args:
164+
executable: bash
165+
register: ssl_version
166+
run_once: true
167+
168+
- name: Set OpenSSL version fact
169+
set_fact:
170+
openssl_version: "{{ ssl_version.stdout }}"
171+
158172
- name: Build the client's p12
159173
shell: >
160174
umask 077;
161175
{{ openssl_bin }} pkcs12
176+
{{ (openssl_version is version('3', '>=')) | ternary('-legacy', '') }}
162177
-in certs/{{ item }}.crt
163178
-inkey private/{{ item }}.key
164179
-export
@@ -175,6 +190,7 @@
175190
shell: >
176191
umask 077;
177192
{{ openssl_bin }} pkcs12
193+
{{ (openssl_version is version('3', '>=')) | ternary('-legacy', '') }}
178194
-in certs/{{ item }}.crt
179195
-inkey private/{{ item }}.key
180196
-export

Diff for: users.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@
2525
set_fact:
2626
server_list: >-
2727
[{% for i in _configs_list.files %}
28-
{% set config = lookup('file', i.path)|from_yaml %}
29-
'{{ config.server }}'
30-
{{ ',' if not loop.last else '' }}
28+
{% set config = lookup('file', i.path) | from_yaml %}
29+
{{ {'server': config.server, 'IP_subject_alt_name': config.IP_subject_alt_name} }}
3130
{% endfor %}]
3231
3332
- name: Server address prompt
3433
pause:
3534
prompt: |
36-
Select the server to update user list below:
35+
Select the server to update user list below:
3736
{% for r in server_list %}
38-
{{ loop.index }}. {{ r }}
39-
{% endfor %}
37+
{{ loop.index }}. {{ r.server }} ({{ r.IP_subject_alt_name }})
38+
{% endfor %}
4039
register: _server
4140
when: server is undefined
4241

@@ -45,7 +44,7 @@
4544
set_fact:
4645
algo_server: >-
4746
{% if server is defined %}{{ server }}
48-
{%- elif _server.user_input %}{{ server_list[_server.user_input | int -1 ] }}
47+
{%- elif _server.user_input %}{{ server_list[_server.user_input | int -1 ].server }}
4948
{%- else %}omit{% endif %}
5049
5150
- name: Import host specific variables

0 commit comments

Comments
 (0)