Skip to content

Commit 5860b11

Browse files
authored
feat: remote access for loopdedupe (#1664)
1 parent 8f96250 commit 5860b11

5 files changed

Lines changed: 52 additions & 0 deletions

File tree

tf/deployment/modules/shared/1password/account/secrets.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module "manual-secrets" {
5151
"IMMICH_GITHUB_OAUTH_APP_INTERNAL_FUTO_ZITADEL_CLIENT_ID",
5252
"IMMICH_GITHUB_OAUTH_APP_INTERNAL_FUTO_ZITADEL_CLIENT_SECRET",
5353
"FUTO_ZITADEL_PROFILE_JSON",
54+
"LOOPDEDUPE_GITHUB_WEBHOOK_URL",
5455
"LOOPDEDUPE_VOYAGE_API_KEY",
5556
]
5657
scoped = [
@@ -82,6 +83,7 @@ module "generated-secrets" {
8283
{ name = "OAUTH2_PROXY_COOKIE_SECRET", length = 32 },
8384
{ name = "IMMICH_GITHUB_ACTION_CHECKS_WEBHOOK_SECRET" },
8485
{ name = "OUTLINE_ROLE_SYNC_WEBHOOK_SECRET" },
86+
{ name = "LOOPDEDUPE_GITHUB_WEBHOOK_SECRET" },
8587
{ name = "LOOPDEDUPE_SECRET_KEY_BASE", length = 64 }
8688
]
8789
scoped = [

tf/deployment/modules/shared/cloudflare/account/dns-immich-cloud.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,24 @@ resource "cloudflare_record" "immich_cloud_a_mich" {
3434
zone_id = cloudflare_zone.immich_cloud.id
3535
}
3636

37+
resource "cloudflare_record" "immich_cloud_a_pokedex" {
38+
name = "pokedex"
39+
proxied = false
40+
ttl = 1
41+
type = "A"
42+
content = local.pokedex_ip
43+
zone_id = cloudflare_zone.immich_cloud.id
44+
}
45+
46+
resource "cloudflare_record" "immich_cloud_cname_loopdedupe_internal" {
47+
name = "loopdedupe.internal"
48+
proxied = false
49+
ttl = 1
50+
type = "CNAME"
51+
content = "pokedex.immich.cloud"
52+
zone_id = cloudflare_zone.immich_cloud.id
53+
}
54+
3755
resource "cloudflare_record" "immich_cloud_a_kube_pokedex_internal_brock" {
3856
name = "kube.pokedex.internal"
3957
proxied = false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
locals {
22
mich_ip = "162.55.19.222"
33
mich_cidrs = ["${local.mich_ip}/32"]
4+
5+
pokedex_ip = "97.77.242.206"
46
}

tf/deployment/modules/shared/github/webhooks/webhooks.tf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,27 @@ import {
7979
to = github_repository_webhook.fluxcd[0]
8080
id = "devtools/541139511"
8181
}
82+
83+
data "onepassword_item" "loopdedupe_webhook_url" {
84+
title = "LOOPDEDUPE_GITHUB_WEBHOOK_URL"
85+
vault = data.onepassword_vault.tf.name
86+
}
87+
88+
data "onepassword_item" "loopdedupe_webhook_secret" {
89+
title = "LOOPDEDUPE_GITHUB_WEBHOOK_SECRET"
90+
vault = data.onepassword_vault.tf.name
91+
}
92+
93+
resource "github_repository_webhook" "loopdedupe" {
94+
count = data.onepassword_item.loopdedupe_webhook_url.password != "REPLACE_ME" ? 1 : 0
95+
events = [
96+
"issues",
97+
"discussion"
98+
]
99+
repository = "immich"
100+
configuration {
101+
url = data.onepassword_item.loopdedupe_webhook_url.password
102+
secret = data.onepassword_item.loopdedupe_webhook_secret.password
103+
content_type = "json"
104+
}
105+
}

tf/deployment/modules/shared/zitadel/self-hosted/project.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ locals {
4747
roles = [{ key = "Granted", grants_to = ["immich_admin", "team"] }]
4848
redirectUris = ["https://oauth2-proxy.internal.immich.cloud/oauth2/callback"]
4949
},
50+
{
51+
name = "LoopDedupe"
52+
roles = [{ key = "Granted", grants_to = ["immich_admin", "team", "contributor", "support"] }]
53+
authMethod = "BASIC"
54+
redirectUris = ["https://loopdedupe.internal.immich.cloud/oauth2/callback"]
55+
},
5056
{
5157
name = "OVHCloud"
5258
protocol = "saml"

0 commit comments

Comments
 (0)