Add opengist

This commit is contained in:
Ian Keane 2026-09-17 17:08:48 -04:00
parent 1132834b76
commit b1ec7bbca7
7 changed files with 173 additions and 0 deletions

View file

@ -0,0 +1,5 @@
apiVersion: v2
name: opengist
description: OpenGist - self-hosted pastebin/gist service
type: application
version: 0.1.0

View file

@ -0,0 +1,22 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: opengist-secrets
namespace: opengist
annotations:
argocd.argoproj.io/sync-wave: "-1"
spec:
refreshInterval: 1h
secretStoreRef:
name: aws-secrets-manager
kind: ClusterSecretStore
target:
name: opengist-secrets
template:
data:
OG_DB_URI: "postgres://postgres:{{ `{{ .postgres_password }}` }}@postgres.postgres.svc.cluster.local:5432/opengist"
data:
- secretKey: postgres_password
remoteRef:
key: dumpnet
property: postgres.password

View file

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: opengist

View file

@ -0,0 +1,90 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: opengist
namespace: opengist
spec:
replicas: 1
selector:
matchLabels:
app: opengist
template:
metadata:
labels:
app: opengist
spec:
containers:
- name: opengist
image: "ghcr.io/thomiceli/opengist:1"
env:
- name: OG_GIT_DEFAULT_BRANCH
value: "main"
- name: OG_EXTERNAL_URL
value: "https://{{ .Values.gistSubdomain }}.{{ .Values.gistDomain }}"
envFrom:
- secretRef:
name: opengist-secrets
ports:
- name: http
containerPort: 6157
- name: ssh
containerPort: 2222
volumeMounts:
- name: data
mountPath: /opengist
readinessProbe:
httpGet:
path: /healthcheck
port: 6157
initialDelaySeconds: 5
livenessProbe:
httpGet:
path: /healthcheck
port: 6157
initialDelaySeconds: 15
volumes:
- name: data
hostPath:
path: /var/local/appdata/opengist
type: DirectoryOrCreate
---
apiVersion: v1
kind: Service
metadata:
name: opengist
namespace: opengist
spec:
selector:
app: opengist
ports:
- name: http
port: 80
targetPort: 6157
- name: ssh
port: 2222
targetPort: 2222
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: opengist
namespace: opengist
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
ingressClassName: nginx
tls:
- hosts:
- "{{ .Values.gistSubdomain }}.{{ .Values.gistDomain }}"
secretName: opengist-tls
rules:
- host: "{{ .Values.gistSubdomain }}.{{ .Values.gistDomain }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: opengist
port:
number: 80

View file

@ -0,0 +1,6 @@
domain: dumpnet.chat
gistDomain: keane.sh
gistSubdomain: gist
registry:
host: forge.keane.sh
user: ian

View file

@ -0,0 +1,33 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: opengist
namespace: argocd
spec:
project: default
sources:
- repoURL: https://forge.keane.sh/ian/dumpnet-argo.git
targetRevision: HEAD
path: charts/opengist
helm:
valueFiles:
- $values/values.yaml
- repoURL: https://forge.keane.sh/ian/dumpnet-argo.git
targetRevision: HEAD
ref: values
destination:
server: https://kubernetes.default.svc
namespace: opengist
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
ignoreDifferences:
- group: external-secrets.io
kind: ExternalSecret
jsonPointers:
- /spec/target/template/mergePolicy
- /spec/target/template/engineVersion
- /spec/target/template/type

13
terraform/opengist-dns.tf Normal file
View file

@ -0,0 +1,13 @@
# gist.keane.sh -> OpenGist, running on the same k8s cluster (different
# hosted zone than dumpnet.chat, so this is separate from dns_records/dns.tf)
data "aws_route53_zone" "keane_sh" {
name = "keane.sh"
}
resource "aws_route53_record" "opengist" {
zone_id = data.aws_route53_zone.keane_sh.zone_id
name = "gist.keane.sh"
type = "A"
ttl = 300
records = [aws_eip.controlplane.public_ip]
}