Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

Turn a fresh machine into an instance on first boot

04e063ca5d73b8f57f45d7c8bb07b0fdaa91b5b8 · Keenan Nemetz · 3d ago · parent ea21f923

Turn a fresh machine into an instance on first boot

A new instance is one package, one configuration, one directory, and one
account. Assembling that by hand is where a first deployment goes wrong:
the capability the hardened unit needs for ports 80 and 443, the order that
makes the package's own init harmless, and the fact that the first instance
admin has to be granted on the host.

deploy/cloud-init/vole.yaml is that assembly. It stages two configurations,
one that lets Vole hold its own certificate and one that leaves TLS to a
proxy, then installs the package, writes the configuration, creates the
instance admin, and starts the service. Running it again changes nothing.

render.sh renders it for providers that take user data without Terraform,
using the placeholder list as the contract with the template.

The three Terraform configurations create the machine, its firewall, its
address, and optionally the DNS record, and hand it that same file. They are
root modules: init and apply, three variables, no other file to edit.

First boot is not configuration management. apply does not upgrade an
instance or touch its data, because users.db migrates in place and cannot be
rolled back.

deploy/terraform/aws/outputs.tf +29

@@ -0,0 +1,29 @@
1 output "web_url" {
2 description = "Where the instance answers, and what public_url is set to."
3 value = "https://${var.domain}"
4 }
5
6 output "git_remote" {
7 description = "SSH address to clone from once a repository exists."
8 value = "ssh://git@${var.domain}:2222/"
9 }
10
11 output "public_ipv4" {
12 description = "The elastic address. Point your own DNS at this if create_dns is false."
13 value = aws_eip.vole.public_ip
14 }
15
16 output "admin_account" {
17 description = "The instance admin created at first boot. Sign in with the key you passed in."
18 value = var.admin_account
19 }
20
21 output "server_login" {
22 description = "Shell access to the machine, for repairs and backups. Vole's own Git SSH is on 2222."
23 value = "ssh -i <private-key> ubuntu@${aws_eip.vole.public_ip}"
24 }
25
26 output "dns_record" {
27 description = "The record created when create_dns is true."
28 value = var.create_dns ? "${var.domain} A ${aws_eip.vole.public_ip}" : "not managed here; point ${var.domain} at ${aws_eip.vole.public_ip}"
29 }