Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenschneider committed Sep 12, 2024
0 parents commit 739eb3c
Show file tree
Hide file tree
Showing 1,349 changed files with 34,910 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
version: 2
updates:
- package-ecosystem: "terraform"
directory: "/contrib/terraform/"
schedule:
interval: "daily"
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
36 changes: 36 additions & 0 deletions .github/workflows/diagrams.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Render Diagrams

on:

Check warning on line 4 in .github/workflows/diagrams.yaml

View workflow job for this annotation

GitHub Actions / yamllint

4:1 [truthy] truthy value should be one of [false, true]
push:
paths:
- '**.d2'

jobs:
render:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up D2
run: |
curl -fsSL https://d2lang.com/install.sh | sh -s --
- name: Run make generate
run: make diagrams

- name: Check for differences
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "Changes in diagrams detected"
git status
git diff
git config --global user.name 'diagrambot'
git config --global user.email '[email protected]'
git commit -am "Automated diagram"
git push
else
echo "No changes detected"
fi
30 changes: 30 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: "lint"
on:

Check warning on line 3 in .github/workflows/lint.yaml

View workflow job for this annotation

GitHub Actions / yamllint

3:1 [truthy] truthy value should be one of [false, true]
push:
branches:
- "master"
- "main"
pull_request: {}
workflow_dispatch: {}
jobs:
kube-linter:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- name: "Scan yamls"
id: "kube-lint-scan"
uses: "stackrox/kube-linter-action@v1"
with:
directory: "apps"
config: ".kube-linter.yaml"
yamllint:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- name: "Install yamllint"
run: |
pip install yamllint
- name: "Run yamllint"
run: |
yamllint .
29 changes: 29 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Pull Request Action
on:

Check warning on line 3 in .github/workflows/pr.yaml

View workflow job for this annotation

GitHub Actions / yamllint

3:1 [truthy] truthy value should be one of [false, true]
push:
branches:
- updates
jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Create Pull Request
uses: actions/[email protected]
with:
script: |
try {
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: '[Auto-generated] Update Container Image',
owner,
repo,
head: '${{ github.ref_name }}',
base: 'main',
body: [
'${{ github.event.head_commit.message }}'
].join('\n')
});
} catch(err) {
console.log(err);
}
31 changes: 31 additions & 0 deletions .github/workflows/security-scanners.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: "security-scanners"
on:

Check warning on line 3 in .github/workflows/security-scanners.yaml

View workflow job for this annotation

GitHub Actions / yamllint

3:1 [truthy] truthy value should be one of [false, true]
push:
branches:
- "master"
- "main"
pull_request: {}
workflow_dispatch: {}
jobs:
trivy:
name: "trivy"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- name: "Run Trivy vulnerability scanner in fs mode"
uses: "aquasecurity/trivy-action@master"
with:
scan-type: "fs"
scan-ref: "."
trivy-config: "trivy.yaml"
gitleaks:
name: "gitleaks"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
- uses: "gitleaks/gitleaks-action@v2"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/.terraform/*
*.tfstate
*.tfstate.*
*secret*.y*ml
!sops-*.y*ml
*.swp
/.idea
4 changes: 4 additions & 0 deletions .kube-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
checks:
exclude:
- "unset-cpu-requirements"
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
repos:
- repo: https://github.com/soerenschneider/pre-commit-hooks
rev: v1.5.1
hooks:
- id: yamllint
- id: gitleaks
39 changes: 39 additions & 0 deletions .trivyignore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
misconfigurations:
- id: "AVD-KSV-0011"
- id: "AVD-KSV-0012"
paths:
- "apps/vector/daemonset.yaml"
- id: "AVD-KSV-0014"
paths:
- "apps/keycloak/deployment.yaml"
- id: "AVD-KSV-0020"
paths:
- "apps/vector/daemonset.yaml"
- "apps/**/postgres-deployment.yaml"
- "apps/immich/components/pgvector/postgres-sts.yaml"
- "apps/paperless-ngx/paperless-ngx-deployment.yaml"
- "apps/keycloak/deployment.yaml" # errors if not running as 1000

Check warning on line 16 in .trivyignore.yaml

View workflow job for this annotation

GitHub Actions / yamllint

16:41 [comments] too few spaces before comment
- id: "AVD-KSV-0021"
paths:
- "apps/vector/daemonset.yaml"
- "apps/**/postgres-deployment.yaml"
- "apps/paperless-ngx/paperless-ngx-deployment.yaml"
- "apps/immich/components/pgvector/postgres-sts.yaml"
- "apps/keycloak/deployment.yaml" # errors if not running as 1000

Check warning on line 23 in .trivyignore.yaml

View workflow job for this annotation

GitHub Actions / yamllint

23:41 [comments] too few spaces before comment
- id: "AVD-KSV-0023"
paths:
- "apps/vector/daemonset.yaml"
- id: "AVD-KSV-0048"
paths:
- "apps/reloader/components/rbac/clusterrole.yaml"
- id: "AVD-KSV-0041"
paths:
- "apps/reloader/components/rbac/clusterrole.yaml"
- id: "AVD-KSV-0109"
paths:
- "clusters/common/taskd/configmap-ca.yaml"
- id: "AVD-KSV-01010"
paths:
- "**/taskwarrior-configmap.yaml" # false positive

Check warning on line 38 in .trivyignore.yaml

View workflow job for this annotation

GitHub Actions / yamllint

38:41 [comments] too few spaces before comment
- "apps/mariadb-galera/components/tls-wsrep/cm-sst-cnf.yaml" # false positive

Check warning on line 39 in .trivyignore.yaml

View workflow job for this annotation

GitHub Actions / yamllint

39:68 [comments] too few spaces before comment
6 changes: 6 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
extends: default
rules:
line-length: disable
ignore:
- "*sops*.yaml"
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: diagrams
diagrams:
find diagrams -iname '*.d2' -print0 | xargs -0 -I {} d2 "{}"

pre-commit-init:
pre-commit install
pre-commit install --hook-type commit-msg

pre-commit-update:
pre-commit autoupdate
82 changes: 82 additions & 0 deletions apps/acmevault/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: acmevault
labels:
app: acmevault
app.kubernetes.io/name: acmevault
app.kubernetes.io/instance: acmevault-prod
annotations:
reloader.stakater.com/auto: "true"
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: acmevault
template:
metadata:
labels:
app: acmevault
app.kubernetes.io/name: acmevault
app.kubernetes.io/instance: acmevault-prod
annotations:
prometheus.io/port: "9191"
prometheus.io/scrape: "true"
spec:
securityContext:
runAsUser: 65535
runAsGroup: 65535
fsGroup: 65535
runAsNonRoot: true
seccompProfile:
type: "RuntimeDefault"
containers:
- name: acmevault
image: "ghcr.io/soerenschneider/acmevault:1.14.0"
imagePullPolicy: "IfNotPresent"
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
privileged: false
runAsNonRoot: true
runAsUser: 65535
runAsGroup: 65535
capabilities:
drop:
- "ALL"
seccompProfile:
type: "RuntimeDefault"
command:
- "/acmevault"
- "-config"
- "/config/acmevault-config.yaml"
ports:
- containerPort: 9191
name: "metrics"
env:
- name: "AWS_REGION"
value: "us-east-1"
resources:
requests:
memory: "32Mi"
cpu: "5m"
limits:
memory: "128Mi"
volumeMounts:
- name: "config-volume"
mountPath: "/config"
volumes:
- name: "config-volume"
configMap:
name: "config"
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
preference:
matchExpressions:
- key: "cpu_speed"
operator: "NotIn"
values:
- "fast"
6 changes: 6 additions & 0 deletions apps/acmevault/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: "kustomize.config.k8s.io/v1beta1"
kind: "Kustomization"
resources:
- "deployment.yaml"
- "networkpolicy.yaml"
42 changes: 42 additions & 0 deletions apps/acmevault/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: acmevault
spec:
podSelector:
matchLabels:
app: acmevault
policyTypes:
- Egress
- Ingress
ingress:
- ports:
- protocol: TCP
port: metrics
from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: monitoring
podSelector:
matchLabels:
app: prometheus
egress:
- ports:
- port: 443
protocol: TCP
- port: 8200
protocol: TCP
- ports:
- port: 53
protocol: TCP
- port: 53
protocol: UDP
- to:
- namespaceSelector: {}
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- port: 53
protocol: UDP
41 changes: 41 additions & 0 deletions apps/actualbudget/components/istio-proxy/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
apiVersion: "kustomize.config.k8s.io/v1alpha1"
kind: "Component"
patches:
- target:
kind: "Namespace"
patch: |-
- op: add
path: "/metadata/labels/istio-injection"
value: "enabled"
- target:
kind: "NetworkPolicy"
patch: |-
- op: add
path: "/spec/egress/-"
value:
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
- op: add
path: "/spec/egress/-"
value:
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: istio-system
podSelector: {}
ports:
- port: 15012
protocol: TCP
- port: 15014
protocol: TCP
Loading

0 comments on commit 739eb3c

Please sign in to comment.