Skip to content

Commit 80bfdd4

Browse files
committed
autobrrrrrrrrrrrrrr (#5628)
1 parent 44a8601 commit 80bfdd4

File tree

8 files changed

+180
-0
lines changed

8 files changed

+180
-0
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"explorer.autoReveal": true,
1313
"files.associations": {
1414
"**/*.json5": "json5",
15+
"**/*.tofu": "terraform",
1516
},
1617
"files.trimTrailingWhitespace": true,
1718
"material-icon-theme.files.associations": {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# yaml-language-server: $schema=https://kube-schemas.pages.dev/external-secrets.io/externalsecret_v1.json
3+
apiVersion: external-secrets.io/v1
4+
kind: ExternalSecret
5+
metadata:
6+
name: &name autobrr
7+
spec:
8+
refreshInterval: 5m
9+
secretStoreRef:
10+
kind: ClusterSecretStore
11+
name: onepassword
12+
target:
13+
name: *name
14+
template:
15+
data:
16+
AUTOBRR__SESSION_SECRET: "{{ .AUTOBRR_SESSION_SECRET }}"
17+
AUTOBRR__OIDC_ENABLED: "true"
18+
AUTOBRR__OIDC_ISSUER: https://sso.jory.dev/application/o/autobrr/
19+
AUTOBRR__OIDC_REDIRECT_URL: https://autobrr.jory.dev/api/auth/oidc/callback
20+
AUTOBRR__OIDC_DISABLE_BUILT_IN_LOGIN: "false"
21+
AUTOBRR__OIDC_CLIENT_ID: "{{ .AUTOBRR_CLIENT_ID }}"
22+
AUTOBRR__OIDC_CLIENT_SECRET: "{{ .AUTOBRR_CLIENT_SECRET }}"
23+
dataFrom:
24+
- extract:
25+
key: autobrr
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s-labs/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json
3+
apiVersion: helm.toolkit.fluxcd.io/v2
4+
kind: HelmRelease
5+
metadata:
6+
name: autobrr
7+
spec:
8+
chartRef:
9+
kind: OCIRepository
10+
name: app-template
11+
dependsOn: []
12+
interval: 15m
13+
values:
14+
controllers:
15+
autobrr:
16+
type: statefulset
17+
annotations:
18+
reloader.stakater.com/auto: "true"
19+
containers:
20+
app:
21+
image:
22+
repository: ghcr.io/autobrr/autobrr
23+
tag: v1.71.0@sha256:db9794958a0f9db93059c1e9f06193a063ce3846d346d7a7c9eca607c6617c51
24+
env:
25+
AUTOBRR__HOST: 0.0.0.0
26+
AUTOBRR__PORT: &port 80
27+
AUTOBRR__METRICS_ENABLED: true
28+
AUTOBRR__METRICS_HOST: 0.0.0.0
29+
AUTOBRR__METRICS_PORT: &metricsPort 9094
30+
AUTOBRR__CHECK_FOR_UPDATES: false
31+
AUTOBRR__LOG_LEVEL: INFO
32+
envFrom:
33+
- secretRef:
34+
name: "{{ .Release.Name }}"
35+
probes:
36+
liveness:
37+
enabled: true
38+
custom: true
39+
spec:
40+
httpGet:
41+
path: /api/healthz/liveness
42+
port: *port
43+
initialDelaySeconds: 0
44+
periodSeconds: 10
45+
timeoutSeconds: 1
46+
failureThreshold: 3
47+
readiness:
48+
enabled: true
49+
custom: true
50+
spec:
51+
httpGet:
52+
path: /api/healthz/readiness
53+
port: *port
54+
initialDelaySeconds: 0
55+
periodSeconds: 10
56+
timeoutSeconds: 1
57+
failureThreshold: 3
58+
securityContext:
59+
allowPrivilegeEscalation: false
60+
readOnlyRootFilesystem: true
61+
capabilities: {drop: ["ALL"]}
62+
resources:
63+
requests:
64+
cpu: 10m
65+
limits:
66+
memory: 256Mi
67+
defaultPodOptions:
68+
securityContext:
69+
runAsNonRoot: true
70+
runAsUser: 1000
71+
runAsGroup: 100
72+
fsGroup: 100
73+
fsGroupChangePolicy: OnRootMismatch
74+
service:
75+
app:
76+
ports:
77+
http:
78+
port: *port
79+
metrics:
80+
port: *metricsPort
81+
serviceMonitor:
82+
app:
83+
endpoints:
84+
- port: metrics
85+
route:
86+
app:
87+
hostnames: ["{{ .Release.Name }}.jory.dev"]
88+
parentRefs:
89+
- name: envoy-internal
90+
namespace: network
91+
persistence:
92+
config:
93+
existingClaim: "{{ .Release.Name }}"
94+
tmp:
95+
type: emptyDir
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
5+
resources:
6+
- ./externalsecret.yaml
7+
- ./helmrelease.yaml
8+
- ./prometheusrule.yaml
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
# yaml-language-server: $schema=https://kube-schemas.pages.dev/monitoring.coreos.com/prometheusrule_v1.json
3+
apiVersion: monitoring.coreos.com/v1
4+
kind: PrometheusRule
5+
metadata:
6+
name: autobrr
7+
spec:
8+
groups:
9+
- name: autobrr.rules
10+
rules:
11+
- alert: AutobrrNetworkUnmonitored
12+
expr: |-
13+
autobrr_irc_channel_enabled_total != autobrr_irc_channel_monitored_total
14+
for: 1h
15+
annotations:
16+
summary: >-
17+
{{ $labels.network }} is not being monitored by Autobrr
18+
labels:
19+
severity: critical
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# yaml-language-server: $schema=https://kube-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
3+
apiVersion: kustomize.toolkit.fluxcd.io/v1
4+
kind: Kustomization
5+
metadata:
6+
name: &app autobrr
7+
spec:
8+
components:
9+
- ../../../../components/volsync
10+
interval: 1h
11+
path: ./kubernetes/apps/base/downloads/autobrr
12+
postBuild:
13+
substitute:
14+
APP: *app
15+
CLUSTER: ${CLUSTER}
16+
prune: true
17+
sourceRef:
18+
kind: GitRepository
19+
name: flux-system
20+
namespace: flux-system
21+
wait: false

kubernetes/apps/main/downloads/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ components:
88
replacements:
99
- path: ../../../components/replacements/ks.yaml
1010
resources:
11+
- ./autobrr.yaml
1112
- ./bazarr.yaml
1213
# - ./cross-seed.yaml
1314
- ./flaresolverr.yaml

terraform/authentik/applications.tofu

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
locals {
22
oauth_apps = [
3+
"autobrr",
34
"Arcane",
45
"ErsatzTV",
56
"Grafana",
@@ -23,6 +24,15 @@ module "onepassword_application" {
2324

2425
locals {
2526
applications = {
27+
autobrr = {
28+
client_id = module.onepassword_application["autobrr"].fields["AUTOBRR_CLIENT_ID"]
29+
client_secret = module.onepassword_application["autobrr"].fields["AUTOBRR_CLIENT_SECRET"]
30+
group = "media"
31+
icon_url = "https://raw.githubusercontent.com/homarr-labs/dashboard-icons/main/png/autobrr.png"
32+
redirect_uri = "https://autobrr.${var.CLUSTER_DOMAIN}/api/auth/oidc/callback"
33+
launch_url = "https://autobrr.${var.CLUSTER_DOMAIN}"
34+
property_mappings = local.default_property_mappings
35+
},
2636
Arcane = {
2737
client_id = module.onepassword_application["Arcane"].fields["ARCANE_CLIENT_ID"]
2838
client_secret = module.onepassword_application["Arcane"].fields["ARCANE_CLIENT_SECRET"]

0 commit comments

Comments
 (0)