@yunuseon/kayra 0.0.0-stage → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +81 -2
- package/ansible/.ansible-lint +13 -0
- package/ansible/ansible.cfg +12 -0
- package/ansible/playbooks/adopt.yml +35 -0
- package/ansible/playbooks/app.yml +21 -0
- package/ansible/playbooks/apps-prune.yml +30 -0
- package/ansible/playbooks/edge.yml +41 -0
- package/ansible/playbooks/nas.yml +47 -0
- package/ansible/playbooks/platform.yml +62 -0
- package/ansible/requirements.yml +7 -0
- package/ansible/roles/app/defaults/main.yml +9 -0
- package/ansible/roles/app/tasks/main.yml +107 -0
- package/ansible/roles/app/templates/app.env.j2 +9 -0
- package/ansible/roles/app/templates/casc-app.yaml.j2 +68 -0
- package/ansible/roles/backup-check/files/backup-check.service +9 -0
- package/ansible/roles/backup-check/files/backup-check.timer +10 -0
- package/ansible/roles/backup-check/tasks/main.yml +59 -0
- package/ansible/roles/backup-check/templates/backup-check.sh.j2 +117 -0
- package/ansible/roles/common/handlers/main.yml +16 -0
- package/ansible/roles/common/tasks/main.yml +100 -0
- package/ansible/roles/compose-stacks/tasks/main.yml +102 -0
- package/ansible/roles/docker/defaults/main.yml +3 -0
- package/ansible/roles/docker/files/buildkit-rootless +23 -0
- package/ansible/roles/docker/handlers/main.yml +12 -0
- package/ansible/roles/docker/tasks/main.yml +82 -0
- package/ansible/roles/edge-proxy/files/docker-compose.yml +13 -0
- package/ansible/roles/edge-proxy/handlers/main.yml +6 -0
- package/ansible/roles/edge-proxy/tasks/main.yml +34 -0
- package/ansible/roles/edge-proxy/templates/Caddyfile.j2 +25 -0
- package/ansible/roles/forgejo-config/tasks/main.yml +333 -0
- package/ansible/roles/platform/defaults/main.yml +76 -0
- package/ansible/roles/platform/tasks/main.yml +298 -0
- package/ansible/roles/platform/templates/authelia-users.yml.j2 +17 -0
- package/ansible/roles/platform/templates/platform.env.j2 +41 -0
- package/ansible/roles/restic-backup/files/docker-compose.postgres.yml +27 -0
- package/ansible/roles/restic-backup/files/docker-compose.yml +12 -0
- package/ansible/roles/restic-backup/handlers/main.yml +7 -0
- package/ansible/roles/restic-backup/tasks/main.yml +121 -0
- package/ansible/roles/restic-backup/templates/backup.env.j2 +9 -0
- package/ansible/roles/restic-backup/templates/backup.sh.j2 +28 -0
- package/ansible/roles/restic-backup/templates/docker-compose.override.yml.j2 +26 -0
- package/ansible/roles/restic-backup/templates/follow-restore-test.sh.j2 +28 -0
- package/ansible/roles/restic-backup/templates/restore-test.sh.j2 +51 -0
- package/ansible/roles/restic-backup/templates/root.crontab.j2 +6 -0
- package/ansible/roles/restic-backup/templates/ssh_config.j2 +12 -0
- package/ansible/roles/wireguard/handlers/main.yml +9 -0
- package/ansible/roles/wireguard/tasks/main.yml +33 -0
- package/ansible/roles/wireguard/templates/wg0.conf.j2 +12 -0
- package/bin/kayra.js +29 -0
- package/cli/dist/brand.js +41 -0
- package/cli/dist/cli.js +21 -0
- package/cli/dist/commands/doctor.js +79 -0
- package/cli/dist/commands/server.js +215 -0
- package/cli/dist/commands/status.js +43 -0
- package/cli/dist/fleet.js +134 -0
- package/cli/dist/interpret.js +98 -0
- package/cli/dist/load.js +49 -0
- package/cli/dist/main.js +94 -0
- package/cli/dist/plan.js +31 -0
- package/cli/dist/result.js +5 -0
- package/cloud-init.yml.tpl +14 -0
- package/compose/authelia/configuration.yml +138 -0
- package/compose/buildkit/buildkitd.toml +14 -0
- package/compose/docker-compose.acme-dns.yml +12 -0
- package/compose/docker-compose.ci.yml +156 -0
- package/compose/docker-compose.yml +83 -0
- package/compose/jenkins/Dockerfile +40 -0
- package/compose/jenkins/casc/00-platform.yaml +158 -0
- package/compose/jenkins/plugins.txt +97 -0
- package/compose/jenkins-agent/Dockerfile +24 -0
- package/compose/traefik/dynamic/authelia.yml +18 -0
- package/compose/traefik/dynamic/middlewares.yml +14 -0
- package/compose/traefik/dynamic/ratelimit.yml +21 -0
- package/compose/traefik/dynamic/tls.yml +9 -0
- package/compose/traefik/traefik.yml +46 -0
- package/hosts.conf +6 -0
- package/package.json +73 -4
- package/scripts/local/app-manifests.sh +26 -0
- package/scripts/local/authelia-dev-init.sh +58 -0
- package/scripts/local/certs.sh +55 -0
- package/scripts/local/home-image.sh +55 -0
- package/scripts/local/home-reach.sh +41 -0
- package/scripts/local/require-main.sh +38 -0
- package/scripts/local/setup-hosts.sh +30 -0
- package/scripts/server/app-purge +26 -0
- package/scripts/server/app-remove +30 -0
- package/scripts/server/jenkins-api +28 -0
- package/scripts/server/jenkins-app-apply +36 -0
- package/scripts/server/jenkins-reload +12 -0
- package/terraform/modules/hcloud-firewall/main.tf +54 -0
- package/terraform/modules/hcloud-firewall/outputs.tf +9 -0
- package/terraform/modules/hcloud-firewall/variables.tf +22 -0
- package/terraform/modules/hcloud-server/main.tf +62 -0
- package/terraform/modules/hcloud-server/outputs.tf +19 -0
- package/terraform/modules/hcloud-server/templates/inventory.ini.tpl +5 -0
- package/terraform/modules/hcloud-server/variables.tf +50 -0
- package/terraform/modules/multipass-instance/main.tf +67 -0
- package/terraform/modules/multipass-instance/outputs.tf +19 -0
- package/terraform/modules/multipass-instance/templates/inventory.ini.tpl +5 -0
- package/terraform/modules/multipass-instance/variables.tf +39 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Multipass Instance Module
|
|
3
|
+
# Provisions a local VM via Multipass with the same cloud-init as production.
|
|
4
|
+
# Generates a dedicated, disposable SSH keypair for the instance — unlike
|
|
5
|
+
# the hcloud-server module, which expects the operator's own persistent key.
|
|
6
|
+
# =============================================================================
|
|
7
|
+
|
|
8
|
+
terraform {
|
|
9
|
+
required_providers {
|
|
10
|
+
multipass = {
|
|
11
|
+
source = "todoroff/multipass"
|
|
12
|
+
}
|
|
13
|
+
tls = {
|
|
14
|
+
source = "hashicorp/tls"
|
|
15
|
+
}
|
|
16
|
+
local = {
|
|
17
|
+
source = "hashicorp/local"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
resource "tls_private_key" "deploy" {
|
|
23
|
+
algorithm = "ED25519"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
resource "local_sensitive_file" "private_key" {
|
|
27
|
+
content = tls_private_key.deploy.private_key_openssh
|
|
28
|
+
filename = "${var.ssh_key_dir}/${var.name}_ed25519"
|
|
29
|
+
file_permission = "0600"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
resource "local_file" "public_key" {
|
|
33
|
+
content = tls_private_key.deploy.public_key_openssh
|
|
34
|
+
filename = "${var.ssh_key_dir}/${var.name}_ed25519.pub"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
# ---------------------------------------------------------------------------
|
|
38
|
+
# Instance
|
|
39
|
+
# ---------------------------------------------------------------------------
|
|
40
|
+
resource "multipass_instance" "this" {
|
|
41
|
+
name = var.name
|
|
42
|
+
image = var.image
|
|
43
|
+
cpus = var.cpus
|
|
44
|
+
memory = var.memory
|
|
45
|
+
disk = var.disk
|
|
46
|
+
|
|
47
|
+
cloud_init = templatefile("${path.module}/../../../cloud-init.yml.tpl", {
|
|
48
|
+
hostname = var.name
|
|
49
|
+
ssh_pubkey = tls_private_key.deploy.public_key_openssh
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
wait_for_cloud_init = true
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
# ---------------------------------------------------------------------------
|
|
56
|
+
# Ansible inventory file
|
|
57
|
+
# ---------------------------------------------------------------------------
|
|
58
|
+
resource "local_file" "ansible_inventory" {
|
|
59
|
+
content = templatefile("${path.module}/templates/inventory.ini.tpl", {
|
|
60
|
+
hostname = var.name
|
|
61
|
+
ssh_host = multipass_instance.this.ipv4[0]
|
|
62
|
+
ssh_port = 22
|
|
63
|
+
ssh_user = "deploy"
|
|
64
|
+
ssh_key_path = local_sensitive_file.private_key.filename
|
|
65
|
+
})
|
|
66
|
+
filename = var.inventory_path
|
|
67
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
output "ipv4_address" {
|
|
2
|
+
description = "Primary IPv4 address of the instance"
|
|
3
|
+
value = multipass_instance.this.ipv4[0]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
output "instance_name" {
|
|
7
|
+
description = "Multipass instance name"
|
|
8
|
+
value = multipass_instance.this.name
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
output "inventory_path" {
|
|
12
|
+
description = "Path to the generated Ansible inventory"
|
|
13
|
+
value = local_file.ansible_inventory.filename
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
output "ssh_private_key_path" {
|
|
17
|
+
description = "Path to the generated SSH private key"
|
|
18
|
+
value = local_sensitive_file.private_key.filename
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
variable "name" {
|
|
2
|
+
description = "Instance name"
|
|
3
|
+
type = string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
variable "image" {
|
|
7
|
+
description = "Multipass image alias"
|
|
8
|
+
type = string
|
|
9
|
+
default = "24.04"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
variable "cpus" {
|
|
13
|
+
description = "Virtual CPU count"
|
|
14
|
+
type = number
|
|
15
|
+
default = 2
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
variable "memory" {
|
|
19
|
+
description = "Memory size (e.g. 4G)"
|
|
20
|
+
type = string
|
|
21
|
+
default = "2G"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
variable "disk" {
|
|
25
|
+
description = "Disk size (e.g. 20G)"
|
|
26
|
+
type = string
|
|
27
|
+
default = "10G"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
variable "ssh_key_dir" {
|
|
31
|
+
description = "Directory to write the generated SSH keypair into"
|
|
32
|
+
type = string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
variable "inventory_path" {
|
|
36
|
+
description = "Path to write the Ansible inventory file"
|
|
37
|
+
type = string
|
|
38
|
+
default = "./inventory.ini"
|
|
39
|
+
}
|